Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,737,354 Members 41,623 Now Online
XDA Developers Android and Mobile Development Forum

[HOWTO]Fix TX's inverted screen caused by cross-flashing(PERMANENT)

Tip us?
 
updateing
Old
(Last edited by updateing; 24th June 2014 at 02:08 AM.)
#1  
Senior Member - OP
Thanks Meter 136
Posts: 146
Join Date: Aug 2012
Location: Wuhan

 
DONATE TO ME
Default [HOWTO]Fix TX's inverted screen caused by cross-flashing(PERMANENT)

OK finally there is a permanent solution for this problem.But this method is still under test.I will not be responsible for anything damaged.You choose whether to try it.

Quote:
1.Download the kernel(c_rtest.elf) and unzip & flash it. We don't need to boot the whole system so no special Android system is required.
2.When the amber light shows up, press Vol+ or Vol- to enter Recovery.
3.Open a terminal and launch "adb shell" on your computer.
4.Type in adb shell
Code:
Select Code
dmesg | grep "panel"
5.Check if the response contains the string "mdx80"
6.------If there is no such text,please post the response here , stop immediately,and flash back to previous kernel.(but if you find ACX... in the response,please do not post.That's Screen type B and I don't own such a device. Sorry...)
------If there is "mdx80",just go ahead.
7.Type
Code:
Select Code
mkdir d
mount -t debugfs none /d
cd /d/msm_fb/mipi_r63306
echo 1 > break_nvm
(The screen will go blank.That's normal.Don't be stressed.)
echo 1 > recover_nvm
(The screen should be working now)
-----If you see "mkdir failed: d already exists",just skip the "mkdir d" and "mount" commands(first 2 lines) and go on.
8.Flash the ROM you want to use IMMEDIATELY after the screen starts to work. Just don't stick with this experimental kernel.
Then you should have working screen on your TX~You can enjoy the leaked 4.3 now~

================================================== ======
WHY IT WORKS
 
As the old post said,we can gather correct register data from a normal screen and write back to the problem ones.Here is the data I collected:
http://forum.xda-developers.com/show....php?t=2607323
Thanks Sakilia,you are our phone's lifesaver!
And I did a comparison between the dumped data and my own,finding that only a few registers were changed.I checked the interfaces provided by the screen driver and found several ways to write the differences to screen.I tried them all but only one way,which is like the previous corruption process,really worked.
After the data was written into the screen,everything looks nice except the color(what a mess!).It was caused by the incomplete data dump.However,after reading something about register operation,I found that hex commands in MDW30 driver and MDX80 driver were just the in the same format (register number + data)and there are several registers used to store color correction data.So in no time did I find the missing parts and wrote them into my screen.Finally the screen works as before!


Old post:
 

================================================== ======
This morning I wanted to find a zImage that could boot 9.2.A.0.278 LT30p leaked firmware on my LT29i.Among the zImages I have,there is one extracted from LT30p CM10.2.But I didn't remember it and flashed it on my phone.Then the terrible "inverted screen" came...

After ~5hrs researching,I found that after cross-flashing,the panel was recognized as MDX80 instead of the correct MDW30_1e.
Maybe RECOVER_PANEL config caused this...The 30p kernel found there was a panel but it couldn't recognize it,so the kernel thought the panel was corrupt and executed the recovering process,after which our MDW30 was overwritten with MDX80 register data.But MDX80 driver fails to initialize the panel with commands required by MDW30 so the panel displays thing upside down...

I think that now that it loads MDX80 driver,why can't we add MDW30 init commands to the MDX80 driver?And there comes the key!
I just copied init_cmds and on_cmds from mdw30.c and replaced the ones in mdx80.c.It works!

And here is my work:
Quote:
1.Download the attached MDX80 driver.
2.Make a backup of (kernel root dir)/drivers/video/msm/mipi_r63306_panels/mipi_tmd_mdx80.c
3.Extract the zip file to drivers/video/msm/mipi_r63306_panels/ and overwrite the original mdx80.c.
4.Modify your kernel config CONFIG_FB_MSM_MIPI_R63306_PANEL_TMD_MDX80=y
5.Compile the kernel and pack it with ramdisk.Then just flash it.
There are some "unused" warnings in the file,but it does finish the compiling and work.

That should do with "Touch Firmware version C" devices.

As for the color correction:
Code:
Select Code
echo 1 > /sys/devices/platform/mipi_dsi.524288/eco_mode
echo 0 > /sys/devices/platform/mipi_dsi.524288/eco_mode
Don't forget about the space after 1 or 0 !

A little bug:screen gamma correction and ECO MODE aren't working properly.The color is a bit different from stock kernel.

There is another way:dump the correct register values from a normal TX and write our own NV Recover data using CONFIG_FB_MSM_RECOVER_PANEL.
But I don't know how to dump data.Anyone can help?So that we won't have to re-compile the kernel every time we flash a new firmware...


Added v2:Changed cabc_user_param to MDW30's

================================================== =====

If you use my work,please give proper credits.Thanks!
Attached Files
File Type: zip mipi_tmd_mdx80.c.new.zip - [Click for QR Code] (3.9 KB, 119 views)
File Type: zip mipi_tmd_mdx80.c.v2.new.zip - [Click for QR Code] (3.9 KB, 143 views)
File Type: zip c_rtest.elf.zip - [Click for QR Code] (9.18 MB, 587 views)
The Following 15 Users Say Thank You to updateing For This Useful Post: [ Click to Expand ]
 
romeoofair
Old
#2  
Senior Member
Thanks Meter 47
Posts: 229
Join Date: Aug 2013
Location: visakhapatnam
Quote:
Originally Posted by updateing View Post
This morning I wanted to find a zImage that could boot 9.2.A.0.278 LT30p leaked firmware on my LT29i.Among the zImages I have,there is one extracted from LT30p CM10.2.But I didn't remember it and flashed it on my phone.Then the terrible "inverted screen" came...

After ~5hrs researching,I found that after cross-flashing,the panel was recognized as MDX80 instead of the correct MDW30_1e.
Maybe RECOVER_PANEL config caused this...The 30p kernel found there was a panel but it couldn't recognize it,so the kernel thought the panel was corrupt and executed the recovering process,after which our MDW30 was overwritten with MDX80 register data.But MDX80 driver fails to initialize the panel with commands required by MDW30 so the panel displays thing upside down...

I think that now that it loads MDX80 driver,why can't we add MDW30 init commands to the MDX80 driver?And there comes the key!
I just copied init_cmds and on_cmds from mdw30.c and replaced the ones in mdx80.c.It works!

And here is my work:


That should do with "Touch Firmware version C" devices.

A little bug:screen gamma correction and ECO MODE aren't working properly.The color is a bit different from stock kernel.

There is another way:dump the correct register values from a normal TX and write our own NV Recover data using CONFIG_FB_MSM_RECOVER_PANEL.
But I don't know how to dump data.Anyone can help?So that we won't have to re-compile the kernel every time we flash a new firmware...
bro i evn cross flahed xperia t 4.3 rom with kernel and got inverted screen. even in recovery . got the problem when i flahed t kernel infact. so can you please tell me where to replace the file exactly. i dont understant the above dir. i tried manually searching for the file with root explorer but dint find it
The Following User Says Thank You to romeoofair For This Useful Post: [ Click to Expand ]
 
peetr_
Old
#3  
Recognized Contributor
Thanks Meter 2122
Posts: 2,331
Join Date: Oct 2010
As the OP said, it must be replaced and recompiled in kernel. I believe that someone will do it soon.
___________________________________

Sony Xperia T owner

 
Midleo
Old
#4  
Midleo's Avatar
Senior Member
Thanks Meter 101
Posts: 264
Join Date: Sep 2009
Location: Márokpapi
Thumbs up Cool

Actualy i cant try/test it cause i already got a new device from the market... but it sounds like true and its i think must work.

Man you are so smart!
Sony Xperia TX using official 4.3 firmware with all goodies: Root, CWM, Deodex, Super User Mod!

 
sj8023ld
Old
#5  
Senior Member
Thanks Meter 351
Posts: 126
Join Date: Jan 2011
Location: Qingdao
Good job! Nice to see you here.I will make a stock kernel with this fix when I get time
The Following 3 Users Say Thank You to sj8023ld For This Useful Post: [ Click to Expand ]
 
updateing
Old
#6  
Senior Member - OP
Thanks Meter 136
Posts: 146
Join Date: Aug 2012
Location: Wuhan

 
DONATE TO ME
Quote:
Originally Posted by sj8023ld View Post
Good job! Nice to see you here.I will make a stock kernel with this fix when I get time
Thanks,you are so nice
 
romeoofair
Old
#7  
Senior Member
Thanks Meter 47
Posts: 229
Join Date: Aug 2013
Location: visakhapatnam
Quote:
Originally Posted by sj8023ld View Post
Good job! Nice to see you here.I will make a stock kernel with this fix when I get time
bro can you make it soon because my screen is still inverted and i cant even operate my phone .its been two days
 
updateing
Old
#8  
Senior Member - OP
Thanks Meter 136
Posts: 146
Join Date: Aug 2012
Location: Wuhan

 
DONATE TO ME
Gamma correction fixed
The Following User Says Thank You to updateing For This Useful Post: [ Click to Expand ]
 
romeoofair
Old
#9  
Senior Member
Thanks Meter 47
Posts: 229
Join Date: Aug 2013
Location: visakhapatnam
Quote:
Originally Posted by updateing View Post
Gamma correction fixed
bro please help .i dont understand the method. my screen got inverted two days back due to crossflahing 4.3 xperia rom and kernel by doomlord , please help me with the process.
 
arctic02
Old
(Last edited by arctic02; 11th January 2014 at 08:47 PM.)
#10  
Member
Thanks Meter 16
Posts: 69
Join Date: Mar 2012
Location: Lapu-Lapu
Quote:
Originally Posted by romeoofair View Post
bro please help .i dont understand the method. my screen got inverted two days back due to crossflahing 4.3 xperia rom and kernel by doomlord , please help me with the process.
Romeoofair, try this http://bbs.gfan.com/android-7139831-1-1.html, its a visk-03, usable only for 4.1, v. .67, while they are cooking for 4.3 and so on fix... Cheers for the devs man!

p.s. Install custom rom first, then flash kernel at recovery after...

The Following User Says Thank You to arctic02 For This Useful Post: [ Click to Expand ]
Tags
inverted screen, kernel, lt29i, universal, upside down
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes