alistair23-linux/drivers/gpu/drm
Chris Wilson a71d8d9452 drm/i915: Record the tail at each request and use it to estimate the head
By recording the location of every request in the ringbuffer, we know
that in order to retire the request the GPU must have finished reading
it and so the GPU head is now beyond the tail of the request. We can
therefore provide a conservative estimate of where the GPU is reading
from in order to avoid having to read back the ring buffer registers
when polling for space upon starting a new write into the ringbuffer.

A secondary effect is that this allows us to convert
intel_ring_buffer_wait() to use i915_wait_request() and so consolidate
upon the single function to handle the complicated task of waiting upon
the GPU. A necessary precaution is that we need to make that wait
uninterruptible to match the existing conditions as all the callers of
intel_ring_begin() have not been audited to handle ERESTARTSYS
correctly.

By using a conservative estimate for the head, and always processing all
outstanding requests first, we prevent a race condition between using
the estimate and direct reads of I915_RING_HEAD which could result in
the value of the head going backwards, and the tail overflowing once
again. We are also careful to mark any request that we skip over in
order to free space in ring as consumed which provides a
self-consistency check.

Given sufficient abuse, such as a set of unthrottled GPU bound
cairo-traces, avoiding the use of I915_RING_HEAD gives a 10-20% boost on
Sandy Bridge (i5-2520m):
  firefox-paintball  18927ms -> 15646ms: 1.21x speedup
  firefox-fishtank   12563ms -> 11278ms: 1.11x speedup
which is a mild consolation for the performance those traces achieved from
exploiting the buggy autoreported head.

v2: Add a few more comments and make request->tail a conservative
estimate as suggested by Daniel Vetter.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
[danvet: resolve conflicts with retirement defering and the lack of
the autoreport head removal (that will go in through -fixes).]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-02-15 14:26:03 +01:00
..
exynos drm/exynos: fixed pm feature for fimd module. 2012-01-27 13:03:59 +09:00
gma500 gma500: Fix suspend/resume functions 2012-01-27 11:52:07 +00:00
i2c gpu: add module.h to drivers/gpu files as required. 2011-10-31 19:32:03 -04:00
i810 Revert "drm/i810: cleanup reclaim_buffers" 2012-01-30 09:31:25 +00:00
i915 drm/i915: Record the tail at each request and use it to estimate the head 2012-02-15 14:26:03 +01:00
mga drm: Make the per-driver file_operations struct const 2011-11-11 11:14:47 +00:00
nouveau drm/nv50/pm: signedness bug in nv50_pm_clocks_pre() 2012-02-01 15:27:43 +10:00
r128 drm: Make the per-driver file_operations struct const 2011-11-11 11:14:47 +00:00
radeon drm/radeon: do not continue after error from r600_ib_test 2012-02-03 10:15:03 +00:00
savage drm: Make the per-driver file_operations struct const 2011-11-11 11:14:47 +00:00
sis gpu, drm, sis: Don't return uninitialized variable from sis_driver_load() 2012-01-23 11:00:47 +00:00
tdfx drm: Make the per-driver file_operations struct const 2011-11-11 11:14:47 +00:00
ttm drm/ttm: fix two regressions since move_notify changes 2012-01-25 18:54:28 +00:00
via drm/sis|via: don't return stack garbage from free_mem ioctl 2012-01-09 12:11:39 +00:00
vmwgfx vmwgfx: Fix assignment in vmw_framebuffer_create_handle 2012-01-30 09:32:39 +00:00
ati_pcigart.c gpu: Add export.h as required to drivers/gpu files. 2011-10-31 19:32:03 -04:00
drm_agpsupport.c
drm_auth.c drm: Fix authentication kernel crash 2012-01-25 09:27:45 +00:00
drm_buffer.c gpu: Add export.h as required to drivers/gpu files. 2011-10-31 19:32:03 -04:00
drm_bufs.c gpu: Add export.h as required to drivers/gpu files. 2011-10-31 19:32:03 -04:00
drm_cache.c gpu: Add export.h as required to drivers/gpu files. 2011-10-31 19:32:03 -04:00
drm_context.c drm: make DRM_UNLOCKED ioctls with their own mutex 2012-01-05 14:43:02 +00:00
drm_crtc.c drm: add support for private planes 2012-01-05 10:00:16 +00:00
drm_crtc_helper.c drm: Add drm_format_num_planes() utility function 2011-12-20 20:34:32 +00:00
drm_debugfs.c drm: serialize access to list of debugfs files 2011-11-11 11:05:19 +00:00
drm_dma.c gpu: Add export.h as required to drivers/gpu files. 2011-10-31 19:32:03 -04:00
drm_dp_i2c_helper.c
drm_drv.c drm: make DRM_UNLOCKED ioctls with their own mutex 2012-01-05 14:43:02 +00:00
drm_edid.c Fix wrong assumptions in cea_for_each_detailed_block v2 2011-12-20 09:51:10 +00:00
drm_edid_modes.h drm/edid: support CEA video modes. 2011-12-19 14:53:16 +00:00
drm_encoder_slave.c gpu: add module.h to drivers/gpu files as required. 2011-10-31 19:32:03 -04:00
drm_fb_helper.c drm: avoid switching to text console if there is no panic timeout 2011-11-10 21:27:34 +00:00
drm_fops.c drm: Fix authentication kernel crash 2012-01-25 09:27:45 +00:00
drm_gem.c drm: Pass the real error code back during GEM bo initialisation 2012-01-30 09:31:42 +00:00
drm_global.c
drm_hashtab.c gpu: Add export.h as required to drivers/gpu files. 2011-10-31 19:32:03 -04:00
drm_info.c Merge remote branch 'intel/drm-intel-next' of ../drm-next into drm-core-next 2011-03-14 14:15:13 +10:00
drm_ioc32.c drivers/gpu/drm/drm_ioc32.c: initialize all fields 2012-02-03 09:47:32 +00:00
drm_ioctl.c drm/i915: kill i915_mem.c 2012-01-17 20:01:01 +01:00
drm_irq.c drm: Remove utterly bogus preempt_disable() sections 2011-11-14 09:28:50 +00:00
drm_lock.c drm: add missing exports for i810 driver. 2011-12-22 19:09:01 +00:00
drm_memory.c gpu: Add export.h as required to drivers/gpu files. 2011-10-31 19:32:03 -04:00
drm_mm.c gpu: Add export.h as required to drivers/gpu files. 2011-10-31 19:32:03 -04:00
drm_modes.c gpu: Add export.h as required to drivers/gpu files. 2011-10-31 19:32:03 -04:00
drm_pci.c gpu: Add export.h as required to drivers/gpu files. 2011-10-31 19:32:03 -04:00
drm_platform.c gpu: Add export.h as required to drivers/gpu files. 2011-10-31 19:32:03 -04:00
drm_proc.c gpu: Add export.h as required to drivers/gpu files. 2011-10-31 19:32:03 -04:00
drm_scatter.c drivers: use kzalloc/kcalloc instead of 'kmalloc+memset', where possible 2011-07-25 20:57:13 -07:00
drm_stub.c drm: Create and use drm_err 2011-04-28 14:53:02 +10:00
drm_sysfs.c switch device_get_devnode() and ->devnode() to umode_t * 2012-01-03 22:54:55 -05:00
drm_trace.h
drm_trace_points.c
drm_usb.c gpu: Add export.h as required to drivers/gpu files. 2011-10-31 19:32:03 -04:00
drm_vm.c gpu: Add export.h as required to drivers/gpu files. 2011-10-31 19:32:03 -04:00
Kconfig Merge tag 'v3.2-rc6' of /home/airlied/devel/kernel/linux-2.6 into drm-core-next 2011-12-20 14:43:53 +00:00
Makefile drm: kill drm_sman 2011-12-22 00:33:23 +01: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