On Thu, Jun 14, 2012 at 12:24:55PM +0200, Daniel Vetter wrote:
Hi all,
Blind me has finally found the bug that killed via - dropping locks again in the early exit path is highly advised ;-)
The big part of this series is cleaning up buffer handling in the teardown/lastclose path: All special-cases only used by 1-2 drivers are moved into the drivers respective preclose functions (newly created in most cases), the remaining stuff is streamlined. The only things left in the common code which is not used by all drivers is used by at least a few of them.
So after this patch series the drm_release/lastclose stuff is now fairly readable and understandable. Originally I wanted to fix up a few of the resource leaks that are possible at module unload time, but got stuck at understanding the release/lastclose stuff ;-)
4 drivers needed special treatement, unfortunately I couldn't get a tested by for sis. I've tried to ebay one of these old cards and found one that works with the sisfb and sis ddx driver, but unfortunately the sis mesa driver only supports one specific generations. But since drm/sis is more or less a 1:1 copy of drm/via I'm fairly sure that this will work, too.
The last two patches just kill stuff that I've noticed while crawling around in the close/release paths.
As usual, comments, flames, reviews (and especially from a sis users) tested-bys highly welcome.
Yours, Daniel
Reprod for inclusion into 3.6. Has been tested on all affected drivers by some random people (and me), and imo really nicely shoves some horrible stuff into driver-private close callbacks. Heck, I like this so much that I've ebayed myself through a few sis cards until I've found one that actually worked. And then fixed the sis driver for 64bit ;-)
Note that the procfs patch is bogus, after some prodding by you on irc we've dug up a few scripts that rely on this. And some strange tools in libdrm.git to read out the procfs debug files and cat them together. So don't include that one - it's smells like a mild form of abi breakage.
Cheers, Daniel
Daniel Vetter (12): drm/via: clean up reclaim_buffers drm/sis: clean up reclaim_buffers drm: kill reclaim_buffers_idlelocked functions Revert "Revert "drm/i810: cleanup reclaim_buffers"" drm: kill reclaim_buffers_locked drm/savage: clean up reclaim_buffers drm: kill reclaim_buffers callback drm: ditch strange DRIVER_DMA_QUEUE only error bail-out drm: kill dma queue support drm: unconditionally clean up dma buffers of closing clients drm: kill i915/i830 ids from drm_pciids.h drm: kill procfs support
drivers/gpu/drm/Makefile | 2 +- drivers/gpu/drm/drm_bufs.c | 16 +-- drivers/gpu/drm/drm_debugfs.c | 1 - drivers/gpu/drm/drm_dma.c | 5 - drivers/gpu/drm/drm_drv.c | 19 --- drivers/gpu/drm/drm_fops.c | 63 +--------- drivers/gpu/drm/drm_info.c | 36 ------ drivers/gpu/drm/drm_lock.c | 4 - drivers/gpu/drm/drm_proc.c | 221 --------------------------------- drivers/gpu/drm/drm_stub.c | 25 ++-- drivers/gpu/drm/gma500/psb_drv.c | 1 - drivers/gpu/drm/i810/i810_dma.c | 17 ++- drivers/gpu/drm/i810/i810_drv.c | 3 +- drivers/gpu/drm/i810/i810_drv.h | 6 +- drivers/gpu/drm/i915/i915_drv.c | 1 - drivers/gpu/drm/mga/mga_drv.c | 1 - drivers/gpu/drm/nouveau/nouveau_drv.c | 1 - drivers/gpu/drm/r128/r128_drv.c | 1 - drivers/gpu/drm/radeon/radeon_drv.c | 2 - drivers/gpu/drm/savage/savage_bci.c | 9 +- drivers/gpu/drm/savage/savage_drv.c | 2 +- drivers/gpu/drm/sis/sis_drv.c | 3 +- drivers/gpu/drm/sis/sis_mm.c | 13 +- drivers/gpu/drm/tdfx/tdfx_drv.c | 1 - drivers/gpu/drm/via/via_drv.c | 4 +- drivers/gpu/drm/via/via_mm.c | 13 +- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 1 - include/drm/drmP.h | 23 +--- include/drm/drm_pciids.h | 42 ------- 29 files changed, 60 insertions(+), 476 deletions(-) delete mode 100644 drivers/gpu/drm/drm_proc.c
-- 1.7.10