cancel
Showing results for 
Search instead for 
Did you mean: 

Qt Example Landscape mode in the STM32MP157C-EV1 Target board

PYOON.1
Associate

I am Korean and a developer with less than a year of experience. Please understand the immaturity of inquiring in the official English language. I am using STM32MP157C-EV1 board. The board has the following settings according to the blog link I referenced. The blog link address is : " http://www.emsyslabs.com/how-to-compile-linux-using-yocto-for-stm32mp1/ ". As you can see, the settings are as follows.

STM32MP157C-EV1

*Linux Image : OpenSTLinux -> st-example-image-qt

*DISTRO=openstlinux-eglfs MACHINE=stm32mp1 source layers/meta-st/scripts/envsetup.sh

As you see the anothe address link : https://wiki.st.com/stm32mpu/wiki/OpenSTLinux_distribution

"Image : st-example-image-qt is ST example of image based on QT framework "

That's right. I'm doing some development to test a Qt example on that STM32MP157C-EV1 Board. Luckily, referring to the blog link, I was able to test the qt example for the target board, including the toolchain.

" http://www.emsyslabs.com/how-to-compile-linux-using-yocto-for-stm32mp1/ "

0690X00000BuuANQAZ.jpg

But I'm having a hard time. When running the Qt example, it is running in portrait mode only, not landscape mode. How can I run the Qt example in landscape mode? To run in landscape mode, I tried two things.

One thing is the referring to the previous blog, image file created on the basis of eglfs. Modified the profile file in the embedded Linux /etc directory.

As follows in Bold

PATH="/usr/local/bin:/usr/bin:/bin"

EDITOR="vi" # needed for packages like cron, git-commit

[ "$TERM" ] || TERM="vt100" # Basic terminal capab. For screen etc.

# Add /sbin & co to $PATH for the root user

[ "$HOME" != "/home/root" ] || PATH=$PATH:/usr/local/sbin:/usr/sbin:/sbin

# Set the prompt for bash and ash (no other shells known to be in use here)

[ -z "$PS1" ] || PS1='\u@\h:\w\$ '

if [ -d /etc/profile.d ]; then

for i in /etc/profile.d/*.sh; do

if [ -f $i -a -r $i ]; then

. $i

fi

done

unset i

fi

# Make sure we are on a serial console (i.e. the device used starts with

# /dev/tty[A-z]), otherwise we confuse e.g. the eclipse launcher which tries do

# use ssh

case $(tty 2>/dev/null) in

/dev/tty[A-z]*) [ -x /usr/bin/resize ] && /usr/bin/resize >/dev/null;;

esac

export PATH PS1 OPIEDIR QPEDIR QTDIR EDITOR TERM

#export QTransformedScreen::Rot180

#export QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS=/dev/input/event5:rotate=180

#export QT_QPA_EGLFS_INTEGRATION=

#export QT_QPA_EGLFS_INTEGRATION=eglfs

#export QT_QPA_EGLFS_FB=/dev/fb0:rotation=180:offset=1280x0:size=1280x720

#export QT_QPA_EGLFS_FB=/dev/fb0

#export QT_QPA_EGLFS_PHYSICAL_WIDTH=70

#export QT_QPA_EGLFS_PHYSICAL_HEIGHT=120

#export QT_QPA_EGLFS_WIDTH=1280

#export QT_QPA_EGLFS_HEIGHT=720

#export QT_QPA_EGLFS_WIDTH=720

#export QT_QPA_EGLFS_HEIGHT=1280

#export QT_QPA_EGLFS_ROTATION=-90

#export QT_QPA_EGLFS_FORCEVSYNC=1

#export QT_QPA_EGLFS_DEBUG=1

#export QT_QPA_PLATFORM=eglfs:fb=/dev/fb0:rotation=180:offset=420x610=720:1280

#export QT_QPA_PLATFORM=linuxfb:fb=/dev/fb0:offset=1280x0

#export QT_QPA_PLATFORM=eglfs:fb=/dev/fb0:offset=1280x0

#export QT_QPA_EGLFS_WIDTH=10

#export QT_QPA_EGLFS_HEIGHT=10

#export QT_QPA_PLATFORM=eglfs:fb=/dev/fb0:size=1280x720

#export QT_QPA_EGLFS_DEBUG=1

#export QT_QPA_EGLFS_SWAPINTERVAL=1

#export QT_QPA_FB_FORCE_FULLSCREEN=0

Second, I modified the qml file in the qtquick example. In the dashboard Qt example, I added the following x, y, and angle values:

Window {

   id: root

   visible: true

   width: 1280/2

   height: 720/2

   color: "#161616"

   title: "Qt Quick Extras Demo"

   ValueSource {

       id: valueSource

   }

   Item {

       id: container

       width: root.width

       height: root.height

       anchors.centerIn: parent

       transform : Rotation {

           origin.x: 420

           origin.y: 610

           angle:270

       }

The first method was useless. The second method was displayed in landscape view as shown in the following image.

0690X00000BuuAmQAJ.jpg

Again, I would like to ask you some great professionals here. How can I run the qt example in landscape mode? For more fundamental solution. Same thing as modifying the kernel. Like the kernel fix code below. CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y fbcon=rotate:3

However, I did not find it on st-image-qt. Even though I typed the following command: cd / && grep -r "CONFIG_FRAMEBUFFER_CONSOLE_ROTATION" /

That is all. Thank you.

3 REPLIES 3
Olivier GALLIEN
ST Employee

​Hi @PYOON.1​ 

Sorry for late reply.

Did you manage to get it work ?

Else did you try to uncomment :

export QT_QPA_PLATFORM=eglfs

export QT_QPA_EGLFS_ROTATION=90

Hope it help

Olivier

Olivier GALLIEN
In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
TBlec.1
Associate

hi @Community member​,

i'm having a similar issue on an stm32mp157 (discovery board with a 480x800) screen:

  • applying a `rotation` for the root qml item "works", but has some implications on the qtquick scene graph, preventing some batches to be merged
  • using `QT_QPA_EGLFS_ROTATION` works for software-rendered QWidgets, but not for QWindow (and QtQuick).

so i wonder if there is any way to convince the drm layer to detect the display as landscape rather than portrait? `modeprint` indicates that the display only supports one mode, but i am not familiar with the whole drm/kms infrastructure.

thanks a lot,

tim

Real_engineer
Associate II

I would also like to know if there is a solution for this