[PATCH v3 00/15] Centralize format information
Laurent Pinchart
laurent.pinchart at ideasonboard.com
Wed Jun 8 23:32:04 UTC 2016
Hello,
(Repost with the drivers maintainers CC'ed, sorry about the noise)
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 (02/15). It reimplements the existing format helper
functions based on that structure (03/15) and converts the DRM core code to
use the new structure (04/15). The DRM core now WARNs when a driver tries to
query information about an unsupported format (05/15).
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 (06/15 to 14/15) and finally merges the
function into its only caller in the DRM core (15/15).
The new API is also useful for drivers as shown by the "[PATCH v2 00/20] OMAP
DRM fixes and improvements" patch series posted yesterday.
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 (15):
drm: Move format-related helpers to drm_fourcc.c
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: msm: Replace drm_fb_get_bpp_depth() with drm_format_plane_cpp()
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: Don't export the drm_fb_get_bpp_depth() function
Documentation/DocBook/gpu.tmpl | 5 +
drivers/gpu/drm/Makefile | 2 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c | 10 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 3 +-
drivers/gpu/drm/arm/hdlcd_crtc.c | 5 +-
drivers/gpu/drm/cirrus/cirrus_fbdev.c | 6 +-
drivers/gpu/drm/cirrus/cirrus_main.c | 4 +-
drivers/gpu/drm/drm_crtc.c | 389 +------------------------------
drivers/gpu/drm/drm_crtc_helper.c | 14 +-
drivers/gpu/drm/drm_fb_cma_helper.c | 23 +-
drivers/gpu/drm/drm_fourcc.c | 280 ++++++++++++++++++++++
drivers/gpu/drm/gma500/framebuffer.c | 20 +-
drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c | 6 +-
drivers/gpu/drm/radeon/radeon_fb.c | 14 +-
drivers/gpu/drm/radeon/radeon_gem.c | 3 +-
drivers/gpu/drm/sti/sti_gdp.c | 6 +-
drivers/gpu/drm/tilcdc/tilcdc_crtc.c | 23 +-
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 12 +-
include/drm/drmP.h | 1 +
include/drm/drm_crtc.h | 9 -
include/drm/drm_fourcc.h | 56 +++++
21 files changed, 437 insertions(+), 454 deletions(-)
create mode 100644 drivers/gpu/drm/drm_fourcc.c
create mode 100644 include/drm/drm_fourcc.h
--
Regards,
Laurent Pinchart
More information about the dri-devel
mailing list