diff options
Diffstat (limited to 'drivers/gpu/drm/i915/i915_dma.c')
-rw-r--r-- | drivers/gpu/drm/i915/i915_dma.c | 36 |
1 files changed, 34 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c index 2dd2c93ebfa3..e6fc48ea55a9 100644 --- a/drivers/gpu/drm/i915/i915_dma.c +++ b/drivers/gpu/drm/i915/i915_dma.c | |||
@@ -34,6 +34,7 @@ | |||
34 | #include "i915_drm.h" | 34 | #include "i915_drm.h" |
35 | #include "i915_drv.h" | 35 | #include "i915_drv.h" |
36 | #include "i915_trace.h" | 36 | #include "i915_trace.h" |
37 | #include "../../../platform/x86/intel_ips.h" | ||
37 | #include <linux/pci.h> | 38 | #include <linux/pci.h> |
38 | #include <linux/vgaarb.h> | 39 | #include <linux/vgaarb.h> |
39 | #include <linux/acpi.h> | 40 | #include <linux/acpi.h> |
@@ -1418,9 +1419,15 @@ static int i915_load_modeset_init(struct drm_device *dev, | |||
1418 | if (ret) | 1419 | if (ret) |
1419 | DRM_INFO("failed to find VBIOS tables\n"); | 1420 | DRM_INFO("failed to find VBIOS tables\n"); |
1420 | 1421 | ||
1421 | /* if we have > 1 VGA cards, then disable the radeon VGA resources */ | 1422 | /* If we have > 1 VGA cards, then we need to arbitrate access |
1423 | * to the common VGA resources. | ||
1424 | * | ||
1425 | * If we are a secondary display controller (!PCI_DISPLAY_CLASS_VGA), | ||
1426 | * then we do not take part in VGA arbitration and the | ||
1427 | * vga_client_register() fails with -ENODEV. | ||
1428 | */ | ||
1422 | ret = vga_client_register(dev->pdev, dev, NULL, i915_vga_set_decode); | 1429 | ret = vga_client_register(dev->pdev, dev, NULL, i915_vga_set_decode); |
1423 | if (ret) | 1430 | if (ret && ret != -ENODEV) |
1424 | goto cleanup_ringbuffer; | 1431 | goto cleanup_ringbuffer; |
1425 | 1432 | ||
1426 | ret = vga_switcheroo_register_client(dev->pdev, | 1433 | ret = vga_switcheroo_register_client(dev->pdev, |
@@ -2047,6 +2054,26 @@ out_unlock: | |||
2047 | EXPORT_SYMBOL_GPL(i915_gpu_turbo_disable); | 2054 | EXPORT_SYMBOL_GPL(i915_gpu_turbo_disable); |
2048 | 2055 | ||
2049 | /** | 2056 | /** |
2057 | * Tells the intel_ips driver that the i915 driver is now loaded, if | ||
2058 | * IPS got loaded first. | ||
2059 | * | ||
2060 | * This awkward dance is so that neither module has to depend on the | ||
2061 | * other in order for IPS to do the appropriate communication of | ||
2062 | * GPU turbo limits to i915. | ||
2063 | */ | ||
2064 | static void | ||
2065 | ips_ping_for_i915_load(void) | ||
2066 | { | ||
2067 | void (*link)(void); | ||
2068 | |||
2069 | link = symbol_get(ips_link_to_i915_driver); | ||
2070 | if (link) { | ||
2071 | link(); | ||
2072 | symbol_put(ips_link_to_i915_driver); | ||
2073 | } | ||
2074 | } | ||
2075 | |||
2076 | /** | ||
2050 | * i915_driver_load - setup chip and create an initial config | 2077 | * i915_driver_load - setup chip and create an initial config |
2051 | * @dev: DRM device | 2078 | * @dev: DRM device |
2052 | * @flags: startup flags | 2079 | * @flags: startup flags |
@@ -2234,6 +2261,8 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags) | |||
2234 | /* XXX Prevent module unload due to memory corruption bugs. */ | 2261 | /* XXX Prevent module unload due to memory corruption bugs. */ |
2235 | __module_get(THIS_MODULE); | 2262 | __module_get(THIS_MODULE); |
2236 | 2263 | ||
2264 | ips_ping_for_i915_load(); | ||
2265 | |||
2237 | return 0; | 2266 | return 0; |
2238 | 2267 | ||
2239 | out_workqueue_free: | 2268 | out_workqueue_free: |
@@ -2306,6 +2335,9 @@ int i915_driver_unload(struct drm_device *dev) | |||
2306 | i915_gem_lastclose(dev); | 2335 | i915_gem_lastclose(dev); |
2307 | 2336 | ||
2308 | intel_cleanup_overlay(dev); | 2337 | intel_cleanup_overlay(dev); |
2338 | |||
2339 | if (!I915_NEED_GFX_HWS(dev)) | ||
2340 | i915_free_hws(dev); | ||
2309 | } | 2341 | } |
2310 | 2342 | ||
2311 | intel_teardown_mchbar(dev); | 2343 | intel_teardown_mchbar(dev); |