Skip to content

Commit 43aba7e

Browse files
committed
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 <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
1 parent 65c2a89 commit 43aba7e

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

drivers/gpu/drm/drm_crtc.c

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1257,6 +1257,7 @@ static int drm_mode_create_standard_connector_properties(struct drm_device *dev)
12571257
{
12581258
struct drm_property *edid;
12591259
struct drm_property *dpms;
1260+
struct drm_property *dev_path;
12601261

12611262
/*
12621263
* Standard properties (apply to all connectors)
@@ -1271,6 +1272,12 @@ static int drm_mode_create_standard_connector_properties(struct drm_device *dev)
12711272
ARRAY_SIZE(drm_dpms_enum_list));
12721273
dev->mode_config.dpms_property = dpms;
12731274

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+
12741281
return 0;
12751282
}
12761283

@@ -3755,6 +3762,25 @@ int drm_mode_getblob_ioctl(struct drm_device *dev,
37553762
return ret;
37563763
}
37573764

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);
3783+
37583784
/**
37593785
* drm_mode_connector_update_edid_property - update the edid property of a connector
37603786
* @connector: drm connector

include/drm/drm_crtc.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,8 @@ struct drm_connector {
524524
struct drm_property_blob *edid_blob_ptr;
525525
struct drm_object_properties properties;
526526

527+
struct drm_property_blob *path_blob_ptr;
528+
527529
uint8_t polled; /* DRM_CONNECTOR_POLL_* */
528530

529531
/* requested DPMS state */
@@ -803,6 +805,7 @@ struct drm_mode_config {
803805
struct list_head property_blob_list;
804806
struct drm_property *edid_property;
805807
struct drm_property *dpms_property;
808+
struct drm_property *path_property;
806809
struct drm_property *plane_type_property;
807810

808811
/* DVI-I properties */
@@ -952,6 +955,8 @@ extern void drm_mode_config_init(struct drm_device *dev);
952955
extern void drm_mode_config_reset(struct drm_device *dev);
953956
extern void drm_mode_config_cleanup(struct drm_device *dev);
954957

958+
extern int drm_mode_connector_set_path_property(struct drm_connector *connector,
959+
char *path);
955960
extern int drm_mode_connector_update_edid_property(struct drm_connector *connector,
956961
struct edid *edid);
957962

0 commit comments

Comments
 (0)