[PATCH V7 03/37] lib/igt_kms: Move get_writeback_formats_blob to lib
Sharma, Swati2
swati2.sharma at intel.com
Thu Apr 3 06:41:27 UTC 2025
Hi Alex,
On 27-03-2025 05:05 am, Alex Hung wrote:
> From: Harry Wentland <harry.wentland at amd.com>
>
> We'll need it in other tests
>
> Signed-off-by: Harry Wentland <harry.wentland at amd.com>
> ---
> lib/igt_kms.c | 19 +++++++++++++++++++
> lib/igt_kms.h | 2 ++
> tests/kms_writeback.c | 19 -------------------
> 3 files changed, 21 insertions(+), 19 deletions(-)
>
> diff --git a/lib/igt_kms.c b/lib/igt_kms.c
> index 99c8707c7..884d78749 100644
> --- a/lib/igt_kms.c
> +++ b/lib/igt_kms.c
> @@ -7434,3 +7434,22 @@ int igt_backlight_write(int value, const char *fname, igt_backlight_context_t *c
>
> return 0;
> }
> +
> +drmModePropertyBlobRes *get_writeback_formats_blob(igt_output_t *output)
Please write function documentation comment.
> +{
> + drmModePropertyBlobRes *blob = NULL;
> + uint64_t blob_id;
> + int ret;
> +
> + ret = kmstest_get_property(output->display->drm_fd,
> + output->config.connector->connector_id,
> + DRM_MODE_OBJECT_CONNECTOR,
> + igt_connector_prop_names[IGT_CONNECTOR_WRITEBACK_PIXEL_FORMATS],
> + NULL, &blob_id, NULL);
> + if (ret)
> + blob = drmModeGetPropertyBlob(output->display->drm_fd, blob_id);
> +
> + igt_assert(blob);
> +
> + return blob;
> +}
> diff --git a/lib/igt_kms.h b/lib/igt_kms.h
> index 0381c82ad..9b5a940f7 100644
> --- a/lib/igt_kms.h
> +++ b/lib/igt_kms.h
> @@ -1280,4 +1280,6 @@ void igt_set_link_params(int drm_fd, igt_output_t *output,
> int igt_backlight_read(int *result, const char *fname, igt_backlight_context_t *context);
> int igt_backlight_write(int value, const char *fname, igt_backlight_context_t *context);
>
> +drmModePropertyBlobRes *get_writeback_formats_blob(igt_output_t *output);
> +
> #endif /* __IGT_KMS_H__ */
> diff --git a/tests/kms_writeback.c b/tests/kms_writeback.c
> index e3671c59b..f733f3ce6 100644
> --- a/tests/kms_writeback.c
> +++ b/tests/kms_writeback.c
> @@ -92,25 +92,6 @@ enum {
> XRGB2101010 = 1 << 1,
> };
>
> -static drmModePropertyBlobRes *get_writeback_formats_blob(igt_output_t *output)
> -{
> - drmModePropertyBlobRes *blob = NULL;
> - uint64_t blob_id;
> - int ret;
> -
> - ret = kmstest_get_property(output->display->drm_fd,
> - output->config.connector->connector_id,
> - DRM_MODE_OBJECT_CONNECTOR,
> - igt_connector_prop_names[IGT_CONNECTOR_WRITEBACK_PIXEL_FORMATS],
> - NULL, &blob_id, NULL);
> - if (ret)
> - blob = drmModeGetPropertyBlob(output->display->drm_fd, blob_id);
> -
> - igt_assert(blob);
> -
> - return blob;
> -}
> -
> static bool check_writeback_config(igt_display_t *display, igt_output_t *output,
> drmModeModeInfo override_mode)
> {
More information about the igt-dev
mailing list