Change / disable gamma correction on Jetson-tk1, R21.2

We have our own jetson based board driving display port output. This in turn gets converted to LVDS output to drive a panel directly.

As part of our production board test we connect our board to a test fixture that allows us to look at the data on the LVDS lanes. We want to do a “walking one” / “walking zero” bit pattern to verify the integrity of each of the pixel bits on the LVDS output.

It appears that some gamma correction is being done somewhere, as we read the LVDS input on the test fixture and compare it to an expected value we see:

    Bit 2 on link 0 failed: read 0x000005, expected 0x000004
    Bit 2 on link 1 failed: read 0x000005, expected 0x000004
    Bit 3 on link 0 failed: read 0x00000A, expected 0x000008
    Bit 3 on link 1 failed: read 0x00000A, expected 0x000008
    Bit 4 on link 0 failed: read 0x000014, expected 0x000010
    Bit 4 on link 1 failed: read 0x000014, expected 0x000010
    Bit 5 on link 0 failed: read 0x000028, expected 0x000020
    Bit 5 on link 1 failed: read 0x000028, expected 0x000020
    Bit 6 on link 0 failed: read 0x000051, expected 0x000040
    Bit 6 on link 1 failed: read 0x000051, expected 0x000040
    Bit 7 on link 0 failed: read 0x0000A3, expected 0x000080
    Bit 7 on link 1 failed: read 0x0000A3, expected 0x000080

The output in /var/log/Xorg.0.log leads you to believe that there is no gamma correction being done:

[ 14836.992] (==) NVIDIA(0): Using gamma correction (1.0, 1.0, 1.0)

but the above results beg to differ.

Is there any way to fully disable gamma correction? I am open to customizing the kernel if necessary.

Are you using DC 0 for the LVDS and still having DC 1 for HDMI?

If CMU is enabled, try disabling (as root):

# Check state:
cat /sys/devices/platform/host1x/tegradc.0/cmu_enable
# Disable:
echo 0 > /sys/devices/platform/host1x/tegradc.0/cmu_enable

Thanks for the quick response,

Yes we are using DC 0 for LVDS, we have disabled DC1 for HDMI with customs to the kernel. ( we have no need for the 2nd output )

Cat’ing the above file did show cmu_enable, but setting it to zero had no effect.

But I did stumble on this… It looks like there is a few sys files in the directory
/sys/devices/platform/host1x/tegradc.0/smartdimmer that do indeed control gamma

The following command looks like it does disable gamma…

echo 0 > /sys/devices/platform/host1x/tegradc.0/smartdimmer/enable

This was great, except when I want to re-enable gamma setting the value to a 1 did not re-enable it.

Is there a proper sequence of writing to these files that will turn gamma correction off AND then back on?

Or perhaps a better way to disable the lut is to override the existing “lut” file in the above directory but I am not sure what the sequence of write commands to effectively disable the lut would be, a cat of this file shows a lot of stuff.

This is probably because frame buffer doesn’t get update after re-enable smart dimmer.
Try blank and then unblank.

$ echo 1 > /sys/devices/platform/host1x/tegradc.0/graphics/fb0/blank 
$ echo 0 > /sys/devices/platform/host1x/tegradc.0/graphics/fb0/blank