From: Kunal Joshi <kunal1.joshi@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Kunal Joshi <kunal1.joshi@intel.com>
Subject: [PATCH i-g-t 1/2] lib/igt_kms: move bigjoiner_mode_found to lib.
Date: Mon, 15 Jan 2024 16:28:53 +0530 [thread overview]
Message-ID: <20240115105854.827266-2-kunal1.joshi@intel.com> (raw)
In-Reply-To: <20240115105854.827266-1-kunal1.joshi@intel.com>
move bigjoiner_mode_found to lib/igt_kms with some modification
Cc: Karthik B S <karthik.b.s@intel.com>
Cc: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
Signed-off-by: Kunal Joshi <kunal1.joshi@intel.com>
---
lib/igt_kms.c | 18 ++++++++++++++++++
lib/igt_kms.h | 3 +++
tests/intel/kms_big_joiner.c | 14 ++------------
3 files changed, 23 insertions(+), 12 deletions(-)
diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index e4dea1a60..cb6d57c2d 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -6142,6 +6142,24 @@ bool igt_bigjoiner_possible(drmModeModeInfo *mode, int max_dotclock)
mode->clock > max_dotclock);
}
+/**
+ * bigjoiner_mode_found:
+ * @connector: libdrm connector
+ * @sort_method: comparator method
+ * @mode: libdrm mode
+ *
+ * Returns: True if big joiner found in connector modes
+ */
+bool bigjoiner_mode_found(int drm_fd, drmModeConnector *connector,
+ int (*sort_method)(const void *, const void*),
+ drmModeModeInfo *mode, int max_dotclock)
+{
+ igt_sort_connector_modes(connector, sort_method);
+ *mode = connector->modes[0];
+
+ return igt_bigjoiner_possible(mode, max_dotclock);
+}
+
/**
* igt_check_bigjoiner_support:
* @display: a pointer to an #igt_display_t structure
diff --git a/lib/igt_kms.h b/lib/igt_kms.h
index b3882808b..d4464c51a 100644
--- a/lib/igt_kms.h
+++ b/lib/igt_kms.h
@@ -1212,6 +1212,9 @@ bool igt_max_bpc_constraint(igt_display_t *display, enum pipe pipe,
igt_output_t *output, int bpc);
int igt_get_max_dotclock(int fd);
bool igt_bigjoiner_possible(drmModeModeInfo *mode, int max_dotclock);
+bool bigjoiner_mode_found(int drm_fd, drmModeConnector *connector,
+ int (*sort_method)(const void *, const void*),
+ drmModeModeInfo *mode, int max_dotclock);
bool igt_check_bigjoiner_support(igt_display_t *display);
bool igt_parse_mode_string(const char *mode_string, drmModeModeInfo *mode);
bool intel_pipe_output_combo_valid(igt_display_t *display);
diff --git a/tests/intel/kms_big_joiner.c b/tests/intel/kms_big_joiner.c
index aba2adfbe..80344d411 100644
--- a/tests/intel/kms_big_joiner.c
+++ b/tests/intel/kms_big_joiner.c
@@ -199,16 +199,6 @@ static void test_dual_display(data_t *data)
igt_display_commit2(display, COMMIT_ATOMIC);
}
-static bool bigjoiner_mode_found(drmModeConnector *connector,
- int (*sort_method)(const void *, const void*),
- drmModeModeInfo *mode)
-{
- igt_sort_connector_modes(connector, sort_method);
- *mode = connector->modes[0];
-
- return igt_bigjoiner_possible(mode, max_dotclock);
-}
-
igt_main
{
data_t data;
@@ -235,8 +225,8 @@ igt_main
* Bigjoiner will come in to the picture when the
* resolution > 5K or clock > max-dot-clock.
*/
- found = (bigjoiner_mode_found(connector, sort_drm_modes_by_res_dsc, &mode) ||
- bigjoiner_mode_found(connector, sort_drm_modes_by_clk_dsc, &mode)) ?
+ found = (bigjoiner_mode_found(data.drm_fd, connector, sort_drm_modes_by_res_dsc, &mode, max_dotclock) ||
+ bigjoiner_mode_found(data.drm_fd, connector, sort_drm_modes_by_clk_dsc, &mode, max_dotclock)) ?
true : false;
if (found) {
--
2.25.1
next prev parent reply other threads:[~2024-01-15 10:49 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-15 10:58 [PATCH i-g-t 0/2] add support for choosing big joiner mode Kunal Joshi
2024-01-15 10:58 ` Kunal Joshi [this message]
2024-01-15 10:58 ` [PATCH i-g-t 2/2] lib/igt_kms: " Kunal Joshi
2024-01-16 11:04 ` Sharma, Swati2
2024-01-16 11:59 ` Joshi, Kunal1
2024-01-16 11:59 ` Joshi, Kunal1
2024-01-16 12:03 ` Sharma, Swati2
2024-01-17 5:44 ` Joshi, Kunal1
2024-01-17 5:44 ` Joshi, Kunal1
2024-01-17 8:55 ` Sharma, Swati2
2024-01-17 9:14 ` Joshi, Kunal1
2024-01-18 9:10 ` Modem, Bhanuprakash
2024-01-18 9:14 ` Joshi, Kunal1
2024-01-18 10:38 ` Nautiyal, Ankit K
2024-01-18 11:28 ` Joshi, Kunal1
2024-01-18 14:15 ` Sharma, Swati2
2024-01-15 11:41 ` ✓ CI.xeBAT: success for add support for choosing big joiner mode (rev2) Patchwork
2024-01-15 12:01 ` ✓ Fi.CI.BAT: " Patchwork
2024-01-15 13:24 ` ✗ Fi.CI.IGT: failure " Patchwork
-- strict thread matches above, loose matches on Subject: below --
2024-03-06 5:25 [PATCH i-g-t 0/2] revamp big joiner test Kunal Joshi
2024-03-06 5:25 ` [PATCH i-g-t 1/2] lib/igt_kms: move bigjoiner_mode_found to lib Kunal Joshi
2024-03-05 16:36 [PATCH i-g-t 0/2] revamp big joiner test Kunal Joshi
2024-03-05 16:36 ` [PATCH i-g-t 1/2] lib/igt_kms: move bigjoiner_mode_found to lib Kunal Joshi
2024-01-18 10:46 [PATCH i-g-t 0/2] add support for choosing big joiner mode Kunal Joshi
2024-01-18 10:46 ` [PATCH i-g-t 1/2] lib/igt_kms: move bigjoiner_mode_found to lib Kunal Joshi
2024-01-12 8:55 [PATCH i-g-t 0/2] add support for choosing big joiner mode Kunal Joshi
2024-01-12 8:55 ` [PATCH i-g-t 1/2] lib/igt_kms: move bigjoiner_mode_found to lib Kunal Joshi
2024-01-18 9:28 ` Modem, Bhanuprakash
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240115105854.827266-2-kunal1.joshi@intel.com \
--to=kunal1.joshi@intel.com \
--cc=igt-dev@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox