ae47d61264
checked in (request 33640) OBS-URL: https://build.opensuse.org/request/show/33640 OBS-URL: https://build.opensuse.org/package/show/X11:XOrg/libdrm?expand=0&rev=41
50 lines
1.8 KiB
Diff
50 lines
1.8 KiB
Diff
From fdcde592c2c48e143251672cf2e82debb07606bd Mon Sep 17 00:00:00 2001
|
|
From: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Date: Tue, 9 Feb 2010 08:32:54 +0000
|
|
Subject: [PATCH] intel: Account for potential pinned buffers hogging fences
|
|
|
|
As the kernel reports the total number of fences, we must guess how many
|
|
fences are likely to be pinned. In the typical system these will be only
|
|
used by the scanout buffers, of which there may be one per pipe, and any
|
|
number of manually pinned fenced buffers. So take a conservative guess
|
|
and reserve two fences for use by the system.
|
|
|
|
Note this reduces the number of fences to 3 for i915 and prior.
|
|
|
|
Reference:
|
|
http://bugs.freedesktop.org/show_bug.cgi?id=25911
|
|
The latest intel driver 2.10.0 causes kernel oops and system hangs
|
|
|
|
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
---
|
|
intel/intel_bufmgr_gem.c | 13 +++++++++++++
|
|
1 files changed, 13 insertions(+), 0 deletions(-)
|
|
|
|
diff --git a/intel/intel_bufmgr_gem.c b/intel/intel_bufmgr_gem.c
|
|
index 0d011a2..66d12bc 100644
|
|
--- a/intel/intel_bufmgr_gem.c
|
|
+++ b/intel/intel_bufmgr_gem.c
|
|
@@ -1769,6 +1769,19 @@ drm_intel_bufmgr_gem_init(int fd, int batch_size)
|
|
fprintf(stderr, "param: %d, val: %d\n", gp.param,
|
|
*gp.value);
|
|
bufmgr_gem->available_fences = 0;
|
|
+ } else {
|
|
+ /* XXX The kernel reports the total number of fences,
|
|
+ * including any that may be pinned.
|
|
+ *
|
|
+ * We presume that there will be at least one pinned
|
|
+ * fence for the scanout buffer, but there may be more
|
|
+ * than one scanout and the user may be manually
|
|
+ * pinning buffers. Let's move to execbuffer2 and
|
|
+ * thereby forget the insanity of using fences...
|
|
+ */
|
|
+ bufmgr_gem->available_fences -= 2;
|
|
+ if (bufmgr_gem->available_fences < 0)
|
|
+ bufmgr_gem->available_fences = 0;
|
|
}
|
|
}
|
|
|
|
--
|
|
1.6.4.2
|
|
|