OpenCloudOS-Kernel/drivers/gpu/drm/i915/gvt
Tvrtko Ursulin 73dec95e6b drm/i915: Emit to ringbuffer directly
This removes the usage of intel_ring_emit in favour of
directly writing to the ring buffer.

intel_ring_emit was preventing the compiler for optimising
fetch and increment of the current ring buffer pointer and
therefore generating very verbose code for every write.

It had no useful purpose since all ringbuffer operations
are started and ended with intel_ring_begin and
intel_ring_advance respectively, with no bail out in the
middle possible, so it is fine to increment the tail in
intel_ring_begin and let the code manage the pointer
itself.

Useless instruction removal amounts to approximately
two and half kilobytes of saved text on my build.

Not sure if this has any measurable performance
implications but executing a ton of useless instructions
on fast paths cannot be good.

v2:
 * Change return from intel_ring_begin to error pointer by
   popular demand.
 * Move tail increment to intel_ring_advance to enable some
   error checking.

v3:
 * Move tail advance back into intel_ring_begin.
 * Rebase and tidy.

v4:
 * Complete rebase after a few months since v3.

v5:
 * Remove unecessary cast and fix !debug compile. (Chris Wilson)

v6:
 * Make intel_ring_offset take request as well.
 * Fix recording of request postfix plus a sprinkle of asserts.
   (Chris Wilson)

v7:
 * Use intel_ring_offset to get the postfix. (Chris Wilson)
 * Convert GVT code as well.

v8:
 * Rename *out++ to *cs++.

v9:
 * Fix GVT out to cs conversion in GVT.

v10:
 * Rebase for new intel_ring_begin in selftests.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Zhi Wang <zhi.a.wang@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170214113242.29241-1-tvrtko.ursulin@linux.intel.com
2017-02-14 14:30:46 +00:00
..
Makefile drm/i915/gvt/kvmgt: add vfio/mdev support to KVMGT 2016-12-16 16:55:26 +08:00
aperture_gm.c Merge tag 'drm-intel-next-2017-01-23' of git://anongit.freedesktop.org/git/drm-intel into drm-next 2017-01-27 12:08:32 +10:00
cfg_space.c drm/i915/gvt: introduce intel_vgpu_reset_cfg_space to reset configuration space 2017-01-13 15:05:38 +08:00
cmd_parser.c drm/i915: Emit to ringbuffer directly 2017-02-14 14:30:46 +00:00
cmd_parser.h drm/i915/gvt: vGPU command scanner 2016-10-14 18:15:25 +08:00
debug.h drm/i915/gvt: vGPU command scanner 2016-10-14 18:15:25 +08:00
display.c drm/i915/gvt: mark symbols static where possible 2016-10-20 17:31:36 +08:00
display.h drm/i915/gvt: vGPU display virtualization 2016-10-14 18:13:06 +08:00
edid.c drm/i915/gvt: Fix static checker warning on intel_gvt_i2c_handle_aux_ch_write() 2016-11-14 18:06:44 +08:00
edid.h drm/i915/gvt: Fix static checker warning on intel_gvt_i2c_handle_aux_ch_write() 2016-11-14 18:06:44 +08:00
execlist.c drm/i915/gvt: fix crash in vgpu_reset_execlist 2016-11-14 18:06:43 +08:00
execlist.h drm/i915/gvt: fix crash in vgpu_reset_execlist 2016-11-14 18:06:43 +08:00
firmware.c drm/i915/gvt: fix sparse warnings on different address spaces 2016-10-20 17:31:35 +08:00
gtt.c drm/i915/gvt: introuduce intel_vgpu_reset_gtt() to reset gtt 2017-01-13 15:05:38 +08:00
gtt.h drm/i915/gvt: introuduce intel_vgpu_reset_gtt() to reset gtt 2017-01-13 15:05:38 +08:00
gvt.c drm/i915/gvt: init/destroy vgpu_idr properly 2017-01-09 11:11:08 +08:00
gvt.h drm/i915/gvt: fix vGPU instance reuse issues by vGPU reset function 2017-01-13 15:05:38 +08:00
handlers.c Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux into drm-next 2017-01-27 11:00:42 +10:00
hypercall.h drm/i915/gvt: refactor intel_gvt_io_emulation_ops to be intel_gvt_ops 2016-11-10 15:45:15 +08:00
interrupt.c drm/i915/gvt: mark symbols static where possible 2016-10-20 17:31:36 +08:00
interrupt.h drm/i915/gvt: vGPU command scanner 2016-10-14 18:15:25 +08:00
kvmgt.c drm/i915/gvt/kvmgt: return meaningful error for vgpu creating failure 2017-01-09 11:11:52 +08:00
mmio.c drm/i915/gvt: introduce intel_vgpu_reset_mmio() to reset mmio space 2017-01-13 15:05:38 +08:00
mmio.h drm/i915/gvt: introduce intel_vgpu_reset_mmio() to reset mmio space 2017-01-13 15:05:38 +08:00
mpt.h drm/i915/gvt: allow several MPT methods to be NULL 2016-11-10 15:45:14 +08:00
opregion.c drm/i915/gvt: cleanup opregion memory allocation code 2017-01-09 11:11:32 +08:00
reg.h drm/i915/gvt: cleanup opregion memory allocation code 2017-01-09 11:11:32 +08:00
render.c drm/i915/gvt: correct the emulation in TLB control handler 2016-11-07 14:16:59 +08:00
render.h drm/i915/gvt: vGPU context switch 2016-10-14 18:15:13 +08:00
sched_policy.c drm/i915/gvt: remove unused variable 'execlist' 2016-11-07 14:16:57 +08:00
sched_policy.h drm/i915/gvt: vGPU schedule policy framework 2016-10-14 18:15:02 +08:00
scheduler.c Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux into drm-next 2017-01-27 11:00:42 +10:00
scheduler.h drm/i915/gvt: vGPU command scanner 2016-10-14 18:15:25 +08:00
trace.h drm/i915/gvt: vGPU command scanner 2016-10-14 18:15:25 +08:00
trace_points.c drm/i915/gvt: trace stub 2016-10-14 18:12:11 +08:00
vgpu.c drm/i915/gvt: fix vGPU instance reuse issues by vGPU reset function 2017-01-13 15:05:38 +08:00