[Development] Screen mirroring

Laszlo Agocs laszlo.agocs at qt.io
Wed Aug 2 09:18:50 CEST 2017


Hi,

Don't you need to duplicate the drmModePageFlip call too? drmModeSetCrtc is called only once. Other than that it should be alright conceptually (as long as the two screens support the same mode). Proper plumbing with config file support can get more complicated, of course. There is some work planned/on-going around eglfs_kms (see umbrella task at https://bugreports.qt.io/browse/QTBUG-62132 ) which could provide this (configurable cloning) as well, but all that won't land before 5.11 at earliest. So current versions need custom patches for the time being.

Cheers,
Laszlo
 

-----Original Message-----
From: Development [mailto:development-bounces+laszlo.agocs=qt.io at qt-project.org] On Behalf Of Quentin Schulz
Sent: onsdag 2. august 2017 08.34
To: development at qt-project.org
Cc: Thomas Petazzoni <thomas.petazzoni at free-electrons.com>; Boris Brezillon <boris.brezillon at free-electrons.com>; Alexandre Belloni <alexandre.belloni at free-electrons.com>
Subject: [Development] Screen mirroring

Hi all,

I'm currently working on getting screen mirroring working on an iMX6Q with Qt5.8 and eglfs plugin.

On this SoC, there is an IPU (Image Processing Unit) which has two DI (Display Interface). The DI is connected to encoders (HDMI and LVDS in our case) and can each handle one screen. It is my understanding that a DI can be assimilated as a CRTC.

We use the eglfs plugin (via -platform) with kms back-end.

I'm able to display content on the two screens connected to the HDMI and LVDS with Qt5_Cinematicexperience (one screen at a time) or quickmwtest[1] (both screens at the same time, but different images) thanks to a JSON file I specify with QT_QPA_EGLFS_KMS_CONFIG.

What I would like to achieve is to have the same image on both screens at the same time (same resolution of 1024x768 limited by the LVDS) without having to code the application to explicitly "copy" what is displayed on one screen to the other.

I managed to achieve this goal by using the same framebuffer for both CRTCs. I basically added a drmModeSetCrtc to QEglFSKmsGbmScreen::flip[2] with hardcoded connectors and CRTCs ids. See horrible patch here[3].

Is it (using the same framebuffer for both CRTCs) the right way to do it? How do you see it being implemented? I guess that we should also adapt the JSON file to be able to specify screen mirroring.

Else, what do you suggest?

Thanks,
Quentin

[1] https://github.com/alpqr/quickmwtest
[2]
https://git.qt.io/consulting-usa/qtbase-xcb-rendering/blob/dev/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmscreen.cpp#L193
[3] http://code.bulix.org/vs6d7z-176162
--
Quentin Schulz, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
_______________________________________________
Development mailing list
Development at qt-project.org
http://lists.qt-project.org/mailman/listinfo/development



More information about the Development mailing list