[Galaxy Note GT-N7000 Android Development] ruleh:
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.

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.

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...