Re: [PATCH] drm: Lighten sysfs connector 'status'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Mar 4, 2015 at 10:25 AM, Chris Wilson <chris@xxxxxxxxxxxxxxxxxx> wrote:
> Since the beginning, sysfs/connector/status has done a heavyweight
> detection of the current connector status. But no user, such as upowerd
> or logind, has ever desired to initiate a probe. Move the probing into a
> new attribute so that existing users get the behaviour they desire.

Reviewed-by: Alex Deucher <alexander.deucher@xxxxxxx>

>
> Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
> Cc: Daniel Vetter <daniel.vetter@xxxxxxxx>
> Cc: David Herrmann <dh.herrmann@xxxxxxxxx>
> Cc: Dave Airlie <airled@xxxxxxxxxx>
> ---
>  drivers/gpu/drm/drm_sysfs.c | 14 +++++++++++++-
>  1 file changed, 13 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/drm_sysfs.c b/drivers/gpu/drm/drm_sysfs.c
> index 5c99d3773212..e4ee91a2bd28 100644
> --- a/drivers/gpu/drm/drm_sysfs.c
> +++ b/drivers/gpu/drm/drm_sysfs.c
> @@ -166,7 +166,7 @@ void drm_sysfs_destroy(void)
>  /*
>   * Connector properties
>   */
> -static ssize_t status_show(struct device *device,
> +static ssize_t detect_show(struct device *device,
>                            struct device_attribute *attr,
>                            char *buf)
>  {
> @@ -185,6 +185,16 @@ static ssize_t status_show(struct device *device,
>                         drm_get_connector_status_name(status));
>  }
>
> +static ssize_t status_show(struct device *device,
> +                          struct device_attribute *attr,
> +                          char *buf)
> +{
> +       struct drm_connector *connector = to_drm_connector(device);
> +
> +       return snprintf(buf, PAGE_SIZE, "%s\n",
> +                       drm_get_connector_status_name(connector->status));
> +}
> +
>  static ssize_t dpms_show(struct device *device,
>                            struct device_attribute *attr,
>                            char *buf)
> @@ -339,12 +349,14 @@ static ssize_t select_subconnector_show(struct device *device,
>                         drm_get_dvi_i_select_name((int)subconnector));
>  }
>
> +static DEVICE_ATTR_RO(detect);
>  static DEVICE_ATTR_RO(status);
>  static DEVICE_ATTR_RO(enabled);
>  static DEVICE_ATTR_RO(dpms);
>  static DEVICE_ATTR_RO(modes);
>
>  static struct attribute *connector_dev_attrs[] = {
> +       &dev_attr_detect.attr,
>         &dev_attr_status.attr,
>         &dev_attr_enabled.attr,
>         &dev_attr_dpms.attr,
> --
> 2.1.4
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@xxxxxxxxxxxxxxxxxxxxx
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel





[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux