summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/tegra/drm.c
diff options
context:
space:
mode:
authorThierry Reding <treding@nvidia.com>2017-12-14 13:46:20 +0100
committerThierry Reding <treding@nvidia.com>2017-12-21 14:52:35 +0100
commitab7d3f5826c55ad23101327eab435660caa83436 (patch)
tree8d8c77f5c2f8c727bebcd0ba2085a91369b2dee4 /drivers/gpu/drm/tegra/drm.c
parentdrm/tegra: dc: Remove redundant spinlock (diff)
downloadlinux-ab7d3f5826c55ad23101327eab435660caa83436.tar.xz
linux-ab7d3f5826c55ad23101327eab435660caa83436.zip
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/drm.c')
-rw-r--r--drivers/gpu/drm/tegra/drm.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c
index 2fa1b48e14d2..52468f669277 100644
--- a/drivers/gpu/drm/tegra/drm.c
+++ b/drivers/gpu/drm/tegra/drm.c
@@ -33,6 +33,29 @@ struct tegra_drm_file {
struct mutex lock;
};
+static int tegra_atomic_check(struct drm_device *drm,
+ struct drm_atomic_state *state)
+{
+ int err;
+
+ err = drm_atomic_helper_check_modeset(drm, state);
+ if (err < 0)
+ return err;
+
+ err = drm_atomic_normalize_zpos(drm, state);
+ if (err < 0)
+ return err;
+
+ err = drm_atomic_helper_check_planes(drm, state);
+ if (err < 0)
+ return err;
+
+ if (state->legacy_cursor_update)
+ state->async_update = !drm_atomic_helper_async_check(drm, state);
+
+ return 0;
+}
+
static struct drm_atomic_state *
tegra_atomic_state_alloc(struct drm_device *drm)
{
@@ -67,7 +90,7 @@ static const struct drm_mode_config_funcs tegra_drm_mode_config_funcs = {
#ifdef CONFIG_DRM_FBDEV_EMULATION
.output_poll_changed = tegra_fb_output_poll_changed,
#endif
- .atomic_check = drm_atomic_helper_check,
+ .atomic_check = tegra_atomic_check,
.atomic_commit = drm_atomic_helper_commit,
.atomic_state_alloc = tegra_atomic_state_alloc,
.atomic_state_clear = tegra_atomic_state_clear,