From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
To: Matt Roper <matthew.d.roper@intel.com>, intel-gfx@lists.freedesktop.org
Subject: [PATCH i-g-t] kms_universal_plane: Add testcase for when no plane is visible on the crtc.
Date: Mon, 13 Jun 2016 11:38:05 +0200 [thread overview]
Message-ID: <b6fcae1f-f400-4d4e-bf0c-dc790af18212@linux.intel.com> (raw)
In-Reply-To: <ca09962a-4d65-3ef7-3202-e48a2a32ad0d@linux.intel.com>
It's completely valid to have a crtc with no active planes, or
only with planes that are invisible. The cursor-only-pipe-* test
will try to set the crtc in a configuration where only the cursor is
visible, then hide the cursor at negative coordinates so no plane is
visible, and finally disables the cursor altogether.
This triggers a WARN_ON in the kernel:
WARN_ON(cstate->plane_mask && total_data_rate == 0);
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
diff --git a/tests/kms_universal_plane.c b/tests/kms_universal_plane.c
index b06b51e6934c..30590ebd6a4b 100644
--- a/tests/kms_universal_plane.c
+++ b/tests/kms_universal_plane.c
@@ -739,6 +739,59 @@ gen9_test_pipe(data_t *data, enum pipe pipe, igt_output_t *output)
}
static void
+cursor_only_test_pipe(data_t *data, enum pipe pipe, igt_output_t *output)
+{
+ igt_display_t *display = &data->display;
+ igt_plane_t *primary, *cursor;
+ drmModeModeInfo *mode;
+ struct igt_fb background_fb, cursor_fb;
+
+ igt_assert(data->display.has_universal_planes);
+ igt_skip_on(pipe >= display->n_pipes);
+
+ igt_output_set_pipe(output, pipe);
+ mode = igt_output_get_mode(output);
+
+ primary = igt_output_get_plane(output, IGT_PLANE_PRIMARY);
+ cursor = igt_output_get_plane(output, IGT_PLANE_CURSOR);
+ if (!primary || !cursor)
+ igt_skip("Primary and/or cursor are unavailable\n");
+
+ igt_create_color_fb(data->drm_fd, mode->hdisplay, mode->vdisplay,
+ DRM_FORMAT_XRGB8888,
+ false,
+ 0.0, 0.0, 0.0,
+ &background_fb);
+
+ igt_create_color_fb(data->drm_fd, 64, 64,
+ DRM_FORMAT_ARGB8888,
+ false, 0xff, 0xff, 0xff,
+ &cursor_fb);
+
+ igt_plane_set_fb(primary, &background_fb);
+ igt_display_commit2(display, COMMIT_LEGACY);
+
+ /* Test with only cursor as active plane. */
+ igt_plane_set_fb(primary, NULL);
+ igt_plane_set_position(cursor, 100, 100);
+ igt_plane_set_fb(cursor, &cursor_fb);
+ igt_display_commit2(display, COMMIT_UNIVERSAL);
+
+ /* Test with cursor as the only plane, hidden. */
+ igt_plane_set_position(cursor, -64, -64);
+ igt_display_commit2(display, COMMIT_UNIVERSAL);
+
+ /* Test with 0 active planes. */
+ igt_plane_set_fb(cursor, NULL);
+ igt_display_commit2(display, COMMIT_UNIVERSAL);
+
+ igt_remove_fb(data->drm_fd, &background_fb);
+ igt_remove_fb(data->drm_fd, &cursor_fb);
+
+ igt_output_set_pipe(output, PIPE_ANY);
+}
+
+static void
run_tests_for_pipe(data_t *data, enum pipe pipe)
{
igt_output_t *output;
@@ -767,6 +820,11 @@ run_tests_for_pipe(data_t *data, enum pipe pipe)
kmstest_pipe_name(pipe))
for_each_connected_output(&data->display, output)
gen9_test_pipe(data, pipe, output);
+
+ igt_subtest_f("cursor-only-pipe-%s",
+ kmstest_pipe_name(pipe))
+ for_each_connected_output(&data->display, output)
+ cursor_only_test_pipe(data, pipe, output);
}
static data_t data;
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2016-06-13 9:38 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-09 22:14 [PATCH 0/3] SKL watermark fixes for !fbcon Matt Roper
2016-06-09 22:14 ` [PATCH 1/3] drm/i915/gen9: Initialize intel_state->active_crtcs during WM sanitization Matt Roper
2016-06-13 8:59 ` Maarten Lankhorst
2016-06-13 9:02 ` Maarten Lankhorst
2016-06-13 14:49 ` Daniel Vetter
2016-06-17 21:00 ` Matt Roper
2016-06-20 12:44 ` Daniel Vetter
2016-06-09 22:14 ` [PATCH 2/3] drm/i915/gen9: Compute data rates for all planes on first commit Matt Roper
2016-06-13 9:04 ` Maarten Lankhorst
2016-06-13 14:50 ` Daniel Vetter
2016-06-17 21:03 ` Matt Roper
2016-06-20 12:47 ` Daniel Vetter
2016-06-09 22:14 ` [PATCH 3/3] drm/i915/gen9: Drop invalid WARN() during data rate calculation Matt Roper
2016-06-13 9:33 ` Maarten Lankhorst
2016-06-13 9:38 ` Maarten Lankhorst [this message]
2016-06-17 21:25 ` Matt Roper
2016-06-10 6:24 ` ✗ Ro.CI.BAT: failure for SKL watermark fixes for !fbcon Patchwork
2016-06-10 14:20 ` Matt Roper
2016-06-10 7:28 ` [PATCH 0/3] " Jani Nikula
2016-06-10 14:17 ` Matt Roper
2016-06-10 8:48 ` Tvrtko Ursulin
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=b6fcae1f-f400-4d4e-bf0c-dc790af18212@linux.intel.com \
--to=maarten.lankhorst@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=matthew.d.roper@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