linux_dsm_epyc7002/drivers/gpu/drm/ast
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
..
ast_dram_tables.h drm: Initial KMS driver for AST (ASpeed Technologies) 2000 series (v2) 2012-05-17 10:53:37 +01:00
ast_drv.c drm/ast: use drm_modeset_lock_all 2013-01-20 22:16:50 +01:00
ast_drv.h drm: only take the crtc lock for ->cursor_set 2013-01-20 22:16:55 +01:00
ast_fb.c drm: revamp framebuffer cleanup interfaces 2013-01-20 22:17:00 +01:00
ast_main.c drm/<drivers>: Unified handling of unimplemented fb->create_handle 2013-01-20 15:57:57 +01:00
ast_mode.c Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux 2012-10-03 23:29:23 -07:00
ast_post.c UAPI: (Scripted) Convert #include "..." to #include <path/...> in drivers/gpu/ 2012-10-02 18:01:07 +01:00
ast_tables.h drm: Initial KMS driver for AST (ASpeed Technologies) 2000 series (v2) 2012-05-17 10:53:37 +01:00
ast_ttm.c drm/ttm: remove no_wait_reserve, v3 2012-12-10 20:21:30 +10:00
Kconfig drm/kms: fix Kconfig for new drivers. 2012-05-20 10:10:53 +01:00
Makefile drm: Initial KMS driver for AST (ASpeed Technologies) 2000 series (v2) 2012-05-17 10:53:37 +01:00