]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
drm/radeon/kms: align height of fb allocation.
authorDave Airlie <airlied@redhat.com>
Fri, 18 Feb 2011 05:51:57 +0000 (15:51 +1000)
committerDave Airlie <airlied@redhat.com>
Wed, 23 Feb 2011 00:08:17 +0000 (10:08 +1000)
this aligns the height of the fb allocation so it doesn't trip
over the size checks later when we use this from userspace to
copy the buffer at X start.

Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/radeon/radeon_fb.c

index 66324b5bb5ba0f038f393f1a4464514c41159ca9..cc44bdfec80f2239a2d07bdf88ab2bc7ac1b53e1 100644 (file)
@@ -113,11 +113,14 @@ static int radeonfb_create_pinned_object(struct radeon_fbdev *rfbdev,
        u32 tiling_flags = 0;
        int ret;
        int aligned_size, size;
+       int height = mode_cmd->height;
 
        /* need to align pitch with crtc limits */
        mode_cmd->pitch = radeon_align_pitch(rdev, mode_cmd->width, mode_cmd->bpp, fb_tiled) * ((mode_cmd->bpp + 1) / 8);
 
-       size = mode_cmd->pitch * mode_cmd->height;
+       if (rdev->family >= CHIP_R600)
+               height = ALIGN(mode_cmd->height, 8);
+       size = mode_cmd->pitch * height;
        aligned_size = ALIGN(size, PAGE_SIZE);
        ret = radeon_gem_object_create(rdev, aligned_size, 0,
                                       RADEON_GEM_DOMAIN_VRAM,