Message ID | hqsrVnKHE6gBs1Wg5uO3GN4jubGCaQ3lGCdCTOSVVj4nK6LC-vGKmnERLwJ2BBpLrO9QnsAph6rXkF0JfQzDACl4uaXzJI-1sioB65tSa0Y=@emersion.fr (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [v2] drm/i915: add immutable zpos plane properties | expand |
Hi Jani, git blame says you are familiar with intel_primary_plane_create! Would you have some time to review this patch? Thanks! -- Simon Ser https://emersion.fr > From: Ville Syrjälä <ville.syrjala@linux.intel.com> > > 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> > --- > > Changes in v2: set correct author and S-o-b tags > > drivers/gpu/drm/i915/intel_display.c | 10 ++++++++-- > drivers/gpu/drm/i915/intel_sprite.c | 5 ++++- > 2 files changed, 12 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..48bd8f9079 100644 > --- a/drivers/gpu/drm/i915/intel_sprite.c > +++ b/drivers/gpu/drm/i915/intel_sprite.c > @@ -2354,7 +2354,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 +2444,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
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..48bd8f9079 100644 --- a/drivers/gpu/drm/i915/intel_sprite.c +++ b/drivers/gpu/drm/i915/intel_sprite.c @@ -2354,7 +2354,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 +2444,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;