[PATCH i-g-t v1 1/2] tests/kms_atomic: Add necessary checks to ensure proper cleanup
Samala, Pranay
pranay.samala at intel.com
Fri Feb 7 06:35:50 UTC 2025
> -----Original Message-----
> From: igt-dev <igt-dev-bounces at lists.freedesktop.org> On Behalf Of Naladala
> Ramanaidu
> Sent: Saturday, February 1, 2025 12:46 AM
> To: igt-dev at lists.freedesktop.org
> Cc: Sharma, Swati2 <swati2.sharma at intel.com>; Naladala, Ramanaidu
> <ramanaidu.naladala at intel.com>
> Subject: [PATCH i-g-t v1 1/2] tests/kms_atomic: Add necessary checks to ensure
> proper cleanup
>
> Stop CRC and free up CRC resources to prevent memory leaks.
>
> Signed-off-by: Naladala Ramanaidu <ramanaidu.naladala at intel.com>
LGTM.
Reviewed-by: Pranay Samala <pranay.samala at intel.com>
> ---
> tests/kms_atomic.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/tests/kms_atomic.c b/tests/kms_atomic.c index
> 489b0d709..8fb26a079 100644
> --- a/tests/kms_atomic.c
> +++ b/tests/kms_atomic.c
> @@ -506,6 +506,10 @@ plane_immutable_zpos(data_t *data, igt_output_t
> *output, enum pipe pipe, int n_p
> DRM_FORMAT_XRGB8888,
> DRM_FORMAT_MOD_LINEAR,
> 0.0, 0.0, 1.0, &fb_lower);
> + if (!fb_id_lower) {
> + igt_pipe_crc_stop(pipe_crc);
> + igt_pipe_crc_free(pipe_crc);
> + }
> igt_assert(fb_id_lower);
>
> fb_id_upper = igt_create_color_fb(data->drm_fd, @@ -513,6 +517,10
> @@ plane_immutable_zpos(data_t *data, igt_output_t *output, enum pipe pipe,
> int n_p
> DRM_FORMAT_XRGB8888,
> DRM_FORMAT_MOD_LINEAR,
> 1.0, 1.0, 0.0, &fb_upper);
> + if (!fb_id_upper) {
> + igt_pipe_crc_stop(pipe_crc);
> + igt_pipe_crc_free(pipe_crc);
> + }
> igt_assert(fb_id_upper);
>
> /*
> @@ -560,6 +568,8 @@ plane_immutable_zpos(data_t *data, igt_output_t
> *output, enum pipe pipe, int n_p
> igt_plane_set_fb(plane_upper, NULL);
> }
>
> + igt_pipe_crc_stop(pipe_crc);
> + igt_pipe_crc_free(pipe_crc);
> igt_remove_fb(data->drm_fd, &fb_ref);
> igt_remove_fb(data->drm_fd, &fb_lower);
> igt_remove_fb(data->drm_fd, &fb_upper);
> --
> 2.25.1
More information about the igt-dev
mailing list