Commit Graph

9 Commits (9133c0f9d5bacfd472c7e6f8884ce9d7b1ee32c1)

Author SHA1 Message Date
Martin Gräßlin 600b3cd2c1 Allow presenting a DrmBuffer on a dedicated DrmOutput 2015-04-24 12:03:20 +02:00
Martin Gräßlin fcc895180b [drm] Better support for multiple outputs in DrmScreens
We get the DrmOutputs from the backend to properly set count, size and
geometry of the outputs.

Dynamic changes are not yet supported.
2015-04-24 12:03:20 +02:00
Martin Gräßlin 6d6c951402 Set the drm mode again when stride changed compared to previous buffer
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.
2015-04-24 12:03:20 +02:00
Martin Gräßlin 8278ae8487 Handle session deactivate and restore in DRM backend
* 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
2015-04-24 12:03:20 +02:00
Martin Gräßlin 2f312f35c9 Add a DrmOutput class to be used by the DrmBackend
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.
2015-04-24 12:03:19 +02:00
Martin Gräßlin 38b676d809 Add support for hardware cursors in DrmBackend
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.
2015-04-24 12:03:19 +02:00
Martin Gräßlin 877c33fe7d Initial implementation of EglGbmBackend
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.
2015-04-24 12:03:19 +02:00
Martin Gräßlin 3a7d0c395e Page flip event support in drm backend 2015-04-24 12:03:19 +02:00
Martin Gräßlin c759551340 [wayland] Add a basic drm/kms backend
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
2015-04-24 12:03:19 +02:00