OpenCloudOS-Kernel/drivers/gpu/drm/i915
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
..
Kconfig 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
Makefile Merge remote-tracking branch 'airlied/drm-next' into drm-intel-next 2014-03-18 09:43:56 +01:00
dvo.h drm/i915: Remove unused mode_fixup() vfunc of struct intel_dvo_dev_ops 2013-09-05 21:39:59 +02:00
dvo_ch7xxx.c drm/i915: Remove spurious semicolons 2014-04-09 21:54:33 +02:00
dvo_ch7017.c
dvo_ivch.c drm/i915: Remove spurious semicolons 2014-04-09 21:54:33 +02:00
dvo_ns2501.c drm/i915: Remove spurious semicolons 2014-04-09 21:54:33 +02:00
dvo_sil164.c drm/i915: Remove spurious semicolons 2014-04-09 21:54:33 +02:00
dvo_tfp410.c drm/i915: Remove spurious semicolons 2014-04-09 21:54:33 +02:00
i915_cmd_parser.c Revert "drm/i915: fix build warning on 32-bit (v2)" 2014-05-05 09:09:19 +02:00
i915_debugfs.c drm/i915: Avoid NULL ctx->obj dereference in debugfs/i915_context_info 2014-05-05 10:56:51 +02:00
i915_dma.c drm/i915: remove extraneous VGA power domain put calls 2014-05-05 09:09:17 +02:00
i915_drv.c drm/i915: vlv: increase timeout when forcing on the GFX clock 2014-05-05 09:09:13 +02:00
i915_drv.h drm/i915: vlv: init only needed state during early power well enabling 2014-05-05 10:56:51 +02:00
i915_gem.c drm/i915: Move semaphore specific ring members to struct 2014-05-05 10:56:52 +02:00
i915_gem_context.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
i915_gem_debug.c drm/i915: prefer struct drm_i915_private to drm_i915_private_t 2014-03-31 15:34:21 +02:00
i915_gem_dmabuf.c drm/i915: dma_buf_vunmap is presumed not to fail, don't let it 2014-04-09 15:03:05 +02:00
i915_gem_evict.c drm/i915: prefer struct drm_i915_private to drm_i915_private_t 2014-03-31 15:34:21 +02:00
i915_gem_execbuffer.c drm/i915: Support 64b relocations 2014-05-05 16:04:23 +02:00
i915_gem_gtt.c drm/i915/bdw: Add WT caching ability 2014-05-05 09:09:22 +02:00
i915_gem_gtt.h drm/i915: Split out GTT specific header file 2014-04-01 22:58:07 +02:00
i915_gem_stolen.c drm/i915: restrict vt-d stolen memory workaround to pre-gen8 2014-03-31 10:45:34 +02:00
i915_gem_tiling.c drm/i915: prefer struct drm_i915_private to drm_i915_private_t 2014-03-31 15:34:21 +02:00
i915_gpu_error.c drm/i915: Move semaphore specific ring members to struct 2014-05-05 10:56:52 +02:00
i915_ioc32.c
i915_irq.c drm/i915: Make sprite updates atomic 2014-05-06 10:18:02 +02:00
i915_params.c drm/i915: Add debug module option for VTd validation 2014-04-03 11:23:11 +02:00
i915_reg.h drm/i915: vlv: add RC6 residency counters 2014-05-05 09:08:52 +02:00
i915_suspend.c drm/i915: Kill most of the FBC register save/restore 2014-01-25 21:17:03 +01:00
i915_sysfs.c drm/i915: get a runtime PM ref for debugfs entries where needed 2014-05-05 09:08:55 +02:00
i915_trace.h drm/i915: Do not dereference pointers from ring buffer in evict event 2014-03-19 08:17:29 +01:00
i915_trace_points.c
i915_ums.c drm/i915: Only restore backlight combination mode reg for ums 2014-01-24 17:22:45 +01:00
intel_acpi.c Merge branch 'acpi-dsm' 2014-01-12 23:45:52 +01:00
intel_bios.c drm/i915: Validate VBT header before trusting it 2014-05-05 09:08:59 +02:00
intel_bios.h 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
intel_crt.c drm/i915/crt: Remove ->mode_set callback 2014-05-05 10:56:59 +02:00
intel_ddi.c drm/i915: fix WARNs when reading DDI state while suspended 2014-04-01 22:53:45 +02:00
intel_display.c drm/i915: Make sprite updates atomic 2014-05-06 10:18:02 +02:00
intel_dp.c drm/i915: vlv: check port power domain instead of only D0 for eDP VDD on 2014-05-05 09:09:03 +02:00
intel_drv.h drm/i915: Make sprite updates atomic 2014-05-06 10:18:02 +02:00
intel_dsi.c drm/i915: Enable RANDOM resolution support for MIPI panels 2014-04-09 21:54:31 +02:00
intel_dsi.h drm/i915: Parameterize the Clockstop and escape_clk_div 2014-04-09 21:54:29 +02:00
intel_dsi_cmd.c drm/i915: Send DPI command explicitely in LP mode 2014-04-09 21:54:30 +02:00
intel_dsi_cmd.h drm/i915: Send DPI command explicitely in LP mode 2014-04-09 21:54:30 +02:00
intel_dsi_pll.c drm/i915: Try harder to get best m, n, p values with minimal error 2013-12-11 23:52:18 +01:00
intel_dvo.c drm/i915/dvo: Remove ->mode_set callback 2014-05-05 10:56:55 +02:00
intel_fbdev.c drm/i915: Discard BIOS framebuffers too small to accommodate chosen mode 2014-04-24 13:34:37 +03:00
intel_hdmi.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
intel_i2c.c drm/i915: Disable dp aux irq on g4x 2014-02-07 16:40:07 +01:00
intel_lvds.c drm/i915: Don't set the 8to6 dither flag when not scaling 2014-04-13 11:59:32 +02:00
intel_modes.c
intel_opregion.c Merge tag 'drm-intel-fixes-2014-02-06' of ssh://git.freedesktop.org/git/drm-intel into drm-next 2014-02-11 12:57:27 +10:00
intel_overlay.c Merge tag 'drm-intel-fixes-2014-04-04' of git://anongit.freedesktop.org/drm-intel into drm-next 2014-04-05 16:14:21 +10:00
intel_panel.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
intel_pm.c drm/i915: vlv: init only needed state during early power well enabling 2014-05-05 10:56:51 +02:00
intel_ringbuffer.c drm/i915: Support 64b execbuf 2014-05-05 16:01:58 +02:00
intel_ringbuffer.h drm/i915: Support 64b execbuf 2014-05-05 16:01:58 +02:00
intel_sdvo.c drm/i915/sdvo: Remove ->mode_set callback 2014-05-05 10:57:00 +02:00
intel_sdvo_regs.h drm/i915: use __packed instead of __attribute__((packed)) 2013-12-03 18:19:49 +01:00
intel_sideband.c drm/i915: Warn when DPIO read returns 0xffffffff 2014-04-03 11:28:39 +02:00
intel_sprite.c drm/i915: Make sprite updates atomic 2014-05-06 10:18:02 +02:00
intel_tv.c drm/i915/tv: Remove ->mode_set callback 2014-05-05 10:56:59 +02:00
intel_uncore.c drm/i915/bdw: enable eDRAM. 2014-05-05 09:09:23 +02:00