aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/i915')
-rw-r--r--drivers/gpu/drm/i915/intel_crt.c5
-rw-r--r--drivers/gpu/drm/i915/intel_display.c56
-rw-r--r--drivers/gpu/drm/i915/intel_dp.c14
-rw-r--r--drivers/gpu/drm/i915/intel_drv.h6
-rw-r--r--drivers/gpu/drm/i915/intel_opregion.c4
-rw-r--r--drivers/gpu/drm/i915/intel_overlay.c4
-rw-r--r--drivers/gpu/drm/i915/intel_panel.c8
-rw-r--r--drivers/gpu/drm/i915/intel_sprite.c2
-rw-r--r--drivers/gpu/drm/i915/intel_tv.c5
9 files changed, 63 insertions, 41 deletions
diff --git a/drivers/gpu/drm/i915/intel_crt.c b/drivers/gpu/drm/i915/intel_crt.c
index 1fc91df58296..5a045d3bd77e 100644
--- a/drivers/gpu/drm/i915/intel_crt.c
+++ b/drivers/gpu/drm/i915/intel_crt.c
@@ -630,6 +630,7 @@ intel_crt_detect(struct drm_connector *connector, bool force)
630 enum intel_display_power_domain power_domain; 630 enum intel_display_power_domain power_domain;
631 enum drm_connector_status status; 631 enum drm_connector_status status;
632 struct intel_load_detect_pipe tmp; 632 struct intel_load_detect_pipe tmp;
633 struct drm_modeset_acquire_ctx ctx;
633 634
634 intel_runtime_pm_get(dev_priv); 635 intel_runtime_pm_get(dev_priv);
635 636
@@ -673,12 +674,12 @@ intel_crt_detect(struct drm_connector *connector, bool force)
673 } 674 }
674 675
675 /* for pre-945g platforms use load detect */ 676 /* for pre-945g platforms use load detect */
676 if (intel_get_load_detect_pipe(connector, NULL, &tmp)) { 677 if (intel_get_load_detect_pipe(connector, NULL, &tmp, &ctx)) {
677 if (intel_crt_detect_ddc(connector)) 678 if (intel_crt_detect_ddc(connector))
678 status = connector_status_connected; 679 status = connector_status_connected;
679 else 680 else
680 status = intel_crt_load_detect(crt); 681 status = intel_crt_load_detect(crt);
681 intel_release_load_detect_pipe(connector, &tmp); 682 intel_release_load_detect_pipe(connector, &tmp, &ctx);
682 } else 683 } else
683 status = connector_status_unknown; 684 status = connector_status_unknown;
684 685
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index c2976ade823f..1ce4ad4626e4 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -2576,7 +2576,7 @@ void intel_display_handle_reset(struct drm_device *dev)
2576 for_each_crtc(dev, crtc) { 2576 for_each_crtc(dev, crtc) {
2577 struct intel_crtc *intel_crtc = to_intel_crtc(crtc); 2577 struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
2578 2578
2579 mutex_lock(&crtc->mutex); 2579 drm_modeset_lock(&crtc->mutex, NULL);
2580 /* 2580 /*
2581 * FIXME: Once we have proper support for primary planes (and 2581 * FIXME: Once we have proper support for primary planes (and
2582 * disabling them without disabling the entire crtc) allow again 2582 * disabling them without disabling the entire crtc) allow again
@@ -2587,7 +2587,7 @@ void intel_display_handle_reset(struct drm_device *dev)
2587 crtc->primary->fb, 2587 crtc->primary->fb,
2588 crtc->x, 2588 crtc->x,
2589 crtc->y); 2589 crtc->y);
2590 mutex_unlock(&crtc->mutex); 2590 drm_modeset_unlock(&crtc->mutex);
2591 } 2591 }
2592} 2592}
2593 2593
@@ -8307,7 +8307,8 @@ mode_fits_in_fbdev(struct drm_device *dev,
8307 8307
8308bool intel_get_load_detect_pipe(struct drm_connector *connector, 8308bool intel_get_load_detect_pipe(struct drm_connector *connector,
8309 struct drm_display_mode *mode, 8309 struct drm_display_mode *mode,
8310 struct intel_load_detect_pipe *old) 8310 struct intel_load_detect_pipe *old,
8311 struct drm_modeset_acquire_ctx *ctx)
8311{ 8312{
8312 struct intel_crtc *intel_crtc; 8313 struct intel_crtc *intel_crtc;
8313 struct intel_encoder *intel_encoder = 8314 struct intel_encoder *intel_encoder =
@@ -8317,13 +8318,19 @@ bool intel_get_load_detect_pipe(struct drm_connector *connector,
8317 struct drm_crtc *crtc = NULL; 8318 struct drm_crtc *crtc = NULL;
8318 struct drm_device *dev = encoder->dev; 8319 struct drm_device *dev = encoder->dev;
8319 struct drm_framebuffer *fb; 8320 struct drm_framebuffer *fb;
8320 int i = -1; 8321 struct drm_mode_config *config = &dev->mode_config;
8322 int ret, i = -1;
8321 8323
8322 DRM_DEBUG_KMS("[CONNECTOR:%d:%s], [ENCODER:%d:%s]\n", 8324 DRM_DEBUG_KMS("[CONNECTOR:%d:%s], [ENCODER:%d:%s]\n",
8323 connector->base.id, connector->name, 8325 connector->base.id, connector->name,
8324 encoder->base.id, encoder->name); 8326 encoder->base.id, encoder->name);
8325 8327
8326 mutex_lock(&dev->mode_config.connection_mutex); 8328 drm_modeset_acquire_init(ctx, 0);
8329
8330retry:
8331 ret = drm_modeset_lock(&config->connection_mutex, ctx);
8332 if (ret)
8333 goto fail_unlock;
8327 8334
8328 /* 8335 /*
8329 * Algorithm gets a little messy: 8336 * Algorithm gets a little messy:
@@ -8339,7 +8346,9 @@ bool intel_get_load_detect_pipe(struct drm_connector *connector,
8339 if (encoder->crtc) { 8346 if (encoder->crtc) {
8340 crtc = encoder->crtc; 8347 crtc = encoder->crtc;
8341 8348
8342 mutex_lock(&crtc->mutex); 8349 ret = drm_modeset_lock(&crtc->mutex, ctx);
8350 if (ret)
8351 goto fail_unlock;
8343 8352
8344 old->dpms_mode = connector->dpms; 8353 old->dpms_mode = connector->dpms;
8345 old->load_detect_temp = false; 8354 old->load_detect_temp = false;
@@ -8367,10 +8376,12 @@ bool intel_get_load_detect_pipe(struct drm_connector *connector,
8367 */ 8376 */
8368 if (!crtc) { 8377 if (!crtc) {
8369 DRM_DEBUG_KMS("no pipe available for load-detect\n"); 8378 DRM_DEBUG_KMS("no pipe available for load-detect\n");
8370 goto fail_unlock_connector; 8379 goto fail_unlock;
8371 } 8380 }
8372 8381
8373 mutex_lock(&crtc->mutex); 8382 ret = drm_modeset_lock(&crtc->mutex, ctx);
8383 if (ret)
8384 goto fail_unlock;
8374 intel_encoder->new_crtc = to_intel_crtc(crtc); 8385 intel_encoder->new_crtc = to_intel_crtc(crtc);
8375 to_intel_connector(connector)->new_encoder = intel_encoder; 8386 to_intel_connector(connector)->new_encoder = intel_encoder;
8376 8387
@@ -8420,15 +8431,21 @@ bool intel_get_load_detect_pipe(struct drm_connector *connector,
8420 intel_crtc->new_config = &intel_crtc->config; 8431 intel_crtc->new_config = &intel_crtc->config;
8421 else 8432 else
8422 intel_crtc->new_config = NULL; 8433 intel_crtc->new_config = NULL;
8423 mutex_unlock(&crtc->mutex); 8434fail_unlock:
8424fail_unlock_connector: 8435 if (ret == -EDEADLK) {
8425 mutex_unlock(&dev->mode_config.connection_mutex); 8436 drm_modeset_backoff(ctx);
8437 goto retry;
8438 }
8439
8440 drm_modeset_drop_locks(ctx);
8441 drm_modeset_acquire_fini(ctx);
8426 8442
8427 return false; 8443 return false;
8428} 8444}
8429 8445
8430void intel_release_load_detect_pipe(struct drm_connector *connector, 8446void intel_release_load_detect_pipe(struct drm_connector *connector,
8431 struct intel_load_detect_pipe *old) 8447 struct intel_load_detect_pipe *old,
8448 struct drm_modeset_acquire_ctx *ctx)
8432{ 8449{
8433 struct intel_encoder *intel_encoder = 8450 struct intel_encoder *intel_encoder =
8434 intel_attached_encoder(connector); 8451 intel_attached_encoder(connector);
@@ -8452,8 +8469,7 @@ void intel_release_load_detect_pipe(struct drm_connector *connector,
8452 drm_framebuffer_unreference(old->release_fb); 8469 drm_framebuffer_unreference(old->release_fb);
8453 } 8470 }
8454 8471
8455 mutex_unlock(&crtc->mutex); 8472 goto unlock;
8456 mutex_unlock(&connector->dev->mode_config.connection_mutex);
8457 return; 8473 return;
8458 } 8474 }
8459 8475
@@ -8461,8 +8477,9 @@ void intel_release_load_detect_pipe(struct drm_connector *connector,
8461 if (old->dpms_mode != DRM_MODE_DPMS_ON) 8477 if (old->dpms_mode != DRM_MODE_DPMS_ON)
8462 connector->funcs->dpms(connector, old->dpms_mode); 8478 connector->funcs->dpms(connector, old->dpms_mode);
8463 8479
8464 mutex_unlock(&crtc->mutex); 8480unlock:
8465 mutex_unlock(&connector->dev->mode_config.connection_mutex); 8481 drm_modeset_drop_locks(ctx);
8482 drm_modeset_acquire_fini(ctx);
8466} 8483}
8467 8484
8468static int i9xx_pll_refclk(struct drm_device *dev, 8485static int i9xx_pll_refclk(struct drm_device *dev,
@@ -10995,7 +11012,7 @@ enum pipe intel_get_pipe_from_connector(struct intel_connector *connector)
10995 struct drm_encoder *encoder = connector->base.encoder; 11012 struct drm_encoder *encoder = connector->base.encoder;
10996 struct drm_device *dev = connector->base.dev; 11013 struct drm_device *dev = connector->base.dev;
10997 11014
10998 WARN_ON(!mutex_is_locked(&dev->mode_config.connection_mutex)); 11015 WARN_ON(!drm_modeset_is_locked(&dev->mode_config.connection_mutex));
10999 11016
11000 if (!encoder) 11017 if (!encoder)
11001 return INVALID_PIPE; 11018 return INVALID_PIPE;
@@ -11805,6 +11822,7 @@ static void intel_enable_pipe_a(struct drm_device *dev)
11805 struct intel_connector *connector; 11822 struct intel_connector *connector;
11806 struct drm_connector *crt = NULL; 11823 struct drm_connector *crt = NULL;
11807 struct intel_load_detect_pipe load_detect_temp; 11824 struct intel_load_detect_pipe load_detect_temp;
11825 struct drm_modeset_acquire_ctx ctx;
11808 11826
11809 /* We can't just switch on the pipe A, we need to set things up with a 11827 /* We can't just switch on the pipe A, we need to set things up with a
11810 * proper mode and output configuration. As a gross hack, enable pipe A 11828 * proper mode and output configuration. As a gross hack, enable pipe A
@@ -11821,8 +11839,8 @@ static void intel_enable_pipe_a(struct drm_device *dev)
11821 if (!crt) 11839 if (!crt)
11822 return; 11840 return;
11823 11841
11824 if (intel_get_load_detect_pipe(crt, NULL, &load_detect_temp)) 11842 if (intel_get_load_detect_pipe(crt, NULL, &load_detect_temp, &ctx))
11825 intel_release_load_detect_pipe(crt, &load_detect_temp); 11843 intel_release_load_detect_pipe(crt, &load_detect_temp, &ctx);
11826 11844
11827 11845
11828} 11846}
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index d01bb430b5bc..2d5d9b010073 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -1154,7 +1154,7 @@ static void edp_panel_vdd_off_sync(struct intel_dp *intel_dp)
1154 u32 pp; 1154 u32 pp;
1155 u32 pp_stat_reg, pp_ctrl_reg; 1155 u32 pp_stat_reg, pp_ctrl_reg;
1156 1156
1157 WARN_ON(!mutex_is_locked(&dev->mode_config.connection_mutex)); 1157 WARN_ON(!drm_modeset_is_locked(&dev->mode_config.connection_mutex));
1158 1158
1159 if (!intel_dp->want_panel_vdd && edp_have_panel_vdd(intel_dp)) { 1159 if (!intel_dp->want_panel_vdd && edp_have_panel_vdd(intel_dp)) {
1160 struct intel_digital_port *intel_dig_port = 1160 struct intel_digital_port *intel_dig_port =
@@ -1191,9 +1191,9 @@ static void edp_panel_vdd_work(struct work_struct *__work)
1191 struct intel_dp, panel_vdd_work); 1191 struct intel_dp, panel_vdd_work);
1192 struct drm_device *dev = intel_dp_to_dev(intel_dp); 1192 struct drm_device *dev = intel_dp_to_dev(intel_dp);
1193 1193
1194 mutex_lock(&dev->mode_config.connection_mutex); 1194 drm_modeset_lock(&dev->mode_config.connection_mutex, NULL);
1195 edp_panel_vdd_off_sync(intel_dp); 1195 edp_panel_vdd_off_sync(intel_dp);
1196 mutex_unlock(&dev->mode_config.connection_mutex); 1196 drm_modeset_unlock(&dev->mode_config.connection_mutex);
1197} 1197}
1198 1198
1199static void edp_panel_vdd_off(struct intel_dp *intel_dp, bool sync) 1199static void edp_panel_vdd_off(struct intel_dp *intel_dp, bool sync)
@@ -3666,9 +3666,9 @@ void intel_dp_encoder_destroy(struct drm_encoder *encoder)
3666 drm_encoder_cleanup(encoder); 3666 drm_encoder_cleanup(encoder);
3667 if (is_edp(intel_dp)) { 3667 if (is_edp(intel_dp)) {
3668 cancel_delayed_work_sync(&intel_dp->panel_vdd_work); 3668 cancel_delayed_work_sync(&intel_dp->panel_vdd_work);
3669 mutex_lock(&dev->mode_config.connection_mutex); 3669 drm_modeset_lock(&dev->mode_config.connection_mutex, NULL);
3670 edp_panel_vdd_off_sync(intel_dp); 3670 edp_panel_vdd_off_sync(intel_dp);
3671 mutex_unlock(&dev->mode_config.connection_mutex); 3671 drm_modeset_unlock(&dev->mode_config.connection_mutex);
3672 } 3672 }
3673 kfree(intel_dig_port); 3673 kfree(intel_dig_port);
3674} 3674}
@@ -4247,9 +4247,9 @@ intel_dp_init_connector(struct intel_digital_port *intel_dig_port,
4247 drm_dp_aux_unregister(&intel_dp->aux); 4247 drm_dp_aux_unregister(&intel_dp->aux);
4248 if (is_edp(intel_dp)) { 4248 if (is_edp(intel_dp)) {
4249 cancel_delayed_work_sync(&intel_dp->panel_vdd_work); 4249 cancel_delayed_work_sync(&intel_dp->panel_vdd_work);
4250 mutex_lock(&dev->mode_config.connection_mutex); 4250 drm_modeset_lock(&dev->mode_config.connection_mutex, NULL);
4251 edp_panel_vdd_off_sync(intel_dp); 4251 edp_panel_vdd_off_sync(intel_dp);
4252 mutex_unlock(&dev->mode_config.connection_mutex); 4252 drm_modeset_unlock(&dev->mode_config.connection_mutex);
4253 } 4253 }
4254 drm_sysfs_connector_remove(connector); 4254 drm_sysfs_connector_remove(connector);
4255 drm_connector_cleanup(connector); 4255 drm_connector_cleanup(connector);
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index f1d5897c96cd..0de04983501e 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -748,9 +748,11 @@ void vlv_wait_port_ready(struct drm_i915_private *dev_priv,
748 struct intel_digital_port *dport); 748 struct intel_digital_port *dport);
749bool intel_get_load_detect_pipe(struct drm_connector *connector, 749bool intel_get_load_detect_pipe(struct drm_connector *connector,
750 struct drm_display_mode *mode, 750 struct drm_display_mode *mode,
751 struct intel_load_detect_pipe *old); 751 struct intel_load_detect_pipe *old,
752 struct drm_modeset_acquire_ctx *ctx);
752void intel_release_load_detect_pipe(struct drm_connector *connector, 753void intel_release_load_detect_pipe(struct drm_connector *connector,
753 struct intel_load_detect_pipe *old); 754 struct intel_load_detect_pipe *old,
755 struct drm_modeset_acquire_ctx *ctx);
754int intel_pin_and_fence_fb_obj(struct drm_device *dev, 756int intel_pin_and_fence_fb_obj(struct drm_device *dev,
755 struct drm_i915_gem_object *obj, 757 struct drm_i915_gem_object *obj,
756 struct intel_engine_cs *pipelined); 758 struct intel_engine_cs *pipelined);
diff --git a/drivers/gpu/drm/i915/intel_opregion.c b/drivers/gpu/drm/i915/intel_opregion.c
index b812e9d39f38..2e2c71fcc9ed 100644
--- a/drivers/gpu/drm/i915/intel_opregion.c
+++ b/drivers/gpu/drm/i915/intel_opregion.c
@@ -410,7 +410,7 @@ static u32 asle_set_backlight(struct drm_device *dev, u32 bclp)
410 if (bclp > 255) 410 if (bclp > 255)
411 return ASLC_BACKLIGHT_FAILED; 411 return ASLC_BACKLIGHT_FAILED;
412 412
413 mutex_lock(&dev->mode_config.connection_mutex); 413 drm_modeset_lock(&dev->mode_config.connection_mutex, NULL);
414 414
415 /* 415 /*
416 * Update backlight on all connectors that support backlight (usually 416 * Update backlight on all connectors that support backlight (usually
@@ -421,7 +421,7 @@ static u32 asle_set_backlight(struct drm_device *dev, u32 bclp)
421 intel_panel_set_backlight(intel_connector, bclp, 255); 421 intel_panel_set_backlight(intel_connector, bclp, 255);
422 iowrite32(DIV_ROUND_UP(bclp * 100, 255) | ASLE_CBLV_VALID, &asle->cblv); 422 iowrite32(DIV_ROUND_UP(bclp * 100, 255) | ASLE_CBLV_VALID, &asle->cblv);
423 423
424 mutex_unlock(&dev->mode_config.connection_mutex); 424 drm_modeset_unlock(&dev->mode_config.connection_mutex);
425 425
426 426
427 return 0; 427 return 0;
diff --git a/drivers/gpu/drm/i915/intel_overlay.c b/drivers/gpu/drm/i915/intel_overlay.c
index e97ea33e0117..0396d1312b5c 100644
--- a/drivers/gpu/drm/i915/intel_overlay.c
+++ b/drivers/gpu/drm/i915/intel_overlay.c
@@ -688,7 +688,7 @@ static int intel_overlay_do_put_image(struct intel_overlay *overlay,
688 u32 swidth, swidthsw, sheight, ostride; 688 u32 swidth, swidthsw, sheight, ostride;
689 689
690 BUG_ON(!mutex_is_locked(&dev->struct_mutex)); 690 BUG_ON(!mutex_is_locked(&dev->struct_mutex));
691 BUG_ON(!mutex_is_locked(&dev->mode_config.connection_mutex)); 691 BUG_ON(!drm_modeset_is_locked(&dev->mode_config.connection_mutex));
692 BUG_ON(!overlay); 692 BUG_ON(!overlay);
693 693
694 ret = intel_overlay_release_old_vid(overlay); 694 ret = intel_overlay_release_old_vid(overlay);
@@ -793,7 +793,7 @@ int intel_overlay_switch_off(struct intel_overlay *overlay)
793 int ret; 793 int ret;
794 794
795 BUG_ON(!mutex_is_locked(&dev->struct_mutex)); 795 BUG_ON(!mutex_is_locked(&dev->struct_mutex));
796 BUG_ON(!mutex_is_locked(&dev->mode_config.connection_mutex)); 796 BUG_ON(!drm_modeset_is_locked(&dev->mode_config.connection_mutex));
797 797
798 ret = intel_overlay_recover_from_interrupt(overlay); 798 ret = intel_overlay_recover_from_interrupt(overlay);
799 if (ret != 0) 799 if (ret != 0)
diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c
index d4d415665475..2e1338a5d488 100644
--- a/drivers/gpu/drm/i915/intel_panel.c
+++ b/drivers/gpu/drm/i915/intel_panel.c
@@ -876,12 +876,12 @@ static int intel_backlight_device_update_status(struct backlight_device *bd)
876 struct intel_connector *connector = bl_get_data(bd); 876 struct intel_connector *connector = bl_get_data(bd);
877 struct drm_device *dev = connector->base.dev; 877 struct drm_device *dev = connector->base.dev;
878 878
879 mutex_lock(&dev->mode_config.connection_mutex); 879 drm_modeset_lock(&dev->mode_config.connection_mutex, NULL);
880 DRM_DEBUG_KMS("updating intel_backlight, brightness=%d/%d\n", 880 DRM_DEBUG_KMS("updating intel_backlight, brightness=%d/%d\n",
881 bd->props.brightness, bd->props.max_brightness); 881 bd->props.brightness, bd->props.max_brightness);
882 intel_panel_set_backlight(connector, bd->props.brightness, 882 intel_panel_set_backlight(connector, bd->props.brightness,
883 bd->props.max_brightness); 883 bd->props.max_brightness);
884 mutex_unlock(&dev->mode_config.connection_mutex); 884 drm_modeset_unlock(&dev->mode_config.connection_mutex);
885 return 0; 885 return 0;
886} 886}
887 887
@@ -893,9 +893,9 @@ static int intel_backlight_device_get_brightness(struct backlight_device *bd)
893 int ret; 893 int ret;
894 894
895 intel_runtime_pm_get(dev_priv); 895 intel_runtime_pm_get(dev_priv);
896 mutex_lock(&dev->mode_config.connection_mutex); 896 drm_modeset_lock(&dev->mode_config.connection_mutex, NULL);
897 ret = intel_panel_get_backlight(connector); 897 ret = intel_panel_get_backlight(connector);
898 mutex_unlock(&dev->mode_config.connection_mutex); 898 drm_modeset_unlock(&dev->mode_config.connection_mutex);
899 intel_runtime_pm_put(dev_priv); 899 intel_runtime_pm_put(dev_priv);
900 900
901 return ret; 901 return ret;
diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c
index d6acd6bd0bf0..1b66ddcdfb33 100644
--- a/drivers/gpu/drm/i915/intel_sprite.c
+++ b/drivers/gpu/drm/i915/intel_sprite.c
@@ -55,7 +55,7 @@ static bool intel_pipe_update_start(struct intel_crtc *crtc, uint32_t *start_vbl
55 int scanline, min, max, vblank_start; 55 int scanline, min, max, vblank_start;
56 DEFINE_WAIT(wait); 56 DEFINE_WAIT(wait);
57 57
58 WARN_ON(!mutex_is_locked(&crtc->base.mutex)); 58 WARN_ON(!drm_modeset_is_locked(&crtc->base.mutex));
59 59
60 vblank_start = mode->crtc_vblank_start; 60 vblank_start = mode->crtc_vblank_start;
61 if (mode->flags & DRM_MODE_FLAG_INTERLACE) 61 if (mode->flags & DRM_MODE_FLAG_INTERLACE)
diff --git a/drivers/gpu/drm/i915/intel_tv.c b/drivers/gpu/drm/i915/intel_tv.c
index 25850a86d70c..67c6c9a2eb1c 100644
--- a/drivers/gpu/drm/i915/intel_tv.c
+++ b/drivers/gpu/drm/i915/intel_tv.c
@@ -1321,10 +1321,11 @@ intel_tv_detect(struct drm_connector *connector, bool force)
1321 1321
1322 if (force) { 1322 if (force) {
1323 struct intel_load_detect_pipe tmp; 1323 struct intel_load_detect_pipe tmp;
1324 struct drm_modeset_acquire_ctx ctx;
1324 1325
1325 if (intel_get_load_detect_pipe(connector, &mode, &tmp)) { 1326 if (intel_get_load_detect_pipe(connector, &mode, &tmp, &ctx)) {
1326 type = intel_tv_detect_type(intel_tv, connector); 1327 type = intel_tv_detect_type(intel_tv, connector);
1327 intel_release_load_detect_pipe(connector, &tmp); 1328 intel_release_load_detect_pipe(connector, &tmp, &ctx);
1328 } else 1329 } else
1329 return connector_status_unknown; 1330 return connector_status_unknown;
1330 } else 1331 } else