Commit 3e1ca627 authored by Pekka Paalanen's avatar Pekka Paalanen

renderer/native: check format for drmModeAddFB fallback

If drmModeAddFB2() does not work, the fallback to drmModeAddFB() can
only handle a single specific format. Make sure the requested format is
that one format, and fail the operation otherwise.

This should at least makes the failure mode obvious on such old systems
where the kernel does not support AddFB2, rather than producing wrong
parent c71f6a18
......@@ -3,6 +3,7 @@
* Copyright (C) 2011 Intel Corporation.
* Copyright (C) 2016 Red Hat
* Copyright (c) 2018 DisplayLink (UK) Ltd.
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
......@@ -2246,6 +2247,15 @@ init_dumb_fb (MetaDumbBuffer *dumb_fb,
if (fb_id == 0)
if (format != DRM_FORMAT_XRGB8888)
g_set_error (error, G_IO_ERROR,
"drmModeAddFB does not support format 0x%x",
goto err_add_fb;
if (drmModeAddFB (kms_fd, width, height,
24 /* depth of RGBX8888 */,
32 /* bpp of RGBX8888 */,
Markdown is supported
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