From 6a0f9ebfc5e753bb948c13353615324462d73795 Mon Sep 17 00:00:00 2001 From: Ville Syrjälä Date: Tue, 21 Mar 2017 20:12:16 +0200 Subject: drm: Add mode_config .get_format_info() hook MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Allow drivers to return a custom drm_format_info structure for special fb layouts. We'll use this for the compression control surface in i915. v2: Fix drm_get_format_info() kernel doc (Laurent) Don't pass 'dev' to the new hook (Laurent) v3: s/compresssion/compression/ (Ben) Cc: Laurent Pinchart Cc: Ben Widawsky Cc: Jason Ekstrand Signed-off-by: Ville Syrjälä Reviewed-by: Ben Widawsky Link: http://patchwork.freedesktop.org/patch/msgid/20170321181218.10042-4-ville.syrjala@linux.intel.com --- include/drm/drm_fourcc.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include/drm/drm_fourcc.h') diff --git a/include/drm/drm_fourcc.h b/include/drm/drm_fourcc.h index fcc08da850c8..6942e84b6edd 100644 --- a/include/drm/drm_fourcc.h +++ b/include/drm/drm_fourcc.h @@ -25,6 +25,9 @@ #include #include +struct drm_device; +struct drm_mode_fb_cmd2; + /** * struct drm_format_info - information about a DRM format * @format: 4CC format identifier (DRM_FORMAT_*) @@ -55,6 +58,9 @@ struct drm_format_name_buf { const struct drm_format_info *__drm_format_info(u32 format); const struct drm_format_info *drm_format_info(u32 format); +const struct drm_format_info * +drm_get_format_info(struct drm_device *dev, + const struct drm_mode_fb_cmd2 *mode_cmd); uint32_t drm_mode_legacy_fb_format(uint32_t bpp, uint32_t depth); int drm_format_num_planes(uint32_t format); int drm_format_plane_cpp(uint32_t format, int plane); -- cgit v1.2.3