IniterWorker / gc9a01

GC9A01 Display Driver
Apache License 2.0
14 stars 6 forks source link

framerate #2

Closed 0x0fe closed 1 year ago

0x0fe commented 1 year ago

Hi, my display has a TE line, so i can sync the updates, however even with SPI at max speed i still get a tearing effect, because the internal refresh rate is still slightly higher than the rate a which i can push datas. I reach about 60fp at pushing datas so i estimate the internal refresh rate is about 75 or 80Hz. I found the registers 0xE8 but i struggle to use it properly. I see you made an enum with it image but i must say it doesnt seem to work, when i set any value other than default i get partial display (the display area is narrowed). And at no time framerate changed. How do you understand this register? i suspect "dot inversion" is not framerate, and unrelated to it, i think that frame rate was in the XX part of the register and for some reason has been disabled. In fact i suspect it is RTN1 and RTN2, one being some divider.

image image

IniterWorker commented 1 year ago

Hi @0x0fe,

I found the registers 0xE8 but i struggle to use it properly. I see you made an enum with it

The documentation is a bit misleading. I hope I didn't make too many errors based on it. I fixed an issue with the DINVMode truncation on 2bits vs 3bits (See ecd6bf182219937aeee7d66fa89cb0d55d0c5b11).

I still get a tearing effect

I fixed the tearing effect parameter that was unused before. (See fbcc839afdd8f0dcb06efcfb6407f0a9e12bb93f)

How do you understand this register? i suspect "dot inversion" is not framerate, and unrelated to it, i think that frame rate was in the XX part of the register and for some reason has been disabled.

Row inversion (column inversion) is when each adjacent row pixels (adjacent column pixels) have different polarity. All the adjacent pixels of the LCD panel have different polarity is called dot inversion. For the framerate part... ?!? I don't have any idea...

Because I didn't have the hardware before, Today was my first run... without a successful draw. I wondering if my LCD is broken. With the latest commits on master, the display init should work.

Could you describe/share your benchmark setup?

Thanks,

IniterWorker commented 1 year ago

Hi @0x0fe,

I had to fix a lot of things to have a working display. I wonder if you're using my library for your tests. It seems unlikely.

IniterWorker commented 1 year ago

The crate is now available on https://crates.io/crates/gc9a01-rs.

Feel free to open a new ticket, If you have question on my library.

0x0fe commented 1 year ago

So, to reply, i did not used your library directly because i use this LCD driver in C, but i checked it closely because your mention the framerate. in it. More research and tests are confirming that the framerate control registers are actually disabled, so there is no control over the internal refresh rate, which is very unfortunate for SPI control. Unless the SPI is fast enough to draw full frame before the internal refresh quicks in, which is unlikely, there will be tearing.