aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_gem.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gem.c')
-rw-r--r--drivers/gpu/drm/i915/i915_gem.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 19dbdd7dd564..107f09befe92 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -1407,8 +1407,10 @@ out:
1407 return VM_FAULT_NOPAGE; 1407 return VM_FAULT_NOPAGE;
1408 case -ENOMEM: 1408 case -ENOMEM:
1409 return VM_FAULT_OOM; 1409 return VM_FAULT_OOM;
1410 case -ENOSPC:
1411 return VM_FAULT_SIGBUS;
1410 default: 1412 default:
1411 WARN_ON_ONCE(ret); 1413 WARN_ONCE(ret, "unhandled error in i915_gem_fault: %i\n", ret);
1412 return VM_FAULT_SIGBUS; 1414 return VM_FAULT_SIGBUS;
1413 } 1415 }
1414} 1416}
@@ -1822,10 +1824,11 @@ i915_gem_object_get_pages_gtt(struct drm_i915_gem_object *obj)
1822 sg_set_page(sg, page, PAGE_SIZE, 0); 1824 sg_set_page(sg, page, PAGE_SIZE, 0);
1823 } 1825 }
1824 1826
1827 obj->pages = st;
1828
1825 if (i915_gem_object_needs_bit17_swizzle(obj)) 1829 if (i915_gem_object_needs_bit17_swizzle(obj))
1826 i915_gem_object_do_bit_17_swizzle(obj); 1830 i915_gem_object_do_bit_17_swizzle(obj);
1827 1831
1828 obj->pages = st;
1829 return 0; 1832 return 0;
1830 1833
1831err_pages: 1834err_pages:
@@ -1955,11 +1958,12 @@ i915_gem_next_request_seqno(struct intel_ring_buffer *ring)
1955int 1958int
1956i915_add_request(struct intel_ring_buffer *ring, 1959i915_add_request(struct intel_ring_buffer *ring,
1957 struct drm_file *file, 1960 struct drm_file *file,
1958 struct drm_i915_gem_request *request) 1961 u32 *out_seqno)
1959{ 1962{
1960 drm_i915_private_t *dev_priv = ring->dev->dev_private; 1963 drm_i915_private_t *dev_priv = ring->dev->dev_private;
1961 uint32_t seqno; 1964 struct drm_i915_gem_request *request;
1962 u32 request_ring_position; 1965 u32 request_ring_position;
1966 u32 seqno;
1963 int was_empty; 1967 int was_empty;
1964 int ret; 1968 int ret;
1965 1969
@@ -1974,11 +1978,9 @@ i915_add_request(struct intel_ring_buffer *ring,
1974 if (ret) 1978 if (ret)
1975 return ret; 1979 return ret;
1976 1980
1977 if (request == NULL) { 1981 request = kmalloc(sizeof(*request), GFP_KERNEL);
1978 request = kmalloc(sizeof(*request), GFP_KERNEL); 1982 if (request == NULL)
1979 if (request == NULL) 1983 return -ENOMEM;
1980 return -ENOMEM;
1981 }
1982 1984
1983 seqno = i915_gem_next_request_seqno(ring); 1985 seqno = i915_gem_next_request_seqno(ring);
1984 1986
@@ -2030,6 +2032,8 @@ i915_add_request(struct intel_ring_buffer *ring,
2030 } 2032 }
2031 } 2033 }
2032 2034
2035 if (out_seqno)
2036 *out_seqno = seqno;
2033 return 0; 2037 return 0;
2034} 2038}
2035 2039
@@ -3959,6 +3963,9 @@ i915_gem_init_hw(struct drm_device *dev)
3959 if (!intel_enable_gtt()) 3963 if (!intel_enable_gtt())
3960 return -EIO; 3964 return -EIO;
3961 3965
3966 if (IS_HASWELL(dev) && (I915_READ(0x120010) == 1))
3967 I915_WRITE(0x9008, I915_READ(0x9008) | 0xf0000);
3968
3962 i915_gem_l3_remap(dev); 3969 i915_gem_l3_remap(dev);
3963 3970
3964 i915_gem_init_swizzling(dev); 3971 i915_gem_init_swizzling(dev);
@@ -4098,7 +4105,6 @@ i915_gem_entervt_ioctl(struct drm_device *dev, void *data,
4098 } 4105 }
4099 4106
4100 BUG_ON(!list_empty(&dev_priv->mm.active_list)); 4107 BUG_ON(!list_empty(&dev_priv->mm.active_list));
4101 BUG_ON(!list_empty(&dev_priv->mm.inactive_list));
4102 mutex_unlock(&dev->struct_mutex); 4108 mutex_unlock(&dev->struct_mutex);
4103 4109
4104 ret = drm_irq_install(dev); 4110 ret = drm_irq_install(dev);