[i-g-t V6 03/41] lib/igt_kms: Move get_writeback_formats_blob to lib
Bhanuprakash Modem
bhanuprakash.modem at intel.com
Wed Apr 24 10:26:11 UTC 2024
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 98d3fb79c..b5a1bff05 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -6562,3 +6562,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 01604dac9..664f223ae 100644
--- a/lib/igt_kms.h
+++ b/lib/igt_kms.h
@@ -1223,4 +1223,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 e9509626a..4cd520c47 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.43.2
More information about the Intel-gfx-trybot
mailing list