diff options
Diffstat (limited to 'include/drm/drm_drv.h')
| -rw-r--r-- | include/drm/drm_drv.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/include/drm/drm_drv.h b/include/drm/drm_drv.h index 7e545f5f94d3..46a8009784df 100644 --- a/include/drm/drm_drv.h +++ b/include/drm/drm_drv.h | |||
| @@ -649,6 +649,35 @@ static inline bool drm_dev_is_unplugged(struct drm_device *dev) | |||
| 649 | return true; | 649 | return true; |
| 650 | } | 650 | } |
| 651 | 651 | ||
| 652 | /** | ||
| 653 | * drm_core_check_feature - check driver feature flags | ||
| 654 | * @dev: DRM device to check | ||
| 655 | * @feature: feature flag | ||
| 656 | * | ||
| 657 | * This checks @dev for driver features, see &drm_driver.driver_features and the | ||
| 658 | * various DRIVER_\* flags. | ||
| 659 | * | ||
| 660 | * Returns true if the @feature is supported, false otherwise. | ||
| 661 | */ | ||
| 662 | static inline bool drm_core_check_feature(struct drm_device *dev, int feature) | ||
| 663 | { | ||
| 664 | return dev->driver->driver_features & feature; | ||
| 665 | } | ||
| 666 | |||
| 667 | /** | ||
| 668 | * drm_drv_uses_atomic_modeset - check if the driver implements | ||
| 669 | * atomic_commit() | ||
| 670 | * @dev: DRM device | ||
| 671 | * | ||
| 672 | * This check is useful if drivers do not have DRIVER_ATOMIC set but | ||
| 673 | * have atomic modesetting internally implemented. | ||
| 674 | */ | ||
| 675 | static inline bool drm_drv_uses_atomic_modeset(struct drm_device *dev) | ||
| 676 | { | ||
| 677 | return drm_core_check_feature(dev, DRIVER_ATOMIC) || | ||
| 678 | dev->mode_config.funcs->atomic_commit != NULL; | ||
| 679 | } | ||
| 680 | |||
| 652 | 681 | ||
| 653 | int drm_dev_set_unique(struct drm_device *dev, const char *name); | 682 | int drm_dev_set_unique(struct drm_device *dev, const char *name); |
| 654 | 683 | ||
