Commit 43aba7eb0dc052d84e88f3569ea3f030868d49b2

Authored by Dave Airlie
1 parent 65c2a89c30

drm: add a path blob property

This property will be used by the MST code to provide userspace
with a path to parse so it can recognise connectors around hotplugs.

Reviewed-by: Todd Previte <tprevite@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>

Showing 2 changed files with 31 additions and 0 deletions Side-by-side Diff

drivers/gpu/drm/drm_crtc.c
... ... @@ -1257,6 +1257,7 @@
1257 1257 {
1258 1258 struct drm_property *edid;
1259 1259 struct drm_property *dpms;
  1260 + struct drm_property *dev_path;
1260 1261  
1261 1262 /*
1262 1263 * Standard properties (apply to all connectors)
... ... @@ -1271,6 +1272,12 @@
1271 1272 ARRAY_SIZE(drm_dpms_enum_list));
1272 1273 dev->mode_config.dpms_property = dpms;
1273 1274  
  1275 + dev_path = drm_property_create(dev,
  1276 + DRM_MODE_PROP_BLOB |
  1277 + DRM_MODE_PROP_IMMUTABLE,
  1278 + "PATH", 0);
  1279 + dev->mode_config.path_property = dev_path;
  1280 +
1274 1281 return 0;
1275 1282 }
1276 1283  
... ... @@ -3754,6 +3761,25 @@
3754 3761 drm_modeset_unlock_all(dev);
3755 3762 return ret;
3756 3763 }
  3764 +
  3765 +int drm_mode_connector_set_path_property(struct drm_connector *connector,
  3766 + char *path)
  3767 +{
  3768 + struct drm_device *dev = connector->dev;
  3769 + int ret, size;
  3770 + size = strlen(path) + 1;
  3771 +
  3772 + connector->path_blob_ptr = drm_property_create_blob(connector->dev,
  3773 + size, path);
  3774 + if (!connector->path_blob_ptr)
  3775 + return -EINVAL;
  3776 +
  3777 + ret = drm_object_property_set_value(&connector->base,
  3778 + dev->mode_config.path_property,
  3779 + connector->path_blob_ptr->base.id);
  3780 + return ret;
  3781 +}
  3782 +EXPORT_SYMBOL(drm_mode_connector_set_path_property);
3757 3783  
3758 3784 /**
3759 3785 * drm_mode_connector_update_edid_property - update the edid property of a connector
include/drm/drm_crtc.h
... ... @@ -524,6 +524,8 @@
524 524 struct drm_property_blob *edid_blob_ptr;
525 525 struct drm_object_properties properties;
526 526  
  527 + struct drm_property_blob *path_blob_ptr;
  528 +
527 529 uint8_t polled; /* DRM_CONNECTOR_POLL_* */
528 530  
529 531 /* requested DPMS state */
... ... @@ -803,6 +805,7 @@
803 805 struct list_head property_blob_list;
804 806 struct drm_property *edid_property;
805 807 struct drm_property *dpms_property;
  808 + struct drm_property *path_property;
806 809 struct drm_property *plane_type_property;
807 810  
808 811 /* DVI-I properties */
... ... @@ -952,6 +955,8 @@
952 955 extern void drm_mode_config_reset(struct drm_device *dev);
953 956 extern void drm_mode_config_cleanup(struct drm_device *dev);
954 957  
  958 +extern int drm_mode_connector_set_path_property(struct drm_connector *connector,
  959 + char *path);
955 960 extern int drm_mode_connector_update_edid_property(struct drm_connector *connector,
956 961 struct edid *edid);
957 962