backend/drm: add test_only arg to wlr_drm_interface.crtc_commit

Right now callers of drm_crtc_commit need to check whether the
interface is legacy or atomic before passing the TEST_ONLY flag.
Additionally, the fallbacks for legacy are in-place in the common
code.

Add a test_only arg to the crtc_commit hook. This way, there's no
risk to pass atomic-only flags to the legacy function (add an assert
to ensure this) and all of the legacy-specific logic can be put back
into legacy.c (done in next commit).
This commit is contained in:
Simon Ser 2021-07-08 15:56:01 +02:00 committed by Simon Zeni
parent a362d21d6b
commit 017555651b
4 changed files with 24 additions and 14 deletions

View file

@ -10,7 +10,11 @@
static bool legacy_crtc_commit(struct wlr_drm_backend *drm,
struct wlr_drm_connector *conn, const struct wlr_output_state *state,
uint32_t flags) {
uint32_t flags, bool test_only) {
if (test_only) {
return true;
}
struct wlr_output *output = &conn->output;
struct wlr_drm_crtc *crtc = conn->crtc;
struct wlr_drm_plane *cursor = crtc->cursor;