From: Ville Syrjala <ville.syrjala@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [PATCH i-g-t 1/2] tests/kms_async_flips: Extend the "async flip needs an extra frame" logic
Date: Fri, 22 Mar 2024 22:37:25 +0200 [thread overview]
Message-ID: <20240322203726.16637-1-ville.syrjala@linux.intel.com> (raw)
From: Ville Syrjälä <ville.syrjala@linux.intel.com>
Soon i915 will be converting the first async flip always to
a sync flip on SKL+. The reason being that Xorg/modesetting
typically attempts to change the modifier when it issues the
first async flip, and we can't do that with an actual async
flip.
Extend the logic to consider all platforms that need the
extra frame, which will now be:
- BDW-GLK due to the async flip hw double buffer fail
- SKL+ to change the modifier
- ADL+ to optimize watermarks/DDB
Note that the 'AT_LEAST_GEN(devid, 12)' already included
TGL in this logic despite the kernel not actually forcing
any sync flips on it previously. So only ICL was being
correctly excluded here. Also BDW wasn't being included
despite needing it due to the double buffer fail.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
tests/kms_async_flips.c | 46 +++++++++++++++++++++++++----------------
1 file changed, 28 insertions(+), 18 deletions(-)
diff --git a/tests/kms_async_flips.c b/tests/kms_async_flips.c
index 2895168f7dc7..efbc8778d7e1 100644
--- a/tests/kms_async_flips.c
+++ b/tests/kms_async_flips.c
@@ -233,6 +233,28 @@ static void test_init_fbs(data_t *data)
igt_plane_set_size(data->plane, width, height);
}
+static bool async_flip_needs_extra_frame(data_t *data)
+{
+ uint32_t devid;
+
+ if (!is_intel_device(data->drm_fd))
+ return false;
+
+ devid = intel_get_drm_devid(data->drm_fd);
+
+ /*
+ * On BDW-GLK async address update bit is double buffered
+ * on vblank. So the first async flip will in fact be
+ * performed as a sync flip by the hardware.
+ *
+ * In order to allow the first async flip to change the modifier
+ * on SKL+ (needed by Xorg/modesetting), and to optimize
+ * watermarks/ddb for faster response on ADL+, we convert the
+ * first async flip to a sync flip.
+ */
+ return intel_display_ver(devid) >= 9 || IS_BROADWELL(devid);
+}
+
static void test_async_flip(data_t *data)
{
int ret, frame;
@@ -259,26 +281,14 @@ static void test_async_flip(data_t *data)
flags |= DRM_MODE_PAGE_FLIP_ASYNC;
- /*
- * In older platforms (<= Gen10), async address update bit is double buffered.
- * So flip timestamp can be verified only from the second flip.
- * The first async flip just enables the async address update.
- * In platforms greater than DISPLAY13 the first async flip will be discarded
- * in order to change the watermark levels as per the optimization. Hence the
- * subsequent async flips will actually do the asynchronous flips.
- */
- if (is_intel_device(data->drm_fd)) {
- uint32_t devid = intel_get_drm_devid(data->drm_fd);
+ if (async_flip_needs_extra_frame(data)) {
+ ret = drmModePageFlip(data->drm_fd, data->crtc_id,
+ data->bufs[frame % NUM_FBS].fb_id,
+ flags, data);
- if (IS_GEN9(devid) || IS_GEN10(devid) || AT_LEAST_GEN(devid, 12)) {
- ret = drmModePageFlip(data->drm_fd, data->crtc_id,
- data->bufs[frame % NUM_FBS].fb_id,
- flags, data);
+ igt_assert(ret == 0);
- igt_assert(ret == 0);
-
- wait_flip_event(data);
- }
+ wait_flip_event(data);
}
}
--
2.43.2
next reply other threads:[~2024-03-22 20:37 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-22 20:37 Ville Syrjala [this message]
2024-03-22 20:37 ` [PATCH i-g-t 2/2] tests/kms_async_flips: Allow the first async flip to change modifier Ville Syrjala
2024-04-11 10:15 ` Kulkarni, Vandita
2024-03-22 23:03 ` ✓ CI.xeBAT: success for series starting with [i-g-t,1/2] tests/kms_async_flips: Extend the "async flip needs an extra frame" logic Patchwork
2024-03-22 23:17 ` ✓ Fi.CI.BAT: " Patchwork
2024-03-23 22:37 ` ✗ Fi.CI.IGT: failure " Patchwork
2024-04-11 10:15 ` [PATCH i-g-t 1/2] " Kulkarni, Vandita
2024-04-26 16:44 ` ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/2] tests/kms_async_flips: Extend the "async flip needs an extra frame" logic (rev2) Patchwork
2024-04-26 17:25 ` ✓ CI.xeBAT: " Patchwork
2024-04-26 21:14 ` ✓ Fi.CI.IGT: " Patchwork
2024-04-26 22:03 ` ✗ CI.xeFULL: failure " 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=20240322203726.16637-1-ville.syrjala@linux.intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=igt-dev@lists.freedesktop.org \
/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