Hello Eugeni Dodonov,
The patch a416edefbbaf: "drm/i915: add support for SBI ops" from May
9, 2012, leads to the following warning:
drivers/gpu/drm/i915/intel_display.c:1347 intel_sbi_write()
warn: bitwise AND condition is false here
SBI_READY is defined like this:
#define SBI_READY (0x0<<0)
1346 spin_lock_irqsave(&dev_priv->dpio_lock, flags);
1347 if (wait_for((I915_READ(SBI_CTL_STAT) & SBI_READY) == 0,
if ((x & 0)…
[View More] == 0) { ...
This is always true, so this condition will never timeout.
1348 100)) {
1349 DRM_ERROR("timeout waiting for SBI to become ready\n");
1350 goto out_unlock;
1351 }
All the places that use SBI_READY are like this:
drivers/gpu/drm/i915/intel_display.c:1347 intel_sbi_write() warn: bitwise AND condition is false here
drivers/gpu/drm/i915/intel_display.c:1361 intel_sbi_write() warn: bitwise AND condition is false here
drivers/gpu/drm/i915/intel_display.c:1378 intel_sbi_read() warn: bitwise AND condition is false here
drivers/gpu/drm/i915/intel_display.c:1390 intel_sbi_read() warn: bitwise AND condition is false here
regards,
dan carpenter
[View Less]
Hey Erik,
Op 07-06-12 19:35, Erik Gilling schreef:
> On Thu, Jun 7, 2012 at 1:55 AM, Maarten Lankhorst
> <m.b.lankhorst(a)gmail.com> wrote:
>> I haven't looked at intel and amd, but from a quick glance
>> it seems like they already implement fencing too, so just
>> some way to synch up the fences on shared buffers seems
>> like it could benefit all graphics drivers and the whole
>> userspace synching could be done away with entirely.
> It's …
[View More]important to have some level of userspace API so that GPU
> generated graphics can participate in the graphics pipeline. Think of
> the case where you have a software video codec streaming textures into
> the GPU. It needs to know when the GPU is done with those textures so
> it can reuse the buffer.
>
In the graphics case this problem already has to be handled without
dma-buf, so adding any extra synchronization api for userspace
that is only used when the bo is shared is a waste.
I do agree you need some way to synch userspace though, but I
think adding a new api for userspace is not the way to go.
Cheers,
Maarten
PS: re-added cc's that seem to have fallen off from your mail.
[View Less]
int drm_intel_gem_bo_wait(drm_intel_bo *bo, uint64_t timeout_ns)
This should bump the libdrm version. We're waiting for context support
so we can do both features in one bump.
v2: don't return remaining timeout amount
use get param and fallback for older kernels
v3: only doing getparam at init
prototypes now have a signed input value
v4: update comments
fall back to correct polling behavior with new userspace and old kernel
v5: since the drmIoctl patch was not well received, return …
[View More]appropriate
values in this function instead. As Daniel pointed out, the polling
case (timeout == 0) should also return -ETIME.
Cc: Eric Anholt <eric(a)anholt.net>
Cc: Daniel Vetter <daniel.vetter(a)ffwll.ch>
Signed-off-by: Ben Widawsky <ben(a)bwidawsk.net>
---
intel/intel_bufmgr.h | 1 +
intel/intel_bufmgr_gem.c | 57 ++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 58 insertions(+)
diff --git a/intel/intel_bufmgr.h b/intel/intel_bufmgr.h
index c197abc..fa6c4dd 100644
--- a/intel/intel_bufmgr.h
+++ b/intel/intel_bufmgr.h
@@ -184,6 +184,7 @@ int drm_intel_get_pipe_from_crtc_id(drm_intel_bufmgr *bufmgr, int crtc_id);
int drm_intel_get_aperture_sizes(int fd, size_t *mappable, size_t *total);
int drm_intel_bufmgr_gem_get_devid(drm_intel_bufmgr *bufmgr);
+int drm_intel_gem_bo_wait(drm_intel_bo *bo, int64_t timeout_ns);
/* drm_intel_bufmgr_fake.c */
drm_intel_bufmgr *drm_intel_bufmgr_fake_init(int fd,
diff --git a/intel/intel_bufmgr_gem.c b/intel/intel_bufmgr_gem.c
index b776d2f..e90f8bd 100644
--- a/intel/intel_bufmgr_gem.c
+++ b/intel/intel_bufmgr_gem.c
@@ -119,6 +119,7 @@ typedef struct _drm_intel_bufmgr_gem {
unsigned int has_blt : 1;
unsigned int has_relaxed_fencing : 1;
unsigned int has_llc : 1;
+ unsigned int has_wait_timeout : 1;
unsigned int bo_reuse : 1;
unsigned int no_exec : 1;
bool fenced_relocs;
@@ -1479,6 +1480,58 @@ drm_intel_gem_bo_wait_rendering(drm_intel_bo *bo)
}
/**
+ * Waits on a BO for the given amount of time.
+ *
+ * @bo: buffer object to wait for
+ * @timeout_ns: amount of time to wait in nanoseconds.
+ * If value is less than 0, an infinite wait will occur.
+ *
+ * Returns 0 if the wait was successful ie. the last batch referencing the
+ * object has completed within the allotted time. Otherwise some negative return
+ * value describes the error. Of particular interest is -ETIME when the wait has
+ * failed to yield the desired result.
+ *
+ * Similar to drm_intel_gem_bo_wait_rendering except a timeout parameter allows
+ * the operation to give up after a certain amount of time. Another subtle
+ * difference is the internal locking semantics are different (this variant does
+ * not hold the lock for the duration of the wait). This makes the wait subject
+ * to a larger userspace race window.
+ *
+ * The implementation shall wait until the object is no longer actively
+ * referenced within a batch buffer at the time of the call. The wait will
+ * not guarantee that the buffer is re-issued via another thread, or an flinked
+ * handle. Userspace must make sure this race does not occur if such precision
+ * is important.
+ */
+int drm_intel_gem_bo_wait(drm_intel_bo *bo, int64_t timeout_ns)
+{
+ drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *) bo->bufmgr;
+ drm_intel_bo_gem *bo_gem = (drm_intel_bo_gem *) bo;
+ struct drm_i915_gem_wait wait;
+ int ret;
+
+ if (!bufmgr_gem->has_wait_timeout) {
+ DBG("%s:%d: Timed wait is not supported. Falling back to "
+ "infinite wait\n", __FILE__, __LINE__);
+ if (timeout_ns) {
+ drm_intel_gem_bo_wait_rendering(bo);
+ return 0;
+ } else {
+ return drm_intel_gem_bo_busy(bo) ? -ETIME : 0;
+ }
+ }
+
+ wait.bo_handle = bo_gem->gem_handle;
+ wait.timeout_ns = timeout_ns;
+ wait.flags = 0;
+ ret = drmIoctl(bufmgr_gem->fd, DRM_IOCTL_I915_GEM_WAIT, &wait);
+ if (ret == -1)
+ return -errno;
+
+ return ret;
+}
+
+/**
* Sets the object to the GTT read and possibly write domain, used by the X
* 2D driver in the absence of kernel support to do drm_intel_gem_bo_map_gtt().
*
@@ -2898,6 +2951,10 @@ drm_intel_bufmgr_gem_init(int fd, int batch_size)
ret = drmIoctl(bufmgr_gem->fd, DRM_IOCTL_I915_GETPARAM, &gp);
bufmgr_gem->has_relaxed_fencing = ret == 0;
+ gp.param = I915_PARAM_HAS_WAIT_TIMEOUT;
+ ret = drmIoctl(bufmgr_gem->fd, DRM_IOCTL_I915_GETPARAM, &gp);
+ bufmgr_gem->has_wait_timeout = ret == 0;
+
gp.param = I915_PARAM_HAS_LLC;
ret = drmIoctl(bufmgr_gem->fd, DRM_IOCTL_I915_GETPARAM, &gp);
if (ret != 0) {
--
1.7.10.3
[View Less]
https://bugs.freedesktop.org/show_bug.cgi?id=42683
Bug #: 42683
Summary: [r300g] GPU lockup while playing WoW
Classification: Unclassified
Product: Mesa
Version: git
Platform: x86 (IA32)
OS/Version: Linux (All)
Status: NEW
Severity: normal
Priority: medium
Component: Drivers/Gallium/r300
AssignedTo: dri-devel(a)lists.freedesktop.org
ReportedBy: rankincj(a)googlemail.com
…
[View More]
Created attachment 53271
--> https://bugs.freedesktop.org/attachment.cgi?id=53271
dmesg log from GPU lockup
I'm not sure whether this is a new problem or just a particularly bad side
effect of bug #41698, but WoW has now begun locking up after just a few moments
of gameplay. I'm sure it wasn't as bad as this yesterday though.
The latest commit in git is:
commit dceb202297b39220fbbcb41267077fb3ff8d137a
Author: Kenneth Graunke <kenneth(a)whitecape.org>
Date: Mon Nov 7 12:07:44 2011 -0800
i965: Fix Sandybridge regression introduced by workaround-free math.
And I'm fairly sure it was working yesterday with:
commit 2318443ebd6bf9727676b530a3b057dcf13a3ca6
Author: Dave Airlie <airlied(a)redhat.com>
Date: Sun Nov 6 19:38:50 2011 +0000
gl3.txt: update for ARB_texture_storage.
There is something seriously wrong with r300g.
--
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
[View Less]
Hi everyone,
Since upgrading to 3.5-rc1 (I believe) I find the following warnings
in my dmesg:
[ 116.591654] [drm] capturing error event; look for more information in /debug/dri/0/i915_error_state
[ 116.592888] i915: render error detected, EIR: 0x00000010
[ 116.592890] i915: IPEIR: 0x00000000
[ 116.592891] i915: IPEHR: 0x05000000
[ 116.592893] i915: INSTDONE: 0xfffffffe
[ 116.592894] i915: INSTPS: 0x0001e000
[ 116.592895] i915: INSTDONE1: 0xffffffff
[ 116.592897] i915: …
[View More]ACTHD: 0x000051f8
[ 116.592898] i915: page table error
[ 116.592899] i915: PGTBL_ER: 0x00000001
[ 116.592902] [drm:i915_report_and_clear_eir] *ERROR* EIR stuck: 0x00000010, masking
I attach the compresed /debug/dri/0/i915_error_state output.
Anything else I can provide?
Best wishes
Norbert
------------------------------------------------------------------------
Norbert Preining preining(a){jaist.ac.jp, logic.at, debian.org}
JAIST, Japan TeX Live & Debian Developer
DSA: 0x09C5B094 fp: 14DF 2E6C 0307 BE6D AD76 A9C0 D2BF 4AA3 09C5 B094
------------------------------------------------------------------------
As he came into the light they could see his black and
gold uniform on which the buttons were so highly polished
that they shone with an intensity that would have made an
approaching motorist flash his lights in annoyance.
--- Douglas Adams, The Hitchhikers Guide to the Galaxy
[View Less]
Tejun/Jerome (and radeon devs):
I'd like to bring a suspend/resume radeon bug full circle (see:
http://thread.gmane.org/gmane.linux.kernel/1209587 for complete thread and
Tejun's excellent summary below).
The problem was triggered by new input serio driver code (commit
8ee294cd9def000 found through bisection). Don't ask me why, but that set it
off.
In a nutshell, X would intermittently lock up across suspend/resume cycles.
The issue remained at least through 3.1.5. I skipped 3.2.x …
[View More]altogether to
kernel 3.3.4 and confirm the problem seems to be gone.
What might have happened in the radeon codebase since 3.1.x that would have
addressed this either intentionally or as a side-effect? Maybe 721604a15b934f
or 9fc04b503df9a3?
Thanks.
~ Andy
----- Forwarded message from Tejun Heo <tj(a)kernel.org> -----
Date: Fri, 4 Nov 2011 09:14:31 -0700
From: Tejun Heo <tj(a)kernel.org>
Subject: Re: [REGRESSION]: hibernate/sleep regression w/ bisection
To: Andrew Watts <akwatts(a)ymail.com>
Cc: Dmitry Torokhov <dmitry.torokhov(a)gmail.com>, linux-kernel(a)vger.kernel.org,
linux-pm(a)lists.linux-foundation.org, David Airlie <airlied(a)linux.ie>,
dri-devel(a)lists.freedesktop.org
(cc'ing David Airlie and dri-devel)
Hello, the original thread can be read from
http://thread.gmane.org/gmane.linux.kernel/1209587
Full sysrq-t output at
http://article.gmane.org/gmane.linux.kernel/1211256
So, the problem is that after a seemingly unreated update to input
serio driver (convert to use workqueue), X seems to lock up
sporadically across suspend/resume cycles.
I went through the full sysrq-t output but couldn't spot anything
suspicious w/ anything else. No worker is stuck and nobody is waiting
for flush to finish.
Stack trace for X follows.
> X S f499b944 5800 1652 1651 0x00400080
> f499b9a8 00003086 00000000 f499b944 c100d4a4 00000000 00000000 f499b958
> 00000000 f499b9a8 f5173140 d7857c56 00000057 f5173140 d8b69880 00000057
> 00000001 00000000 f499b9b4 c104dd89 000f4240 00000000 00000000 f499ba68
> Call Trace:
> [<c1291301>] ttm_bo_wait_unreserved+0x5f/0x106
> [<c129145f>] ttm_bo_reserve_locked+0xb7/0xe1
> [<c1292c27>] ttm_bo_reserve+0x26/0x95
> [<c12c3c97>] radeon_crtc_do_set_base+0xbd/0x6d2
> [<c12c42e7>] radeon_crtc_set_base+0x1b/0x1d
> [<c12c430d>] radeon_crtc_mode_set+0x24/0xdd7
> [<c1279c57>] drm_crtc_helper_set_mode+0x32c/0x48b
> [<c1279e2f>] drm_helper_resume_force_mode+0x79/0x23e
> [<c12ace10>] radeon_gpu_reset+0x84/0x98
> [<c12c0838>] radeon_fence_wait+0x2d1/0x311
> [<c12c0e37>] radeon_sync_obj_wait+0xc/0xe
> [<c12908be>] ttm_bo_wait+0xa1/0x108
> [<c12d6e7b>] radeon_gem_wait_idle_ioctl+0x76/0xc4
> [<c127e62e>] drm_ioctl+0x1c2/0x42c
> [<c10e288e>] do_vfs_ioctl+0x79/0x54b
> [<c10e2dcb>] sys_ioctl+0x6b/0x70
> [<c1593813>] sysenter_do_call+0x12/0x22
Do you guys have any ideas what's going on? It seems to be waiting
for bo->reserved to go zero. Is it possible that someone there is
forgetting to properly kick a work item after resume causing the wait
to stall?
Andrew, can you please kill the X server after the hang and see
whether that brings the system back? I think sshd should still work
and if not you can write a script to kill the X server after 30secs
after resume (and kill that script if resume succeeds).
Thank you.
--
tejun
----- End forwarded message -----
[View Less]
Hi,
I have here a "Wortmann AG terra Pad 1051", which has a GMA500-like
device (PCI ID 8086:4102). Using Linux 3.1.x (openSUSE 12.1's default),
loading psb_gfx.ko crashed the machine. I therefore tried Linux 3.4.0,
where this crash does not occur thankfully.
According to your commit b7cdd9e6323af368e26121c5b791eddc78e79fea,
GMA500 is now available through the DRM tree. I take it you mean
kernel/drivers/gpu/drm/gma500/gma500_gfx.ko by that. However,
gma500_gfx.ko does not provide support …
[View More]for 8086:4102, i.e. modinfo does
not show the alias.
So, am I correct in the assumption that the 4102 code never really
worked, and deletion of psb_gfx was therefore ok without having 4102
support in gma500_gfx?
thanks,
Jan
[View Less]