diff options
author | Thierry Reding <treding@nvidia.com> | 2017-12-14 13:46:20 +0100 |
---|---|---|
committer | Thierry Reding <treding@nvidia.com> | 2017-12-21 14:52:35 +0100 |
commit | ab7d3f5826c55ad23101327eab435660caa83436 (patch) | |
tree | 8d8c77f5c2f8c727bebcd0ba2085a91369b2dee4 /drivers/gpu/drm/tegra/hub.c | |
parent | 363541e8eeed16fdf696252008ddee823730f82c (diff) |
drm/tegra: Implement zpos property
Implement the standard zpos property for planes on Tegra124 and later.
Earlier generations have a different blending unit that needs different
programming.
Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'drivers/gpu/drm/tegra/hub.c')
-rw-r--r-- | drivers/gpu/drm/tegra/hub.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/gpu/drm/tegra/hub.c b/drivers/gpu/drm/tegra/hub.c index 63541dbd864d..90bcf24b1523 100644 --- a/drivers/gpu/drm/tegra/hub.c +++ b/drivers/gpu/drm/tegra/hub.c @@ -399,6 +399,7 @@ static void tegra_shared_plane_atomic_update(struct drm_plane *plane, { struct tegra_plane_state *state = to_tegra_plane_state(plane->state); struct tegra_dc *dc = to_tegra_dc(plane->state->crtc); + unsigned int zpos = plane->state->normalized_zpos; struct drm_framebuffer *fb = plane->state->fb; struct tegra_plane *p = to_tegra_plane(plane); struct tegra_bo *bo; @@ -431,7 +432,7 @@ static void tegra_shared_plane_atomic_update(struct drm_plane *plane, BLEND_FACTOR_SRC_COLOR_K1_TIMES_SRC; tegra_plane_writel(p, value, DC_WIN_BLEND_NOMATCH_SELECT); - value = K2(255) | K1(255) | WINDOW_LAYER_DEPTH(p->depth); + value = K2(255) | K1(255) | WINDOW_LAYER_DEPTH(255 - zpos); tegra_plane_writel(p, value, DC_WIN_BLEND_LAYER_CONTROL); /* bypass scaling */ @@ -536,7 +537,6 @@ struct drm_plane *tegra_shared_plane_create(struct drm_device *drm, plane->base.offset = 0x0a00 + 0x0300 * index; plane->base.index = index; - plane->base.depth = 0; plane->wgrp = &hub->wgrps[wgrp]; plane->wgrp->parent = dc->dev; @@ -555,6 +555,7 @@ struct drm_plane *tegra_shared_plane_create(struct drm_device *drm, } drm_plane_helper_add(p, &tegra_shared_plane_helper_funcs); + drm_plane_create_zpos_property(p, 0, 0, 255); return p; } |