sna: Handle old busy_ioctl not reporting the active ring

If we have an old kernel, just presume that the bo was last active on the
render ring.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2014-06-23 11:25:47 +01:00
parent 30348efd57
commit 60fd6764eb
2 changed files with 8 additions and 4 deletions

View File

@ -6439,7 +6439,7 @@ fixup_flip:
if (drmIoctl(sna->kgem.fd, DRM_IOCTL_I915_GEM_BUSY, &busy) == 0) {
if (busy.busy) {
int mode = KGEM_RENDER;
if ((busy.busy & (1 << 16)) == 0)
if (busy.busy & (0xfffe << 16))
mode = KGEM_BLT;
DBG(("%s: marking flip bo as busy [%x -> mode=%d]\n", __FUNCTION__, busy.busy, mode));
kgem_bo_mark_busy(&sna->kgem, flip_bo, mode);

View File

@ -778,13 +778,17 @@ static void sna_dri2_select_mode(struct sna *sna, struct kgem_bo *dst, struct kg
if (drmIoctl(sna->kgem.fd, DRM_IOCTL_I915_GEM_BUSY, &busy))
return;
DBG(("%s: src busy?=%x\n", __FUNCTION__, busy.busy));
DBG(("%s: src handle=%d busy?=%x\n", __FUNCTION__, busy.handle, busy.busy));
if (busy.busy == 0) {
__kgem_bo_clear_busy(src);
busy.handle = dst->handle;
if (drmIoctl(sna->kgem.fd, DRM_IOCTL_I915_GEM_BUSY, &busy))
return;
DBG(("%s: dst busy?=%x\n", __FUNCTION__, busy.busy));
DBG(("%s: dst handle=%d busy?=%x\n", __FUNCTION__, busy.handle, busy.busy));
if (busy.busy == 0) {
__kgem_bo_clear_busy(dst);
DBG(("%s: src/dst is idle, using defaults\n", __FUNCTION__));
return;
}
@ -806,7 +810,7 @@ static void sna_dri2_select_mode(struct sna *sna, struct kgem_bo *dst, struct kg
* the cost of the query.
*/
mode = KGEM_RENDER;
if ((busy.busy & (1 << 16)) == 0)
if (busy.busy & (0xfffe << 16))
mode = KGEM_BLT;
kgem_bo_mark_busy(&sna->kgem, busy.handle == src->handle ? src : dst, mode);
_kgem_set_mode(&sna->kgem, mode);