Bug 50075

Summary: [IVB regression]I-G-T/gem_linear_blits fails(*ERROR* Attempting to unbind pinned buffer)
Product: DRI Reporter: Guang Yang <guang.a.yang>
Component: DRM/IntelAssignee: Daniel Vetter <daniel>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: medium CC: ben, chris, daniel, jbarnes
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
after running gem_linear_blits dmesg info
none
dump backtrace
none
dump backtrace, fixed version
none
with patch's dmesg info
none
Error message begone. none

Description Guang Yang 2012-05-17 20:20:27 UTC
Created attachment 61775 [details]
after running gem_linear_blits dmesg info

System Environment:
--------------------------
Platform:        965GM
Kernel: (drm-intel-next-queued)659900dd3fa07b4ddffebfff07f6ee0341988943
Bug detailed description:
-------------------------
   On 965GM platform ,running gem_linear_blits of the Intel-gpu-tools will fail.
   On the console refresh this every seconds:
  *ERROR* Attempting to unbind pinned buffer
Comment 1 Daniel Vetter 2012-05-19 12:50:44 UTC
Created attachment 61863 [details] [review]
dump backtrace
Comment 2 Daniel Vetter 2012-05-19 12:52:00 UTC
Please apply this patch, reproduce the problem and then attach the dmesg with the backtrace.
Comment 3 Daniel Vetter 2012-05-19 12:56:48 UTC
Created attachment 61864 [details] [review]
dump backtrace, fixed version
Comment 4 Guang Yang 2012-05-21 02:02:59 UTC
Created attachment 61903 [details]
with patch's dmesg info

(In reply to comment #3)
> Created attachment 61864 [details] [review] [review]
> dump backtrace, fixed version
The dmesg with patch.
Comment 5 Chris Wilson 2012-05-21 02:25:17 UTC
And so the unbound patch now fixes a genuine bug :-p
Comment 6 Chris Wilson 2012-05-21 02:27:41 UTC
Or rather the patch required is:

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 402726d..54eac99 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -2040,10 +2040,8 @@ i915_gem_object_unbind(struct drm_i915_gem_object *obj)
        if (obj->gtt_space == NULL)
                return 0;
 
-       if (obj->pin_count != 0) {
-               DRM_ERROR("Attempting to unbind pinned buffer\n");
+       if (obj->pin_count != 0)
                return -EINVAL;
-       }
 
        ret = i915_gem_object_finish_gpu(obj);
        if (ret)
Comment 7 Chris Wilson 2012-05-21 02:34:12 UTC
Created attachment 61905 [details] [review]
Error message begone.
Comment 8 Daniel Vetter 2012-05-21 02:36:28 UTC
This is likely a regression introduced in

commit 1b50247a8ddde4af5aaa0e6bc125615372ce6c16
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Tue Apr 24 15:47:30 2012 +0100

    drm/i915: Remove the list of pinned inactive objects
Comment 9 Daniel Vetter 2012-05-23 02:31:19 UTC
Ping for the test result - I'd like to include this patch in a -fixes pull request at the end of this week.
Comment 10 Guang Yang 2012-05-24 02:03:45 UTC
(In reply to comment #9)
> Ping for the test result - I'd like to include this patch in a -fixes pull
> request at the end of this week.

I try patch of chris on comment 7,the issue is gone.
BTW, we try to revert the patch on comment 8 then build the kernel,but fail while compiling.
Comment 11 Daniel Vetter 2012-05-29 06:07:42 UTC
Patch from Chris merged to -fixes.

commit 31d8d651eb646498413abe5f17acc7fa2b68b2fc
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu May 24 19:11:20 2012 +0100

    drm/i915: Remove the error message for unbinding pinned buffers
Comment 12 Elizabeth 2017-10-06 14:50:05 UTC
Closing old verified.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.