Commit f31b4b36 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.
parent ec759434
Pipeline #152011 passed with stage
in 15 minutes and 8 seconds
......@@ -119,21 +119,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