summaryrefslogtreecommitdiff
path: root/lib/igt_kms.h
diff options
context:
space:
mode:
authorBhanuprakash Modem <bhanuprakash.modem@intel.com>2022-05-31 17:28:03 +0530
committerBhanuprakash Modem <bhanuprakash.modem@intel.com>2022-06-01 16:08:09 +0530
commit8c1fdd9bb2fc0a964dce72bbc43fe1f463374786 (patch)
treeffef02883c9d901fc6aaba393700f369348ad24f /lib/igt_kms.h
parenta6a189fef321ee9230339d2ee8cc2acf8c9476b6 (diff)
lib/igt_kms: Add helper functions to sort drm modes
Add helper function to sort drm modes based on the clock, resolution in both ascending & descending order. V2: * Minor changes V3: * Added documentaion for helper functions Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com> Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Diffstat (limited to 'lib/igt_kms.h')
-rw-r--r--lib/igt_kms.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/igt_kms.h b/lib/igt_kms.h
index ba0bf4d6..0f12d825 100644
--- a/lib/igt_kms.h
+++ b/lib/igt_kms.h
@@ -637,6 +637,9 @@ igt_output_t **__igt_pipe_populate_outputs(igt_display_t *display,
for (int j__ = 0; assert(igt_can_fail()), (plane) = &(display)->pipes[(pipe)].planes[j__], \
j__ < (display)->pipes[(pipe)].n_planes; j__++)
+#define for_each_connector_mode(output) \
+ for (int j__ = 0; j__ < output->config.connector->count_modes; j__++)
+
#define IGT_FIXED(i,f) ((i) << 16 | (f))
/**
@@ -957,4 +960,11 @@ void igt_assert_output_bpc_equal(int drmfd, enum pipe pipe,
bool igt_check_output_bpc_equal(int drmfd, enum pipe pipe,
char *output_name, unsigned int bpc);
+int sort_drm_modes_by_clk_dsc(const void *a, const void *b);
+int sort_drm_modes_by_clk_asc(const void *a, const void *b);
+int sort_drm_modes_by_res_dsc(const void *a, const void *b);
+int sort_drm_modes_by_res_asc(const void *a, const void *b);
+void igt_sort_connector_modes(drmModeConnector *connector,
+ int (*comparator)(const void *, const void*));
+
#endif /* __IGT_KMS_H__ */