• Status Closed
  • Percent Complete
  • Task Type Patches
  • Category LCD
  • Assigned To No-one
  • Operating System Sansa e200
  • Severity Low
  • Priority Very Low
  • Reported Version Daily build (which?)
  • Due in Version Undecided
  • Due Date Undecided
  • Votes
  • Private
Attached to Project: Rockbox
Opened by jrbil - 2007-08-25
Last edited by MikeS - 2007-09-05

FS#7654 - LCD garbled top two lines.

Original code had the DMA controller writing two extra lines. When data was transferred to the GRAM on the LCD controller it wrapped around with the extra two lines of data (from outside of the allocated framebuffer). Hence the top two lines were garbled.

However, just changing the 0xde (222) to 0xdc (220) didn’t entirely fix the problem. The top two lines were now blank instead of randomly changing. By offseting at least two lines lower

lcd_write_reg(R_RAM_ADDR_SET, (y « 2)+175) where y >= 2

the problem goes away. But then everything is offset by y lines.

So I worked around by filling in the GRAM from the bottom up.

lcd_write_reg(R_ENTRY_MODE, 0×6000);
lcd_write_reg(R_RAM_ADDR_SET, (219 « 2)+175)

The image was now flipped. So I flipped it back by changing R_DRV_OUTPUT_CONTROL_NORMAL.

It’s a workaround, but without knowing exactly that all the LCD_REG_? do (no docs), it the best that I can do.

To use this patch, you must build a bootloader and install it as well (sansapatch -a new_bootloader).

It also clears up the garbled lines when you load the original firmware. To my knowledge, it should work on older e200s, but it has not been tested.

   patch (1.6 KiB)
Closed by  MikeS
2007-09-05 08:32
Reason for closing:  Fixed
Additional comments about closing:   Warning: Undefined array key "typography" in /home/rockbox/flyspray/plugins/dokuwiki/inc/parserutils.php on line 371 Warning: Undefined array key "camelcase" in /home/rockbox/flyspray/plugins/dokuwiki/inc/parserutils.php on line 407

Committed fix better and compatible with older models.

MikeS commented on 2007-08-25 11:39

There is a vertical blanking interval of two lines as is set up currently. Removing them will, I believe, increase the refresh rate (not sure if that’s so bad). The LCD driver chip is also supposed to match that and has setup in the registers. I’m pretty sure there would be a way without reversing the write direction or using an offset. If this one works on older models, I suppose this is far a more genuine fix than the line copying.

One problem with removing that interval is there’d be no blanking for synchronized display updates if we ever do that.

jrbil commented on 2007-08-25 17:00

I thought that the blank lines (back porch) was part of the problem, but it’s not. Current the the front porch is set to default, which makes the BP+FP=16 given BP. Increasing the BP does not affect how many lines are blank.

The patch does not change the BP or FP. It just draws from the bottom up, perhaps sidestepping synchronization issues (writing to the GRAM as the display is refreshed? I’m not sure why it works). All the offset does is tell it to draw from the bottom right instead of the top right.

MikeS commented on 2007-08-27 00:54

I’m going to have a look at this on my model and I’ll commit it if I have no problems. If anyone gets to that first, feel free.

MikeS commented on 2007-08-29 06:55

Just tried this and the image is flipped along the horizontal axis (vertical mirror) though it doesn’t introduce any other artifacts.

MikeS commented on 2007-08-29 06:59

I might have mentioned to feel free to get a register dump of the LCD controller registers (any of the SoC ones) _before_ the bootloader changes the controller settings. Would be a nice comparison.

jrbil commented on 2007-08-29 15:31

I’m just packing for holidays. I’ll be back in a week and look into it then. Thanks for testing it.

JL commented on 2007-09-04 11:29

Hello I made a patch that fixed this for me. see if it works for you  FS#7692 .
Some one posted that it does not seem to be a patch file. but I followed the directions to make one.
Let me know if i need to remake the patch file.
I did “svn diff firmware/target/arm/sandisk/sansa-e200/lcd-e200.c” is this wrong?
Thanks Jesse

jrbil commented on 2007-09-05 01:12

Checked out Jesse’s patch. Looks good. Added my 2 cents, but not really necessary (think it’s closer to what the code should be).


Available keyboard shortcuts


Task Details

Task Editing