diff mbox series

[2/6] drm/i915: Add plane damage clips property

Message ID 20200526221447.64110-2-jose.souza@intel.com (mailing list archive)
State New, archived
Headers show
Series [1/6] drm/i915/rkl: Disable PSR2 | expand

Commit Message

Souza, Jose May 26, 2020, 10:14 p.m. UTC
This property will be used by PSR2 software tracking, adding it to
GEN12+.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
---
 drivers/gpu/drm/i915/display/intel_display.c | 4 ++++
 drivers/gpu/drm/i915/display/intel_sprite.c  | 4 ++++
 2 files changed, 8 insertions(+)

Comments

Gwan-gyeong Mun June 12, 2020, 3:15 p.m. UTC | #1
This feature is supported from GEN9+, but this time it focuses on
supporting of PSR2 software tracking for GEN12+.
Looks good to me.

Reviewed-by: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>

On Tue, 2020-05-26 at 15:14 -0700, José Roberto de Souza wrote:
> This property will be used by PSR2 software tracking, adding it to
> GEN12+.
> 
> Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_display.c | 4 ++++
>  drivers/gpu/drm/i915/display/intel_sprite.c  | 4 ++++
>  2 files changed, 8 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_display.c
> b/drivers/gpu/drm/i915/display/intel_display.c
> index f40b909952cc..b69878334040 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.c
> +++ b/drivers/gpu/drm/i915/display/intel_display.c
> @@ -35,6 +35,7 @@
>  #include <drm/drm_atomic.h>
>  #include <drm/drm_atomic_helper.h>
>  #include <drm/drm_atomic_uapi.h>
> +#include <drm/drm_damage_helper.h>
>  #include <drm/drm_dp_helper.h>
>  #include <drm/drm_edid.h>
>  #include <drm/drm_fourcc.h>
> @@ -16476,6 +16477,9 @@ intel_cursor_plane_create(struct
> drm_i915_private *dev_priv,
>  	zpos = RUNTIME_INFO(dev_priv)->num_sprites[pipe] + 1;
>  	drm_plane_create_zpos_immutable_property(&cursor->base, zpos);
>  
> +	if (INTEL_GEN(dev_priv) >= 12)
> +		drm_plane_enable_fb_damage_clips(&cursor->base);
> +
>  	drm_plane_helper_add(&cursor->base, &intel_plane_helper_funcs);
>  
>  	return cursor;
> diff --git a/drivers/gpu/drm/i915/display/intel_sprite.c
> b/drivers/gpu/drm/i915/display/intel_sprite.c
> index 571c36f929bd..8be06cb25999 100644
> --- a/drivers/gpu/drm/i915/display/intel_sprite.c
> +++ b/drivers/gpu/drm/i915/display/intel_sprite.c
> @@ -34,6 +34,7 @@
>  #include <drm/drm_atomic_helper.h>
>  #include <drm/drm_color_mgmt.h>
>  #include <drm/drm_crtc.h>
> +#include <drm/drm_damage_helper.h>
>  #include <drm/drm_fourcc.h>
>  #include <drm/drm_plane_helper.h>
>  #include <drm/drm_rect.h>
> @@ -3151,6 +3152,9 @@ skl_universal_plane_create(struct
> drm_i915_private *dev_priv,
>  
>  	drm_plane_create_zpos_immutable_property(&plane->base,
> plane_id);
>  
> +	if (INTEL_GEN(dev_priv) >= 12)
> +		drm_plane_enable_fb_damage_clips(&plane->base);
> +
>  	drm_plane_helper_add(&plane->base, &intel_plane_helper_funcs);
>  
>  	return plane;
Ville Syrjälä June 12, 2020, 3:25 p.m. UTC | #2
On Tue, May 26, 2020 at 03:14:43PM -0700, José Roberto de Souza wrote:
> This property will be used by PSR2 software tracking, adding it to
> GEN12+.

Is there actual userspace that uses this?

> 
> Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_display.c | 4 ++++
>  drivers/gpu/drm/i915/display/intel_sprite.c  | 4 ++++
>  2 files changed, 8 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> index f40b909952cc..b69878334040 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.c
> +++ b/drivers/gpu/drm/i915/display/intel_display.c
> @@ -35,6 +35,7 @@
>  #include <drm/drm_atomic.h>
>  #include <drm/drm_atomic_helper.h>
>  #include <drm/drm_atomic_uapi.h>
> +#include <drm/drm_damage_helper.h>
>  #include <drm/drm_dp_helper.h>
>  #include <drm/drm_edid.h>
>  #include <drm/drm_fourcc.h>
> @@ -16476,6 +16477,9 @@ intel_cursor_plane_create(struct drm_i915_private *dev_priv,
>  	zpos = RUNTIME_INFO(dev_priv)->num_sprites[pipe] + 1;
>  	drm_plane_create_zpos_immutable_property(&cursor->base, zpos);
>  
> +	if (INTEL_GEN(dev_priv) >= 12)
> +		drm_plane_enable_fb_damage_clips(&cursor->base);
> +
>  	drm_plane_helper_add(&cursor->base, &intel_plane_helper_funcs);
>  
>  	return cursor;
> diff --git a/drivers/gpu/drm/i915/display/intel_sprite.c b/drivers/gpu/drm/i915/display/intel_sprite.c
> index 571c36f929bd..8be06cb25999 100644
> --- a/drivers/gpu/drm/i915/display/intel_sprite.c
> +++ b/drivers/gpu/drm/i915/display/intel_sprite.c
> @@ -34,6 +34,7 @@
>  #include <drm/drm_atomic_helper.h>
>  #include <drm/drm_color_mgmt.h>
>  #include <drm/drm_crtc.h>
> +#include <drm/drm_damage_helper.h>
>  #include <drm/drm_fourcc.h>
>  #include <drm/drm_plane_helper.h>
>  #include <drm/drm_rect.h>
> @@ -3151,6 +3152,9 @@ skl_universal_plane_create(struct drm_i915_private *dev_priv,
>  
>  	drm_plane_create_zpos_immutable_property(&plane->base, plane_id);
>  
> +	if (INTEL_GEN(dev_priv) >= 12)
> +		drm_plane_enable_fb_damage_clips(&plane->base);
> +
>  	drm_plane_helper_add(&plane->base, &intel_plane_helper_funcs);
>  
>  	return plane;
> -- 
> 2.26.2
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Souza, Jose June 12, 2020, 3:30 p.m. UTC | #3
On Fri, 2020-06-12 at 18:25 +0300, Ville Syrjälä wrote:
> On Tue, May 26, 2020 at 03:14:43PM -0700, José Roberto de Souza wrote:
> > This property will be used by PSR2 software tracking, adding it to
> > GEN12+.
> 
> Is there actual userspace that uses this?

Only Weston for now:

https://gitlab.freedesktop.org/wayland/weston/-/merge_requests/17

> 
> > Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
> > ---
> >  drivers/gpu/drm/i915/display/intel_display.c | 4 ++++
> >  drivers/gpu/drm/i915/display/intel_sprite.c  | 4 ++++
> >  2 files changed, 8 insertions(+)
> > 
> > diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> > index f40b909952cc..b69878334040 100644
> > --- a/drivers/gpu/drm/i915/display/intel_display.c
> > +++ b/drivers/gpu/drm/i915/display/intel_display.c
> > @@ -35,6 +35,7 @@
> >  #include <drm/drm_atomic.h>
> >  #include <drm/drm_atomic_helper.h>
> >  #include <drm/drm_atomic_uapi.h>
> > +#include <drm/drm_damage_helper.h>
> >  #include <drm/drm_dp_helper.h>
> >  #include <drm/drm_edid.h>
> >  #include <drm/drm_fourcc.h>
> > @@ -16476,6 +16477,9 @@ intel_cursor_plane_create(struct drm_i915_private *dev_priv,
> >  	zpos = RUNTIME_INFO(dev_priv)->num_sprites[pipe] + 1;
> >  	drm_plane_create_zpos_immutable_property(&cursor->base, zpos);
> >  
> > +	if (INTEL_GEN(dev_priv) >= 12)
> > +		drm_plane_enable_fb_damage_clips(&cursor->base);
> > +
> >  	drm_plane_helper_add(&cursor->base, &intel_plane_helper_funcs);
> >  
> >  	return cursor;
> > diff --git a/drivers/gpu/drm/i915/display/intel_sprite.c b/drivers/gpu/drm/i915/display/intel_sprite.c
> > index 571c36f929bd..8be06cb25999 100644
> > --- a/drivers/gpu/drm/i915/display/intel_sprite.c
> > +++ b/drivers/gpu/drm/i915/display/intel_sprite.c
> > @@ -34,6 +34,7 @@
> >  #include <drm/drm_atomic_helper.h>
> >  #include <drm/drm_color_mgmt.h>
> >  #include <drm/drm_crtc.h>
> > +#include <drm/drm_damage_helper.h>
> >  #include <drm/drm_fourcc.h>
> >  #include <drm/drm_plane_helper.h>
> >  #include <drm/drm_rect.h>
> > @@ -3151,6 +3152,9 @@ skl_universal_plane_create(struct drm_i915_private *dev_priv,
> >  
> >  	drm_plane_create_zpos_immutable_property(&plane->base, plane_id);
> >  
> > +	if (INTEL_GEN(dev_priv) >= 12)
> > +		drm_plane_enable_fb_damage_clips(&plane->base);
> > +
> >  	drm_plane_helper_add(&plane->base, &intel_plane_helper_funcs);
> >  
> >  	return plane;
> > -- 
> > 2.26.2
> > 
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Ville Syrjälä June 12, 2020, 3:37 p.m. UTC | #4
On Fri, Jun 12, 2020 at 03:30:59PM +0000, Souza, Jose wrote:
> On Fri, 2020-06-12 at 18:25 +0300, Ville Syrjälä wrote:
> > On Tue, May 26, 2020 at 03:14:43PM -0700, José Roberto de Souza wrote:
> > > This property will be used by PSR2 software tracking, adding it to
> > > GEN12+.
> > 
> > Is there actual userspace that uses this?
> 
> Only Weston for now:
> 
> https://gitlab.freedesktop.org/wayland/weston/-/merge_requests/17

And what happens when userspace doesn't do this stuff?

> 
> > 
> > > Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
> > > ---
> > >  drivers/gpu/drm/i915/display/intel_display.c | 4 ++++
> > >  drivers/gpu/drm/i915/display/intel_sprite.c  | 4 ++++
> > >  2 files changed, 8 insertions(+)
> > > 
> > > diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> > > index f40b909952cc..b69878334040 100644
> > > --- a/drivers/gpu/drm/i915/display/intel_display.c
> > > +++ b/drivers/gpu/drm/i915/display/intel_display.c
> > > @@ -35,6 +35,7 @@
> > >  #include <drm/drm_atomic.h>
> > >  #include <drm/drm_atomic_helper.h>
> > >  #include <drm/drm_atomic_uapi.h>
> > > +#include <drm/drm_damage_helper.h>
> > >  #include <drm/drm_dp_helper.h>
> > >  #include <drm/drm_edid.h>
> > >  #include <drm/drm_fourcc.h>
> > > @@ -16476,6 +16477,9 @@ intel_cursor_plane_create(struct drm_i915_private *dev_priv,
> > >  	zpos = RUNTIME_INFO(dev_priv)->num_sprites[pipe] + 1;
> > >  	drm_plane_create_zpos_immutable_property(&cursor->base, zpos);
> > >  
> > > +	if (INTEL_GEN(dev_priv) >= 12)
> > > +		drm_plane_enable_fb_damage_clips(&cursor->base);
> > > +
> > >  	drm_plane_helper_add(&cursor->base, &intel_plane_helper_funcs);
> > >  
> > >  	return cursor;
> > > diff --git a/drivers/gpu/drm/i915/display/intel_sprite.c b/drivers/gpu/drm/i915/display/intel_sprite.c
> > > index 571c36f929bd..8be06cb25999 100644
> > > --- a/drivers/gpu/drm/i915/display/intel_sprite.c
> > > +++ b/drivers/gpu/drm/i915/display/intel_sprite.c
> > > @@ -34,6 +34,7 @@
> > >  #include <drm/drm_atomic_helper.h>
> > >  #include <drm/drm_color_mgmt.h>
> > >  #include <drm/drm_crtc.h>
> > > +#include <drm/drm_damage_helper.h>
> > >  #include <drm/drm_fourcc.h>
> > >  #include <drm/drm_plane_helper.h>
> > >  #include <drm/drm_rect.h>
> > > @@ -3151,6 +3152,9 @@ skl_universal_plane_create(struct drm_i915_private *dev_priv,
> > >  
> > >  	drm_plane_create_zpos_immutable_property(&plane->base, plane_id);
> > >  
> > > +	if (INTEL_GEN(dev_priv) >= 12)
> > > +		drm_plane_enable_fb_damage_clips(&plane->base);
> > > +
> > >  	drm_plane_helper_add(&plane->base, &intel_plane_helper_funcs);
> > >  
> > >  	return plane;
> > > -- 
> > > 2.26.2
> > > 
> > > _______________________________________________
> > > Intel-gfx mailing list
> > > Intel-gfx@lists.freedesktop.org
> > > https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Souza, Jose June 12, 2020, 3:42 p.m. UTC | #5
On Fri, 2020-06-12 at 18:37 +0300, Ville Syrjälä wrote:
> On Fri, Jun 12, 2020 at 03:30:59PM +0000, Souza, Jose wrote:
> > On Fri, 2020-06-12 at 18:25 +0300, Ville Syrjälä wrote:
> > > On Tue, May 26, 2020 at 03:14:43PM -0700, José Roberto de Souza wrote:
> > > > This property will be used by PSR2 software tracking, adding it to
> > > > GEN12+.
> > > 
> > > Is there actual userspace that uses this?
> > 
> > Only Weston for now:
> > 
> > https://gitlab.freedesktop.org/wayland/weston/-/merge_requests/17
> 
> And what happens when userspace doesn't do this stuff?

It updates the whole area of the plane that flipped.

> 
> > > > Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
> > > > ---
> > > >  drivers/gpu/drm/i915/display/intel_display.c | 4 ++++
> > > >  drivers/gpu/drm/i915/display/intel_sprite.c  | 4 ++++
> > > >  2 files changed, 8 insertions(+)
> > > > 
> > > > diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> > > > index f40b909952cc..b69878334040 100644
> > > > --- a/drivers/gpu/drm/i915/display/intel_display.c
> > > > +++ b/drivers/gpu/drm/i915/display/intel_display.c
> > > > @@ -35,6 +35,7 @@
> > > >  #include <drm/drm_atomic.h>
> > > >  #include <drm/drm_atomic_helper.h>
> > > >  #include <drm/drm_atomic_uapi.h>
> > > > +#include <drm/drm_damage_helper.h>
> > > >  #include <drm/drm_dp_helper.h>
> > > >  #include <drm/drm_edid.h>
> > > >  #include <drm/drm_fourcc.h>
> > > > @@ -16476,6 +16477,9 @@ intel_cursor_plane_create(struct drm_i915_private *dev_priv,
> > > >  	zpos = RUNTIME_INFO(dev_priv)->num_sprites[pipe] + 1;
> > > >  	drm_plane_create_zpos_immutable_property(&cursor->base, zpos);
> > > >  
> > > > +	if (INTEL_GEN(dev_priv) >= 12)
> > > > +		drm_plane_enable_fb_damage_clips(&cursor->base);
> > > > +
> > > >  	drm_plane_helper_add(&cursor->base, &intel_plane_helper_funcs);
> > > >  
> > > >  	return cursor;
> > > > diff --git a/drivers/gpu/drm/i915/display/intel_sprite.c b/drivers/gpu/drm/i915/display/intel_sprite.c
> > > > index 571c36f929bd..8be06cb25999 100644
> > > > --- a/drivers/gpu/drm/i915/display/intel_sprite.c
> > > > +++ b/drivers/gpu/drm/i915/display/intel_sprite.c
> > > > @@ -34,6 +34,7 @@
> > > >  #include <drm/drm_atomic_helper.h>
> > > >  #include <drm/drm_color_mgmt.h>
> > > >  #include <drm/drm_crtc.h>
> > > > +#include <drm/drm_damage_helper.h>
> > > >  #include <drm/drm_fourcc.h>
> > > >  #include <drm/drm_plane_helper.h>
> > > >  #include <drm/drm_rect.h>
> > > > @@ -3151,6 +3152,9 @@ skl_universal_plane_create(struct drm_i915_private *dev_priv,
> > > >  
> > > >  	drm_plane_create_zpos_immutable_property(&plane->base, plane_id);
> > > >  
> > > > +	if (INTEL_GEN(dev_priv) >= 12)
> > > > +		drm_plane_enable_fb_damage_clips(&plane->base);
> > > > +
> > > >  	drm_plane_helper_add(&plane->base, &intel_plane_helper_funcs);
> > > >  
> > > >  	return plane;
> > > > -- 
> > > > 2.26.2
> > > > 
> > > > _______________________________________________
> > > > Intel-gfx mailing list
> > > > Intel-gfx@lists.freedesktop.org
> > > > https://lists.freedesktop.org/mailman/listinfo/intel-gfx
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
index f40b909952cc..b69878334040 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -35,6 +35,7 @@ 
 #include <drm/drm_atomic.h>
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_atomic_uapi.h>
+#include <drm/drm_damage_helper.h>
 #include <drm/drm_dp_helper.h>
 #include <drm/drm_edid.h>
 #include <drm/drm_fourcc.h>
@@ -16476,6 +16477,9 @@  intel_cursor_plane_create(struct drm_i915_private *dev_priv,
 	zpos = RUNTIME_INFO(dev_priv)->num_sprites[pipe] + 1;
 	drm_plane_create_zpos_immutable_property(&cursor->base, zpos);
 
+	if (INTEL_GEN(dev_priv) >= 12)
+		drm_plane_enable_fb_damage_clips(&cursor->base);
+
 	drm_plane_helper_add(&cursor->base, &intel_plane_helper_funcs);
 
 	return cursor;
diff --git a/drivers/gpu/drm/i915/display/intel_sprite.c b/drivers/gpu/drm/i915/display/intel_sprite.c
index 571c36f929bd..8be06cb25999 100644
--- a/drivers/gpu/drm/i915/display/intel_sprite.c
+++ b/drivers/gpu/drm/i915/display/intel_sprite.c
@@ -34,6 +34,7 @@ 
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_color_mgmt.h>
 #include <drm/drm_crtc.h>
+#include <drm/drm_damage_helper.h>
 #include <drm/drm_fourcc.h>
 #include <drm/drm_plane_helper.h>
 #include <drm/drm_rect.h>
@@ -3151,6 +3152,9 @@  skl_universal_plane_create(struct drm_i915_private *dev_priv,
 
 	drm_plane_create_zpos_immutable_property(&plane->base, plane_id);
 
+	if (INTEL_GEN(dev_priv) >= 12)
+		drm_plane_enable_fb_damage_clips(&plane->base);
+
 	drm_plane_helper_add(&plane->base, &intel_plane_helper_funcs);
 
 	return plane;