* [PATCH v2 0/2] enable virtual HWSP in GVT-g
@ 2017-09-30 5:57 Weinan Li
2017-09-30 5:57 ` [PATCH v2 1/2] drm/i915/gvt: update CSB and CSB write pointer in virtual HWSP Weinan Li
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Weinan Li @ 2017-09-30 5:57 UTC (permalink / raw)
To: intel-gvt-dev, intel-gfx
V2: clean merge confict.
Weinan Li (2):
drm/i915/gvt: update CSB and CSB write pointer in virtual HWSP
drm/i915: enable to read CSB and CSB write pointer from HWSP in GVT-g
VM
drivers/gpu/drm/i915/gvt/execlist.c | 16 +++++++++++++
drivers/gpu/drm/i915/gvt/gvt.h | 1 +
drivers/gpu/drm/i915/gvt/handlers.c | 42 ++++++++++++++++++++++++++++++++--
drivers/gpu/drm/i915/gvt/vgpu.c | 8 +++++++
drivers/gpu/drm/i915/i915_pvinfo.h | 1 +
drivers/gpu/drm/i915/i915_vgpu.c | 5 ++++
drivers/gpu/drm/i915/i915_vgpu.h | 1 +
drivers/gpu/drm/i915/intel_engine_cs.c | 11 +++++----
drivers/gpu/drm/i915/intel_lrc.c | 7 +++++-
9 files changed, 85 insertions(+), 7 deletions(-)
--
1.9.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2 1/2] drm/i915/gvt: update CSB and CSB write pointer in virtual HWSP
2017-09-30 5:57 [PATCH v2 0/2] enable virtual HWSP in GVT-g Weinan Li
@ 2017-09-30 5:57 ` Weinan Li
2017-09-30 5:57 ` [PATCH v2 2/2] drm/i915: enable to read CSB and CSB write pointer from HWSP in GVT-g VM Weinan Li
2017-09-30 6:06 ` ✗ Fi.CI.BAT: failure for enable virtual HWSP in GVT-g Patchwork
2 siblings, 0 replies; 8+ messages in thread
From: Weinan Li @ 2017-09-30 5:57 UTC (permalink / raw)
To: intel-gvt-dev, intel-gfx
The engine provides a mirror of the CSB and CSB write pointer in the HWSP.
Read these status from virtual HWSP in VM can reduce CPU utilization while
applications have much more short GPU workloads. Here we update the
corresponding data in virtual HWSP as it in virtual MMIO.
Before read these status from HWSP in GVT-g VM, please ensure the host
support it by checking the BIT(3) of caps in PVINFO.
Virtual HWSP only support GEN8+ platform, since the HWSP MMIO may change
follow the platform update, please add the corresponding MMIO emulation
when enable new platforms in GVT-g.
Signed-off-by: Weinan Li <weinan.z.li@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
---
drivers/gpu/drm/i915/gvt/execlist.c | 16 ++++++++++++++
drivers/gpu/drm/i915/gvt/gvt.h | 1 +
drivers/gpu/drm/i915/gvt/handlers.c | 42 +++++++++++++++++++++++++++++++++++--
drivers/gpu/drm/i915/gvt/vgpu.c | 8 +++++++
drivers/gpu/drm/i915/i915_pvinfo.h | 1 +
5 files changed, 66 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/gvt/execlist.c b/drivers/gpu/drm/i915/gvt/execlist.c
index 5c966ed..b0c7e9e 100644
--- a/drivers/gpu/drm/i915/gvt/execlist.c
+++ b/drivers/gpu/drm/i915/gvt/execlist.c
@@ -133,6 +133,8 @@ static void emulate_csb_update(struct intel_vgpu_execlist *execlist,
struct execlist_context_status_pointer_format ctx_status_ptr;
u32 write_pointer;
u32 ctx_status_ptr_reg, ctx_status_buf_reg, offset;
+ unsigned long hwsp_gpa;
+ struct drm_i915_private *dev_priv = vgpu->gvt->dev_priv;
ctx_status_ptr_reg = execlist_ring_mmio(vgpu->gvt, ring_id,
_EL_OFFSET_STATUS_PTR);
@@ -158,6 +160,20 @@ static void emulate_csb_update(struct intel_vgpu_execlist *execlist,
ctx_status_ptr.write_ptr = write_pointer;
vgpu_vreg(vgpu, ctx_status_ptr_reg) = ctx_status_ptr.dw;
+ /*
+ * Update the CSB and CSB write pointer in HWSP.
+ */
+ if (INTEL_INFO(dev_priv)->gen >= 8) {
+ hwsp_gpa = intel_vgpu_gma_to_gpa(vgpu->gtt.ggtt_mm,
+ vgpu->hws_pga[ring_id]);
+ intel_gvt_hypervisor_write_gpa(vgpu,
+ hwsp_gpa + I915_HWS_CSB_BUF0_INDEX * 4 +
+ write_pointer * 8,
+ status, 8);
+ intel_gvt_hypervisor_write_gpa(vgpu,
+ hwsp_gpa + intel_hws_csb_write_index(dev_priv) * 4,
+ &write_pointer, 4);
+ }
gvt_dbg_el("vgpu%d: w pointer %u reg %x csb l %x csb h %x\n",
vgpu->id, write_pointer, offset, status->ldw, status->udw);
diff --git a/drivers/gpu/drm/i915/gvt/gvt.h b/drivers/gpu/drm/i915/gvt/gvt.h
index f08d194..27e8186 100644
--- a/drivers/gpu/drm/i915/gvt/gvt.h
+++ b/drivers/gpu/drm/i915/gvt/gvt.h
@@ -189,6 +189,7 @@ struct intel_vgpu {
struct intel_vgpu_opregion opregion;
struct intel_vgpu_display display;
struct intel_vgpu_submission submission;
+ u32 hws_pga[I915_NUM_ENGINES];
struct dentry *debugfs;
diff --git a/drivers/gpu/drm/i915/gvt/handlers.c b/drivers/gpu/drm/i915/gvt/handlers.c
index 0fa61a7..c1e79dd 100644
--- a/drivers/gpu/drm/i915/gvt/handlers.c
+++ b/drivers/gpu/drm/i915/gvt/handlers.c
@@ -1371,6 +1371,43 @@ static int mailbox_write(struct intel_vgpu *vgpu, unsigned int offset,
return intel_vgpu_default_mmio_write(vgpu, offset, &value, bytes);
}
+static int hws_pga_write(struct intel_vgpu *vgpu, unsigned int offset,
+ void *p_data, unsigned int bytes)
+{
+ u32 value = *(u32 *)p_data;
+ /*
+ * Need to emulate all the HWSP register write to ensure host can
+ * update the VM CSB status correctly. Here listed registers can
+ * support BDW, SKL or other platforms with same HWSP registers.
+ */
+ switch (offset) {
+ case 0x2080:
+ vgpu->hws_pga[RCS] = value;
+ break;
+ case 0x12080:
+ vgpu->hws_pga[VCS] = value;
+ break;
+ case 0x1c080:
+ vgpu->hws_pga[VCS2] = value;
+ break;
+ case 0x1a080:
+ vgpu->hws_pga[VECS] = value;
+ break;
+ case 0x22080:
+ vgpu->hws_pga[BCS] = value;
+ break;
+ default:
+ gvt_vgpu_err("VM(%d) access unknown hardware status page register:0x%x\n",
+ vgpu->id, offset);
+ return -EINVAL;
+ }
+
+ gvt_dbg_mmio("VM(%d) write: 0x%x to HWSP: 0x%x\n",
+ vgpu->id, value, offset);
+
+ return intel_vgpu_default_mmio_write(vgpu, offset, &value, bytes);
+}
+
static int skl_power_well_ctl_write(struct intel_vgpu *vgpu,
unsigned int offset, void *p_data, unsigned int bytes)
{
@@ -2574,8 +2611,9 @@ static int init_broadwell_mmio_info(struct intel_gvt *gvt)
MMIO_F(RING_REG(GEN8_BSD2_RING_BASE), 32, 0, 0, 0, D_BDW_PLUS, NULL, NULL);
#undef RING_REG
- MMIO_RING_GM_RDR(RING_HWS_PGA, D_BDW_PLUS, NULL, NULL);
- MMIO_GM_RDR(RING_HWS_PGA(GEN8_BSD2_RING_BASE), D_BDW_PLUS, NULL, NULL);
+ MMIO_RING_GM_RDR(RING_HWS_PGA, D_BDW_PLUS, NULL, hws_pga_write);
+ MMIO_GM_RDR(RING_HWS_PGA(GEN8_BSD2_RING_BASE), D_BDW_PLUS, NULL,
+ hws_pga_write);
MMIO_DFH(HDC_CHICKEN0, D_BDW_PLUS, F_MODE_MASK | F_CMD_ACCESS, NULL, NULL);
diff --git a/drivers/gpu/drm/i915/gvt/vgpu.c b/drivers/gpu/drm/i915/gvt/vgpu.c
index 99dbefa..5d180c6 100644
--- a/drivers/gpu/drm/i915/gvt/vgpu.c
+++ b/drivers/gpu/drm/i915/gvt/vgpu.c
@@ -43,7 +43,15 @@ void populate_pvinfo_page(struct intel_vgpu *vgpu)
vgpu_vreg(vgpu, vgtif_reg(version_minor)) = 0;
vgpu_vreg(vgpu, vgtif_reg(display_ready)) = 0;
vgpu_vreg(vgpu, vgtif_reg(vgt_id)) = vgpu->id;
+
vgpu_vreg(vgpu, vgtif_reg(vgt_caps)) = VGT_CAPS_FULL_48BIT_PPGTT;
+ /*
+ * Add HWSP emulation support after gen8 platform, VM need to check
+ * this caps to ensure it can read CSB status in HWSP.
+ */
+ if (INTEL_INFO(vgpu->gvt->dev_priv)->gen >= 8)
+ vgpu_vreg(vgpu, vgtif_reg(vgt_caps)) |= VGT_CAPS_HWSP_EMULATION;
+
vgpu_vreg(vgpu, vgtif_reg(avail_rs.mappable_gmadr.base)) =
vgpu_aperture_gmadr_base(vgpu);
vgpu_vreg(vgpu, vgtif_reg(avail_rs.mappable_gmadr.size)) =
diff --git a/drivers/gpu/drm/i915/i915_pvinfo.h b/drivers/gpu/drm/i915/i915_pvinfo.h
index 0679a58..195203f 100644
--- a/drivers/gpu/drm/i915/i915_pvinfo.h
+++ b/drivers/gpu/drm/i915/i915_pvinfo.h
@@ -53,6 +53,7 @@ enum vgt_g2v_type {
* VGT capabilities type
*/
#define VGT_CAPS_FULL_48BIT_PPGTT BIT(2)
+#define VGT_CAPS_HWSP_EMULATION BIT(3)
struct vgt_if {
u64 magic; /* VGT_MAGIC */
--
1.9.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 2/2] drm/i915: enable to read CSB and CSB write pointer from HWSP in GVT-g VM
2017-09-30 5:57 [PATCH v2 0/2] enable virtual HWSP in GVT-g Weinan Li
2017-09-30 5:57 ` [PATCH v2 1/2] drm/i915/gvt: update CSB and CSB write pointer in virtual HWSP Weinan Li
@ 2017-09-30 5:57 ` Weinan Li
2017-10-02 10:03 ` Joonas Lahtinen
2017-09-30 6:06 ` ✗ Fi.CI.BAT: failure for enable virtual HWSP in GVT-g Patchwork
2 siblings, 1 reply; 8+ messages in thread
From: Weinan Li @ 2017-09-30 5:57 UTC (permalink / raw)
To: intel-gvt-dev, intel-gfx
Let GVT-g VM read the CSB and CSB write pointer from virtual HWSP, not all
the host support this feature, need to check the BIT(3) of caps in PVINFO.
Signed-off-by: Weinan Li <weinan.z.li@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
---
drivers/gpu/drm/i915/i915_vgpu.c | 5 +++++
drivers/gpu/drm/i915/i915_vgpu.h | 1 +
drivers/gpu/drm/i915/intel_engine_cs.c | 11 +++++++----
drivers/gpu/drm/i915/intel_lrc.c | 7 ++++++-
4 files changed, 19 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_vgpu.c b/drivers/gpu/drm/i915/i915_vgpu.c
index 5fe9f3f..6f713c5 100644
--- a/drivers/gpu/drm/i915/i915_vgpu.c
+++ b/drivers/gpu/drm/i915/i915_vgpu.c
@@ -86,6 +86,11 @@ bool intel_vgpu_has_full_48bit_ppgtt(struct drm_i915_private *dev_priv)
return dev_priv->vgpu.caps & VGT_CAPS_FULL_48BIT_PPGTT;
}
+bool intel_vgpu_has_hwsp_emulation(struct drm_i915_private *dev_priv)
+{
+ return dev_priv->vgpu.caps & VGT_CAPS_HWSP_EMULATION;
+}
+
struct _balloon_info_ {
/*
* There are up to 2 regions per mappable/unmappable graphic
diff --git a/drivers/gpu/drm/i915/i915_vgpu.h b/drivers/gpu/drm/i915/i915_vgpu.h
index b72bd29..cec0ec1 100644
--- a/drivers/gpu/drm/i915/i915_vgpu.h
+++ b/drivers/gpu/drm/i915/i915_vgpu.h
@@ -29,6 +29,7 @@
void i915_check_vgpu(struct drm_i915_private *dev_priv);
bool intel_vgpu_has_full_48bit_ppgtt(struct drm_i915_private *dev_priv);
+bool intel_vgpu_has_hwsp_emulation(struct drm_i915_private *dev_priv);
int intel_vgt_balloon(struct drm_i915_private *dev_priv);
void intel_vgt_deballoon(struct drm_i915_private *dev_priv);
diff --git a/drivers/gpu/drm/i915/intel_engine_cs.c b/drivers/gpu/drm/i915/intel_engine_cs.c
index a28e2a8..58945ef 100644
--- a/drivers/gpu/drm/i915/intel_engine_cs.c
+++ b/drivers/gpu/drm/i915/intel_engine_cs.c
@@ -23,6 +23,7 @@
*/
#include "i915_drv.h"
+#include "i915_vgpu.h"
#include "intel_ringbuffer.h"
#include "intel_lrc.h"
@@ -384,10 +385,6 @@ static void intel_engine_init_timeline(struct intel_engine_cs *engine)
static bool csb_force_mmio(struct drm_i915_private *i915)
{
- /* GVT emulation depends upon intercepting CSB mmio */
- if (intel_vgpu_active(i915))
- return true;
-
/*
* IOMMU adds unpredictable latency causing the CSB write (from the
* GPU into the HWSP) to only be visible some time after the interrupt
@@ -396,6 +393,12 @@ static bool csb_force_mmio(struct drm_i915_private *i915)
if (intel_vtd_active())
return true;
+ /* GVT emulation depends upon host kernel implementation, check
+ * support capbility by reading PV INFO before access HWSP.
+ */
+ if (intel_vgpu_active(i915) && !intel_vgpu_has_hwsp_emulation(i915))
+ return true;
+
return false;
}
diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
index 7d6da13..2313d0a 100644
--- a/drivers/gpu/drm/i915/intel_lrc.c
+++ b/drivers/gpu/drm/i915/intel_lrc.c
@@ -722,7 +722,12 @@ static void intel_lrc_irq_handler(unsigned long data)
&engine->status_page.page_addr[I915_HWS_CSB_BUF0_INDEX];
unsigned int head, tail;
- /* However GVT emulation depends upon intercepting CSB mmio */
+ /* However GVT-g emulation depends upon host kernel
+ * implementation, need to check support capbility by reading PV
+ * INFO before access HWSP. Beside from this, another special
+ * configuration may also need to force use mmio, like IOMMU
+ * enabled.
+ */
if (unlikely(execlists->csb_use_mmio)) {
buf = (u32 * __force)
(dev_priv->regs + i915_mmio_reg_offset(RING_CONTEXT_STATUS_BUF_LO(engine, 0)));
--
1.9.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 8+ messages in thread
* ✗ Fi.CI.BAT: failure for enable virtual HWSP in GVT-g
2017-09-30 5:57 [PATCH v2 0/2] enable virtual HWSP in GVT-g Weinan Li
2017-09-30 5:57 ` [PATCH v2 1/2] drm/i915/gvt: update CSB and CSB write pointer in virtual HWSP Weinan Li
2017-09-30 5:57 ` [PATCH v2 2/2] drm/i915: enable to read CSB and CSB write pointer from HWSP in GVT-g VM Weinan Li
@ 2017-09-30 6:06 ` Patchwork
2 siblings, 0 replies; 8+ messages in thread
From: Patchwork @ 2017-09-30 6:06 UTC (permalink / raw)
To: Weinan Li; +Cc: intel-gfx
== Series Details ==
Series: enable virtual HWSP in GVT-g
URL : https://patchwork.freedesktop.org/series/31217/
State : failure
== Summary ==
Series 31217 revision 1 was fully merged or fully failed: no git log
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2 2/2] drm/i915: enable to read CSB and CSB write pointer from HWSP in GVT-g VM
2017-09-30 5:57 ` [PATCH v2 2/2] drm/i915: enable to read CSB and CSB write pointer from HWSP in GVT-g VM Weinan Li
@ 2017-10-02 10:03 ` Joonas Lahtinen
2017-10-02 10:23 ` Chris Wilson
0 siblings, 1 reply; 8+ messages in thread
From: Joonas Lahtinen @ 2017-10-02 10:03 UTC (permalink / raw)
To: Weinan Li, intel-gvt-dev, intel-gfx
On Sat, 2017-09-30 at 13:57 +0800, Weinan Li wrote:
> Let GVT-g VM read the CSB and CSB write pointer from virtual HWSP, not all
> the host support this feature, need to check the BIT(3) of caps in PVINFO.
>
> Signed-off-by: Weinan Li <weinan.z.li@intel.com>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
<SNIP>
> @@ -396,6 +393,12 @@ static bool csb_force_mmio(struct drm_i915_private *i915)
> if (intel_vtd_active())
> return true;
>
> + /* GVT emulation depends upon host kernel implementation, check
> + * support capbility by reading PV INFO before access HWSP.
> + */
The comment can be dropped completely, the code is self-descriptive.
> +++ b/drivers/gpu/drm/i915/intel_lrc.c
> @@ -722,7 +722,12 @@ static void intel_lrc_irq_handler(unsigned long data)
> &engine->status_page.page_addr[I915_HWS_CSB_BUF0_INDEX];
> unsigned int head, tail;
>
> - /* However GVT emulation depends upon intercepting CSB mmio */
> + /* However GVT-g emulation depends upon host kernel
> + * implementation, need to check support capbility by reading PV
> + * INFO before access HWSP. Beside from this, another special
> + * configuration may also need to force use mmio, like IOMMU
> + * enabled.
> + */
s/capbility/capability/ and please rephrase this to be a kerneldoc for
csb_use_mmio at the declaration.
> if (unlikely(execlists->csb_use_mmio)) {
> buf = (u32 * __force)
> (dev_priv->regs + i915_mmio_reg_offset(RING_CONTEXT_STATUS_BUF_LO(engine, 0)));
Regards, Joonas
--
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2 2/2] drm/i915: enable to read CSB and CSB write pointer from HWSP in GVT-g VM
2017-10-02 10:03 ` Joonas Lahtinen
@ 2017-10-02 10:23 ` Chris Wilson
2017-10-02 11:37 ` Joonas Lahtinen
0 siblings, 1 reply; 8+ messages in thread
From: Chris Wilson @ 2017-10-02 10:23 UTC (permalink / raw)
To: Joonas Lahtinen, Weinan Li, intel-gvt-dev, intel-gfx
Quoting Joonas Lahtinen (2017-10-02 11:03:30)
> On Sat, 2017-09-30 at 13:57 +0800, Weinan Li wrote:
> > Let GVT-g VM read the CSB and CSB write pointer from virtual HWSP, not all
> > the host support this feature, need to check the BIT(3) of caps in PVINFO.
> >
> > Signed-off-by: Weinan Li <weinan.z.li@intel.com>
> > Cc: Chris Wilson <chris@chris-wilson.co.uk>
>
> <SNIP>
>
> > @@ -396,6 +393,12 @@ static bool csb_force_mmio(struct drm_i915_private *i915)
> > if (intel_vtd_active())
> > return true;
> >
> > + /* GVT emulation depends upon host kernel implementation, check
> > + * support capbility by reading PV INFO before access HWSP.
> > + */
>
> The comment can be dropped completely, the code is self-descriptive.
>
> > +++ b/drivers/gpu/drm/i915/intel_lrc.c
> > @@ -722,7 +722,12 @@ static void intel_lrc_irq_handler(unsigned long data)
> > &engine->status_page.page_addr[I915_HWS_CSB_BUF0_INDEX];
> > unsigned int head, tail;
> >
> > - /* However GVT emulation depends upon intercepting CSB mmio */
> > + /* However GVT-g emulation depends upon host kernel
> > + * implementation, need to check support capbility by reading PV
> > + * INFO before access HWSP. Beside from this, another special
> > + * configuration may also need to force use mmio, like IOMMU
> > + * enabled.
> > + */
>
> s/capbility/capability/ and please rephrase this to be a kerneldoc for
> csb_use_mmio at the declaration.
This is not a description of how to use the function or even on how
csb_use_mmio work, this is why we want certain logic paths. Just a regular
old comment.
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2 2/2] drm/i915: enable to read CSB and CSB write pointer from HWSP in GVT-g VM
2017-10-02 10:23 ` Chris Wilson
@ 2017-10-02 11:37 ` Joonas Lahtinen
2017-10-09 3:02 ` Li, Weinan Z
0 siblings, 1 reply; 8+ messages in thread
From: Joonas Lahtinen @ 2017-10-02 11:37 UTC (permalink / raw)
To: Chris Wilson, Weinan Li, intel-gvt-dev, intel-gfx
On Mon, 2017-10-02 at 11:23 +0100, Chris Wilson wrote:
> Quoting Joonas Lahtinen (2017-10-02 11:03:30)
> > On Sat, 2017-09-30 at 13:57 +0800, Weinan Li wrote:
> > > Let GVT-g VM read the CSB and CSB write pointer from virtual HWSP, not all
> > > the host support this feature, need to check the BIT(3) of caps in PVINFO.
> > >
> > > Signed-off-by: Weinan Li <weinan.z.li@intel.com>
> > > Cc: Chris Wilson <chris@chris-wilson.co.uk>
> >
> > <SNIP>
> >
> > > @@ -396,6 +393,12 @@ static bool csb_force_mmio(struct drm_i915_private *i915)
> > > if (intel_vtd_active())
> > > return true;
> > >
> > > + /* GVT emulation depends upon host kernel implementation, check
> > > + * support capbility by reading PV INFO before access HWSP.
> > > + */
> >
> > The comment can be dropped completely, the code is self-descriptive.
> >
> > > +++ b/drivers/gpu/drm/i915/intel_lrc.c
> > > @@ -722,7 +722,12 @@ static void intel_lrc_irq_handler(unsigned long data)
> > > &engine->status_page.page_addr[I915_HWS_CSB_BUF0_INDEX];
> > > unsigned int head, tail;
> > >
> > > - /* However GVT emulation depends upon intercepting CSB mmio */
> > > + /* However GVT-g emulation depends upon host kernel
> > > + * implementation, need to check support capbility by reading PV
> > > + * INFO before access HWSP. Beside from this, another special
> > > + * configuration may also need to force use mmio, like IOMMU
> > > + * enabled.
> > > + */
> >
> > s/capbility/capability/ and please rephrase this to be a kerneldoc for
> > csb_use_mmio at the declaration.
>
> This is not a description of how to use the function or even on how
> csb_use_mmio work, this is why we want certain logic paths. Just a regular
> old comment.
That's why I asked to "rephrase" :) Anyway, it seems like there already
is kerneldoc for the csb_use_mmio, so this comment can be dropped.
Regards, Joonas
--
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2 2/2] drm/i915: enable to read CSB and CSB write pointer from HWSP in GVT-g VM
2017-10-02 11:37 ` Joonas Lahtinen
@ 2017-10-09 3:02 ` Li, Weinan Z
0 siblings, 0 replies; 8+ messages in thread
From: Li, Weinan Z @ 2017-10-09 3:02 UTC (permalink / raw)
To: Joonas Lahtinen, Chris Wilson, intel-gvt-dev, intel-gfx
On 10/2/2017 7:37 PM, Joonas Lahtinen wrote:
> On Mon, 2017-10-02 at 11:23 +0100, Chris Wilson wrote:
>> Quoting Joonas Lahtinen (2017-10-02 11:03:30)
>>> On Sat, 2017-09-30 at 13:57 +0800, Weinan Li wrote:
>>>> Let GVT-g VM read the CSB and CSB write pointer from virtual HWSP, not all
>>>> the host support this feature, need to check the BIT(3) of caps in PVINFO.
>>>>
>>>> Signed-off-by: Weinan Li <weinan.z.li@intel.com>
>>>> Cc: Chris Wilson <chris@chris-wilson.co.uk>
>>> <SNIP>
>>>
>>>> @@ -396,6 +393,12 @@ static bool csb_force_mmio(struct drm_i915_private *i915)
>>>> if (intel_vtd_active())
>>>> return true;
>>>>
>>>> + /* GVT emulation depends upon host kernel implementation, check
>>>> + * support capbility by reading PV INFO before access HWSP.
>>>> + */
>>> The comment can be dropped completely, the code is self-descriptive.
will remove it in next version.
>>>
>>>> +++ b/drivers/gpu/drm/i915/intel_lrc.c
>>>> @@ -722,7 +722,12 @@ static void intel_lrc_irq_handler(unsigned long data)
>>>> &engine->status_page.page_addr[I915_HWS_CSB_BUF0_INDEX];
>>>> unsigned int head, tail;
>>>>
>>>> - /* However GVT emulation depends upon intercepting CSB mmio */
>>>> + /* However GVT-g emulation depends upon host kernel
>>>> + * implementation, need to check support capbility by reading PV
>>>> + * INFO before access HWSP. Beside from this, another special
>>>> + * configuration may also need to force use mmio, like IOMMU
>>>> + * enabled.
>>>> + */
>>> s/capbility/capability/ and please rephrase this to be a kerneldoc for
>>> csb_use_mmio at the declaration.
>> This is not a description of how to use the function or even on how
>> csb_use_mmio work, this is why we want certain logic paths. Just a regular
>> old comment.
> That's why I asked to "rephrase" :) Anyway, it seems like there already
> is kerneldoc for the csb_use_mmio, so this comment can be dropped.
will remove this comment in next version.
> Regards, Joonas
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2017-10-09 3:02 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-30 5:57 [PATCH v2 0/2] enable virtual HWSP in GVT-g Weinan Li
2017-09-30 5:57 ` [PATCH v2 1/2] drm/i915/gvt: update CSB and CSB write pointer in virtual HWSP Weinan Li
2017-09-30 5:57 ` [PATCH v2 2/2] drm/i915: enable to read CSB and CSB write pointer from HWSP in GVT-g VM Weinan Li
2017-10-02 10:03 ` Joonas Lahtinen
2017-10-02 10:23 ` Chris Wilson
2017-10-02 11:37 ` Joonas Lahtinen
2017-10-09 3:02 ` Li, Weinan Z
2017-09-30 6:06 ` ✗ Fi.CI.BAT: failure for enable virtual HWSP in GVT-g Patchwork
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox