(I don't know if T suffers from inverted screen...)
According to my research,inverted screen is caused by cross-flashing.Wrong screen driver is used for initializing the screen,and the registers get corrupted(written data from the inappropriate driver).After that,the screen will be recognized as other model(written data suggests)so even if you use stock kernel,no proper driver will be loaded.
In order to fix this,we need to write proper register data into the screen again.If we take a look at the source of the driver,we will find "RECOVER_NVM" feature.That's how pre-defined data gets written into screen and we will use it for rescuing the screen.
Step 1.COLLECTING CORRECT DATA.
The rest is pretty easy:compile this kernel with CONFIG_MSM_FB_RECOVER_PANEL,boot into recovery,and follow command in this post:
http://forum.xda-developers.com/show...php?p=49297118
Note:
r63306 is the controller name.You can see it in the directory name of the driver.
I hope this will help you.If you have any question,please ask. :)
According to my research,inverted screen is caused by cross-flashing.Wrong screen driver is used for initializing the screen,and the registers get corrupted(written data from the inappropriate driver).After that,the screen will be recognized as other model(written data suggests)so even if you use stock kernel,no proper driver will be loaded.
In order to fix this,we need to write proper register data into the screen again.If we take a look at the source of the driver,we will find "RECOVER_NVM" feature.That's how pre-defined data gets written into screen and we will use it for rescuing the screen.
Step 1.COLLECTING CORRECT DATA.
1.1 Identify your actual screen model2.MODIFY THE DETECTED MODEL'S DRIVERSince the screen is already broken,we can't use any software to make it clear.You need to distinguish them using other ways.For example,TX's B screen has a much wider viewing angle than Screen C.Looking from side will give you answer.1.2 Get to know current detected model.1.2.1 Reboot your phone to clear dmesg cache.1.3 Collect correct register data for your ACTUAL screen model.
1.2.2 When it finishes boot,open ADB SHELL or Terminal Emulator.
1.2.3 Type "su".
1.2.4 After # shows up(root privilege acquired),type1.2.5 Look at the lines in redCode:dmesg | grep "panel"
In this case,ls043k3sx04 is detected screen model.Quote:
<6>[ 1.006409] default panel: mipi_sharp_panel
<6>[ 1.006775] setting pdata->panel_info.fb_num to 3. type: 8
<6>[ 1.012208] mdp_probe: panel_detect function
<6>[ 1.061651] mipi_renesas_r63306 mipi_renesas_r63306.0: found panel vendor: mipi_sharp_panel
<6>[ 1.062078] mipi_renesas_r63306 mipi_renesas_r63306.0: found panel: mipi_video_sharp_wxga_ls043k3sx04
<3>[ 1.397588] msm_fb_detect_panel: comparing name=hdmi_msm with mipi_video_renesas_fwvga
<6>[ 1.398718] setting pdata->panel_info.fb_num to 1. type: 7
<6>[ 1.399450] mdp_probe: panel_detect function
<6>[ 1.399603] mdp_probe: no panel_detect function
<6>[ 1.402685] setting pdata->panel_info.fb_num to 1. type: 10
<6>[ 1.403906] mdp_probe: panel_detect function
<6>[ 1.403998] mdp_probe: no panel_detect function
(Mine is MDX80,not this log)You may ask your friend who has the same phone and screen to run the script from this post:http://forum.xda-developers.com/show....php?t=2607323
And run the dmesg | grep "panel" also to find the model number.
Note that the register number may differ.The numbers in the script is for TX with Screen C.You can download the kernel source of your phone,navigate to /drivers/video/msm and search for your DETECTED model,open the .c file with any text editor.Search for "nvm_**_reg".The hex number is the register number.List them all in the script.
EG.Mine is Screen C/MDW30
2.1 Open the driver mentioned above.
2.2 Scroll to the first "nvm_**_reg".3.RE-COMPILE THE KERNEL AND APPLY MODYou can simply skip the nvm_e4_00_00_00_f0_ff_reg ones(have more than one hex num in their names-they are not storing the register data and are more like START/END BURNING commands :) )2.3 Find the correct values of long arrays
For example,you find
The first byte in the array is the same as register number.Leave it unchanged and modify the rest bytes accroding to the correct data you have just collected.Code:static char nvm_e7_reg[] = {
0xE7, 0x0F, 0x0C, 0x0B, 0x34
};
EG.The collected data for E7 is
We have 1+4 bytes in the nvm_e7_reg array,1 for reg number and 4 for rest bytes.So you copy 4bytes from this list to the array.Code:GEN_READ
reg=0xE7
len=10
data[0]=0x02
data[1]=0x02
data[2]=0x0D
data[3]=0x36
data[4]=0x00
data[5]=0x00
data[6]=0x00
data[7]=0x00
data[8]=0xCE
data[9]=0x9A
After modding,it should be
NOTE! The last 2 bytes in each register data is checksum.DO NOT write them into the driver.So the max. available data is 8 bytes.If you find some arrays have more than 8 bytes of data,you need to skip them and go on.Code:static char nvm_e7_reg[] = {
0xE7, 0x02, 0x02, 0x0D, 0x36
};
Open ACTUAL screen's driver,search 0xREG_NUM.2.4 Save the file.
EG. You find
There are 1+13 bytes.So you search for 0xCA in mdw30.c(my actual model)Code:static char nvm_ca_reg[] = {
0xCA, 0x0A, 0x15, 0x2E, 0x2D, 0x27, 0x1B, 0x20, 0x2B, 0x29, 0x31,
0x4F, 0x79, 0x3F
};
You will find in mdw30.c
EG.
So this is the actual value for Register CA.Copy the rest bytes to mdx80.c(my detected model)Code:static char gamma_ctrl_set_r_neg[] = {
0xCA, 0x00, 0x12, 0x22, 0x26, 0x21, 0x1C, 0x25,
0x31, 0x2D, 0x49, 0x5F, 0x3F, 0x3F
};
Note: do not use value from arrays named "eco".
The rest is pretty easy:compile this kernel with CONFIG_MSM_FB_RECOVER_PANEL,boot into recovery,and follow command in this post:
http://forum.xda-developers.com/show...php?p=49297118
Note:
Code:
cd /d/msm_fb/mipi_r63306
I hope this will help you.If you have any question,please ask. :)