drm: Export drm_plane_has_format()

Export drm_plane_has_format() so that drivers can use it.

v2: add kerneldoc

Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240619113144.1616-1-ville.syrjala@linux.intel.com
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Daniel Stone <daniels@collabora.com>
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
This commit is contained in:
Ville Syrjälä 2024-06-19 14:31:44 +03:00
parent 1d36db2b51
commit 1c5f18d88e
3 changed files with 12 additions and 2 deletions

View File

@ -272,8 +272,6 @@ int drm_mode_atomic_ioctl(struct drm_device *dev,
/* drm_plane.c */ /* drm_plane.c */
int drm_plane_register_all(struct drm_device *dev); int drm_plane_register_all(struct drm_device *dev);
void drm_plane_unregister_all(struct drm_device *dev); void drm_plane_unregister_all(struct drm_device *dev);
bool drm_plane_has_format(struct drm_plane *plane,
u32 format, u64 modifier);
struct drm_mode_rect * struct drm_mode_rect *
__drm_plane_get_damage_clips(const struct drm_plane_state *state); __drm_plane_get_damage_clips(const struct drm_plane_state *state);

View File

@ -877,6 +877,15 @@ int drm_mode_getplane(struct drm_device *dev, void *data,
return 0; return 0;
} }
/**
* drm_plane_has_format - Check whether the plane supports this format and modifier combination
* @plane: drm plane
* @format: pixel format (DRM_FORMAT_*)
* @modifier: data layout modifier
*
* Returns:
* Whether the plane supports the specified format and modifier combination.
*/
bool drm_plane_has_format(struct drm_plane *plane, bool drm_plane_has_format(struct drm_plane *plane,
u32 format, u64 modifier) u32 format, u64 modifier)
{ {
@ -906,6 +915,7 @@ bool drm_plane_has_format(struct drm_plane *plane,
return true; return true;
} }
EXPORT_SYMBOL(drm_plane_has_format);
static int __setplane_check(struct drm_plane *plane, static int __setplane_check(struct drm_plane *plane,
struct drm_crtc *crtc, struct drm_crtc *crtc,

View File

@ -972,6 +972,8 @@ static inline struct drm_plane *drm_plane_find(struct drm_device *dev,
#define drm_for_each_plane(plane, dev) \ #define drm_for_each_plane(plane, dev) \
list_for_each_entry(plane, &(dev)->mode_config.plane_list, head) list_for_each_entry(plane, &(dev)->mode_config.plane_list, head)
bool drm_plane_has_format(struct drm_plane *plane,
u32 format, u64 modifier);
bool drm_any_plane_has_format(struct drm_device *dev, bool drm_any_plane_has_format(struct drm_device *dev,
u32 format, u64 modifier); u32 format, u64 modifier);