drm/nouveau: use ALIGN instead of open coding it
Subsystems (4)
PATCH 1/1 drm/nouveau: use ALIGN instead of open coding it
CC Ben Skeggs <[email protected]>
Signed-off-by Matt Turner <[email protected]>
--- drivers/gpu/drm/nouveau/nv04_fbcon.c | 2 +- drivers/gpu/drm/nouveau/nv50_fbcon.c | 2 +- drivers/gpu/drm/nouveau/nv50_instmem.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/nouveau/nv04_fbcon.c +1 -1
@@ -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 ||
drivers/gpu/drm/nouveau/nv50_fbcon.c +1 -1
@@ -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 );
drivers/gpu/drm/nouveau/nv50_instmem.c +1 -1
@@ -373,7 +373,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 ;
Signature · 1 line
1.6.4.4
A message that is not in the archive (sent off-list or not yet received): 1267072030-23176-1-git-send-email-mattst88-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Quoted 7 lines · Matt Turner
CC Ben Skeggs <[email protected]>Signed-off-by Matt Turner <[email protected]>--- drivers/gpu/drm/nouveau/nv04_fbcon.c | 2 +- drivers/gpu/drm/nouveau/nv50_fbcon.c | 2 +- drivers/gpu/drm/nouveau/nv50_instmem.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
Thank you, in nouveau git.
Ben.
Quoted 40 lines
drivers/gpu/drm/nouveau/nv04_fbcon.c +1
-1@@ -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 ||drivers/gpu/drm/nouveau/nv50_fbcon.c +1
-1@@ -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 );drivers/gpu/drm/nouveau/nv50_instmem.c +1
-1@@ -373,7 +373,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 ;