From ed4577d35d37ee96fa7d37ed87882d8ce84d1692 Mon Sep 17 00:00:00 2001 From: Joseph Lehrer Date: Mon, 3 Oct 2011 16:25:53 -0700 Subject: video: tegra: set fb line_length to physical pitch bug 867222 Change-Id: I782620ac5f9cc633b52bc525fecbdf56cef23002 Reviewed-on: http://git-master/r/54351 Reviewed-by: Varun Colbert Tested-by: Varun Colbert Rebase-Id: R4df4ce6e36fa490ffad3233c1a7b09330c2a6f74 --- drivers/video/tegra/fb.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'drivers/video/tegra/fb.c') diff --git a/drivers/video/tegra/fb.c b/drivers/video/tegra/fb.c index 72176b7e99a5..7b01f1ef72a2 100644 --- a/drivers/video/tegra/fb.c +++ b/drivers/video/tegra/fb.c @@ -108,8 +108,9 @@ static int tegra_fb_set_par(struct fb_info *info) } info->fix.line_length = var->xres * var->bits_per_pixel / 8; /* Pad the stride to 16-byte boundary. */ - tegra_fb->win->stride = round_up(info->fix.line_length, + info->fix.line_length = round_up(info->fix.line_length, TEGRA_LINEAR_PITCH_ALIGNMENT); + tegra_fb->win->stride = info->fix.line_length; tegra_fb->win->stride_uv = 0; tegra_fb->win->phys_addr_u = 0; tegra_fb->win->phys_addr_v = 0; @@ -410,6 +411,10 @@ struct tegra_fb_info *tegra_fb_register(struct nvhost_device *ndev, info->fix.accel = FB_ACCEL_NONE; info->fix.smem_start = fb_phys; info->fix.smem_len = fb_size; + info->fix.line_length = fb_data->xres * fb_data->bits_per_pixel / 8; + /* Pad the stride to 16-byte boundary. */ + info->fix.line_length = round_up(info->fix.line_length, + TEGRA_LINEAR_PITCH_ALIGNMENT); info->var.xres = fb_data->xres; info->var.yres = fb_data->yres; @@ -442,9 +447,7 @@ struct tegra_fb_info *tegra_fb_register(struct nvhost_device *ndev, win->virt_addr = fb_base; win->phys_addr_u = 0; win->phys_addr_v = 0; - win->stride = fb_data->xres * fb_data->bits_per_pixel / 8; - /* Pad the stride to 16-byte boundary. */ - win->stride = round_up(win->stride, TEGRA_LINEAR_PITCH_ALIGNMENT); + win->stride = info->fix.line_length; win->stride_uv = 0; win->flags = TEGRA_WIN_FLAG_ENABLED; -- cgit v1.2.3