Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/i915: fix up locking inconsistency around gem_do_init
@ 2012-01-30 15:55 Daniel Vetter
  2012-01-30 15:55 ` [PATCH 2/2] drm/i915: drop the guard page at the end of the gtt Daniel Vetter
  0 siblings, 1 reply; 8+ messages in thread
From: Daniel Vetter @ 2012-01-30 15:55 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter

The locking in our setup and teardown paths is rather arbitrary, but
generally we try to protect gem stuff with dev->struct_mutex. Further,
the ums/gem ioctl to setup gem _does_ take the look. So fix up this
benign inconsistency.

Noticed while reading through code.

Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/i915/i915_dma.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
index 448848c..51bbd03 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -1196,6 +1196,7 @@ static int i915_load_gem_init(struct drm_device *dev)
 	/* Basic memrange allocator for stolen space */
 	drm_mm_init(&dev_priv->mm.stolen, 0, prealloc_size);
 
+	mutex_lock(&dev->struct_mutex);
 	/* Let GEM Manage all of the aperture.
 	 *
 	 * However, leave one page at the end still bound to the scratch page.
@@ -1207,7 +1208,6 @@ static int i915_load_gem_init(struct drm_device *dev)
 	 */
 	i915_gem_do_init(dev, 0, mappable_size, gtt_size - PAGE_SIZE);
 
-	mutex_lock(&dev->struct_mutex);
 	ret = i915_gem_init_ringbuffer(dev);
 	mutex_unlock(&dev->struct_mutex);
 	if (ret)
-- 
1.7.8.3

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-01-31 19:08 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-30 15:55 [PATCH 1/2] drm/i915: fix up locking inconsistency around gem_do_init Daniel Vetter
2012-01-30 15:55 ` [PATCH 2/2] drm/i915: drop the guard page at the end of the gtt Daniel Vetter
2012-01-30 19:09   ` Eric Anholt
2012-01-30 19:14     ` Daniel Vetter
2012-01-30 19:22       ` Daniel Vetter
2012-01-31 13:24         ` Daniel Vetter
2012-01-31 13:27           ` Daniel Vetter
2012-01-31 19:08   ` Daniel Vetter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox