Do not try to create a gbm dmabuf when gbm is not available

Allows us to take the fallback path instead of just crashing
This commit is contained in:
Aleix Pol 2020-09-15 13:53:17 +02:00
parent 474060a456
commit fec4e058e5

View file

@ -31,6 +31,10 @@ GbmDmaBuf::~GbmDmaBuf()
KWin::GbmDmaBuf *GbmDmaBuf::createBuffer(const QSize &size, gbm_device *device)
{
if (!device) {
return nullptr;
}
auto bo = gbm_bo_create(device, size.width(), size.height(), GBM_BO_FORMAT_ARGB8888, GBM_BO_USE_RENDERING | GBM_BO_USE_LINEAR);
if (!bo) {