All of lore.kernel.org
 help / color / mirror / Atom feed
From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH i-g-t v2 07/14] lib/igt_kms: Unexport broadcast rgb API.
Date: Thu, 12 Oct 2017 13:54:28 +0200	[thread overview]
Message-ID: <20171012115435.18880-8-maarten.lankhorst@linux.intel.com> (raw)
In-Reply-To: <20171012115435.18880-1-maarten.lankhorst@linux.intel.com>

Setting broadcast rgb was only used by chamelium, but is now handled
in igt_display by default. This means that chamelium doesn't need to
set it, and this can be hidden. The broadcast RGB property is intel
connector specific, so rename the enum to intel_broadcast_rgb_mode.

Keep the property and enum public in case someone wants to test the
property later.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
 lib/igt_kms.c     | 44 ++++++--------------------------------------
 lib/igt_kms.h     |  7 +++----
 tests/chamelium.c |  3 ---
 3 files changed, 9 insertions(+), 45 deletions(-)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index 5f54021350ac..ad0855d0c8fa 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -187,7 +187,8 @@ const char *igt_crtc_prop_names[IGT_NUM_CRTC_PROPS] = {
 const char *igt_connector_prop_names[IGT_NUM_CONNECTOR_PROPS] = {
 	"scaling mode",
 	"CRTC_ID",
-	"DPMS"
+	"DPMS",
+	"Broadcast RGB"
 };
 
 /*
@@ -1037,40 +1038,6 @@ void kmstest_set_connector_dpms(int fd, drmModeConnector *connector, int mode)
 					       dpms, mode) == 0);
 }
 
-/**
- * kmstest_set_connector_broadcast_rgb:
- * @fd: DRM fd
- * @connector: libdrm connector
- * @mode: Broadcast RGB mode
- *
- * This function sets the Broadcast RGB prop of @connector to @mode, if there
- * is one.
- *
- * Returns: true if we found and set the Broadcast RGB prop, false otherwise
- */
-bool kmstest_set_connector_broadcast_rgb(int fd, drmModeConnector *connector,
-					 enum kmstest_broadcast_rgb_mode mode)
-{
-	uint32_t prop_id;
-	int ret;
-
-	ret = kmstest_get_property(fd, connector->connector_id,
-				   DRM_MODE_OBJECT_CONNECTOR, "Broadcast RGB",
-				   &prop_id, NULL, NULL);
-	if (!ret) {
-		igt_debug("Broadcast RGB property not found on %d\n",
-			  connector->connector_id);
-		return false;
-	}
-
-	igt_debug("Setting Broadcast RGB mode on connector %d to %d\n",
-		  connector->connector_id, mode);
-	ret = drmModeConnectorSetProperty(fd, connector->connector_id, prop_id,
-					  mode);
-
-	return ret == 0;
-}
-
 /**
  * kmstest_get_property:
  * @drm_fd: drm file descriptor
@@ -1583,9 +1550,10 @@ static void igt_output_refresh(igt_output_t *output)
 		igt_atomic_fill_connector_props(display, output,
 			IGT_NUM_CONNECTOR_PROPS, igt_connector_prop_names);
 
-		kmstest_set_connector_broadcast_rgb(display->drm_fd,
-						    output->config.connector,
-						    BROADCAST_RGB_FULL);
+		if (output->props[IGT_CONNECTOR_BROADCAST_RGB])
+			igt_output_set_prop_value(output,
+						  IGT_CONNECTOR_BROADCAST_RGB,
+						  BROADCAST_RGB_FULL);
 	}
 
 	LOG(display, "%s: Selecting pipe %s\n", output->name,
diff --git a/lib/igt_kms.h b/lib/igt_kms.h
index 2e4c23437f4e..b8a04af73e2f 100644
--- a/lib/igt_kms.h
+++ b/lib/igt_kms.h
@@ -115,6 +115,7 @@ enum igt_atomic_connector_properties {
        IGT_CONNECTOR_SCALING_MODE = 0,
        IGT_CONNECTOR_CRTC_ID,
        IGT_CONNECTOR_DPMS,
+       IGT_CONNECTOR_BROADCAST_RGB,
        IGT_NUM_CONNECTOR_PROPS
 };
 
@@ -171,13 +172,13 @@ enum kmstest_force_connector_state {
 };
 
 /**
- * kmstest_broadcast_rgb_mode:
+ * intel_broadcast_rgb_mode:
  * @BROADCAST_RGB_AUTO: Choose the color range to use automatically
  * @BROADCAST_RGB_FULL: Force the connector to use full color range
  * @BROADCAST_RGB_16_235: Force the connector to use a limited 16:235 color
  * range
  */
-enum kmstest_broadcast_rgb_mode {
+enum intel_broadcast_rgb_mode {
 	BROADCAST_RGB_AUTO = 0,
 	BROADCAST_RGB_FULL,
 	BROADCAST_RGB_16_235
@@ -203,8 +204,6 @@ bool kmstest_probe_connector_config(int drm_fd, uint32_t connector_id,
 void kmstest_free_connector_config(struct kmstest_connector_config *config);
 
 void kmstest_set_connector_dpms(int fd, drmModeConnector *connector, int mode);
-bool kmstest_set_connector_broadcast_rgb(int fd, drmModeConnector *connector,
-					 enum kmstest_broadcast_rgb_mode mode);
 bool kmstest_get_property(int drm_fd, uint32_t object_id, uint32_t object_type,
 			  const char *name, uint32_t *prop_id, uint64_t *value,
 			  drmModePropertyPtr *prop);
diff --git a/tests/chamelium.c b/tests/chamelium.c
index ae164920e86e..4ad29f9d178a 100644
--- a/tests/chamelium.c
+++ b/tests/chamelium.c
@@ -466,9 +466,6 @@ enable_output(data_t *data,
 	igt_pipe_obj_replace_prop_blob(primary->pipe, IGT_CRTC_GAMMA_LUT, NULL, 0);
 	igt_pipe_obj_replace_prop_blob(primary->pipe, IGT_CRTC_CTM, NULL, 0);
 
-	kmstest_set_connector_broadcast_rgb(display->drm_fd, connector,
-					    BROADCAST_RGB_FULL);
-
 	igt_display_commit(display);
 
 	if (chamelium_port_get_type(port) == DRM_MODE_CONNECTOR_VGA)
-- 
2.14.1

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

  parent reply	other threads:[~2017-10-12 11:54 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-12 11:54 [PATCH i-g-t v2 00/14] lib/igt_kms: Rewrite property handling to better match atomic Maarten Lankhorst
2017-10-12 11:54 ` [PATCH i-g-t v2 01/14] lib/igt_kms: Rework connector properties to be more atomic, v2 Maarten Lankhorst
2017-10-12 11:54 ` [PATCH i-g-t v2 02/14] lib/igt_kms: Rework plane properties to be more atomic, v5 Maarten Lankhorst
2017-10-19  9:08   ` Mika Kahola
2017-10-19  9:44     ` Maarten Lankhorst
2017-10-20  8:03       ` Mika Kahola
2017-10-12 11:54 ` [PATCH i-g-t v2 03/14] lib/igt_kms: Rework pipe properties to be more atomic, v7 Maarten Lankhorst
2017-10-19 10:28   ` Mika Kahola
2018-03-05 14:37   ` Maxime Ripard
2018-03-05 14:37     ` [igt-dev] [Intel-gfx] " Maxime Ripard
2018-03-06 13:41     ` Daniel Vetter
2018-03-06 13:41       ` [igt-dev] [Intel-gfx] " Daniel Vetter
2018-03-06 13:47       ` Maarten Lankhorst
2018-03-06 13:47         ` [Intel-gfx] " Maarten Lankhorst
2017-10-12 11:54 ` [PATCH i-g-t v2 04/14] lib/igt_kms: Allow setting any plane property through the universal path Maarten Lankhorst
2017-10-19 11:04   ` Mika Kahola
2017-10-12 11:54 ` [PATCH i-g-t v2 05/14] lib/igt_kms: Allow setting any output property through the !atomic paths Maarten Lankhorst
2017-10-20  9:38   ` Mika Kahola
2017-10-12 11:54 ` [PATCH i-g-t v2 06/14] lib/igt_kms: Export property blob functions for output/pipe/plane, v2 Maarten Lankhorst
2017-10-19 11:24   ` Mika Kahola
2017-10-12 11:54 ` Maarten Lankhorst [this message]
2017-10-19 11:28   ` [PATCH i-g-t v2 07/14] lib/igt_kms: Unexport broadcast rgb API Mika Kahola
2017-10-12 11:54 ` [PATCH i-g-t v2 08/14] lib/igt_kms: Add igt_$obj_has_prop functions Maarten Lankhorst
2017-10-12 15:33   ` [PATCH i-g-t v2] lib/igt_kms: Add igt_$obj_has_prop functions, v2 Maarten Lankhorst
2017-10-19 12:06     ` Mika Kahola
2017-10-12 11:54 ` [PATCH i-g-t v2 09/14] lib/igt_kms: Add igt_$obj_get_prop functions Maarten Lankhorst
2017-10-19 12:58   ` Mika Kahola
2017-10-12 11:54 ` [PATCH i-g-t v2 10/14] lib/igt_kms: Remove igt_pipe_get_property Maarten Lankhorst
2017-10-19 13:18   ` Mika Kahola
2017-10-12 11:54 ` [PATCH i-g-t v2 11/14] lib/igt_kms: Remove igt_crtc_set_background() Maarten Lankhorst
2017-10-20  6:33   ` Mika Kahola
2017-10-12 11:54 ` [PATCH i-g-t v2 12/14] tests/kms_color: Rework tests slightly to work better with new atomic api Maarten Lankhorst
2017-10-20  7:14   ` Mika Kahola
2017-10-12 11:54 ` [PATCH i-g-t v2 13/14] tests/chamelium: Remove reliance on output->config.pipe Maarten Lankhorst
2017-10-20  7:15   ` Mika Kahola
2017-10-12 11:54 ` [PATCH i-g-t v2 14/14] tests/kms_atomic: Convert/rewrite tests to use igt_kms framework Maarten Lankhorst
2017-10-12 15:33   ` [PATCH i-g-t v2] tests/kms_atomic: Convert/rewrite tests to use igt_kms framework, v2 Maarten Lankhorst
2017-10-20 10:02     ` Mika Kahola
2017-10-20 10:08       ` Maarten Lankhorst
2017-10-20 10:16         ` Mika Kahola
2017-10-20 11:43           ` Maarten Lankhorst
2017-10-12 12:28 ` ✓ Fi.CI.BAT: success for lib/igt_kms: Rewrite property handling to better match atomic. (rev4) Patchwork
2017-10-12 15:01 ` ✗ Fi.CI.IGT: failure " Patchwork
2017-10-12 16:04 ` ✓ Fi.CI.BAT: success for lib/igt_kms: Rewrite property handling to better match atomic. (rev6) Patchwork
2017-10-12 23:47 ` ✗ Fi.CI.IGT: failure " Patchwork

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=20171012115435.18880-8-maarten.lankhorst@linux.intel.com \
    --to=maarten.lankhorst@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.