mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-03-02 01:40:54 -05:00
Merge branch 'present-v3' into 'master'
presentation-time: implement support for presentation-time v3 See merge request wlroots/wlroots!5207
This commit is contained in:
commit
fcab193c03
3 changed files with 15 additions and 1 deletions
|
|
@ -2037,6 +2037,12 @@ static void handle_page_flip(int fd, unsigned seq,
|
||||||
present_flags |= WLR_OUTPUT_PRESENT_ZERO_COPY;
|
present_flags |= WLR_OUTPUT_PRESENT_ZERO_COPY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (conn->output.adaptive_sync_status == WLR_OUTPUT_ADAPTIVE_SYNC_ENABLED) {
|
||||||
|
present_flags |= WLR_OUTPUT_PRESENT_VARIABLE_RATE;
|
||||||
|
} else {
|
||||||
|
present_flags |= WLR_OUTPUT_PRESENT_FIXED_RATE;
|
||||||
|
}
|
||||||
|
|
||||||
struct wlr_output_event_present present_event = {
|
struct wlr_output_event_present present_event = {
|
||||||
/* The DRM backend guarantees that the presentation event will be for
|
/* The DRM backend guarantees that the presentation event will be for
|
||||||
* the last submitted frame. */
|
* the last submitted frame. */
|
||||||
|
|
|
||||||
|
|
@ -303,6 +303,10 @@ enum wlr_output_present_flag {
|
||||||
WLR_OUTPUT_PRESENT_HW_COMPLETION = 0x4,
|
WLR_OUTPUT_PRESENT_HW_COMPLETION = 0x4,
|
||||||
// The presentation of this update was done zero-copy.
|
// The presentation of this update was done zero-copy.
|
||||||
WLR_OUTPUT_PRESENT_ZERO_COPY = 0x8,
|
WLR_OUTPUT_PRESENT_ZERO_COPY = 0x8,
|
||||||
|
// The display hardware is operating at a fixed refresh rate.
|
||||||
|
WLR_OUTPUT_PRESENT_FIXED_RATE = 0x10,
|
||||||
|
// The display hardware is operating at a variable refresh rate.
|
||||||
|
WLR_OUTPUT_PRESENT_VARIABLE_RATE = 0x20,
|
||||||
};
|
};
|
||||||
|
|
||||||
struct wlr_output_event_present {
|
struct wlr_output_event_present {
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
#include <wlr/util/addon.h>
|
#include <wlr/util/addon.h>
|
||||||
#include "presentation-time-protocol.h"
|
#include "presentation-time-protocol.h"
|
||||||
|
|
||||||
#define PRESENTATION_VERSION 2
|
#define PRESENTATION_VERSION 3
|
||||||
|
|
||||||
struct wlr_presentation_surface_state {
|
struct wlr_presentation_surface_state {
|
||||||
struct wlr_presentation_feedback *feedback;
|
struct wlr_presentation_feedback *feedback;
|
||||||
|
|
@ -293,6 +293,10 @@ static void feedback_handle_output_present(struct wl_listener *listener,
|
||||||
event.output->adaptive_sync_status == WLR_OUTPUT_ADAPTIVE_SYNC_ENABLED) {
|
event.output->adaptive_sync_status == WLR_OUTPUT_ADAPTIVE_SYNC_ENABLED) {
|
||||||
event.refresh = 0;
|
event.refresh = 0;
|
||||||
}
|
}
|
||||||
|
if (wl_resource_get_version(resource) < 3) {
|
||||||
|
event.flags &= ~WLR_OUTPUT_PRESENT_VARIABLE_RATE;
|
||||||
|
event.flags &= ~WLR_OUTPUT_PRESENT_FIXED_RATE;
|
||||||
|
}
|
||||||
if (!feedback->zero_copy) {
|
if (!feedback->zero_copy) {
|
||||||
event.flags &= ~WP_PRESENTATION_FEEDBACK_KIND_ZERO_COPY;
|
event.flags &= ~WP_PRESENTATION_FEEDBACK_KIND_ZERO_COPY;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue