From: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
To: Zhi Wang <zhi.a.wang@intel.com>,
chris@chris-wilson.co.uk, zhiyuan.lv@intel.com,
kevin.tian@intel.com, tvrtko.ursulin@linux.intel.com,
intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v7 05/11] drm/i915: gvt: Introduce the basic architecture of GVT-g
Date: Wed, 08 Jun 2016 11:28:01 +0300 [thread overview]
Message-ID: <1465374481.5803.18.camel@linux.intel.com> (raw)
In-Reply-To: <1465312727-2211-6-git-send-email-zhi.a.wang@intel.com>
On ti, 2016-06-07 at 11:18 -0400, Zhi Wang wrote:
> This patch introduces the very basic framework of GVT-g device model,
> includes basic prototypes, definitions, initialization.
>
> v7:
> - Refine the URL link in Kconfig. (Joonas)
> - Refine the introduction of GVT-g host support in Kconfig. (Joonas)
> - Remove the macro GVT_ALIGN(), use round_down() instead. (Joonas)
> - Make "struct intel_gvt" a data member in struct drm_i915_private.(Joonas)
> - Remove {alloc, free}_gvt_device()
> - Rename intel_gvt_{create, destroy}_gvt_device()
> - Expost intel_gvt_init_host()
> - Remove the dummy "struct intel_gvt" declaration in intel_gvt.h (Joonas)
>
> v6:
> - Refine introduction in Kconfig. (Chris)
> - The exposed API functions will take struct intel_gvt * instead of
> void *. (Chris/Tvrtko)
> - Remove most memebers of strct intel_gvt_device_info. Will add them
> in the device model patches.(Chris)
> - Remove gvt_info() and gvt_err() in debug.h. (Chris)
> - Move GVT kernel parameter into i915_params. (Chris)
> - Remove include/drm/i915_gvt.h, as GVT-g will be built within i915.
> - Remove the redundant struct i915_gvt *, as the functions in i915
> will directly take struct intel_gvt *.
> - Add more comments for reviewer.
>
> v5:
> Take Tvrtko's comments:
> - Fix the misspelled words in Kconfig
> - Let functions take drm_i915_private * instead of struct drm_device *
> - Remove redundant prints/local varible initialization
>
> v3:
> Take Joonas' comments:
> - Change file name i915_gvt.* to intel_gvt.*
> - Move GVT kernel parameter into intel_gvt.c
> - Remove redundant debug macros
> - Change error handling style
> - Add introductions for some stub functions
> - Introduce drm/i915_gvt.h.
>
> Take Kevin's comments:
> - Move GVT-g host/guest check into intel_vgt_balloon in i915_gem_gtt.c
>
> v2:
> - Introduce i915_gvt.c.
> It's necessary to introduce the stubs between i915 driver and GVT-g host,
> as GVT-g components is configurable in kernel config. When disabled, the
> stubs here do nothing.
>
> Take Joonas' comments:
> - Replace boolean return value with int.
> - Replace customized info/warn/debug macros with DRM macros.
> - Document all non-static functions like i915.
> - Remove empty and unused functions.
> - Replace magic number with marcos.
> - Set GVT-g in kernel config to "n" by default.
>
> Signed-off-by: Zhi Wang <zhi.a.wang@intel.com>
Again, add Cc: everyone who has given comments.
> ---
> drivers/gpu/drm/i915/Kconfig | 22 +++++
> drivers/gpu/drm/i915/Makefile | 5 ++
> drivers/gpu/drm/i915/gvt/Makefile | 5 ++
> drivers/gpu/drm/i915/gvt/debug.h | 34 ++++++++
> drivers/gpu/drm/i915/gvt/gvt.c | 158 +++++++++++++++++++++++++++++++++++
> drivers/gpu/drm/i915/gvt/gvt.h | 72 ++++++++++++++++
> drivers/gpu/drm/i915/gvt/hypercall.h | 38 +++++++++
> drivers/gpu/drm/i915/gvt/mpt.h | 49 +++++++++++
> drivers/gpu/drm/i915/i915_dma.c | 16 +++-
> drivers/gpu/drm/i915/i915_drv.h | 10 +++
> drivers/gpu/drm/i915/i915_params.c | 5 ++
> drivers/gpu/drm/i915/i915_params.h | 1 +
> drivers/gpu/drm/i915/intel_gvt.c | 100 ++++++++++++++++++++++
> drivers/gpu/drm/i915/intel_gvt.h | 45 ++++++++++
> 14 files changed, 556 insertions(+), 4 deletions(-)
> create mode 100644 drivers/gpu/drm/i915/gvt/Makefile
> create mode 100644 drivers/gpu/drm/i915/gvt/debug.h
> create mode 100644 drivers/gpu/drm/i915/gvt/gvt.c
> create mode 100644 drivers/gpu/drm/i915/gvt/gvt.h
> create mode 100644 drivers/gpu/drm/i915/gvt/hypercall.h
> create mode 100644 drivers/gpu/drm/i915/gvt/mpt.h
> create mode 100644 drivers/gpu/drm/i915/intel_gvt.c
> create mode 100644 drivers/gpu/drm/i915/intel_gvt.h
>
> +/**
> + * intel_gvt_clean_device - clean a GVT device
> + * @gvt: intel gvt device
> + *
> + * This function is called at the driver unloading stage, to free the
> + * resources owned by a GVT device.
> + *
> + */
> +void intel_gvt_clean_device(struct drm_i915_private *dev_priv)
> +{
> + struct intel_gvt *gvt = &dev_priv->gvt;
> +
> + if (WARN_ON(!gvt->initialized))
> + return;
> +
> + mutex_lock(&intel_gvt_host.gvt_idr_lock);
Why is this lock necessary? I assume intel_gvt_init will be called on
driver load (same for fini part), and there should be no races.
With that explained or removed;
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> + idr_remove(&intel_gvt_host.gvt_idr, gvt->id);
> + mutex_unlock(&intel_gvt_host.gvt_idr_lock);
> + /* Other de-initialization of GVT components will be introduced. */
> +
> + gvt->initialized = false;
> +}
> +
--
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
next prev parent reply other threads:[~2016-06-08 8:28 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-07 15:18 [PATCH v7 00/11] Introduce the implementation of GVT context Zhi Wang
2016-06-07 15:18 ` [PATCH v7 01/11] drm/i915: Factor out i915_pvinfo.h Zhi Wang
2016-06-08 7:55 ` Joonas Lahtinen
2016-06-08 8:20 ` Wang, Zhi A
2016-06-07 15:18 ` [PATCH v7 02/11] drm/i915: Use offsetof() to calculate the offset of members in PVINFO page Zhi Wang
2016-06-08 7:57 ` Joonas Lahtinen
2016-06-07 15:18 ` [PATCH v7 03/11] drm/i915: Fold vGPU active check into inner functions Zhi Wang
2016-06-08 8:04 ` Joonas Lahtinen
2016-06-08 8:06 ` Wang, Zhi A
2016-06-07 15:18 ` [PATCH v7 04/11] drm/i915: Add teardown path in intel_vgt_ballon() Zhi Wang
2016-06-08 8:12 ` Joonas Lahtinen
2016-06-07 15:18 ` [PATCH v7 05/11] drm/i915: gvt: Introduce the basic architecture of GVT-g Zhi Wang
2016-06-08 8:28 ` Joonas Lahtinen [this message]
2016-06-07 15:18 ` [PATCH v7 06/11] drm/i915: Introduce host graphics memory partition for GVT-g Zhi Wang
2016-06-07 15:18 ` [PATCH v7 07/11] drm/i915: Make ring buffer size of a LRC context configurable Zhi Wang
2016-06-08 7:08 ` Chris Wilson
2016-06-08 8:34 ` Joonas Lahtinen
2016-06-07 15:18 ` [PATCH v7 08/11] drm/i915: Make addressing mode bits in context descriptor configurable Zhi Wang
2016-06-08 7:12 ` Chris Wilson
2016-06-08 8:17 ` Wang, Zhi A
2016-06-08 8:38 ` Joonas Lahtinen
2016-06-07 15:18 ` [PATCH v7 09/11] drm/i915: Introduce execlist context status change notification Zhi Wang
2016-06-07 22:01 ` Chris Wilson
2016-06-08 8:40 ` Joonas Lahtinen
2016-06-07 15:18 ` [PATCH v7 10/11] drm/i915: Support LRC context single submission Zhi Wang
2016-06-08 7:04 ` Chris Wilson
2016-06-08 8:44 ` Joonas Lahtinen
2016-06-07 15:18 ` [PATCH v7 11/11] drm/i915: Introduce GVT context creation API Zhi Wang
2016-06-08 6:59 ` Chris Wilson
2016-06-07 15:53 ` ✓ Ro.CI.BAT: success for Introduce the implementation of GVT context (rev5) Patchwork
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=1465374481.5803.18.camel@linux.intel.com \
--to=joonas.lahtinen@linux.intel.com \
--cc=chris@chris-wilson.co.uk \
--cc=intel-gfx@lists.freedesktop.org \
--cc=kevin.tian@intel.com \
--cc=tvrtko.ursulin@linux.intel.com \
--cc=zhi.a.wang@intel.com \
--cc=zhiyuan.lv@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox