linux/drivers/staging/omapdrm
Daniel Vetter 362063619c drm: revamp framebuffer cleanup interfaces
We have two classes of framebuffer
- Created by the driver (atm only for fbdev), and the driver holds
  onto the last reference count until destruction.
- Created by userspace and associated with a given fd. These
  framebuffers will be reaped when their assoiciated fb is closed.

Now these two cases are set up differently, the framebuffers are on
different lists and hence destruction needs to clean up different
things. Also, for userspace framebuffers we remove them from any
current usage, whereas for internal framebuffers it is assumed that
the driver has done this already.

Long story short, we need two different ways to cleanup such drivers.
Three functions are involved in total:
- drm_framebuffer_remove: Convenience function which removes the fb
  from all active usage and then drops the passed-in reference.
- drm_framebuffer_unregister_private: Will remove driver-private
  framebuffers from relevant lists and drop the corresponding
  references. Should be called for driver-private framebuffers before
  dropping the last reference (or like for a lot of the drivers where
  the fbdev is embedded someplace else, before doing the cleanup
  manually).
- drm_framebuffer_cleanup: Final cleanup for both classes of fbs,
  should be called by the driver's ->destroy callback once the last
  reference is gone.

This patch just rolls out the new interfaces and updates all drivers
(by adding calls to drm_framebuffer_unregister_private at all the
right places)- no functional changes yet. Follow-on patches will move
drm core code around and update the lifetime management for
framebuffers, so that we are no longer required to keep framebuffers
alive by locking mode_config.mutex.

I've also updated the kerneldoc already.

vmwgfx seems to again be a bit special, at least I haven't figured out
how the fbdev support in that driver works. It smells like it's
external though.

v2: The i915 driver creates another private framebuffer in the
load-detect code. Adjust its cleanup code, too.

Reviewed-by: Rob Clark <rob@ti.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-01-20 22:17:00 +01:00
..
Kconfig staging: drm/omap: add support for ARCH_MULTIPLATFORM 2012-10-30 11:10:00 -07:00
Makefile staging: drm/omap: use omapdss low level API 2013-01-07 12:24:36 -08:00
TODO staging: drm/omap: use omapdss low level API 2013-01-07 12:24:36 -08:00
omap_connector.c staging: drm/omap: use omapdss low level API 2013-01-07 12:24:36 -08:00
omap_crtc.c omapdrm: use modeset_lock_all 2013-01-20 22:16:53 +01:00
omap_debugfs.c drm: revamp locking around fb creation/destruction 2013-01-20 22:16:58 +01:00
omap_dmm_priv.h drm/omap: Fix release of refill engine 2012-10-22 15:46:37 -07:00
omap_dmm_tiler.c staging: drm/omap: Fix usage of IS_ERR_OR_NULL and PTR_ERR 2012-11-16 15:03:10 -08:00
omap_dmm_tiler.h staging: drm/omap: add support for ARCH_MULTIPLATFORM 2012-10-30 11:10:00 -07:00
omap_drm.h
omap_drv.c omapdrm: use modeset_lock_all 2013-01-20 22:16:53 +01:00
omap_drv.h staging: drm/omap: use omapdss low level API 2013-01-07 12:24:36 -08:00
omap_encoder.c staging: drm/omap: use omapdss low level API 2013-01-07 12:24:36 -08:00
omap_fb.c drm/<drivers>: reorder framebuffer init sequence 2013-01-20 15:29:24 +01:00
omap_fbdev.c drm: revamp framebuffer cleanup interfaces 2013-01-20 22:17:00 +01:00
omap_gem.c staging/omapdrm: Fix spacing coding style in omap_gem.c 2012-11-14 16:31:04 -08:00
omap_gem_dmabuf.c Staging fixes for 3.8-rc3 2013-01-14 09:08:38 -08:00
omap_gem_helpers.c staging/omapdrm: Fix spacing coding style in omap_gem_helper.c 2012-11-14 16:31:04 -08:00
omap_irq.c staging: drm/omap: use omapdss low level API 2013-01-07 12:24:36 -08:00
omap_plane.c staging: drm/omap: use omapdss low level API 2013-01-07 12:24:36 -08:00
tcm-sita.c staging:omapdrm Fix typos in drivers:omapdrm 2012-04-10 10:31:01 -07:00
tcm-sita.h
tcm.h