linux-stable/include/uapi/drm
Akash Goel 1816f92363 drm/i915: Support creation of unbound wc user mappings for objects
This patch provides support to create write-combining virtual mappings of
GEM object. It intends to provide the same funtionality of 'mmap_gtt'
interface without the constraints and contention of a limited aperture
space, but requires clients handles the linear to tile conversion on their
own. This is for improving the CPU write operation performance, as with such
mapping, writes and reads are almost 50% faster than with mmap_gtt. Similar
to the GTT mmapping, unlike the regular CPU mmapping, it avoids the cache
flush after update from CPU side, when object is passed onto GPU.  This
type of mapping is specially useful in case of sub-region update,
i.e. when only a portion of the object is to be updated. Using a CPU mmap
in such cases would normally incur a clflush of the whole object, and
using a GTT mmapping would likely require eviction of an active object or
fence and thus stall. The write-combining CPU mmap avoids both.

To ensure the cache coherency, before using this mapping, the GTT domain
has been reused here. This provides the required cache flush if the object
is in CPU domain or synchronization against the concurrent rendering.
Although the access through an uncached mmap should automatically
invalidate the cache lines, this may not be true for non-temporal write
instructions and also not all pages of the object may be updated at any
given point of time through this mapping.  Having a call to get_pages in
set_to_gtt_domain function, as added in the earlier patch 'drm/i915:
Broaden application of set-domain(GTT)', would guarantee the clflush and
so there will be no cachelines holding the data for the object before it
is accessed through this map.

The drm_i915_gem_mmap structure (for the DRM_I915_GEM_MMAP_IOCTL) has been
extended with a new flags field (defaulting to 0 for existent users). In
order for userspace to detect the extended ioctl, a new parameter
I915_PARAM_MMAP_VERSION has been added for versioning the ioctl interface.

v2: Fix error handling, invalid flag detection, renaming (ickle)

v3: Rebase to latest drm-intel-nightly codebase

The new mmapping is exercised by igt/gem_mmap_wc,
igt/gem_concurrent_blit and igt/gem_gtt_speed.

Change-Id: Ie883942f9e689525f72fe9a8d3780c3a9faa769a
Signed-off-by: Akash Goel <akash.goel@intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-01-06 09:08:00 +01:00
..
armada_drm.h DRM: Armada: Add Armada DRM driver 2013-10-12 10:13:40 +01:00
drm.h drm: Driver-specific ioctls range from 0x40 to 0x9f 2014-06-18 13:50:16 +02:00
drm_fourcc.h
drm_mode.h drm: s/enum_blob_list/enum_list/ in drm_property 2014-11-20 11:35:21 +10:00
drm_sarea.h
exynos_drm.h drm/exynos: use drm generic mmap interface 2014-09-20 01:00:13 +09:00
i810_drm.h
i915_drm.h drm/i915: Support creation of unbound wc user mappings for objects 2015-01-06 09:08:00 +01:00
Kbuild drm/msm: add a3xx gpu support 2013-08-24 14:57:18 -04:00
mga_drm.h
msm_drm.h drm/msm: validate flags, etc 2014-03-31 10:27:46 -04:00
nouveau_drm.h drm/nouveau: expose the full object/event interfaces to userspace 2014-08-10 05:28:18 +10:00
omap_drm.h drm/omap: move out of staging 2013-02-16 17:38:06 -05:00
qxl_drm.h drm: add new QXL driver. (v1.4) 2013-04-12 13:51:07 +10:00
r128_drm.h
radeon_drm.h drm/radeon: add RADEON_GEM_NO_CPU_ACCESS BO creation flag (v4) 2014-09-10 11:29:46 -04:00
savage_drm.h
sis_drm.h
tegra_drm.h drm/tegra: Add SET/GET_FLAGS IOCTLs 2014-08-04 10:07:35 +02:00
via_drm.h
vmwgfx_drm.h drm/vmwgfx: Fix drm.h include 2014-09-12 13:57:49 +10:00