diff options
author | Kevin Huang <kevinh@nvidia.com> | 2011-06-06 14:16:54 -0700 |
---|---|---|
committer | Varun Colbert <vcolbert@nvidia.com> | 2011-07-07 18:55:05 -0700 |
commit | fa573b2c78562b60c3fd8ae95317f5819431ea35 (patch) | |
tree | 9c97f9b1688ddc4f3865badbf870e77a252000ae | |
parent | 2f3eef1667a1aa977fab117d5a8c1e087fd75a01 (diff) |
video: tegra: Aligned the stride of fb to 16-byte boundary.
Aligned memory can improve the performance memory access. Also,
since the bootloader fb is aligned, kernel needs to do it to avoid
skew.
Change-Id: Ia5a122539856da9e9c73580929b8ea9c73e86c9d
Reviewed-on: http://git-master/r/35276
Reviewed-by: Varun Colbert <vcolbert@nvidia.com>
Tested-by: Varun Colbert <vcolbert@nvidia.com>
-rw-r--r-- | drivers/video/tegra/fb.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/video/tegra/fb.c b/drivers/video/tegra/fb.c index 2954661a4064..2d40e22a697e 100644 --- a/drivers/video/tegra/fb.c +++ b/drivers/video/tegra/fb.c @@ -43,6 +43,9 @@ #include "nvmap/nvmap.h" #include "dc/dc_priv.h" +/* Pad pitch to 16-byte boundary. */ +#define TEGRA_LINEAR_PITCH_ALIGNMENT 16 + struct tegra_fb_info { struct tegra_dc_win *win; struct nvhost_device *ndev; @@ -169,7 +172,9 @@ static int tegra_fb_set_par(struct fb_info *info) return -EINVAL; } info->fix.line_length = var->xres * var->bits_per_pixel / 8; - tegra_fb->win->stride = info->fix.line_length; + /* Pad the stride to 16-byte boundary. */ + tegra_fb->win->stride = round_up(info->fix.line_length, + TEGRA_LINEAR_PITCH_ALIGNMENT); tegra_fb->win->stride_uv = 0; tegra_fb->win->offset_u = 0; tegra_fb->win->offset_v = 0; @@ -832,6 +837,8 @@ struct tegra_fb_info *tegra_fb_register(struct nvhost_device *ndev, win->offset_u = 0; win->offset_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_uv = 0; win->flags = TEGRA_WIN_FLAG_ENABLED; |