Skip to content
This repository has been archived by the owner on Nov 1, 2021. It is now read-only.

wlr_allocator_autocreate #2884

Merged
merged 7 commits into from
Apr 28, 2021
Merged

Conversation

bl4ckb0ne
Copy link
Contributor

Implements #2861

@bl4ckb0ne bl4ckb0ne force-pushed the wlr_allocator_autocreate branch 3 times, most recently from 8b71061 to 735a9dd Compare April 26, 2021 16:17
@bl4ckb0ne bl4ckb0ne marked this pull request as ready for review April 26, 2021 16:18
backend/drm/backend.c Outdated Show resolved Hide resolved
backend/wayland/backend.c Outdated Show resolved Hide resolved
backend/x11/backend.c Outdated Show resolved Hide resolved
@emersion
Copy link
Member

Can we import the doc-comments from the original issue #2861?

render/allocator.c Outdated Show resolved Hide resolved
render/gbm_allocator.c Outdated Show resolved Hide resolved
render/allocator.c Outdated Show resolved Hide resolved
render/allocator.c Outdated Show resolved Hide resolved
render/allocator.c Outdated Show resolved Hide resolved
backend/wayland/backend.c Outdated Show resolved Hide resolved
backend/x11/backend.c Outdated Show resolved Hide resolved
close(drm_fd);
goto error_event;
}
x11->allocator = &gbm_alloc->base;
pixmap_formats = &x11->dri3_formats;
} else if (x11->have_shm) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can now support both DRI3 and SHM at the same time, so this can be an if instead of an else if.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So we should store both pixman formats then right?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh. Hm that won't work too well. We must use the dri3_formats if the allocator is GBM, shm_formats if the allocator is shm. However we don't know whether we'll use GBM or shm prior to wlr_allocator_autocreate. Potential solutions:

  1. Support either DMA-BUFs or shm, not both at the same time. But this will break if DMA-BUFs are available (disabling shm) and the user forces the Pixman renderer (via WLR_RENDERER=pixman).
  2. Check the type of the allocator returned by wlr_allocator_autocreate, with new functions like allocator_is_gbm and allocator_is_shm.
  3. Do something more involved like allocator_get_buffer_caps then check the result to decide which formats to select, but let's keep this for later (if ever), it's over-complicated when there are no third-party allocators.

backend/x11/backend.c Outdated Show resolved Hide resolved
render/gbm_allocator.c Outdated Show resolved Hide resolved
@emersion
Copy link
Member

Also needs a rebase :)

Copy link
Member

@emersion emersion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@emersion emersion merged commit cc1b663 into swaywm:master Apr 28, 2021
@emersion emersion added the breaking Breaking change in public API label Apr 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
breaking Breaking change in public API
Development

Successfully merging this pull request may close these issues.

None yet

2 participants