xf86-video-intel: 4 commits - src/sna/kgem.c src/sna/sna_dri2.c
Chris Wilson
ickle at kemper.freedesktop.org
Fri Jun 27 00:05:31 PDT 2014
src/sna/kgem.c | 68 ++++++++++++++++++++++++++++-------------------------
src/sna/sna_dri2.c | 7 +++--
2 files changed, 41 insertions(+), 34 deletions(-)
New commits:
commit 157e22cb8e96b0a9ffa7d58625fe2396f6084ff9
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Thu Jun 26 20:19:52 2014 +0100
sna: Only reuse pinned batches for 830/845
Trying to fly too close to the sun. :(
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80558
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index 6556d12..898f943 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -3102,29 +3102,33 @@ out_16384:
}
}
- if (kgem->gen == 020 && !kgem->has_pinned_batches) {
- assert(size <= 16384);
+ if (kgem->gen == 020) {
+ bo = kgem_create_linear(kgem, size, CREATE_CACHED | CREATE_TEMPORARY);
+ if (bo)
+ return bo;
- bo = list_first_entry(&kgem->pinned_batches[size > 4096],
- struct kgem_bo,
- list);
- list_move_tail(&bo->list, &kgem->pinned_batches[size > 4096]);
+ if (size < 16384) {
+ bo = list_first_entry(&kgem->pinned_batches[size > 4096],
+ struct kgem_bo,
+ list);
+ list_move_tail(&bo->list, &kgem->pinned_batches[size > 4096]);
- DBG(("%s: syncing due to busy batches\n", __FUNCTION__));
+ DBG(("%s: syncing due to busy batches\n", __FUNCTION__));
- VG_CLEAR(set_domain);
- set_domain.handle = bo->handle;
- set_domain.read_domains = I915_GEM_DOMAIN_GTT;
- set_domain.write_domain = I915_GEM_DOMAIN_GTT;
- if (do_ioctl(kgem->fd, DRM_IOCTL_I915_GEM_SET_DOMAIN, &set_domain)) {
- DBG(("%s: sync: GPU hang detected\n", __FUNCTION__));
- kgem_throttle(kgem);
- return NULL;
- }
+ VG_CLEAR(set_domain);
+ set_domain.handle = bo->handle;
+ set_domain.read_domains = I915_GEM_DOMAIN_GTT;
+ set_domain.write_domain = I915_GEM_DOMAIN_GTT;
+ if (do_ioctl(kgem->fd, DRM_IOCTL_I915_GEM_SET_DOMAIN, &set_domain)) {
+ DBG(("%s: sync: GPU hang detected\n", __FUNCTION__));
+ kgem_throttle(kgem);
+ return NULL;
+ }
- kgem_retire(kgem);
- assert(bo->rq == NULL);
- return kgem_bo_reference(bo);
+ kgem_retire(kgem);
+ assert(bo->rq == NULL);
+ return kgem_bo_reference(bo);
+ }
}
return kgem_create_linear(kgem, size, CREATE_NO_THROTTLE);
commit f027b4f628b6d0f4c00f8aba7b27dcf51f91211d
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Thu Jun 26 20:24:05 2014 +0100
sna/dri2: Slightly improved DBG messages
Missing git add from
commit 2e8c09f3fe468abba9c307ba3d7b2d22908e1172
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Wed Jun 25 22:19:23 2014 +0100
sna/dri2: Hook into ClientGone callback to clear dangling references
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
diff --git a/src/sna/sna_dri2.c b/src/sna/sna_dri2.c
index f24086a..c6327ee 100644
--- a/src/sna/sna_dri2.c
+++ b/src/sna/sna_dri2.c
@@ -1199,8 +1199,8 @@ sna_dri2_remove_event(WindowPtr win, struct sna_dri2_event *info)
struct sna_dri2_event *chain;
assert(win->drawable.type == DRAWABLE_WINDOW);
- DBG(("%s: remove[%p] from window %ld)\n",
- __FUNCTION__, info, (long)win->drawable.id));
+ DBG(("%s: remove[%p] from window %ld, active? %d\n",
+ __FUNCTION__, info, (long)win->drawable.id, info->darw != NULL));
priv = dri2_window(win);
assert(priv);
@@ -1267,7 +1267,8 @@ sna_dri2_client_gone(CallbackListPtr *list, void *closure, void *data)
if (client->clientState != ClientStateGone)
return;
- DBG(("%s()\n", __FUNCTION__));
+ DBG(("%s(active?=%d)\n", __FUNCTION__
+ !list_is_empty(&priv->events)));
while (!list_is_empty(&priv->events)) {
struct sna_dri2_event *event;
commit 2ae5d7d9415a77c76078bc340066df73dce72d27
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Thu Jun 26 20:21:12 2014 +0100
sna: Tidy selection of a near-miss active buffer.
References: https://bugs.freedesktop.org/show_bug.cgi?id=80560
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index db7e46f..6556d12 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -4840,7 +4840,7 @@ search_active:
}
if (kgem->gen >= 040) {
- for (i = I915_TILING_NONE; i <= I915_TILING_Y; i++) {
+ for (i = I915_TILING_Y; i >= I915_TILING_NONE; i--) {
cache = &kgem->active[bucket][i];
list_for_each_entry(bo, cache, list) {
assert(!bo->purged);
@@ -4853,10 +4853,13 @@ search_active:
if (num_pages(bo) < size)
continue;
- if (!gem_set_tiling(kgem->fd,
- bo->handle,
- tiling, pitch))
- continue;
+ if (bo->tiling != tiling ||
+ (tiling != I915_TILING_NONE && bo->pitch != pitch)) {
+ if (!gem_set_tiling(kgem->fd,
+ bo->handle,
+ tiling, pitch))
+ continue;
+ }
kgem_bo_remove_from_active(kgem, bo);
@@ -4872,11 +4875,8 @@ search_active:
return bo;
}
}
- }
-
- if (!exact) { /* allow an active near-miss? */
- i = tiling;
- while (--i >= 0) {
+ } else if (!exact) { /* allow an active near-miss? */
+ for (i = tiling; i >= I915_TILING_NONE; i--) {
tiled_height = kgem_surface_size(kgem, kgem->has_relaxed_fencing, flags,
width, height, bpp, tiling, &pitch);
cache = active(kgem, tiled_height / PAGE_SIZE, i);
@@ -7091,6 +7091,8 @@ kgem_replace_bo(struct kgem *kgem,
dst->pitch = pitch;
dst->unique_id = kgem_get_unique_id(kgem);
dst->refcnt = 1;
+ assert(dst->tiling == I915_TILING_NONE);
+ assert(kgem_bo_can_blt(kgem, dst));
kgem_set_mode(kgem, KGEM_BLT, dst);
if (!kgem_check_batch(kgem, 10) ||
commit 8cad98eca64224534887efbcd1c60604cd491c35
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Thu Jun 26 12:42:30 2014 +0100
sna: Fix userptr defines to match i915_drm.h
Now that we are starting to see userptr in the headers, we see that the
definitions slightly changed.
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index 8ce12f7..db7e46f 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -159,8 +159,8 @@ struct local_i915_gem_userptr {
uint64_t user_ptr;
uint64_t user_size;
uint32_t flags;
-#define I915_USERPTR_READ_ONLY (1<<0)
-#define I915_USERPTR_UNSYNCHRONIZED (1<<31)
+#define I915_USERPTR_READ_ONLY 0x1
+#define I915_USERPTR_UNSYNCHRONIZED 0x80000000
uint32_t handle;
};
More information about the xorg-commit
mailing list