drm/i915: Use drm_i915_private as the native pointer for intel_uncore.c
Pass drm_i915_private to the uncore init/fini routines and their
subservients as it is their native type.
text data bss dec hex filename
6309978 3578778 696320 10585076 a183f4 vmlinux
6309530 3578778 696320 10584628 a18234 vmlinux
a modest 400 bytes of saving, but 60 lines of code deleted!
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1462885804-26750-1-git-send-email-chris@chris-wilson.co.uk
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
index 4e7ee25..b55fef3 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -223,8 +223,7 @@
return -ENODEV;
break;
case I915_PARAM_HAS_GPU_RESET:
- value = i915.enable_hangcheck &&
- intel_has_gpu_reset(dev);
+ value = i915.enable_hangcheck && intel_has_gpu_reset(dev_priv);
break;
case I915_PARAM_HAS_RESOURCE_STREAMER:
value = HAS_RESOURCE_STREAMER(dev);
@@ -427,6 +426,8 @@
static void i915_gem_fini(struct drm_device *dev)
{
+ struct drm_i915_private *dev_priv = to_i915(dev);
+
/*
* Neither the BIOS, ourselves or any other kernel
* expects the system to be in execlists mode on startup,
@@ -447,7 +448,7 @@
* machine in an unusable condition.
*/
if (HAS_HW_CONTEXTS(dev)) {
- int reset = intel_gpu_reset(dev, ALL_ENGINES);
+ int reset = intel_gpu_reset(dev_priv, ALL_ENGINES);
WARN_ON(reset && reset != -ENODEV);
}
@@ -1189,7 +1190,7 @@
if (ret < 0)
goto put_bridge;
- intel_uncore_init(dev);
+ intel_uncore_init(dev_priv);
return 0;
@@ -1207,7 +1208,7 @@
{
struct drm_device *dev = dev_priv->dev;
- intel_uncore_fini(dev);
+ intel_uncore_fini(dev_priv);
i915_mmio_cleanup(dev);
pci_dev_put(dev_priv->bridge_dev);
}
@@ -1288,7 +1289,7 @@
pm_qos_add_request(&dev_priv->pm_qos, PM_QOS_CPU_DMA_LATENCY,
PM_QOS_DEFAULT_VALUE);
- intel_uncore_sanitize(dev);
+ intel_uncore_sanitize(dev_priv);
intel_opregion_setup(dev);