diff options
Diffstat (limited to 'drivers/gpu/drm/i915/intel_overlay.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_overlay.c | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/drivers/gpu/drm/i915/intel_overlay.c b/drivers/gpu/drm/i915/intel_overlay.c index eb93f90bb74d..3212d8806b5a 100644 --- a/drivers/gpu/drm/i915/intel_overlay.c +++ b/drivers/gpu/drm/i915/intel_overlay.c | |||
@@ -409,7 +409,7 @@ static int intel_overlay_release_old_vid(struct intel_overlay *overlay) | |||
409 | struct intel_engine_cs *engine = &dev_priv->engine[RCS]; | 409 | struct intel_engine_cs *engine = &dev_priv->engine[RCS]; |
410 | int ret; | 410 | int ret; |
411 | 411 | ||
412 | lockdep_assert_held(&dev_priv->dev->struct_mutex); | 412 | lockdep_assert_held(&dev_priv->drm.struct_mutex); |
413 | 413 | ||
414 | /* Only wait if there is actually an old frame to release to | 414 | /* Only wait if there is actually an old frame to release to |
415 | * guarantee forward progress. | 415 | * guarantee forward progress. |
@@ -741,8 +741,8 @@ static int intel_overlay_do_put_image(struct intel_overlay *overlay, | |||
741 | u32 swidth, swidthsw, sheight, ostride; | 741 | u32 swidth, swidthsw, sheight, ostride; |
742 | enum pipe pipe = overlay->crtc->pipe; | 742 | enum pipe pipe = overlay->crtc->pipe; |
743 | 743 | ||
744 | lockdep_assert_held(&dev_priv->dev->struct_mutex); | 744 | lockdep_assert_held(&dev_priv->drm.struct_mutex); |
745 | WARN_ON(!drm_modeset_is_locked(&dev_priv->dev->mode_config.connection_mutex)); | 745 | WARN_ON(!drm_modeset_is_locked(&dev_priv->drm.mode_config.connection_mutex)); |
746 | 746 | ||
747 | ret = intel_overlay_release_old_vid(overlay); | 747 | ret = intel_overlay_release_old_vid(overlay); |
748 | if (ret != 0) | 748 | if (ret != 0) |
@@ -836,7 +836,8 @@ static int intel_overlay_do_put_image(struct intel_overlay *overlay, | |||
836 | overlay->old_vid_bo = overlay->vid_bo; | 836 | overlay->old_vid_bo = overlay->vid_bo; |
837 | overlay->vid_bo = new_bo; | 837 | overlay->vid_bo = new_bo; |
838 | 838 | ||
839 | intel_frontbuffer_flip(dev_priv->dev, INTEL_FRONTBUFFER_OVERLAY(pipe)); | 839 | intel_frontbuffer_flip(&dev_priv->drm, |
840 | INTEL_FRONTBUFFER_OVERLAY(pipe)); | ||
840 | 841 | ||
841 | return 0; | 842 | return 0; |
842 | 843 | ||
@@ -851,8 +852,8 @@ int intel_overlay_switch_off(struct intel_overlay *overlay) | |||
851 | struct overlay_registers __iomem *regs; | 852 | struct overlay_registers __iomem *regs; |
852 | int ret; | 853 | int ret; |
853 | 854 | ||
854 | lockdep_assert_held(&dev_priv->dev->struct_mutex); | 855 | lockdep_assert_held(&dev_priv->drm.struct_mutex); |
855 | WARN_ON(!drm_modeset_is_locked(&dev_priv->dev->mode_config.connection_mutex)); | 856 | WARN_ON(!drm_modeset_is_locked(&dev_priv->drm.mode_config.connection_mutex)); |
856 | 857 | ||
857 | ret = intel_overlay_recover_from_interrupt(overlay); | 858 | ret = intel_overlay_recover_from_interrupt(overlay); |
858 | if (ret != 0) | 859 | if (ret != 0) |
@@ -1084,7 +1085,7 @@ int intel_overlay_put_image_ioctl(struct drm_device *dev, void *data, | |||
1084 | struct drm_file *file_priv) | 1085 | struct drm_file *file_priv) |
1085 | { | 1086 | { |
1086 | struct drm_intel_overlay_put_image *put_image_rec = data; | 1087 | struct drm_intel_overlay_put_image *put_image_rec = data; |
1087 | struct drm_i915_private *dev_priv = dev->dev_private; | 1088 | struct drm_i915_private *dev_priv = to_i915(dev); |
1088 | struct intel_overlay *overlay; | 1089 | struct intel_overlay *overlay; |
1089 | struct drm_crtc *drmmode_crtc; | 1090 | struct drm_crtc *drmmode_crtc; |
1090 | struct intel_crtc *crtc; | 1091 | struct intel_crtc *crtc; |
@@ -1282,7 +1283,7 @@ int intel_overlay_attrs_ioctl(struct drm_device *dev, void *data, | |||
1282 | struct drm_file *file_priv) | 1283 | struct drm_file *file_priv) |
1283 | { | 1284 | { |
1284 | struct drm_intel_overlay_attrs *attrs = data; | 1285 | struct drm_intel_overlay_attrs *attrs = data; |
1285 | struct drm_i915_private *dev_priv = dev->dev_private; | 1286 | struct drm_i915_private *dev_priv = to_i915(dev); |
1286 | struct intel_overlay *overlay; | 1287 | struct intel_overlay *overlay; |
1287 | struct overlay_registers __iomem *regs; | 1288 | struct overlay_registers __iomem *regs; |
1288 | int ret; | 1289 | int ret; |
@@ -1379,7 +1380,7 @@ void intel_setup_overlay(struct drm_i915_private *dev_priv) | |||
1379 | if (!overlay) | 1380 | if (!overlay) |
1380 | return; | 1381 | return; |
1381 | 1382 | ||
1382 | mutex_lock(&dev_priv->dev->struct_mutex); | 1383 | mutex_lock(&dev_priv->drm.struct_mutex); |
1383 | if (WARN_ON(dev_priv->overlay)) | 1384 | if (WARN_ON(dev_priv->overlay)) |
1384 | goto out_free; | 1385 | goto out_free; |
1385 | 1386 | ||
@@ -1387,9 +1388,10 @@ void intel_setup_overlay(struct drm_i915_private *dev_priv) | |||
1387 | 1388 | ||
1388 | reg_bo = NULL; | 1389 | reg_bo = NULL; |
1389 | if (!OVERLAY_NEEDS_PHYSICAL(dev_priv)) | 1390 | if (!OVERLAY_NEEDS_PHYSICAL(dev_priv)) |
1390 | reg_bo = i915_gem_object_create_stolen(dev_priv->dev, PAGE_SIZE); | 1391 | reg_bo = i915_gem_object_create_stolen(&dev_priv->drm, |
1392 | PAGE_SIZE); | ||
1391 | if (reg_bo == NULL) | 1393 | if (reg_bo == NULL) |
1392 | reg_bo = i915_gem_object_create(dev_priv->dev, PAGE_SIZE); | 1394 | reg_bo = i915_gem_object_create(&dev_priv->drm, PAGE_SIZE); |
1393 | if (IS_ERR(reg_bo)) | 1395 | if (IS_ERR(reg_bo)) |
1394 | goto out_free; | 1396 | goto out_free; |
1395 | overlay->reg_bo = reg_bo; | 1397 | overlay->reg_bo = reg_bo; |
@@ -1434,7 +1436,7 @@ void intel_setup_overlay(struct drm_i915_private *dev_priv) | |||
1434 | intel_overlay_unmap_regs(overlay, regs); | 1436 | intel_overlay_unmap_regs(overlay, regs); |
1435 | 1437 | ||
1436 | dev_priv->overlay = overlay; | 1438 | dev_priv->overlay = overlay; |
1437 | mutex_unlock(&dev_priv->dev->struct_mutex); | 1439 | mutex_unlock(&dev_priv->drm.struct_mutex); |
1438 | DRM_INFO("initialized overlay support\n"); | 1440 | DRM_INFO("initialized overlay support\n"); |
1439 | return; | 1441 | return; |
1440 | 1442 | ||
@@ -1444,7 +1446,7 @@ out_unpin_bo: | |||
1444 | out_free_bo: | 1446 | out_free_bo: |
1445 | drm_gem_object_unreference(®_bo->base); | 1447 | drm_gem_object_unreference(®_bo->base); |
1446 | out_free: | 1448 | out_free: |
1447 | mutex_unlock(&dev_priv->dev->struct_mutex); | 1449 | mutex_unlock(&dev_priv->drm.struct_mutex); |
1448 | kfree(overlay); | 1450 | kfree(overlay); |
1449 | return; | 1451 | return; |
1450 | } | 1452 | } |