diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-07 14:38:30 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-07 14:38:30 -0400 |
commit | f69fb9c39868463f6b0b8306824341bd5610250b (patch) | |
tree | 7ab396e5185772342bdf8a50e6dfb56ff0cd1f64 /drivers | |
parent | e07cccf4046978df10f2e13fe2b99b2f9b3a65db (diff) | |
parent | 07fb6111e7af5fac6b6076e2658d0e32b67f713b (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/anholt/drm-intel
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/anholt/drm-intel:
agp/intel: support for new chip variant of IGDNG mobile
drm/i915: Unref old_obj on get_fence_reg() error path
drm/i915: increase default latency constant (v2 w/comment)
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/char/agp/intel-agp.c | 8 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem.c | 13 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 16 |
3 files changed, 31 insertions, 6 deletions
diff --git a/drivers/char/agp/intel-agp.c b/drivers/char/agp/intel-agp.c index 8c9d50db5c3a..c58557790585 100644 --- a/drivers/char/agp/intel-agp.c +++ b/drivers/char/agp/intel-agp.c | |||
@@ -49,6 +49,7 @@ | |||
49 | #define PCI_DEVICE_ID_INTEL_IGDNG_D_HB 0x0040 | 49 | #define PCI_DEVICE_ID_INTEL_IGDNG_D_HB 0x0040 |
50 | #define PCI_DEVICE_ID_INTEL_IGDNG_D_IG 0x0042 | 50 | #define PCI_DEVICE_ID_INTEL_IGDNG_D_IG 0x0042 |
51 | #define PCI_DEVICE_ID_INTEL_IGDNG_M_HB 0x0044 | 51 | #define PCI_DEVICE_ID_INTEL_IGDNG_M_HB 0x0044 |
52 | #define PCI_DEVICE_ID_INTEL_IGDNG_MA_HB 0x0062 | ||
52 | #define PCI_DEVICE_ID_INTEL_IGDNG_M_IG 0x0046 | 53 | #define PCI_DEVICE_ID_INTEL_IGDNG_M_IG 0x0046 |
53 | 54 | ||
54 | /* cover 915 and 945 variants */ | 55 | /* cover 915 and 945 variants */ |
@@ -81,7 +82,8 @@ | |||
81 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_GM45_HB || \ | 82 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_GM45_HB || \ |
82 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_G41_HB || \ | 83 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_G41_HB || \ |
83 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_IGDNG_D_HB || \ | 84 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_IGDNG_D_HB || \ |
84 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_IGDNG_M_HB) | 85 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_IGDNG_M_HB || \ |
86 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_IGDNG_MA_HB) | ||
85 | 87 | ||
86 | extern int agp_memory_reserved; | 88 | extern int agp_memory_reserved; |
87 | 89 | ||
@@ -1216,6 +1218,7 @@ static void intel_i965_get_gtt_range(int *gtt_offset, int *gtt_size) | |||
1216 | case PCI_DEVICE_ID_INTEL_G41_HB: | 1218 | case PCI_DEVICE_ID_INTEL_G41_HB: |
1217 | case PCI_DEVICE_ID_INTEL_IGDNG_D_HB: | 1219 | case PCI_DEVICE_ID_INTEL_IGDNG_D_HB: |
1218 | case PCI_DEVICE_ID_INTEL_IGDNG_M_HB: | 1220 | case PCI_DEVICE_ID_INTEL_IGDNG_M_HB: |
1221 | case PCI_DEVICE_ID_INTEL_IGDNG_MA_HB: | ||
1219 | *gtt_offset = *gtt_size = MB(2); | 1222 | *gtt_offset = *gtt_size = MB(2); |
1220 | break; | 1223 | break; |
1221 | default: | 1224 | default: |
@@ -2195,6 +2198,8 @@ static const struct intel_driver_description { | |||
2195 | "IGDNG/D", NULL, &intel_i965_driver }, | 2198 | "IGDNG/D", NULL, &intel_i965_driver }, |
2196 | { PCI_DEVICE_ID_INTEL_IGDNG_M_HB, PCI_DEVICE_ID_INTEL_IGDNG_M_IG, 0, | 2199 | { PCI_DEVICE_ID_INTEL_IGDNG_M_HB, PCI_DEVICE_ID_INTEL_IGDNG_M_IG, 0, |
2197 | "IGDNG/M", NULL, &intel_i965_driver }, | 2200 | "IGDNG/M", NULL, &intel_i965_driver }, |
2201 | { PCI_DEVICE_ID_INTEL_IGDNG_MA_HB, PCI_DEVICE_ID_INTEL_IGDNG_M_IG, 0, | ||
2202 | "IGDNG/MA", NULL, &intel_i965_driver }, | ||
2198 | { 0, 0, 0, NULL, NULL, NULL } | 2203 | { 0, 0, 0, NULL, NULL, NULL } |
2199 | }; | 2204 | }; |
2200 | 2205 | ||
@@ -2398,6 +2403,7 @@ static struct pci_device_id agp_intel_pci_table[] = { | |||
2398 | ID(PCI_DEVICE_ID_INTEL_G41_HB), | 2403 | ID(PCI_DEVICE_ID_INTEL_G41_HB), |
2399 | ID(PCI_DEVICE_ID_INTEL_IGDNG_D_HB), | 2404 | ID(PCI_DEVICE_ID_INTEL_IGDNG_D_HB), |
2400 | ID(PCI_DEVICE_ID_INTEL_IGDNG_M_HB), | 2405 | ID(PCI_DEVICE_ID_INTEL_IGDNG_M_HB), |
2406 | ID(PCI_DEVICE_ID_INTEL_IGDNG_MA_HB), | ||
2401 | { } | 2407 | { } |
2402 | }; | 2408 | }; |
2403 | 2409 | ||
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 0c07a755b3a3..7edb5b9d5792 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c | |||
@@ -2267,8 +2267,6 @@ i915_gem_object_get_fence_reg(struct drm_gem_object *obj) | |||
2267 | fence_list) { | 2267 | fence_list) { |
2268 | old_obj = old_obj_priv->obj; | 2268 | old_obj = old_obj_priv->obj; |
2269 | 2269 | ||
2270 | reg = &dev_priv->fence_regs[old_obj_priv->fence_reg]; | ||
2271 | |||
2272 | if (old_obj_priv->pin_count) | 2270 | if (old_obj_priv->pin_count) |
2273 | continue; | 2271 | continue; |
2274 | 2272 | ||
@@ -2290,8 +2288,11 @@ i915_gem_object_get_fence_reg(struct drm_gem_object *obj) | |||
2290 | */ | 2288 | */ |
2291 | i915_gem_object_flush_gpu_write_domain(old_obj); | 2289 | i915_gem_object_flush_gpu_write_domain(old_obj); |
2292 | ret = i915_gem_object_wait_rendering(old_obj); | 2290 | ret = i915_gem_object_wait_rendering(old_obj); |
2293 | if (ret != 0) | 2291 | if (ret != 0) { |
2292 | drm_gem_object_unreference(old_obj); | ||
2294 | return ret; | 2293 | return ret; |
2294 | } | ||
2295 | |||
2295 | break; | 2296 | break; |
2296 | } | 2297 | } |
2297 | 2298 | ||
@@ -2299,10 +2300,14 @@ i915_gem_object_get_fence_reg(struct drm_gem_object *obj) | |||
2299 | * Zap this virtual mapping so we can set up a fence again | 2300 | * Zap this virtual mapping so we can set up a fence again |
2300 | * for this object next time we need it. | 2301 | * for this object next time we need it. |
2301 | */ | 2302 | */ |
2302 | i915_gem_release_mmap(reg->obj); | 2303 | i915_gem_release_mmap(old_obj); |
2304 | |||
2303 | i = old_obj_priv->fence_reg; | 2305 | i = old_obj_priv->fence_reg; |
2306 | reg = &dev_priv->fence_regs[i]; | ||
2307 | |||
2304 | old_obj_priv->fence_reg = I915_FENCE_REG_NONE; | 2308 | old_obj_priv->fence_reg = I915_FENCE_REG_NONE; |
2305 | list_del_init(&old_obj_priv->fence_list); | 2309 | list_del_init(&old_obj_priv->fence_list); |
2310 | |||
2306 | drm_gem_object_unreference(old_obj); | 2311 | drm_gem_object_unreference(old_obj); |
2307 | } | 2312 | } |
2308 | 2313 | ||
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 3fadb5358858..748ed50c55ca 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -2005,7 +2005,21 @@ static void igd_enable_cxsr(struct drm_device *dev, unsigned long clock, | |||
2005 | return; | 2005 | return; |
2006 | } | 2006 | } |
2007 | 2007 | ||
2008 | const static int latency_ns = 3000; /* default for non-igd platforms */ | 2008 | /* |
2009 | * Latency for FIFO fetches is dependent on several factors: | ||
2010 | * - memory configuration (speed, channels) | ||
2011 | * - chipset | ||
2012 | * - current MCH state | ||
2013 | * It can be fairly high in some situations, so here we assume a fairly | ||
2014 | * pessimal value. It's a tradeoff between extra memory fetches (if we | ||
2015 | * set this value too high, the FIFO will fetch frequently to stay full) | ||
2016 | * and power consumption (set it too low to save power and we might see | ||
2017 | * FIFO underruns and display "flicker"). | ||
2018 | * | ||
2019 | * A value of 5us seems to be a good balance; safe for very low end | ||
2020 | * platforms but not overly aggressive on lower latency configs. | ||
2021 | */ | ||
2022 | const static int latency_ns = 5000; | ||
2009 | 2023 | ||
2010 | static int intel_get_fifo_size(struct drm_device *dev, int plane) | 2024 | static int intel_get_fifo_size(struct drm_device *dev, int plane) |
2011 | { | 2025 | { |