From: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: ville.syrjala@intel.com, martin.peres@intel.com,
stanislav.lisovskiy@intel.com
Subject: [igt-dev] [PATCH i-g-t v2 2/2] igt/tests: Tolerate if kernel can't have all planes
Date: Fri, 29 Mar 2019 16:07:31 +0200 [thread overview]
Message-ID: <20190329140731.607-3-stanislav.lisovskiy@intel.com> (raw)
In-Reply-To: <20190329140731.607-1-stanislav.lisovskiy@intel.com>
With some upcoming changes i915 might not allow
all sprite planes enabled, depending on available
bandwidth limitation. Thus the test need to decrement
amount of planes and try again, instead of panicking.
Signed-off-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
---
tests/kms_atomic_transition.c | 30 ++++++++++++++++++++++--------
1 file changed, 22 insertions(+), 8 deletions(-)
diff --git a/tests/kms_atomic_transition.c b/tests/kms_atomic_transition.c
index 638fe17e..e4dee7e2 100644
--- a/tests/kms_atomic_transition.c
+++ b/tests/kms_atomic_transition.c
@@ -214,7 +214,8 @@ static void setup_parms(igt_display_t *display, enum pipe pipe,
uint32_t n_planes = display->pipes[pipe].n_planes;
uint32_t n_overlays = 0, overlays[n_planes];
igt_plane_t *plane;
- uint32_t iter_mask = 3;
+ uint32_t iter_mask;
+ int retries = n_planes - 1;
do_or_die(drmGetCap(display->drm_fd, DRM_CAP_CURSOR_WIDTH, &cursor_width));
if (cursor_width >= mode->hdisplay)
@@ -224,6 +225,10 @@ static void setup_parms(igt_display_t *display, enum pipe pipe,
if (cursor_height >= mode->vdisplay)
cursor_height = mode->vdisplay;
+retry:
+ n_overlays = 0;
+ iter_mask = 3;
+
for_each_plane_on_pipe(display, pipe, plane) {
int i = plane->index;
@@ -278,7 +283,6 @@ static void setup_parms(igt_display_t *display, enum pipe pipe,
* Pre gen9 not all sizes are supported, find the biggest possible
* size that can be enabled on all sprite planes.
*/
-retry:
prev_w = sprite_width = cursor_width;
prev_h = sprite_height = cursor_height;
@@ -298,12 +302,22 @@ retry:
if (is_atomic_check_plane_size_errno(ret)) {
if (cursor_width == sprite_width &&
cursor_height == sprite_height) {
- igt_assert_f(alpha,
- "Cannot configure the test with all sprite planes enabled\n");
-
- /* retry once with XRGB format. */
- alpha = false;
- goto retry;
+ if (--retries >= 0) {
+ /* retry once with XRGB format. */
+ if (alpha) {
+ alpha = false;
+ }
+ else if (display->pipes[pipe].n_planes > 0) {
+ display->pipes[pipe].n_planes--;
+ igt_warn("Reduced available planes to %d\n",
+ display->pipes[pipe].n_planes);
+ }
+ n_planes = display->pipes[pipe].n_planes;
+ igt_assert_f(n_planes > 0, "No planes left to proceed with!");
+ goto retry;
+ }
+ igt_assert_f(retries > 0,
+ "Cannot configure the test with all sprite planes enabled\n");
}
sprite_width = prev_w;
--
2.17.1
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
next prev parent reply other threads:[~2019-03-29 14:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-29 14:07 [igt-dev] [PATCH i-g-t v2 0/2] kms_atomic_transition improvements Stanislav Lisovskiy
2019-03-29 14:07 ` [igt-dev] [PATCH i-g-t v2 1/2] igt/tests/kms_atomic_transition: Skip transition, if no changes done Stanislav Lisovskiy
2019-03-29 14:07 ` Stanislav Lisovskiy [this message]
2019-03-29 14:59 ` [igt-dev] ✓ Fi.CI.BAT: success for kms_atomic_transition improvements (rev2) Patchwork
2019-03-29 17:20 ` [igt-dev] ✓ Fi.CI.IGT: " 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=20190329140731.607-3-stanislav.lisovskiy@intel.com \
--to=stanislav.lisovskiy@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=martin.peres@intel.com \
--cc=ville.syrjala@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