Commit f7de5027 authored by Daniele Ceraolo Spurio's avatar Daniele Ceraolo Spurio Committed by Chris Wilson

drm/i915: make more uncore function work on intel_uncore

Move the init, fini, prune, suspend, resume function to work on
intel_uncore instead of dev_priv.
Signed-off-by: default avatarDaniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: default avatarPaulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20190319183543.13679-5-daniele.ceraolospurio@intel.com
parent 3ceea6a1
...@@ -1031,11 +1031,11 @@ static int i915_driver_init_mmio(struct drm_i915_private *dev_priv) ...@@ -1031,11 +1031,11 @@ static int i915_driver_init_mmio(struct drm_i915_private *dev_priv)
if (ret < 0) if (ret < 0)
goto err_bridge; goto err_bridge;
intel_uncore_init(dev_priv); intel_uncore_init(&dev_priv->uncore);
intel_device_info_init_mmio(dev_priv); intel_device_info_init_mmio(dev_priv);
intel_uncore_prune(dev_priv); intel_uncore_prune(&dev_priv->uncore);
intel_uc_init_mmio(dev_priv); intel_uc_init_mmio(dev_priv);
...@@ -1048,7 +1048,7 @@ static int i915_driver_init_mmio(struct drm_i915_private *dev_priv) ...@@ -1048,7 +1048,7 @@ static int i915_driver_init_mmio(struct drm_i915_private *dev_priv)
return 0; return 0;
err_uncore: err_uncore:
intel_uncore_fini(dev_priv); intel_uncore_fini(&dev_priv->uncore);
i915_mmio_cleanup(dev_priv); i915_mmio_cleanup(dev_priv);
err_bridge: err_bridge:
pci_dev_put(dev_priv->bridge_dev); pci_dev_put(dev_priv->bridge_dev);
...@@ -1062,7 +1062,7 @@ static int i915_driver_init_mmio(struct drm_i915_private *dev_priv) ...@@ -1062,7 +1062,7 @@ static int i915_driver_init_mmio(struct drm_i915_private *dev_priv)
*/ */
static void i915_driver_cleanup_mmio(struct drm_i915_private *dev_priv) static void i915_driver_cleanup_mmio(struct drm_i915_private *dev_priv)
{ {
intel_uncore_fini(dev_priv); intel_uncore_fini(&dev_priv->uncore);
i915_mmio_cleanup(dev_priv); i915_mmio_cleanup(dev_priv);
pci_dev_put(dev_priv->bridge_dev); pci_dev_put(dev_priv->bridge_dev);
} }
...@@ -2124,7 +2124,7 @@ static int i915_drm_suspend_late(struct drm_device *dev, bool hibernation) ...@@ -2124,7 +2124,7 @@ static int i915_drm_suspend_late(struct drm_device *dev, bool hibernation)
i915_gem_suspend_late(dev_priv); i915_gem_suspend_late(dev_priv);
intel_uncore_suspend(dev_priv); intel_uncore_suspend(&dev_priv->uncore);
intel_power_domains_suspend(dev_priv, intel_power_domains_suspend(dev_priv,
get_suspend_mode(dev_priv, hibernation)); get_suspend_mode(dev_priv, hibernation));
...@@ -2320,7 +2320,9 @@ static int i915_drm_resume_early(struct drm_device *dev) ...@@ -2320,7 +2320,9 @@ static int i915_drm_resume_early(struct drm_device *dev)
DRM_ERROR("Resume prepare failed: %d, continuing anyway\n", DRM_ERROR("Resume prepare failed: %d, continuing anyway\n",
ret); ret);
intel_uncore_resume_early(dev_priv); intel_uncore_resume_early(&dev_priv->uncore);
i915_check_and_clear_faults(dev_priv);
if (INTEL_GEN(dev_priv) >= 11 || IS_GEN9_LP(dev_priv)) { if (INTEL_GEN(dev_priv) >= 11 || IS_GEN9_LP(dev_priv)) {
gen9_sanitize_dc_state(dev_priv); gen9_sanitize_dc_state(dev_priv);
...@@ -2890,7 +2892,7 @@ static int intel_runtime_suspend(struct device *kdev) ...@@ -2890,7 +2892,7 @@ static int intel_runtime_suspend(struct device *kdev)
intel_runtime_pm_disable_interrupts(dev_priv); intel_runtime_pm_disable_interrupts(dev_priv);
intel_uncore_suspend(dev_priv); intel_uncore_suspend(&dev_priv->uncore);
ret = 0; ret = 0;
if (INTEL_GEN(dev_priv) >= 11) { if (INTEL_GEN(dev_priv) >= 11) {
...@@ -2907,7 +2909,7 @@ static int intel_runtime_suspend(struct device *kdev) ...@@ -2907,7 +2909,7 @@ static int intel_runtime_suspend(struct device *kdev)
if (ret) { if (ret) {
DRM_ERROR("Runtime suspend failed, disabling it (%d)\n", ret); DRM_ERROR("Runtime suspend failed, disabling it (%d)\n", ret);
intel_uncore_runtime_resume(dev_priv); intel_uncore_runtime_resume(&dev_priv->uncore);
intel_runtime_pm_enable_interrupts(dev_priv); intel_runtime_pm_enable_interrupts(dev_priv);
...@@ -3004,7 +3006,7 @@ static int intel_runtime_resume(struct device *kdev) ...@@ -3004,7 +3006,7 @@ static int intel_runtime_resume(struct device *kdev)
ret = vlv_resume_prepare(dev_priv, true); ret = vlv_resume_prepare(dev_priv, true);
} }
intel_uncore_runtime_resume(dev_priv); intel_uncore_runtime_resume(&dev_priv->uncore);
intel_runtime_pm_enable_interrupts(dev_priv); intel_runtime_pm_enable_interrupts(dev_priv);
......
This diff is collapsed.
...@@ -142,14 +142,14 @@ forcewake_domain_to_uncore(const struct intel_uncore_forcewake_domain *d) ...@@ -142,14 +142,14 @@ forcewake_domain_to_uncore(const struct intel_uncore_forcewake_domain *d)
} }
void intel_uncore_sanitize(struct drm_i915_private *dev_priv); void intel_uncore_sanitize(struct drm_i915_private *dev_priv);
void intel_uncore_init(struct drm_i915_private *dev_priv); void intel_uncore_init(struct intel_uncore *uncore);
void intel_uncore_prune(struct drm_i915_private *dev_priv); void intel_uncore_prune(struct intel_uncore *uncore);
bool intel_uncore_unclaimed_mmio(struct drm_i915_private *dev_priv); bool intel_uncore_unclaimed_mmio(struct drm_i915_private *dev_priv);
bool intel_uncore_arm_unclaimed_mmio_detection(struct drm_i915_private *dev_priv); bool intel_uncore_arm_unclaimed_mmio_detection(struct drm_i915_private *dev_priv);
void intel_uncore_fini(struct drm_i915_private *dev_priv); void intel_uncore_fini(struct intel_uncore *uncore);
void intel_uncore_suspend(struct drm_i915_private *dev_priv); void intel_uncore_suspend(struct intel_uncore *uncore);
void intel_uncore_resume_early(struct drm_i915_private *dev_priv); void intel_uncore_resume_early(struct intel_uncore *uncore);
void intel_uncore_runtime_resume(struct drm_i915_private *dev_priv); void intel_uncore_runtime_resume(struct intel_uncore *uncore);
u64 intel_uncore_edram_size(struct drm_i915_private *dev_priv); u64 intel_uncore_edram_size(struct drm_i915_private *dev_priv);
void assert_forcewakes_inactive(struct intel_uncore *uncore); void assert_forcewakes_inactive(struct intel_uncore *uncore);
......
...@@ -182,7 +182,7 @@ struct drm_i915_private *mock_gem_device(void) ...@@ -182,7 +182,7 @@ struct drm_i915_private *mock_gem_device(void)
I915_GTT_PAGE_SIZE_64K | I915_GTT_PAGE_SIZE_64K |
I915_GTT_PAGE_SIZE_2M; I915_GTT_PAGE_SIZE_2M;
mock_uncore_init(i915); mock_uncore_init(&i915->uncore);
i915_gem_init__mm(i915); i915_gem_init__mm(i915);
init_waitqueue_head(&i915->gpu_error.wait_queue); init_waitqueue_head(&i915->gpu_error.wait_queue);
......
...@@ -39,8 +39,8 @@ __nop_read(16) ...@@ -39,8 +39,8 @@ __nop_read(16)
__nop_read(32) __nop_read(32)
__nop_read(64) __nop_read(64)
void mock_uncore_init(struct drm_i915_private *i915) void mock_uncore_init(struct intel_uncore *uncore)
{ {
ASSIGN_WRITE_MMIO_VFUNCS(i915, nop); ASSIGN_WRITE_MMIO_VFUNCS(uncore, nop);
ASSIGN_READ_MMIO_VFUNCS(i915, nop); ASSIGN_READ_MMIO_VFUNCS(uncore, nop);
} }
...@@ -25,6 +25,6 @@ ...@@ -25,6 +25,6 @@
#ifndef __MOCK_UNCORE_H #ifndef __MOCK_UNCORE_H
#define __MOCK_UNCORE_H #define __MOCK_UNCORE_H
void mock_uncore_init(struct drm_i915_private *i915); void mock_uncore_init(struct intel_uncore *uncore);
#endif /* !__MOCK_UNCORE_H */ #endif /* !__MOCK_UNCORE_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment