The aim is to be able to create a plugin for each of the backends.
The following directories are created:
* backends/drm
* backends/fbdev
* backends/wayland
* backends/x11
Each available mode on the connector is added to the
KWayland::Server::OutputInterface for the DrmOutput.
The logic to calculate the refreshRate is highly inspired from Weston's
implementation in compositor-drm.c.
Documentation for the wonderful EDID format can be found at:
http://read.pudn.com/downloads110/ebook/456020/E-EDID%20Standard.pdf
In case the link breaks: wikipedia also has a good section on it.
We read out the following information:
* EISA code (3 characters)
* serial number
* monitor name (up to 12 characters)
* physical size (stored in cm)
Unfortunately the EDID information cannot be trusted at all.
My 24" screen reports a sice of 16x9 cm. So we need to provide users
a way to overwrite the broken data in an easy way through kwinrc
[EdidOverwrite][EISA code/maker name][monitor name][serial number]
PhysicalSize=trueWidthInMM,trueHeightInMM
Unfortunately monitor name is not a sufficient enough identifier, that's
why serial number is also used. This makes automatic distribution of
overwrites difficult. But in the example above the monitor name is
"SyncMaster" which is a rather broad field in Samsung :-(
The extracted information from EDID is also used to set the corresponding
fields in KWayland::Server::OutputInterface.
Requires to move the screensQueried signal and disconnect during
Application startup.
As Screens only hold the geometry of each screen and the overall
geometry, there is no need (yet) to update in more detail when a
DrmOutput is added or removed. The overall queried is sufficient.
The DrmBackend installs a UdevMonitor to listen for output hotplug
events. Whenever a hotplug event occurrs the resources are queried
again and a signal is emitted for each removed and added output.
Includes better error handling for when page flip failed. If it fails,
we shouldn't set the current buffer as otherwise each new attempt to
present a buffer will fail, too.
* blocks compositor while session is inactive
* prevents page flips while session is inactive
* restores modes when going to inactive
* hides cursor when going to inactive
* blanks screens when going active
* shows cursor again when going active
* triggers a repaint when going active
The DrmOutput corresponds to one output we perform mode setting on.
This implies that page flip is now performed on the DrmOutput. As our
compositor cannot drive multiple outputs yet, we only use the first one
and call into bufferSwapComplete and aboutToBufferSwap when either all
page flips are completed or respectivly the first one is performed.
Setting cursor is also handled on each DrmOutput.
When the DrmOutput is initialized it is blanked with a black buffer which
gets destroyed once the first page flip event has occurred (meanig the
buffer is no longer needed). Before setting the black buffer we store the
current buffer which will be set back on tear down. Because of that
tearing down the DrmBackend needs to wait till all page flips ended.
Creates two buffers with the size queried through the drm capabilities.
The actual cursor image is retrieved using the software cursor
functionality from the AbstractBackend and rendered into the shared
memory buffer. The the buffer is set as the new cursor image and the
rendering buffer for the cursor is swapped.
The position is updated whenever the cursor image changes or the mouse
position changes.
Uses EGL_MESA_platform_gbm to get an EglDisplay from a gbm_device.
The DrmBackend can provide a DrmBuffer for a gbm_surface and present
it.
Unfortunately buffer age seems to be slightly broken and we still have
artefacts.
Introduces a new (optional) dependency: libdrm.
The DrmBackend currently supports finding the first connected output.
It can create shared memory buffers which are used by SceneQPainter to
do double buffered rendering.
There is still lots to do, the following things are not yet working:
* multiple outputs
* page flip
* OpenGL (through gbm)
* restoring mode setting to start value