[KERNEL] black crush fix

ruleh

Senior Member
Jan 12, 2015
344
212
0
ONLY TESTED ON NIGHTOWL ROM
[This kernel is actually bauner's kernel source from 11.07.2015 with the patch on top]

Also if you want to flash this, make a backup in a twrp compatible format since this kernel uses twrp.
If you don't then.....oh well I don't really care.

And most importantly:
I AM NOT RESPONSIBLE FOR ANYTHING THAT HAPPENS. IT IS YOUR CHOICE TO USE THIS KERNEL OR NOT.

With that out of the way, here it is: A WORKING BLACK CRUSH/CLIPPING FIX

This kernel shows that the black clipping issue is NOT hardware related and can be fixed through software.
Actually it was already fixed in 2012 or even earlier.
There was a driver in the source but no one bothered to use it.
So I went ahead and put it into a kernel and fixed a few things here and there to get it working properly.

Actually the fix is just a simple value change in a single header file.
The currently attached kernel still uses the "other driver" method but the outcome is roughly the same anyways.

bugs:
--brightness settings
--colour calibration
--a lot more....

The brightness settings take too long (for me) to implement so I just left it there without it.
Also this can be worked around by using apps like Screen Filter which add a dark overlay on top of the screen.

The colour calibration is completely off. This one is actually is easy to fix but I don't know how it should look like so it is how it is for now.
As for now. You will see an orange hue in recovery and during boot. If you turn off the screen (once) everything becomes blueish.
The orange hue was an attempt to fix the blue. It seems like it is still too blue.

There is also a bad gamma calibration (or the lack of one at all). The image below shows what I mean.

We are at the first stage because I really don't know how the mdnie gamma (second stage) settings work. (However it still looks nice.)

Anyways this kernel does what it is supposed to do: show that black crush is not hardware related.
One would wonder as to why no one else tried to do this (especially since the fix was there since who knows when).
Hopefully someone will actually spend time on this and get it working properly.
For now it is what it is and no more.

Maybe I should also say that this kernel is not suitable for daily use but I assume most people figured this out.

The cause of black clipping

From what I found out, the following is responsible for the black clipping.
Code:
static int s6e8ax0_gamma_ctl(struct lcd_info *lcd)
{
	s6e8ax0_write(lcd, lcd->gamma_table[lcd->bl], GAMMA_PARAM_SIZE);

	/* Gamma Set Update */
	s6e8ax0_write(lcd, SEQ_GAMMA_UPDATE, ARRAY_SIZE(SEQ_GAMMA_UPDATE));

	return 0;
}
[file: s3cfb_s6e8aa0.c]
Getting rid of either s6e8ax0_write line also gets rid of brightness settings and adds the blue hue but fixes black clipping.

Also this one seems important.
Code:
static const unsigned char SEQ_GAMMA_UPDATE[] = {
	0xF7, 0x03,
	0x00
};
[file: s6e8aa0_param.h]
There doesn't seem to much to change with these 3 values (especially since 0xF7 shouldn't change).
Changing 0x03 to 0x00 has the same effect as deleting one of the s6e8ax0_write lines.

So basically it is just a few lines that completely mess up the display.


A "good" fix?
This is just my opinion etc etc....
A possible fix would be to set 0x03 to 0x00 and reimplement brightness settings in the rom instead of the driver.
This is based on the assumption that it is easier to do a black overlay in the rom while it would still have the same effect.
Then all that is left is a decent calibration and we would have a perfect display.


Source
Commit
These 2 are irrelevant, kind of...
 

Attachments

Last edited:

avincric

Senior Member
May 25, 2014
119
54
0
Boot up screen tone is quite warm, and after boot its very cool(everything's bluish). But the important thing is it works properly, couldn't see any black clippings.
Nice job.
 
  • Like
Reactions: ruleh

ruleh

Senior Member
Jan 12, 2015
344
212
0
Boot up screen tone is quite warm, and after boot its very cool(everything's bluish). But the important thing is it works properly, couldn't see any black clippings.
Nice job.
Thanks for the feedback.

Regarding the blue hue:
It should "cooldown" after the first time you lock the screen (bug but hard t fix).
In recovery it stays warm all the time.
You can change the colour temperature under the display settings in the rom if the colours are too cold.

I forgot to add this in the OP.
 

Settler11

Senior Member
Jan 24, 2011
136
15
38
ONLY TESTED ON NIGHTOWL ROM
[This kernel is actually bauner's kernel source from 11.07.2015 with the patch on top]

Also if you want to flash this, make a backup in a twrp compatible format since this kernel uses twrp.
If you don't then.....oh well I don't really care.

And most importantly:
I AM NOT RESPONSIBLE FOR ANYTHING THAT HAPPENS. IT IS YOUR CHOICE TO USE THIS KERNEL OR NOT.

....
I've tried this kernel but it only hides the effect and makes the colors even warmer. :(
 

ruleh

Senior Member
Jan 12, 2015
344
212
0
I've tried this kernel but it only hides the effect and makes the colors even warmer. :(
Lock and unlock your screen to get rid of warm colours.
However this kernel is badly calibrated anyways so you won't see any decent improvement in your daily use (it actually makes it harder to seperate black tones).
 

Settler11

Senior Member
Jan 24, 2011
136
15
38
Lock and unlock your screen to get rid of warm colours.
However this kernel is badly calibrated anyways so you won't see any decent improvement in your daily use (it actually makes it harder to seperate black tones).
Doesn't work. Besides, I've restarted it. Also, I wasn't able to change the brightness after this update as well. So not so good, sorry.