Skip to contentSkip to conversation

drm/i915: silence useless messages about DDI buffer translation

PATCH In review Paulo Zanoni 3 participants 5 messages Aug 5, 2013 – Aug 6, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 drm/i915: silence useless messages about DDI buffer translation

From: Paulo Zanoni <[email protected]>

These messages are not really useful since it's very easy to check which mode is used for each port.

Also, when we add the code to enable/disable PC8+, intel_prepare_ddi_buffers will be called more often and will eat your dmesg buffers.

While at it, fix the coding style of the "for" statement above.

---
 drivers/gpu/drm/i915/intel_ddi.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)
drivers/gpu/drm/i915/intel_ddi.c +2 -9
index b361c08..b6281d9 100644
@@ -94,15 +94,8 @@ static void intel_prepare_ddi_buffers(struct drm_device *dev, enum port port,
 		hsw_ddi_translations_fdi :
 		hsw_ddi_translations_dp);
 
-	DRM_DEBUG_DRIVER("Initializing DDI buffers for port %c in %s mode\n",
-			port_name(port),
-			use_fdi_mode ? "FDI" : "DP");
-
-	WARN((use_fdi_mode && (port != PORT_E)),
-		"Programming port %c in FDI mode, this probably will not work.\n",
-		port_name(port));
-
-	for (i=0, reg=DDI_BUF_TRANS(port); i < ARRAY_SIZE(hsw_ddi_translations_fdi); i++) {
+	for (i = 0, reg = DDI_BUF_TRANS(port);
+	     i < ARRAY_SIZE(hsw_ddi_translations_fdi); i++) {
 		I915_WRITE(reg, ddi_translations[i]);
 		reg += 4;
 	}
Signature · 1 line
1.8.1.2
#1 lore raw

PATCH 2/2 drm/i915: remove use_fdi_mode argument from intel_prepare_ddi_buffers

From: Paulo Zanoni <[email protected]>

We set the mode based on the port, and we already pass the port as an argument.

---
 drivers/gpu/drm/i915/intel_ddi.c | 17 +++++------------
 1 file changed, 5 insertions(+), 12 deletions(-)
drivers/gpu/drm/i915/intel_ddi.c +5 -12
index b6281d9..b8c096b 100644
@@ -84,15 +84,14 @@ static enum port intel_ddi_get_encoder_port(struct intel_encoder *intel_encoder)
  * in either FDI or DP modes only, as HDMI connections will work with both
  * of those
  */
-static void intel_prepare_ddi_buffers(struct drm_device *dev, enum port port,
-				      bool use_fdi_mode)
+static void intel_prepare_ddi_buffers(struct drm_device *dev, enum port port)
 {
 	struct drm_i915_private *dev_priv = dev->dev_private;
 	u32 reg;
 	int i;
-	const u32 *ddi_translations = ((use_fdi_mode) ?
+	const u32 *ddi_translations = (port == PORT_E) ?
 		hsw_ddi_translations_fdi :
-		hsw_ddi_translations_dp);
+		hsw_ddi_translations_dp;
 
 	for (i = 0, reg = DDI_BUF_TRANS(port);
 	     i < ARRAY_SIZE(hsw_ddi_translations_fdi); i++) {
@@ -111,14 +110,8 @@ void intel_prepare_ddi(struct drm_device *dev)
 	if (!HAS_DDI(dev))
 		return;
 
-	for (port = PORT_A; port < PORT_E; port++)
-		intel_prepare_ddi_buffers(dev, port, false);
-
-	/* DDI E is the suggested one to work in FDI mode, so program is as such
-	 * by default. It will have to be re-programmed in case a digital DP
-	 * output will be detected on it
-	 */
-	intel_prepare_ddi_buffers(dev, PORT_E, true);
+	for (port = PORT_A; port <= PORT_E; port++)
+		intel_prepare_ddi_buffers(dev, port);
 }
 
 static const long hsw_ddi_buf_ctl_values[] = {
Signature · 1 line
1.8.1.2
#2 lore raw
In reply to Paulo Zanoni
Quoted 5 lines · Paulo Zanoni

From: Paulo Zanoni <[email protected]>

These messages are not really useful since it's very easy to check which mode is used for each port.

For those following along at home, a quick explanation of what to look for instead would be very useful.
-Chris

Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre
#3 lore raw

2013/8/5 Chris Wilson <[email protected]>:

Quoted 8 lines · Paulo Zanoni
Quoted 5 lines

From: Paulo Zanoni <[email protected]>

These messages are not really useful since it's very easy to check which mode is used for each port.

For those following along at home, a quick explanation of what to look for instead would be very useful.

The values programmed are based on the port type, then assigned to the ddi_translations variable. Currently we use DP mode for ports A-D and FDI mode for port E.

Daniel, should I resend with the sentence above or can you add it if/when applying the patch?

Quoted 4 lines

-Chris

--
Chris Wilson, Intel Open Source Technology Centre

Signature · 1 line
Paulo Zanoni
#4 lore raw
Quoted 10 lines · Paulo Zanoni

2013/8/5 Chris Wilson <[email protected]>:

Quoted 8 lines · Paulo Zanoni
Quoted 5 lines

From: Paulo Zanoni <[email protected]>

These messages are not really useful since it's very easy to check which mode is used for each port.

For those following along at home, a quick explanation of what to look for instead would be very useful.

Quoted 6 lines

The values programmed are based on the port type, then assigned to the ddi_translations variable. Currently we use DP mode for ports A-D and FDI mode for port E.

Daniel, should I resend with the sentence above or can you add it if/when applying the patch?

Both patches merged to dinq with the pimped commit message for this one.

Thanks, Daniel

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch