All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Vinod Govindapillai <vinod.govindapillai@intel.com>,
	intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org
Cc: vinod.govindapillai@intel.com, ville.syrjala@intel.com,
	santhosh.reddy.guddati@intel.com, jani.saarinen@intel.com
Subject: Re: [PATCH v4 6/6] drm/i915/xe3: introduce a dirty rectangle state variable
Date: Wed, 22 Jan 2025 12:42:36 +0200	[thread overview]
Message-ID: <875xm7p1sz.fsf@intel.com> (raw)
In-Reply-To: <20250122093006.405711-7-vinod.govindapillai@intel.com>

On Wed, 22 Jan 2025, Vinod Govindapillai <vinod.govindapillai@intel.com> wrote:
> To avoid programming garbage to dirty rectangle registers,
> introduce a state variable to track the validity of the
> dirty rectangle update scenarios. Program the dirty rectangle
> coordinate only if this state variable is valid.
>
> Signed-off-by: Vinod Govindapillai <vinod.govindapillai@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_fbc.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_fbc.c b/drivers/gpu/drm/i915/display/intel_fbc.c
> index 033eb4a3eab0..ab8acb1cc090 100644
> --- a/drivers/gpu/drm/i915/display/intel_fbc.c
> +++ b/drivers/gpu/drm/i915/display/intel_fbc.c
> @@ -91,6 +91,7 @@ struct intel_fbc_state {
>  	u16 interval;
>  	s8 fence_id;
>  	struct drm_rect dirty_rect;
> +	bool dr_valid;

Please let's try to avoid inventing new acronyms for every little
thing. I don't think we want to be guessing what "dr_valid" means.

Adding context would help:

	struct {
		struct drm_rect rect;
		bool valid;
	} dirty_rect;

Or similar.


>  };
>  
>  struct intel_fbc {
> @@ -1227,6 +1228,9 @@ __intel_fbc_program_dirty_rect(struct intel_dsb *dsb, struct intel_plane *plane)
>  	if (fbc_state->plane != plane)
>  		return;
>  
> +	if (!fbc_state->dr_valid)
> +		return;
> +
>  	intel_de_write_dsb(display, dsb, XE3_FBC_DIRTY_RECT(fbc->id),
>  			   FBC_DIRTY_RECT_START_LINE(fbc_state->dirty_rect.y1) |
>  			   FBC_DIRTY_RECT_END_LINE(fbc_state->dirty_rect.y2));
> @@ -1314,6 +1318,8 @@ intel_fbc_compute_dirty_rect(struct intel_atomic_state *state,
>  		if (!fbc || plane->pipe != crtc->pipe)
>  			continue;
>  
> +		fbc->state.dr_valid = false;
> +
>  		/* If plane not visible, dirty rect might have invalid coordinates */
>  		if (!new_plane_state->uapi.visible)
>  			continue;
> @@ -1323,6 +1329,8 @@ intel_fbc_compute_dirty_rect(struct intel_atomic_state *state,
>  			continue;
>  
>  		__intel_fbc_compute_dirty_rect(plane, old_plane_state, new_plane_state);
> +
> +		fbc->state.dr_valid = true;
>  	}
>  }

-- 
Jani Nikula, Intel

  reply	other threads:[~2025-01-22 10:42 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-22  9:30 [PATCH v4 0/6] drm/i915/xe3: FBC Dirty rect feature support Vinod Govindapillai
2025-01-22  9:30 ` [PATCH v4 1/6] drm/i915/xe3: avoid calling fbc activate if fbc is active Vinod Govindapillai
2025-01-22 18:13   ` Ville Syrjälä
2025-01-22 18:31     ` Govindapillai, Vinod
2025-01-22  9:30 ` [PATCH v4 2/6] drm/i915/xe3: add register definitions for fbc dirty rect support Vinod Govindapillai
2025-01-22  9:30 ` [PATCH v4 3/6] drm/i915/xe3: disable FBC if PSR2 selective fetch is enabled Vinod Govindapillai
2025-01-22  9:30 ` [PATCH v4 4/6] drm/i915/xe3: add dirty rect support for FBC Vinod Govindapillai
2025-01-22 10:39   ` Jani Nikula
2025-01-22 19:41   ` Ville Syrjälä
2025-01-22  9:30 ` [PATCH v4 5/6] drm/i915/xe3: handle dirty rect update within the scope of DSB Vinod Govindapillai
2025-01-22 10:47   ` Jani Nikula
2025-01-22 13:55     ` Govindapillai, Vinod
2025-01-23  9:46       ` Jani Nikula
2025-01-22  9:30 ` [PATCH v4 6/6] drm/i915/xe3: introduce a dirty rectangle state variable Vinod Govindapillai
2025-01-22 10:42   ` Jani Nikula [this message]
2025-01-22 10:04 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915/xe3: FBC Dirty rect feature support (rev5) Patchwork
2025-01-22 10:04 ` ✗ Fi.CI.SPARSE: " Patchwork
2025-01-22 10:18 ` ✓ i915.CI.BAT: success " Patchwork
2025-01-22 11:36 ` ✓ CI.Patch_applied: " Patchwork
2025-01-22 11:37 ` ✗ CI.checkpatch: warning " Patchwork
2025-01-22 11:38 ` ✓ CI.KUnit: success " Patchwork
2025-01-22 11:54 ` ✓ CI.Build: " Patchwork
2025-01-22 11:56 ` ✓ CI.Hooks: " Patchwork
2025-01-22 11:58 ` ✗ CI.checksparse: warning " Patchwork
2025-01-22 12:25 ` ✓ Xe.CI.BAT: success " Patchwork
2025-01-22 22:46 ` ✗ Xe.CI.Full: failure " Patchwork
2025-01-23 14:33 ` ✓ i915.CI.Full: success " 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=875xm7p1sz.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --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.