[RFC PATCH v5 03/32] lib/igt_kms: Move get_writeback_formats_blob to lib
Harry Wentland
harry.wentland at amd.com
Mon Feb 26 21:13:47 UTC 2024
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 1b4d0d7612a2..0cccf56aefd3 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -6368,3 +6368,22 @@ int get_num_scalers(int drm_fd, enum pipe pipe)
return num_scalers;
}
+
+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;
+}
diff --git a/lib/igt_kms.h b/lib/igt_kms.h
index b3882808b42f..6591f6e227b9 100644
--- a/lib/igt_kms.h
+++ b/lib/igt_kms.h
@@ -1219,4 +1219,6 @@ bool igt_check_output_is_dp_mst(igt_output_t *output);
int igt_get_dp_mst_connector_id(igt_output_t *output);
int get_num_scalers(int drm_fd, enum pipe pipe);
+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 8d9f502f88f1..86a83bf6fc67 100644
--- a/tests/kms_writeback.c
+++ b/tests/kms_writeback.c
@@ -94,25 +94,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)
{
--
2.44.0
More information about the igt-dev
mailing list