summaryrefslogtreecommitdiffstats
path: root/include/drm
diff options
context:
space:
mode:
authorThomas Zimmermann <tzimmermann@suse.de>2024-10-14 10:55:25 +0200
committerThomas Zimmermann <tzimmermann@suse.de>2024-10-18 09:23:03 +0200
commit1f828b4dd40264028d9b481c0412e63837d968f6 (patch)
tree68fbf9443e46d033455ef91047094fe6c1070bd8 /include/drm
parentdrm/radeon: Suspend and resume clients with client helpers (diff)
downloadlinux-1f828b4dd40264028d9b481c0412e63837d968f6.tar.xz
linux-1f828b4dd40264028d9b481c0412e63837d968f6.zip
drm/client: Make client support optional
Only build client code if DRM_CLIENT has been selected. Automatially do so if one of the default clients has been enabled. If client support has been disabled, the helpers for client-related events are empty and the regular client functions are not present. Amdgpu has an internal DRM client, so it has to select DRM_CLIENT by itself unconditionally. v3: - provide empty drm_client_debugfs_init() if DRM_CLIENT=n (kernel test robot) Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Cc: Alex Deucher <alexander.deucher@amd.com> Cc: "Christian König" <christian.koenig@amd.com> Cc: Xinhui Pan <Xinhui.Pan@amd.com> Reviewed-by: Jonathan Cavitt <jonathan.cavitt@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20241014085740.582287-12-tzimmermann@suse.de
Diffstat (limited to 'include/drm')
-rw-r--r--include/drm/drm_client.h2
-rw-r--r--include/drm/drm_client_event.h13
2 files changed, 13 insertions, 2 deletions
diff --git a/include/drm/drm_client.h b/include/drm/drm_client.h
index c03c4b0f3e94..3b13cf29ed55 100644
--- a/include/drm/drm_client.h
+++ b/include/drm/drm_client.h
@@ -236,6 +236,4 @@ int drm_client_modeset_dpms(struct drm_client_dev *client, int mode);
drm_for_each_connector_iter(connector, iter) \
if (connector->connector_type != DRM_MODE_CONNECTOR_WRITEBACK)
-void drm_client_debugfs_init(struct drm_device *dev);
-
#endif
diff --git a/include/drm/drm_client_event.h b/include/drm/drm_client_event.h
index 72c97d111169..99863554b055 100644
--- a/include/drm/drm_client_event.h
+++ b/include/drm/drm_client_event.h
@@ -5,10 +5,23 @@
struct drm_device;
+#if defined(CONFIG_DRM_CLIENT)
void drm_client_dev_unregister(struct drm_device *dev);
void drm_client_dev_hotplug(struct drm_device *dev);
void drm_client_dev_restore(struct drm_device *dev);
void drm_client_dev_suspend(struct drm_device *dev, bool holds_console_lock);
void drm_client_dev_resume(struct drm_device *dev, bool holds_console_lock);
+#else
+static inline void drm_client_dev_unregister(struct drm_device *dev)
+{ }
+static inline void drm_client_dev_hotplug(struct drm_device *dev)
+{ }
+static inline void drm_client_dev_restore(struct drm_device *dev)
+{ }
+static inline void drm_client_dev_suspend(struct drm_device *dev, bool holds_console_lock)
+{ }
+static inline void drm_client_dev_resume(struct drm_device *dev, bool holds_console_lock)
+{ }
+#endif
#endif