From: Vinod Govindapillai <vinod.govindapillai@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: vinod.govindapillai@intel.com, jouni.hogander@intel.com,
jeevan.b@intel.com, jani.saarinen@intel.com
Subject: [PATCH i-g-t v3 2/2] lib/i915/fbc: update fbc support based on psr mode
Date: Thu, 27 Mar 2025 10:03:58 +0200 [thread overview]
Message-ID: <20250327080358.559968-3-vinod.govindapillai@intel.com> (raw)
In-Reply-To: <20250327080358.559968-1-vinod.govindapillai@intel.com>
Combination of fbc and psr modes (psr1, psr2 and pr) depends on
display version. Consolidate this fbc combination check into
one place and update the relevent tests to use this consolidated
function
Signed-off-by: Vinod Govindapillai <vinod.govindapillai@intel.com>
---
lib/i915/intel_fbc.c | 47 ++++++++++++++++++++++++++++++---------
lib/i915/intel_fbc.h | 4 +++-
tests/intel/kms_psr.c | 10 ++++++---
tests/intel/kms_psr2_sf.c | 9 +++++---
4 files changed, 52 insertions(+), 18 deletions(-)
diff --git a/lib/i915/intel_fbc.c b/lib/i915/intel_fbc.c
index 3971e4920..a8ded0a59 100644
--- a/lib/i915/intel_fbc.c
+++ b/lib/i915/intel_fbc.c
@@ -6,6 +6,7 @@
#include <fcntl.h>
#include "igt.h"
+#include "igt_psr.h"
#include "intel_fbc.h"
@@ -156,22 +157,46 @@ bool intel_fbc_plane_size_supported(int fd, uint32_t width, uint32_t height)
}
/**
- * intel_fbc_psr_combo_supported
+ * intel_fbc_supported_for_psr_mode
*
- * @fd: fd of the device
+ * @disp_ver: Display version
+ * @mode: psr mode
*
- * FBC PSR combination support depends on the display version.
+ * FBC and PSR1/PSR2/PR combination support depends on the display version.
*
* Returns:
- * true if FBC and PSR can be enabled together in a platform
+ * true if FBC and the given PSR mode can be enabled together in a platform
*/
-bool intel_fbc_psr_combo_supported(int device)
+bool intel_fbc_supported_for_psr_mode(int disp_ver, enum psr_mode mode)
{
- int ver = intel_display_ver(intel_get_drm_devid(device));
-
- /* In Xe3 FBC PSR combo not supported because of FBC dirty rect */
- if (ver >= 20 && ver < 30)
- return true;
+ bool fbc_supported = true;
+
+ switch(mode) {
+ case PSR_MODE_1:
+ /* TODO: Update this to exclude MTL C0 onwards from this list */
+ if (disp_ver >= 12 && disp_ver <= 14)
+ fbc_supported = false;
+ break;
+ case PSR_MODE_2:
+ case PSR_MODE_2_SEL_FETCH:
+ case PSR_MODE_2_ET:
+ case PR_MODE_SEL_FETCH:
+ case PR_MODE_SEL_FETCH_ET:
+ /*
+ * FBC is not supported if PSR2 is enabled in display version 12 to 14.
+ * According to the xe2lpd+ requirements, display driver need to
+ * implement a selection logic between FBC and PSR2/Panel Replay selective
+ * update based on dirty region threshold. Until that is implemented,
+ * keep FBC disabled if PSR2/PR selective update is on.
+ *
+ * TODO: Update this based on the selection logic in the driver
+ */
+ fbc_supported = false;
+ break;
+ case PR_MODE:
+ default:
+ break;
+ }
- return false;
+ return fbc_supported;
}
diff --git a/lib/i915/intel_fbc.h b/lib/i915/intel_fbc.h
index 0abd18478..fcafe6049 100644
--- a/lib/i915/intel_fbc.h
+++ b/lib/i915/intel_fbc.h
@@ -11,11 +11,13 @@
#define intel_fbc_enable(device) igt_set_module_param_int(device, "enable_fbc", 1)
#define intel_fbc_disable(device) igt_set_module_param_int(device, "enable_fbc", 0)
+enum psr_mode;
+
bool intel_fbc_supported_on_chipset(int device, enum pipe pipe);
bool intel_fbc_wait_until_enabled(int device, enum pipe pipe);
bool intel_fbc_is_enabled(int device, enum pipe pipe, int log_level);
void intel_fbc_max_plane_size(int fd, uint32_t *width, uint32_t *height);
bool intel_fbc_plane_size_supported(int device, uint32_t width, uint32_t height);
-bool intel_fbc_psr_combo_supported(int device);
+bool intel_fbc_supported_for_psr_mode(int disp_ver, enum psr_mode mode);
#endif
diff --git a/tests/intel/kms_psr.c b/tests/intel/kms_psr.c
index a83d90194..1fdb565fa 100644
--- a/tests/intel/kms_psr.c
+++ b/tests/intel/kms_psr.c
@@ -781,6 +781,8 @@ igt_main
int modes[] = {PSR_MODE_1, PSR_MODE_2, PR_MODE};
int fbc_status[] = {FBC_DISABLED, FBC_ENABLED};
igt_output_t *output;
+ bool fbc_chipset_support;
+ int disp_ver;
igt_fixture {
data.drm_fd = drm_open_driver_master(DRIVER_INTEL | DRIVER_XE);
@@ -790,15 +792,17 @@ igt_main
data.bops = buf_ops_create(data.drm_fd);
igt_display_require(&data.display, data.drm_fd);
igt_require_f(output_supports_psr(&data), "Sink does not support PSR/PSR2/PR\n");
- if (intel_fbc_supported_on_chipset(data.drm_fd, pipe) &&
- intel_fbc_psr_combo_supported(data.drm_fd))
- data.fbc_flag = true;
+ disp_ver = intel_display_ver(data.devid);
+ fbc_chipset_support = intel_fbc_supported_on_chipset(data.drm_fd, pipe);
}
for (y = 0; y < ARRAY_SIZE(fbc_status); y++) {
data.op_fbc_mode = fbc_status[y];
for (z = 0; z < ARRAY_SIZE(modes); z++) {
data.op_psr_mode = modes[z];
+ data.fbc_flag = fbc_chipset_support &&
+ intel_fbc_supported_for_psr_mode(disp_ver,
+ data.op_psr_mode);
igt_describe("Basic check for psr if it is detecting changes made "
"in planes");
diff --git a/tests/intel/kms_psr2_sf.c b/tests/intel/kms_psr2_sf.c
index 4c9847692..68842b020 100644
--- a/tests/intel/kms_psr2_sf.c
+++ b/tests/intel/kms_psr2_sf.c
@@ -1190,6 +1190,8 @@ igt_main
"pr-"
};
int psr_status[] = {PSR_MODE_2, PR_MODE_SEL_FETCH};
+ bool fbc_chipset_support;
+ int disp_ver;
igt_fixture {
drmModeResPtr res;
@@ -1200,9 +1202,8 @@ igt_main
display_init(&data);
- if (intel_fbc_supported_on_chipset(data.drm_fd, data.pipe) &&
- intel_fbc_psr_combo_supported(data.drm_fd))
- data.fbc_flag = true;
+ disp_ver = intel_display_ver(intel_get_drm_devid(data.drm_fd));
+ fbc_chipset_support = intel_fbc_supported_on_chipset(data.drm_fd, data.pipe);
data.damage_area_count = MAX_DAMAGE_AREAS;
data.primary_format = DRM_FORMAT_XRGB8888;
@@ -1240,6 +1241,8 @@ igt_main
data.op_fbc_mode = fbc_status[y];
data.psr_mode = psr_status[z];
+ data.fbc_flag = fbc_chipset_support &&
+ intel_fbc_supported_for_psr_mode(disp_ver, data.psr_mode);
/* Verify primary plane selective fetch */
igt_describe("Test that selective fetch works on primary plane");
--
2.43.0
next prev parent reply other threads:[~2025-03-27 8:04 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-27 8:03 [PATCH i-g-t v3 0/2] lib/i915/fbc: update fbc support based on psr mode Vinod Govindapillai
2025-03-27 8:03 ` [PATCH i-g-t v3 1/2] Revert "tests/intel/kms_frontbuffer_tracking: update to FBC support check" Vinod Govindapillai
2025-03-27 8:03 ` Vinod Govindapillai [this message]
2025-04-07 5:57 ` [PATCH i-g-t v3 2/2] lib/i915/fbc: update fbc support based on psr mode Reddy Guddati, Santhosh
2025-03-27 10:47 ` ✓ Xe.CI.BAT: success for lib/i915/fbc: update fbc support based on psr mode (rev2) Patchwork
2025-03-27 11:05 ` ✓ i915.CI.BAT: " Patchwork
2025-03-27 12:37 ` ✗ i915.CI.Full: failure " Patchwork
2025-03-27 17:27 ` ✗ Xe.CI.Full: " Patchwork
2025-03-28 12:22 ` Patchwork
2025-03-29 0:30 ` ✓ i915.CI.BAT: success for lib/i915/fbc: update fbc support based on psr mode (rev3) Patchwork
2025-03-29 0:37 ` ✓ Xe.CI.BAT: " Patchwork
2025-03-29 5:36 ` ✗ i915.CI.Full: failure " Patchwork
2025-03-31 12:06 ` Govindapillai, Vinod
2025-03-29 18:18 ` ✗ Xe.CI.Full: " Patchwork
2025-03-31 12:07 ` Govindapillai, Vinod
2025-03-31 10:11 ` [PATCH i-g-t v3 0/2] lib/i915/fbc: update fbc support based on psr mode Hogander, Jouni
2025-04-06 16:45 ` ✗ Xe.CI.Full: failure for lib/i915/fbc: update fbc support based on psr mode (rev2) Patchwork
2025-04-06 19:25 ` ✗ Xe.CI.Full: failure for lib/i915/fbc: update fbc support based on psr mode (rev3) 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=20250327080358.559968-3-vinod.govindapillai@intel.com \
--to=vinod.govindapillai@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=jani.saarinen@intel.com \
--cc=jeevan.b@intel.com \
--cc=jouni.hogander@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