Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+12 -2
-2
drivers/gpu/drm/drm_crtc_internal.h
··· 272 272 /* drm_plane.c */ 273 273 int drm_plane_register_all(struct drm_device *dev); 274 274 void drm_plane_unregister_all(struct drm_device *dev); 275 - bool drm_plane_has_format(struct drm_plane *plane, 276 - u32 format, u64 modifier); 277 275 struct drm_mode_rect * 278 276 __drm_plane_get_damage_clips(const struct drm_plane_state *state); 279 277
+10
drivers/gpu/drm/drm_plane.c
··· 877 877 return 0; 878 878 } 879 879 880 + /** 881 + * drm_plane_has_format - Check whether the plane supports this format and modifier combination 882 + * @plane: drm plane 883 + * @format: pixel format (DRM_FORMAT_*) 884 + * @modifier: data layout modifier 885 + * 886 + * Returns: 887 + * Whether the plane supports the specified format and modifier combination. 888 + */ 880 889 bool drm_plane_has_format(struct drm_plane *plane, 881 890 u32 format, u64 modifier) 882 891 { ··· 915 906 916 907 return true; 917 908 } 909 + EXPORT_SYMBOL(drm_plane_has_format); 918 910 919 911 static int __setplane_check(struct drm_plane *plane, 920 912 struct drm_crtc *crtc,
+2
include/drm/drm_plane.h
··· 972 972 #define drm_for_each_plane(plane, dev) \ 973 973 list_for_each_entry(plane, &(dev)->mode_config.plane_list, head) 974 974 975 + bool drm_plane_has_format(struct drm_plane *plane, 976 + u32 format, u64 modifier); 975 977 bool drm_any_plane_has_format(struct drm_device *dev, 976 978 u32 format, u64 modifier); 977 979