FORUMS
Remove All Ads from XDA

[DEV][PATCH] KCAL - Advanced color control for Qualcomm MDSS 8x10/8x26/8974/8084/8939

1,784 posts
Thanks Meter: 5,764
 
By savoca, Inactive Recognized Developer on 16th February 2015, 08:07 AM
Post Reply Email Thread
Hello! If you're keen on custom kernels, especially for Nexus devices, you've probably heard the term Color/Gamma Control thrown around a bit. A once *very* device dependent feature now made available for the following chipsets:
Quote:

8x10
8974 v1.0
8x26 v1.0
8x26 v2.0, 8926 v1.0
8926 v2.0
8974 v2.0
8974 v3.0 (Pro)
8084 v1.0
8084 v1.1
8994 v1.0
8916 v1.0
8939 v1.0
8092 v1.0

Color calibration allows you to use an app (or root shell) to manipulate the following post-processing features of the Qualcomm MDSS:
Quote:

RGB Multipliers (Polynomial Color Correction)
Display Color Inversion (Inverse Gamma Correction)
Hue/Saturation/Value/Contrast Manipulation (Picture Adjustment)

Too confusing? Here's a video demonstration by @Andromjb:
[youtube]dESlxM9izxk[/youtube] [youtube]LYCJ-3OCjZQ[/youtube]

Sysfs paths/variables:
Quote:

/sys/devices/platform/kcal_ctrl.0/kcal - (0-256 0-256 0-256) - Controls R/G/B Multipliers
/sys/devices/platform/kcal_ctrl.0/kcal_min - (0-256) - Controls minimum RGB Multiplier value
/sys/devices/platform/kcal_ctrl.0/kcal_enable - (0-1) - Enables/Disables RGB Multiplier Control
/sys/devices/platform/kcal_ctrl.0/kcal_invert - (0-1) - Enables/Disables Display Inversion Mode
/sys/devices/platform/kcal_ctrl.0/kcal_sat - (224-383 or 128) - Controls saturation intensity - use 128 for grayscale mode
/sys/devices/platform/kcal_ctrl.0/kcal_hue - (0-1536) - Controls display hue - may have issues with msm8x26 in the higher values
/sys/devices/platform/kcal_ctrl.0/kcal_val - (128-383) - Controls display value
/sys/devices/platform/kcal_ctrl.0/kcal_cont - (128-383) - Controls display contrast

Link your favorite kernel developer back to this thread and ask them to add support!

KCAL for MDP5
https://github.com/savoca/kcal/commits/mdp5

KCAL for MDP3 (Only supports RGB multipliers):
https://github.com/savoca/kcal/commits/mdp3

And finally, an app to control your display - available for free here:
http://downloads.codefi.re/savoca/kcal

Thank you to LG for the display inversion control and code reference, also thank you to @faux123 for insight/reference with MDP3 RGB multipliers and @eng.stk for testing on APQ8084
The Following 271 Users Say Thank You to savoca For This Useful Post: [ View ] Gift savoca Ad-Free
 
 
16th February 2015, 12:38 PM |#3  
neobuddy89's Avatar
Recognized Contributor
Flag APQ8084
Thanks Meter: 21,702
 
Donate to Me
More
Great work @savoca
How to check MDSS_MDP_HW_REV? Any idea which is for Hammerhead and Shamu?
The Following 5 Users Say Thank You to neobuddy89 For This Useful Post: [ View ] Gift neobuddy89 Ad-Free
16th February 2015, 12:59 PM |#4  
Member
Flag Netherlands
Thanks Meter: 18
 
More
great
16th February 2015, 02:57 PM |#6  
franciscofranco's Avatar
Recognized Developer
Flag Carcavelos
Thanks Meter: 136,085
 
Donate to Me
More
Looks great to me. I'll give it a whirl on Shamu. Thanks!
The Following 26 Users Say Thank You to franciscofranco For This Useful Post: [ View ]
16th February 2015, 04:00 PM |#7  
Sweet. I'll try it on HTC m8 and Nexus 6 this week.
The Following 19 Users Say Thank You to flar2 For This Useful Post: [ View ]
16th February 2015, 04:22 PM |#8  
djvita's Avatar
Senior Member
Flag Guadalajara
Thanks Meter: 80
 
More
msm8960?
any support for first gen krait?
The Following User Says Thank You to djvita For This Useful Post: [ View ] Gift djvita Ad-Free
16th February 2015, 04:38 PM |#9  
franciscofranco's Avatar
Recognized Developer
Flag Carcavelos
Thanks Meter: 136,085
 
Donate to Me
More
On Shamu I can't get anything to work besides the usual RGB and inverted.
The Following 4 Users Say Thank You to franciscofranco For This Useful Post: [ View ]
16th February 2015, 05:38 PM |#11  
savoca's Avatar
OP Inactive Recognized Developer
Flag Pasadena
Thanks Meter: 5,764
 
Donate to Me
More
Quote:
Originally Posted by franciscofranco

On Shamu I can't get anything to work besides the usual RGB and inverted.

Quote:
Originally Posted by flar2

Sweet. I'll try it on HTC m8 and Nexus 6 this week.

Sat/Hue/Val/Cont use the picture adjustment feature, and on APQ8084 and beyond it's been moved to a 2nd version of Qcom's picture adjustment. I don't have any of those devices so I didn't attempt to add support - but here's a blind patch you can try to add support or use for reference:
https://github.com/savoca/kernel-msm...e52b448b39fc98
(This patch is assuming the scaling for PA v2 is the same as v1, it's very possible that has changed - but again, no device in hand, not much I can find out)

Quote:
Originally Posted by neobuddy89

Great work @savoca
How to check MDSS_MDP_HW_REV? Any idea which is for Hammerhead and Shamu?

First code block in the OP has a reference list.
The Following 2 Users Say Thank You to savoca For This Useful Post: [ View ] Gift savoca Ad-Free
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes