All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: Manasi Navare <manasi.d.navare@intel.com>,
	Daniel Vetter <daniel.vetter@intel.com>,
	dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v3 1/4] drm: Add a new connector property for link status
Date: Wed, 09 Nov 2016 15:45:54 +0200	[thread overview]
Message-ID: <877f8cg419.fsf@intel.com> (raw)
In-Reply-To: <1477949394-20483-1-git-send-email-manasi.d.navare@intel.com>

On Mon, 31 Oct 2016, Manasi Navare <manasi.d.navare@intel.com> wrote:
> 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.
> Also add link status connector member corersponding to the
> decoded value of link status property.

I think it would be good to expand on this, both in the commit message
and documentation. This is UABI after all.

When is the property changed, who changes it, what is the userspace
expected to do when the status goes from good to bad, how does userspace
notice it's gone bad (uevents).

While we want this for handling DP link training failures during mode
setting according to the DP spec, in a way that can pass the CTS, it's
also needed for async mode sets.

BR,
Jani.



>
> v3:
> * Drop "link training" from description since this is
> not specific to DP (Jani Nikula)
> * Add link status member to store property value locally
> (Ville Syrjala)
> 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     |  7 ++++++-
>  include/drm/drm_crtc.h          |  5 +++++
>  include/uapi/drm/drm_mode.h     |  4 ++++
>  4 files changed, 32 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 ac9d7d8..5c335e8 100644
> --- a/include/drm/drm_connector.h
> +++ b/include/drm/drm_connector.h
> @@ -682,6 +682,12 @@ 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;
> +
> +	/* Connector Link status
> +	 * 0: If the link is Good
> +	 * 1: If the link is Bad
> +	 */
> +	int link_status;
>  };
>  
>  #define obj_to_connector(x) container_of(x, struct drm_connector, base)
> @@ -754,7 +760,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..737f4d3 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
> +	 */
> +	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;

-- 
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2016-11-09 13:45 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-29  1:07 [PATCH v2 0/4] Handle link training failure during modeset for DDI Manasi Navare
2016-10-29  1:07 ` [PATCH v2 1/4] drm: Add a new connector property for link status Manasi Navare
2016-10-31 13:16   ` Jani Nikula
2016-10-31 21:29   ` [PATCH v3 " Manasi Navare
2016-11-09 13:45     ` Jani Nikula [this message]
2016-10-29  1:07 ` [PATCH v2 2/4] drm/i915: Set link status property for DP connector Manasi Navare
2016-10-31 16:08   ` Jani Nikula
2016-10-29  1:07 ` [PATCH v2 3/4] drm/i915: Find fallback link rate/lane count Manasi Navare
2016-10-29  1:07 ` [PATCH v2 4/4] drm/i915: Implement Link Rate fallback on Link training failure Manasi Navare
2016-11-01  8:49   ` Jani Nikula
2016-11-01 16:26     ` Manasi Navare
2016-11-01 19:16       ` Jani Nikula
2016-11-01 19:34         ` Manasi Navare
2016-11-02  0:29           ` Manasi Navare
2016-11-02 20:55   ` [PATCH v3 " Manasi Navare
2016-11-07 19:24     ` Manasi Navare
2016-11-09 13:07       ` Jani Nikula
2016-11-09 13:04     ` Jani Nikula
2016-11-09 22:05       ` Manasi Navare
2016-10-29  1:55 ` ✗ Fi.CI.BAT: failure for Handle link training failure during modeset for DDI Patchwork
2016-10-31 21:55 ` ✗ Fi.CI.BAT: failure for Handle link training failure during modeset for DDI (rev2) Patchwork
2016-11-02 21:24 ` ✗ Fi.CI.BAT: failure for Handle link training failure during modeset for DDI (rev3) 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=877f8cg419.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=manasi.d.navare@intel.com \
    /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.