From 83009bd159cfc34e30fdf0add82722d09ad92556 Mon Sep 17 00:00:00 2001 From: Jong Kim Date: Wed, 12 Dec 2012 16:26:53 -0800 Subject: arm: tegra: fb: Update line_length using display width Unconditionally update line_length using disply width to avoid discrepancy between line_length and actual display width. bug 1186388 Change-Id: I8ef2f9cf76a61764c2121f3c2c013b72b830ce2e Signed-off-by: Jong Kim Reviewed-on: http://git-master/r/170664 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Winnie Hsu --- drivers/video/tegra/fb.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'drivers') diff --git a/drivers/video/tegra/fb.c b/drivers/video/tegra/fb.c index 59c162bb3b4c..46cbabfe73f0 100644 --- a/drivers/video/tegra/fb.c +++ b/drivers/video/tegra/fb.c @@ -126,12 +126,9 @@ static int tegra_fb_set_par(struct fb_info *info) return -EINVAL; } /* if line_length unset, then pad the stride */ - if (!info->fix.line_length) { - info->fix.line_length = var->xres * var->bits_per_pixel - / 8; - info->fix.line_length = round_up(info->fix.line_length, - TEGRA_LINEAR_PITCH_ALIGNMENT); - } + info->fix.line_length = var->xres * var->bits_per_pixel / 8; + 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; @@ -649,12 +646,8 @@ struct tegra_fb_info *tegra_fb_register(struct nvhost_device *ndev, tegra_fb->valid = true; } - info->fix.line_length = fb_data->xres * fb_data->bits_per_pixel / 8; - - stride = tegra_dc_get_stride(dc, 0); - if (!stride) /* default to pad the stride */ - stride = round_up(info->fix.line_length, - TEGRA_LINEAR_PITCH_ALIGNMENT); + stride = fb_data->xres * fb_data->bits_per_pixel / 8; + stride = round_up(stride, TEGRA_LINEAR_PITCH_ALIGNMENT); info->fbops = &tegra_fb_ops; info->pseudo_palette = pseudo_palette; -- cgit v1.2.3