[PATCH 01/15] drm: move drv test macros out of drmP.h
Sean Paul
seanpaul at chromium.org
Thu Jul 12 13:52:21 UTC 2018
On Mon, Jul 09, 2018 at 10:40:02AM +0200, Daniel Vetter wrote:
> Last bit the prevented us from starting to delete the drmP.h monster
> includes from source files!
>
> Also add kernel-doc while moving them.
>
> A nice consistent drm_dev_ prefix would be cute for these, but since
> they're used everywhere I've figured I'll leave this bikeshed aside
> for now.
>
> Signed-off-by: Daniel Vetter <daniel.vetter at intel.com>
Reviewed-by: Sean Paul <seanpaul at chromium.org>
> ---
> include/drm/drmP.h | 19 -------------------
> include/drm/drm_drv.h | 29 +++++++++++++++++++++++++++++
> 2 files changed, 29 insertions(+), 19 deletions(-)
>
> diff --git a/include/drm/drmP.h b/include/drm/drmP.h
> index c5dfbdb7271d..f7a19c2a7a80 100644
> --- a/include/drm/drmP.h
> +++ b/include/drm/drmP.h
> @@ -102,25 +102,6 @@ struct pci_controller;
> #define DRM_SWITCH_POWER_CHANGING 2
> #define DRM_SWITCH_POWER_DYNAMIC_OFF 3
>
> -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;
> -}
> -
> /* returns true if currently okay to sleep */
> static inline bool drm_can_sleep(void)
> {
> 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)
> 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);
>
> --
> 2.18.0
>
> _______________________________________________
> dri-devel mailing list
> dri-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
--
Sean Paul, Software Engineer, Google / Chromium OS
More information about the dri-devel
mailing list