mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-02-05 04:06:11 -05:00
Merge branch 'nonblock-backendwide' into 'master'
Draft: backend/drm: Allow nonblocking backend commits See merge request wlroots/wlroots!4863
This commit is contained in:
commit
df8ea07c59
1 changed files with 7 additions and 3 deletions
|
|
@ -612,9 +612,6 @@ static void drm_connector_rollback_commit(const struct wlr_drm_connector_state *
|
||||||
static bool drm_commit(struct wlr_drm_backend *drm,
|
static bool drm_commit(struct wlr_drm_backend *drm,
|
||||||
const struct wlr_drm_device_state *state,
|
const struct wlr_drm_device_state *state,
|
||||||
uint32_t flags, bool test_only) {
|
uint32_t flags, bool test_only) {
|
||||||
// Disallow atomic-only flags
|
|
||||||
assert((flags & ~DRM_MODE_PAGE_FLIP_FLAGS) == 0);
|
|
||||||
|
|
||||||
struct wlr_drm_page_flip *page_flip = NULL;
|
struct wlr_drm_page_flip *page_flip = NULL;
|
||||||
if (flags & DRM_MODE_PAGE_FLIP_EVENT) {
|
if (flags & DRM_MODE_PAGE_FLIP_EVENT) {
|
||||||
page_flip = drm_page_flip_create(drm, state);
|
page_flip = drm_page_flip_create(drm, state);
|
||||||
|
|
@ -1922,6 +1919,7 @@ bool commit_drm_device(struct wlr_drm_backend *drm,
|
||||||
bool ok = false;
|
bool ok = false;
|
||||||
bool modeset = false;
|
bool modeset = false;
|
||||||
size_t conn_states_len = 0;
|
size_t conn_states_len = 0;
|
||||||
|
bool nonblock = drm->iface == &atomic_iface;
|
||||||
for (size_t i = 0; i < output_states_len; i++) {
|
for (size_t i = 0; i < output_states_len; i++) {
|
||||||
const struct wlr_backend_output_state *output_state = &output_states[i];
|
const struct wlr_backend_output_state *output_state = &output_states[i];
|
||||||
struct wlr_output *output = output_state->output;
|
struct wlr_output *output = output_state->output;
|
||||||
|
|
@ -1932,6 +1930,9 @@ bool commit_drm_device(struct wlr_drm_backend *drm,
|
||||||
}
|
}
|
||||||
|
|
||||||
struct wlr_drm_connector *conn = get_drm_connector_from_output(output);
|
struct wlr_drm_connector *conn = get_drm_connector_from_output(output);
|
||||||
|
if (!test_only && conn->pending_page_flip != NULL) {
|
||||||
|
nonblock = false;
|
||||||
|
}
|
||||||
|
|
||||||
if (output_pending_enabled(output, &output_state->base) && !drm_connector_alloc_crtc(conn)) {
|
if (output_pending_enabled(output, &output_state->base) && !drm_connector_alloc_crtc(conn)) {
|
||||||
wlr_drm_conn_log(conn, WLR_DEBUG,
|
wlr_drm_conn_log(conn, WLR_DEBUG,
|
||||||
|
|
@ -1966,6 +1967,9 @@ bool commit_drm_device(struct wlr_drm_backend *drm,
|
||||||
if (!test_only) {
|
if (!test_only) {
|
||||||
flags |= DRM_MODE_PAGE_FLIP_EVENT;
|
flags |= DRM_MODE_PAGE_FLIP_EVENT;
|
||||||
}
|
}
|
||||||
|
if (nonblock) {
|
||||||
|
flags |= DRM_MODE_ATOMIC_NONBLOCK;
|
||||||
|
}
|
||||||
struct wlr_drm_device_state dev_state = {
|
struct wlr_drm_device_state dev_state = {
|
||||||
.modeset = modeset,
|
.modeset = modeset,
|
||||||
.connectors = conn_states,
|
.connectors = conn_states,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue