sna: Add a few more DBG and assertions around Present/TearFree interactions
References: https://bugs.freedesktop.org/show_bug.cgi?id=91467#c12 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
50f3e9c41c
commit
7e5e006be4
|
|
@ -17405,11 +17405,14 @@ static bool has_offload_slaves(struct sna *sna)
|
|||
|
||||
static bool has_shadow(struct sna *sna)
|
||||
{
|
||||
DamagePtr damage = sna->mode.shadow_damage;
|
||||
DamagePtr damage;
|
||||
|
||||
if (damage == NULL)
|
||||
if (!sna->mode.shadow_enabled)
|
||||
return false;
|
||||
|
||||
damage = sna->mode.shadow_damage;
|
||||
assert(damage);
|
||||
|
||||
DBG(("%s: has pending damage? %d, outstanding flips: %d\n",
|
||||
__FUNCTION__,
|
||||
RegionNotEmpty(DamageRegion(damage)),
|
||||
|
|
|
|||
|
|
@ -1281,6 +1281,7 @@ static bool wait_for_shadow(struct sna *sna,
|
|||
}
|
||||
|
||||
assert(sna->mode.shadow_active);
|
||||
assert(sna->mode.shadow_enabled);
|
||||
sna->mode.shadow_enabled = false;
|
||||
|
||||
flip_active = sna->mode.flip_active;
|
||||
|
|
|
|||
|
|
@ -681,9 +681,10 @@ cleanup:
|
|||
|
||||
static bool has_shadow(struct sna *sna)
|
||||
{
|
||||
if (!sna->mode.shadow_damage)
|
||||
if (!sna->mode.shadow_enabled)
|
||||
return false;
|
||||
|
||||
assert(sna->mode.shadow_damage);
|
||||
if (RegionNil(DamageRegion(sna->mode.shadow_damage)))
|
||||
return false;
|
||||
|
||||
|
|
|
|||
|
|
@ -689,8 +689,11 @@ sna_present_flip(RRCrtcPtr crtc,
|
|||
|
||||
assert(sna->present.unflip == 0);
|
||||
|
||||
if (sna->flags & SNA_TEAR_FREE)
|
||||
if (sna->flags & SNA_TEAR_FREE) {
|
||||
DBG(("%s: disabling TearFree (was %s) in favour of Present flips\n",
|
||||
__FUNCTION__, sna->mode.shadow_enabled ? "enabled" : "disabled"));
|
||||
sna->mode.shadow_enabled = false;
|
||||
}
|
||||
assert(!sna->mode.shadow_enabled);
|
||||
|
||||
if (sna->mode.flip_active) {
|
||||
|
|
@ -739,8 +742,12 @@ notify:
|
|||
return;
|
||||
}
|
||||
|
||||
if (sna->flags & SNA_TEAR_FREE)
|
||||
assert(!sna->mode.shadow_enabled);
|
||||
if (sna->flags & SNA_TEAR_FREE) {
|
||||
DBG(("%s: %s TearFree after Present flips\n",
|
||||
__FUNCTION__, sna->mode.shadow_damage != NULL ? "enabling" : "disabling"));
|
||||
sna->mode.shadow_enabled = sna->mode.shadow_damage != NULL;
|
||||
}
|
||||
|
||||
bo = get_flip_bo(screen->GetScreenPixmap(screen));
|
||||
if (bo == NULL) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue