]> err.no Git - linux-2.6/commitdiff
[PATCH] drm: another mga bug
authorDave Airlie <airlied@linux.ie>
Thu, 20 Oct 2005 22:49:00 +0000 (23:49 +0100)
committerLinus Torvalds <torvalds@g5.osdl.org>
Fri, 21 Oct 2005 19:18:09 +0000 (12:18 -0700)
The wrong state emission routines were being called for G550, and
consistent maps weren't correctly mapped...

Signed-off-by: Dave Airlie <airlied@linux.ie>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/char/drm/drm_vm.c
drivers/char/drm/mga_drv.h
drivers/char/drm/mga_state.c

index ced4215e2275e71dad67a2db787054bb03bfc12f..39ea96e42c5bdee37f10698864f43a4d6e5dda1c 100644 (file)
@@ -148,7 +148,8 @@ static __inline__ struct page *drm_do_vm_shm_nopage(struct vm_area_struct *vma,
 
        offset   = address - vma->vm_start;
        i = (unsigned long)map->handle + offset;
-       page = vmalloc_to_page((void *)i);
+       page = (map->type == _DRM_CONSISTENT) ?
+               virt_to_page((void *)i) : vmalloc_to_page((void *)i);
        if (!page)
                return NOPAGE_OOM;
        get_page(page);
index b22fdbd4f830b561d058584383d107d42468144b..6059c5a5b10516c0ddf5e48892a5b5cb43e39913 100644 (file)
@@ -227,7 +227,7 @@ static inline u32 _MGA_READ(u32 *addr)
 #define MGA_EMIT_STATE( dev_priv, dirty )                              \
 do {                                                                   \
        if ( (dirty) & ~MGA_UPLOAD_CLIPRECTS ) {                        \
-               if ( dev_priv->chipset == MGA_CARD_TYPE_G400 ) {        \
+               if ( dev_priv->chipset >= MGA_CARD_TYPE_G400 ) {        \
                        mga_g400_emit_state( dev_priv );                \
                } else {                                                \
                        mga_g200_emit_state( dev_priv );                \
index 05bbb4719376ac9fe1f424f8633d29a5643c2005..6ac5e006226f068033d304a2673df335c3a65c2d 100644 (file)
@@ -53,7 +53,7 @@ static void mga_emit_clip_rect( drm_mga_private_t *dev_priv,
 
        /* Force reset of DWGCTL on G400 (eliminates clip disable bit).
         */
-       if (dev_priv->chipset == MGA_CARD_TYPE_G400) {
+       if (dev_priv->chipset >= MGA_CARD_TYPE_G400) {
                DMA_BLOCK(MGA_DWGCTL, ctx->dwgctl,
                          MGA_LEN + MGA_EXEC, 0x80000000,
                          MGA_DWGCTL, ctx->dwgctl,