[PATCH v2 0/5] Centralize format information

Laurent Pinchart laurent.pinchart at ideasonboard.com
Tue Jun 7 23:35:33 UTC 2016


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 (2/5). It reimplements the existing format helper
functions based on that structure (3/5) and converts the DRM core code to use
the new structure (4/5).

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 v1:

- Move format-related helpers to drm_fourcc.c (1/5)
- Use named initializers for the formats array (2/5)
- WARN when calling drm_format_info() for an unsupported format (5/5)
- Don't drop the drm_format_plane_width() and drm_format_plane_height()
  helpers

Laurent Pinchart (5):
  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

 Documentation/DocBook/gpu.tmpl      |   5 +
 drivers/gpu/drm/Makefile            |   2 +-
 drivers/gpu/drm/drm_crtc.c          | 389 ++----------------------------------
 drivers/gpu/drm/drm_fb_cma_helper.c |  23 ++-
 drivers/gpu/drm/drm_fourcc.c        | 308 ++++++++++++++++++++++++++++
 include/drm/drmP.h                  |   1 +
 include/drm/drm_crtc.h              |   9 -
 include/drm/drm_fourcc.h            |  59 ++++++
 8 files changed, 399 insertions(+), 397 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