linux-stable/drivers/gpu/drm
Matt Roper 161d0dc1dc drm: Support legacy cursor ioctls via universal planes when possible (v4)
If drivers support universal planes and have registered a cursor plane
with the DRM core, we should use that universal plane support when
handling legacy cursor ioctls.  Drivers that transition to universal
planes won't have to maintain separate legacy ioctl handling; drivers
that don't transition to universal planes will continue to operate
without any change to behavior.

Note that there's a bit of a mismatch between the legacy cursor ioctls
and the universal plane API's --- legacy ioctl's use driver buffer
handles directly whereas the universal plane API takes drm_framebuffers.
Since there's no way to recover the driver handle from a
drm_framebuffer, we can implement legacy ioctl's in terms of universal
plane interfaces, but cannot implement universal plane interfaces in
terms of legacy ioctls.  Specifically, there's no way to create a
general cursor helper in the way we previously created a primary plane
helper.

It's important to land this patch before any patches that add universal
cursor support to individual drivers so that drivers don't have to worry
about juggling two different styles of reference counting for cursor
buffers when userspace mixes and matches legacy and universal cursor
calls.  With this patch, a driver that switches to universal cursor
support may assume that all cursor buffers are wrapped in a
drm_framebuffer and can rely on framebuffer reference counting for all
cursor operations.

v4:
 - Add comments pointing out setplane_internal's reference-eating
   semantics.
v3:
 - Drop drm_mode_rmfb() call that is no longer needed now that we're
   using setplane_internal(), which takes care of deref'ing the
   appropriate framebuffer.
v2:
 - Use new add_framebuffer_internal() function to create framebuffer
   rather than trying to call directly into the ioctl interface and
   look up the handle returned.
 - Use new setplane_internal() function to update the cursor plane
   rather than calling through the ioctl interface.  Note that since
   we're no longer looking up an fb_id, no extra reference will be
   taken here.
 - Grab extra reference to fb under lock in !BO case to avoid issues
   where racing userspace could cause the fb to be destroyed out from
   under us after we grab the fb pointer.

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Reviewed-by: Pallavi G<pallavi.g@intel.com>
Acked-by: Dave Airlie <airlied@linux.ie>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-06-13 17:45:21 +02:00
..
armada drm: Remove DRM_ARRAY_SIZE() for ARRAY_SIZE() 2014-06-10 09:36:17 +10:00
ast drm: Remove spurious ';' 2014-06-10 09:35:42 +10:00
bochs drm/bochs: Remove unecessary NULL check in gem_free 2014-04-22 15:39:40 +02:00
bridge drm: make mode_valid callback optional 2014-04-22 11:18:12 +02:00
cirrus Merge tag 'topic/core-stuff-2014-05-05' of git://anongit.freedesktop.org/drm-intel into drm-next 2014-05-16 11:47:13 +10:00
exynos drm: Remove DRM_ARRAY_SIZE() for ARRAY_SIZE() 2014-06-10 09:36:17 +10:00
gma500 drm: Remove DRM_ARRAY_SIZE() for ARRAY_SIZE() 2014-06-10 09:36:17 +10:00
i2c drm/i2c/tda998x: Fix signed overflow issue 2014-04-22 15:39:41 +02:00
i810 drm: Remove DRM_ARRAY_SIZE() for ARRAY_SIZE() 2014-06-10 09:36:17 +10:00
i915 drm/i915/chv: Fix "drm/i915/chv: Add a bunch of pre production workarounds" 2014-06-13 17:45:19 +02:00
mga drm: Remove DRM_ARRAY_SIZE() for ARRAY_SIZE() 2014-06-10 09:36:17 +10:00
mgag200 drm/mgag200: Remove unecessary NULL check in gem_free 2014-04-22 15:39:04 +02:00
msm drm: add drm_fb_helper_restore_fbdev_mode_unlocked() 2014-06-05 10:02:40 +10:00
nouveau Merge branch 'drm-nouveau-next' of git://anongit.freedesktop.org/git/nouveau/linux-2.6 into drm-next 2014-06-11 16:28:10 +10:00
omapdrm drm: add drm_fb_helper_restore_fbdev_mode_unlocked() 2014-06-05 10:02:40 +10:00
panel drm/panel: simple - Add AUO B133XTN01 panel support 2014-06-09 12:17:21 +02:00
qxl drm: Remove DRM_ARRAY_SIZE() for ARRAY_SIZE() 2014-06-10 09:36:17 +10:00
r128 drm: Remove DRM_ARRAY_SIZE() for ARRAY_SIZE() 2014-06-10 09:36:17 +10:00
radeon Merge branch 'drm-next-3.16' of git://people.freedesktop.org/~agd5f/linux into drm-next 2014-06-10 13:09:01 +10:00
rcar-du drm/rcar-du: Add run-time dependencies 2014-05-27 15:46:36 +10:00
savage drm: Remove DRM_ARRAY_SIZE() for ARRAY_SIZE() 2014-06-10 09:36:17 +10:00
shmobile drm/shmobile: Add run-time dependencies 2014-05-27 15:47:07 +10:00
sis drm: Remove DRM_ARRAY_SIZE() for ARRAY_SIZE() 2014-06-10 09:36:17 +10:00
tdfx
tegra drm/tegra: sor - Remove obsolete comment 2014-06-09 12:02:51 +02:00
tilcdc drm: pass the irq explicitly to drm_irq_install 2014-04-23 10:32:50 +02:00
ttm
udl drm/udl: Initialize ret in udl_driver_load 2014-04-22 15:39:37 +02:00
via drm: Remove DRM_ARRAY_SIZE() for ARRAY_SIZE() 2014-06-10 09:36:17 +10:00
vmwgfx drm: Remove DRM_ARRAY_SIZE() for ARRAY_SIZE() 2014-06-10 09:36:17 +10:00
ati_pcigart.c
drm_agpsupport.c
drm_auth.c
drm_buffer.c
drm_bufs.c Merge tag 'topic/core-stuff-2014-05-05' of git://anongit.freedesktop.org/drm-intel into drm-next 2014-05-16 11:47:13 +10:00
drm_cache.c drm: Missed clflushopt in drm_clflush_virt_range 2014-06-02 09:57:31 +02:00
drm_context.c
drm_crtc.c drm: Support legacy cursor ioctls via universal planes when possible (v4) 2014-06-13 17:45:21 +02:00
drm_crtc_helper.c Merge commit '9e9a928eed8796a0a1aaed7e0b676db86ba84594' into drm-next 2014-06-05 20:28:59 +10:00
drm_crtc_internal.h
drm_debugfs.c
drm_dma.c
drm_dp_helper.c drm/dp: add a hw mutex around the transfer functions. (v2) 2014-06-05 09:54:29 +10:00
drm_drv.c
drm_edid.c drm/edid: Store all supported hdmi deep color modes in drm_display_info 2014-06-09 22:06:49 -04:00
drm_edid_load.c drm: replace drm_get_connector_name() with direct name field use 2014-06-04 13:17:41 +10:00
drm_encoder_slave.c
drm_fb_cma_helper.c drm: add drm_fb_helper_restore_fbdev_mode_unlocked() 2014-06-05 10:02:40 +10:00
drm_fb_helper.c drm: add drm_fb_helper_restore_fbdev_mode_unlocked() 2014-06-05 10:02:40 +10:00
drm_flip_work.c
drm_fops.c drm: remove unused argument from drm_open_helper 2014-04-28 23:50:59 +02:00
drm_gem.c drm/gem: replace misleading comment 2014-05-27 15:50:57 +10:00
drm_gem_cma_helper.c
drm_global.c
drm_hashtab.c
drm_info.c drm: remove drm_bus->get_name 2014-04-23 10:32:53 +02:00
drm_ioc32.c
drm_ioctl.c drm: Introduce drm_dev_set_unique() 2014-06-05 23:14:32 +02:00
drm_irq.c drm/irq: Coding style fix 2014-05-22 14:10:39 +02:00
drm_lock.c
drm_memory.c
drm_mipi_dsi.c drm/dsi: Support device shutdown 2014-06-05 16:42:19 +02:00
drm_mm.c drm/mm: Don't WARN if drm_mm_reserve_node 2014-04-10 10:54:47 +03:00
drm_modes.c drm: try harder to avoid regression when merging mode bits 2014-05-01 09:26:53 +10:00
drm_modeset_lock.c drm: convert crtc and connection_mutex to ww_mutex (v5) 2014-06-05 09:54:33 +10:00
drm_panel.c
drm_pci.c drm: Add device registration documentation 2014-06-05 23:14:38 +02:00
drm_plane_helper.c drm/plane-helper: Add drm_plane_helper_check_update() (v3) 2014-06-05 08:52:43 +02:00
drm_platform.c drm: Add device registration documentation 2014-06-05 23:14:38 +02:00
drm_prime.c
drm_probe_helper.c drm: replace drm_get_connector_name() with direct name field use 2014-06-04 13:17:41 +10:00
drm_rect.c
drm_scatter.c
drm_stub.c drm: Add device registration documentation 2014-06-05 23:14:38 +02:00
drm_sysfs.c drm: replace drm_get_connector_name() with direct name field use 2014-06-04 13:17:41 +10:00
drm_trace.h
drm_trace_points.c
drm_usb.c drm: Add device registration documentation 2014-06-05 23:14:38 +02:00
drm_vm.c
drm_vma_manager.c
Kconfig drm/exynos: Fix PTN3460 dependency 2014-06-02 02:07:10 +09:00
Makefile drm: convert crtc and connection_mutex to ww_mutex (v5) 2014-06-05 09:54:33 +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