Skip to content

Commit

Permalink
drm/tegra: fb: Properly support linear modifier
Browse files Browse the repository at this point in the history
Instead of relying on the tiling attached to a buffer object, make sure
to set the proper tiling for linear buffers.

Signed-off-by: Thierry Reding <treding@nvidia.com>
  • Loading branch information
Thierry Reding committed Mar 15, 2018
1 parent e90124c commit 4ae4b5c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions drivers/gpu/drm/tegra/fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ int tegra_fb_get_tiling(struct drm_framebuffer *framebuffer,
uint64_t modifier = fb->base.modifier;

switch (modifier) {
case DRM_FORMAT_MOD_LINEAR:
tiling->mode = TEGRA_BO_TILING_MODE_PITCH;
tiling->value = 0;
break;

case DRM_FORMAT_MOD_NVIDIA_TEGRA_TILED:
tiling->mode = TEGRA_BO_TILING_MODE_TILED;
tiling->value = 0;
Expand Down Expand Up @@ -91,9 +96,7 @@ int tegra_fb_get_tiling(struct drm_framebuffer *framebuffer,
break;

default:
/* TODO: handle YUV formats? */
*tiling = fb->planes[0]->tiling;
break;
return -EINVAL;
}

return 0;
Expand Down

0 comments on commit 4ae4b5c

Please sign in to comment.