summaryrefslogtreecommitdiff
path: root/include/drm/drmP.h
diff options
context:
space:
mode:
authorDhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>2016-12-22 00:50:42 -0800
committerDaniel Vetter <daniel.vetter@ffwll.ch>2016-12-27 10:44:00 +0100
commita743d7582db9aba0e7078d6386bdad2756309dba (patch)
treef142599c73b31d08257ee07294b4fbcf30df54e9 /include/drm/drmP.h
parentf79f26921ee12c6fc14d0df61b1eb27a5070b959 (diff)
drm: Wrap the check for atomic_commit implementation
This check is useful for drivers that do not have DRIVER_ATOMIC set but have atomic modesetting internally implemented. Wrap the check into a function since this is used in many places and as a bonus, the function name helps to document what the check is for. v2: Change return type to bool (Ville) Move the function drm_atomic.h (Daniel) Fixed comment marker for documentation Suggested-by: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Ben Skeggs <bskeggs@redhat.com> Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> [danvet: Move back to drmP.h because include hell.] Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1482396643-32456-1-git-send-email-dhinakaran.pandiyan@intel.com
Diffstat (limited to 'include/drm/drmP.h')
-rw-r--r--include/drm/drmP.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index a9cfd33c7b1a..8671ddd256fc 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -634,6 +634,19 @@ struct drm_device {
int switch_power_state;
};
+/**
+ * drm_drv_uses_atomic_modeset - check if the driver implements
+ * atomic_commit()
+ * @dev: DRM device
+ *
+ * This check is useful if drivers do not have DRIVER_ATOMIC set but
+ * have atomic modesetting internally implemented.
+ */
+static inline bool drm_drv_uses_atomic_modeset(struct drm_device *dev)
+{
+ return dev->mode_config.funcs->atomic_commit != NULL;
+}
+
#include <drm/drm_irq.h>
#define DRM_SWITCH_POWER_ON 0