diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 906663b..c72304e 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -726,7 +726,7 @@ struct drm_i915_gem_object { * * In the worst case this is 1 + 1 + 1 + 2*2 = 7. That would fit into 3 * bits with absolutely no headroom. So use 4 bits. */ - unsigned int pin_count : 4; + unsigned int pin_count : 10; #define DRM_I915_GEM_OBJECT_MAX_PIN_COUNT 0xf /** AGP memory structure for our GTT binding. */ diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 0758c78..17ba026 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -4184,7 +4184,8 @@ i915_gem_object_pin(struct drm_gem_object *obj, uint32_t alignment) struct drm_i915_gem_object *obj_priv = to_intel_bo(obj); int ret; - BUG_ON(obj_priv->pin_count == DRM_I915_GEM_OBJECT_MAX_PIN_COUNT); + WARN(obj_priv->pin_count == DRM_I915_GEM_OBJECT_MAX_PIN_COUNT, + "too many pins on %p\n", obj); i915_verify_inactive(dev, __FILE__, __LINE__); diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 5ec10e0..9609e10 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -1371,6 +1371,8 @@ intel_pin_and_fence_fb_obj(struct drm_device *dev, struct drm_gem_object *obj) BUG(); } + printk("will pin %p, pincount %u\n", obj, obj_priv->pin_count); + ret = i915_gem_object_pin(obj, alignment); if (ret != 0) return ret; @@ -1526,6 +1528,8 @@ intel_pipe_set_base(struct drm_crtc *crtc, int x, int y, obj_priv = to_intel_bo(obj); mutex_lock(&dev->struct_mutex); + WARN_ON(!mutex_is_locked(&dev->mode_config.mutex)); + printk("in set base"); ret = intel_pin_and_fence_fb_obj(dev, obj); if (ret != 0) { mutex_unlock(&dev->struct_mutex); @@ -1603,8 +1607,10 @@ intel_pipe_set_base(struct drm_crtc *crtc, int x, int y, if (old_fb) { intel_fb = to_intel_framebuffer(old_fb); obj_priv = to_intel_bo(intel_fb->obj); + printk("will unpin %p\n", intel_fb->obj); i915_gem_object_unpin(intel_fb->obj); - } + } else + WARN(1, "no obj to unpin!\n"); intel_increase_pllclock(crtc, true); mutex_unlock(&dev->struct_mutex); @@ -5061,6 +5067,7 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc, obj = intel_fb->obj; mutex_lock(&dev->struct_mutex); + printk("in page flip"); ret = intel_pin_and_fence_fb_obj(dev, obj); if (ret) goto cleanup_work; diff --git a/drivers/gpu/drm/i915/intel_fb.c b/drivers/gpu/drm/i915/intel_fb.c index 7bdc962..ef8fc1a 100644 --- a/drivers/gpu/drm/i915/intel_fb.c +++ b/drivers/gpu/drm/i915/intel_fb.c @@ -100,6 +100,8 @@ static int intelfb_create(struct intel_fbdev *ifbdev, mutex_lock(&dev->struct_mutex); + printk("fb with obj: %p\n", fbo); + ret = intel_pin_and_fence_fb_obj(dev, fbo); if (ret) { DRM_ERROR("failed to pin fb: %d\n", ret);