diff options
Diffstat (limited to 'drivers/gpu/drm/drm_crtc.c')
-rw-r--r-- | drivers/gpu/drm/drm_crtc.c | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index 66d3bfb8d264..f3ef461deeb8 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c | |||
@@ -1022,6 +1022,29 @@ void drm_connector_cleanup(struct drm_connector *connector) | |||
1022 | EXPORT_SYMBOL(drm_connector_cleanup); | 1022 | EXPORT_SYMBOL(drm_connector_cleanup); |
1023 | 1023 | ||
1024 | /** | 1024 | /** |
1025 | * drm_connector_index - find the index of a registered connector | ||
1026 | * @connector: connector to find index for | ||
1027 | * | ||
1028 | * Given a registered connector, return the index of that connector within a DRM | ||
1029 | * device's list of connectors. | ||
1030 | */ | ||
1031 | unsigned int drm_connector_index(struct drm_connector *connector) | ||
1032 | { | ||
1033 | unsigned int index = 0; | ||
1034 | struct drm_connector *tmp; | ||
1035 | |||
1036 | list_for_each_entry(tmp, &connector->dev->mode_config.connector_list, head) { | ||
1037 | if (tmp == connector) | ||
1038 | return index; | ||
1039 | |||
1040 | index++; | ||
1041 | } | ||
1042 | |||
1043 | BUG(); | ||
1044 | } | ||
1045 | EXPORT_SYMBOL(drm_connector_index); | ||
1046 | |||
1047 | /** | ||
1025 | * drm_connector_register - register a connector | 1048 | * drm_connector_register - register a connector |
1026 | * @connector: the connector to register | 1049 | * @connector: the connector to register |
1027 | * | 1050 | * |
@@ -1326,6 +1349,29 @@ void drm_plane_cleanup(struct drm_plane *plane) | |||
1326 | EXPORT_SYMBOL(drm_plane_cleanup); | 1349 | EXPORT_SYMBOL(drm_plane_cleanup); |
1327 | 1350 | ||
1328 | /** | 1351 | /** |
1352 | * drm_plane_index - find the index of a registered plane | ||
1353 | * @plane: plane to find index for | ||
1354 | * | ||
1355 | * Given a registered plane, return the index of that CRTC within a DRM | ||
1356 | * device's list of planes. | ||
1357 | */ | ||
1358 | unsigned int drm_plane_index(struct drm_plane *plane) | ||
1359 | { | ||
1360 | unsigned int index = 0; | ||
1361 | struct drm_plane *tmp; | ||
1362 | |||
1363 | list_for_each_entry(tmp, &plane->dev->mode_config.plane_list, head) { | ||
1364 | if (tmp == plane) | ||
1365 | return index; | ||
1366 | |||
1367 | index++; | ||
1368 | } | ||
1369 | |||
1370 | BUG(); | ||
1371 | } | ||
1372 | EXPORT_SYMBOL(drm_plane_index); | ||
1373 | |||
1374 | /** | ||
1329 | * drm_plane_force_disable - Forcibly disable a plane | 1375 | * drm_plane_force_disable - Forcibly disable a plane |
1330 | * @plane: plane to disable | 1376 | * @plane: plane to disable |
1331 | * | 1377 | * |