[PATCH 0/6] Intel Color Manager Framework

Shashank Sharma
2014-02-20T12:34:38Z

Color manager is a new framework in i915 driver, which provides
a unified interface for various color correction methods supported
by intel hardwares. The high level overview of this change is:

1. Intel hardwares support various color correction methods like
a. csc(wide gamut) correction
b. gamma correction
c. hue/saturation correction
d. contrast/brightness correction

2. Color manager provides a sysfs based interface and a common
protocol (named as color EDID) for all the color correction
properties. There is a command and data parser in the framework
to extract command and data.

3. The interested dispalys can call for a color-manager register
from their corresponding init functions, like we have added for
DSI and EDP interfaces. The corresponding entry will be
/sys/class/drm/<card-name-connector-name>/color-manager

4. Color EDID: is a simple protocol for the communication from user about
what to do, how to do, and where to do. The first value passed from
userspace, will be color manager command value, which will be
interpreted as: (sample command value: 0x 01 01 00 FF)
<property[1Byte]> <enable/disable[1Byte]> <identifier[1Byte]>
<no of data blocks[1Byte]>
a. property: This byte represents color manager property, listed
=========== as CSC correction, gamma correction, hue and
saturation correction and brightness and contrast correction.
For example 01 in above sample tells color manager to change
Gamma correction.

b. enable: This byte represents if we want to enable or disable
========= the mentioned property.
For example 01 in above sample tells color-manager to enable the property.

c. identifier: This byte tells the targeted pipe/plane for the property
============= change. There are few correction values which
can be selectively applied on a particular plane.
For example 00 in above sample tells change in PIPE A.

d. size: This byte tells how many data blocks will be followed by
======== this command block.
For example FF in above sample tells there are 255 correction values coming up.

5. For example (read/write):
To enable csc on pipeA with 6 correction values:
echo 0x00010006,0x111111,0x222222,0x333333,0x444444,0x555555,0x66666
> /sys/class/drm/<connector>/color-manager

To disable gamma on pipeA:
echo 0x01000000 > /sys/class/drm/<connector>/color-manager

To check the current status of color-manager:
cat /sys/class/drm/<connector>/color-manager

6. The current implementation:
The current implementation is just limited to valleyview, that too on primary
displays. But the design is modular and hence can be extended for all other
devices. Once we agree upon the basic framework, I am going to extend it for
all possible platforms. You can see current check for is_valleyview.

7. About the patches:
First patch adds the basic framework, parsers and header.
Second to fifth patch add support for one property each
CSC, Gamma, Contrast and Brightness, Hue and Sat.
Sixth patch adds save and restore functions to maintain color corrections
across suspend resume cycles.

Shashank Sharma (6):
drm/i915: Add Color manager framework
drm/i915: Color Manager: Add CSC color correction
drm/i915: Color manager: Add Gamma correction
drm/i915: Color manager: brightness/contrast
drm/i915: Color manager: hue/saturation correction
drm/i915: Save color manager status

drivers/gpu/drm/i915/Makefile | 1 +
drivers/gpu/drm/i915/i915_drv.h | 29 +
drivers/gpu/drm/i915/intel_clrmgr.c | 1455 ++++++++++++++++++++++++++++++++++
drivers/gpu/drm/i915/intel_clrmgr.h | 238 ++++++
drivers/gpu/drm/i915/intel_display.c | 5 +-
drivers/gpu/drm/i915/intel_dp.c | 4 +
drivers/gpu/drm/i915/intel_dsi.c | 4 +
7 files changed, 1734 insertions(+), 2 deletions(-)
create mode 100644 drivers/gpu/drm/i915/intel_clrmgr.c
create mode 100644 drivers/gpu/drm/i915/intel_clrmgr.h

--
1.7.10.4