Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Vinod Govindapillai <vinod.govindapillai@intel.com>
To: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org, vinod.govindapillai@intel.com,
	jani.nikula@intel.com, jani.saarinen@intel.com
Subject: [PATCH v10 6/9] drm/i915/fbc: avoid calling fbc activate if fbc is active
Date: Fri, 28 Feb 2025 11:37:59 +0200	[thread overview]
Message-ID: <20250228093802.27091-7-vinod.govindapillai@intel.com> (raw)
In-Reply-To: <20250228093802.27091-1-vinod.govindapillai@intel.com>

If FBC is already active, we don't need to call FBC activate
routine again unless there are changes to the fences. So skip
this on all platforms that don't have fences. Any FBC register
updates done after enabling the dirty rect support in xe3 will
trigger nuke by FBC which is counter productive to the fbc
dirty rect feature.

The front buffer rendering sequence will call intel_fbc_flush()
and which will call intel_fbc_nuke() or intel_fbc_activate()
based on FBC status explicitly and won't get impacted by this
change.

v2: use HAS_FBC_DIRTY_RECT()
    move this functionality within intel_fbc_activate()

v3: update to intel_fbc_activate logic (Ville)
    update to the patch description

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Vinod Govindapillai <vinod.govindapillai@intel.com>
---
 drivers/gpu/drm/i915/display/intel_fbc.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/gpu/drm/i915/display/intel_fbc.c b/drivers/gpu/drm/i915/display/intel_fbc.c
index 33142427f121..ca44cec73fd2 100644
--- a/drivers/gpu/drm/i915/display/intel_fbc.c
+++ b/drivers/gpu/drm/i915/display/intel_fbc.c
@@ -734,8 +734,19 @@ static void intel_fbc_nuke(struct intel_fbc *fbc)
 
 static void intel_fbc_activate(struct intel_fbc *fbc)
 {
+	struct intel_display *display = fbc->display;
+
 	lockdep_assert_held(&fbc->lock);
 
+	/* only the fence can change for a flip nuke */
+	if (fbc->active && !intel_fbc_has_fences(display))
+		return;
+	/*
+	 * In case of FBC dirt rect, any updates to the FBC registers will
+	 * trigger the nuke.
+	 */
+	drm_WARN_ON(display->drm, fbc->active && HAS_FBC_DIRTY_RECT(display));
+
 	intel_fbc_hw_activate(fbc);
 	intel_fbc_nuke(fbc);
 
-- 
2.43.0


  parent reply	other threads:[~2025-02-28  9:38 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-28  9:37 [PATCH v10 0/9] [PATCH v9 0/8] drm/i915/fbc: FBC Dirty rect feature support Vinod Govindapillai
2025-02-28  9:37 ` [PATCH v10 1/9] drm/i915/fbc: remove one duplicate forward declaration Vinod Govindapillai
2025-02-28  9:43   ` Jani Nikula
2025-02-28  9:37 ` [PATCH v10 2/9] drm/damage-helper: add const qualifier in drm_atomic_helper_damage_merged() Vinod Govindapillai
2025-03-02  8:47   ` Govindapillai, Vinod
2025-03-03  9:16     ` Jani Nikula
2025-02-28  9:37 ` [PATCH v10 3/9] drm/i915/display: update and store the plane damage clips Vinod Govindapillai
2025-02-28  9:37 ` [PATCH v10 4/9] drm/i915/fbc: add register definitions for fbc dirty rect support Vinod Govindapillai
2025-02-28  9:37 ` [PATCH v10 5/9] drm/i915/fbc: introduce HAS_FBC_DIRTY_RECT() for FBC " Vinod Govindapillai
2025-02-28  9:37 ` Vinod Govindapillai [this message]
2025-02-28  9:38 ` [PATCH v10 7/9] drm/i915/fbc: dirty rect support for FBC Vinod Govindapillai
2025-02-28  9:38 ` [PATCH v10 8/9] drm/i915/fbc: disable FBC if PSR2 selective fetch is enabled Vinod Govindapillai
2025-02-28  9:38 ` [PATCH v10 9/9] drm/i915/fbc: handle dirty rect coords for the first frame Vinod Govindapillai
2025-02-28 11:13 ` ✓ CI.Patch_applied: success for drm/i915/fbc: FBC Dirty rect feature support (rev4) Patchwork
2025-02-28 11:14 ` ✗ CI.checkpatch: warning " Patchwork
2025-02-28 11:16 ` ✓ CI.KUnit: success " Patchwork
2025-02-28 11:37 ` ✓ CI.Build: " Patchwork
2025-02-28 11:39 ` ✓ CI.Hooks: " Patchwork
2025-02-28 11:41 ` ✗ CI.checksparse: warning " Patchwork
2025-02-28 12:00 ` ✓ Xe.CI.BAT: success " Patchwork
2025-02-28 17:19 ` ✗ Xe.CI.Full: failure " Patchwork
2025-02-28 18:11   ` Govindapillai, Vinod

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=20250228093802.27091-7-vinod.govindapillai@intel.com \
    --to=vinod.govindapillai@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=jani.nikula@intel.com \
    --cc=jani.saarinen@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox