aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/drm/i915/intel_display.c18
-rw-r--r--drivers/gpu/drm/i915/intel_drv.h1
-rw-r--r--drivers/gpu/drm/i915/intel_fbdev.c2
3 files changed, 14 insertions, 7 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 39380f414aff..4d8a397893d1 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -2291,6 +2291,7 @@ intel_fb_align_height(struct drm_device *dev, unsigned int height,
2291int 2291int
2292intel_pin_and_fence_fb_obj(struct drm_plane *plane, 2292intel_pin_and_fence_fb_obj(struct drm_plane *plane,
2293 struct drm_framebuffer *fb, 2293 struct drm_framebuffer *fb,
2294 const struct drm_plane_state *plane_state,
2294 struct intel_engine_cs *pipelined) 2295 struct intel_engine_cs *pipelined)
2295{ 2296{
2296 struct drm_device *dev = fb->dev; 2297 struct drm_device *dev = fb->dev;
@@ -2378,8 +2379,11 @@ err_interruptible:
2378 return ret; 2379 return ret;
2379} 2380}
2380 2381
2381static void intel_unpin_fb_obj(struct drm_i915_gem_object *obj) 2382static void intel_unpin_fb_obj(struct drm_framebuffer *fb,
2383 const struct drm_plane_state *plane_state)
2382{ 2384{
2385 struct drm_i915_gem_object *obj = intel_fb_obj(fb);
2386
2383 WARN_ON(!mutex_is_locked(&obj->base.dev->struct_mutex)); 2387 WARN_ON(!mutex_is_locked(&obj->base.dev->struct_mutex));
2384 2388
2385 i915_gem_object_unpin_fence(obj); 2389 i915_gem_object_unpin_fence(obj);
@@ -9318,7 +9322,7 @@ static void intel_unpin_work_fn(struct work_struct *__work)
9318 enum pipe pipe = to_intel_crtc(work->crtc)->pipe; 9322 enum pipe pipe = to_intel_crtc(work->crtc)->pipe;
9319 9323
9320 mutex_lock(&dev->struct_mutex); 9324 mutex_lock(&dev->struct_mutex);
9321 intel_unpin_fb_obj(intel_fb_obj(work->old_fb)); 9325 intel_unpin_fb_obj(work->old_fb, work->crtc->primary->state);
9322 drm_gem_object_unreference(&work->pending_flip_obj->base); 9326 drm_gem_object_unreference(&work->pending_flip_obj->base);
9323 9327
9324 intel_fbc_update(dev); 9328 intel_fbc_update(dev);
@@ -10026,7 +10030,8 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc,
10026 ring = &dev_priv->ring[RCS]; 10030 ring = &dev_priv->ring[RCS];
10027 } 10031 }
10028 10032
10029 ret = intel_pin_and_fence_fb_obj(crtc->primary, fb, ring); 10033 ret = intel_pin_and_fence_fb_obj(crtc->primary, fb,
10034 crtc->primary->state, ring);
10030 if (ret) 10035 if (ret)
10031 goto cleanup_pending; 10036 goto cleanup_pending;
10032 10037
@@ -10066,7 +10071,7 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc,
10066 return 0; 10071 return 0;
10067 10072
10068cleanup_unpin: 10073cleanup_unpin:
10069 intel_unpin_fb_obj(obj); 10074 intel_unpin_fb_obj(fb, crtc->primary->state);
10070cleanup_pending: 10075cleanup_pending:
10071 atomic_dec(&intel_crtc->unpin_work_count); 10076 atomic_dec(&intel_crtc->unpin_work_count);
10072 mutex_unlock(&dev->struct_mutex); 10077 mutex_unlock(&dev->struct_mutex);
@@ -12022,7 +12027,7 @@ intel_prepare_plane_fb(struct drm_plane *plane,
12022 if (ret) 12027 if (ret)
12023 DRM_DEBUG_KMS("failed to attach phys object\n"); 12028 DRM_DEBUG_KMS("failed to attach phys object\n");
12024 } else { 12029 } else {
12025 ret = intel_pin_and_fence_fb_obj(plane, fb, NULL); 12030 ret = intel_pin_and_fence_fb_obj(plane, fb, new_state, NULL);
12026 } 12031 }
12027 12032
12028 if (ret == 0) 12033 if (ret == 0)
@@ -12054,7 +12059,7 @@ intel_cleanup_plane_fb(struct drm_plane *plane,
12054 if (plane->type != DRM_PLANE_TYPE_CURSOR || 12059 if (plane->type != DRM_PLANE_TYPE_CURSOR ||
12055 !INTEL_INFO(dev)->cursor_needs_physical) { 12060 !INTEL_INFO(dev)->cursor_needs_physical) {
12056 mutex_lock(&dev->struct_mutex); 12061 mutex_lock(&dev->struct_mutex);
12057 intel_unpin_fb_obj(obj); 12062 intel_unpin_fb_obj(fb, old_state);
12058 mutex_unlock(&dev->struct_mutex); 12063 mutex_unlock(&dev->struct_mutex);
12059 } 12064 }
12060} 12065}
@@ -13940,6 +13945,7 @@ void intel_modeset_gem_init(struct drm_device *dev)
13940 13945
13941 if (intel_pin_and_fence_fb_obj(c->primary, 13946 if (intel_pin_and_fence_fb_obj(c->primary,
13942 c->primary->fb, 13947 c->primary->fb,
13948 c->primary->state,
13943 NULL)) { 13949 NULL)) {
13944 DRM_ERROR("failed to pin boot fb on pipe %d\n", 13950 DRM_ERROR("failed to pin boot fb on pipe %d\n",
13945 to_intel_crtc(c)->pipe); 13951 to_intel_crtc(c)->pipe);
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index e974dd6fe25f..a0df556ad895 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -959,6 +959,7 @@ void intel_release_load_detect_pipe(struct drm_connector *connector,
959 struct intel_load_detect_pipe *old); 959 struct intel_load_detect_pipe *old);
960int intel_pin_and_fence_fb_obj(struct drm_plane *plane, 960int intel_pin_and_fence_fb_obj(struct drm_plane *plane,
961 struct drm_framebuffer *fb, 961 struct drm_framebuffer *fb,
962 const struct drm_plane_state *plane_state,
962 struct intel_engine_cs *pipelined); 963 struct intel_engine_cs *pipelined);
963struct drm_framebuffer * 964struct drm_framebuffer *
964__intel_framebuffer_create(struct drm_device *dev, 965__intel_framebuffer_create(struct drm_device *dev,
diff --git a/drivers/gpu/drm/i915/intel_fbdev.c b/drivers/gpu/drm/i915/intel_fbdev.c
index 757c0d216f80..4e7e7da2e03b 100644
--- a/drivers/gpu/drm/i915/intel_fbdev.c
+++ b/drivers/gpu/drm/i915/intel_fbdev.c
@@ -151,7 +151,7 @@ static int intelfb_alloc(struct drm_fb_helper *helper,
151 } 151 }
152 152
153 /* Flush everything out, we'll be doing GTT only from now on */ 153 /* Flush everything out, we'll be doing GTT only from now on */
154 ret = intel_pin_and_fence_fb_obj(NULL, fb, NULL); 154 ret = intel_pin_and_fence_fb_obj(NULL, fb, NULL, NULL);
155 if (ret) { 155 if (ret) {
156 DRM_ERROR("failed to pin obj: %d\n", ret); 156 DRM_ERROR("failed to pin obj: %d\n", ret);
157 goto out_fb; 157 goto out_fb;