xf86-video-intel: 3 commits - src/sna/kgem.c src/sna/sna_display.c src/sna/sna_dri.c
Chris Wilson
ickle at kemper.freedesktop.org
Sun Jan 6 09:26:25 PST 2013
src/sna/kgem.c | 14 +++++++++-----
src/sna/sna_display.c | 9 +++++++++
src/sna/sna_dri.c | 6 +++++-
3 files changed, 23 insertions(+), 6 deletions(-)
New commits:
commit 27550e81482229007fa9e0e9769fdd20f3616b23
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Sun Jan 6 17:29:19 2013 +0000
sna/dri: Transfer the DRI2 reference to the new TearFree pixmap
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=58814
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
diff --git a/src/sna/sna_dri.c b/src/sna/sna_dri.c
index b5ae051..f4058cc 100644
--- a/src/sna/sna_dri.c
+++ b/src/sna/sna_dri.c
@@ -225,8 +225,12 @@ sna_dri_pixmap_update_bo(struct sna *sna, PixmapPtr pixmap)
assert(private->pixmap == pixmap);
bo = sna_pixmap(pixmap)->gpu_bo;
+ if (private->bo == bo)
+ return;
+
+ kgem_bo_destroy(&sna->kgem, private->bo);
buffer->name = kgem_bo_flink(&sna->kgem, bo);
- private->bo = bo;
+ private->bo = ref(bo);
/* XXX DRI2InvalidateDrawable(&pixmap->drawable); */
}
commit 1a5e4fb725da2eb25cf7f476290c02e9880a4efc
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Sun Jan 6 17:08:56 2013 +0000
sna: Only disable upon a failed pageflip after at least one pipe flips
If we have yet to update a pipe for a pageflip, then the state remains
consistent and we can fallback to a blit without disabling any pipes. If
we fail after flipping a pipe, then unless we disable an output the
state becomes inconsistent (the pipes disagree on what the attached fb
is).
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index c66bb47..4ff4d8f 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -2539,6 +2539,12 @@ static int do_page_flip(struct sna *sna, struct kgem_bo *bo,
DBG(("%s: flip [fb=%d] on crtc %d [%d] failed - %d\n",
__FUNCTION__, arg.fb_id, i, crtc->id, errno));
disable:
+ if (count == 0)
+ return 0;
+
+ xf86DrvMsg(sna->scrn->scrnIndex, X_ERROR,
+ "%s: page flipping failed, disabling CRTC:%d (pipe=%d)\n",
+ __FUNCTION__, crtc->id, crtc->pipe);
sna_crtc_disable(config->crtc[i]);
continue;
}
@@ -3288,6 +3294,9 @@ void sna_mode_redisplay(struct sna *sna)
DBG(("%s: flip [fb=%d] on crtc %d [%d, pipe=%d] failed - %d\n",
__FUNCTION__, arg.fb_id, i, crtc->id, crtc->pipe, errno));
disable:
+ xf86DrvMsg(sna->scrn->scrnIndex, X_ERROR,
+ "%s: page flipping failed, disabling CRTC:%d (pipe=%d)\n",
+ __FUNCTION__, crtc->id, crtc->pipe);
sna_crtc_disable(config->crtc[i]);
continue;
}
commit dd66ba8e5666a1ce7da0ddc226d074f591e1fa22
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Sun Jan 6 16:13:56 2013 +0000
sna: Try to create userptr with the unsync'ed flag set first
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index e3da032..26581ad 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -125,7 +125,8 @@ struct local_i915_gem_userptr {
uint64_t user_ptr;
uint32_t user_size;
uint32_t flags;
-#define I915_USERPTR_READ_ONLY 0x1
+#define I915_USERPTR_READ_ONLY (1<<0)
+#define I915_USERPTR_UNSYNCHRONIZED (1<<31)
uint32_t handle;
};
@@ -230,14 +231,17 @@ static uint32_t gem_userptr(int fd, void *ptr, int size, int read_only)
VG_CLEAR(arg);
arg.user_ptr = (uintptr_t)ptr;
arg.user_size = size;
- arg.flags = 0;
+ arg.flags = I915_USERPTR_UNSYNCHRONIZED;
if (read_only)
arg.flags |= I915_USERPTR_READ_ONLY;
if (drmIoctl(fd, LOCAL_IOCTL_I915_GEM_USERPTR, &arg)) {
- DBG(("%s: failed to map %p + %d bytes: %d\n",
- __FUNCTION__, ptr, size, errno));
- return 0;
+ arg.flags &= ~I915_USERPTR_UNSYNCHRONIZED;
+ if (drmIoctl(fd, LOCAL_IOCTL_I915_GEM_USERPTR, &arg)) {
+ DBG(("%s: failed to map %p + %d bytes: %d\n",
+ __FUNCTION__, ptr, size, errno));
+ return 0;
+ }
}
return arg.handle;
More information about the xorg-commit
mailing list