Rotating the LCD display

For SAMA5D2 Xplained, SAMA5D3 Xplained and SAMA5D4 Xplained

Moderator: nferre

brian_
Posts: 15
Joined: Mon Jan 09, 2017 11:59 am

Rotating the LCD display

Wed Mar 29, 2017 2:37 pm

I am driving an LCD using the SAMA5D4 Xplained Ultra board and I would like to rotate everything that is displayed by 180 degrees.

I am running the atmel-qt5-demo-image.

If I run modetest, I get the following:

Code: Select all

root@Server:/sys/class/graphics/fb0# modetest
trying to open device 'i915'...failed
trying to open device 'radeon'...failed
trying to open device 'nouveau'...failed
trying to open device 'vmwgfx'...failed
trying to open device 'omapdrm'...failed
trying to open device 'exynos'...failed
trying to open device 'tilcdc'...failed
trying to open device 'msm'...failed
trying to open device 'sti'...failed
trying to open device 'tegra'...failed
trying to open device 'imx-drm'...failed
trying to open device 'rockchip'...failed
trying to open device 'atmel-hlcdc'...done
Encoders:
id      crtc    type    possible crtcs  possible clones
18      26      none    0x00000001      0x00000000

Connectors:
id      encoder status          name            size (mm)       modes   encoders
19      18      connected       unknown-1       108x65          2       18
  modes:
        name refresh (Hz) hdisp hss hse htot vdisp vss vse vtot)
  800x480 60 800 1010 1040 1086 480 502 512 535 flags: ; type: preferred, driver
  800x480 60 800 816 896 992 480 481 484 497 flags: nhsync, pvsync; type: userdef
  props:
        1 EDID:
                flags: immutable blob
                blobs:

                value:
        2 DPMS:
                flags: enum
                enums: On=0 Standby=1 Suspend=2 Off=3
                value: 0

CRTCs:
id      fb      pos     size
26      30      (0,0)   (800x480)
  800x480 60 800 1010 1040 1086 480 502 512 535 flags: ; type: preferred, driver
  props:

Planes:
id      crtc    fb      CRTC x,y        x,y     gamma size      possible crtcs
22      26      30      0,0             0,0     0               0x00000001
  formats: XR12 AR12 RA12 AR15 RG16 RG24 XR24 AR24 RA24
  props:
        5 type:
                flags: immutable enum
                enums: Overlay=0 Primary=1 Cursor=2
                value: 1
        21 rotation:
                flags: bitmask
                values: rotate-0=0x1 rotate-90=0x2 rotate-180=0x4 rotate-270=0x8
                value: 1
23      0       0       0,0             0,0     0               0x00000001
  formats: XR12 AR12 RA12 AR15 RG16 RG24 XR24 AR24 RA24
  props:
        5 type:
                flags: immutable enum
                enums: Overlay=0 Primary=1 Cursor=2
                value: 0
        20 alpha:
                flags: range
                values: 0 255
                value: 255
        21 rotation:
                flags: bitmask
                values: rotate-0=0x1 rotate-90=0x2 rotate-180=0x4 rotate-270=0x8
                value: 1
24      0       0       0,0             0,0     0               0x00000001
  formats: XR12 AR12 RA12 AR15 RG16 RG24 XR24 AR24 RA24
  props:
        5 type:
                flags: immutable enum
                enums: Overlay=0 Primary=1 Cursor=2
                value: 0
        20 alpha:
                flags: range
                values: 0 255
                value: 255
        21 rotation:
                flags: bitmask
                values: rotate-0=0x1 rotate-90=0x2 rotate-180=0x4 rotate-270=0x8
                value: 1
25      0       0       0,0             0,0     0               0x00000001
  formats: XR12 AR12 RA12 AR15 RG16 RG24 XR24 AR24 RA24 AYUV YUYV UYVY YVYU VYUY NV21 NV61 YU16 YU12
  props:
        5 type:
                flags: immutable enum
                enums: Overlay=0 Primary=1 Cursor=2
                value: 0
        20 alpha:
                flags: range
                values: 0 255
                value: 255
        21 rotation:
                flags: bitmask
                values: rotate-0=0x1 rotate-90=0x2 rotate-180=0x4 rotate-270=0x8
                value: 1

Frame buffers:
id      size    pitch

root@Server:/sys/class/graphics/fb0#

I can run modetest and see the test pattern. It claims to be using plane 23:

Code: Select all

root@Server:/sys/class/graphics/fb0# modetest -P 26:800x480
trying to open device 'i915'...failed
trying to open device 'radeon'...failed
trying to open device 'nouveau'...failed
trying to open device 'vmwgfx'...failed
trying to open device 'omapdrm'...failed
trying to open device 'exynos'...failed
trying to open device 'tilcdc'...failed
trying to open device 'msm'...failed
trying to open device 'sti'...failed
trying to open device 'tegra'...failed
trying to open device 'imx-drm'...failed
trying to open device 'rockchip'...failed
trying to open device 'atmel-hlcdc'...done
testing 800x480@XR24 overlay plane 23
I then try to rotate plane 23 as follows:

Code: Select all

modetest -w 23:rotation:0x4
But when I view the test pattern again, it has not changed. I tried this for different values, but running modetest again shows that plane 23 always has value:1 for its rotation value.

I have looked in the datasheet but I cannot see any obvious LCDcontroller register for rotation - but it does mention that hardware rotation is possible of the LCD Controller.

I have also tried various values in /sys/class/graphics/fb0/rotate (e.g. 1, 2, 4, 90, 180 etc) but this has no effect.

Any ideas?

Thanks in advance.
blue_z
Location: USA
Posts: 1507
Joined: Thu Apr 19, 2007 10:15 pm

Re: Rotating the LCD display

Wed Mar 29, 2017 9:44 pm

brian_ wrote:I would like to rotate everything that is displayed by 180 degrees.
That's not going to happen (in HW, if you use the base layer).
The SAMA5D4 datasheet clearly states (and is shown in the LCD controller block diagram) that rotation engines are only available for the three overlays.
The base layer has no rotation capability.

Regards
brian_
Posts: 15
Joined: Mon Jan 09, 2017 11:59 am

Re: Rotating the LCD display

Thu Mar 30, 2017 2:44 pm

Thanks for the response. It turns out that there is a hardware option on the LCD itself - changing the L/R and U/D polarity allowed for this to be done without any software changes.

Return to “SAMA5 Xplained”

Who is online

Users browsing this forum: No registered users and 1 guest