All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: "Govindapillai, Vinod" <vinod.govindapillai@intel.com>
Cc: "intel-xe@lists.freedesktop.org" <intel-xe@lists.freedesktop.org>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	"Reddy Guddati, Santhosh" <santhosh.reddy.guddati@intel.com>,
	"Saarinen, Jani" <jani.saarinen@intel.com>,
	"intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>,
	"Syrjala, Ville" <ville.syrjala@intel.com>
Subject: Re: [PATCH v7 2/7] drm/i915/xe3: update and store the plane damage clips
Date: Wed, 12 Feb 2025 22:42:17 +0200	[thread overview]
Message-ID: <Z60HqVD2Bq9bhcVq@intel.com> (raw)
In-Reply-To: <6e7132ef52c8da1bc3ea1a781f9a56850570c762.camel@intel.com>

On Wed, Feb 12, 2025 at 08:14:12PM +0000, Govindapillai, Vinod wrote:
> On Wed, 2025-02-12 at 20:35 +0200, Ville Syrjälä wrote:
> > On Wed, Feb 12, 2025 at 03:14:15PM +0200, Vinod Govindapillai wrote:
> > > Userspace can pass damage area clips per plane to track
> > > changes in a plane and some display components can utilze
> > > these damage clips for efficiently handling use cases like
> > > FBC, PSR etc. A merged damage area is generated and its
> > > coordinates are updated relative to viewport and HW and
> > > stored in the plane_state. This merged damage areas will be
> > > used for FBC dirty rect support in xe3 in the follow-up
> > > patch.
> > > 
> > > Big thanks to Ville Syrjala for his contribuitions in shaping
> > > up of this series.
> > > 
> > > v1: - Move damage_merged helper to cover bigjoiner case and use
> > >     the correct plane state for damage find helper (Ville)
> > >     - Damage handling code under HAS_FBC_DIRTY_RECT() so the
> > >     the related part will be executed only for xe3+
> > >     - Changed dev_priv to i915 in one of the functions
> > > 
> > > v2: - damage reported is stored in the plane state after coords
> > >       adjustmentments irrespective of fbc dirty rect support.
> > >     - Damage to be empty in case of plane not visible (Ville)
> > >     - Handle fb could be NULL and plane not visible cases (Ville)
> > > 
> > > Signed-off-by: Vinod Govindapillai <vinod.govindapillai@intel.com>
> > > ---
> > >  .../gpu/drm/i915/display/intel_atomic_plane.c | 31 +++++++++++++
> > >  .../drm/i915/display/intel_display_types.h    |  2 +
> > >  .../drm/i915/display/skl_universal_plane.c    | 46 ++++++++++++++++++-
> > >  3 files changed, 78 insertions(+), 1 deletion(-)
> > > 
> > > diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.c
> > > b/drivers/gpu/drm/i915/display/intel_atomic_plane.c
> > > index 8a49d87d9bd9..b4e94dd01173 100644
> > > --- a/drivers/gpu/drm/i915/display/intel_atomic_plane.c
> > > +++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.c
> > > @@ -36,6 +36,7 @@
> > >  
> > >  #include <drm/drm_atomic_helper.h>
> > >  #include <drm/drm_blend.h>
> > > +#include <drm/drm_damage_helper.h>
> > >  #include <drm/drm_fourcc.h>
> > >  #include <drm/drm_gem.h>
> > >  #include <drm/drm_gem_atomic_helper.h>
> > > @@ -117,6 +118,7 @@ intel_plane_duplicate_state(struct drm_plane *plane)
> > >  	intel_state->ggtt_vma = NULL;
> > >  	intel_state->dpt_vma = NULL;
> > >  	intel_state->flags = 0;
> > > +	intel_state->damage = DRM_RECT_INIT(0, 0, 0, 0);
> > >  
> > >  	/* add reference to fb */
> > >  	if (intel_state->hw.fb)
> > > @@ -322,6 +324,27 @@ static void intel_plane_clear_hw_state(struct intel_plane_state
> > > *plane_state)
> > >  	memset(&plane_state->hw, 0, sizeof(plane_state->hw));
> > >  }
> > >  
> > > +static void
> > > +intel_plane_copy_uapi_plane_damage(struct intel_plane_state *new_plane_state,
> > > +				   const struct intel_plane_state *old_uapi_plane_state,
> > > +				   const struct intel_plane_state *new_uapi_plane_state)
> > > +{
> > > +	struct intel_display *display = to_intel_display(new_plane_state);
> > > +	struct drm_rect *damage = &new_plane_state->damage;
> > > +
> > > +	/* damage property tracking enabled from display version 12 onwards */
> > > +	if (DISPLAY_VER(display) < 12) {
> > > +		*damage = DRM_RECT_INIT(0, 0, 0, 0);
> > > +		return;
> > > +	}
> > 
> > I don't think that is needed. If we have no damage prop then the helper
> > will give us full damage.
> 
> We do this drm_plane_enable_fb_damage_clips from from display version 12 onwards.
> 
> 	if (DISPLAY_VER(display) >= 12)
> 		drm_plane_enable_fb_damage_clips(&plane->base);
> 
> There will be a dmesg warn if we call that damage helper without the enable_fb_damage_clips
> 
> "4> [44.199485] i915 0000:00:02.0: [drm] drm_plane_enable_fb_damage_clips() not called"

Sigh. This "helper" is even worse than I thought. I think we
should just roll our own. But I guess we can live with the platform
check for now. You should be able to drop the RECT_INIT though since
the rectagle will be empty already anyway.

-- 
Ville Syrjälä
Intel

  reply	other threads:[~2025-02-12 20:42 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-12 13:14 [PATCH v7 0/7] drm/i915/fbc: FBC Dirty rect feature support Vinod Govindapillai
2025-02-12 13:14 ` [PATCH v7 1/7] drm/damage-helper: add const qualifier in drm_atomic_helper_damage_merged() Vinod Govindapillai
2025-02-12 13:14 ` [PATCH v7 2/7] drm/i915/xe3: update and store the plane damage clips Vinod Govindapillai
2025-02-12 18:35   ` Ville Syrjälä
2025-02-12 20:14     ` Govindapillai, Vinod
2025-02-12 20:42       ` Ville Syrjälä [this message]
2025-02-12 13:14 ` [PATCH v7 3/7] drm/i915/xe3: add register definitions for fbc dirty rect support Vinod Govindapillai
2025-02-12 13:14 ` [PATCH v7 4/7] drm/i915/xe3: introduce HAS_FBC_DIRTY_RECT() for FBC " Vinod Govindapillai
2025-02-12 13:14 ` [PATCH v7 5/7] drm/i915/xe3: avoid calling fbc activate if fbc is active Vinod Govindapillai
2025-02-12 18:30   ` Ville Syrjälä
2025-02-12 20:21     ` Govindapillai, Vinod
2025-02-12 13:14 ` [PATCH v7 6/7] drm/i915/xe3: dirty rect support for FBC Vinod Govindapillai
2025-02-12 18:42   ` Ville Syrjälä
2025-02-12 13:14 ` [PATCH v7 7/7] drm/i915/xe3: disable FBC if PSR2 selective fetch is enabled Vinod Govindapillai
2025-02-12 14:30 ` ✓ CI.Patch_applied: success for drm/i915/fbc: FBC Dirty rect feature support Patchwork
2025-02-12 14:30 ` ✗ CI.checkpatch: warning " Patchwork
2025-02-12 14:32 ` ✓ CI.KUnit: success " Patchwork
2025-02-12 14:48 ` ✓ CI.Build: " Patchwork
2025-02-12 14:48 ` ✗ Fi.CI.CHECKPATCH: warning " Patchwork
2025-02-12 14:48 ` ✗ Fi.CI.SPARSE: " Patchwork
2025-02-12 14:50 ` ✓ CI.Hooks: success " Patchwork
2025-02-12 14:52 ` ✗ CI.checksparse: warning " Patchwork
2025-02-12 15:09 ` ✓ i915.CI.BAT: success " Patchwork
2025-02-12 15:13 ` ✓ Xe.CI.BAT: " Patchwork
2025-02-12 21:05 ` ✗ Xe.CI.Full: failure " Patchwork
2025-02-12 22:37 ` ✗ i915.CI.Full: " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Z60HqVD2Bq9bhcVq@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=jani.saarinen@intel.com \
    --cc=santhosh.reddy.guddati@intel.com \
    --cc=ville.syrjala@intel.com \
    --cc=vinod.govindapillai@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.