OpenCloudOS-Kernel/drivers/gpu/drm
Daniel Vetter 5cef29aa52 drm: fix fb leak in setcrtc
Drivers are allowed (actually have to) disable unrelated crtcs in
their ->set_config callback (when we steal all the connectors from
that crtc). If they do that they'll clear crtc->fb to NULL.

Which results in a refcount leak, since the drm core is keeping track
of that reference.

To fix this track the old fb of all crtcs and adjust references for
all of them. Of course, since we only hold an additional reference for
the fb for the current crtc we need to increase refcounts before we
drop the old one.

This approach has the benefit that it inches us a bit closer to an
atomic modeset world, where we want to update the config of all crtcs
in one step.

This regression has been introduce in the framebuffer refcount
conversion, specifically in

commit b0d1232589
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Tue Dec 11 01:07:12 2012 +0100

    drm: refcounting for crtc framebuffers

Reported-by: Russell King <linux@arm.linux.org.uk>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: stable@vger.kernel.org
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-06-25 13:04:11 +10:00
..
ast drm (ast, cirrus, mgag200, nouveau, savage, vmwgfx): Remove drm_mtrr_{add, del} 2013-05-31 13:02:54 +10:00
cirrus drm (ast, cirrus, mgag200, nouveau, savage, vmwgfx): Remove drm_mtrr_{add, del} 2013-05-31 13:02:54 +10:00
exynos drm: Drop all the stub gamma_get, gamma_set, load_lut functions from drivers 2013-06-17 19:42:47 +10:00
gma500 Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux 2013-05-02 19:40:34 -07:00
i2c drm/i2c: nxp-tda998x (v3) 2013-02-19 17:57:44 -05:00
i810
i915 drm/i915: Drop bogus fbdev sprite disable code 2013-06-17 19:42:45 +10:00
mga
mgag200 drm/mgag200: Don't do full cleanup if mgag200_device_init fails 2013-06-17 19:42:49 +10:00
nouveau drm (ast, cirrus, mgag200, nouveau, savage, vmwgfx): Remove drm_mtrr_{add, del} 2013-05-31 13:02:54 +10:00
omapdrm drm: Drop all the stub gamma_get, gamma_set, load_lut functions from drivers 2013-06-17 19:42:47 +10:00
qxl drm: Drop all the stub gamma_get, gamma_set, load_lut functions from drivers 2013-06-17 19:42:47 +10:00
r128
radeon radeon: Switch to arch_phys_wc_add and add a missing ..._del 2013-05-31 13:37:34 +10:00
savage drm (ast, cirrus, mgag200, nouveau, savage, vmwgfx): Remove drm_mtrr_{add, del} 2013-05-31 13:02:54 +10:00
shmobile drm/shmobile: Drop usage of removed drm_plane enabled field 2013-06-20 14:06:39 +10:00
sis drm/sis: convert to idr_alloc() 2013-02-27 19:10:16 -08:00
tdfx
tilcdc gpu:drm:tilcdc: get preferred_bpp value from DT 2013-06-20 14:08:01 +10:00
ttm drm: use vma_pages() to replace (vm_end - vm_start) >> PAGE_SHIFT 2013-04-16 13:14:00 +10:00
udl drm: Drop all the stub gamma_get, gamma_set, load_lut functions from drivers 2013-06-17 19:42:47 +10:00
via drm/via: convert to idr_alloc() 2013-02-27 19:10:16 -08:00
vmwgfx drm/vmwgfx: Don't access file_priv in cursor_set when handle==0 2013-06-11 08:47:32 +10:00
Kconfig drm/tegra: Move drm to live under host1x 2013-04-22 12:39:11 +02:00
Makefile Linux 3.10-rc2 2013-05-21 09:52:16 +02:00
README.drm
ati_pcigart.c
drm_agpsupport.c
drm_auth.c
drm_buffer.c
drm_bufs.c drm: Don't leak phys_wc "handles" to userspace 2013-05-31 13:37:39 +10:00
drm_cache.c lib/scatterlist: sg_page_iter: support sg lists w/o backing pages 2013-03-27 17:13:44 +01:00
drm_context.c drm: convert to idr_alloc() 2013-02-27 19:10:15 -08:00
drm_crtc.c drm: fix fb leak in setcrtc 2013-06-25 13:04:11 +10:00
drm_crtc_helper.c drm/crtc-helper: explicit DPMS on after modeset 2013-06-25 11:01:30 +10:00
drm_debugfs.c
drm_dma.c
drm_dp_helper.c
drm_drv.c drm: Use names of ioctls in debug traces 2013-05-10 14:46:50 +10:00
drm_edid.c drm/edid: Add both 60Hz and 59.94Hz CEA modes to connector's mode list 2013-06-11 08:51:31 +10:00
drm_edid_load.c drm: Cocci spatch "memdup.spatch" 2013-06-11 08:29:22 +10:00
drm_encoder_slave.c drm: refactor call to request_module 2013-05-10 14:46:03 +10:00
drm_fb_cma_helper.c Merge branch 'tilcdc-next' of git://people.freedesktop.org/~robclark/linux into drm-next 2013-02-21 09:31:47 +10:00
drm_fb_helper.c drm/fb-helper: Make load_lut and gamma_set/gamma_get hooks optional 2013-06-17 19:42:47 +10:00
drm_fops.c drm: correctly restore mappings if drm_open fails 2013-04-03 06:44:38 +10:00
drm_gem.c drm/gem: Split drm_gem_mmap() into object search and object mapping 2013-06-08 09:14:03 +02:00
drm_gem_cma_helper.c drm/cma: Cocci spatch "ptr_ret.spatch" 2013-06-11 08:30:54 +10:00
drm_global.c
drm_hashtab.c hlist: drop the node parameter from iterators 2013-02-27 19:10:24 -08:00
drm_info.c
drm_ioc32.c
drm_ioctl.c drm: Don't leak phys_wc "handles" to userspace 2013-05-31 13:37:39 +10:00
drm_irq.c drm: small fix in drm_send_vblank_event() 2013-02-17 17:55:42 -05:00
drm_lock.c
drm_memory.c
drm_mm.c drm/mm: fix dump table BUG 2013-04-30 15:15:58 +02:00
drm_modes.c drm: Sort connector modes based on vrefresh 2013-06-11 08:35:51 +10:00
drm_pci.c drm, agpgart: Use pgprot_writecombine for AGP maps and make the MTRR optional 2013-05-31 13:37:31 +10:00
drm_platform.c
drm_prime.c drm/prime: Cocci spatch "err_cast.spatch" 2013-06-11 08:30:49 +10:00
drm_proc.c drm: proc: Use remove_proc_subtree() 2013-05-01 17:29:44 -04:00
drm_rect.c drm: Add drm_rect_debug_print() 2013-04-30 22:20:00 +02:00
drm_scatter.c
drm_stub.c drm, agpgart: Use pgprot_writecombine for AGP maps and make the MTRR optional 2013-05-31 13:37:31 +10:00
drm_sysfs.c drm: remove legacy drm_connector_property fxns 2012-11-30 10:30:48 -06:00
drm_trace.h
drm_trace_points.c
drm_usb.c drm/usb: bind driver to correct device 2013-02-07 12:37:41 +10:00
drm_vm.c drm_vm: drop explicit VM_IO setting 2013-06-24 06:26:50 +10:00

README.drm

************************************************************
* For the very latest on DRI development, please see:      *
*     http://dri.freedesktop.org/                          *
************************************************************

The Direct Rendering Manager (drm) is a device-independent kernel-level
device driver that provides support for the XFree86 Direct Rendering
Infrastructure (DRI).

The DRM supports the Direct Rendering Infrastructure (DRI) in four major
ways:

    1. The DRM provides synchronized access to the graphics hardware via
       the use of an optimized two-tiered lock.

    2. The DRM enforces the DRI security policy for access to the graphics
       hardware by only allowing authenticated X11 clients access to
       restricted regions of memory.

    3. The DRM provides a generic DMA engine, complete with multiple
       queues and the ability to detect the need for an OpenGL context
       switch.

    4. The DRM is extensible via the use of small device-specific modules
       that rely extensively on the API exported by the DRM module.


Documentation on the DRI is available from:
    http://dri.freedesktop.org/wiki/Documentation
    http://sourceforge.net/project/showfiles.php?group_id=387
    http://dri.sourceforge.net/doc/

For specific information about kernel-level support, see:

    The Direct Rendering Manager, Kernel Support for the Direct Rendering
    Infrastructure
    http://dri.sourceforge.net/doc/drm_low_level.html

    Hardware Locking for the Direct Rendering Infrastructure
    http://dri.sourceforge.net/doc/hardware_locking_low_level.html

    A Security Analysis of the Direct Rendering Infrastructure
    http://dri.sourceforge.net/doc/security_low_level.html