"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "hw/xwayland/xwayland-present.c" between
xorg-server-1.20.7.tar.bz2 and xorg-server-1.20.8.tar.bz2

About: The X.Org X Server component of the X Window System architecture.

xwayland-present.c  (xorg-server-1.20.7.tar.bz2):xwayland-present.c  (xorg-server-1.20.8.tar.bz2)
skipping to change at line 63 skipping to change at line 63
if (xwl_present_window == NULL) { if (xwl_present_window == NULL) {
xwl_present_window = calloc (1, sizeof (struct xwl_present_window)); xwl_present_window = calloc (1, sizeof (struct xwl_present_window));
if (!xwl_present_window) if (!xwl_present_window)
return NULL; return NULL;
xwl_present_window->window = window; xwl_present_window->window = window;
xwl_present_window->msc = 1; xwl_present_window->msc = 1;
xwl_present_window->ust = GetTimeInMicros(); xwl_present_window->ust = GetTimeInMicros();
xorg_list_init(&xwl_present_window->frame_callback_list);
xorg_list_init(&xwl_present_window->event_list); xorg_list_init(&xwl_present_window->event_list);
xorg_list_init(&xwl_present_window->release_queue); xorg_list_init(&xwl_present_window->release_queue);
dixSetPrivate(&window->devPrivates, dixSetPrivate(&window->devPrivates,
&xwl_present_window_private_key, &xwl_present_window_private_key,
xwl_present_window); xwl_present_window);
} }
return xwl_present_window; return xwl_present_window;
} }
skipping to change at line 99 skipping to change at line 100
return !!xwl_present_window->sync_flip || return !!xwl_present_window->sync_flip ||
!xorg_list_is_empty(&xwl_present_window->event_list); !xorg_list_is_empty(&xwl_present_window->event_list);
} }
static void static void
xwl_present_reset_timer(struct xwl_present_window *xwl_present_window) xwl_present_reset_timer(struct xwl_present_window *xwl_present_window)
{ {
if (xwl_present_has_events(xwl_present_window)) { if (xwl_present_has_events(xwl_present_window)) {
CARD32 timeout; CARD32 timeout;
if (xwl_present_window->frame_callback) if (!xorg_list_is_empty(&xwl_present_window->frame_callback_list))
timeout = TIMER_LEN_FLIP; timeout = TIMER_LEN_FLIP;
else else
timeout = TIMER_LEN_COPY; timeout = TIMER_LEN_COPY;
xwl_present_window->frame_timer = TimerSet(xwl_present_window->frame_tim er, xwl_present_window->frame_timer = TimerSet(xwl_present_window->frame_tim er,
0, timeout, 0, timeout,
&xwl_present_timer_callback, &xwl_present_timer_callback,
xwl_present_window); xwl_present_window);
} else { } else {
xwl_present_free_timer(xwl_present_window); xwl_present_free_timer(xwl_present_window);
skipping to change at line 122 skipping to change at line 123
void void
xwl_present_cleanup(WindowPtr window) xwl_present_cleanup(WindowPtr window)
{ {
struct xwl_present_window *xwl_present_window = xwl_present_window_priv(wind ow); struct xwl_present_window *xwl_present_window = xwl_present_window_priv(wind ow);
struct xwl_present_event *event, *tmp; struct xwl_present_event *event, *tmp;
if (!xwl_present_window) if (!xwl_present_window)
return; return;
if (xwl_present_window->frame_callback) { xorg_list_del(&xwl_present_window->frame_callback_list);
wl_callback_destroy(xwl_present_window->frame_callback);
xwl_present_window->frame_callback = NULL;
}
if (xwl_present_window->sync_callback) { if (xwl_present_window->sync_callback) {
wl_callback_destroy(xwl_present_window->sync_callback); wl_callback_destroy(xwl_present_window->sync_callback);
xwl_present_window->sync_callback = NULL; xwl_present_window->sync_callback = NULL;
} }
/* Clear remaining events */ /* Clear remaining events */
xorg_list_for_each_entry_safe(event, tmp, &xwl_present_window->event_list, l ist) { xorg_list_for_each_entry_safe(event, tmp, &xwl_present_window->event_list, l ist) {
xorg_list_del(&event->list); xorg_list_del(&event->list);
free(event); free(event);
skipping to change at line 247 skipping to change at line 245
} }
} }
CARD32 CARD32
xwl_present_timer_callback(OsTimerPtr timer, xwl_present_timer_callback(OsTimerPtr timer,
CARD32 time, CARD32 time,
void *arg) void *arg)
{ {
struct xwl_present_window *xwl_present_window = arg; struct xwl_present_window *xwl_present_window = arg;
xwl_present_window->frame_timer_firing = TRUE; /* If we were expecting a frame callback for this window, it didn't arrive
* in a second. Stop listening to it to avoid double-bumping the MSC
*/
xorg_list_del(&xwl_present_window->frame_callback_list);
xwl_present_msc_bump(xwl_present_window); xwl_present_msc_bump(xwl_present_window);
xwl_present_reset_timer(xwl_present_window); xwl_present_reset_timer(xwl_present_window);
return 0; return 0;
} }
static void void
xwl_present_frame_callback(void *data, xwl_present_frame_callback(struct xwl_present_window *xwl_present_window)
struct wl_callback *callback,
uint32_t time)
{ {
struct xwl_present_window *xwl_present_window = data; xorg_list_del(&xwl_present_window->frame_callback_list);
wl_callback_destroy(xwl_present_window->frame_callback);
xwl_present_window->frame_callback = NULL;
if (xwl_present_window->frame_timer_firing) {
/* If the timer is firing, this frame callback is too late */
return;
}
xwl_present_msc_bump(xwl_present_window); xwl_present_msc_bump(xwl_present_window);
/* we do not need the timer anymore for this frame, /* we do not need the timer anymore for this frame,
* reset it for potentially the next one * reset it for potentially the next one
*/ */
xwl_present_reset_timer(xwl_present_window); xwl_present_reset_timer(xwl_present_window);
} }
static const struct wl_callback_listener xwl_present_frame_listener = {
xwl_present_frame_callback
};
static void static void
xwl_present_sync_callback(void *data, xwl_present_sync_callback(void *data,
struct wl_callback *callback, struct wl_callback *callback,
uint32_t time) uint32_t time)
{ {
struct xwl_present_event *event = data; struct xwl_present_event *event = data;
struct xwl_present_window *xwl_present_window = event->xwl_present_window; struct xwl_present_window *xwl_present_window = event->xwl_present_window;
wl_callback_destroy(xwl_present_window->sync_callback); wl_callback_destroy(xwl_present_window->sync_callback);
xwl_present_window->sync_callback = NULL; xwl_present_window->sync_callback = NULL;
skipping to change at line 363 skipping to change at line 350
* Queue an event to report back to the Present extension when the specified * Queue an event to report back to the Present extension when the specified
* MSC has past * MSC has past
*/ */
static int static int
xwl_present_queue_vblank(WindowPtr present_window, xwl_present_queue_vblank(WindowPtr present_window,
RRCrtcPtr crtc, RRCrtcPtr crtc,
uint64_t event_id, uint64_t event_id,
uint64_t msc) uint64_t msc)
{ {
struct xwl_present_window *xwl_present_window = xwl_present_window_get_priv( present_window); struct xwl_present_window *xwl_present_window = xwl_present_window_get_priv( present_window);
struct xwl_window *xwl_window = xwl_window_from_window(present_window);
struct xwl_present_event *event; struct xwl_present_event *event;
event = malloc(sizeof *event); event = malloc(sizeof *event);
if (!event) if (!event)
return BadAlloc; return BadAlloc;
event->event_id = event_id; event->event_id = event_id;
event->xwl_present_window = xwl_present_window; event->xwl_present_window = xwl_present_window;
event->target_msc = msc; event->target_msc = msc;
xorg_list_append(&event->list, &xwl_present_window->event_list); xorg_list_append(&event->list, &xwl_present_window->event_list);
if (!xwl_present_window->frame_timer) /* If there's a pending frame callback, use that */
if (xwl_window && xwl_window->frame_callback &&
xorg_list_is_empty(&xwl_present_window->frame_callback_list)) {
xorg_list_add(&xwl_present_window->frame_callback_list,
&xwl_window->frame_callback_list);
}
if ((xwl_window && xwl_window->frame_callback) ||
!xwl_present_window->frame_timer)
xwl_present_reset_timer(xwl_present_window); xwl_present_reset_timer(xwl_present_window);
return Success; return Success;
} }
/* /*
* Remove a pending vblank event so that it is not reported * Remove a pending vblank event so that it is not reported
* to the extension * to the extension
*/ */
static void static void
skipping to change at line 491 skipping to change at line 487
xorg_list_add(&event->list, &xwl_present_window->release_queue); xorg_list_add(&event->list, &xwl_present_window->release_queue);
} }
if (buffer_created) if (buffer_created)
wl_buffer_add_listener(buffer, &xwl_present_release_listener, NULL); wl_buffer_add_listener(buffer, &xwl_present_release_listener, NULL);
wl_buffer_set_user_data(buffer, event); wl_buffer_set_user_data(buffer, event);
/* We can flip directly to the main surface (full screen window without clip s) */ /* We can flip directly to the main surface (full screen window without clip s) */
wl_surface_attach(xwl_window->surface, buffer, 0, 0); wl_surface_attach(xwl_window->surface, buffer, 0, 0);
if (!xwl_present_window->frame_callback) { if (!xwl_window->frame_callback)
xwl_present_window->frame_callback = wl_surface_frame(xwl_window->surfac xwl_window_create_frame_callback(xwl_window);
e);
wl_callback_add_listener(xwl_present_window->frame_callback, if (xorg_list_is_empty(&xwl_present_window->frame_callback_list)) {
&xwl_present_frame_listener, xorg_list_add(&xwl_present_window->frame_callback_list,
xwl_present_window); &xwl_window->frame_callback_list);
} }
/* Realign timer */ /* Realign timer */
xwl_present_window->frame_timer_firing = FALSE;
xwl_present_reset_timer(xwl_present_window); xwl_present_reset_timer(xwl_present_window);
wl_surface_damage(xwl_window->surface, 0, 0, wl_surface_damage(xwl_window->surface, 0, 0,
damage_box->x2 - damage_box->x1, damage_box->x2 - damage_box->x1,
damage_box->y2 - damage_box->y1); damage_box->y2 - damage_box->y1);
wl_surface_commit(xwl_window->surface); wl_surface_commit(xwl_window->surface);
if (!sync_flip) { if (!sync_flip) {
xwl_present_window->sync_callback = xwl_present_window->sync_callback =
skipping to change at line 531 skipping to change at line 527
static void static void
xwl_present_flips_stop(WindowPtr window) xwl_present_flips_stop(WindowPtr window)
{ {
struct xwl_present_window *xwl_present_window = xwl_present_window_priv(wi ndow); struct xwl_present_window *xwl_present_window = xwl_present_window_priv(wi ndow);
/* Change back to the fast refresh rate */ /* Change back to the fast refresh rate */
xwl_present_reset_timer(xwl_present_window); xwl_present_reset_timer(xwl_present_window);
} }
void void
xwl_present_unrealize_window(WindowPtr window) xwl_present_unrealize_window(struct xwl_present_window *xwl_present_window)
{ {
struct xwl_present_window *xwl_present_window = xwl_present_window_priv(wind
ow);
if (!xwl_present_window || !xwl_present_window->frame_callback)
return;
/* The pending frame callback may never be called, so drop it and shorten /* The pending frame callback may never be called, so drop it and shorten
* the frame timer interval. * the frame timer interval.
*/ */
wl_callback_destroy(xwl_present_window->frame_callback); xorg_list_del(&xwl_present_window->frame_callback_list);
xwl_present_window->frame_callback = NULL;
xwl_present_reset_timer(xwl_present_window); xwl_present_reset_timer(xwl_present_window);
} }
static present_wnmd_info_rec xwl_present_info = { static present_wnmd_info_rec xwl_present_info = {
.version = PRESENT_SCREEN_INFO_VERSION, .version = PRESENT_SCREEN_INFO_VERSION,
.get_crtc = xwl_present_get_crtc, .get_crtc = xwl_present_get_crtc,
.get_ust_msc = xwl_present_get_ust_msc, .get_ust_msc = xwl_present_get_ust_msc,
.queue_vblank = xwl_present_queue_vblank, .queue_vblank = xwl_present_queue_vblank,
.abort_vblank = xwl_present_abort_vblank, .abort_vblank = xwl_present_abort_vblank,
 End of changes. 14 change blocks. 
40 lines changed or deleted 28 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)