mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-22 21:05:58 +01:00
backend/headless: use a format suitable for rendering
When allocating buffers, use a format suitable for rendering. This avoids picking a format that won't work.
This commit is contained in:
parent
5d008d9030
commit
c045253927
1 changed files with 2 additions and 2 deletions
|
@ -13,6 +13,7 @@
|
||||||
#include "backend/headless.h"
|
#include "backend/headless.h"
|
||||||
#include "render/drm_format_set.h"
|
#include "render/drm_format_set.h"
|
||||||
#include "render/gbm_allocator.h"
|
#include "render/gbm_allocator.h"
|
||||||
|
#include "render/wlr_renderer.h"
|
||||||
#include "util/signal.h"
|
#include "util/signal.h"
|
||||||
|
|
||||||
struct wlr_headless_backend *headless_backend_from_backend(
|
struct wlr_headless_backend *headless_backend_from_backend(
|
||||||
|
@ -132,12 +133,11 @@ static bool backend_init(struct wlr_headless_backend *backend,
|
||||||
backend->allocator = &alloc->base;
|
backend->allocator = &alloc->base;
|
||||||
|
|
||||||
const struct wlr_drm_format_set *formats =
|
const struct wlr_drm_format_set *formats =
|
||||||
wlr_renderer_get_dmabuf_formats(backend->renderer);
|
wlr_renderer_get_dmabuf_render_formats(backend->renderer);
|
||||||
if (formats == NULL) {
|
if (formats == NULL) {
|
||||||
wlr_log(WLR_ERROR, "Failed to get available DMA-BUF formats from renderer");
|
wlr_log(WLR_ERROR, "Failed to get available DMA-BUF formats from renderer");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// TODO: filter modifiers with external_only=false
|
|
||||||
const struct wlr_drm_format *format =
|
const struct wlr_drm_format *format =
|
||||||
wlr_drm_format_set_get(formats, DRM_FORMAT_XRGB8888);
|
wlr_drm_format_set_get(formats, DRM_FORMAT_XRGB8888);
|
||||||
if (format == NULL) {
|
if (format == NULL) {
|
||||||
|
|
Loading…
Reference in a new issue