Hello, Various pieces of information about DRM formats (number of planes, color depth, chroma subsampling, ...) are scattered across different helper functions in the DRM core. Callers of those functions often need to access more than a single parameter of the format, leading to inefficiencies due to multiple lookups. This patch series addresses this issue by centralizing all format information in a single data structure (01/14). It reimplements the existing format helper functions based on that structure (02/14) and converts the DRM core code to use the new structure (03/14). The DRM core now WARNs when a driver tries to query information about an unsupported format (04/14). The second part of the patch series removes the drm_fb_get_bpp_depth() legacy function that shouldn't be used directly by drivers. It modifies all its users to use the appropriate API instead (05/14 to 13/14) and finally merges the function into its only caller in the DRM core (14/14). The new API is also useful for drivers as shown by the "[PATCH v2 00/20] OMAP DRM fixes and improvements" patch series previously posted (and which I have rebased and will repost soon). Changes since v3: - Rebased on top of latest drm/master branch - Collected acks - Dropped "drm: Move format-related helpers to drm_fourcc.c" and "drm/msm: Replace drm_fb_get_bpp_depth() with drm_format_plane_cpp()" that have been merged already - Added new "drm/arm: mali-dp: Replace drm_fb_get_bpp_depth() with drm_format_plane_cpp()" patch - Coding style fixes and variable renames Changes since v2: - Remove bpp field from drm_format_info structure - Replace all users of drm_fb_get_bpp_depth() with the appropriate API - Merge drm_fb_get_bpp_depth() into its only caller Changes since v1: - Move format-related helpers to drm_fourcc.c - Use named initializers for the formats array - WARN when calling drm_format_info() for an unsupported format - Don't drop the drm_format_plane_width() and drm_format_plane_height() helpers Laurent Pinchart (14): drm: Centralize format information drm: Implement the drm_format_*() helpers as drm_format_info() wrappers drm: Use drm_format_info() in DRM core code drm: WARN when calling drm_format_info() for an unsupported format drm: sti: Replace drm_fb_get_bpp_depth() with drm_format_plane_cpp() drm: hdlcd: Replace drm_fb_get_bpp_depth() with drm_format_plane_cpp() drm: tilcdc: Replace drm_fb_get_bpp_depth() with drm_format_plane_cpp() drm: cirrus: Replace drm_fb_get_bpp_depth() with drm_format_plane_cpp() drm: gma500: Replace drm_fb_get_bpp_depth() with drm_format_info() drm: amdgpu: Replace drm_fb_get_bpp_depth() with drm_format_plane_cpp() drm: radeon: Replace drm_fb_get_bpp_depth() with drm_format_plane_cpp() drm: vmwgfx: Replace drm_fb_get_bpp_depth() with drm_format_info() drm/arm: mali-dp: Replace drm_fb_get_bpp_depth() with drm_format_plane_cpp() drm: Don't export the drm_fb_get_bpp_depth() function Documentation/gpu/drm-kms.rst | 3 + drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c | 14 +- drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 3 +- drivers/gpu/drm/arm/hdlcd_crtc.c | 5 +- drivers/gpu/drm/arm/malidp_hw.c | 7 +- drivers/gpu/drm/cirrus/cirrus_fbdev.c | 6 +- drivers/gpu/drm/cirrus/cirrus_main.c | 4 +- drivers/gpu/drm/drm_fb_cma_helper.c | 23 +-- drivers/gpu/drm/drm_fourcc.c | 281 ++++++++++++++------------------ drivers/gpu/drm/drm_framebuffer.c | 102 ++---------- drivers/gpu/drm/drm_modeset_helper.c | 17 +- drivers/gpu/drm/gma500/framebuffer.c | 20 +-- drivers/gpu/drm/radeon/radeon_fb.c | 20 +-- drivers/gpu/drm/radeon/radeon_gem.c | 3 +- drivers/gpu/drm/sti/sti_gdp.c | 6 +- drivers/gpu/drm/tilcdc/tilcdc_crtc.c | 15 +- drivers/gpu/drm/tilcdc/tilcdc_plane.c | 7 +- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 12 +- include/drm/drm_fourcc.h | 21 ++- 19 files changed, 242 insertions(+), 327 deletions(-) -- Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list dri-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/dri-devel