public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH 00/23] Color Management for DRM
@ 2015-09-16 17:36 Shashank Sharma
  2015-09-16 17:36 ` [PATCH 01/23] drm: Create Color Management DRM properties Shashank Sharma
                   ` (23 more replies)
  0 siblings, 24 replies; 65+ messages in thread
From: Shashank Sharma @ 2015-09-16 17:36 UTC (permalink / raw)
  To: matthew.d.roper, jim.bish, robert.bradford, gary.k.smith,
	dri-devel, intel-gfx
  Cc: annie.j.matheson, kausalmalladi, daniel.vetter

This patch set adds Color Manager implementation in DRM layer. Color Manager
is an extension in DRM framework to support color correction/enhancement.

Various Hardware platforms can support several color correction capabilities.
Color Manager provides abstraction of these capabilities and allows a user
space UI agent to correct/enhance the display using the DRM property interface.

How is this going to work?
==========================
1. This patch series adds a few new properties in DRM framework. These properties are:
        a. color_capabilities property (type blob)
        b. Color Transformation Matrix property for corrections like CSC (called CTM, type blob)
        c. Palette correction properties for corrections like gamma fixup (called palette_correction, type blob) 
2. Also, this patch series adds few structures to indicate specifications of a property like size, no_of_samples for correction etc.
3. These properties are present in mode_config.
4. When the platform's display driver loads, it fills up the values of color_capabilities property using the standard structures (added in step 2).
   For example, Intel's I915 driver adds following color correction capabilities:
        a. gamma correction capability as palette correction property, with 257 correction coefficients and a max/min value
        b. csc correction capability as CTM correction property, with 3x3 transformation matrix values and max/min values 
5. Now when userspace comes up, it queries the platform's color capabilities by doing a get_property() on color_capabilities DRM property
6. Reading the blob, the userspace understands the color capabilities of the platform.
   For example, userspace will understand it can support:
        a. palette_correction with 257 coefficients
        b. CSC correction with 3x3 = 9 values 
7. To set color correction values, userspace:
        a. creates a blob using the create_blob_ioctl in standard palette_correction structure format, with the correction values
        b. calls the set_property_ioctl with the blob_id as value for the property 
8. Driver refers to the blob, gets the correction values and applies the correction in HW.
9. To get currently applied color correction values, userspace:
        a. calls a get_property_ioctl on that color property
        b. gets the blob_id for the currently applied correction from DRM infrastructure
        c. gets the blob using get_blob_ioctl and hence the currently applied values

That's all! :)

About the patch series:
=======================
The patch series first adds the color management support in DRM layer.
Then it adds the color management framework in I915 layer. 
After that, it implements platform specific core color correction functios. 

Intel color manager registers color correction with DRM color manager in this way:
 - CSC transformation is registered as CTM DRM property
 - Gamma correction is registered as palette_after_ctm DRM property
 - Degamma correction is registered as palette_before_ctm DRM property

Our thanks to all the reviewers who have given valuable comments in terms
of design and implementation to our previous sets of patches. Special mention
of thanks should go to Matt Roper for all his inputs/suggestions in implementation
of this module, using DRM atomic CRTC commit path.

V2: Worked on review comments from Matt, Jim, Thierry, Rob.
V3: Worked on review comments from Matt, Jim, Rob:
 - Jim, Rob:
   ========
   Re-arranged the whole patch series in the sequence of features, currently:
   First 5 patches add color management support in DRM layer
   Next 7 patches add Intel color management framework in I915 driver
   Next 5 patches add color correction for CHV (gamma, degamma and CSC)
   Next 2 patches enable color management, by attaching the properties to CRTC(Matt)
   Next 4 patches add color correction for BDW (gamma, degamma)
 - Matt:
   =====
   Patch 3: Added refernce/unreference for blob
   Patch 7: return -EINVAL and added debug message
   Patch 8: check for valid blob, from create blob
            moved call to intel_crtc_attach_color_prop in the end of full implementation (CHV)
   Patch 9: DRM_ERROR->DRM_DEBUG for NULL blob case
   Patch 13: Added static for internal functions
   Patch 20-24: renamed gen9_* functions to bdw_*
   Added new variables in device_info structure num_samples_after_ctm and num_samples_before_ctm
   Added new function in patch 8 to load capabilities based on device_info across all platforms

Shashank Sharma (23):
  drm: Create Color Management DRM properties
  drm: Add structure for querying palette color capabilities
  drm: Add color correction blobs in CRTC state
  drm: Add drm structures for palette color property
  drm: Add structure to set/get a CTM color property
  drm/i915: Add atomic set property interface for CRTC
  drm/i915: Add atomic get property interface for CRTC
  drm/i915: Create color management files
  drm/i915: Register pipe color capabilities
  drm/i915: Add gamma correction handlers
  drm/i915: Add pipe deGamma correction handlers
  drm/i915: Add pipe CSC correction handlers
  drm/i915: CHV: Load gamma color correction values
  drm/i915: CHV: Pipe level Gamma correction
  drm/i915: CHV: Load degamma color correction values
  drm/i915: CHV: Pipe level degamma correction
  drm/i915: CHV: Pipe level CSC correction
  drm/i915: Commit color changes to CRTC
  drm/i915: Attach color properties to CRTC
  drm/i915: BDW: Load gamma correction values
  drm/i915: BDW: Pipe level Gamma correction
  drm/i915: BDW: Load degamma correction values
  drm/i915: BDW: Pipe level degamma correction

 drivers/gpu/drm/drm_atomic_helper.c        |  12 +
 drivers/gpu/drm/drm_crtc.c                 |  26 +
 drivers/gpu/drm/i915/Makefile              |   3 +-
 drivers/gpu/drm/i915/i915_drv.c            |  17 +
 drivers/gpu/drm/i915/i915_drv.h            |   2 +
 drivers/gpu/drm/i915/i915_reg.h            |  41 +-
 drivers/gpu/drm/i915/intel_atomic.c        |  56 ++
 drivers/gpu/drm/i915/intel_color_manager.c | 852 +++++++++++++++++++++++++++++
 drivers/gpu/drm/i915/intel_color_manager.h |  99 ++++
 drivers/gpu/drm/i915/intel_display.c       |   6 +
 drivers/gpu/drm/i915/intel_drv.h           |  22 +
 include/drm/drm_crtc.h                     |  11 +
 include/uapi/drm/drm.h                     |  50 ++
 13 files changed, 1195 insertions(+), 2 deletions(-)
 create mode 100644 drivers/gpu/drm/i915/intel_color_manager.c
 create mode 100644 drivers/gpu/drm/i915/intel_color_manager.h

-- 
1.9.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 65+ messages in thread

end of thread, other threads:[~2015-09-30 17:15 UTC | newest]

Thread overview: 65+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-16 17:36 [PATCH 00/23] Color Management for DRM Shashank Sharma
2015-09-16 17:36 ` [PATCH 01/23] drm: Create Color Management DRM properties Shashank Sharma
2015-09-16 17:51   ` Matt Roper
2015-09-23  8:51     ` Sharma, Shashank
2015-09-16 17:36 ` [PATCH 02/23] drm: Add structure for querying palette color capabilities Shashank Sharma
2015-09-16 17:51   ` Matt Roper
2015-09-22 13:02     ` Daniel Vetter
2015-09-23  8:10       ` Sharma, Shashank
2015-09-23  9:47         ` Smith, Gary K
2015-09-23 11:57           ` Sharma, Shashank
2015-09-23 13:26             ` Daniel Vetter
2015-09-16 17:37 ` [PATCH 03/23] drm: Add color correction blobs in CRTC state Shashank Sharma
2015-09-16 17:37 ` [PATCH 04/23] drm: Add drm structures for palette color property Shashank Sharma
2015-09-21 16:46   ` Ville Syrjälä
2015-09-22  7:57     ` Sharma, Shashank
2015-09-22 13:08   ` Daniel Vetter
2015-09-22 13:53     ` Emil Velikov
2015-09-22 15:00       ` Ville Syrjälä
2015-09-22 16:51         ` Emil Velikov
2015-09-23  8:15     ` Sharma, Shashank
2015-09-23 12:49       ` Daniel Vetter
2015-09-23 12:59         ` Sharma, Shashank
2015-09-23 13:30           ` Daniel Vetter
2015-09-16 17:37 ` [PATCH 05/23] drm: Add structure to set/get a CTM " Shashank Sharma
2015-09-22 13:08   ` Daniel Vetter
2015-09-23  8:16     ` Sharma, Shashank
2015-09-22 15:22   ` Ville Syrjälä
2015-09-16 17:37 ` [PATCH 06/23] drm/i915: Add atomic set property interface for CRTC Shashank Sharma
2015-09-16 17:37 ` [PATCH 07/23] drm/i915: Add atomic get " Shashank Sharma
2015-09-16 17:37 ` [PATCH 08/23] drm/i915: Create color management files Shashank Sharma
2015-09-16 17:37 ` [PATCH 09/23] drm/i915: Register pipe color capabilities Shashank Sharma
2015-09-22 13:24   ` Daniel Vetter
2015-09-23  8:35     ` Sharma, Shashank
2015-09-23 12:52       ` [Intel-gfx] " Daniel Vetter
2015-09-16 17:37 ` [PATCH 10/23] drm/i915: Add gamma correction handlers Shashank Sharma
2015-09-22 13:15   ` [Intel-gfx] " Daniel Vetter
2015-09-22 13:19     ` Daniel Vetter
2015-09-23  8:22     ` [Intel-gfx] " Sharma, Shashank
2015-09-23 13:02       ` Daniel Vetter
2015-09-26 15:48       ` Sharma, Shashank
2015-09-28  6:43         ` [Intel-gfx] " Daniel Vetter
2015-09-28  8:19           ` Sharma, Shashank
2015-09-28 21:42             ` Matt Roper
2015-09-29  4:29               ` Sharma, Shashank
2015-09-29  4:29                 ` Matheson, Annie J
2015-09-16 17:37 ` [PATCH 11/23] drm/i915: Add pipe deGamma " Shashank Sharma
2015-09-16 17:37 ` [PATCH 12/23] drm/i915: Add pipe CSC " Shashank Sharma
2015-09-16 17:37 ` [PATCH 13/23] drm/i915: CHV: Load gamma color correction values Shashank Sharma
2015-09-16 17:37 ` [PATCH 14/23] drm/i915: CHV: Load degamma " Shashank Sharma
2015-09-16 17:37 ` [PATCH 15/23] drm/i915: CHV: Pipe level Gamma correction Shashank Sharma
2015-09-16 17:37 ` [PATCH 16/23] drm/i915: CHV: Pipe level degamma correction Shashank Sharma
2015-09-16 17:37 ` [PATCH 17/23] drm/i915: CHV: Pipe level CSC correction Shashank Sharma
2015-09-16 17:37 ` [PATCH 18/23] drm/i915: Commit color changes to CRTC Shashank Sharma
2015-09-16 17:37 ` [PATCH 19/23] drm/i915: Attach color properties " Shashank Sharma
2015-09-16 17:37 ` [PATCH 20/23] drm/i915: BDW: Load gamma correction values Shashank Sharma
2015-09-16 17:37 ` [PATCH 21/23] drm/i915: BDW: Pipe level Gamma correction Shashank Sharma
2015-09-30 14:31   ` Rob Bradford
2015-09-30 16:25     ` Sharma, Shashank
2015-09-30 16:31       ` Matheson, Annie J
2015-09-30 17:15         ` Sharma, Shashank
2015-09-30 16:44     ` Ville Syrjälä
2015-09-16 17:37 ` [PATCH 22/23] drm/i915: BDW: Load degamma correction values Shashank Sharma
2015-09-16 17:37 ` [PATCH 23/23] drm/i915: BDW: Pipe level degamma correction Shashank Sharma
2015-09-22 13:27 ` [Intel-gfx] [PATCH 00/23] Color Management for DRM Daniel Vetter
2015-09-23  8:38   ` Sharma, Shashank

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox