sna: Avoid randomly changing domains of active bo
After attaching the bo to the scanout, mark it as retired in order to update its domains so that the assertion during retirement later is correct. Reported-by: Clemens Eisserer <linuxhippy@gmail.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=49526 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
d5200510b8
commit
a83d90ee61
|
|
@ -342,7 +342,7 @@ kgem_busy(struct kgem *kgem, int handle)
|
|||
return busy.busy;
|
||||
}
|
||||
|
||||
static void kgem_bo_retire(struct kgem *kgem, struct kgem_bo *bo)
|
||||
void kgem_bo_retire(struct kgem *kgem, struct kgem_bo *bo)
|
||||
{
|
||||
DBG(("%s: handle=%d, domain=%d\n",
|
||||
__FUNCTION__, bo->handle, bo->domain));
|
||||
|
|
@ -359,6 +359,8 @@ static void kgem_bo_retire(struct kgem *kgem, struct kgem_bo *bo)
|
|||
list_del(&bo->request);
|
||||
bo->needs_flush = bo->flush;
|
||||
}
|
||||
|
||||
bo->domain = DOMAIN_NONE;
|
||||
}
|
||||
|
||||
Bool kgem_bo_write(struct kgem *kgem, struct kgem_bo *bo,
|
||||
|
|
@ -375,7 +377,6 @@ Bool kgem_bo_write(struct kgem *kgem, struct kgem_bo *bo,
|
|||
|
||||
DBG(("%s: flush=%d, domain=%d\n", __FUNCTION__, bo->flush, bo->domain));
|
||||
kgem_bo_retire(kgem, bo);
|
||||
bo->domain = DOMAIN_NONE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
@ -4171,7 +4172,6 @@ void kgem_buffer_read_sync(struct kgem *kgem, struct kgem_bo *_bo)
|
|||
kgem_bo_map__cpu(kgem, &bo->base);
|
||||
}
|
||||
kgem_bo_retire(kgem, &bo->base);
|
||||
bo->base.domain = DOMAIN_NONE;
|
||||
}
|
||||
|
||||
uint32_t kgem_bo_get_binding(struct kgem_bo *bo, uint32_t format)
|
||||
|
|
|
|||
|
|
@ -243,6 +243,7 @@ struct kgem_bo *kgem_create_cpu_2d(struct kgem *kgem,
|
|||
uint32_t kgem_bo_get_binding(struct kgem_bo *bo, uint32_t format);
|
||||
void kgem_bo_set_binding(struct kgem_bo *bo, uint32_t format, uint16_t offset);
|
||||
|
||||
void kgem_bo_retire(struct kgem *kgem, struct kgem_bo *bo);
|
||||
bool kgem_retire(struct kgem *kgem);
|
||||
|
||||
void _kgem_submit(struct kgem *kgem);
|
||||
|
|
|
|||
|
|
@ -495,7 +495,7 @@ sna_crtc_restore(struct sna *sna)
|
|||
return;
|
||||
}
|
||||
|
||||
bo->domain = DOMAIN_NONE;
|
||||
kgem_bo_retire(&sna->kgem, bo);
|
||||
scrn->displayWidth = bo->pitch / sna->mode.cpp;
|
||||
sna->mode.fb_pixmap = sna->front->drawable.serialNumber;
|
||||
}
|
||||
|
|
@ -659,7 +659,6 @@ sna_crtc_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
|
|||
int saved_x, saved_y;
|
||||
Rotation saved_rotation;
|
||||
DisplayModeRec saved_mode;
|
||||
int ret = TRUE;
|
||||
|
||||
DBG(("%s(rotation=%d, x=%d, y=%d, mode=%dx%d@%d)\n",
|
||||
__FUNCTION__, rotation, x, y,
|
||||
|
|
@ -690,7 +689,6 @@ sna_crtc_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
|
|||
DBG(("%s: handle %d attached to fb %d\n",
|
||||
__FUNCTION__, bo->handle, sna_mode->fb_id));
|
||||
|
||||
bo->domain = DOMAIN_NONE;
|
||||
sna_mode->fb_pixmap = sna->front->drawable.serialNumber;
|
||||
}
|
||||
|
||||
|
|
@ -797,7 +795,6 @@ sna_crtc_shadow_allocate(xf86CrtcPtr crtc, int width, int height)
|
|||
|
||||
DBG(("%s: attached handle %d to fb %d\n",
|
||||
__FUNCTION__, bo->handle, sna_crtc->shadow_fb_id));
|
||||
bo->domain = DOMAIN_NONE;
|
||||
return sna_crtc->shadow = shadow;
|
||||
}
|
||||
|
||||
|
|
@ -810,7 +807,6 @@ sna_crtc_shadow_create(xf86CrtcPtr crtc, void *data, int width, int height)
|
|||
static void
|
||||
sna_crtc_shadow_destroy(xf86CrtcPtr crtc, PixmapPtr pixmap, void *data)
|
||||
{
|
||||
struct sna *sna = to_sna(crtc->scrn);
|
||||
struct sna_crtc *sna_crtc = crtc->driver_private;
|
||||
|
||||
/* We may have not called shadow_create() on the data yet and
|
||||
|
|
@ -1727,7 +1723,8 @@ sna_crtc_resize(ScrnInfoPtr scrn, int width, int height)
|
|||
if (!sna_crtc_apply(crtc))
|
||||
goto fail;
|
||||
}
|
||||
bo->domain = DOMAIN_NONE;
|
||||
|
||||
kgem_bo_retire(&sna->kgem, bo);
|
||||
|
||||
scrn->virtualX = width;
|
||||
scrn->virtualY = height;
|
||||
|
|
@ -1859,9 +1856,7 @@ sna_page_flip(struct sna *sna,
|
|||
*/
|
||||
count = do_page_flip(sna, data, ref_crtc_hw_id);
|
||||
DBG(("%s: page flipped %d crtcs\n", __FUNCTION__, count));
|
||||
if (count)
|
||||
bo->domain = DOMAIN_NONE;
|
||||
else
|
||||
if (count == 0)
|
||||
mode->fb_id = *old_fb;
|
||||
|
||||
return count;
|
||||
|
|
|
|||
Loading…
Reference in New Issue