summaryrefslogtreecommitdiff
path: root/drivers/video/tegra
diff options
context:
space:
mode:
authorChristopher Freeman <cfreeman@nvidia.com>2012-08-27 17:36:15 -0700
committerLokesh Pathak <lpathak@nvidia.com>2012-08-29 02:54:31 -0700
commit7162d051308f53063470412cb2955f12e1f56a1c (patch)
treea87ad48c51bfd5e9e5e2acf94d61a23b11d1013d /drivers/video/tegra
parentfb1ba1236a57894c13b92d0497a9dd23d02f6ed9 (diff)
video: tegra: fb: Default stride from HW
This patch adds: 1. line_stride value is honored in fb_set_par routine 2. Hardware value for line_stride is used in fb_register Bug 1025739 Change-Id: Ic37c4c90911c2c70e74b8d5609f3b32b521772ff Signed-off-by: Christopher Freeman <cfreeman@nvidia.com> Reviewed-on: http://git-master/r/127690 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Kevin Huang (Eng-SW) <kevinh@nvidia.com> Reviewed-by: Jon Mayo <jmayo@nvidia.com>
Diffstat (limited to 'drivers/video/tegra')
-rw-r--r--drivers/video/tegra/fb.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/video/tegra/fb.c b/drivers/video/tegra/fb.c
index 007d713..a996494 100644
--- a/drivers/video/tegra/fb.c
+++ b/drivers/video/tegra/fb.c
@@ -122,10 +122,13 @@ static int tegra_fb_set_par(struct fb_info *info)
default:
return -EINVAL;
}
- info->fix.line_length = var->xres * var->bits_per_pixel / 8;
- /* Pad the stride to 16-byte boundary. */
- info->fix.line_length = round_up(info->fix.line_length,
+ /* 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);
+ }
tegra_fb->win->stride = info->fix.line_length;
tegra_fb->win->stride_uv = 0;
tegra_fb->win->phys_addr_u = 0;
@@ -516,8 +519,10 @@ 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 to 16-byte boundary. */
+ if (!stride) /* default to pad the stride */
stride = round_up(info->fix.line_length,
TEGRA_LINEAR_PITCH_ALIGNMENT);
@@ -534,7 +539,6 @@ 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;
info->fix.line_length = stride;
info->var.xres = fb_data->xres;