linux/drivers/gpu/drm
Daniel Vetter 9f1f46a45a drm/i915: protect force_wake_(get|put) with the gt_lock
The problem this patch solves is that the forcewake accounting
necessary for register reads is protected by dev->struct_mutex. But the
hangcheck and error_capture code need to access registers without
grabbing this mutex because we hold it while waiting for the gpu.
So a new lock is required. Because currently the error_state capture
is called from the error irq handler and the hangcheck code runs from
a timer, it needs to be an irqsafe spinlock (note that the registers
used by the irq handler (neglecting the error handling part) only uses
registers that don't need the forcewake dance).

We could tune this down to a normal spinlock when we rework the
error_state capture and hangcheck code to run from a workqueue.  But
we don't have any read in a fastpath that needs forcewake, so I've
decided to not care much about overhead.

This prevents tests/gem_hangcheck_forcewake from i-g-t from killing my
snb on recent kernels - something must have slightly changed the
timings. On previous kernels it only trigger a WARN about the broken
locking.

v2: Drop the previous patch for the register writes.

v3: Improve the commit message per Chris Wilson's suggestions.

Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2012-01-19 11:51:31 -08:00
..
exynos drm: add support for private planes 2012-01-05 10:00:16 +00:00
gma500 gma500: silence gcc warnings in mid_get_vbt_data() 2012-01-10 10:01:22 +00:00
i2c
i810 drm/i810: don't acces hw regs in lastclose 2011-12-22 19:54:58 +01:00
i915 drm/i915: protect force_wake_(get|put) with the gt_lock 2012-01-19 11:51:31 -08:00
mga drm: Make the per-driver file_operations struct const 2011-11-11 11:14:47 +00:00
nouveau drm/nouveau/pm: fix build with HWMON off 2012-01-10 10:13:16 +00:00
r128 drm: Make the per-driver file_operations struct const 2011-11-11 11:14:47 +00:00
radeon Merge branch 'drm-core-next' of git://people.freedesktop.org/~airlied/linux 2012-01-10 11:04:36 -08:00
savage drm: Make the per-driver file_operations struct const 2011-11-11 11:14:47 +00:00
sis drm/sis|via: don't return stack garbage from free_mem ioctl 2012-01-09 12:11:39 +00:00
tdfx drm: Make the per-driver file_operations struct const 2011-11-11 11:14:47 +00:00
ttm drm/ttm: fix condition (and vs or) 2012-01-10 10:00:42 +00:00
via drm/sis|via: don't return stack garbage from free_mem ioctl 2012-01-09 12:11:39 +00:00
vmwgfx Merge branch 'drm-core-next' of git://people.freedesktop.org/~airlied/linux 2012-01-10 11:04:36 -08: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
ati_pcigart.c
drm_agpsupport.c
drm_auth.c
drm_buffer.c
drm_bufs.c
drm_cache.c
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
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
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: Make the per-driver file_operations struct const 2011-11-11 11:14:47 +00:00
drm_gem.c
drm_global.c
drm_hashtab.c
drm_info.c
drm_ioc32.c
drm_ioctl.c drm: make DRM_UNLOCKED ioctls with their own mutex 2012-01-05 14:43:02 +00: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
drm_mm.c
drm_modes.c
drm_pci.c
drm_platform.c
drm_proc.c
drm_scatter.c
drm_stub.c
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
drm_vm.c

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