Skip to content

Commit

Permalink
egl-wayland: set unprocessedFeedback flag
Browse files Browse the repository at this point in the history
A prior commit added logic to reallocate window surfaces after receiving
a new dma-buf feedback from the compositor. This keys off of the
unprocessedFeedback flag, however currently that flag never actually
gets set. This change sets the flag after receiving a new feedback, so
that we will reallocate the surface on the next eglSwapBuffers call.
  • Loading branch information
Erik Kurzinger committed May 9, 2023
1 parent 1c87fc0 commit f2dc786
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/wayland-egldisplay.c
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ dmabuf_feedback_done(void *data, struct zwp_linux_dmabuf_feedback_v1 *dmabuf_fee
WlEglDmaBufFeedback *feedback = data;
(void) dmabuf_feedback;

feedback->feedbackDone = true;
feedback->feedbackDone = feedback->unprocessedFeedback = true;
}

_Static_assert(sizeof(WlEglDmaBufFormatTableEntry) == 16,
Expand Down Expand Up @@ -1085,6 +1085,9 @@ EGLBoolean wlEglInitializeHook(EGLDisplay dpy, EGLint *major, EGLint *minor)
goto fail;
}

/* We haven't created any surfaces yet, so no need to reallocate. */
display->defaultFeedback.unprocessedFeedback = false;

if (major != NULL) {
*major = display->devDpy->major;
}
Expand Down
3 changes: 3 additions & 0 deletions src/wayland-eglsurface.c
Original file line number Diff line number Diff line change
Expand Up @@ -2351,6 +2351,9 @@ EGLSurface wlEglCreatePlatformWindowSurfaceHook(EGLDisplay dpy,
err = EGL_BAD_ALLOC;
goto fail;
}

/* We haven't allocated our surface yet, so we can clear this flag. */
surface->feedback.unprocessedFeedback = false;
}

err = create_surface_context(surface);
Expand Down

0 comments on commit f2dc786

Please sign in to comment.