Commit 0c2682ce authored by Xaver Hugl's avatar Xaver Hugl
Browse files

backends/drm: only allow ARGB8888 as the cursor format

The raspberry pi exposes opaque formats for the cursor plane, and interprets
them as being opaque as well... Considering that we effectively don't support
anything else with the QPainter anyways, just hardcode ARGB8888 until we paint
the cursor with OpenGl.


(cherry picked from commit f31b4b36)
parent 5186f411
Pipeline #152030 passed with stage
in 12 minutes and 34 seconds
......@@ -118,21 +118,12 @@ void DrmOutput::updateCursor()
}
const auto plane = m_pipeline->pending.crtc->cursorPlane();
if (!m_cursor || (plane && !plane->formats().value(m_cursor->drmFormat()).contains(DRM_FORMAT_MOD_LINEAR))) {
if (plane) {
const auto formatModifiers = plane->formats();
const auto formats = formatModifiers.keys();
for (uint32_t format : formats) {
if (!formatModifiers[format].contains(DRM_FORMAT_MOD_LINEAR)) {
continue;
}
m_cursor = QSharedPointer<DumbSwapchain>::create(m_gpu, m_gpu->cursorSize(), format, QImage::Format::Format_ARGB32_Premultiplied);
if (!m_cursor->isEmpty()) {
break;
}
}
} else {
m_cursor = QSharedPointer<DumbSwapchain>::create(m_gpu, m_gpu->cursorSize(), DRM_FORMAT_XRGB8888, QImage::Format::Format_ARGB32_Premultiplied);
if (plane && (!plane->formats().contains(DRM_FORMAT_ARGB8888) || !plane->formats().value(DRM_FORMAT_ARGB8888).contains(DRM_FORMAT_MOD_LINEAR))) {
m_pipeline->setCursor(nullptr);
m_setCursorSuccessful = false;
return;
}
m_cursor = QSharedPointer<DumbSwapchain>::create(m_gpu, m_gpu->cursorSize(), plane ? DRM_FORMAT_ARGB8888 : DRM_FORMAT_XRGB8888, QImage::Format::Format_ARGB32_Premultiplied);
if (!m_cursor || m_cursor->isEmpty()) {
m_pipeline->setCursor(nullptr);
m_setCursorSuccessful = false;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment