drm/i915: add immutable zpos plane properties
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Sat, 13 Apr 2019 11:13:27 +0000 (11:13 +0000)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Fri, 6 Sep 2019 14:34:38 +0000 (17:34 +0300)
This adds basic immutable support for the zpos property. The zpos increases
from bottom to top: primary, sprites, cursor.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
[contact@emersion.fr: adapted for latest drm-tip]
Signed-off-by: Simon Ser <contact@emersion.fr>
Link: https://patchwork.freedesktop.org/patch/msgid/YSH9PasoADJJdNJCSdI4m55ankIBsCaoSgkw-NQ5dlruCAxc8J-SQwVl5n3ddSAMDLTdbdyQvkONmtbjkUU-TQk5VIu1p-aZRO1OjjuSxjY=@emersion.fr
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
drivers/gpu/drm/i915/display/intel_display.c
drivers/gpu/drm/i915/display/intel_sprite.c

index 06cf2171474d86316e2830e33e2eb306cf5201b3..3b5275ab66cf0752642f86921c6df087c239545d 100644 (file)
@@ -14887,7 +14887,7 @@ intel_primary_plane_create(struct drm_i915_private *dev_priv, enum pipe pipe)
        const u64 *modifiers;
        const u32 *formats;
        int num_formats;
-       int ret;
+       int ret, zpos;
 
        if (INTEL_GEN(dev_priv) >= 9)
                return skl_universal_plane_create(dev_priv, pipe,
@@ -14976,6 +14976,9 @@ intel_primary_plane_create(struct drm_i915_private *dev_priv, enum pipe pipe)
                                                   DRM_MODE_ROTATE_0,
                                                   supported_rotations);
 
+       zpos = 0;
+       drm_plane_create_zpos_immutable_property(&plane->base, zpos);
+
        drm_plane_helper_add(&plane->base, &intel_plane_helper_funcs);
 
        return plane;
@@ -14992,7 +14995,7 @@ intel_cursor_plane_create(struct drm_i915_private *dev_priv,
 {
        unsigned int possible_crtcs;
        struct intel_plane *cursor;
-       int ret;
+       int ret, zpos;
 
        cursor = intel_plane_alloc();
        if (IS_ERR(cursor))
@@ -15041,6 +15044,9 @@ intel_cursor_plane_create(struct drm_i915_private *dev_priv,
                                                   DRM_MODE_ROTATE_0 |
                                                   DRM_MODE_ROTATE_180);
 
+       zpos = RUNTIME_INFO(dev_priv)->num_sprites[pipe] + 1;
+       drm_plane_create_zpos_immutable_property(&cursor->base, zpos);
+
        drm_plane_helper_add(&cursor->base, &intel_plane_helper_funcs);
 
        return cursor;
index 8ca2fbc2af1df56297023a2eaa9dffa19bac054c..e415b0ad4a4251c67c16c1668af85e346040ebeb 100644 (file)
@@ -2592,6 +2592,8 @@ skl_universal_plane_create(struct drm_i915_private *dev_priv,
                                             BIT(DRM_MODE_BLEND_PREMULTI) |
                                             BIT(DRM_MODE_BLEND_COVERAGE));
 
+       drm_plane_create_zpos_immutable_property(&plane->base, plane_id);
+
        drm_plane_helper_add(&plane->base, &intel_plane_helper_funcs);
 
        return plane;
@@ -2613,7 +2615,7 @@ intel_sprite_plane_create(struct drm_i915_private *dev_priv,
        const u64 *modifiers;
        const u32 *formats;
        int num_formats;
-       int ret;
+       int ret, zpos;
 
        if (INTEL_GEN(dev_priv) >= 9)
                return skl_universal_plane_create(dev_priv, pipe,
@@ -2703,6 +2705,9 @@ intel_sprite_plane_create(struct drm_i915_private *dev_priv,
                                          DRM_COLOR_YCBCR_BT709,
                                          DRM_COLOR_YCBCR_LIMITED_RANGE);
 
+       zpos = sprite + 1;
+       drm_plane_create_zpos_immutable_property(&plane->base, zpos);
+
        drm_plane_helper_add(&plane->base, &intel_plane_helper_funcs);
 
        return plane;