[Intel-gfx] [PATCH v3] drm/i915: add immutable zpos plane properties
Ville Syrjälä
ville.syrjala at linux.intel.com
Tue Apr 16 13:20:17 UTC 2019
On Sat, Apr 13, 2019 at 11:13:27AM +0000, Simon Ser wrote:
> From: Ville Syrjälä <ville.syrjala at linux.intel.com>
>
> This adds basic immutable support for the zpos property. The zpos increases
> from bottom to top: primary, sprites, cursor.
I was thinking a bit about how we might go about testing this.
We probably want a basic test that just checks that if any
plane has a zpos prop then all planes should have it.
A functional test would stack the planes up in some way and
compare against a software rendered reference. IIRC there was
a zpos test case floating around but that depended on alpha
blending which we don't necessarily have.
>
> Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
> [contact at emersion.fr: adapted for latest drm-tip]
> Signed-off-by: Simon Ser <contact at emersion.fr>
> ---
>
> Maarten, could your review this patch?
>
> Changes from v2 to v3: add the zpos property in skl_universal_plane_create too.
>
> drivers/gpu/drm/i915/intel_display.c | 10 ++++++++--
> drivers/gpu/drm/i915/intel_sprite.c | 7 ++++++-
> 2 files changed, 14 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 8576a7f799..f0a85a75bd 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -14323,7 +14323,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,
> @@ -14412,6 +14412,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;
> @@ -14428,7 +14431,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))
> @@ -14477,6 +14480,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;
> diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c
> index 65de7387bf..40b7bcd720 100644
> --- a/drivers/gpu/drm/i915/intel_sprite.c
> +++ b/drivers/gpu/drm/i915/intel_sprite.c
> @@ -2333,6 +2333,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;
> @@ -2354,7 +2356,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,
> @@ -2444,6 +2446,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;
> --
> 2.21.0
>
--
Ville Syrjälä
Intel
More information about the Intel-gfx
mailing list