[igt-dev] [PATCH 2/2] amdgpu_amd_plane: Add Multi MPO invalid test
Leo Li
sunpeng.li at amd.com
Fri Feb 17 20:38:05 UTC 2023
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 <Bhawanpreet.Lakha at amd.com>
> Change-Id: Ida52c3cbb6e59ed4759496e2a3fc35255bf522e0
With Change-Id removed,
Reviewed-by: Leo Li <sunpeng.li at amd.com>
> ---
> 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);
More information about the igt-dev
mailing list