summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/drm_mode_config.c
diff options
context:
space:
mode:
authorLiviu Dudau <Liviu.Dudau@arm.com>2018-02-28 17:11:23 +0300
committerLiviu Dudau <Liviu.Dudau@arm.com>2018-06-20 17:30:20 +0300
commitd67b6a2065076d763c7df626b8c54f16038ad862 (patch)
treefb7d98ec56e8a726aa2ea0696c55b6702265729e /drivers/gpu/drm/drm_mode_config.c
parentb13cc8dd588434e2aec781e6d12224e4c408ac18 (diff)
downloadlinux-d67b6a2065076d763c7df626b8c54f16038ad862.tar.xz
drm: writeback: Add client capability for exposing writeback connectors
Due to the fact that writeback connectors behave in a special way in DRM (they always report being disconnected) we might confuse some userspace. Add a client capability for writeback connectors that will filter them out for clients that don't understand the capability. Changelog: - only accept the capability if the client has already set the DRM_CLIENT_CAP_ATOMIC one. Cc: Sean Paul <seanpaul@chromium.org> Cc: Brian Starkey <brian.starkey@arm.com> Signed-off-by: Liviu Dudau <liviu.dudau@arm.com> Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Brian Starkey <brian.starkey@arm.com> Link: https://patchwork.freedesktop.org/patch/229038/
Diffstat (limited to 'drivers/gpu/drm/drm_mode_config.c')
-rw-r--r--drivers/gpu/drm/drm_mode_config.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_mode_config.c b/drivers/gpu/drm/drm_mode_config.c
index e5c653357024..21e353bd3948 100644
--- a/drivers/gpu/drm/drm_mode_config.c
+++ b/drivers/gpu/drm/drm_mode_config.c
@@ -145,6 +145,11 @@ int drm_mode_getresources(struct drm_device *dev, void *data,
count = 0;
connector_id = u64_to_user_ptr(card_res->connector_id_ptr);
drm_for_each_connector_iter(connector, &conn_iter) {
+ /* only expose writeback connectors if userspace understands them */
+ if (!file_priv->writeback_connectors &&
+ (connector->connector_type == DRM_MODE_CONNECTOR_WRITEBACK))
+ continue;
+
if (drm_lease_held(file_priv, connector->base.id)) {
if (count < card_res->count_connectors &&
put_user(connector->base.id, connector_id + count)) {