Re: mi0283qt driver issues
Den 18.04.2018 17.52, skrev Tom Callaway: On 04/18/2018 06:22 AM, Noralf Trønnes wrote: It turns out that the reason for this is that the pitft has a hw reset circuit that resets only on power-on and not on each reboot through a gpio like rpi-display does. When the driver is enabling the display pipeline it checks if the controller is already initialized, and skips setup if it is. This means that the rotation value is only applied after power-on on the pitft and not on each reboot. Turning off the "display" before rebooting should also work: $ # change rotation value $ echo "28" | sudo tee /sys/kernel/debug/dri/0/command $ sudo reboot Rotation/mirror/flip/bgr is controlled by commmand 0x36. The current value is returned by command 0x0b: $ sudo cat /sys/kernel/debug/dri/0/command | grep "0b:" 0b: f8 So to fix this in the driver the rotation value has to always be applied regardless of display "on" state. This can be done by moving the rotation code in mi0283qt_enable() down after the out: label. Confirmed, turning off the display before rebooting works, thanks. To fix this correctly, it seems like there are two paths: * If it is always safe to apply the rotation value regardless of display state, move the rotation code down after out: in the mi0283qt driver. This is fine, it's reset, sleep in/out and display on/off that's disruptive. * If this fix is only safe on the pitft (and not on the other panels driven by the mi0283qt driver), either conditionalizing this behavior somehow, or making a separate ili9340 driver with this change. I'm willing to make patches if necessary here, but it is not clear which path is the correct one. Thanks, a patch a much appreciated. Noralf. ~tom ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: mi0283qt driver issues
On 04/18/2018 06:22 AM, Noralf Trønnes wrote: > It turns out that the reason for this is that the pitft has a hw reset > circuit that resets only on power-on and not on each reboot through a > gpio like rpi-display does. > > When the driver is enabling the display pipeline it checks if the > controller is already initialized, and skips setup if it is. This means > that the rotation value is only applied after power-on on the pitft and > not on each reboot. > > Turning off the "display" before rebooting should also work: > > $ # change rotation value > $ echo "28" | sudo tee /sys/kernel/debug/dri/0/command > $ sudo reboot > > Rotation/mirror/flip/bgr is controlled by commmand 0x36. The current > value is returned by command 0x0b: > > $ sudo cat /sys/kernel/debug/dri/0/command | grep "0b:" > 0b: f8 > > So to fix this in the driver the rotation value has to always be applied > regardless of display "on" state. This can be done by moving the rotation > code in mi0283qt_enable() down after the out: label. Confirmed, turning off the display before rebooting works, thanks. To fix this correctly, it seems like there are two paths: * If it is always safe to apply the rotation value regardless of display state, move the rotation code down after out: in the mi0283qt driver. * If this fix is only safe on the pitft (and not on the other panels driven by the mi0283qt driver), either conditionalizing this behavior somehow, or making a separate ili9340 driver with this change. I'm willing to make patches if necessary here, but it is not clear which path is the correct one. ~tom ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: mi0283qt driver issues
On 18 April 2018 at 11:22, Noralf Trønneswrote: >> os.putenv('SDL_VIDEODRIVER', 'fbcon') >> os.putenv('SDL_FBDEV' , '/dev/fb1') >> pygame.init() >> list = pygame.display.list_modes() >> print "List of modes: %s" % (list) >> >> It shows an empty set ("List of modes: []"). > > > I couldn't find any source code for the sdl fbcon driver, so I don't know > how it queries for modes. > The fbcon driver is an SDL1 thing. IMHO a wide move is to switch to SDL2 and its KMSDRM video backend. Disclaimer: I haven't tried how well the backend behaves. HTH Emil ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: mi0283qt driver issues
Den 16.04.2018 18.44, skrev Tom Callaway: Noralf, Thanks for the guidance on how to use the mi0283qt driver to run the panel included in the Adafruit 2.8" capacitive PiTFT Plus (running on top of a Raspberry Pi 3). I am working with 4.16.0 (Fedora 28). I can get the driver to load, and have console output appearing on it, but I have run into some issues that I am unclear how to resolve. Specifically: 1) If I change the rotation value to anything other than 90 (0x5a), the screen output from the console is corrupt. It turns out that the reason for this is that the pitft has a hw reset circuit that resets only on power-on and not on each reboot through a gpio like rpi-display does. When the driver is enabling the display pipeline it checks if the controller is already initialized, and skips setup if it is. This means that the rotation value is only applied after power-on on the pitft and not on each reboot. Turning off the "display" before rebooting should also work: $ # change rotation value $ echo "28" | sudo tee /sys/kernel/debug/dri/0/command $ sudo reboot Rotation/mirror/flip/bgr is controlled by commmand 0x36. The current value is returned by command 0x0b: $ sudo cat /sys/kernel/debug/dri/0/command | grep "0b:" 0b: f8 So to fix this in the driver the rotation value has to always be applied regardless of display "on" state. This can be done by moving the rotation code in mi0283qt_enable() down after the out: label. 2) The resolution is set to 240x320, not the 320x240 that I expected. mi0283qt doesn't match fb_ili9340 when it comes to rotation. rotation=90 on mi0283qt is 240x320 rotate=90 on fb_ili9340 is 320x240 3) pygame cannot run a display.set_mode call, always returning: No video mode large enough for 240x320 When I run this python code: import os import pygame os.putenv('SDL_VIDEODRIVER', 'fbcon') os.putenv('SDL_FBDEV' , '/dev/fb1') pygame.init() list = pygame.display.list_modes() print "List of modes: %s" % (list) It shows an empty set ("List of modes: []"). I couldn't find any source code for the sdl fbcon driver, so I don't know how it queries for modes. Noralf. Do you have any advice on how to resolve these issues? Thanks in advance, ~tom For debugging purposes: I have the following device tree entry for the device (taken from dtc -Ifs /proc/device-tree): pitft@0 { compatible = "multi-inno,mi0283qt"; buswidth = <0x8>; rotation = <0x5a>; bgr; fps = <0x1e>; reg = <0x0>; pinctrl-0 = <0x10>; debug = <0x0>; dc-gpios = <0xf 0x19 0x0>; spi-max-frequency = <0x3d09000>; pinctrl-names = "default"; }; *** modetest output *** [root@localhost ~]# modetest -M "mi0283qt" -c Connectors: id encoder status namesize (mm) modes encoders 28 31 connected Virtual-1 43x58 1 31 modes: name refresh (Hz) hdisp hss hse htot vdisp vss vse vtot) 240x320 0 240 240 240 240 320 320 320 320 1 flags: ; type: preferred, driver props: 2 DPMS: flags: enum enums: On=0 Standby=1 Suspend=2 Off=3 value: 0 5 link-status: flags: enum enums: Good=0 Bad=1 value: 0 6 non-desktop: flags: immutable range values: 0 1 value: 0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
mi0283qt driver issues
Noralf, Thanks for the guidance on how to use the mi0283qt driver to run the panel included in the Adafruit 2.8" capacitive PiTFT Plus (running on top of a Raspberry Pi 3). I am working with 4.16.0 (Fedora 28). I can get the driver to load, and have console output appearing on it, but I have run into some issues that I am unclear how to resolve. Specifically: 1) If I change the rotation value to anything other than 90 (0x5a), the screen output from the console is corrupt. 2) The resolution is set to 240x320, not the 320x240 that I expected. 3) pygame cannot run a display.set_mode call, always returning: No video mode large enough for 240x320 When I run this python code: import os import pygame os.putenv('SDL_VIDEODRIVER', 'fbcon') os.putenv('SDL_FBDEV' , '/dev/fb1') pygame.init() list = pygame.display.list_modes() print "List of modes: %s" % (list) It shows an empty set ("List of modes: []"). Do you have any advice on how to resolve these issues? Thanks in advance, ~tom For debugging purposes: I have the following device tree entry for the device (taken from dtc -Ifs /proc/device-tree): pitft@0 { compatible = "multi-inno,mi0283qt"; buswidth = <0x8>; rotation = <0x5a>; bgr; fps = <0x1e>; reg = <0x0>; pinctrl-0 = <0x10>; debug = <0x0>; dc-gpios = <0xf 0x19 0x0>; spi-max-frequency = <0x3d09000>; pinctrl-names = "default"; }; *** modetest output *** [root@localhost ~]# modetest -M "mi0283qt" -c Connectors: id encoder status namesize (mm) modes encoders 28 31 connected Virtual-1 43x58 1 31 modes: name refresh (Hz) hdisp hss hse htot vdisp vss vse vtot) 240x320 0 240 240 240 240 320 320 320 320 1 flags: ; type: preferred, driver props: 2 DPMS: flags: enum enums: On=0 Standby=1 Suspend=2 Off=3 value: 0 5 link-status: flags: enum enums: Good=0 Bad=1 value: 0 6 non-desktop: flags: immutable range values: 0 1 value: 0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel