|
|
@ -1,5 +1,6 @@
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
#include <wlr/render/drm_syncobj.h>
|
|
|
|
#include <wlr/util/log.h>
|
|
|
|
#include <wlr/util/log.h>
|
|
|
|
#include "types/wlr_output.h"
|
|
|
|
#include "types/wlr_output.h"
|
|
|
|
|
|
|
|
|
|
|
@ -16,6 +17,8 @@ void wlr_output_state_finish(struct wlr_output_state *state) {
|
|
|
|
state->buffer = NULL;
|
|
|
|
state->buffer = NULL;
|
|
|
|
pixman_region32_fini(&state->damage);
|
|
|
|
pixman_region32_fini(&state->damage);
|
|
|
|
free(state->gamma_lut);
|
|
|
|
free(state->gamma_lut);
|
|
|
|
|
|
|
|
wlr_drm_syncobj_timeline_unref(state->wait_timeline);
|
|
|
|
|
|
|
|
wlr_drm_syncobj_timeline_unref(state->signal_timeline);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void wlr_output_state_set_enabled(struct wlr_output_state *state,
|
|
|
|
void wlr_output_state_set_enabled(struct wlr_output_state *state,
|
|
|
@ -114,16 +117,36 @@ void wlr_output_state_set_layers(struct wlr_output_state *state,
|
|
|
|
state->layers_len = layers_len;
|
|
|
|
state->layers_len = layers_len;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void wlr_output_state_set_wait_timeline(struct wlr_output_state *state,
|
|
|
|
|
|
|
|
struct wlr_drm_syncobj_timeline *timeline, uint64_t src_point) {
|
|
|
|
|
|
|
|
state->committed |= WLR_OUTPUT_STATE_WAIT_TIMELINE;
|
|
|
|
|
|
|
|
wlr_drm_syncobj_timeline_unref(state->wait_timeline);
|
|
|
|
|
|
|
|
state->wait_timeline = wlr_drm_syncobj_timeline_ref(timeline);
|
|
|
|
|
|
|
|
state->wait_point = src_point;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void wlr_output_state_set_signal_timeline(struct wlr_output_state *state,
|
|
|
|
|
|
|
|
struct wlr_drm_syncobj_timeline *timeline, uint64_t dst_point) {
|
|
|
|
|
|
|
|
state->committed |= WLR_OUTPUT_STATE_SIGNAL_TIMELINE;
|
|
|
|
|
|
|
|
wlr_drm_syncobj_timeline_unref(state->signal_timeline);
|
|
|
|
|
|
|
|
state->signal_timeline = wlr_drm_syncobj_timeline_ref(timeline);
|
|
|
|
|
|
|
|
state->signal_point = dst_point;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool wlr_output_state_copy(struct wlr_output_state *dst,
|
|
|
|
bool wlr_output_state_copy(struct wlr_output_state *dst,
|
|
|
|
const struct wlr_output_state *src) {
|
|
|
|
const struct wlr_output_state *src) {
|
|
|
|
struct wlr_output_state copy = *src;
|
|
|
|
struct wlr_output_state copy = *src;
|
|
|
|
copy.committed &= ~(WLR_OUTPUT_STATE_BUFFER |
|
|
|
|
copy.committed &= ~(WLR_OUTPUT_STATE_BUFFER |
|
|
|
|
WLR_OUTPUT_STATE_DAMAGE |
|
|
|
|
WLR_OUTPUT_STATE_DAMAGE |
|
|
|
|
WLR_OUTPUT_STATE_GAMMA_LUT);
|
|
|
|
WLR_OUTPUT_STATE_GAMMA_LUT |
|
|
|
|
|
|
|
|
WLR_OUTPUT_STATE_WAIT_TIMELINE |
|
|
|
|
|
|
|
|
WLR_OUTPUT_STATE_SIGNAL_TIMELINE);
|
|
|
|
copy.buffer = NULL;
|
|
|
|
copy.buffer = NULL;
|
|
|
|
pixman_region32_init(©.damage);
|
|
|
|
pixman_region32_init(©.damage);
|
|
|
|
copy.gamma_lut = NULL;
|
|
|
|
copy.gamma_lut = NULL;
|
|
|
|
copy.gamma_lut_size = 0;
|
|
|
|
copy.gamma_lut_size = 0;
|
|
|
|
|
|
|
|
copy.wait_timeline = NULL;
|
|
|
|
|
|
|
|
copy.signal_timeline = NULL;
|
|
|
|
|
|
|
|
|
|
|
|
if (src->committed & WLR_OUTPUT_STATE_BUFFER) {
|
|
|
|
if (src->committed & WLR_OUTPUT_STATE_BUFFER) {
|
|
|
|
wlr_output_state_set_buffer(©, src->buffer);
|
|
|
|
wlr_output_state_set_buffer(©, src->buffer);
|
|
|
@ -142,6 +165,15 @@ bool wlr_output_state_copy(struct wlr_output_state *dst,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (src->committed & WLR_OUTPUT_STATE_WAIT_TIMELINE) {
|
|
|
|
|
|
|
|
wlr_output_state_set_wait_timeline(©, src->wait_timeline,
|
|
|
|
|
|
|
|
src->wait_point);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (src->committed & WLR_OUTPUT_STATE_SIGNAL_TIMELINE) {
|
|
|
|
|
|
|
|
wlr_output_state_set_signal_timeline(©, src->signal_timeline,
|
|
|
|
|
|
|
|
src->signal_point);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
wlr_output_state_finish(dst);
|
|
|
|
wlr_output_state_finish(dst);
|
|
|
|
*dst = copy;
|
|
|
|
*dst = copy;
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|