From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2065.outbound.protection.outlook.com [40.107.237.65]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0BA2010E45F for ; Fri, 17 Feb 2023 20:38:14 +0000 (UTC) Message-ID: <8307c87d-e96c-ee2d-48bb-a2964a349e31@amd.com> Date: Fri, 17 Feb 2023 15:38:05 -0500 Content-Language: en-US To: Bhawanpreet Lakha , igt-dev@lists.freedesktop.org, rodrigo.siqueira@amd.com, harry.wentland@amd.com, nicholas.kazlauskas@amd.com References: <20230213181651.863367-1-Bhawanpreet.Lakha@amd.com> <20230213181651.863367-2-Bhawanpreet.Lakha@amd.com> From: Leo Li In-Reply-To: <20230213181651.863367-2-Bhawanpreet.Lakha@amd.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit MIME-Version: 1.0 Subject: Re: [igt-dev] [PATCH 2/2] amdgpu_amd_plane: Add Multi MPO invalid test List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" List-ID: On 2/13/23 13:16, Bhawanpreet Lakha wrote: > [Why] > We cannot draw cursor on a video plane so if the usermode trys to use > the topmost plane as a video plane we should reject that commit > > [How] > Trying to use a video format (NV12) as the topmost plane should fail > atomic check > > Signed-off-by: Bhawanpreet Lakha > Change-Id: Ida52c3cbb6e59ed4759496e2a3fc35255bf522e0 With Change-Id removed, Reviewed-by: Leo Li > --- > tests/amdgpu/amd_plane.c | 55 ++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 55 insertions(+) > > diff --git a/tests/amdgpu/amd_plane.c b/tests/amdgpu/amd_plane.c > index d34cd1d9..46f90c6c 100644 > --- a/tests/amdgpu/amd_plane.c > +++ b/tests/amdgpu/amd_plane.c > @@ -557,6 +557,57 @@ static void test_panning_2_display(data_t *data, int w, int h, struct fbc *fbc) > > } > > +/* > + * This tests invalid plane format order > + * > + * Since we cannot draw a cursor on a video plane the top most plane cannot be a video plane. > + * This test trys to commit a configuration where the topmost plane is a video plane. This is > + * expected to fail since we do not support that configuration. > + */ > +static void test_multi_mpo_invalid(data_t *data) > +{ > + igt_display_t *display = &data->display; > + igt_output_t *output; > + uint32_t regamma_lut_size; > + lut_t lut; > + struct fbc fb[4]; > + int valid_outputs = 0; > + int w, h; > + int ret; > + > + test_init(data); > + > + w = data->w[0]; > + h = data->h[0]; > + > + /* Skip test if we don't have 2 overlay planes */ > + igt_skip_on(!data->overlay2[0]); > + > + igt_output_set_pipe(data->output[0], data->pipe_id[0]); > + > + igt_create_color_fb(data->fd, w, h, DRM_FORMAT_XRGB8888, 0, 1.0, 1.0, 1.0, &fb[0].test_primary); > + igt_create_fb(data->fd, w, h, DRM_FORMAT_NV12, 0, &fb[0].test_overlay); > + > + /* Top most plane is NV12 (video plane) */ > + igt_create_fb(data->fd, w, h, DRM_FORMAT_NV12, 0, &fb[0].test_overlay2); > + > + igt_plane_set_fb(data->primary[0], &fb[0].test_primary); > + igt_plane_set_fb(data->overlay[0], &fb[0].test_overlay); > + igt_plane_set_fb(data->overlay2[0], &fb[0].test_overlay2); > + > + /* This should fail as the topmost plane is NV12 */ > + ret = igt_display_try_commit_atomic(display, DRM_MODE_ATOMIC_TEST_ONLY, NULL); > + > + if (!ret) > + igt_assert(0); > + > + test_fini(data); > + > + igt_remove_fb(data->fd, &fb[0].test_primary); > + igt_remove_fb(data->fd, &fb[0].test_overlay); > + igt_remove_fb(data->fd, &fb[0].test_overlay2); > +} > + > /* > * Setup and runner for panning test. Creates common video sizes and pans them across the display > */ > @@ -924,6 +975,10 @@ igt_main > igt_subtest("multi-mpo") > test_display_mpo(&data, MPO_MULTI_OVERLAY, DRM_FORMAT_NV12, 1); > > + igt_describe("Multi MPO invalid"); > + igt_subtest("multi-mpo-invalid") > + test_multi_mpo_invalid(&data); > + > igt_describe("MPO and scaling RGB primary plane"); > igt_subtest("mpo-scale-rgb") > test_display_mpo(&data, MPO_SCALE, DRM_FORMAT_XRGB8888, 1);