aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2012-12-13 17:38:38 -0500
committerDaniel Vetter <daniel.vetter@ffwll.ch>2013-01-20 09:29:24 -0500
commitc7d73f6a8ad71f9d9f58c86981322c6e48093a4f (patch)
tree5710889ea53df0cb695f96175708a91e430e8e45 /drivers/staging
parent065a50ed3ef75cb265e12e3e1b615db0835150bc (diff)
drm/<drivers>: reorder framebuffer init sequence
With more fine-grained locking we can no longer rely on the big mode_config lock to prevent concurrent access to mode resources like framebuffers. Instead a framebuffer becomes accessible to other threads as soon as it is added to the relevant lookup structures. Hence it needs to be fully set up by the time drivers call drm_framebuffer_init. This patch here is the drivers part of that reorg. Nothing really fancy going on safe for three special cases. - exynos needs to be careful to properly unref all handles. - nouveau gets a resource leak fixed for free: one of the error cases didn't cleanup the framebuffer, which is now moot since the framebuffer is only registered once it is fully set up. - vmwgfx requires a slight reordering of operations, I'm hoping I didn't break anything (but it's refcount management only, so should be safe). v2: Split out exynos, since it's a bit more hairy than expected. v3: Drop bogus cirrus hunk noticed by Richard Wilbur. v4: Split out vmwgfx since there's a small change in return values. Reviewed-by: Rob Clark <rob@ti.com> (core + omapdrm) Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/omapdrm/omap_fb.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/staging/omapdrm/omap_fb.c b/drivers/staging/omapdrm/omap_fb.c
index 09028e9c1093..bf6421f26c40 100644
--- a/drivers/staging/omapdrm/omap_fb.c
+++ b/drivers/staging/omapdrm/omap_fb.c
@@ -424,14 +424,6 @@ struct drm_framebuffer *omap_framebuffer_init(struct drm_device *dev,
424 } 424 }
425 425
426 fb = &omap_fb->base; 426 fb = &omap_fb->base;
427 ret = drm_framebuffer_init(dev, fb, &omap_framebuffer_funcs);
428 if (ret) {
429 dev_err(dev->dev, "framebuffer init failed: %d\n", ret);
430 goto fail;
431 }
432
433 DBG("create: FB ID: %d (%p)", fb->base.id, fb);
434
435 omap_fb->format = format; 427 omap_fb->format = format;
436 428
437 for (i = 0; i < n; i++) { 429 for (i = 0; i < n; i++) {
@@ -462,6 +454,14 @@ struct drm_framebuffer *omap_framebuffer_init(struct drm_device *dev,
462 454
463 drm_helper_mode_fill_fb_struct(fb, mode_cmd); 455 drm_helper_mode_fill_fb_struct(fb, mode_cmd);
464 456
457 ret = drm_framebuffer_init(dev, fb, &omap_framebuffer_funcs);
458 if (ret) {
459 dev_err(dev->dev, "framebuffer init failed: %d\n", ret);
460 goto fail;
461 }
462
463 DBG("create: FB ID: %d (%p)", fb->base.id, fb);
464
465 return fb; 465 return fb;
466 466
467fail: 467fail: