arm: tegra: fb: Update line_length using display width
Jong Kim [Thu, 13 Dec 2012 00:26:53 +0000 (16:26 -0800)]
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 <jongk@nvidia.com>
Reviewed-on: http://git-master/r/170664
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Winnie Hsu <whsu@nvidia.com>

drivers/video/tegra/fb.c

index 59c162b..46cbabf 100644 (file)
@@ -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;