diff options
author | Rob Clark <robdclark@gmail.com> | 2014-12-18 16:01:54 -0500 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2015-01-05 07:55:29 -0500 |
commit | ae16c597b61ae4613b13a0c3fac302e8d8827ac7 (patch) | |
tree | 317f0b969445d5ff94067e101d3f7c9f5c6db9ad | |
parent | 6b4959f43a04e12d39c5700607727f2cbcfeac31 (diff) |
drm/atomic: atomic connector properties
Expose the core connector state as properties so it can be updated via
atomic ioctl.
Signed-off-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r-- | Documentation/DocBook/drm.tmpl | 11 | ||||
-rw-r--r-- | drivers/gpu/drm/drm_atomic.c | 9 | ||||
-rw-r--r-- | drivers/gpu/drm/drm_crtc.c | 13 |
3 files changed, 25 insertions, 8 deletions
diff --git a/Documentation/DocBook/drm.tmpl b/Documentation/DocBook/drm.tmpl index 8d8dc7124bb5..2f4a29906425 100644 --- a/Documentation/DocBook/drm.tmpl +++ b/Documentation/DocBook/drm.tmpl | |||
@@ -2572,8 +2572,8 @@ void intel_crt_init(struct drm_device *dev) | |||
2572 | <td valign="top" >Description/Restrictions</td> | 2572 | <td valign="top" >Description/Restrictions</td> |
2573 | </tr> | 2573 | </tr> |
2574 | <tr> | 2574 | <tr> |
2575 | <td rowspan="35" valign="top" >DRM</td> | 2575 | <td rowspan="36" valign="top" >DRM</td> |
2576 | <td rowspan="4" valign="top" >Generic</td> | 2576 | <td rowspan="5" valign="top" >Connector</td> |
2577 | <td valign="top" >“EDID”</td> | 2577 | <td valign="top" >“EDID”</td> |
2578 | <td valign="top" >BLOB | IMMUTABLE</td> | 2578 | <td valign="top" >BLOB | IMMUTABLE</td> |
2579 | <td valign="top" >0</td> | 2579 | <td valign="top" >0</td> |
@@ -2602,6 +2602,13 @@ void intel_crt_init(struct drm_device *dev) | |||
2602 | <td valign="top" >Contains tiling information for a connector.</td> | 2602 | <td valign="top" >Contains tiling information for a connector.</td> |
2603 | </tr> | 2603 | </tr> |
2604 | <tr> | 2604 | <tr> |
2605 | <td valign="top" >“CRTC_ID”</td> | ||
2606 | <td valign="top" >OBJECT</td> | ||
2607 | <td valign="top" >DRM_MODE_OBJECT_CRTC</td> | ||
2608 | <td valign="top" >Connector</td> | ||
2609 | <td valign="top" >CRTC that connector is attached to (atomic)</td> | ||
2610 | </tr> | ||
2611 | <tr> | ||
2605 | <td rowspan="11" valign="top" >Plane</td> | 2612 | <td rowspan="11" valign="top" >Plane</td> |
2606 | <td valign="top" >“type”</td> | 2613 | <td valign="top" >“type”</td> |
2607 | <td valign="top" >ENUM | IMMUTABLE</td> | 2614 | <td valign="top" >ENUM | IMMUTABLE</td> |
diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c index 131d47f6f7a2..57cc68177f09 100644 --- a/drivers/gpu/drm/drm_atomic.c +++ b/drivers/gpu/drm/drm_atomic.c | |||
@@ -627,7 +627,10 @@ int drm_atomic_connector_set_property(struct drm_connector *connector, | |||
627 | struct drm_device *dev = connector->dev; | 627 | struct drm_device *dev = connector->dev; |
628 | struct drm_mode_config *config = &dev->mode_config; | 628 | struct drm_mode_config *config = &dev->mode_config; |
629 | 629 | ||
630 | if (property == config->dpms_property) { | 630 | if (property == config->prop_crtc_id) { |
631 | struct drm_crtc *crtc = drm_crtc_find(dev, val); | ||
632 | return drm_atomic_set_crtc_for_connector(state, crtc); | ||
633 | } else if (property == config->dpms_property) { | ||
631 | /* setting DPMS property requires special handling, which | 634 | /* setting DPMS property requires special handling, which |
632 | * is done in legacy setprop path for us. Disallow (for | 635 | * is done in legacy setprop path for us. Disallow (for |
633 | * now?) atomic writes to DPMS property: | 636 | * now?) atomic writes to DPMS property: |
@@ -665,7 +668,9 @@ int drm_atomic_connector_get_property(struct drm_connector *connector, | |||
665 | struct drm_device *dev = connector->dev; | 668 | struct drm_device *dev = connector->dev; |
666 | struct drm_mode_config *config = &dev->mode_config; | 669 | struct drm_mode_config *config = &dev->mode_config; |
667 | 670 | ||
668 | if (property == config->dpms_property) { | 671 | if (property == config->prop_crtc_id) { |
672 | *val = (state->crtc) ? state->crtc->base.id : 0; | ||
673 | } else if (property == config->dpms_property) { | ||
669 | *val = connector->dpms; | 674 | *val = connector->dpms; |
670 | } else if (connector->funcs->atomic_get_property) { | 675 | } else if (connector->funcs->atomic_get_property) { |
671 | return connector->funcs->atomic_get_property(connector, | 676 | return connector->funcs->atomic_get_property(connector, |
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index 46fa0945b53e..3cb1fa09ac9e 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c | |||
@@ -831,6 +831,7 @@ int drm_connector_init(struct drm_device *dev, | |||
831 | const struct drm_connector_funcs *funcs, | 831 | const struct drm_connector_funcs *funcs, |
832 | int connector_type) | 832 | int connector_type) |
833 | { | 833 | { |
834 | struct drm_mode_config *config = &dev->mode_config; | ||
834 | int ret; | 835 | int ret; |
835 | struct ida *connector_ida = | 836 | struct ida *connector_ida = |
836 | &drm_connector_enum_list[connector_type].ida; | 837 | &drm_connector_enum_list[connector_type].ida; |
@@ -869,16 +870,20 @@ int drm_connector_init(struct drm_device *dev, | |||
869 | 870 | ||
870 | /* We should add connectors at the end to avoid upsetting the connector | 871 | /* We should add connectors at the end to avoid upsetting the connector |
871 | * index too much. */ | 872 | * index too much. */ |
872 | list_add_tail(&connector->head, &dev->mode_config.connector_list); | 873 | list_add_tail(&connector->head, &config->connector_list); |
873 | dev->mode_config.num_connector++; | 874 | config->num_connector++; |
874 | 875 | ||
875 | if (connector_type != DRM_MODE_CONNECTOR_VIRTUAL) | 876 | if (connector_type != DRM_MODE_CONNECTOR_VIRTUAL) |
876 | drm_object_attach_property(&connector->base, | 877 | drm_object_attach_property(&connector->base, |
877 | dev->mode_config.edid_property, | 878 | config->edid_property, |
878 | 0); | 879 | 0); |
879 | 880 | ||
880 | drm_object_attach_property(&connector->base, | 881 | drm_object_attach_property(&connector->base, |
881 | dev->mode_config.dpms_property, 0); | 882 | config->dpms_property, 0); |
883 | |||
884 | if (drm_core_check_feature(dev, DRIVER_ATOMIC)) { | ||
885 | drm_object_attach_property(&connector->base, config->prop_crtc_id, 0); | ||
886 | } | ||
882 | 887 | ||
883 | connector->debugfs_entry = NULL; | 888 | connector->debugfs_entry = NULL; |
884 | 889 | ||