Howto Fix Xperia T LT30p tmd_mdx80 Screen (washed out colors/wrong gamma curve)
If you encounter a "mediocre" tmd_mdx80 screen with very washed out colors and gamma values which are way too high, like i did and like it is described in this monster-270-post-thread
https://forum.xda-developers.com/showthread.php?t=1909710 , this is not due to a "bad screen" but due to wrong values in nvm, which will even survive a stock- or custom ROM flash until you "break" the values and let the right default values be rewritten with a latest Stockrom-flash from 2014 (stockrom through flashboot-mode because screen will go blanc after breaking nvm and you can`t flash LOS neither through twrp with a blanc screen nor LOS with flashboot).
Bonus: Disable annoying auto Dynamic light/contrast adaption and CABC (Content Adaptive LCD Backlight Control)
The Xperia T with a tmd_mdx80 features not just one, but two dynamic light adaption controls by default. This results in a very annoying screen auto-up-and-down dimming based on the displayed content which is especially annoying while watching videoclips or wiping though photos in a gallery.
To disable the first one is easy. Just open /etc/pre_hw_config.sh (you will need write-permission for /system or use amaze) and change the two values of
Code:
echo 1 > /sys/class/leds/lcd-backlight_1/use_dls
echo 1 > /sys/class/leds/lcd-backlight_2/use_dls
to
Code:
echo 0 > /sys/class/leds/lcd-backlight_1/use_dls
echo 0 > /sys/class/leds/lcd-backlight_2/use_dls
and reboot. After that the dynamic control got less, but isn`t gone completely. Disableing the "second one", CABC, is more complicated, because you have to compile your own custom-kernel and repack it with adriandc`s bootimage editor (thank you for that adriandc!).
To disable it (technically you can`t disable or remove it completely, because twrp still relies on it, so you just make it "flat"), compile the kernel with the following modification in
android_kernel_sony_msm8x60-lineage-15.1/drivers/video/msm/mipi_r63306_panels/mipi_tmd_mdx80.c
change line 37 to 40 from
Code:
static char cabc_user_param[] = {
0xBE, 0xFF, 0x0F, 0x00, 0x0C, 0x10, 0x02,
0x00, 0x5D, 0x00, 0x00, 0x80, 0x32
};
to
Code:
static char cabc_user_param[] = {
0xBE, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
repack the boot.img, put it on /sdcard or your external sdcard and just reflash the custom boot.img after every LOS-update through twrp.
In the end my screen on my LT30p looked even better than on my tsubasa.
If someone is interested in a detailed howto, feel free to ask.