linux/drivers/gpu/drm
Chris Wilson d18b961903 drm/i915: Fix incoherence with fence updates on Sandybridge+
This hopefully fixes the root cause behind the workaround added in

commit 25ff1195f8
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu Apr 4 21:31:03 2013 +0100

    drm/i915: Workaround incoherence between fences and LLC across multiple CPUs

Thanks to further investigation by Jon Bloomfield, he realised that
the 64-bit register might be broken up by the hardware into two 32-bit
writes (a problem we have encountered elsewhere). This non-atomicity
would then cause an issue where a second thread would see an
intermediate register state (new high dword, old low dword), and this
register would randomly be used in preference to its own thread register.
This would cause the second thread to read from and write into a fairly
random tiled location.  Breaking the operation into 3 explicit 32-bit
updates (first disable the fence, poke the upper bits, then poke the lower
bits and enable) ensures that, given proper serialisation between the
32-bit register write and the memory transfer, that the fence value is
always consistent.

Armed with this knowledge, we can explain how the previous workaround
work. The key to the corruption is that a second thread sees an
erroneous fence register that conflicts and overrides its own. By
serialising the fence update across all CPUs, we have a small window
where no GTT access is occurring and so hide the potential corruption.
This also leads to the conclusion that the earlier workaround was
incomplete.

v2: Be overly paranoid about the order in which fence updates become
visible to the GPU to make really sure that we turn the fence off before
doing the update, and then only switch the fence on afterwards.

Signed-off-by: Jon Bloomfield <jon.bloomfield@intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Carsten Emde <C.Emde@osadl.org>
Cc: stable@vger.kernel.org
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-07-10 14:41:46 +02:00
..
ast drm/ast: inline reservations 2013-06-28 12:04:04 +10:00
cirrus drm/cirrus: inline reservations 2013-06-28 12:04:05 +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 'gma500-fixes' of git://github.com/patjak/drm-gma500 into drm-fixes 2013-06-11 08:16:10 +10:00
i2c
i810
i915 drm/i915: Fix incoherence with fence updates on Sandybridge+ 2013-07-10 14:41:46 +02:00
mga
mgag200 drm/mgag200: inline reservations 2013-06-28 12:04:06 +10:00
nouveau drm/ttm: convert to the reservation api 2013-06-28 12:04:01 +10:00
omapdrm drm/gem: add mutex lock when using drm_gem_mmap_obj 2013-06-28 12:30:15 +10:00
qxl drm/ttm: convert to the reservation api 2013-06-28 12:04:01 +10:00
r128
radeon drm/radeon: get rid of ttm_bo_is_reserved usage 2013-06-28 12:04:12 +10:00
rcar-du drm: Renesas R-Car Display Unit DRM driver 2013-06-27 10:08:04 +10:00
savage
shmobile drm/shmobile: Enable compilation on all ARM platforms 2013-06-20 10:07:14 +02:00
sis
tdfx
tilcdc drm/tilcdc: Clear bits of register we're going to set. 2013-06-28 09:13:00 +10:00
ttm drm/ttm: get rid of ttm_bo_is_reserved usage 2013-06-28 12:04:10 +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
vmwgfx drm/vmwgfx: get rid of ttm_bo_is_reserved usage 2013-06-28 12:04:14 +10:00
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
drm_context.c
drm_crtc.c drm: add hotspot support for cursors. 2013-06-28 09:13:39 +10:00
drm_crtc_helper.c Revert "drm: kms_helper: don't lose hotplug event" 2013-06-28 20:31:34 +10:00
drm_debugfs.c
drm_dma.c
drm_dp_helper.c
drm_drv.c drm: add hotspot support for cursors. 2013-06-28 09:13:39 +10:00
drm_edid.c drm/edid: Don't print messages regarding stereo or csync by default 2013-06-27 21:15:44 +10:00
drm_edid_load.c drm: Cocci spatch "memdup.spatch" 2013-06-11 08:29:22 +10:00
drm_encoder_slave.c
drm_fb_cma_helper.c
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_gem.c drm/gem: fix not to assign error value to gem name 2013-06-28 12:31:23 +10:00
drm_gem_cma_helper.c drm/gem: add mutex lock when using drm_gem_mmap_obj 2013-06-28 12:30:15 +10:00
drm_global.c
drm_hashtab.c
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: fix a use-after-free when GPU acceleration disabled 2013-06-03 19:12:04 +10:00
drm_lock.c
drm_memory.c
drm_mm.c
drm_modes.c drm: Sort connector modes based on vrefresh 2013-06-11 08:35:51 +10:00
drm_pci.c
drm_platform.c
drm_prime.c drm/prime: add return check for dma_buf_fd 2013-06-28 14:43:04 +10:00
drm_proc.c
drm_rect.c
drm_scatter.c
drm_stub.c drm: drm_stub: Fixing return value if driver master_set call failed 2013-06-27 21:03:16 +10:00
drm_sysfs.c
drm_trace.h
drm_trace_points.c
drm_usb.c
drm_vm.c drm_vm: drop explicit VM_IO setting 2013-06-24 06:26:50 +10:00
Kconfig drm/nouveau: always select ACPI_VIDEO if ACPI is enabled. 2013-06-28 11:56:22 +10:00
Makefile drm: Renesas R-Car Display Unit DRM driver 2013-06-27 10:08:04 +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