diff options
author | Rob Clark <robdclark@gmail.com> | 2014-04-01 20:16:57 -0400 |
---|---|---|
committer | Rob Clark <robdclark@gmail.com> | 2014-04-01 20:18:16 -0400 |
commit | 9922ab5a7e4a4e089b2abfb1425590b97a7a90a3 (patch) | |
tree | 5433db8d25b85f30ad9246821215812cc7d1b1ad /drivers/gpu/drm/drm_crtc.c | |
parent | dc415ff97d6b8f21cc6d264962f3a857a8d44650 (diff) |
drm: Add plane type property (v2)
Add a plane type property to allow userspace to distinguish plane types.
v2: Driver-specific churn eliminated now that drm_plane_init() and
drm_universal_plane_init() were separated out in a previous patch.
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Reviewed-by: Rob Clark <robdclark@gmail.com>
Diffstat (limited to 'drivers/gpu/drm/drm_crtc.c')
-rw-r--r-- | drivers/gpu/drm/drm_crtc.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index 60b903bdf528..eb2165954f18 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c | |||
@@ -121,6 +121,13 @@ static const struct drm_prop_enum_list drm_dpms_enum_list[] = | |||
121 | 121 | ||
122 | DRM_ENUM_NAME_FN(drm_get_dpms_name, drm_dpms_enum_list) | 122 | DRM_ENUM_NAME_FN(drm_get_dpms_name, drm_dpms_enum_list) |
123 | 123 | ||
124 | static const struct drm_prop_enum_list drm_plane_type_enum_list[] = | ||
125 | { | ||
126 | { DRM_PLANE_TYPE_OVERLAY, "Overlay" }, | ||
127 | { DRM_PLANE_TYPE_PRIMARY, "Primary" }, | ||
128 | { DRM_PLANE_TYPE_CURSOR, "Cursor" }, | ||
129 | }; | ||
130 | |||
124 | /* | 131 | /* |
125 | * Optional properties | 132 | * Optional properties |
126 | */ | 133 | */ |
@@ -1050,6 +1057,10 @@ int drm_universal_plane_init(struct drm_device *dev, struct drm_plane *plane, | |||
1050 | if (plane->type == DRM_PLANE_TYPE_OVERLAY) | 1057 | if (plane->type == DRM_PLANE_TYPE_OVERLAY) |
1051 | dev->mode_config.num_overlay_plane++; | 1058 | dev->mode_config.num_overlay_plane++; |
1052 | 1059 | ||
1060 | drm_object_attach_property(&plane->base, | ||
1061 | dev->mode_config.plane_type_property, | ||
1062 | plane->type); | ||
1063 | |||
1053 | out: | 1064 | out: |
1054 | drm_modeset_unlock_all(dev); | 1065 | drm_modeset_unlock_all(dev); |
1055 | 1066 | ||
@@ -1161,6 +1172,21 @@ static int drm_mode_create_standard_connector_properties(struct drm_device *dev) | |||
1161 | return 0; | 1172 | return 0; |
1162 | } | 1173 | } |
1163 | 1174 | ||
1175 | static int drm_mode_create_standard_plane_properties(struct drm_device *dev) | ||
1176 | { | ||
1177 | struct drm_property *type; | ||
1178 | |||
1179 | /* | ||
1180 | * Standard properties (apply to all planes) | ||
1181 | */ | ||
1182 | type = drm_property_create_enum(dev, DRM_MODE_PROP_IMMUTABLE, | ||
1183 | "type", drm_plane_type_enum_list, | ||
1184 | ARRAY_SIZE(drm_plane_type_enum_list)); | ||
1185 | dev->mode_config.plane_type_property = type; | ||
1186 | |||
1187 | return 0; | ||
1188 | } | ||
1189 | |||
1164 | /** | 1190 | /** |
1165 | * drm_mode_create_dvi_i_properties - create DVI-I specific connector properties | 1191 | * drm_mode_create_dvi_i_properties - create DVI-I specific connector properties |
1166 | * @dev: DRM device | 1192 | * @dev: DRM device |
@@ -4564,6 +4590,7 @@ void drm_mode_config_init(struct drm_device *dev) | |||
4564 | 4590 | ||
4565 | drm_modeset_lock_all(dev); | 4591 | drm_modeset_lock_all(dev); |
4566 | drm_mode_create_standard_connector_properties(dev); | 4592 | drm_mode_create_standard_connector_properties(dev); |
4593 | drm_mode_create_standard_plane_properties(dev); | ||
4567 | drm_modeset_unlock_all(dev); | 4594 | drm_modeset_unlock_all(dev); |
4568 | 4595 | ||
4569 | /* Just to be sure */ | 4596 | /* Just to be sure */ |