[igt-dev] [PATCH i-g-t] tests/kms_plane_multiple: don't disable primary plane
Juha-Pekka Heikkila
juhapekka.heikkila at gmail.com
Tue Jan 5 16:47:54 UTC 2021
Hi Simon,
On 5.1.2021 17.23, Simon Ser wrote:
> Some drivers such as amdgpu don't support disabling the primary plane
> while keeping the CRTC active. Additionally, opening the CRC debugfs
> file while the CRTC is inactive will error out.
>
> Keep the primary plane active to accomodate for this.
>
> Signed-off-by: Simon Ser <contact at emersion.fr>
> Cc: Ville Syrjälä <ville.syrjala at linux.intel.com>
> Cc: Petri Latvala <petri.latvala at intel.com>
> Cc: Mika Kahola <mika.kahola at intel.com>
> ---
> tests/kms_plane_multiple.c | 14 ++++++++++----
> 1 file changed, 10 insertions(+), 4 deletions(-)
>
> diff --git a/tests/kms_plane_multiple.c b/tests/kms_plane_multiple.c
> index 8310981cf9fa..8167e781918a 100644
> --- a/tests/kms_plane_multiple.c
> +++ b/tests/kms_plane_multiple.c
> @@ -313,12 +313,15 @@ test_plane_position_with_output(data_t *data, enum pipe pipe,
> prepare_planes(data, pipe, &blue, tiling, c, output);
> err = igt_display_try_commit2(&data->display, COMMIT_ATOMIC);
>
> + /* Some drivers can't light up a CRTC without the primary plane
> + * enabled. */
> for_each_plane_on_pipe(&data->display, pipe, plane)
> - igt_plane_set_fb(plane, NULL);
> + if (plane->type != DRM_PLANE_TYPE_PRIMARY)
> + igt_plane_set_fb(plane, NULL);
>
> igt_display_commit2(&data->display, COMMIT_ATOMIC);
>
> - for (int x = 0; x < c; x++)
> + for (int x = 1; x < c; x++)
> igt_remove_fb(data->drm_fd, &data->fb[x]);
I think you will leak here primary plane fb for each round of loop when
prepare_planes(..) will always create new one.
> } while (!err && c < n_planes);
>
> @@ -340,12 +343,15 @@ test_plane_position_with_output(data_t *data, enum pipe pipe,
>
> igt_pipe_crc_get_current(data->display.drm_fd, data->pipe_crc, &crc);
>
> + /* Some drivers can't light up a CRTC without the primary plane
> + * enabled. */
> for_each_plane_on_pipe(&data->display, pipe, plane)
> - igt_plane_set_fb(plane, NULL);
> + if (plane->type != DRM_PLANE_TYPE_PRIMARY)
> + igt_plane_set_fb(plane, NULL);
>
> igt_display_commit2(&data->display, COMMIT_ATOMIC);
>
> - for (int x = 0; x < c; x++)
> + for (int x = 1; x < c; x++)
> igt_remove_fb(data->drm_fd, &data->fb[x]);
Here same as above.
>
> igt_assert_crc_equal(&data->ref_crc, &crc);
>
More information about the igt-dev
mailing list