mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-12-16 08:56:26 -05:00
backend/drm: take wlr_output_state as arg in crtc_commit
Stop assuming that the state to be applied is in output->pending in crtc_commit. This will allow us to remove ephemeral fields in wlr_drm_crtc, which are used scratch fields to stash temporary per-commit data.
This commit is contained in:
parent
69d4cf19b5
commit
8f90d7f8f5
4 changed files with 20 additions and 17 deletions
|
|
@ -164,7 +164,8 @@ error:
|
|||
}
|
||||
|
||||
static bool atomic_crtc_commit(struct wlr_drm_backend *drm,
|
||||
struct wlr_drm_connector *conn, uint32_t flags) {
|
||||
struct wlr_drm_connector *conn, const struct wlr_output_state *state,
|
||||
uint32_t flags) {
|
||||
struct wlr_output *output = &conn->output;
|
||||
struct wlr_drm_crtc *crtc = conn->crtc;
|
||||
|
||||
|
|
@ -176,19 +177,19 @@ static bool atomic_crtc_commit(struct wlr_drm_backend *drm,
|
|||
}
|
||||
|
||||
uint32_t gamma_lut = crtc->gamma_lut;
|
||||
if (output->pending.committed & WLR_OUTPUT_STATE_GAMMA_LUT) {
|
||||
if (state->committed & WLR_OUTPUT_STATE_GAMMA_LUT) {
|
||||
// Fallback to legacy gamma interface when gamma properties are not
|
||||
// available (can happen on older Intel GPUs that support gamma but not
|
||||
// degamma).
|
||||
if (crtc->props.gamma_lut == 0) {
|
||||
if (!drm_legacy_crtc_set_gamma(drm, crtc,
|
||||
output->pending.gamma_lut_size,
|
||||
output->pending.gamma_lut)) {
|
||||
state->gamma_lut_size,
|
||||
state->gamma_lut)) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
if (!create_gamma_lut_blob(drm, output->pending.gamma_lut_size,
|
||||
output->pending.gamma_lut, &gamma_lut)) {
|
||||
if (!create_gamma_lut_blob(drm, state->gamma_lut_size,
|
||||
state->gamma_lut, &gamma_lut)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
@ -197,9 +198,9 @@ static bool atomic_crtc_commit(struct wlr_drm_backend *drm,
|
|||
bool prev_vrr_enabled =
|
||||
output->adaptive_sync_status == WLR_OUTPUT_ADAPTIVE_SYNC_ENABLED;
|
||||
bool vrr_enabled = prev_vrr_enabled;
|
||||
if ((output->pending.committed & WLR_OUTPUT_STATE_ADAPTIVE_SYNC_ENABLED) &&
|
||||
if ((state->committed & WLR_OUTPUT_STATE_ADAPTIVE_SYNC_ENABLED) &&
|
||||
drm_connector_supports_vrr(conn)) {
|
||||
vrr_enabled = output->pending.adaptive_sync_enabled;
|
||||
vrr_enabled = state->adaptive_sync_enabled;
|
||||
}
|
||||
|
||||
if (crtc->pending_modeset) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue