Skip to content

Commit 8cdf1b5

Browse files
committed
Merge tag 'drm-intel-fixes-2022-06-29' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes
drm/i915 fixes for v5.19-rc5: - Fix ioctl argument error return - Fix d3cold disable to allow PCI upstream bridge D3 transition - Fix setting cache_dirty for dma-buf objects on discrete Signed-off-by: Dave Airlie <[email protected]> From: Jani Nikula <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 parents 76f0544 + 7953849 commit 8cdf1b5

File tree

3 files changed

+21
-24
lines changed

3 files changed

+21
-24
lines changed

drivers/gpu/drm/i915/gem/i915_gem_context.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -933,8 +933,9 @@ static int set_proto_ctx_param(struct drm_i915_file_private *fpriv,
933933
case I915_CONTEXT_PARAM_PERSISTENCE:
934934
if (args->size)
935935
ret = -EINVAL;
936-
ret = proto_context_set_persistence(fpriv->dev_priv, pc,
937-
args->value);
936+
else
937+
ret = proto_context_set_persistence(fpriv->dev_priv, pc,
938+
args->value);
938939
break;
939940

940941
case I915_CONTEXT_PARAM_PROTECTED_CONTENT:

drivers/gpu/drm/i915/gem/i915_gem_domain.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ bool i915_gem_cpu_write_needs_clflush(struct drm_i915_gem_object *obj)
3535
if (obj->cache_dirty)
3636
return false;
3737

38-
if (!(obj->cache_coherent & I915_BO_CACHE_COHERENT_FOR_WRITE))
39-
return true;
40-
4138
if (IS_DGFX(i915))
4239
return false;
4340

41+
if (!(obj->cache_coherent & I915_BO_CACHE_COHERENT_FOR_WRITE))
42+
return true;
43+
4444
/* Currently in use by HW (display engine)? Keep flushed. */
4545
return i915_gem_object_is_framebuffer(obj);
4646
}

drivers/gpu/drm/i915/i915_driver.c

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,7 @@ static int i915_set_dma_info(struct drm_i915_private *i915)
530530
static int i915_driver_hw_probe(struct drm_i915_private *dev_priv)
531531
{
532532
struct pci_dev *pdev = to_pci_dev(dev_priv->drm.dev);
533+
struct pci_dev *root_pdev;
533534
int ret;
534535

535536
if (i915_inject_probe_failure(dev_priv))
@@ -641,6 +642,15 @@ static int i915_driver_hw_probe(struct drm_i915_private *dev_priv)
641642

642643
intel_bw_init_hw(dev_priv);
643644

645+
/*
646+
* FIXME: Temporary hammer to avoid freezing the machine on our DGFX
647+
* This should be totally removed when we handle the pci states properly
648+
* on runtime PM and on s2idle cases.
649+
*/
650+
root_pdev = pcie_find_root_port(pdev);
651+
if (root_pdev)
652+
pci_d3cold_disable(root_pdev);
653+
644654
return 0;
645655

646656
err_msi:
@@ -664,11 +674,16 @@ static int i915_driver_hw_probe(struct drm_i915_private *dev_priv)
664674
static void i915_driver_hw_remove(struct drm_i915_private *dev_priv)
665675
{
666676
struct pci_dev *pdev = to_pci_dev(dev_priv->drm.dev);
677+
struct pci_dev *root_pdev;
667678

668679
i915_perf_fini(dev_priv);
669680

670681
if (pdev->msi_enabled)
671682
pci_disable_msi(pdev);
683+
684+
root_pdev = pcie_find_root_port(pdev);
685+
if (root_pdev)
686+
pci_d3cold_enable(root_pdev);
672687
}
673688

674689
/**
@@ -1193,14 +1208,6 @@ static int i915_drm_suspend_late(struct drm_device *dev, bool hibernation)
11931208
goto out;
11941209
}
11951210

1196-
/*
1197-
* FIXME: Temporary hammer to avoid freezing the machine on our DGFX
1198-
* This should be totally removed when we handle the pci states properly
1199-
* on runtime PM and on s2idle cases.
1200-
*/
1201-
if (suspend_to_idle(dev_priv))
1202-
pci_d3cold_disable(pdev);
1203-
12041211
pci_disable_device(pdev);
12051212
/*
12061213
* During hibernation on some platforms the BIOS may try to access
@@ -1365,8 +1372,6 @@ static int i915_drm_resume_early(struct drm_device *dev)
13651372

13661373
pci_set_master(pdev);
13671374

1368-
pci_d3cold_enable(pdev);
1369-
13701375
disable_rpm_wakeref_asserts(&dev_priv->runtime_pm);
13711376

13721377
ret = vlv_resume_prepare(dev_priv, false);
@@ -1543,7 +1548,6 @@ static int intel_runtime_suspend(struct device *kdev)
15431548
{
15441549
struct drm_i915_private *dev_priv = kdev_to_i915(kdev);
15451550
struct intel_runtime_pm *rpm = &dev_priv->runtime_pm;
1546-
struct pci_dev *pdev = to_pci_dev(dev_priv->drm.dev);
15471551
int ret;
15481552

15491553
if (drm_WARN_ON_ONCE(&dev_priv->drm, !HAS_RUNTIME_PM(dev_priv)))
@@ -1589,12 +1593,6 @@ static int intel_runtime_suspend(struct device *kdev)
15891593
drm_err(&dev_priv->drm,
15901594
"Unclaimed access detected prior to suspending\n");
15911595

1592-
/*
1593-
* FIXME: Temporary hammer to avoid freezing the machine on our DGFX
1594-
* This should be totally removed when we handle the pci states properly
1595-
* on runtime PM and on s2idle cases.
1596-
*/
1597-
pci_d3cold_disable(pdev);
15981596
rpm->suspended = true;
15991597

16001598
/*
@@ -1633,7 +1631,6 @@ static int intel_runtime_resume(struct device *kdev)
16331631
{
16341632
struct drm_i915_private *dev_priv = kdev_to_i915(kdev);
16351633
struct intel_runtime_pm *rpm = &dev_priv->runtime_pm;
1636-
struct pci_dev *pdev = to_pci_dev(dev_priv->drm.dev);
16371634
int ret;
16381635

16391636
if (drm_WARN_ON_ONCE(&dev_priv->drm, !HAS_RUNTIME_PM(dev_priv)))
@@ -1646,7 +1643,6 @@ static int intel_runtime_resume(struct device *kdev)
16461643

16471644
intel_opregion_notify_adapter(dev_priv, PCI_D0);
16481645
rpm->suspended = false;
1649-
pci_d3cold_enable(pdev);
16501646
if (intel_uncore_unclaimed_mmio(&dev_priv->uncore))
16511647
drm_dbg(&dev_priv->drm,
16521648
"Unclaimed access during suspend, bios?\n");

0 commit comments

Comments
 (0)