public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Intel-gfx@lists.freedesktop.org
Subject: [PATCH i-g-t 3/3] kms_flip: Reduce dmesg spam by not calling drmModeGetResources too much
Date: Wed, 27 Apr 2016 16:12:36 +0100	[thread overview]
Message-ID: <1461769956-33188-3-git-send-email-tvrtko.ursulin@linux.intel.com> (raw)
In-Reply-To: <1461769956-33188-1-git-send-email-tvrtko.ursulin@linux.intel.com>

From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Configuration reported in drmModeGetResources is static - pass it
into kmstest_get_connector_config so it can be reused there.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 tests/kms_flip.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/kms_flip.c b/tests/kms_flip.c
index fec69254e4da..a85153fa3d52 100644
--- a/tests/kms_flip.c
+++ b/tests/kms_flip.c
@@ -1042,7 +1042,7 @@ static void connector_find_preferred_mode(uint32_t connector_id, int crtc_idx,
 {
 	struct kmstest_connector_config config;
 
-	if (!kmstest_get_connector_config(drm_fd, NULL,
+	if (!kmstest_get_connector_config(drm_fd, resources,
 					  connector_id, 1 << crtc_idx,
 					  &config)) {
 		o->mode_valid = 0;
@@ -1087,11 +1087,11 @@ static void connector_find_compatible_mode(int crtc_idx0, int crtc_idx1,
 	drmModeModeInfo *mode[2];
 	int n, m;
 
-	if (!kmstest_get_connector_config(drm_fd, NULL, o->_connector[0],
+	if (!kmstest_get_connector_config(drm_fd, resources, o->_connector[0],
 					  1 << crtc_idx0, &config[0]))
 		return;
 
-	if (!kmstest_get_connector_config(drm_fd, NULL, o->_connector[1],
+	if (!kmstest_get_connector_config(drm_fd, resources, o->_connector[1],
 					  1 << crtc_idx1, &config[1])) {
 		kmstest_free_connector_config(&config[0]);
 		return;
-- 
1.9.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2016-04-27 15:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-27 15:12 [PATCH i-g-t 1/3] igt_kms: Fix use after free in kmstest_get_pipe_from_crtc_id Tvrtko Ursulin
2016-04-27 15:12 ` [PATCH i-g-t 2/3] igt_kms: Allow kmstest_get_connector_config to take provided drmModeGetResources Tvrtko Ursulin
2016-04-28  8:28   ` Daniel Vetter
2016-04-28  9:05     ` Tvrtko Ursulin
2016-04-27 15:12 ` Tvrtko Ursulin [this message]
2016-04-28  9:14 ` [PATCH i-g-t 1/3] igt_kms: Fix use after free in kmstest_get_pipe_from_crtc_id Tvrtko Ursulin

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=1461769956-33188-3-git-send-email-tvrtko.ursulin@linux.intel.com \
    --to=tvrtko.ursulin@linux.intel.com \
    --cc=Intel-gfx@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