diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2010-09-24 11:02:42 -0400 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2010-09-24 16:03:00 -0400 |
commit | f787a5f59e1b0e320a6b0a37e9a2e306551d1e40 (patch) | |
tree | 994bdfb8efef803986fbd40e22942de40aa1daf2 /drivers/gpu/drm/i915/i915_dma.c | |
parent | 27d64339a8d8465484286a2da93f5f6c36be5c3d (diff) |
drm/i915: Only hold a process-local lock whilst throttling.
Avoid cause latencies in other clients by not taking the global struct
mutex and moving the per-client request manipulation a local per-client
mutex. For example, this allows a compositor to schedule a page-flip
(through X) whilst an OpenGL application is monopolising the GPU.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_dma.c')
-rw-r--r-- | drivers/gpu/drm/i915/i915_dma.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c index 048c54bdfd4c..a3aea17c964b 100644 --- a/drivers/gpu/drm/i915/i915_dma.c +++ b/drivers/gpu/drm/i915/i915_dma.c | |||
@@ -2162,20 +2162,19 @@ int i915_driver_unload(struct drm_device *dev) | |||
2162 | return 0; | 2162 | return 0; |
2163 | } | 2163 | } |
2164 | 2164 | ||
2165 | int i915_driver_open(struct drm_device *dev, struct drm_file *file_priv) | 2165 | int i915_driver_open(struct drm_device *dev, struct drm_file *file) |
2166 | { | 2166 | { |
2167 | struct drm_i915_file_private *i915_file_priv; | 2167 | struct drm_i915_file_private *file_priv; |
2168 | 2168 | ||
2169 | DRM_DEBUG_DRIVER("\n"); | 2169 | DRM_DEBUG_DRIVER("\n"); |
2170 | i915_file_priv = (struct drm_i915_file_private *) | 2170 | file_priv = kmalloc(sizeof(*file_priv), GFP_KERNEL); |
2171 | kmalloc(sizeof(*i915_file_priv), GFP_KERNEL); | 2171 | if (!file_priv) |
2172 | |||
2173 | if (!i915_file_priv) | ||
2174 | return -ENOMEM; | 2172 | return -ENOMEM; |
2175 | 2173 | ||
2176 | file_priv->driver_priv = i915_file_priv; | 2174 | file->driver_priv = file_priv; |
2177 | 2175 | ||
2178 | INIT_LIST_HEAD(&i915_file_priv->mm.request_list); | 2176 | INIT_LIST_HEAD(&file_priv->mm.request_list); |
2177 | mutex_init(&file_priv->mutex); | ||
2179 | 2178 | ||
2180 | return 0; | 2179 | return 0; |
2181 | } | 2180 | } |
@@ -2218,11 +2217,12 @@ void i915_driver_preclose(struct drm_device * dev, struct drm_file *file_priv) | |||
2218 | i915_mem_release(dev, file_priv, dev_priv->agp_heap); | 2217 | i915_mem_release(dev, file_priv, dev_priv->agp_heap); |
2219 | } | 2218 | } |
2220 | 2219 | ||
2221 | void i915_driver_postclose(struct drm_device *dev, struct drm_file *file_priv) | 2220 | void i915_driver_postclose(struct drm_device *dev, struct drm_file *file) |
2222 | { | 2221 | { |
2223 | struct drm_i915_file_private *i915_file_priv = file_priv->driver_priv; | 2222 | struct drm_i915_file_private *file_priv = file->driver_priv; |
2224 | 2223 | ||
2225 | kfree(i915_file_priv); | 2224 | mutex_destroy(&file_priv->mutex); |
2225 | kfree(file_priv); | ||
2226 | } | 2226 | } |
2227 | 2227 | ||
2228 | struct drm_ioctl_desc i915_ioctls[] = { | 2228 | struct drm_ioctl_desc i915_ioctls[] = { |