[Intel-gfx] [PATCH]drm_i915: remove unnecessary object pin for mode set

Shaohua Li shaohua.li at intel.com
Fri May 15 04:49:33 CEST 2009


I get this log when using xrandr set display resolution in kms:
[   52.795810] [drm:i915_gem_object_unbind] *ERROR* Attempting to unbind pinned buffer
[   52.795824] ------------[ cut here ]------------
[   52.795829] WARNING: at /workshop/kernel/git/my/linux/drivers/gpu/drm/i915/i915_gem_tiling.c:320 i915_gem_set_tiling+0x3a9/0x412()
[   52.795836] Hardware name: Calistoga & ICH7M Chipset
[   52.795840] failed to unbind object for tiling switchModules linked in:
[   52.795851] Pid: 1991, comm: X Not tainted 2.6.30-rc5 #318
[   52.795855] Call Trace:
[   52.795868]  [<c02475f8>] warn_slowpath_fmt+0x77/0xa6
[   52.795879]  [<c0617e60>] ? _spin_unlock_irqrestore+0x1c/0x31
[   52.795887]  [<c0247b9a>] ? release_console_sem+0x180/0x1ad
[   52.795894]  [<c0248078>] ? vprintk+0x2ab/0x2e0
[   52.795905]  [<c0292f64>] ? __generic_file_aio_write_nolock+0x3d4/0x40c
[   52.795913]  [<c0615650>] ? printk+0x14/0x16
[   52.795922]  [<c043fbbf>] ? i915_gem_object_unbind+0x43/0x200
[   52.795931]  [<c0443e1f>] i915_gem_set_tiling+0x3a9/0x412
[   52.795940]  [<c042cd43>] drm_ioctl+0x215/0x29b
[   52.795947]  [<c0443a76>] ? i915_gem_set_tiling+0x0/0x412
[   52.795957]  [<c02fffb7>] ? ext3_file_write+0x1f/0x90
[   52.795966]  [<c02b738a>] ? do_sync_write+0xb0/0xee
[   52.795976]  [<c02c2744>] vfs_ioctl+0x55/0x6e
[   52.795985]  [<c02c2bf3>] do_vfs_ioctl+0x496/0x4cf
[   52.795993]  [<c02b7cee>] ? vfs_write+0xf5/0x109
[   52.796002]  [<c02c2c5d>] sys_ioctl+0x31/0x4a
[   52.796011]  [<c021de70>] sysenter_do_call+0x12/0x22
[   52.796017] ---[ end trace 8cb90508f72e0a4d ]---

dri_bo_unreference() try to free the front buffer and will set the tiling
to NONE, but the bo is pined in intel_pipe_set_base(), so the warning is
reported. It appears the bo isn't required to be pinned in intel_pipe_set_base(),
as either 2d driver or intel fb will pin the front buffer, and the pin
will confuse 2d driver.

Signed-off-by: Shaohua Li <shaohua.li at intel.com>

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index bdcda36..dcac5a5 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -698,12 +698,6 @@ intel_pipe_set_base(struct drm_crtc *crtc, int x, int y,
 	}
 
 	mutex_lock(&dev->struct_mutex);
-	ret = i915_gem_object_pin(intel_fb->obj, alignment);
-	if (ret != 0) {
-		mutex_unlock(&dev->struct_mutex);
-		return ret;
-	}
-
 	ret = i915_gem_object_set_to_gtt_domain(intel_fb->obj, 1);
 	if (ret != 0) {
 		i915_gem_object_unpin(intel_fb->obj);
@@ -760,11 +754,6 @@ intel_pipe_set_base(struct drm_crtc *crtc, int x, int y,
 	}
 
 	intel_wait_for_vblank(dev);
-
-	if (old_fb) {
-		intel_fb = to_intel_framebuffer(old_fb);
-		i915_gem_object_unpin(intel_fb->obj);
-	}
 	mutex_unlock(&dev->struct_mutex);
 
 	if (!dev->primary->master)



More information about the Intel-gfx mailing list