diff mbox

drm/i915: add kvmgt as i915's soft dependency

Message ID 1529652777-3653-1-git-send-email-hang.yuan@linux.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

hang.yuan@linux.intel.com June 22, 2018, 7:32 a.m. UTC
From: Hang Yuan <hang.yuan@linux.intel.com>

This helps kvmgt included in initramfs and got loaded after i915.

Signed-off-by: Hang Yuan <hang.yuan@linux.intel.com>
---
 drivers/gpu/drm/i915/i915_pci.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Chris Wilson June 22, 2018, 7:44 a.m. UTC | #1
Quoting hang.yuan@linux.intel.com (2018-06-22 08:32:57)
> From: Hang Yuan <hang.yuan@linux.intel.com>
> 
> This helps kvmgt included in initramfs and got loaded after i915.
> 
> Signed-off-by: Hang Yuan <hang.yuan@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/i915_pci.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c
> index 062e91b..a0fb51f 100644
> --- a/drivers/gpu/drm/i915/i915_pci.c
> +++ b/drivers/gpu/drm/i915/i915_pci.c
> @@ -773,3 +773,5 @@ MODULE_AUTHOR("Intel Corporation");
>  
>  MODULE_DESCRIPTION(DRIVER_DESC);
>  MODULE_LICENSE("GPL and additional rights");
> +
> +MODULE_SOFTDEP("post: kvmgt");

The dependency is added by gvt, so what's it doing here?
-Chris
hang.yuan@linux.intel.com June 22, 2018, 8:33 a.m. UTC | #2
On Fri, Jun 22, 2018 at 08:44:50AM +0100, Chris Wilson wrote:
> Quoting hang.yuan@linux.intel.com (2018-06-22 08:32:57)
> > From: Hang Yuan <hang.yuan@linux.intel.com>
> > 
> > This helps kvmgt included in initramfs and got loaded after i915.
> > 
> > Signed-off-by: Hang Yuan <hang.yuan@linux.intel.com>
> > ---
> >  drivers/gpu/drm/i915/i915_pci.c | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c
> > index 062e91b..a0fb51f 100644
> > --- a/drivers/gpu/drm/i915/i915_pci.c
> > +++ b/drivers/gpu/drm/i915/i915_pci.c
> > @@ -773,3 +773,5 @@ MODULE_AUTHOR("Intel Corporation");
> >  
> >  MODULE_DESCRIPTION(DRIVER_DESC);
> >  MODULE_LICENSE("GPL and additional rights");
> > +
> > +MODULE_SOFTDEP("post: kvmgt");
> 
> The dependency is added by gvt, so what's it doing here?
> -Chris
It wants to indicate the soft dependency between i915 and kvmgt. So kvmgt can be loaded automatically after i915 module, for example, in initramfs. Do you see any problem here?
hang.yuan@linux.intel.com June 22, 2018, 8:45 a.m. UTC | #3
On Fri, Jun 22, 2018 at 04:33:21PM +0800, intel-gvt-dev-bounces@lists.freedesktop.org wrote:
> On Fri, Jun 22, 2018 at 08:44:50AM +0100, Chris Wilson wrote:
> > Quoting hang.yuan@linux.intel.com (2018-06-22 08:32:57)
> > > From: Hang Yuan <hang.yuan@linux.intel.com>
> > > 
> > > This helps kvmgt included in initramfs and got loaded after i915.
> > > 
> > > Signed-off-by: Hang Yuan <hang.yuan@linux.intel.com>
> > > ---
> > >  drivers/gpu/drm/i915/i915_pci.c | 2 ++
> > >  1 file changed, 2 insertions(+)
> > > 
> > > diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c
> > > index 062e91b..a0fb51f 100644
> > > --- a/drivers/gpu/drm/i915/i915_pci.c
> > > +++ b/drivers/gpu/drm/i915/i915_pci.c
> > > @@ -773,3 +773,5 @@ MODULE_AUTHOR("Intel Corporation");
> > >  
> > >  MODULE_DESCRIPTION(DRIVER_DESC);
> > >  MODULE_LICENSE("GPL and additional rights");
> > > +
> > > +MODULE_SOFTDEP("post: kvmgt");
> > 
> > The dependency is added by gvt, so what's it doing here?
> > -Chris
> It wants to indicate the soft dependency between i915 and kvmgt. So kvmgt can be loaded automatically after i915 module, for example, in initramfs. Do you see any problem here?
Sorry I made the field "From" with wrong account in my last email.
hang.yuan@linux.intel.com June 22, 2018, 8:58 a.m. UTC | #4
On Fri, Jun 22, 2018 at 09:41:26AM +0100, Chris Wilson wrote:
> Quoting Hang Yuan (2018-06-22 09:18:02)
> > On Fri, Jun 22, 2018 at 08:44:50AM +0100, Chris Wilson wrote:
> > > Quoting hang.yuan@linux.intel.com (2018-06-22 08:32:57)
> > > > From: Hang Yuan <hang.yuan@linux.intel.com>
> > > > 
> > > > This helps kvmgt included in initramfs and got loaded after i915.
> > > > 
> > > > Signed-off-by: Hang Yuan <hang.yuan@linux.intel.com>
> > > > ---
> > > >  drivers/gpu/drm/i915/i915_pci.c | 2 ++
> > > >  1 file changed, 2 insertions(+)
> > > > 
> > > > diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c
> > > > index 062e91b..a0fb51f 100644
> > > > --- a/drivers/gpu/drm/i915/i915_pci.c
> > > > +++ b/drivers/gpu/drm/i915/i915_pci.c
> > > > @@ -773,3 +773,5 @@ MODULE_AUTHOR("Intel Corporation");
> > > >  
> > > >  MODULE_DESCRIPTION(DRIVER_DESC);
> > > >  MODULE_LICENSE("GPL and additional rights");
> > > > +
> > > > +MODULE_SOFTDEP("post: kvmgt");
> > > 
> > > The dependency is added by gvt, so what's it doing here?
> > > -Chris
> > It wants to indicate the soft dependency between kvmgt and i915. So kvmgt can be loaded after i915 module in initramfs. Do you think it's ok?
> 
> #if IS_ENABLED(CONFIG_DRM_I915_GVT_KVMGT)
>                 /* not in Xen. Try KVMGT */
>                 intel_gvt_host.mpt = try_then_request_module(
>                                 symbol_get(kvmgt_mpt), "kvmgt");
>                 intel_gvt_host.hypervisor_type = INTEL_GVT_HYPERVISOR_KVM;
> #endif
> 
> Does not look all too soft, conditional and a pre-dependency not post.
> Also only required if gvt + gvt-kvmgt is compiled in. Not part of the
> base i915 module.
> -Chris
Thanks for the comments. I will re-consider the implementation.

Regards,
Henry
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c
index 062e91b..a0fb51f 100644
--- a/drivers/gpu/drm/i915/i915_pci.c
+++ b/drivers/gpu/drm/i915/i915_pci.c
@@ -773,3 +773,5 @@  MODULE_AUTHOR("Intel Corporation");
 
 MODULE_DESCRIPTION(DRIVER_DESC);
 MODULE_LICENSE("GPL and additional rights");
+
+MODULE_SOFTDEP("post: kvmgt");