PeartreeStudios
Posts: 27
Joined: Tue Feb 22, 2022 3:33 pm

Screen rotation with drm/egl rendering on Rpi4

Sun Dec 03, 2023 3:46 pm

Hi, we've converted an OpenGL ES application from using egl+x11 for presentation to egl+libdrm/libgbm. It all works as expected, but we're using a native portrait DPI display which we rotated to landscape using xrandr commands. Now in libdrm/gbm land with no X display server there is no xrandr approach. Searching online it looks like the libdrm/gbm interface can expose hardware rotation capabilities but I can't find any examples and I have an inkling there are some specific approaches for the Rpi4's architecture.

We're targeting a CM4 with a 480x640 waveshare DPI display running Raspberry Pi OS Bullseye 64-bit.

Thanks
Russell

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 15865
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Screen rotation with drm/egl rendering on Rpi4

Tue Dec 05, 2023 9:41 am

The DRM rendering path has no transpose option, only flipping vertically and/or horizontally.

EGL should give you the option to transpose as that is a trivial operation for 3D hardware.
Software Engineer at Raspberry Pi Ltd. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

Return to “Graphics programming”