* [PATCH 1/7] drm: Define a work struct for scheduling a uevent for modeset retry
@ 2016-10-26 23:25 Manasi Navare
2016-10-26 23:25 ` [PATCH 2/7] drm: Add a new connector property for link status Manasi Navare
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Manasi Navare @ 2016-10-26 23:25 UTC (permalink / raw)
To: intel-gfx; +Cc: Daniel Vetter, dri-devel
This work struct will be used to schedule a uevent on a separate
thread. This will be scheduled after a link train failure during modeset
to indicate a modeset retry request. It will get executed after the
current modeset is complete and all locks are released. This was
required to avoid deadlock.
v2:
* Create a generic work func not i915 specific (Daniel Vetter)
Cc: dri-devel@lists.freedesktop.org
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Daniel Vetter <daniel.vetter@intel.com>
Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
Signed-off-by: Manasi Navare <manasi.d.navare@intel.com>
---
include/drm/drm_connector.h | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
index ac9d7d8..fc9d475 100644
--- a/include/drm/drm_connector.h
+++ b/include/drm/drm_connector.h
@@ -682,6 +682,11 @@ struct drm_connector {
uint8_t num_h_tile, num_v_tile;
uint8_t tile_h_loc, tile_v_loc;
uint16_t tile_h_size, tile_v_size;
+
+ /* Work struct to schedule a uevent on link train failure for
+ * DisplayPort.
+ */
+ struct work_struct modeset_retry_work;
};
#define obj_to_connector(x) container_of(x, struct drm_connector, base)
--
1.9.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/7] drm: Add a new connector property for link status
2016-10-26 23:25 [PATCH 1/7] drm: Define a work struct for scheduling a uevent for modeset retry Manasi Navare
@ 2016-10-26 23:25 ` Manasi Navare
2016-10-26 23:25 ` [PATCH 3/7] drm/i915: Set link status property for DP connector Manasi Navare
2016-10-28 12:01 ` [PATCH 1/7] drm: Define a work struct for scheduling a uevent for modeset retry Jani Nikula
2 siblings, 0 replies; 6+ messages in thread
From: Manasi Navare @ 2016-10-26 23:25 UTC (permalink / raw)
To: intel-gfx; +Cc: dri-devel, Daniel Vetter
A new default 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 not good, 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.
v2:
* Make this a default connector property (Daniel Vetter)
Cc: dri-devel@lists.freedesktop.org
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Daniel Vetter <daniel.vetter@intel.com>
Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Manasi Navare <manasi.d.navare@intel.com>
---
drivers/gpu/drm/drm_connector.c | 17 +++++++++++++++++
include/drm/drm_connector.h | 1 -
include/drm/drm_crtc.h | 5 +++++
include/uapi/drm/drm_mode.h | 4 ++++
4 files changed, 26 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
index 2db7fb5..d4e852f 100644
--- a/drivers/gpu/drm/drm_connector.c
+++ b/drivers/gpu/drm/drm_connector.c
@@ -243,6 +243,10 @@ int drm_connector_init(struct drm_device *dev,
drm_object_attach_property(&connector->base,
config->dpms_property, 0);
+ drm_object_attach_property(&connector->base,
+ config->link_status_property,
+ 0);
+
if (drm_core_check_feature(dev, DRIVER_ATOMIC)) {
drm_object_attach_property(&connector->base, config->prop_crtc_id, 0);
}
@@ -506,6 +510,12 @@ const char *drm_get_subpixel_order_name(enum subpixel_order order)
};
DRM_ENUM_NAME_FN(drm_get_dpms_name, drm_dpms_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" },
+};
+DRM_ENUM_NAME_FN(drm_get_link_status_name, drm_link_status_enum_list)
+
/**
* drm_display_info_set_bus_formats - set the supported bus formats
* @info: display info to store bus formats in
@@ -622,6 +632,13 @@ int drm_connector_create_standard_properties(struct drm_device *dev)
return -ENOMEM;
dev->mode_config.tile_property = prop;
+ prop = drm_property_create_enum(dev, 0, "link-status",
+ drm_link_status_enum_list,
+ ARRAY_SIZE(drm_link_status_enum_list));
+ if (!prop)
+ return -ENOMEM;
+ dev->mode_config.link_status_property = prop;
+
return 0;
}
diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
index fc9d475..3bb420d 100644
--- a/include/drm/drm_connector.h
+++ b/include/drm/drm_connector.h
@@ -759,7 +759,6 @@ 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_connector_set_path_property(struct drm_connector *connector,
const char *path);
int drm_mode_connector_set_tile_property(struct drm_connector *connector);
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index fa1aa21..b86ca19 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -1151,6 +1151,11 @@ struct drm_mode_config {
*/
struct drm_property *tile_property;
/**
+ * @link_status_property: Default connector property for link status
+ * of a connector as a result of link training.
+ */
+ struct drm_property *link_status_property;
+ /**
* @plane_type_property: Default plane property to differentiate
* CURSOR, PRIMARY and OVERLAY legacy uses of planes.
*/
diff --git a/include/uapi/drm/drm_mode.h b/include/uapi/drm/drm_mode.h
index 084b50a..f1b0afd 100644
--- a/include/uapi/drm/drm_mode.h
+++ b/include/uapi/drm/drm_mode.h
@@ -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;
--
1.9.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/7] drm/i915: Set link status property for DP connector
2016-10-26 23:25 [PATCH 1/7] drm: Define a work struct for scheduling a uevent for modeset retry Manasi Navare
2016-10-26 23:25 ` [PATCH 2/7] drm: Add a new connector property for link status Manasi Navare
@ 2016-10-26 23:25 ` Manasi Navare
2016-10-28 12:03 ` Jani Nikula
2016-10-28 12:01 ` [PATCH 1/7] drm: Define a work struct for scheduling a uevent for modeset retry Jani Nikula
2 siblings, 1 reply; 6+ messages in thread
From: Manasi Navare @ 2016-10-26 23:25 UTC (permalink / raw)
To: intel-gfx; +Cc: dri-devel, Daniel Vetter
This defines a helper function to set the property value.
This will be used to set the link status to Bad in case
of link training failures.
Cc: dri-devel@lists.freedesktop.org
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Daniel Vetter <daniel.vetter@intel.com>
Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Manasi Navare <manasi.d.navare@intel.com>
---
drivers/gpu/drm/i915/intel_dp.c | 16 ++++++++++++++++
drivers/gpu/drm/i915/intel_drv.h | 2 ++
2 files changed, 18 insertions(+)
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 3c2293b..795897c 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -4673,6 +4673,22 @@ static int intel_dp_get_modes(struct drm_connector *connector)
return 0;
}
+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)
{
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 7dda79d..f6fe05a 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -1397,6 +1397,8 @@ u32 skl_plane_stride(const struct drm_framebuffer *fb, int plane,
bool intel_dp_init(struct drm_device *dev, i915_reg_t output_reg, enum port port);
bool intel_dp_init_connector(struct intel_digital_port *intel_dig_port,
struct intel_connector *intel_connector);
+int intel_dp_set_link_status_property(struct drm_connector *connector,
+ uint64_t val);
void intel_dp_set_link_params(struct intel_dp *intel_dp,
int link_rate, uint8_t lane_count,
bool link_mst);
--
1.9.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 1/7] drm: Define a work struct for scheduling a uevent for modeset retry
2016-10-26 23:25 [PATCH 1/7] drm: Define a work struct for scheduling a uevent for modeset retry Manasi Navare
2016-10-26 23:25 ` [PATCH 2/7] drm: Add a new connector property for link status Manasi Navare
2016-10-26 23:25 ` [PATCH 3/7] drm/i915: Set link status property for DP connector Manasi Navare
@ 2016-10-28 12:01 ` Jani Nikula
2016-10-28 12:16 ` Jani Nikula
2 siblings, 1 reply; 6+ messages in thread
From: Jani Nikula @ 2016-10-28 12:01 UTC (permalink / raw)
To: Manasi Navare, intel-gfx; +Cc: Daniel Vetter, dri-devel
On Thu, 27 Oct 2016, Manasi Navare <manasi.d.navare@intel.com> wrote:
> This work struct will be used to schedule a uevent on a separate
> thread. This will be scheduled after a link train failure during modeset
> to indicate a modeset retry request. It will get executed after the
> current modeset is complete and all locks are released. This was
> required to avoid deadlock.
>
> v2:
> * Create a generic work func not i915 specific (Daniel Vetter)
>
> Cc: dri-devel@lists.freedesktop.org
> Cc: Jani Nikula <jani.nikula@linux.intel.com>
> Cc: Daniel Vetter <daniel.vetter@intel.com>
> Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
>
> Signed-off-by: Manasi Navare <manasi.d.navare@intel.com>
> ---
> include/drm/drm_connector.h | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
> index ac9d7d8..fc9d475 100644
> --- a/include/drm/drm_connector.h
> +++ b/include/drm/drm_connector.h
> @@ -682,6 +682,11 @@ struct drm_connector {
> uint8_t num_h_tile, num_v_tile;
> uint8_t tile_h_loc, tile_v_loc;
> uint16_t tile_h_size, tile_v_size;
> +
> + /* Work struct to schedule a uevent on link train failure for
> + * DisplayPort.
> + */
> + struct work_struct modeset_retry_work;
I think at least for now we should keep this in intel_connector. All the
code using this will be in i915.
BR,
Jani.
> };
>
> #define obj_to_connector(x) container_of(x, struct drm_connector, base)
--
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 3/7] drm/i915: Set link status property for DP connector
2016-10-26 23:25 ` [PATCH 3/7] drm/i915: Set link status property for DP connector Manasi Navare
@ 2016-10-28 12:03 ` Jani Nikula
0 siblings, 0 replies; 6+ messages in thread
From: Jani Nikula @ 2016-10-28 12:03 UTC (permalink / raw)
To: intel-gfx; +Cc: Manasi Navare, Daniel Vetter, dri-devel
On Thu, 27 Oct 2016, Manasi Navare <manasi.d.navare@intel.com> wrote:
> This defines a helper function to set the property value.
> This will be used to set the link status to Bad in case
> of link training failures.
>
> Cc: dri-devel@lists.freedesktop.org
> Cc: Jani Nikula <jani.nikula@linux.intel.com>
> Cc: Daniel Vetter <daniel.vetter@intel.com>
> Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Signed-off-by: Manasi Navare <manasi.d.navare@intel.com>
> ---
> drivers/gpu/drm/i915/intel_dp.c | 16 ++++++++++++++++
> drivers/gpu/drm/i915/intel_drv.h | 2 ++
> 2 files changed, 18 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> index 3c2293b..795897c 100644
> --- a/drivers/gpu/drm/i915/intel_dp.c
> +++ b/drivers/gpu/drm/i915/intel_dp.c
> @@ -4673,6 +4673,22 @@ static int intel_dp_get_modes(struct drm_connector *connector)
> return 0;
> }
>
> +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;
That's a difficult way to say
return drm_object_property_set_value(...);
> +}
> +
> static int
> intel_dp_connector_register(struct drm_connector *connector)
> {
> diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
> index 7dda79d..f6fe05a 100644
> --- a/drivers/gpu/drm/i915/intel_drv.h
> +++ b/drivers/gpu/drm/i915/intel_drv.h
> @@ -1397,6 +1397,8 @@ u32 skl_plane_stride(const struct drm_framebuffer *fb, int plane,
> bool intel_dp_init(struct drm_device *dev, i915_reg_t output_reg, enum port port);
> bool intel_dp_init_connector(struct intel_digital_port *intel_dig_port,
> struct intel_connector *intel_connector);
> +int intel_dp_set_link_status_property(struct drm_connector *connector,
> + uint64_t val);
> void intel_dp_set_link_params(struct intel_dp *intel_dp,
> int link_rate, uint8_t lane_count,
> bool link_mst);
--
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/7] drm: Define a work struct for scheduling a uevent for modeset retry
2016-10-28 12:01 ` [PATCH 1/7] drm: Define a work struct for scheduling a uevent for modeset retry Jani Nikula
@ 2016-10-28 12:16 ` Jani Nikula
0 siblings, 0 replies; 6+ messages in thread
From: Jani Nikula @ 2016-10-28 12:16 UTC (permalink / raw)
To: Manasi Navare, intel-gfx; +Cc: Daniel Vetter, dri-devel
On Fri, 28 Oct 2016, Jani Nikula <jani.nikula@linux.intel.com> wrote:
> On Thu, 27 Oct 2016, Manasi Navare <manasi.d.navare@intel.com> wrote:
>> This work struct will be used to schedule a uevent on a separate
>> thread. This will be scheduled after a link train failure during modeset
>> to indicate a modeset retry request. It will get executed after the
>> current modeset is complete and all locks are released. This was
>> required to avoid deadlock.
>>
>> v2:
>> * Create a generic work func not i915 specific (Daniel Vetter)
>>
>> Cc: dri-devel@lists.freedesktop.org
>> Cc: Jani Nikula <jani.nikula@linux.intel.com>
>> Cc: Daniel Vetter <daniel.vetter@intel.com>
>> Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
>>
>> Signed-off-by: Manasi Navare <manasi.d.navare@intel.com>
>> ---
>> include/drm/drm_connector.h | 5 +++++
>> 1 file changed, 5 insertions(+)
>>
>> diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
>> index ac9d7d8..fc9d475 100644
>> --- a/include/drm/drm_connector.h
>> +++ b/include/drm/drm_connector.h
>> @@ -682,6 +682,11 @@ struct drm_connector {
>> uint8_t num_h_tile, num_v_tile;
>> uint8_t tile_h_loc, tile_v_loc;
>> uint16_t tile_h_size, tile_v_size;
>> +
>> + /* Work struct to schedule a uevent on link train failure for
>> + * DisplayPort.
>> + */
>> + struct work_struct modeset_retry_work;
>
> I think at least for now we should keep this in intel_connector. All the
> code using this will be in i915.
Oh, and you can just squash that in the first patch that uses it,
i.e. patch 7/7 in this series.
>
> BR,
> Jani.
>
>> };
>>
>> #define obj_to_connector(x) container_of(x, struct drm_connector, base)
--
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2016-10-28 12:16 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-26 23:25 [PATCH 1/7] drm: Define a work struct for scheduling a uevent for modeset retry Manasi Navare
2016-10-26 23:25 ` [PATCH 2/7] drm: Add a new connector property for link status Manasi Navare
2016-10-26 23:25 ` [PATCH 3/7] drm/i915: Set link status property for DP connector Manasi Navare
2016-10-28 12:03 ` Jani Nikula
2016-10-28 12:01 ` [PATCH 1/7] drm: Define a work struct for scheduling a uevent for modeset retry Jani Nikula
2016-10-28 12:16 ` Jani Nikula
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).