diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2010-08-19 11:09:23 -0400 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2010-09-08 05:13:32 -0400 |
commit | 44834a67c0082e2cf74b16be91e49108b1432d65 (patch) | |
tree | ebe2c53b1a08b99a95b579942ae2d7603935709d /drivers/gpu/drm/i915/i915_dma.c | |
parent | 3b61796785e7b0ca8846b7a709216dceb6e2f68d (diff) |
drm/i915: Use the VBT from OpRegion when available (v3)
It is recommended that we use the Video BIOS tables that were copied
into the OpRegion during POST when initialising the driver. This saves
us from having to furtle around inside the ROM ourselves and possibly
allows the vBIOS to adjust the tables prior to initialisation.
On some systems, such as the Samsung N210, there is no accessible VBIOS
and the only means of finding the VBT is through the OpRegion.
v2: Rearrange the code so that ASLE is enabled along with ACPI
v3: Enable OpRegion parsing even without ACPI
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Matthew Garrett <mjg@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_dma.c')
-rw-r--r-- | drivers/gpu/drm/i915/i915_dma.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c index c58ec5c02919..2dae3be9ebef 100644 --- a/drivers/gpu/drm/i915/i915_dma.c +++ b/drivers/gpu/drm/i915/i915_dma.c | |||
@@ -40,6 +40,7 @@ | |||
40 | #include <linux/pnp.h> | 40 | #include <linux/pnp.h> |
41 | #include <linux/vga_switcheroo.h> | 41 | #include <linux/vga_switcheroo.h> |
42 | #include <linux/slab.h> | 42 | #include <linux/slab.h> |
43 | #include <acpi/video.h> | ||
43 | 44 | ||
44 | extern int intel_max_stolen; /* from AGP driver */ | 45 | extern int intel_max_stolen; /* from AGP driver */ |
45 | 46 | ||
@@ -2166,6 +2167,7 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags) | |||
2166 | 2167 | ||
2167 | /* Try to make sure MCHBAR is enabled before poking at it */ | 2168 | /* Try to make sure MCHBAR is enabled before poking at it */ |
2168 | intel_setup_mchbar(dev); | 2169 | intel_setup_mchbar(dev); |
2170 | intel_opregion_setup(dev); | ||
2169 | 2171 | ||
2170 | i915_gem_load(dev); | 2172 | i915_gem_load(dev); |
2171 | 2173 | ||
@@ -2221,7 +2223,8 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags) | |||
2221 | } | 2223 | } |
2222 | 2224 | ||
2223 | /* Must be done after probing outputs */ | 2225 | /* Must be done after probing outputs */ |
2224 | intel_opregion_init(dev, 0); | 2226 | intel_opregion_init(dev); |
2227 | acpi_video_register(); | ||
2225 | 2228 | ||
2226 | setup_timer(&dev_priv->hangcheck_timer, i915_hangcheck_elapsed, | 2229 | setup_timer(&dev_priv->hangcheck_timer, i915_hangcheck_elapsed, |
2227 | (unsigned long) dev); | 2230 | (unsigned long) dev); |
@@ -2271,6 +2274,8 @@ int i915_driver_unload(struct drm_device *dev) | |||
2271 | dev_priv->mm.gtt_mtrr = -1; | 2274 | dev_priv->mm.gtt_mtrr = -1; |
2272 | } | 2275 | } |
2273 | 2276 | ||
2277 | acpi_video_unregister(); | ||
2278 | |||
2274 | if (drm_core_check_feature(dev, DRIVER_MODESET)) { | 2279 | if (drm_core_check_feature(dev, DRIVER_MODESET)) { |
2275 | intel_modeset_cleanup(dev); | 2280 | intel_modeset_cleanup(dev); |
2276 | 2281 | ||
@@ -2299,7 +2304,7 @@ int i915_driver_unload(struct drm_device *dev) | |||
2299 | if (dev_priv->regs != NULL) | 2304 | if (dev_priv->regs != NULL) |
2300 | iounmap(dev_priv->regs); | 2305 | iounmap(dev_priv->regs); |
2301 | 2306 | ||
2302 | intel_opregion_free(dev, 0); | 2307 | intel_opregion_fini(dev); |
2303 | 2308 | ||
2304 | if (drm_core_check_feature(dev, DRIVER_MODESET)) { | 2309 | if (drm_core_check_feature(dev, DRIVER_MODESET)) { |
2305 | /* Flush any outstanding unpin_work. */ | 2310 | /* Flush any outstanding unpin_work. */ |