A20 + PiTFT display with ILI9341

Started by zoidberg, June 20, 2014, 06:13:09 PM

Previous topic - Next topic

zoidberg

Hello, recently I've been connecting Olimex A20 board to Adafruit PiTFT display with ILI9341 via SPI. I wasn't able to make fbtft_device module work, so, I created my own kernel FB driver - ili9341.c(http://pastebin.com/HKrs61s2)
fbcon seems to work fine.(please, see picture http://i57.tinypic.com/2w4fzur.jpg).

But when I do startx, I see Debian's desktop with ugly colors. I've tried changing RGB to BGR in display configuration, but it has no effect. And I'm not sure if that's the issue (another image http://i60.tinypic.com/117ecnn.jpg ).
I have no idea what might be wrong. I have 3 options:
1) Error in display initial configuration
2) some issue in my ili9341 kernel module.
3) Need to configure/fix Xorg somehow.

Can anyone advice what might be wrong?
THanks

MBR

I'm not sure, but it coukld be a RGB mode mismatch, e.g. RGB565 on RGB555 or something like that. The output of fbset -i and relevant parts of Xorg.*.log could help a lot.

zoidberg

Issue resolved thanks to advice from Adafruit forum. It was an endianness issue. Bytes on video memory were little-endian, while display required big endian. Putting htons() for each unsigned short pixel value before sending it to SPI did the job. Thanks everybody.