All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Yu Zhang <yu.c.zhang@linux.intel.com>, Intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v3 7/8] drm/i915: Create vGPU specific write MMIO to reduce traps
Date: Fri, 12 Dec 2014 13:31:22 +0000	[thread overview]
Message-ID: <548AEE2A.7010808@linux.intel.com> (raw)
In-Reply-To: <1415880169-7656-8-git-send-email-yu.c.zhang@linux.intel.com>


On 11/13/2014 12:02 PM, Yu Zhang wrote:
> In the virtualized environment, forcewake operations are not
> necessory for the driver, because mmio accesses will be trapped

necessary

> and emulated by the host side, and real forcewake operations are
> also done in the host. New mmio write handlers are added to directly
> call the __raw_i915_write, therefore will reduce many traps and
> increase the overall performance for drivers running in the VM
> with Intel GVT-g enhancement.
>
> v2:
> take Chris' comments:
>          - register the mmio hooks in intel_uncore_init()
> v3:
> take Daniel's comments:
>          - use macros to assign mmio write functions for vGPU
>
> Signed-off-by: Yu Zhang <yu.c.zhang@linux.intel.com>
> Signed-off-by: Jike Song <jike.song@intel.com>
> Signed-off-by: Kevin Tian <kevin.tian@intel.com>
> ---
>   drivers/gpu/drm/i915/intel_uncore.c | 16 ++++++++++++++++
>   1 file changed, 16 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c
> index cae27bb..b76c21d 100644
> --- a/drivers/gpu/drm/i915/intel_uncore.c
> +++ b/drivers/gpu/drm/i915/intel_uncore.c
> @@ -727,6 +727,14 @@ hsw_write##x(struct drm_i915_private *dev_priv, off_t reg, u##x val, bool trace)
>   	REG_WRITE_FOOTER; \
>   }
>
> +#define __vgpu_write(x) \
> +static void \
> +vgpu_write##x(struct drm_i915_private *dev_priv, off_t reg, u##x val, bool trace) { \
> +	REG_WRITE_HEADER; \
> +	__raw_i915_write##x(dev_priv, reg, val); \
> +	REG_WRITE_FOOTER; \
> +}
> +
>   static const u32 gen8_shadowed_regs[] = {
>   	FORCEWAKE_MT,
>   	GEN6_RPNSWREQ,
> @@ -821,6 +829,10 @@ __gen4_write(8)
>   __gen4_write(16)
>   __gen4_write(32)
>   __gen4_write(64)
> +__vgpu_write(8)
> +__vgpu_write(16)
> +__vgpu_write(32)
> +__vgpu_write(64)
>
>   #undef __chv_write
>   #undef __gen8_write
> @@ -828,6 +840,7 @@ __gen4_write(64)
>   #undef __gen6_write
>   #undef __gen5_write
>   #undef __gen4_write
> +#undef __vgpu_write
>   #undef REG_WRITE_FOOTER
>   #undef REG_WRITE_HEADER
>
> @@ -939,6 +952,9 @@ void intel_uncore_init(struct drm_device *dev)
>   		break;
>   	}
>
> +	if (intel_vgpu_active(dev))
> +		ASSIGN_WRITE_MMIO_VFUNCS(vgpu);
> +
>   	i915_check_and_clear_faults(dev);
>   }
>   #undef ASSIGN_WRITE_MMIO_VFUNCS
>

Maybe I am missing something obvious, but why are read variants not needed?

Regards,

Tvrtko
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2014-12-12 13:31 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-13 12:02 [PATCH v3 0/8] Add enlightenments for vGPU Yu Zhang
2014-11-13 12:02 ` [PATCH v3 1/8] drm/i915: Introduce a PV INFO page structure for Intel GVT-g Yu Zhang
2014-12-11 17:33   ` Tvrtko Ursulin
2014-12-15  8:12     ` Daniel Vetter
2014-12-16 12:51     ` Yu, Zhang
2014-12-16 13:19       ` Tvrtko Ursulin
2014-12-17  2:49         ` Yu, Zhang
2014-12-17  5:04           ` Tian, Kevin
2014-11-13 12:02 ` [PATCH v3 2/8] drm/i915: Adds graphic address space ballooning logic Yu Zhang
2014-11-14 10:16   ` Daniel Vetter
2014-11-14 12:00     ` Yu, Zhang
2014-12-12 13:00   ` Tvrtko Ursulin
2014-12-16 13:22     ` Yu, Zhang
2014-12-16 13:41       ` Tvrtko Ursulin
2014-12-16 14:39         ` Gerd Hoffmann
2014-12-16 15:15           ` Tvrtko Ursulin
2014-12-17  3:10             ` Yu, Zhang
2014-12-17  5:20               ` Tian, Kevin
2014-12-17 10:06                 ` Tvrtko Ursulin
2014-12-17  5:57     ` Tian, Kevin
2014-11-13 12:02 ` [PATCH v3 3/8] drm/i915: Partition the fence registers for vGPU in i915 driver Yu Zhang
2014-12-12 13:07   ` Tvrtko Ursulin
2014-12-16 13:32     ` Yu, Zhang
2014-12-16 13:44       ` Tvrtko Ursulin
2014-12-16 14:41         ` Gerd Hoffmann
2014-12-16 15:01           ` Tvrtko Ursulin
2014-12-17  7:33             ` Gerd Hoffmann
2014-12-17  9:59               ` Tvrtko Ursulin
2014-12-17 11:06                 ` Gerd Hoffmann
2014-12-17 11:25                   ` Yu, Zhang
2014-12-17 11:50                     ` Tvrtko Ursulin
2014-12-17 17:10                       ` Daniel Vetter
2014-12-17 17:11                         ` Daniel Vetter
2014-12-18  0:36                         ` Tian, Kevin
2014-12-18  8:08                           ` Daniel Vetter
2014-12-18  8:39                             ` Tian, Kevin
2014-12-17  4:58         ` Tian, Kevin
2014-11-13 12:02 ` [PATCH v3 4/8] drm/i915: Disable framebuffer compression for i915 driver in VM Yu Zhang
2014-12-12 13:13   ` Tvrtko Ursulin
2014-12-17  3:15     ` Yu, Zhang
2014-11-13 12:02 ` [PATCH v3 5/8] drm/i915: Add the display switch logic for vGPU in i915 driver Yu Zhang
2014-12-12 13:18   ` Tvrtko Ursulin
2014-12-15  8:16   ` Daniel Vetter
2014-12-17  3:17     ` Yu, Zhang
2014-11-13 12:02 ` [PATCH v3 6/8] drm/i915: Disable power management for i915 driver in VM Yu Zhang
2014-12-12 13:27   ` Tvrtko Ursulin
2014-12-17  3:25     ` Yu, Zhang
2014-11-13 12:02 ` [PATCH v3 7/8] drm/i915: Create vGPU specific write MMIO to reduce traps Yu Zhang
2014-12-12 13:31   ` Tvrtko Ursulin [this message]
2014-12-17  7:28     ` Yu, Zhang
2014-11-13 12:02 ` [PATCH v3 8/8] drm/i915: Support alias ppgtt in VM if ppgtt is enabled Yu Zhang
2014-11-14  0:29   ` [PATCH v3 8/8] drm/i915: Support alias ppgtt in VM if shuang.he
2014-12-12 13:37   ` [PATCH v3 8/8] drm/i915: Support alias ppgtt in VM if ppgtt is enabled Tvrtko Ursulin
2014-11-14 10:17 ` [PATCH v3 0/8] Add enlightenments for vGPU Daniel Vetter
2014-11-14 12:01   ` Yu, Zhang
2014-12-11 17:03 ` Tvrtko Ursulin
2014-12-15  8:18   ` Daniel Vetter
2014-12-15  9:16     ` Jani Nikula

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=548AEE2A.7010808@linux.intel.com \
    --to=tvrtko.ursulin@linux.intel.com \
    --cc=Intel-gfx@lists.freedesktop.org \
    --cc=yu.c.zhang@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.