Skip to contentSkip to conversation

drm/i915: Reject modeset when the same digital port is used more than once

PATCH Superseded [email protected] 5 participants 12 messages May 19, 2014 – Dec 3, 2014

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

PATCH 1/1 drm/i915: Reject modeset when the same digital port is used more than once

From: Ville Syrjälä <[email protected]>

On pre-HSW we have two encoders per digital port: one HDMI, one DP. However they are the same physical port in hardware and we can't enable both at the same time. Reject the modeset if the user attempts this.

So far we've been saved by the fact that we never see both HDMI and DP connectors as connected. But if the user decides to force a mode anyway, all kinds of funny stuff might happen.

Unfortunately we don't seem to have any way to inform userspace that such configurations are invalid except by returning an error from setcrtc. possible_clones only covers real cloning situations, and looking at the connector names doesn't work either since we don't always register both connectors for the same port. I suppose the only way to fix that would be to expose only a single encoder per digital port like we do on HSW+ but that would be a fairly large undertaking for little gain.

kms_setmode hits this since it forces modes on non-connected VGA and HDMI connectors. Previosuly it just resulted in weirdness such as failed link training. With this patch it will now get an error back from the kernel and will die with an assert since it thinks that the configuration should be fine.

---
 drivers/gpu/drm/i915/intel_display.c | 44 ++++++++++++++++++++++++++++++++++++
 1 file changed, 44 insertions(+)
drivers/gpu/drm/i915/intel_display.c +44 -0
index a432348..13add38 100644
@@ -9621,6 +9621,45 @@ static bool check_encoder_cloning(struct intel_crtc *crtc)
 	return true;
 }
 
+static bool check_digital_port_conflicts(struct drm_device *dev)
+{
+	struct intel_connector *connector;
+	unsigned int used_ports = 0;
+
+	/*
+	 * Walk the connector list instead of the encoder
+	 * list to detect the problem on ddi platforms
+	 * where there's just one encoder per digital port.
+	 */
+	list_for_each_entry(connector,
+			    &dev->mode_config.connector_list, base.head) {
+		struct intel_encoder *encoder = connector->new_encoder;
+
+		if (!encoder)
+			continue;
+
+		WARN_ON(!encoder->new_crtc);
+
+		switch (encoder->type) {
+			unsigned int port_mask;
+		case INTEL_OUTPUT_DISPLAYPORT:
+		case INTEL_OUTPUT_HDMI:
+		case INTEL_OUTPUT_EDP:
+			port_mask = 1 << enc_to_dig_port(&encoder->base)->port;
+
+			/* the same port mustn't appear more than once */
+			if (used_ports & port_mask)
+				return false;
+
+			used_ports |= port_mask;
+		default:
+			break;
+		}
+	}
+
+	return true;
+}
+
 static struct intel_crtc_config *
 intel_modeset_pipe_config(struct drm_crtc *crtc,
 			  struct drm_framebuffer *fb,
@@ -9637,6 +9676,11 @@ intel_modeset_pipe_config(struct drm_crtc *crtc,
 		return ERR_PTR(-EINVAL);
 	}
 
+	if (!check_digital_port_conflicts(dev)) {
+		DRM_DEBUG_KMS("rejecting conflicting digital port configuration\n");
+		return ERR_PTR(-EINVAL);
+	}
+
 	pipe_config = kzalloc(sizeof(*pipe_config), GFP_KERNEL);
 	if (!pipe_config)
 		return ERR_PTR(-ENOMEM);
Signature · 6 lines
1.8.5.5

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw
Quoted 19 lines · On Mon, May 19, 2014 at 05:19:09PM +0300, [email protected] wrote:

From: Ville Syrjälä <[email protected]>

On pre-HSW we have two encoders per digital port: one HDMI, one DP. However they are the same physical port in hardware and we can't enable both at the same time. Reject the modeset if the user attempts this.

So far we've been saved by the fact that we never see both HDMI and DP connectors as connected. But if the user decides to force a mode anyway, all kinds of funny stuff might happen.

Unfortunately we don't seem to have any way to inform userspace that such configurations are invalid except by returning an error from setcrtc. possible_clones only covers real cloning situations, and looking at the connector names doesn't work either since we don't always register both connectors for the same port. I suppose the only way to fix that would be to expose only a single encoder per digital port like we do on HSW+ but that would be a fairly large undertaking for little gain.

Quoted 7 lines

kms_setmode hits this since it forces modes on non-connected VGA and HDMI connectors. Previosuly it just resulted in weirdness such as failed link training. With this patch it will now get an error back from the kernel and will die with an assert since it thinks that the configuration should be fine.

Do we have a bugzilla for this somewhere?
-Daniel

Quoted 73 lines
---
 drivers/gpu/drm/i915/intel_display.c | 44 ++++++++++++++++++++++++++++++++++++
 1 file changed, 44 insertions(+)
drivers/gpu/drm/i915/intel_display.c +44 -0
index a432348..13add38 100644
@@ -9621,6 +9621,45 @@ static bool check_encoder_cloning(struct intel_crtc *crtc)
 	return true;
 }
 
+static bool check_digital_port_conflicts(struct drm_device *dev)
+{
+	struct intel_connector *connector;
+	unsigned int used_ports = 0;
+
+	/*
+	 * Walk the connector list instead of the encoder
+	 * list to detect the problem on ddi platforms
+	 * where there's just one encoder per digital port.
+	 */
+	list_for_each_entry(connector,
+			    &dev->mode_config.connector_list, base.head) {
+		struct intel_encoder *encoder = connector->new_encoder;
+
+		if (!encoder)
+			continue;
+
+		WARN_ON(!encoder->new_crtc);
+
+		switch (encoder->type) {
+			unsigned int port_mask;
+		case INTEL_OUTPUT_DISPLAYPORT:
+		case INTEL_OUTPUT_HDMI:
+		case INTEL_OUTPUT_EDP:
+			port_mask = 1 << enc_to_dig_port(&encoder->base)->port;
+
+			/* the same port mustn't appear more than once */
+			if (used_ports & port_mask)
+				return false;
+
+			used_ports |= port_mask;
+		default:
+			break;
+		}
+	}
+
+	return true;
+}
+
 static struct intel_crtc_config *
 intel_modeset_pipe_config(struct drm_crtc *crtc,
 			  struct drm_framebuffer *fb,
@@ -9637,6 +9676,11 @@ intel_modeset_pipe_config(struct drm_crtc *crtc,
 		return ERR_PTR(-EINVAL);
 	}
 
+	if (!check_digital_port_conflicts(dev)) {
+		DRM_DEBUG_KMS("rejecting conflicting digital port configuration\n");
+		return ERR_PTR(-EINVAL);
+	}
+
 	pipe_config = kzalloc(sizeof(*pipe_config), GFP_KERNEL);
 	if (!pipe_config)
 		return ERR_PTR(-ENOMEM);
Signature · 6 lines
1.8.5.5

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
#2 lore raw
Quoted 26 lines · Daniel Vetter
Quoted 25 lines · On Mon, May 19, 2014 at 05:19:09PM +0300, [email protected] wrote:

From: Ville Syrjälä <[email protected]>

On pre-HSW we have two encoders per digital port: one HDMI, one DP. However they are the same physical port in hardware and we can't enable both at the same time. Reject the modeset if the user attempts this.

So far we've been saved by the fact that we never see both HDMI and DP connectors as connected. But if the user decides to force a mode anyway, all kinds of funny stuff might happen.

Unfortunately we don't seem to have any way to inform userspace that such configurations are invalid except by returning an error from setcrtc. possible_clones only covers real cloning situations, and looking at the connector names doesn't work either since we don't always register both connectors for the same port. I suppose the only way to fix that would be to expose only a single encoder per digital port like we do on HSW+ but that would be a fairly large undertaking for little gain.

kms_setmode hits this since it forces modes on non-connected VGA and HDMI connectors. Previosuly it just resulted in weirdness such as failed link training. With this patch it will now get an error back from the kernel and will die with an assert since it thinks that the configuration should be fine.

Quoted 3 lines
Quoted 1 line

Do we have a bugzilla for this somewhere?

No idea. Can't spot anything right now that would match my IVB kms_setmode symptoms (tons of link training failures when the same port gets used for both DP and HDMI).

Signature · 2 lines
Ville Syrjälä
Intel OTC
#3 lore raw
In reply to [email protected]

2014-05-19 11:19 GMT-03:00 <[email protected]>:

Quoted 52 lines

From: Ville Syrjälä <[email protected]>

On pre-HSW we have two encoders per digital port: one HDMI, one DP. However they are the same physical port in hardware and we can't enable both at the same time. Reject the modeset if the user attempts this.

So far we've been saved by the fact that we never see both HDMI and DP connectors as connected. But if the user decides to force a mode anyway, all kinds of funny stuff might happen.

Unfortunately we don't seem to have any way to inform userspace that such configurations are invalid except by returning an error from setcrtc. possible_clones only covers real cloning situations, and looking at the connector names doesn't work either since we don't always register both connectors for the same port. I suppose the only way to fix that would be to expose only a single encoder per digital port like we do on HSW+ but that would be a fairly large undertaking for little gain.

kms_setmode hits this since it forces modes on non-connected VGA and HDMI connectors. Previosuly it just resulted in weirdness such as failed link training. With this patch it will now get an error back from the kernel and will die with an assert since it thinks that the configuration should be fine.

---
 drivers/gpu/drm/i915/intel_display.c | 44 ++++++++++++++++++++++++++++++++++++
 1 file changed, 44 insertions(+)
drivers/gpu/drm/i915/intel_display.c +14 -0
index a432348..13add38 100644
@@ -9621,6 +9621,45 @@ static bool check_encoder_cloning(struct intel_crtc *crtc)
        return true;
 }
 
+static bool check_digital_port_conflicts(struct drm_device *dev)
+{
+       struct intel_connector *connector;
+       unsigned int used_ports = 0;
+
+       /*
+        * Walk the connector list instead of the encoder
+        * list to detect the problem on ddi platforms
+        * where there's just one encoder per digital port.
+        */
+       list_for_each_entry(connector,
+                           &dev->mode_config.connector_list, base.head) {
+               struct intel_encoder *encoder = connector->new_encoder;
+

drivers/gpu/drm/i915/intel_display.c static bool check_encoder_cloning(struct intel_crtc *crtc) · line 9647

Quoted 10 lines
drivers/gpu/drm/i915/intel_display.c +10 -0
+               if (!encoder)
+                       continue;
+
+               WARN_ON(!encoder->new_crtc);
+
+               switch (encoder->type) {
+                       unsigned int port_mask;
+               case INTEL_OUTPUT_DISPLAYPORT:
+               case INTEL_OUTPUT_HDMI:
+               case INTEL_OUTPUT_EDP:

If we're also interested on DDI platforms, we need to check for INTEL_OUTPUT_UNKNOWN here too. I guess Daniel could add this while applying the patch...

With that: Reviewed-by: Paulo Zanoni <[email protected]>

Quoted 37 lines
drivers/gpu/drm/i915/intel_display.c +20 -1
+                       port_mask = 1 << enc_to_dig_port(&encoder->base)->port;
+
+                       /* the same port mustn't appear more than once */
+                       if (used_ports & port_mask)
+                               return false;
+
+                       used_ports |= port_mask;
+               default:
+                       break;
+               }
+       }
+
+       return true;
+}
+
 static struct intel_crtc_config *
 intel_modeset_pipe_config(struct drm_crtc *crtc,
                          struct drm_framebuffer *fb,
@@ -9637,6 +9676,11 @@ intel_modeset_pipe_config(struct drm_crtc *crtc,
                return ERR_PTR(-EINVAL);
        }
 
+       if (!check_digital_port_conflicts(dev)) {
+               DRM_DEBUG_KMS("rejecting conflicting digital port configuration\n");
+               return ERR_PTR(-EINVAL);
+       }
+
        pipe_config = kzalloc(sizeof(*pipe_config), GFP_KERNEL);
        if (!pipe_config)
                return ERR_PTR(-ENOMEM);
--

1.8.5.5

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

Signature · 5 lines
Paulo Zanoni
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#4 lore raw
Quoted 59 lines · Paulo Zanoni

2014-05-19 11:19 GMT-03:00 <[email protected]>:

Quoted 58 lines

From: Ville Syrjälä <[email protected]>

On pre-HSW we have two encoders per digital port: one HDMI, one DP. However they are the same physical port in hardware and we can't enable both at the same time. Reject the modeset if the user attempts this.

So far we've been saved by the fact that we never see both HDMI and DP connectors as connected. But if the user decides to force a mode anyway, all kinds of funny stuff might happen.

Unfortunately we don't seem to have any way to inform userspace that such configurations are invalid except by returning an error from setcrtc. possible_clones only covers real cloning situations, and looking at the connector names doesn't work either since we don't always register both connectors for the same port. I suppose the only way to fix that would be to expose only a single encoder per digital port like we do on HSW+ but that would be a fairly large undertaking for little gain.

kms_setmode hits this since it forces modes on non-connected VGA and HDMI connectors. Previosuly it just resulted in weirdness such as failed link training. With this patch it will now get an error back from the kernel and will die with an assert since it thinks that the configuration should be fine.

---
 drivers/gpu/drm/i915/intel_display.c | 44 ++++++++++++++++++++++++++++++++++++
 1 file changed, 44 insertions(+)
drivers/gpu/drm/i915/intel_display.c +20 -0
index a432348..13add38 100644
@@ -9621,6 +9621,45 @@ static bool check_encoder_cloning(struct intel_crtc *crtc)
        return true;
 }
 
+static bool check_digital_port_conflicts(struct drm_device *dev)
+{
+       struct intel_connector *connector;
+       unsigned int used_ports = 0;
+
+       /*
+        * Walk the connector list instead of the encoder
+        * list to detect the problem on ddi platforms
+        * where there's just one encoder per digital port.
+        */
+       list_for_each_entry(connector,
+                           &dev->mode_config.connector_list, base.head) {
+               struct intel_encoder *encoder = connector->new_encoder;
+
+               if (!encoder)
+                       continue;
+
+               WARN_ON(!encoder->new_crtc);
+
+               switch (encoder->type) {
Quoted 8 lines

drivers/gpu/drm/i915/intel_display.c static bool check_encoder_cloning(struct intel_crtc *crtc) · line 9647

Quoted 4 lines
drivers/gpu/drm/i915/intel_display.c +4 -0
+                       unsigned int port_mask;
+               case INTEL_OUTPUT_DISPLAYPORT:
+               case INTEL_OUTPUT_HDMI:
+               case INTEL_OUTPUT_EDP:

If we're also interested on DDI platforms, we need to check for INTEL_OUTPUT_UNKNOWN here too. I guess Daniel could add this while applying the patch...

Adding UNKNOWN here smells like a massive hack. Can't we add a new OUTPUT_DDI type, which together with the ddi personality stuff dtrt?

I'm really don't think that sprinkling UNKOWN here is a good idea ...

Quoted 1 line

With that: Reviewed-by: Paulo Zanoni <[email protected]>

r-b even without that, just to get things going?
-Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#5 lore raw

2014-11-03 8:29 GMT-02:00 Daniel Vetter <[email protected]>:

Quoted 69 lines · Paulo Zanoni
Quoted 59 lines

2014-05-19 11:19 GMT-03:00 <[email protected]>:

Quoted 58 lines

From: Ville Syrjälä <[email protected]>

On pre-HSW we have two encoders per digital port: one HDMI, one DP. However they are the same physical port in hardware and we can't enable both at the same time. Reject the modeset if the user attempts this.

So far we've been saved by the fact that we never see both HDMI and DP connectors as connected. But if the user decides to force a mode anyway, all kinds of funny stuff might happen.

Unfortunately we don't seem to have any way to inform userspace that such configurations are invalid except by returning an error from setcrtc. possible_clones only covers real cloning situations, and looking at the connector names doesn't work either since we don't always register both connectors for the same port. I suppose the only way to fix that would be to expose only a single encoder per digital port like we do on HSW+ but that would be a fairly large undertaking for little gain.

kms_setmode hits this since it forces modes on non-connected VGA and HDMI connectors. Previosuly it just resulted in weirdness such as failed link training. With this patch it will now get an error back from the kernel and will die with an assert since it thinks that the configuration should be fine.

---
 drivers/gpu/drm/i915/intel_display.c | 44 ++++++++++++++++++++++++++++++++++++
 1 file changed, 44 insertions(+)
drivers/gpu/drm/i915/intel_display.c +20 -0
index a432348..13add38 100644
@@ -9621,6 +9621,45 @@ static bool check_encoder_cloning(struct intel_crtc *crtc)
        return true;
 }
 
+static bool check_digital_port_conflicts(struct drm_device *dev)
+{
+       struct intel_connector *connector;
+       unsigned int used_ports = 0;
+
+       /*
+        * Walk the connector list instead of the encoder
+        * list to detect the problem on ddi platforms
+        * where there's just one encoder per digital port.
+        */
+       list_for_each_entry(connector,
+                           &dev->mode_config.connector_list, base.head) {
+               struct intel_encoder *encoder = connector->new_encoder;
+
+               if (!encoder)
+                       continue;
+
+               WARN_ON(!encoder->new_crtc);
+
+               switch (encoder->type) {
Quoted 8 lines

drivers/gpu/drm/i915/intel_display.c static bool check_encoder_cloning(struct intel_crtc *crtc) · line 9647

Quoted 4 lines
drivers/gpu/drm/i915/intel_display.c +4 -0
+                       unsigned int port_mask;
+               case INTEL_OUTPUT_DISPLAYPORT:
+               case INTEL_OUTPUT_HDMI:
+               case INTEL_OUTPUT_EDP:

If we're also interested on DDI platforms, we need to check for INTEL_OUTPUT_UNKNOWN here too. I guess Daniel could add this while applying the patch...

Quoted 1 line

Adding UNKNOWN here smells like a massive hack.

Why?

Quoted 2 lines

Can't we add a new
OUTPUT_DDI type, which together with the ddi personality stuff dtrt?

Or we can rename INTEL_OUTPUT_UNKNOWN to INTEL_OUTPUT_DDI_DISCONNECTED so it smells less hacky to you?

Quoted 2 lines

I'm really don't think that sprinkling UNKOWN here is a good idea ...

Why?

Quoted 4 lines
Quoted 2 lines

With that: Reviewed-by: Paulo Zanoni <[email protected]>

r-b even without that, just to get things going?

No.

Quoted 5 lines

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

Signature · 5 lines
Paulo Zanoni
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#6 lore raw
Quoted 8 lines · Paulo Zanoni

2014-11-03 8:29 GMT-02:00 Daniel Vetter <[email protected]>:

Quoted 5 lines
Quoted 3 lines

If we're also interested on DDI platforms, we need to check for INTEL_OUTPUT_UNKNOWN here too. I guess Daniel could add this while applying the patch...

Adding UNKNOWN here smells like a massive hack.

Why?

Someone will reuse UNKOWN for something else than DDI.

Quoted 6 lines
Quoted 3 lines

Can't we add a new
OUTPUT_DDI type, which together with the ddi personality stuff dtrt?

Or we can rename INTEL_OUTPUT_UNKNOWN to INTEL_OUTPUT_DDI_DISCONNECTED so it smells less hacky to you?

Yeah that works, too.
-Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#7 lore raw

PATCH v2 1/1 drm/i915: Reject modeset when the same digital port is used more than once

In reply to [email protected]

From: Ville Syrjälä <[email protected]>

On pre-HSW we have two encoders per digital port: one HDMI, one DP. However they are the same physical port in hardware and we can't enable both at the same time. Reject the modeset if the user attempts this.

So far we've been saved by the fact that we never see both HDMI and DP connectors as connected. But if the user decides to force a mode anyway, all kinds of funny stuff might happen.

Unfortunately we don't seem to have any way to inform userspace that such configurations are invalid except by returning an error from setcrtc. possible_clones only covers real cloning situations, and looking at the connector names doesn't work either since we don't always register both connectors for the same port. I suppose the only way to fix that would be to expose only a single encoder per digital port like we do on HSW+ but that would be a fairly large undertaking for little gain.

kms_setmode hits this since it forces modes on non-connected VGA and HDMI connectors. Previosuly it just resulted in weirdness such as failed link training. With this patch it will now get an error back from the kernel and will die with an assert since it thinks that the configuration should be fine.

v2: Deal with INTEL_OUTPUT_UNKNOWN (Paulo)

---
 drivers/gpu/drm/i915/intel_display.c | 47 ++++++++++++++++++++++++++++++++++++
 1 file changed, 47 insertions(+)
drivers/gpu/drm/i915/intel_display.c +47 -0
index c424c36..3a088c0 100644
@@ -10218,6 +10218,48 @@ static bool check_encoder_cloning(struct intel_crtc *crtc)
 	return true;
 }
 
+static bool check_digital_port_conflicts(struct drm_device *dev)
+{
+	struct intel_connector *connector;
+	unsigned int used_ports = 0;
+
+	/*
+	 * Walk the connector list instead of the encoder
+	 * list to detect the problem on ddi platforms
+	 * where there's just one encoder per digital port.
+	 */
+	list_for_each_entry(connector,
+			    &dev->mode_config.connector_list, base.head) {
+		struct intel_encoder *encoder = connector->new_encoder;
+
+		if (!encoder)
+			continue;
+
+		WARN_ON(!encoder->new_crtc);
+
+		switch (encoder->type) {
+			unsigned int port_mask;
+		case INTEL_OUTPUT_UNKNOWN:
+			if (WARN_ON(!HAS_DDI(dev)))
+				break;
+		case INTEL_OUTPUT_DISPLAYPORT:
+		case INTEL_OUTPUT_HDMI:
+		case INTEL_OUTPUT_EDP:
+			port_mask = 1 << enc_to_dig_port(&encoder->base)->port;
+
+			/* the same port mustn't appear more than once */
+			if (used_ports & port_mask)
+				return false;
+
+			used_ports |= port_mask;
+		default:
+			break;
+		}
+	}
+
+	return true;
+}
+
 static struct intel_crtc_config *
 intel_modeset_pipe_config(struct drm_crtc *crtc,
 			  struct drm_framebuffer *fb,
@@ -10234,6 +10276,11 @@ intel_modeset_pipe_config(struct drm_crtc *crtc,
 		return ERR_PTR(-EINVAL);
 	}
 
+	if (!check_digital_port_conflicts(dev)) {
+		DRM_DEBUG_KMS("rejecting conflicting digital port configuration\n");
+		return ERR_PTR(-EINVAL);
+	}
+
 	pipe_config = kzalloc(sizeof(*pipe_config), GFP_KERNEL);
 	if (!pipe_config)
 		return ERR_PTR(-ENOMEM);
Signature · 6 lines
2.0.4

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#8 lore raw

drivers/gpu/drm/i915/intel_display.c intel_modeset_pipe_config(struct drm_crtc *crtc, · line 10279

Quoted 1 line · On Tue, Dec 02, 2014 at 02:10:46PM +0200, [email protected] wrote:
drivers/gpu/drm/i915/intel_display.c +1 -0
+	if (!check_digital_port_conflicts(dev)) {

Being picky:

if not check digital port for conflicts, report error.

It reads backwards. Perhaps

if (conflicting_digital_port_config(dev)) return -EINVAL;

drivers/gpu/drm/i915/intel_display.c intel_modeset_pipe_config(struct drm_crtc *crtc, · line 10282

Quoted 3 lines
drivers/gpu/drm/i915/intel_display.c +3 -0
+		DRM_DEBUG_KMS("rejecting conflicting digital port configuration\n");
+		return ERR_PTR(-EINVAL);
+	}

Regarding getting more information back to the user about the error message, we could with have a connector/crtc property, a procfs file or an ioctl to grab a string describing the last error. A LastError property blob might be the most convenient. Though I am not sure how outlandish this idea is.
-Chris

Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#9 lore raw
Quoted 10 lines · Chris Wilson

drivers/gpu/drm/i915/intel_display.c intel_modeset_pipe_config(struct drm_crtc *crtc, · line 10279

Quoted 1 line · On Tue, Dec 02, 2014 at 02:10:46PM +0200, [email protected] wrote:
drivers/gpu/drm/i915/intel_display.c +1 -0
+	if (!check_digital_port_conflicts(dev)) {

Being picky:

if not check digital port for conflicts, report error.

It reads backwards. Perhaps

if (conflicting_digital_port_config(dev)) return -EINVAL;

I just followed the pattern established by check_encoder_cloning(). Should probably rename both if we go down that path.

Quoted 10 lines

drivers/gpu/drm/i915/intel_display.c intel_modeset_pipe_config(struct drm_crtc *crtc, · line 10282

Quoted 4 lines
drivers/gpu/drm/i915/intel_display.c +3 -0
+		DRM_DEBUG_KMS("rejecting conflicting digital port configuration\n");
+		return ERR_PTR(-EINVAL);
+	}

Regarding getting more information back to the user about the error message, we could with have a connector/crtc property, a procfs file or an ioctl to grab a string describing the last error. A LastError property blob might be the most convenient. Though I am not sure how outlandish this idea is.

Yeah somehow passing a string to userland might be nice for the user. But I don't think we should start matching such strings in tests, so that wouldn't help kms_setmode figure out if it just tried something that was supposed to work or not.

Signature · 6 lines
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#10 lore raw
In reply to Chris Wilson
Quoted 11 lines · Chris Wilson

drivers/gpu/drm/i915/intel_display.c intel_modeset_pipe_config(struct drm_crtc *crtc, · line 10279

Quoted 1 line · On Tue, Dec 02, 2014 at 02:10:46PM +0200, [email protected] wrote:
drivers/gpu/drm/i915/intel_display.c +1 -0
+	if (!check_digital_port_conflicts(dev)) {

Being picky:

if not check digital port for conflicts, report error.

It reads backwards. Perhaps

if (conflicting_digital_port_config(dev)) return -EINVAL;

Quoted 9 lines

drivers/gpu/drm/i915/intel_display.c intel_modeset_pipe_config(struct drm_crtc *crtc, · line 10282

Quoted 3 lines
drivers/gpu/drm/i915/intel_display.c +3 -0
+		DRM_DEBUG_KMS("rejecting conflicting digital port configuration\n");
+		return ERR_PTR(-EINVAL);
+	}

Regarding getting more information back to the user about the error message, we could with have a connector/crtc property, a procfs file or an ioctl to grab a string describing the last error. A LastError property blob might be the most convenient. Though I am not sure how outlandish this idea is.

It's an unsolved problem since right now we don't tell anyone ever why something doesn't work. The current solution is the check-only mode of atomic where you can quickly go through a bunch of options and then pick the most suitable using heuristics (either user picking what he likes or in the code).

Queued for -next, thanks for the patch.
-Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Tested-by on v2 1/1
#11 lore raw
In reply to [email protected]

-------------------------------------Summary-------------------------------------
Platform Delta drm-intel-nightly Series Applied

PNV                 -1              364/364              363/364
ILK              +1                 365/366              366/366
SNB                                  450/450              450/450
IVB                                  498/498              498/498
BYT                                  289/289              289/289

HSW -1 564/564 563/564
BDW 417/417 417/417
-------------------------------------Detailed-------------------------------------
Platform Test drm-intel-nightly Series Applied

*PNV  igt_gem_partial_pwrite_pread_write      PASS(2, M25M7)      NO_RESULT(1, M7)
 ILK  igt_kms_flip_wf_vblank-ts-check      DMESG_WARN(2, M26)PASS(10, M26M37)      PASS(1, M37)
*HSW  igt_gem_flink_race_flink_close      PASS(2, M19)      DMESG_WARN(1, M19)

Note: You need to pay more attention to line start with '*'
_______________________________________________
Intel-gfx mailing list [email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx