Return-Path: Received: from mail-ua1-x92e.google.com (mail-ua1-x92e.google.com [IPv6:2607:f8b0:4864:20::92e]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2AF7D6E903 for ; Mon, 24 May 2021 18:42:56 +0000 (UTC) Received: by mail-ua1-x92e.google.com with SMTP id 14so9646438uac.9 for ; Mon, 24 May 2021 11:42:56 -0700 (PDT) From: Mark Yacoub Date: Mon, 24 May 2021 18:42:52 +0000 Message-Id: <20210524184252.1320366-1-markyacoub@chromium.org> MIME-Version: 1.0 Subject: [igt-dev] [PATCH] tests/kms_atomic: Match overlay size with primary plane on amdgpu List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" To: igt-dev@lists.freedesktop.org Cc: seanpaul@chromium.org, petri.latvala@intel.com, Mark Yacoub List-ID: From: Mark Yacoub [Why] AMDGPU has a restriction of not allowing overlay planes that do not fully cover the primary plane when the cursor is enabled. Testing with an overlay smaller than primary fails the commit. [How] On amdgpu, force the overlay size and src to match the primary plane, but test with a smaller size on all other platforms. Signed-off-by: markyacoub@chromium.org --- tests/kms_atomic.c | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/tests/kms_atomic.c b/tests/kms_atomic.c index df9c9df7..d5bfd38c 100644 --- a/tests/kms_atomic.c +++ b/tests/kms_atomic.c @@ -491,13 +491,27 @@ plane_immutable_zpos(igt_display_t *display, igt_pipe_t *pipe, igt_remove_fb(display->drm_fd, &fb_upper); } -static void plane_overlay(igt_pipe_t *pipe, igt_output_t *output, igt_plane_t *plane) +static void plane_overlay(igt_pipe_t* pipe, igt_output_t* output, igt_plane_t* plane, int drm_fd) { drmModeModeInfo *mode = igt_output_get_mode(output); uint32_t format = plane_get_igt_format(plane); struct igt_fb fb; - uint32_t w = mode->hdisplay / 2; - uint32_t h = mode->vdisplay / 2; + uint32_t w, h, x, y; + + /* On AMD, with hardware cursor, overlay plane must fully cover the primary plane. + * Test with smaller overlays on all other platforms. */ + if (is_amdgpu_device(drm_fd)) { + w = mode->hdisplay; + h = mode->vdisplay; + x = 0; + y = 0; + } + else { + w = mode->hdisplay / 2; + h = mode->vdisplay / 2; + x = w / 2; + y = h / 2; + } igt_require(format != 0); @@ -505,7 +519,7 @@ static void plane_overlay(igt_pipe_t *pipe, igt_output_t *output, igt_plane_t *p format, I915_TILING_NONE, &fb); igt_plane_set_fb(plane, &fb); - igt_plane_set_position(plane, w/2, h/2); + igt_plane_set_position(plane, x, y); /* Enable the overlay plane using the atomic API, and double-check * state is what we think it should be. */ @@ -519,7 +533,7 @@ static void plane_overlay(igt_pipe_t *pipe, igt_output_t *output, igt_plane_t *p /* Re-enable the plane through the legacy plane API, and verify through * atomic. */ igt_plane_set_fb(plane, &fb); - igt_plane_set_position(plane, w/2, h/2); + igt_plane_set_position(plane, x, y); plane_commit(plane, COMMIT_LEGACY, ATOMIC_RELAX_NONE); /* Restore the plane to its original settings through the legacy plane @@ -1113,7 +1127,7 @@ igt_main igt_require(overlay); atomic_setup(&display, pipe, output, primary, &fb); - plane_overlay(pipe_obj, output, overlay); + plane_overlay(pipe_obj, output, overlay, display.drm_fd); } igt_describe("Test for KMS atomic modesetting on primary plane and ensure coherency between " -- 2.31.1.818.g46aad6cb9e-goog _______________________________________________ igt-dev mailing list igt-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/igt-dev