CHROMIUM: drm/exynos: fbdev: Don't recompute fb size in fbdev_update
authorDaniel Kurtz <djkurtz@chromium.org>
Thu, 3 Jan 2013 03:14:21 +0000 (11:14 +0800)
committerChromeBot <chrome-bot@google.com>
Sat, 12 Jan 2013 01:26:16 +0000 (17:26 -0800)
The size variable in fbdev_update is used to set the amount of mapped RAM
needed for the framebuffer.  Thus, it is not just the number of pixels
times the bpp; it could be significantly more due to line length cache
alignment and other padding.

Thus, get the size from the gem object itself instead of computing it.

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
BUG=none
TEST=splash screen displays correctly w/ no HDMI
TEST=splash screen displays correctly w/ HDMI

Change-Id: I7df74770d49931f98ebd62d71178755a83d6db57
Reviewed-on: https://gerrit.chromium.org/gerrit/40445
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Commit-Queue: Daniel Kurtz <djkurtz@chromium.org>
Tested-by: Daniel Kurtz <djkurtz@chromium.org>
drivers/gpu/drm/exynos/exynos_drm_fbdev.c

index 7293516..30b4e80 100644 (file)
@@ -82,7 +82,8 @@ static void exynos_drm_fbdev_update(struct drm_fb_helper *helper,
        struct fb_info *fbi = helper->fbdev;
        struct drm_device *dev = helper->dev;
        struct exynos_drm_gem_buf *buffer = exynos_gem_obj->buffer;
-       unsigned int size = fb->width * fb->height * (fb->bits_per_pixel >> 3);
+       struct drm_gem_object *drm_gem_object = &exynos_gem_obj->base;
+       size_t size = drm_gem_object->size;
 
        DRM_DEBUG_KMS("%s\n", __FILE__);