Skip to contentSkip to conversation

drm: Add a new connector property for link status

PATCH Superseded Manasi Navare 6 participants 12 messages Oct 26, 2016

Subsystems (3)

v1 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 drm: Add a new connector property for link status

A new optional connector property is added for keeping track of whether the link is good (link training passed) or link is bad (link training failed). If the link status property is Bad, then userspace should fire off a new modeset at the current mode even if there have not been any changes in the mode list or connector status.

Cc Jani Nikula <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Ville Syrjala <[email protected]>
Cc Chris Wilson <[email protected]>
---
 drivers/gpu/drm/drm_connector.c | 32 ++++++++++++++++++++++++++++++++
 include/drm/drm_connector.h     |  1 +
 include/drm/drm_crtc.h          |  6 ++++++
 include/uapi/drm/drm_mode.h     |  4 ++++
 4 files changed, 43 insertions(+)
drivers/gpu/drm/drm_connector.c +32 -0
index 2db7fb5..b4ce19f 100644
@@ -588,6 +588,11 @@ int drm_display_info_set_bus_formats(struct drm_display_info *info,
 DRM_ENUM_NAME_FN(drm_get_tv_subconnector_name,
 		 drm_tv_subconnector_enum_list)
 
+static const struct drm_prop_enum_list drm_link_status_enum_list[] = {
+	{ DRM_MODE_LINK_STATUS_GOOD, "Good" },
+	{ DRM_MODE_LINK_STATUS_BAD, "Bad" },
+};
+
 int drm_connector_create_standard_properties(struct drm_device *dev)
 {
 	struct drm_property *prop;
@@ -845,6 +850,33 @@ int drm_mode_create_suggested_offset_properties(struct drm_device *dev)
 EXPORT_SYMBOL(drm_mode_create_suggested_offset_properties);
 
 /**
+ * drm_mode_create_link_status_property - Create link status property
+ * @dev: DRM device
+ *
+ * Called by a driver the first time it's needed, must be attached to desired
+ * connectors.
+ * This property is used to indicate whether link sttaus is Good or Bad as
+ * a result fo link training
+ */
+int drm_mode_create_link_status_property(struct drm_device *dev)
+{
+	struct drm_property *link_status;
+
+	if (dev->mode_config.link_status_property)
+		return 0;
+
+	link_status =
+		drm_property_create_enum(dev, 0, "link-status",
+					 drm_link_status_enum_list,
+					 ARRAY_SIZE(drm_link_status_enum_list));
+
+	dev->mode_config.scaling_mode_property = link_status;
+
+	return 0;
+}
+EXPORT_SYMBOL(drm_mode_create_link_status_property);
+
+/**
  * drm_mode_connector_set_path_property - set tile property on connector
  * @connector: connector to set property on.
  * @path: path to use for property; must not be NULL.
include/drm/drm_connector.h +1 -0
index fc9d475..7234c0c 100644
@@ -759,6 +759,7 @@ int drm_mode_create_tv_properties(struct drm_device *dev,
 int drm_mode_create_scaling_mode_property(struct drm_device *dev);
 int drm_mode_create_aspect_ratio_property(struct drm_device *dev);
 int drm_mode_create_suggested_offset_properties(struct drm_device *dev);
+int drm_mode_create_link_status_property(struct drm_device *dev);
 
 int drm_mode_connector_set_path_property(struct drm_connector *connector,
 					 const char *path);
include/drm/drm_crtc.h +6 -0
index fa1aa21..3e9c833 100644
@@ -1343,6 +1343,12 @@ struct drm_mode_config {
 	 */
 	struct drm_property *suggested_y_property;
 
+	/**
+	 * @link_status_property: Optional connector property for link status
+	 * of the connector as a result of link training.
+	 */
+	 struct drm_property *link_status_property;
+
 	/* dumb ioctl parameters */
 	uint32_t preferred_depth, prefer_shadow;
 
include/uapi/drm/drm_mode.h +4 -0
index 084b50a..f1b0afd 100644
@@ -121,6 +121,10 @@
 #define DRM_MODE_DIRTY_ON       1
 #define DRM_MODE_DIRTY_ANNOTATE 2
 
+/* Link Status options */
+#define DRM_MODE_LINK_STATUS_GOOD	0
+#define DRM_MODE_LINK_STATUS_BAD	1
+
 struct drm_mode_modeinfo {
 	__u32 clock;
 	__u16 hdisplay;
Signature · 6 lines
1.9.1

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

PATCH 2/2 drm/i915: Set link status property for DP connector

The link status connector property is attached to the drm object in DP initialization.
This also defines a helper function to set the property value. This will be used to set the link sttaus to Bad in case of link training failures.

Cc Jani Nikula <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Ville Syrjala <[email protected]>
Cc Chris Wilson <[email protected]>
---
 drivers/gpu/drm/i915/intel_dp.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
drivers/gpu/drm/i915/intel_dp.c +21 -0
index 3c2293b..dd0d372 100644
@@ -4674,6 +4674,22 @@ static int intel_dp_get_modes(struct drm_connector *connector)
 }
 
 static int
+intel_dp_set_link_status_property(struct drm_connector *connector,
+				  uint64_t val)
+{
+	struct drm_device *dev = connector->dev;
+	int ret = 0;
+
+	ret = drm_object_property_set_value(&connector->base,
+					    dev->mode_config.link_status_property,
+					    val);
+	if (ret)
+		return ret;
+
+	return ret;
+}
+
+static int
 intel_dp_connector_register(struct drm_connector *connector)
 {
 	struct intel_dp *intel_dp = intel_attached_dp(connector);
@@ -4940,6 +4956,11 @@ bool intel_dp_is_edp(struct drm_device *dev, enum port port)
 			connector->dev->mode_config.scaling_mode_property,
 			DRM_MODE_SCALE_ASPECT);
 		intel_connector->panel.fitting_mode = DRM_MODE_SCALE_ASPECT;
+	} else {
+		drm_mode_create_link_status_property(connector->dev);
+		drm_object_attach_property(&connector->base,
+					   connector->dev->mode_config.link_status_property,
+					   DRM_MODE_LINK_STATUS_GOOD);
 	}
 }
 
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#2 lore raw
In reply to Manasi Navare

Chris,

Would you be able to make the necessary changes in the suerspace driver so I can do some testing tomorrow?

Manasi

Quoted 117 lines · Manasi Navare

A new optional connector property is added for keeping track of whether the link is good (link training passed) or link is bad (link training failed). If the link status property is Bad, then userspace should fire off a new modeset at the current mode even if there have not been any changes in the mode list or connector status.

Cc Jani Nikula <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Ville Syrjala <[email protected]>
Cc Chris Wilson <[email protected]>
---
 drivers/gpu/drm/drm_connector.c | 32 ++++++++++++++++++++++++++++++++
 include/drm/drm_connector.h     |  1 +
 include/drm/drm_crtc.h          |  6 ++++++
 include/uapi/drm/drm_mode.h     |  4 ++++
 4 files changed, 43 insertions(+)
drivers/gpu/drm/drm_connector.c +32 -0
index 2db7fb5..b4ce19f 100644
@@ -588,6 +588,11 @@ int drm_display_info_set_bus_formats(struct drm_display_info *info,
 DRM_ENUM_NAME_FN(drm_get_tv_subconnector_name,
 		 drm_tv_subconnector_enum_list)
 
+static const struct drm_prop_enum_list drm_link_status_enum_list[] = {
+	{ DRM_MODE_LINK_STATUS_GOOD, "Good" },
+	{ DRM_MODE_LINK_STATUS_BAD, "Bad" },
+};
+
 int drm_connector_create_standard_properties(struct drm_device *dev)
 {
 	struct drm_property *prop;
@@ -845,6 +850,33 @@ int drm_mode_create_suggested_offset_properties(struct drm_device *dev)
 EXPORT_SYMBOL(drm_mode_create_suggested_offset_properties);
 
 /**
+ * drm_mode_create_link_status_property - Create link status property
+ * @dev: DRM device
+ *
+ * Called by a driver the first time it's needed, must be attached to desired
+ * connectors.
+ * This property is used to indicate whether link sttaus is Good or Bad as
+ * a result fo link training
+ */
+int drm_mode_create_link_status_property(struct drm_device *dev)
+{
+	struct drm_property *link_status;
+
+	if (dev->mode_config.link_status_property)
+		return 0;
+
+	link_status =
+		drm_property_create_enum(dev, 0, "link-status",
+					 drm_link_status_enum_list,
+					 ARRAY_SIZE(drm_link_status_enum_list));
+
+	dev->mode_config.scaling_mode_property = link_status;
+
+	return 0;
+}
+EXPORT_SYMBOL(drm_mode_create_link_status_property);
+
+/**
  * drm_mode_connector_set_path_property - set tile property on connector
  * @connector: connector to set property on.
  * @path: path to use for property; must not be NULL.
include/drm/drm_connector.h +1 -0
index fc9d475..7234c0c 100644
@@ -759,6 +759,7 @@ int drm_mode_create_tv_properties(struct drm_device *dev,
 int drm_mode_create_scaling_mode_property(struct drm_device *dev);
 int drm_mode_create_aspect_ratio_property(struct drm_device *dev);
 int drm_mode_create_suggested_offset_properties(struct drm_device *dev);
+int drm_mode_create_link_status_property(struct drm_device *dev);
 
 int drm_mode_connector_set_path_property(struct drm_connector *connector,
 					 const char *path);
include/drm/drm_crtc.h +6 -0
index fa1aa21..3e9c833 100644
@@ -1343,6 +1343,12 @@ struct drm_mode_config {
 	 */
 	struct drm_property *suggested_y_property;
 
+	/**
+	 * @link_status_property: Optional connector property for link status
+	 * of the connector as a result of link training.
+	 */
+	 struct drm_property *link_status_property;
+
 	/* dumb ioctl parameters */
 	uint32_t preferred_depth, prefer_shadow;
 
include/uapi/drm/drm_mode.h +4 -0
index 084b50a..f1b0afd 100644
@@ -121,6 +121,10 @@
 #define DRM_MODE_DIRTY_ON       1
 #define DRM_MODE_DIRTY_ANNOTATE 2
 
+/* Link Status options */
+#define DRM_MODE_LINK_STATUS_GOOD	0
+#define DRM_MODE_LINK_STATUS_BAD	1
+
 struct drm_mode_modeinfo {
 	__u32 clock;
 	__u16 hdisplay;
Signature · 1 line
1.9.1

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

#3 lore raw
Quoted 57 lines · Manasi Navare

Chris,

Would you be able to make the necessary changes in the suerspace driver so I can do some testing tomorrow?

Manasi

Quoted 49 lines · Manasi Navare

A new optional connector property is added for keeping track of whether the link is good (link training passed) or link is bad (link training failed). If the link status property is Bad, then userspace should fire off a new modeset at the current mode even if there have not been any changes in the mode list or connector status.

Cc Jani Nikula <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Ville Syrjala <[email protected]>
Cc Chris Wilson <[email protected]>
---
 drivers/gpu/drm/drm_connector.c | 32 ++++++++++++++++++++++++++++++++
 include/drm/drm_connector.h     |  1 +
 include/drm/drm_crtc.h          |  6 ++++++
 include/uapi/drm/drm_mode.h     |  4 ++++
 4 files changed, 43 insertions(+)
drivers/gpu/drm/drm_connector.c +14 -0
index 2db7fb5..b4ce19f 100644
@@ -588,6 +588,11 @@ int drm_display_info_set_bus_formats(struct drm_display_info *info,
 DRM_ENUM_NAME_FN(drm_get_tv_subconnector_name,
 		 drm_tv_subconnector_enum_list)
 
+static const struct drm_prop_enum_list drm_link_status_enum_list[] = {
+	{ DRM_MODE_LINK_STATUS_GOOD, "Good" },
+	{ DRM_MODE_LINK_STATUS_BAD, "Bad" },
+};
+
 int drm_connector_create_standard_properties(struct drm_device *dev)
 {
 	struct drm_property *prop;
@@ -845,6 +850,33 @@ int drm_mode_create_suggested_offset_properties(struct drm_device *dev)
 EXPORT_SYMBOL(drm_mode_create_suggested_offset_properties);
 
 /**
+ * drm_mode_create_link_status_property - Create link status property
+ * @dev: DRM device
+ *
+ * Called by a driver the first time it's needed, must be attached to desired
+ * connectors.
+ * This property is used to indicate whether link sttaus is Good or Bad as
+ * a result fo link training
+ */
+int drm_mode_create_link_status_property(struct drm_device *dev)
Quoted 8 lines

drivers/gpu/drm/drm_connector.c int drm_mode_create_suggested_offset_properties(struct drm_device *dev) · line 869

Quoted 8 lines
drivers/gpu/drm/drm_connector.c +8 -0
+{
+	struct drm_property *link_status;
+
+	if (dev->mode_config.link_status_property)
+		return 0;
+
+	link_status =
+		drm_property_create_enum(dev, 0, "link-status",

s/0/DRM_MODE_PROP_IMMUTABLE/

Bikeshed commitee: "link-status" or "link status" or "Link status"
"Good" or "good"

Do we want a general term such as bad or more specific error? Anything not !good is an error, so we are always free to add more if need be. -Chris

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

✗ Fi.CI.BAT: failure for series starting with [1/2] drm: Add a new connector property for link status

In reply to Manasi Navare
== Series Details ==

== Series Details ==

Series: series starting with [1/2] drm: Add a new connector property for link status
URL : https://patchwork.freedesktop.org/series/14374/
State : failure

== Summary ==

Series 14374v1 Series without cover letter
https://patchwork.freedesktop.org/api/1.0/series/14374/revisions/1/mbox/

Test drv_module_reload_basic:

                dmesg-warn -> PASS       (fi-skl-6700hq)
Test gem_exec_suspend:
        Subgroup basic-s3:
                pass       -> DMESG-WARN (fi-skl-6700hq)
Test kms_busy:
        Subgroup basic-flip-default-a:
                pass       -> INCOMPLETE (fi-skl-6260u)
                pass       -> INCOMPLETE (fi-bxt-t5700)
                pass       -> INCOMPLETE (fi-skl-6770hq)
                skip       -> INCOMPLETE (fi-bsw-n3050)
                pass       -> INCOMPLETE (fi-ilk-650)
                pass       -> INCOMPLETE (fi-hsw-4770)
                pass       -> INCOMPLETE (fi-byt-j1900)
                pass       -> INCOMPLETE (fi-snb-2520m)
                pass       -> INCOMPLETE (fi-hsw-4770r)
                pass       -> INCOMPLETE (fi-kbl-7200u)
                pass       -> INCOMPLETE (fi-bdw-5557u)
                pass       -> INCOMPLETE (fi-skl-6700k)
                pass       -> INCOMPLETE (fi-skl-6700hq)
                pass       -> INCOMPLETE (fi-snb-2600)
                pass       -> INCOMPLETE (fi-ivb-3770)
                pass       -> INCOMPLETE (fi-byt-n2820)
                pass       -> INCOMPLETE (fi-ivb-3520m)
fi-bdw-5557u     total:168  pass:161  dwarn:0   dfail:0   fail:0   skip:6  
fi-bsw-n3050     total:168  pass:149  dwarn:0   dfail:0   fail:0   skip:18 
fi-bxt-t5700     total:168  pass:149  dwarn:0   dfail:0   fail:0   skip:18 
fi-byt-j1900     total:168  pass:148  dwarn:0   dfail:0   fail:0   skip:19 
fi-byt-n2820     total:168  pass:148  dwarn:0   dfail:0   fail:0   skip:19 
fi-hsw-4770      total:168  pass:154  dwarn:0   dfail:0   fail:0   skip:13 
fi-hsw-4770r     total:168  pass:154  dwarn:0   dfail:0   fail:0   skip:13 
fi-ilk-650       total:168  pass:127  dwarn:0   dfail:0   fail:0   skip:40 
fi-ivb-3520m     total:168  pass:149  dwarn:0   dfail:0   fail:0   skip:18 
fi-ivb-3770      total:168  pass:149  dwarn:0   dfail:0   fail:0   skip:18 
fi-kbl-7200u     total:168  pass:152  dwarn:0   dfail:0   fail:0   skip:15 
fi-skl-6260u     total:168  pass:162  dwarn:0   dfail:0   fail:0   skip:5  
fi-skl-6700hq    total:168  pass:151  dwarn:1   dfail:0   fail:0   skip:15 
fi-skl-6700k     total:168  pass:151  dwarn:1   dfail:0   fail:0   skip:15 
fi-skl-6770hq    total:168  pass:162  dwarn:0   dfail:0   fail:0   skip:5  
fi-snb-2520m     total:168  pass:144  dwarn:0   dfail:0   fail:0   skip:23 
fi-snb-2600      total:168  pass:144  dwarn:0   dfail:0   fail:0   skip:23 

f746a2112fbb563743acc132304075706551d123 drm-intel-nightly: 2016y-10m-25d-20h-02m-34s UTC integration manifest 9181ffc drm/i915: Set link status property for DP connector
59ae3f6 drm: Add a new connector property for link status

Full results at https://intel-gfx-ci.01.org/CI/Patchwork_2819/

== Logs ==

For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_2819/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#5 lore raw
In reply to Manasi Navare
Quoted 39 lines · Manasi Navare

A new optional connector property is added for keeping track of whether the link is good (link training passed) or link is bad (link training failed). If the link status property is Bad, then userspace should fire off a new modeset at the current mode even if there have not been any changes in the mode list or connector status.

Cc Jani Nikula <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Ville Syrjala <[email protected]>
Cc Chris Wilson <[email protected]>
---
 drivers/gpu/drm/drm_connector.c | 32 ++++++++++++++++++++++++++++++++
 include/drm/drm_connector.h     |  1 +
 include/drm/drm_crtc.h          |  6 ++++++
 include/uapi/drm/drm_mode.h     |  4 ++++
 4 files changed, 43 insertions(+)
drivers/gpu/drm/drm_connector.c +5 -0
index 2db7fb5..b4ce19f 100644
@@ -588,6 +588,11 @@ int drm_display_info_set_bus_formats(struct drm_display_info *info,
 DRM_ENUM_NAME_FN(drm_get_tv_subconnector_name,
 		 drm_tv_subconnector_enum_list)
 
+static const struct drm_prop_enum_list drm_link_status_enum_list[] = {
+	{ DRM_MODE_LINK_STATUS_GOOD, "Good" },
+	{ DRM_MODE_LINK_STATUS_BAD, "Bad" },
+};
+
 int drm_connector_create_standard_properties(struct drm_device *dev)
 {
 	struct drm_property *prop;
@@ -845,6 +850,33 @@ int drm_mode_create_suggested_offset_properties(struct drm_device *dev)
 EXPORT_SYMBOL(drm_mode_create_suggested_offset_properties);
 

drivers/gpu/drm/drm_connector.c int drm_mode_create_suggested_offset_properties(struct drm_device *dev) · line 861

Quoted 10 lines
drivers/gpu/drm/drm_connector.c +9 -0
 /**
+ * drm_mode_create_link_status_property - Create link status property
+ * @dev: DRM device
+ *
+ * Called by a driver the first time it's needed, must be attached to desired
+ * connectors.
+ * This property is used to indicate whether link sttaus is Good or Bad as
+ * a result fo link training
+ */
+int drm_mode_create_link_status_property(struct drm_device *dev)

I'd go further and just always create this as one of the standard properties (and always attach it to the connector, like edid), and only expose helpers to set the link status to good or bad. -Daniel

Quoted 72 lines
drivers/gpu/drm/drm_connector.c +18 -0
+{
+	struct drm_property *link_status;
+
+	if (dev->mode_config.link_status_property)
+		return 0;
+
+	link_status =
+		drm_property_create_enum(dev, 0, "link-status",
+					 drm_link_status_enum_list,
+					 ARRAY_SIZE(drm_link_status_enum_list));
+
+	dev->mode_config.scaling_mode_property = link_status;
+
+	return 0;
+}
+EXPORT_SYMBOL(drm_mode_create_link_status_property);
+
+/**
  * drm_mode_connector_set_path_property - set tile property on connector
  * @connector: connector to set property on.
  * @path: path to use for property; must not be NULL.
include/drm/drm_connector.h +1 -0
index fc9d475..7234c0c 100644
@@ -759,6 +759,7 @@ int drm_mode_create_tv_properties(struct drm_device *dev,
 int drm_mode_create_scaling_mode_property(struct drm_device *dev);
 int drm_mode_create_aspect_ratio_property(struct drm_device *dev);
 int drm_mode_create_suggested_offset_properties(struct drm_device *dev);
+int drm_mode_create_link_status_property(struct drm_device *dev);
 
 int drm_mode_connector_set_path_property(struct drm_connector *connector,
 					 const char *path);
include/drm/drm_crtc.h +6 -0
index fa1aa21..3e9c833 100644
@@ -1343,6 +1343,12 @@ struct drm_mode_config {
 	 */
 	struct drm_property *suggested_y_property;
 
+	/**
+	 * @link_status_property: Optional connector property for link status
+	 * of the connector as a result of link training.
+	 */
+	 struct drm_property *link_status_property;
+
 	/* dumb ioctl parameters */
 	uint32_t preferred_depth, prefer_shadow;
 
include/uapi/drm/drm_mode.h +4 -0
index 084b50a..f1b0afd 100644
@@ -121,6 +121,10 @@
 #define DRM_MODE_DIRTY_ON       1
 #define DRM_MODE_DIRTY_ANNOTATE 2
 
+/* Link Status options */
+#define DRM_MODE_LINK_STATUS_GOOD	0
+#define DRM_MODE_LINK_STATUS_BAD	1
+
 struct drm_mode_modeinfo {
 	__u32 clock;
 	__u16 hdisplay;
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#6 lore raw
Quoted 3 lines · Daniel Vetter

I'd go further and just always create this as one of the standard properties (and always attach it to the connector, like edid), and only expose helpers to set the link status to good or bad.

One of the sketches for this idea was that this could serve as the failure notification path for nonblocking modesets (well modesets in general since it appears returning the error is not going to happen). -Chris

Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
maintainer
#7 lore raw
Quoted 8 lines · Chris Wilson
Quoted 3 lines · Daniel Vetter

I'd go further and just always create this as one of the standard properties (and always attach it to the connector, like edid), and only expose helpers to set the link status to good or bad.

One of the sketches for this idea was that this could serve as the failure notification path for nonblocking modesets (well modesets in general since it appears returning the error is not going to happen).

In nonblocking modesets, when should we change the status from bad to good? If the setcrtc returns and userspace looks at link status and sees it's still bad (because the kernel hasn't gotten around to enabling the link yet, or whatever), userspace might think it would have to try again. Do we set it to good immediately on setcrtc ioctl, or add a "pending" status? Or something better?

BR,
Jani.

Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#8 lore raw
Quoted 10 lines · Jani Nikula
Quoted 8 lines · Chris Wilson
Quoted 3 lines · Daniel Vetter

I'd go further and just always create this as one of the standard properties (and always attach it to the connector, like edid), and only expose helpers to set the link status to good or bad.

One of the sketches for this idea was that this could serve as the failure notification path for nonblocking modesets (well modesets in general since it appears returning the error is not going to happen).

Quoted 6 lines

In nonblocking modesets, when should we change the status from bad to good? If the setcrtc returns and userspace looks at link status and sees it's still bad (because the kernel hasn't gotten around to enabling the link yet, or whatever), userspace might think it would have to try again. Do we set it to good immediately on setcrtc ioctl, or add a "pending" status? Or something better?

I was thinking it'd start out as "good" and only change to something else when things actually go south.

Not sure if we should also want "off" as one of the values, for when it's really off at the request of the user.

Signature · 6 lines
Ville Syrjälä
Intel OTC
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#9 lore raw
Quoted 18 lines · Ville Syrjälä
Quoted 10 lines · Jani Nikula
Quoted 8 lines · Chris Wilson
Quoted 3 lines · Daniel Vetter

I'd go further and just always create this as one of the standard properties (and always attach it to the connector, like edid), and only expose helpers to set the link status to good or bad.

One of the sketches for this idea was that this could serve as the failure notification path for nonblocking modesets (well modesets in general since it appears returning the error is not going to happen).

Quoted 6 lines

In nonblocking modesets, when should we change the status from bad to good? If the setcrtc returns and userspace looks at link status and sees it's still bad (because the kernel hasn't gotten around to enabling the link yet, or whatever), userspace might think it would have to try again. Do we set it to good immediately on setcrtc ioctl, or add a "pending" status? Or something better?

Quoted 5 lines

I was thinking it'd start out as "good" and only change to something else when things actually go south.

Not sure if we should also want "off" as one of the values, for when it's really off at the request of the user.

That's something the user knows. At least, if the ddx has output->crtc set and sees that link-status=off the response is to say "that can't be me!" and reapply the desired mode, i.e. same response as if the link-status was bad. Maybe useful for someone else to differentiate? -Chris

Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#10 lore raw
Quoted 22 lines · Chris Wilson
Quoted 21 lines · Ville Syrjälä
Quoted 10 lines · Jani Nikula
Quoted 8 lines · Chris Wilson
Quoted 3 lines · Daniel Vetter

I'd go further and just always create this as one of the standard properties (and always attach it to the connector, like edid), and only expose helpers to set the link status to good or bad.

One of the sketches for this idea was that this could serve as the failure notification path for nonblocking modesets (well modesets in general since it appears returning the error is not going to happen).

Quoted 6 lines

In nonblocking modesets, when should we change the status from bad to good? If the setcrtc returns and userspace looks at link status and sees it's still bad (because the kernel hasn't gotten around to enabling the link yet, or whatever), userspace might think it would have to try again. Do we set it to good immediately on setcrtc ioctl, or add a "pending" status? Or something better?

I was thinking it'd start out as "good" and only change to something else when things actually go south.

Quoted 7 lines
Quoted 2 lines

Not sure if we should also want "off" as one of the values, for when it's really off at the request of the user.

That's something the user knows. At least, if the ddx has output->crtc set and sees that link-status=off the response is to say "that can't be me!" and reapply the desired mode, i.e. same response as if the link-status was bad. Maybe useful for someone else to differentiate?

Dunno really. If we don't add it we have to define what the link status will indicate when the thing is really off though. With "good" and "bad" the only options I guess "good" would be the right answer?

Signature · 6 lines
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#11 lore raw
Quoted 26 lines · Ville Syrjälä
Quoted 25 lines · Chris Wilson
Quoted 23 lines · Ville Syrjälä
Quoted 10 lines · Jani Nikula
Quoted 8 lines · Chris Wilson
Quoted 3 lines · Daniel Vetter

I'd go further and just always create this as one of the standard properties (and always attach it to the connector, like edid), and only expose helpers to set the link status to good or bad.

One of the sketches for this idea was that this could serve as the failure notification path for nonblocking modesets (well modesets in general since it appears returning the error is not going to happen).

Quoted 6 lines

In nonblocking modesets, when should we change the status from bad to good? If the setcrtc returns and userspace looks at link status and sees it's still bad (because the kernel hasn't gotten around to enabling the link yet, or whatever), userspace might think it would have to try again. Do we set it to good immediately on setcrtc ioctl, or add a "pending" status? Or something better?

I was thinking it'd start out as "good" and only change to something else when things actually go south.

Not sure if we should also want "off" as one of the values, for when it's really off at the request of the user.

Quoted 8 lines
Quoted 4 lines

That's something the user knows. At least, if the ddx has output->crtc set and sees that link-status=off the response is to say "that can't be me!" and reapply the desired mode, i.e. same response as if the link-status was bad. Maybe useful for someone else to differentiate?

Dunno really. If we don't add it we have to define what the link status will indicate when the thing is really off though. With "good" and "bad" the only options I guess "good" would be the right answer?

Fair point.

bad = -1, (any specific error can then be -value)
ok = 0,
suspend,
standy,
off, [looking suspiciously like dpms modes :]
?
-Chris

Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel