sna/present: Cancel pending unflips when resizing the screen
Otherwise we try to flip back before we complete the mode change. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
f656f6afa2
commit
1b82b7b48d
|
|
@ -599,11 +599,13 @@ bool sna_present_open(struct sna *sna, ScreenPtr pScreen);
|
|||
void sna_present_update(struct sna *sna);
|
||||
void sna_present_close(struct sna *sna, ScreenPtr pScreen);
|
||||
void sna_present_vblank_handler(struct drm_event_vblank *event);
|
||||
void sna_present_cancel_flip(struct sna *sna);
|
||||
#else
|
||||
static inline bool sna_present_open(struct sna *sna, ScreenPtr pScreen) { return false; }
|
||||
static inline void sna_present_update(struct sna *sna) { }
|
||||
static inline void sna_present_close(struct sna *sna, ScreenPtr pScreen) { }
|
||||
static inline void sna_present_vblank_handler(struct drm_event_vblank *event) { }
|
||||
void sna_present_cancel_flip(struct sna *sna) { }
|
||||
#endif
|
||||
|
||||
extern bool sna_crtc_set_sprite_rotation(xf86CrtcPtr crtc, uint32_t rotation);
|
||||
|
|
|
|||
|
|
@ -5346,6 +5346,8 @@ sna_mode_resize(ScrnInfoPtr scrn, int width, int height)
|
|||
assert(sna->mode.shadow_damage == NULL);
|
||||
assert(sna->mode.shadow == NULL);
|
||||
|
||||
/* Cancel a pending [un]flip (as the pixmaps no longer match) */
|
||||
sna_present_cancel_flip(sna);
|
||||
copy_front(sna, sna->front, new_front);
|
||||
|
||||
screen->SetScreenPixmap(new_front);
|
||||
|
|
|
|||
|
|
@ -790,6 +790,19 @@ reset_mode:
|
|||
goto reset_mode;
|
||||
}
|
||||
|
||||
void sna_present_cancel_flip(struct sna *sna)
|
||||
{
|
||||
if (sna->present.unflip) {
|
||||
const struct ust_msc *swap;
|
||||
|
||||
swap = sna_crtc_last_swap(sna_primary_crtc(sna));
|
||||
present_event_notify(sna->present.unflip,
|
||||
swap_ust(swap), swap->msc);
|
||||
|
||||
sna->present.unflip = 0;
|
||||
}
|
||||
}
|
||||
|
||||
static present_screen_info_rec present_info = {
|
||||
.version = PRESENT_SCREEN_INFO_VERSION,
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue