|
@@ -649,6 +649,35 @@ static inline bool drm_dev_is_unplugged(struct drm_device *dev)
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+/**
|
|
|
|
+ * drm_core_check_feature - check driver feature flags
|
|
|
|
+ * @dev: DRM device to check
|
|
|
|
+ * @feature: feature flag
|
|
|
|
+ *
|
|
|
|
+ * This checks @dev for driver features, see &drm_driver.driver_features and the
|
|
|
|
+ * various DRIVER_\* flags.
|
|
|
|
+ *
|
|
|
|
+ * Returns true if the @feature is supported, false otherwise.
|
|
|
|
+ */
|
|
|
|
+static inline bool drm_core_check_feature(struct drm_device *dev, int feature)
|
|
|
|
+{
|
|
|
|
+ return dev->driver->driver_features & feature;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * 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 drm_core_check_feature(dev, DRIVER_ATOMIC) ||
|
|
|
|
+ dev->mode_config.funcs->atomic_commit != NULL;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
|
|
int drm_dev_set_unique(struct drm_device *dev, const char *name);
|
|
int drm_dev_set_unique(struct drm_device *dev, const char *name);
|
|
|
|
|