linux/drivers/gpu/drm
Ville Syrjälä 8d7849db3e drm/i915: Make sprite updates atomic
Add a mechanism by which we can evade the leading edge of vblank. This
guarantees that no two sprite register writes will straddle on either
side of the vblank start, and that means all the writes will be latched
together in one atomic operation.

We do the vblank evade by checking the scanline counter, and if it's too
close to the start of vblank (too close has been hardcoded to 100usec
for now), we will wait for the vblank start to pass. In order to
eliminate random delayes from the rest of the system, we operate with
interrupts disabled, except when waiting for the vblank obviously.

Note that we now go digging through pipe_to_crtc_mapping[] in the
vblank interrupt handler, which is a bit dangerous since we set up
interrupts before the crtcs. However in this case since it's the vblank
interrupt, we don't actually unmask it until some piece of code
requests it.

v2: preempt_check_resched() calls after local_irq_enable() (Jesse)
    Hook up the vblank irq stuff on BDW as well
v3: Pass intel_crtc instead of drm_crtc (Daniel)
    Warn if crtc.mutex isn't locked (Daniel)
    Add an explicit compiler barrier and document the barriers (Daniel)
    Note the irq vs. modeset setup madness in the commit message (Daniel)
v4: Use prepare_to_wait() & co. directly and eliminate vbl_received
v5: Refactor intel_pipe_handle_vblank() vs. drm_handle_vblank() (Chris)
    Check for min/max scanline <= 0 (Chris)
    Don't call intel_pipe_update_end() if start failed totally (Chris)
    Check that the vblank counters match on both sides of the critical
    section (Chris)
v6: Fix atomic update for interlaced modes
v7: Reorder code for better readability (Chris)
v8: Drop preempt_check_resched(). It's not available to modules
    anymore and isn't even needed unless we ourselves cause
    a wakeup needing reschedule while interrupts are off

Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Reviewed-by: Sourab Gupta <sourabgupta@gmail.com>
Reviewed-by: Akash Goel <akash.goels@gmail.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-05-06 10:18:02 +02:00
..
armada drm: pass the irq explicitly to drm_irq_install 2014-04-23 10:32:50 +02:00
ast Merge branch 'drm-init-cleanup' of git://people.freedesktop.org/~danvet/drm into drm-next 2014-05-01 09:32:21 +10:00
bochs drm/bochs: Remove unecessary NULL check in gem_free 2014-04-22 15:39:40 +02:00
bridge drm/bridge: export ptn3460_init function 2014-04-04 21:24:50 +09:00
cirrus drm/cirrus: Remove unecessary NULL check in gem_free 2014-04-22 15:39:07 +02:00
exynos drm/exynos: use %pad for dma_addr_t 2014-04-30 09:48:54 +10:00
gma500 drm: pass the irq explicitly to drm_irq_install 2014-04-23 10:32:50 +02:00
i2c drm/i2c/tda998x: Fix signed overflow issue 2014-04-22 15:39:41 +02:00
i810
i915 drm/i915: Make sprite updates atomic 2014-05-06 10:18:02 +02:00
mga drm: remove drm_dev_to_irq from drivers 2014-04-22 11:41:12 +02:00
mgag200 drm/mgag200: Remove unecessary NULL check in gem_free 2014-04-22 15:39:04 +02:00
msm Merge branch 'drm-init-cleanup' of git://people.freedesktop.org/~danvet/drm into drm-next 2014-05-01 09:32:21 +10:00
nouveau drm: Rip out totally bogus vga_switcheroo->can_switch locking 2014-04-23 10:32:33 +02:00
omapdrm drm/omap: fix the handling of fb ref counts 2014-04-15 16:40:01 +03:00
panel drm/panel: Changes for v3.15-rc1 2014-04-05 16:12:27 +10:00
qxl Merge branch 'drm-init-cleanup' of git://people.freedesktop.org/~danvet/drm into drm-next 2014-05-01 09:32:21 +10:00
r128 drm: remove drm_dev_to_irq from drivers 2014-04-22 11:41:12 +02:00
radeon Merge branch 'drm-init-cleanup' of git://people.freedesktop.org/~danvet/drm into drm-next 2014-05-01 09:32:21 +10:00
rcar-du drm/rcar-du: Handle encoder initialization failures 2014-04-04 08:02:54 +10:00
savage
shmobile drm: pass the irq explicitly to drm_irq_install 2014-04-23 10:32:50 +02:00
sis
tdfx
tegra Merge branch 'drm-init-cleanup' of git://people.freedesktop.org/~danvet/drm into drm-next 2014-05-01 09:32:21 +10:00
tilcdc drm: pass the irq explicitly to drm_irq_install 2014-04-23 10:32:50 +02:00
ttm Merge tag 'ttm-next-2014-04-04' of git://people.freedesktop.org/~thomash/linux into drm-next 2014-04-05 16:07:39 +10:00
udl drm/udl: Initialize ret in udl_driver_load 2014-04-22 15:39:37 +02:00
via drm/via: Remove unecessary NULL check 2014-04-22 15:39:11 +02:00
vmwgfx Merge branch 'drm-init-cleanup' of git://people.freedesktop.org/~danvet/drm into drm-next 2014-05-01 09:32:21 +10:00
ati_pcigart.c
drm_agpsupport.c
drm_auth.c
drm_buffer.c
drm_bufs.c drm: rename dev->count_lock to dev->buf_lock 2014-04-23 10:32:43 +02:00
drm_cache.c Merge tag 'drm-intel-next-2014-04-16' of git://anongit.freedesktop.org/drm-intel into drm-next 2014-05-01 09:11:37 +10:00
drm_context.c
drm_crtc.c drm: Allow userspace to ask for universal plane list (v2) 2014-04-01 20:18:29 -04:00
drm_crtc_helper.c drm: Split out drm_probe_helper.c from drm_crtc_helper.c 2014-04-18 13:21:17 +10:00
drm_crtc_internal.h drm: move drm_mode related functions into drm_modes.c 2014-03-13 12:48:40 +01:00
drm_debugfs.c
drm_dma.c
drm_dp_helper.c drm/dp/i2c: Update comments about common i2c over dp assumptions (v3) 2014-04-08 16:12:39 +02:00
drm_drv.c drm: Add a function to get the ioctl flags 2014-03-28 14:19:02 +01:00
drm_edid.c Merge branch 'topic/core-stuff' of git://git.freedesktop.org/git/drm-intel into drm-next 2014-03-18 19:23:22 +10:00
drm_edid_load.c
drm_encoder_slave.c
drm_fb_cma_helper.c
drm_fb_helper.c drm: Prefer noninterlace cmdline mode unless explicitly specified 2014-04-04 10:07:03 +10:00
drm_flip_work.c
drm_fops.c Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux 2014-04-08 09:52:16 -07:00
drm_gem.c Merge branch 'drm-docs' of ssh://people.freedesktop.org/~danvet/drm into drm-next 2014-03-18 19:09:10 +10:00
drm_gem_cma_helper.c drm: gem-cma: Fix warnings due to improper printk formats 2014-04-04 10:13:48 +10:00
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: rip out dev->devname 2014-04-23 10:32:52 +02:00
drm_irq.c drm: rip out dev->devname 2014-04-23 10:32:52 +02:00
drm_lock.c
drm_memory.c
drm_mipi_dsi.c drm/mipi_dsi: create dsi devices only for nodes with reg property 2014-04-04 21:24:47 +09: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_panel.c
drm_pci.c drm: Remove dev->kdriver 2014-04-23 10:32:54 +02:00
drm_plane_helper.c drm/plane-helper: Don't fake-implement primary plane disabling 2014-04-18 13:18:50 +10:00
drm_platform.c drm: Remove dev->kdriver 2014-04-23 10:32:54 +02:00
drm_prime.c Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux 2014-04-08 09:52:16 -07:00
drm_probe_helper.c drm: try harder to avoid regression when merging mode bits 2014-05-01 09:26:53 +10:00
drm_rect.c
drm_scatter.c
drm_stub.c Merge branch 'drm-init-cleanup' of git://people.freedesktop.org/~danvet/drm into drm-next 2014-05-01 09:32:21 +10:00
drm_sysfs.c
drm_trace.h
drm_trace_points.c
drm_usb.c drm: Remove dev->kdriver 2014-04-23 10:32:54 +02:00
drm_vm.c
drm_vma_manager.c
Kconfig drm/bridge: Add PTN3460 bridge driver 2014-03-24 00:36:37 +09:00
Makefile drm: Split out drm_probe_helper.c from drm_crtc_helper.c 2014-04-18 13:21:17 +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