linux/drivers/gpu/drm/nouveau
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
..
core drm/nvc0/fb: fix crash when different mutex is used to protect same list 2013-01-13 18:07:46 +10:00
Kconfig drm/nouveau: add Kconfig options for debug control 2012-10-03 13:12:59 +10:00
Makefile nvc0/ppp: initial implementation of engine 2012-11-29 09:58:08 +10:00
nouveau_abi16.c Merge branch 'drm-next-3.8' of git://people.freedesktop.org/~agd5f/linux into drm-next 2012-12-10 20:03:58 +10:00
nouveau_abi16.h drm/nouveau: port all engines to new engine module format 2012-10-03 13:12:56 +10:00
nouveau_acpi.c drm/nouveau: Add interface to detect optimus and v1 support 2012-11-29 09:57:59 +10:00
nouveau_acpi.h drm/nouveau: Add interface to detect optimus and v1 support 2012-11-29 09:57:59 +10:00
nouveau_agp.c drm/nouveau: implement devinit subdev, and new init table parser 2012-10-03 13:12:47 +10:00
nouveau_agp.h drm/nouveau: implement devinit subdev, and new init table parser 2012-10-03 13:12:47 +10:00
nouveau_backlight.c drm/nouveau: port remainder of drm code, and rip out compat layer 2012-10-03 13:12:59 +10:00
nouveau_bios.c drm/nouveau/dp: remove last bits of VBIOS parsing from DRM code 2012-11-29 09:57:54 +10:00
nouveau_bios.h drm/nouveau/dp: remove last bits of VBIOS parsing from DRM code 2012-11-29 09:57:54 +10:00
nouveau_bo.c drm/nouveau: try to protect nbo->pin_refcount 2013-01-20 15:57:56 +01:00
nouveau_bo.h drm/nouveau: try to protect nbo->pin_refcount 2013-01-20 15:57:56 +01:00
nouveau_calc.c Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux 2012-10-03 23:29:23 -07:00
nouveau_chan.c drm/nouveau: unpin pushbuffer bo before destroying it 2012-11-29 09:58:11 +10:00
nouveau_chan.h drm/nve0: use async copy engine for ttm buffer moves if available 2012-10-03 13:13:02 +10:00
nouveau_connector.c drm/nouveau: do not forcibly power on lvds panels 2013-01-13 18:07:32 +10:00
nouveau_connector.h drm/nv50-nvc0: switch to common disp impl, removing previous version 2012-11-29 09:57:58 +10:00
nouveau_crtc.h drm/nouveau: rename nvd0_display to nv50_display to reflect reality since merge 2012-11-29 09:57:58 +10:00
nouveau_display.c drm/<drivers>: reorder framebuffer init sequence 2013-01-20 15:29:24 +01:00
nouveau_display.h drm/nouveau: port remainder of drm code, and rip out compat layer 2012-10-03 13:12:59 +10:00
nouveau_dma.c drm/nouveau: port all engines to new engine module format 2012-10-03 13:12:56 +10:00
nouveau_dma.h drm/nouveau: port all engines to new engine module format 2012-10-03 13:12:56 +10:00
nouveau_dp.c drm/nouveau/dp: remove last bits of VBIOS parsing from DRM code 2012-11-29 09:57:54 +10:00
nouveau_drm.c Merge branch 'drm-nouveau-fixes' of git://anongit.freedesktop.org/git/nouveau/linux-2.6 into drm-next 2013-01-14 08:15:36 +10:00
nouveau_drm.h drm/nouveau: convert to dev_pm_ops 2012-11-29 09:58:00 +10:00
nouveau_encoder.h drm/nouveau: rename nvd0_display to nv50_display to reflect reality since merge 2012-11-29 09:57:58 +10:00
nouveau_fbcon.c drm: revamp framebuffer cleanup interfaces 2013-01-20 22:17:00 +01:00
nouveau_fbcon.h Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux 2012-10-03 23:29:23 -07:00
nouveau_fence.c Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux 2012-10-03 23:29:23 -07:00
nouveau_fence.h drm/nv17-50: restore fence buffer on resume 2013-01-13 18:07:45 +10:00
nouveau_gem.c drm/ttm: remove no_wait_reserve, v3 2012-12-10 20:21:30 +10:00
nouveau_gem.h Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux 2012-10-03 23:29:23 -07:00
nouveau_hw.c Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux 2012-10-03 23:29:23 -07:00
nouveau_hw.h Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux 2012-10-03 23:29:23 -07:00
nouveau_hwsq.h drm/nouveau/hwsq: remove some magic, give proper opcode names 2011-12-21 19:01:44 +10:00
nouveau_ioc32.c Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux 2012-10-03 23:29:23 -07:00
nouveau_ioctl.h drm/nouveau: move compat ioctl out of nouveau_drv.h 2012-10-03 13:12:58 +10:00
nouveau_irq.c drm/nv50/disp: move remaining interrupt handling into core 2012-11-29 09:57:52 +10:00
nouveau_irq.h drm/nouveau: port remainder of drm code, and rip out compat layer 2012-10-03 13:12:59 +10:00
nouveau_mem.c drm/nouveau: quiet some static-related sparse noise 2012-10-03 13:13:07 +10:00
nouveau_perf.c Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux 2012-10-03 23:29:23 -07:00
nouveau_pm.c drm: nouveau: Fix build warning seen if HWMON is undefined 2013-01-04 16:03:33 +10:00
nouveau_pm.h drm/nouveau/therm: move thermal-related functions to the therm subdev 2012-10-03 13:13:14 +10:00
nouveau_prime.c drm/prime: drop reference on imported dma-buf come from gem 2013-01-08 14:41:53 +10:00
nouveau_reg.h drm/nva3/backlight: add suppport for newer style backlight regs 2011-09-20 16:10:06 +10:00
nouveau_sgdma.c drm/nouveau: port all engines to new engine module format 2012-10-03 13:12:56 +10:00
nouveau_ttm.c drm/nouveau: store supported dma mask in vmmgr 2012-10-03 13:13:16 +10:00
nouveau_ttm.h drm/nouveau: port remainder of drm code, and rip out compat layer 2012-10-03 13:12:59 +10:00
nouveau_vga.c drm/nouveau: convert to dev_pm_ops 2012-11-29 09:58:00 +10:00
nouveau_vga.h drm/nouveau: port remainder of drm code, and rip out compat layer 2012-10-03 13:12:59 +10:00
nouveau_volt.c Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux 2012-10-03 23:29:23 -07:00
nv04_crtc.c drm/nouveau: unpin various bo's before destroying 2012-11-29 09:58:11 +10:00
nv04_cursor.c Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux 2012-10-03 23:29:23 -07:00
nv04_dac.c drm/nouveau: silence modesetting spam on pre-gf8 chipsets 2012-10-31 10:57:53 +10:00
nv04_dfp.c drm/nouveau: fix blank LVDS screen regression on pre-nv50 cards 2013-01-13 18:07:45 +10:00
nv04_display.c drm: encapsulate crtc->set_config calls 2013-01-20 15:57:58 +01:00
nv04_display.h drm/nouveau: port remainder of drm code, and rip out compat layer 2012-10-03 13:12:59 +10:00
nv04_fbcon.c drm/nouveau: port remainder of drm code, and rip out compat layer 2012-10-03 13:12:59 +10:00
nv04_fence.c drm/nouveau: port all engines to new engine module format 2012-10-03 13:12:56 +10:00
nv04_pm.c Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux 2012-10-03 23:29:23 -07:00
nv04_tv.c drm/nouveau: silence modesetting spam on pre-gf8 chipsets 2012-10-31 10:57:53 +10:00
nv10_fence.c drm/nv17-50: restore fence buffer on resume 2013-01-13 18:07:45 +10:00
nv17_tv_modes.c Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux 2012-10-03 23:29:23 -07:00
nv17_tv.c drm: encapsulate crtc->set_config calls 2013-01-20 15:57:58 +01:00
nv17_tv.h drm/nouveau: port remainder of drm code, and rip out compat layer 2012-10-03 13:12:59 +10:00
nv40_pm.c Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux 2012-10-03 23:29:23 -07:00
nv50_display.c drm/nouveau: protect evo_wait/evo_kick sections with a channel mutex 2013-01-20 15:57:55 +01:00
nv50_display.h drm/nouveau: rename nvd0_display to nv50_display to reflect reality since merge 2012-11-29 09:57:58 +10:00
nv50_fbcon.c drm/nouveau: port remainder of drm code, and rip out compat layer 2012-10-03 13:12:59 +10:00
nv50_fence.c drm/nv17-50: restore fence buffer on resume 2013-01-13 18:07:45 +10:00
nv50_pm.c drm/nv50-nvc0: switch to common disp impl, removing previous version 2012-11-29 09:57:58 +10:00
nv84_fence.c drm/nouveau: rename nvd0_display to nv50_display to reflect reality since merge 2012-11-29 09:57:58 +10:00
nva3_pm.c Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux 2012-10-03 23:29:23 -07:00
nvc0_fbcon.c drm/nouveau: port remainder of drm code, and rip out compat layer 2012-10-03 13:12:59 +10:00
nvc0_fence.c drm/nouveau: unpin various bo's before destroying 2012-11-29 09:58:11 +10:00
nvc0_pm.c drm/nouveau: port remainder of drm code, and rip out compat layer 2012-10-03 13:12:59 +10:00
nvreg.h drm/nv17-nv40: Fix modesetting failure when pitch == 4096px (fdo bug 35901). 2011-06-07 09:22:29 +10:00