linux/drivers/gpu/drm/radeon
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
..
reg_srcs drm/radeon: add proper checking of RESOLVE_BOX command for r600-r700 2012-08-29 12:11:00 -04:00
.gitignore
atom-bits.h
atom-names.h
atom-types.h
atom.c drm/radeon/kms: fix fans after resume 2012-04-02 11:07:42 +01:00
atom.h UAPI: (Scripted) Convert #include "..." to #include <path/...> in drivers/gpu/ 2012-10-02 18:01:07 +01:00
atombios_crtc.c drm/radeon/dce32+: use fractional fb dividers for high clocks 2012-12-07 19:48:22 -05:00
atombios_dp.c drm: extract drm_dp_max_lane_count helper 2012-10-22 22:56:43 +02:00
atombios_encoders.c drm/radeon: fix eDP clk and lane setup for scaled modes 2012-12-07 19:48:23 -05:00
atombios_i2c.c UAPI: (Scripted) Convert #include "..." to #include <path/...> in drivers/gpu/ 2012-10-02 18:01:07 +01:00
atombios.h drm/radeon/kms: upstream power table updates 2012-03-21 06:55:50 +00:00
avivod.h
cayman_blit_shaders.c bug.h: add include of it to various implicit C users 2012-02-29 17:15:08 -05:00
cayman_blit_shaders.h drm/radeon/kms: add blit support for cayman (v2) 2011-05-26 09:19:31 +10:00
evergreen_blit_kms.c UAPI: (Scripted) Convert #include "..." to #include <path/...> in drivers/gpu/ 2012-10-02 18:01:07 +01:00
evergreen_blit_shaders.c bug.h: add include of it to various implicit C users 2012-02-29 17:15:08 -05:00
evergreen_blit_shaders.h
evergreen_cs.c drm/radeon: add WAIT_UNTIL to evergreen VM safe reg list 2012-12-21 11:12:39 -05:00
evergreen_hdmi.c UAPI: (Scripted) Convert #include "..." to #include <path/...> in drivers/gpu/ 2012-10-02 18:01:07 +01:00
evergreen_reg.h drm/radeon: properly handle mc_stop/mc_resume on evergreen+ (v2) 2012-09-20 13:10:33 -04:00
evergreen.c drm/radeon: switch to a finer grained reset for evergreen 2013-01-03 21:28:49 -05:00
evergreend.h drm/radeon: switch to a finer grained reset for evergreen 2013-01-03 21:28:49 -05:00
Kconfig drm/radeon/kms: clean up the radeon kms Kconfig 2011-05-26 09:22:05 +10:00
Makefile drm/radeon: add PRIME support (v2) 2012-05-23 10:47:11 +01:00
mkregtable.c radeon mkregtable: Add missing fclose() calls 2011-02-14 09:22:54 +10:00
ni_reg.h drm/radeon/kms: add ni_reg.h 2011-01-07 14:11:38 +10:00
ni.c drm/radeon: switch to a finer grained reset for cayman/TN 2013-01-03 21:29:14 -05:00
nid.h drm/radeon: reset dma engine on gpu reset (v2) 2013-01-03 13:18:41 -05:00
ObjectID.h drm/radeon/kms: Upstream ObjectID.h updates 2012-03-21 06:55:49 +00:00
r100_track.h drm/radeon: Remove more bogus inlines in the radeon driver. 2011-10-18 09:44:52 +01:00
r100.c drm/radeon: make indirect register access concurrency-safe 2012-12-14 10:45:23 -05:00
r100d.h drm/radeon: Definition of R_0003C2_GENMO_WT seems wrong 2010-12-21 12:55:33 +10:00
r200.c UAPI: (Scripted) Convert #include "..." to #include <path/...> in drivers/gpu/ 2012-10-02 18:01:07 +01:00
r300_cmdbuf.c UAPI: (Scripted) Convert #include "..." to #include <path/...> in drivers/gpu/ 2012-10-02 18:01:07 +01:00
r300_reg.h Fix common misspellings 2011-03-31 11:26:23 -03:00
r300.c Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux 2012-10-03 23:29:23 -07:00
r300d.h drm/radeon/kms: manage r300 CMASK RAM access and allow CMASK clear 2011-01-06 13:00:45 +10:00
r420.c UAPI: (Scripted) Convert #include "..." to #include <path/...> in drivers/gpu/ 2012-10-02 18:01:07 +01:00
r420d.h
r500_reg.h drm/radeon/kms: add wait_for_vblank asic callback 2012-02-27 14:46:13 +00:00
r520.c Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux 2012-10-03 23:29:23 -07:00
r520d.h
r600_audio.c UAPI: (Scripted) Convert #include "..." to #include <path/...> in drivers/gpu/ 2012-10-02 18:01:07 +01:00
r600_blit_kms.c Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux 2012-10-03 23:29:23 -07:00
r600_blit_shaders.c The following text was taken from the original review request: 2012-03-24 10:08:39 -07:00
r600_blit_shaders.h Annotate int2float() as being a pure function. 2012-09-20 13:10:34 -04:00
r600_blit.c Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux 2012-10-03 23:29:23 -07:00
r600_cp.c drm/radeon: Use hweight32 2012-11-20 16:06:18 +10:00
r600_cs.c radeon/kms: fix dma relocation checking 2013-01-10 17:05:38 -05:00
r600_hdmi.c Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux 2012-10-03 23:29:23 -07:00
r600_reg.h drm/radeon: improve mc_stop/mc_resume on r5xx-r7xx 2012-12-12 14:34:08 -05:00
r600.c drm/radeon: split r6xx and r7xx copy_dma functions 2013-01-04 09:29:54 -05:00
r600d.h drm/radeon: add register headers for CP DMA on r6xx-SI 2012-12-12 17:16:48 -05:00
radeon_acpi.c drm/radeon: fix compilation with backlight disabled 2012-10-15 13:21:00 -04:00
radeon_acpi.h drm/radeon: implement handler for ACPI event 2012-09-20 13:10:36 -04:00
radeon_agp.c radeon: add AGPMode 1 quirk for RV250 2012-11-20 11:47:32 -05:00
radeon_asic.c drm/radeon: split r6xx and r7xx copy_dma functions 2013-01-04 09:29:54 -05:00
radeon_asic.h drm/radeon: split r6xx and r7xx copy_dma functions 2013-01-04 09:29:54 -05:00
radeon_atombios.c Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux 2012-10-03 23:29:23 -07:00
radeon_atpx_handler.c drm/radeon: fix ATPX function documentation 2012-11-01 10:34:32 -04:00
radeon_benchmark.c drm/radeon: remove radeon_fence_create 2012-06-21 09:38:35 +02:00
radeon_bios.c UAPI: (Scripted) Convert #include "..." to #include <path/...> in drivers/gpu/ 2012-10-02 18:01:07 +01:00
radeon_blit_common.h drm/radeon/kms: common definitions for blit copy code 2012-02-03 09:31:14 +00:00
radeon_clocks.c UAPI: (Scripted) Convert #include "..." to #include <path/...> in drivers/gpu/ 2012-10-02 18:01:07 +01:00
radeon_combios.c drm/radeon: add connector table for Mac G4 Silver 2013-01-03 10:16:11 -05:00
radeon_connectors.c drm/radeon: Properly handle DDC probe for DP bridges 2013-01-03 15:04:38 -05:00
radeon_cp.c drm/radeon: add W|RREG32_IDX for MM_INDEX|DATA based mmio accesss 2012-12-14 10:45:22 -05:00
radeon_cs.c drm/radeon: fix error path in kpage allocation 2013-01-10 17:05:36 -05:00
radeon_cursor.c drm: only take the crtc lock for ->cursor_move 2013-01-20 22:16:57 +01:00
radeon_device.c drm/radeon: add quirk for d3 delay during switcheroo poweron for apple macbooks 2013-01-07 10:13:36 -05:00
radeon_display.c drm/<drivers>: reorder framebuffer init sequence 2013-01-20 15:29:24 +01:00
radeon_drv.c Drivers: gpu: remove __dev* attributes. 2013-01-03 15:57:15 -08:00
radeon_drv.h drm/radeon: add W|RREG32_IDX for MM_INDEX|DATA based mmio accesss 2012-12-14 10:45:22 -05:00
radeon_encoders.c Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux 2012-10-03 23:29:23 -07:00
radeon_family.h drm/radeon/kms: add trinity (TN) chip family 2012-03-21 06:55:55 +00:00
radeon_fb.c drm: revamp framebuffer cleanup interfaces 2013-01-20 22:17:00 +01:00
radeon_fence.c drm/radeon: avoid deadlock in pm path when waiting for fence 2012-12-19 17:44:05 -05:00
radeon_gart.c drm/radeon: allow move_notify to be called without reservation 2012-12-10 20:13:49 +10:00
radeon_gem.c drm/radeon: move the retry to gem_object_create 2012-10-24 11:41:56 -04:00
radeon_i2c.c drm/radeon: Properly handle DDC probe for DP bridges 2013-01-03 15:04:38 -05:00
radeon_ioc32.c Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux 2012-10-03 23:29:23 -07:00
radeon_irq_kms.c Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux 2012-10-03 23:29:23 -07:00
radeon_irq.c UAPI: (Scripted) Convert #include "..." to #include <path/...> in drivers/gpu/ 2012-10-02 18:01:07 +01:00
radeon_kms.c drm/radeon: add new INFO ioctl requests 2012-12-07 19:48:22 -05:00
radeon_legacy_crtc.c DRM/radeon: For single CRTC GPUs move handling of CRTC_CRT_ON to crtc_dpms(). 2012-11-01 10:34:34 -04:00
radeon_legacy_encoders.c radeon/kms: force rn50 chip to always report connected on analog output 2013-01-10 17:05:37 -05:00
radeon_legacy_tv.c UAPI: (Scripted) Convert #include "..." to #include <path/...> in drivers/gpu/ 2012-10-02 18:01:07 +01:00
radeon_mem.c UAPI: (Scripted) Convert #include "..." to #include <path/...> in drivers/gpu/ 2012-10-02 18:01:07 +01:00
radeon_mode.h drm/radeon: Properly handle DDC probe for DP bridges 2013-01-03 15:04:38 -05:00
radeon_object.c radeon: fix regression with eviction since evict caching changes 2012-12-14 10:45:28 -05:00
radeon_object.h drm/radeon: Use ttm_bo_is_reserved 2012-11-07 10:58:14 +10:00
radeon_pm.c drm/radeon: avoid deadlock in pm path when waiting for fence 2012-12-19 17:44:05 -05:00
radeon_prime.c drm/prime: drop reference on imported dma-buf come from gem 2013-01-08 14:41:53 +10:00
radeon_reg.h drm/radeon/kms: fix up atom HPD gpio parsing for DCE6 2012-03-21 06:55:50 +00:00
radeon_ring.c drm/radeon: improve ring debugfs printing 2013-01-03 13:18:40 -05:00
radeon_sa.c Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux 2012-10-03 23:29:23 -07:00
radeon_semaphore.c UAPI: (Scripted) Convert #include "..." to #include <path/...> in drivers/gpu/ 2012-10-02 18:01:07 +01:00
radeon_state.c UAPI: (Scripted) Convert #include "..." to #include <path/...> in drivers/gpu/ 2012-10-02 18:01:07 +01:00
radeon_test.c drm/radeon/kms: add support for dma rings to radeon_test_moves() 2012-12-10 16:53:47 -05:00
radeon_trace_points.c UAPI: (Scripted) Convert #include "..." to #include <path/...> in drivers/gpu/ 2012-10-02 18:01:07 +01:00
radeon_trace.h drm/radeon: add initial tracepoint support. 2010-12-16 14:37:47 +10:00
radeon_ttm.c drm/ttm: remove no_wait_reserve, v3 2012-12-10 20:21:30 +10:00
radeon.h drm/radeon: add GPU reset flags 2013-01-03 21:27:54 -05:00
rs100d.h
rs400.c drm/radeon: Mark all possible functions / structs as static 2012-09-20 13:10:41 -04:00
rs400d.h
rs600.c Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux 2012-10-03 23:29:23 -07:00
rs600d.h drm/radeon/kms: add register definitions for audio 2012-04-24 09:50:13 +01:00
rs690.c Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux 2012-10-03 23:29:23 -07:00
rs690d.h
rv200d.h
rv250d.h
rv350d.h
rv515.c drm/radeon: improve mc_stop/mc_resume on r5xx-r7xx 2012-12-12 14:34:08 -05:00
rv515d.h
rv770.c drm/radeon: split r6xx and r7xx copy_dma functions 2013-01-04 09:29:54 -05:00
rv770d.h drm/radeon/kms: Add initial support for async DMA on r6xx/r7xx 2012-12-10 16:53:23 -05:00
si_blit_shaders.c The following text was taken from the original review request: 2012-03-24 10:08:39 -07:00
si_blit_shaders.h drm/radeon/kms: add support for CP setup on SI 2012-03-21 06:55:54 +00:00
si_reg.h drm/radeon: SI tiling fixes for display 2012-06-20 19:55:56 +01:00
si.c drm/radeon: switch to a finer grained reset for SI (v2) 2013-01-03 21:29:35 -05:00
sid.h drm/radeon: reset dma engine on gpu reset (v2) 2013-01-03 13:18:41 -05:00