aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_overlay.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2016-07-14 23:50:58 -0400
committerDave Airlie <airlied@redhat.com>2016-07-14 23:50:58 -0400
commitff37c05a996bb96eccc21f4fb1b32ba0e24f3443 (patch)
treec09b09b37521f2f8f3f7a9bb3b0a33a2b3bde1a1 /drivers/gpu/drm/i915/intel_overlay.c
parent6c181c82106e12dced317e93a7a396cbb8c64f75 (diff)
parent0b2c0582f1570bfc95aa9ac1cd340a215d8e8335 (diff)
Merge tag 'drm-intel-next-2016-07-11' of git://anongit.freedesktop.org/drm-intel into drm-next
- select igt testing depencies for CONFIG_DRM_I915_DEBUG (Chris) - track outputs in crtc state and clean up all our ad-hoc connector/encoder walking in modest code (Ville) - demidlayer drm_device/drm_i915_private (Chris Wilson) - thundering herd fix from Chris Wilson, with lots of help from Tvrtko Ursulin - piles of assorted clean and fallout from the thundering herd fix - documentation and more tuning for waitboosting (Chris) - pooled EU support on bxt (Arun Siluvery) - bxt support is no longer considered prelimary! - ring/engine vfunc cleanup from Tvrtko - introduce intel_wait_for_register helper (Chris) - opregion updates (Jani Nukla) - tuning and fixes for wait_for macros (Tvrkto&Imre) - more kabylake pci ids (Rodrigo) - pps cleanup and fixes for bxt (Imre) - move sink crc support over to atomic state (Maarten) - fix up async fbdev init ordering (Chris) - fbc fixes from Paulo and Chris * tag 'drm-intel-next-2016-07-11' of git://anongit.freedesktop.org/drm-intel: (223 commits) drm/i915: Update DRIVER_DATE to 20160711 drm/i915: Select DRM_VGEM for igt drm/i915: Select X86_MSR for igt drm/i915: Fill unused GGTT with scratch pages for VT-d drm/i915: Introduce Kabypoint PCH for Kabylake H/DT. drm/i915:gen9: implement WaMediaPoolStateCmdInWABB drm/i915: Check for invalid cloning earlier during modeset drm/i915: Simplify hdmi_12bpc_possible() drm/i915: Kill has_dsi_encoder drm/i915: s/INTEL_OUTPUT_DISPLAYPORT/INTEL_OUTPUT_DP/ drm/i915: Replace some open coded intel_crtc_has_dp_encoder()s drm/i915: Kill has_dp_encoder from pipe_config drm/i915: Replace manual lvds and sdvo/hdmi counting with intel_crtc_has_type() drm/i915: Unify intel_pipe_has_type() and intel_pipe_will_have_type() drm/i915: Add output_types bitmask into the crtc state drm/i915: Remove encoder type checks from MST suspend/resume drm/i915: Don't mark eDP encoders as MST capable drm/i915: avoid wait_for_atomic() in non-atomic host2guc_action() drm/i915: Group the irq breadcrumb variables into the same cacheline drm/i915: Wake up the bottom-half if we steal their interrupt ...
Diffstat (limited to 'drivers/gpu/drm/i915/intel_overlay.c')
-rw-r--r--drivers/gpu/drm/i915/intel_overlay.c28
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:
1444out_free_bo: 1446out_free_bo:
1445 drm_gem_object_unreference(&reg_bo->base); 1447 drm_gem_object_unreference(&reg_bo->base);
1446out_free: 1448out_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}