drm/nouveau: use ALIGN instead of open coding it
authorMatt Turner <mattst88@gmail.com>
Thu, 25 Feb 2010 04:27:10 +0000 (23:27 -0500)
committerBen Skeggs <bskeggs@redhat.com>
Thu, 25 Feb 2010 05:09:46 +0000 (15:09 +1000)
CC: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nv04_fbcon.c
drivers/gpu/drm/nouveau/nv50_fbcon.c
drivers/gpu/drm/nouveau/nv50_instmem.c

index fd01caabd5c3aee9efbc93bda38b3707adb14a84..3da90c2c4e634910eba368bdb691bf9684cd5b95 100644 (file)
@@ -118,7 +118,7 @@ nv04_fbcon_imageblit(struct fb_info *info, const struct fb_image *image)
                return;
        }
 
-       width = (image->width + 31) & ~31;
+       width = ALIGN(image->width, 32);
        dsize = (width * image->height) >> 5;
 
        if (info->fix.visual == FB_VISUAL_TRUECOLOR ||
index 0f57cdf7ccb23dd22ed70d581247f23e14db6596..993c7126fbded104b6ed3a16cac2e5f07f757474 100644 (file)
@@ -109,7 +109,7 @@ nv50_fbcon_imageblit(struct fb_info *info, const struct fb_image *image)
                return;
        }
 
-       width = (image->width + 31) & ~31;
+       width = ALIGN(image->width, 32);
        dwords = (width * image->height) >> 5;
 
        BEGIN_RING(chan, NvSub2D, 0x0814, 2);
index f0dc4e36ef055c7d711eaf1a54a501d41bbce2d2..de1f5b0062c551c3f9480aa0efeb326634f3f635 100644 (file)
@@ -390,7 +390,7 @@ nv50_instmem_populate(struct drm_device *dev, struct nouveau_gpuobj *gpuobj,
        if (gpuobj->im_backing)
                return -EINVAL;
 
-       *sz = (*sz + (NV50_INSTMEM_PAGE_SIZE-1)) & ~(NV50_INSTMEM_PAGE_SIZE-1);
+       *sz = ALIGN(*sz, NV50_INSTMEM_PAGE_SIZE);
        if (*sz == 0)
                return -EINVAL;