* [RFC 1/3] component: alloc component_match without any comp to match
2018-07-11 14:11 [RFC 0/3] I915 component master Ramalingam C
@ 2018-07-11 14:11 ` Ramalingam C
2018-07-12 8:21 ` Daniel Vetter
2018-07-11 14:11 ` [RFC 2/3] drm/i915: component master at i915 driver load Ramalingam C
` (2 subsequent siblings)
3 siblings, 1 reply; 9+ messages in thread
From: Ramalingam C @ 2018-07-11 14:11 UTC (permalink / raw)
To: intel-gfx, daniel, tomas.winkler, alexander.usyskin
If all the components associated to a component master is not added
to the component framework due to the HW capability or Kconfig
selection, component_match will be NULL at
component_master_add_with_match().
To avoid this, component_match_alloc() is added to the framework,
to allcoate the struct component_match with zero associated components.
Hence component master can be added with a component_match with zero
associated components.
This helps the component master bind call to get triggered always,
even if no component is registered for that particular master.
This is useful if we use the component master for waiting for few
components(features), only if they are registered, else proceed with
the normal flow.
Signed-off-by: Ramalingam C <ramalingam.c@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
drivers/base/component.c | 30 ++++++++++++++++++++++++++++++
include/linux/component.h | 2 ++
2 files changed, 32 insertions(+)
diff --git a/drivers/base/component.c b/drivers/base/component.c
index 8946dfee4768..007fb738263a 100644
--- a/drivers/base/component.c
+++ b/drivers/base/component.c
@@ -312,6 +312,36 @@ static int component_match_realloc(struct device *dev,
}
/*
+ * Allocate the match without any component_match_array elements.
+ *
+ * This function is useful when the component master might end up
+ * registering itself without any matching components.
+ */
+void component_match_alloc(struct device *master,
+ struct component_match **matchptr)
+{
+ struct component_match *match = *matchptr;
+
+ if (IS_ERR(match))
+ return;
+
+ if (match)
+ return;
+
+ match = devres_alloc(devm_component_match_release,
+ sizeof(*match), GFP_KERNEL);
+ if (!match) {
+ *matchptr = ERR_PTR(-ENOMEM);
+ return;
+ }
+
+ devres_add(master, match);
+
+ *matchptr = match;
+}
+EXPORT_SYMBOL(component_match_alloc);
+
+/*
* Add a component to be matched, with a release function.
*
* The match array is first created or extended if necessary.
diff --git a/include/linux/component.h b/include/linux/component.h
index e71fbbbc74e2..3f6b420a58f8 100644
--- a/include/linux/component.h
+++ b/include/linux/component.h
@@ -37,6 +37,8 @@ void component_match_add_release(struct device *master,
struct component_match **matchptr,
void (*release)(struct device *, void *),
int (*compare)(struct device *, void *), void *compare_data);
+void component_match_alloc(struct device *master,
+ struct component_match **matchptr);
static inline void component_match_add(struct device *master,
struct component_match **matchptr,
--
2.7.4
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 9+ messages in thread* Re: [RFC 1/3] component: alloc component_match without any comp to match
2018-07-11 14:11 ` [RFC 1/3] component: alloc component_match without any comp to match Ramalingam C
@ 2018-07-12 8:21 ` Daniel Vetter
2018-07-12 8:53 ` Ramalingam C
0 siblings, 1 reply; 9+ messages in thread
From: Daniel Vetter @ 2018-07-12 8:21 UTC (permalink / raw)
To: Ramalingam C; +Cc: intel-gfx, alexander.usyskin, tomas.winkler
On Wed, Jul 11, 2018 at 07:41:26PM +0530, Ramalingam C wrote:
> If all the components associated to a component master is not added
> to the component framework due to the HW capability or Kconfig
> selection, component_match will be NULL at
> component_master_add_with_match().
>
> To avoid this, component_match_alloc() is added to the framework,
> to allcoate the struct component_match with zero associated components.
> Hence component master can be added with a component_match with zero
> associated components.
>
> This helps the component master bind call to get triggered always,
> even if no component is registered for that particular master.
>
> This is useful if we use the component master for waiting for few
> components(features), only if they are registered, else proceed with
> the normal flow.
registered is a bit confusing here, I'd go with "supported by the
underlying hw". And maybe also explain that this is for big pci device
drivers where only some small/optional things are external components, so
different use-case from SoC drivers where the entire driver is always
built up from lots of small components.
When you submit this for real please also run script/get_maintainers.pl
for the full Cc: list.
> Signed-off-by: Ramalingam C <ramalingam.c@intel.com>
> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Uh, don't do this, ever. I didn't put my s-o-b onto this patch. If you
want to credit me for the suggestion, use
Suggested-by: ...
s-o-b has legal meaning and is like signing a contract, you've just forged
my signature here. Same applies to reviewed-by tags btw.
-Daniel
> ---
> drivers/base/component.c | 30 ++++++++++++++++++++++++++++++
> include/linux/component.h | 2 ++
> 2 files changed, 32 insertions(+)
>
> diff --git a/drivers/base/component.c b/drivers/base/component.c
> index 8946dfee4768..007fb738263a 100644
> --- a/drivers/base/component.c
> +++ b/drivers/base/component.c
> @@ -312,6 +312,36 @@ static int component_match_realloc(struct device *dev,
> }
>
> /*
> + * Allocate the match without any component_match_array elements.
> + *
> + * This function is useful when the component master might end up
> + * registering itself without any matching components.
> + */
> +void component_match_alloc(struct device *master,
> + struct component_match **matchptr)
> +{
> + struct component_match *match = *matchptr;
> +
> + if (IS_ERR(match))
> + return;
> +
> + if (match)
> + return;
> +
> + match = devres_alloc(devm_component_match_release,
> + sizeof(*match), GFP_KERNEL);
> + if (!match) {
> + *matchptr = ERR_PTR(-ENOMEM);
> + return;
> + }
> +
> + devres_add(master, match);
> +
> + *matchptr = match;
> +}
> +EXPORT_SYMBOL(component_match_alloc);
> +
> +/*
> * Add a component to be matched, with a release function.
> *
> * The match array is first created or extended if necessary.
> diff --git a/include/linux/component.h b/include/linux/component.h
> index e71fbbbc74e2..3f6b420a58f8 100644
> --- a/include/linux/component.h
> +++ b/include/linux/component.h
> @@ -37,6 +37,8 @@ void component_match_add_release(struct device *master,
> struct component_match **matchptr,
> void (*release)(struct device *, void *),
> int (*compare)(struct device *, void *), void *compare_data);
> +void component_match_alloc(struct device *master,
> + struct component_match **matchptr);
>
> static inline void component_match_add(struct device *master,
> struct component_match **matchptr,
> --
> 2.7.4
>
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [RFC 1/3] component: alloc component_match without any comp to match
2018-07-12 8:21 ` Daniel Vetter
@ 2018-07-12 8:53 ` Ramalingam C
0 siblings, 0 replies; 9+ messages in thread
From: Ramalingam C @ 2018-07-12 8:53 UTC (permalink / raw)
To: Daniel Vetter; +Cc: intel-gfx, alexander.usyskin, tomas.winkler
On Thursday 12 July 2018 01:51 PM, Daniel Vetter wrote:
> On Wed, Jul 11, 2018 at 07:41:26PM +0530, Ramalingam C wrote:
>> If all the components associated to a component master is not added
>> to the component framework due to the HW capability or Kconfig
>> selection, component_match will be NULL at
>> component_master_add_with_match().
>>
>> To avoid this, component_match_alloc() is added to the framework,
>> to allcoate the struct component_match with zero associated components.
>> Hence component master can be added with a component_match with zero
>> associated components.
>>
>> This helps the component master bind call to get triggered always,
>> even if no component is registered for that particular master.
>>
>> This is useful if we use the component master for waiting for few
>> components(features), only if they are registered, else proceed with
>> the normal flow.
> registered is a bit confusing here, I'd go with "supported by the
> underlying hw". And maybe also explain that this is for big pci device
> drivers where only some small/optional things are external components, so
> different use-case from SoC drivers where the entire driver is always
> built up from lots of small components.
>
> When you submit this for real please also run script/get_maintainers.pl
> for the full Cc: list.
sure.
>
>> Signed-off-by: Ramalingam C <ramalingam.c@intel.com>
>> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> Uh, don't do this, ever. I didn't put my s-o-b onto this patch. If you
> want to credit me for the suggestion, use
>
> Suggested-by: ...
>
> s-o-b has legal meaning and is like signing a contract, you've just forged
> my signature here. Same applies to reviewed-by tags btw.
Since the idea is suggested by you, thought that its my responsibility
to give the credit. Sure got your point.
I will add Suggested-by: instead.
Thanks,
Ram.
> -Daniel
>
>> ---
>> drivers/base/component.c | 30 ++++++++++++++++++++++++++++++
>> include/linux/component.h | 2 ++
>> 2 files changed, 32 insertions(+)
>>
>> diff --git a/drivers/base/component.c b/drivers/base/component.c
>> index 8946dfee4768..007fb738263a 100644
>> --- a/drivers/base/component.c
>> +++ b/drivers/base/component.c
>> @@ -312,6 +312,36 @@ static int component_match_realloc(struct device *dev,
>> }
>>
>> /*
>> + * Allocate the match without any component_match_array elements.
>> + *
>> + * This function is useful when the component master might end up
>> + * registering itself without any matching components.
>> + */
>> +void component_match_alloc(struct device *master,
>> + struct component_match **matchptr)
>> +{
>> + struct component_match *match = *matchptr;
>> +
>> + if (IS_ERR(match))
>> + return;
>> +
>> + if (match)
>> + return;
>> +
>> + match = devres_alloc(devm_component_match_release,
>> + sizeof(*match), GFP_KERNEL);
>> + if (!match) {
>> + *matchptr = ERR_PTR(-ENOMEM);
>> + return;
>> + }
>> +
>> + devres_add(master, match);
>> +
>> + *matchptr = match;
>> +}
>> +EXPORT_SYMBOL(component_match_alloc);
>> +
>> +/*
>> * Add a component to be matched, with a release function.
>> *
>> * The match array is first created or extended if necessary.
>> diff --git a/include/linux/component.h b/include/linux/component.h
>> index e71fbbbc74e2..3f6b420a58f8 100644
>> --- a/include/linux/component.h
>> +++ b/include/linux/component.h
>> @@ -37,6 +37,8 @@ void component_match_add_release(struct device *master,
>> struct component_match **matchptr,
>> void (*release)(struct device *, void *),
>> int (*compare)(struct device *, void *), void *compare_data);
>> +void component_match_alloc(struct device *master,
>> + struct component_match **matchptr);
>>
>> static inline void component_match_add(struct device *master,
>> struct component_match **matchptr,
>> --
>> 2.7.4
>>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 9+ messages in thread
* [RFC 2/3] drm/i915: component master at i915 driver load
2018-07-11 14:11 [RFC 0/3] I915 component master Ramalingam C
2018-07-11 14:11 ` [RFC 1/3] component: alloc component_match without any comp to match Ramalingam C
@ 2018-07-11 14:11 ` Ramalingam C
2018-07-12 8:26 ` Daniel Vetter
2018-07-11 14:11 ` [RFC 3/3] drm/i915: Initialize HDCP2.2 and its MEI interface Ramalingam C
2018-07-11 14:21 ` ✗ Fi.CI.BAT: failure for I915 component master Patchwork
3 siblings, 1 reply; 9+ messages in thread
From: Ramalingam C @ 2018-07-11 14:11 UTC (permalink / raw)
To: intel-gfx, daniel, tomas.winkler, alexander.usyskin
A generic component master is added to hold the i915 registration
untill all required kernel modules are up and active.
This is achieved through following steps:
- moving the i915 driver registration to the component master's
bind call
- all required kernel modules will add one component each to
component_match of I915 component master.
If no component is added to the I915 component master, due to CONFIG
selection or HW limitation, component master's bind call will be
triggered with no wait.
Signed-off-by: Ramalingam C <ramalingam.c@intel.com>
---
drivers/gpu/drm/i915/i915_drv.c | 87 +++++++++++++++++++++++++++++++++++------
drivers/gpu/drm/i915/i915_drv.h | 3 ++
include/drm/i915_component.h | 16 ++++++++
3 files changed, 94 insertions(+), 12 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 0db3c83cce29..598ab3afc131 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -39,12 +39,14 @@
#include <linux/vgaarb.h>
#include <linux/vga_switcheroo.h>
#include <linux/vt.h>
+#include <linux/component.h>
#include <acpi/video.h>
#include <drm/drmP.h>
#include <drm/drm_crtc_helper.h>
#include <drm/drm_atomic_helper.h>
#include <drm/i915_drm.h>
+#include <drm/i915_component.h>
#include "i915_drv.h"
#include "i915_trace.h"
@@ -1247,8 +1249,6 @@ static void i915_driver_register(struct drm_i915_private *dev_priv)
if (IS_GEN5(dev_priv))
intel_gpu_ips_init(dev_priv);
- intel_audio_init(dev_priv);
-
/*
* Some ports require correctly set-up hpd registers for detection to
* work properly (leading to ghost connected connector status), e.g. VGA
@@ -1310,6 +1310,47 @@ static void i915_welcome_messages(struct drm_i915_private *dev_priv)
DRM_INFO("DRM_I915_DEBUG_GEM enabled\n");
}
+static void i915_driver_load_tail(struct drm_i915_private *dev_priv)
+{
+ i915_driver_register(dev_priv);
+
+ intel_runtime_pm_enable(dev_priv);
+
+ intel_init_ipc(dev_priv);
+
+ intel_runtime_pm_put(dev_priv);
+
+ i915_welcome_messages(dev_priv);
+}
+
+static int i915_component_master_bind(struct device *dev)
+{
+ struct drm_i915_private *dev_priv = kdev_to_i915(dev);
+ int ret;
+
+ ret = component_bind_all(dev, dev_priv->comp_master);
+ if (ret < 0)
+ return ret;
+
+ i915_driver_load_tail(dev_priv);
+
+ return 0;
+}
+
+static void i915_component_master_unbind(struct device *dev)
+{
+ struct drm_i915_private *dev_priv = kdev_to_i915(dev);
+
+ component_unbind_all(dev, dev_priv->comp_master);
+
+ /* TO-DO: Whether I915 should be unloaded on any component unbind!? */
+}
+
+static const struct component_master_ops i915_component_master_ops = {
+ .bind = i915_component_master_bind,
+ .unbind = i915_component_master_unbind,
+};
+
/**
* i915_driver_load - setup chip and create an initial config
* @pdev: PCI device
@@ -1341,12 +1382,25 @@ int i915_driver_load(struct pci_dev *pdev, const struct pci_device_id *ent)
goto out_free;
}
+ dev_priv->comp_master = kzalloc(sizeof(*dev_priv->comp_master),
+ GFP_KERNEL);
+ if (!dev_priv->comp_master) {
+ ret = -ENOMEM;
+ goto out_fini;
+ }
+
+ component_match_alloc(dev_priv->drm.dev, &dev_priv->master_match);
+ if (!dev_priv->master_match) {
+ ret = -ENOMEM;
+ goto out_comp_master_clean;
+ }
+
dev_priv->drm.pdev = pdev;
dev_priv->drm.dev_private = dev_priv;
ret = pci_enable_device(pdev);
if (ret)
- goto out_fini;
+ goto out_comp_master_clean;
pci_set_drvdata(pdev, &dev_priv->drm);
/*
@@ -1389,18 +1443,21 @@ int i915_driver_load(struct pci_dev *pdev, const struct pci_device_id *ent)
if (ret < 0)
goto out_cleanup_hw;
- i915_driver_register(dev_priv);
-
- intel_runtime_pm_enable(dev_priv);
-
- intel_init_ipc(dev_priv);
-
- intel_runtime_pm_put(dev_priv);
-
- i915_welcome_messages(dev_priv);
+ ret = component_master_add_with_match(dev_priv->drm.dev,
+ &i915_component_master_ops,
+ dev_priv->master_match);
+ if (ret < 0) {
+ DRM_DEV_ERROR(&pdev->dev, "Master comp add failed %d\n",
+ ret);
+ goto out_cleanup_modeset;
+ }
+ intel_audio_init(dev_priv);
+ DRM_DEV_INFO(&pdev->dev, "I915 waits for Components (If any).\n");
return 0;
+out_cleanup_modeset:
+ intel_modeset_cleanup(&dev_priv->drm);
out_cleanup_hw:
i915_driver_cleanup_hw(dev_priv);
out_cleanup_mmio:
@@ -1410,6 +1467,8 @@ int i915_driver_load(struct pci_dev *pdev, const struct pci_device_id *ent)
i915_driver_cleanup_early(dev_priv);
out_pci_disable:
pci_disable_device(pdev);
+out_comp_master_clean:
+ kfree(dev_priv->comp_master);
out_fini:
i915_load_error(dev_priv, "Device initialization failed (%d)\n", ret);
drm_dev_fini(&dev_priv->drm);
@@ -1428,6 +1487,10 @@ void i915_driver_unload(struct drm_device *dev)
if (i915_gem_suspend(dev_priv))
DRM_ERROR("failed to idle hardware; continuing to unload!\n");
+ component_master_del(dev_priv->drm.dev,
+ &i915_component_master_ops);
+ kfree(dev_priv->comp_master);
+
intel_display_power_get(dev_priv, POWER_DOMAIN_INIT);
drm_atomic_helper_shutdown(dev);
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 09ab12458244..620f41e13dbe 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -2119,6 +2119,9 @@ struct drm_i915_private {
struct i915_pmu pmu;
+ struct i915_component_master *comp_master;
+ struct component_match *master_match;
+
/*
* NOTE: This is the dri1/ums dungeon, don't add stuff here. Your patch
* will be rejected. Instead look for a better place.
diff --git a/include/drm/i915_component.h b/include/drm/i915_component.h
index 346b1f5cb180..52313bc227b2 100644
--- a/include/drm/i915_component.h
+++ b/include/drm/i915_component.h
@@ -121,4 +121,20 @@ struct i915_audio_component {
const struct i915_audio_component_audio_ops *audio_ops;
};
+/**
+ * struct i915_component_master - Used for communication between i915
+ * and any other drivers for the services of different feature.
+ */
+struct i915_component_master {
+ /**
+ * @i915_kdev: Kdev of I915. Used from the client component for
+ * removing the reference to mei_cldev.
+ */
+ struct device *i915_kdev;
+
+ /*
+ * Add here the interface details between I915 and interested modules.
+ */
+};
+
#endif /* _I915_COMPONENT_H_ */
--
2.7.4
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 9+ messages in thread* Re: [RFC 2/3] drm/i915: component master at i915 driver load
2018-07-11 14:11 ` [RFC 2/3] drm/i915: component master at i915 driver load Ramalingam C
@ 2018-07-12 8:26 ` Daniel Vetter
2018-07-12 9:00 ` Ramalingam C
0 siblings, 1 reply; 9+ messages in thread
From: Daniel Vetter @ 2018-07-12 8:26 UTC (permalink / raw)
To: Ramalingam C; +Cc: intel-gfx, alexander.usyskin, tomas.winkler
On Wed, Jul 11, 2018 at 07:41:27PM +0530, Ramalingam C wrote:
> A generic component master is added to hold the i915 registration
> untill all required kernel modules are up and active.
>
> This is achieved through following steps:
> - moving the i915 driver registration to the component master's
> bind call
> - all required kernel modules will add one component each to
> component_match of I915 component master.
>
> If no component is added to the I915 component master, due to CONFIG
> selection or HW limitation, component master's bind call will be
> triggered with no wait.
>
> Signed-off-by: Ramalingam C <ramalingam.c@intel.com>
> ---
> drivers/gpu/drm/i915/i915_drv.c | 87 +++++++++++++++++++++++++++++++++++------
> drivers/gpu/drm/i915/i915_drv.h | 3 ++
> include/drm/i915_component.h | 16 ++++++++
> 3 files changed, 94 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> index 0db3c83cce29..598ab3afc131 100644
> --- a/drivers/gpu/drm/i915/i915_drv.c
> +++ b/drivers/gpu/drm/i915/i915_drv.c
> @@ -39,12 +39,14 @@
> #include <linux/vgaarb.h>
> #include <linux/vga_switcheroo.h>
> #include <linux/vt.h>
> +#include <linux/component.h>
> #include <acpi/video.h>
>
> #include <drm/drmP.h>
> #include <drm/drm_crtc_helper.h>
> #include <drm/drm_atomic_helper.h>
> #include <drm/i915_drm.h>
> +#include <drm/i915_component.h>
>
> #include "i915_drv.h"
> #include "i915_trace.h"
> @@ -1247,8 +1249,6 @@ static void i915_driver_register(struct drm_i915_private *dev_priv)
> if (IS_GEN5(dev_priv))
> intel_gpu_ips_init(dev_priv);
>
> - intel_audio_init(dev_priv);
> -
> /*
> * Some ports require correctly set-up hpd registers for detection to
> * work properly (leading to ghost connected connector status), e.g. VGA
> @@ -1310,6 +1310,47 @@ static void i915_welcome_messages(struct drm_i915_private *dev_priv)
> DRM_INFO("DRM_I915_DEBUG_GEM enabled\n");
> }
>
> +static void i915_driver_load_tail(struct drm_i915_private *dev_priv)
> +{
> + i915_driver_register(dev_priv);
> +
> + intel_runtime_pm_enable(dev_priv);
> +
> + intel_init_ipc(dev_priv);
> +
> + intel_runtime_pm_put(dev_priv);
> +
> + i915_welcome_messages(dev_priv);
> +}
> +
> +static int i915_component_master_bind(struct device *dev)
> +{
> + struct drm_i915_private *dev_priv = kdev_to_i915(dev);
> + int ret;
> +
> + ret = component_bind_all(dev, dev_priv->comp_master);
> + if (ret < 0)
> + return ret;
> +
> + i915_driver_load_tail(dev_priv);
> +
> + return 0;
> +}
> +
> +static void i915_component_master_unbind(struct device *dev)
> +{
> + struct drm_i915_private *dev_priv = kdev_to_i915(dev);
> +
> + component_unbind_all(dev, dev_priv->comp_master);
> +
> + /* TO-DO: Whether I915 should be unloaded on any component unbind!? */
I think we also need a FIXME here because the audio side will blow up if
we do this?
If that's not the case then yes I think we should do the
i915_dev_unregister call from here, for symmetry. That way we should be
able to unload mei, and it should force the i915 driver out too.
This also depends upon how the entire mei reset story pans out ofc.
Aside from this tiny nit I think the load side here looks good now.
-Daniel
> +}
> +
> +static const struct component_master_ops i915_component_master_ops = {
> + .bind = i915_component_master_bind,
> + .unbind = i915_component_master_unbind,
> +};
> +
> /**
> * i915_driver_load - setup chip and create an initial config
> * @pdev: PCI device
> @@ -1341,12 +1382,25 @@ int i915_driver_load(struct pci_dev *pdev, const struct pci_device_id *ent)
> goto out_free;
> }
>
> + dev_priv->comp_master = kzalloc(sizeof(*dev_priv->comp_master),
> + GFP_KERNEL);
> + if (!dev_priv->comp_master) {
> + ret = -ENOMEM;
> + goto out_fini;
> + }
> +
> + component_match_alloc(dev_priv->drm.dev, &dev_priv->master_match);
> + if (!dev_priv->master_match) {
> + ret = -ENOMEM;
> + goto out_comp_master_clean;
> + }
> +
> dev_priv->drm.pdev = pdev;
> dev_priv->drm.dev_private = dev_priv;
>
> ret = pci_enable_device(pdev);
> if (ret)
> - goto out_fini;
> + goto out_comp_master_clean;
>
> pci_set_drvdata(pdev, &dev_priv->drm);
> /*
> @@ -1389,18 +1443,21 @@ int i915_driver_load(struct pci_dev *pdev, const struct pci_device_id *ent)
> if (ret < 0)
> goto out_cleanup_hw;
>
> - i915_driver_register(dev_priv);
> -
> - intel_runtime_pm_enable(dev_priv);
> -
> - intel_init_ipc(dev_priv);
> -
> - intel_runtime_pm_put(dev_priv);
> -
> - i915_welcome_messages(dev_priv);
> + ret = component_master_add_with_match(dev_priv->drm.dev,
> + &i915_component_master_ops,
> + dev_priv->master_match);
> + if (ret < 0) {
> + DRM_DEV_ERROR(&pdev->dev, "Master comp add failed %d\n",
> + ret);
> + goto out_cleanup_modeset;
> + }
> + intel_audio_init(dev_priv);
I think a FIXME comment explaining what's going on here would be good:
/*
* FIXME: component.c doesn't (yet) support recursion, and snd-hda
* doesn't handle delayed component registration correctly. For
* now just uncoditionally register the audio component here,
* outside of the master->bind callback.
*/
Hopefully we can untangle this later on, but for now I think this approach
is good.
> + DRM_DEV_INFO(&pdev->dev, "I915 waits for Components (If any).\n");
>
> return 0;
>
> +out_cleanup_modeset:
> + intel_modeset_cleanup(&dev_priv->drm);
> out_cleanup_hw:
> i915_driver_cleanup_hw(dev_priv);
> out_cleanup_mmio:
> @@ -1410,6 +1467,8 @@ int i915_driver_load(struct pci_dev *pdev, const struct pci_device_id *ent)
> i915_driver_cleanup_early(dev_priv);
> out_pci_disable:
> pci_disable_device(pdev);
> +out_comp_master_clean:
> + kfree(dev_priv->comp_master);
> out_fini:
> i915_load_error(dev_priv, "Device initialization failed (%d)\n", ret);
> drm_dev_fini(&dev_priv->drm);
> @@ -1428,6 +1487,10 @@ void i915_driver_unload(struct drm_device *dev)
> if (i915_gem_suspend(dev_priv))
> DRM_ERROR("failed to idle hardware; continuing to unload!\n");
>
> + component_master_del(dev_priv->drm.dev,
> + &i915_component_master_ops);
> + kfree(dev_priv->comp_master);
> +
> intel_display_power_get(dev_priv, POWER_DOMAIN_INIT);
>
> drm_atomic_helper_shutdown(dev);
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 09ab12458244..620f41e13dbe 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -2119,6 +2119,9 @@ struct drm_i915_private {
>
> struct i915_pmu pmu;
>
> + struct i915_component_master *comp_master;
> + struct component_match *master_match;
> +
> /*
> * NOTE: This is the dri1/ums dungeon, don't add stuff here. Your patch
> * will be rejected. Instead look for a better place.
> diff --git a/include/drm/i915_component.h b/include/drm/i915_component.h
> index 346b1f5cb180..52313bc227b2 100644
> --- a/include/drm/i915_component.h
> +++ b/include/drm/i915_component.h
> @@ -121,4 +121,20 @@ struct i915_audio_component {
> const struct i915_audio_component_audio_ops *audio_ops;
> };
>
> +/**
> + * struct i915_component_master - Used for communication between i915
> + * and any other drivers for the services of different feature.
> + */
> +struct i915_component_master {
> + /**
> + * @i915_kdev: Kdev of I915. Used from the client component for
> + * removing the reference to mei_cldev.
> + */
> + struct device *i915_kdev;
> +
> + /*
> + * Add here the interface details between I915 and interested modules.
> + */
> +};
> +
> #endif /* _I915_COMPONENT_H_ */
> --
> 2.7.4
>
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [RFC 2/3] drm/i915: component master at i915 driver load
2018-07-12 8:26 ` Daniel Vetter
@ 2018-07-12 9:00 ` Ramalingam C
0 siblings, 0 replies; 9+ messages in thread
From: Ramalingam C @ 2018-07-12 9:00 UTC (permalink / raw)
To: Daniel Vetter; +Cc: intel-gfx, alexander.usyskin, tomas.winkler
On Thursday 12 July 2018 01:56 PM, Daniel Vetter wrote:
> On Wed, Jul 11, 2018 at 07:41:27PM +0530, Ramalingam C wrote:
>> A generic component master is added to hold the i915 registration
>> untill all required kernel modules are up and active.
>>
>> This is achieved through following steps:
>> - moving the i915 driver registration to the component master's
>> bind call
>> - all required kernel modules will add one component each to
>> component_match of I915 component master.
>>
>> If no component is added to the I915 component master, due to CONFIG
>> selection or HW limitation, component master's bind call will be
>> triggered with no wait.
>>
>> Signed-off-by: Ramalingam C <ramalingam.c@intel.com>
>> ---
>> drivers/gpu/drm/i915/i915_drv.c | 87 +++++++++++++++++++++++++++++++++++------
>> drivers/gpu/drm/i915/i915_drv.h | 3 ++
>> include/drm/i915_component.h | 16 ++++++++
>> 3 files changed, 94 insertions(+), 12 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
>> index 0db3c83cce29..598ab3afc131 100644
>> --- a/drivers/gpu/drm/i915/i915_drv.c
>> +++ b/drivers/gpu/drm/i915/i915_drv.c
>> @@ -39,12 +39,14 @@
>> #include <linux/vgaarb.h>
>> #include <linux/vga_switcheroo.h>
>> #include <linux/vt.h>
>> +#include <linux/component.h>
>> #include <acpi/video.h>
>>
>> #include <drm/drmP.h>
>> #include <drm/drm_crtc_helper.h>
>> #include <drm/drm_atomic_helper.h>
>> #include <drm/i915_drm.h>
>> +#include <drm/i915_component.h>
>>
>> #include "i915_drv.h"
>> #include "i915_trace.h"
>> @@ -1247,8 +1249,6 @@ static void i915_driver_register(struct drm_i915_private *dev_priv)
>> if (IS_GEN5(dev_priv))
>> intel_gpu_ips_init(dev_priv);
>>
>> - intel_audio_init(dev_priv);
>> -
>> /*
>> * Some ports require correctly set-up hpd registers for detection to
>> * work properly (leading to ghost connected connector status), e.g. VGA
>> @@ -1310,6 +1310,47 @@ static void i915_welcome_messages(struct drm_i915_private *dev_priv)
>> DRM_INFO("DRM_I915_DEBUG_GEM enabled\n");
>> }
>>
>> +static void i915_driver_load_tail(struct drm_i915_private *dev_priv)
>> +{
>> + i915_driver_register(dev_priv);
>> +
>> + intel_runtime_pm_enable(dev_priv);
>> +
>> + intel_init_ipc(dev_priv);
>> +
>> + intel_runtime_pm_put(dev_priv);
>> +
>> + i915_welcome_messages(dev_priv);
>> +}
>> +
>> +static int i915_component_master_bind(struct device *dev)
>> +{
>> + struct drm_i915_private *dev_priv = kdev_to_i915(dev);
>> + int ret;
>> +
>> + ret = component_bind_all(dev, dev_priv->comp_master);
>> + if (ret < 0)
>> + return ret;
>> +
>> + i915_driver_load_tail(dev_priv);
>> +
>> + return 0;
>> +}
>> +
>> +static void i915_component_master_unbind(struct device *dev)
>> +{
>> + struct drm_i915_private *dev_priv = kdev_to_i915(dev);
>> +
>> + component_unbind_all(dev, dev_priv->comp_master);
>> +
>> + /* TO-DO: Whether I915 should be unloaded on any component unbind!? */
> I think we also need a FIXME here because the audio side will blow up if
> we do this?
With audio_init is moved out of bind i dont see the audio failure message.
May be we should get the hdac tested with these changes along with
INTEL_MEI_HDCP as y/n/m.
>
> If that's not the case then yes I think we should do the
> i915_dev_unregister call from here, for symmetry. That way we should be
> able to unload mei, and it should force the i915 driver out too.
>
> This also depends upon how the entire mei reset story pans out ofc.
I will start a thread straight away to understand the freq of ME reset
and duration of it.
>
> Aside from this tiny nit I think the load side here looks good now.
> -Daniel
>
>
>> +}
>> +
>> +static const struct component_master_ops i915_component_master_ops = {
>> + .bind = i915_component_master_bind,
>> + .unbind = i915_component_master_unbind,
>> +};
>> +
>> /**
>> * i915_driver_load - setup chip and create an initial config
>> * @pdev: PCI device
>> @@ -1341,12 +1382,25 @@ int i915_driver_load(struct pci_dev *pdev, const struct pci_device_id *ent)
>> goto out_free;
>> }
>>
>> + dev_priv->comp_master = kzalloc(sizeof(*dev_priv->comp_master),
>> + GFP_KERNEL);
>> + if (!dev_priv->comp_master) {
>> + ret = -ENOMEM;
>> + goto out_fini;
>> + }
>> +
>> + component_match_alloc(dev_priv->drm.dev, &dev_priv->master_match);
>> + if (!dev_priv->master_match) {
>> + ret = -ENOMEM;
>> + goto out_comp_master_clean;
>> + }
>> +
>> dev_priv->drm.pdev = pdev;
>> dev_priv->drm.dev_private = dev_priv;
>>
>> ret = pci_enable_device(pdev);
>> if (ret)
>> - goto out_fini;
>> + goto out_comp_master_clean;
>>
>> pci_set_drvdata(pdev, &dev_priv->drm);
>> /*
>> @@ -1389,18 +1443,21 @@ int i915_driver_load(struct pci_dev *pdev, const struct pci_device_id *ent)
>> if (ret < 0)
>> goto out_cleanup_hw;
>>
>> - i915_driver_register(dev_priv);
>> -
>> - intel_runtime_pm_enable(dev_priv);
>> -
>> - intel_init_ipc(dev_priv);
>> -
>> - intel_runtime_pm_put(dev_priv);
>> -
>> - i915_welcome_messages(dev_priv);
>> + ret = component_master_add_with_match(dev_priv->drm.dev,
>> + &i915_component_master_ops,
>> + dev_priv->master_match);
>> + if (ret < 0) {
>> + DRM_DEV_ERROR(&pdev->dev, "Master comp add failed %d\n",
>> + ret);
>> + goto out_cleanup_modeset;
>> + }
>> + intel_audio_init(dev_priv);
> I think a FIXME comment explaining what's going on here would be good:
>
> /*
> * FIXME: component.c doesn't (yet) support recursion, and snd-hda
> * doesn't handle delayed component registration correctly. For
> * now just uncoditionally register the audio component here,
> * outside of the master->bind callback.
> */
>
> Hopefully we can untangle this later on, but for now I think this approach
> is good.
>> + DRM_DEV_INFO(&pdev->dev, "I915 waits for Components (If any).\n");
>>
>> return 0;
>>
>> +out_cleanup_modeset:
>> + intel_modeset_cleanup(&dev_priv->drm);
>> out_cleanup_hw:
>> i915_driver_cleanup_hw(dev_priv);
>> out_cleanup_mmio:
>> @@ -1410,6 +1467,8 @@ int i915_driver_load(struct pci_dev *pdev, const struct pci_device_id *ent)
>> i915_driver_cleanup_early(dev_priv);
>> out_pci_disable:
>> pci_disable_device(pdev);
>> +out_comp_master_clean:
>> + kfree(dev_priv->comp_master);
>> out_fini:
>> i915_load_error(dev_priv, "Device initialization failed (%d)\n", ret);
>> drm_dev_fini(&dev_priv->drm);
>> @@ -1428,6 +1487,10 @@ void i915_driver_unload(struct drm_device *dev)
>> if (i915_gem_suspend(dev_priv))
>> DRM_ERROR("failed to idle hardware; continuing to unload!\n");
>>
>> + component_master_del(dev_priv->drm.dev,
>> + &i915_component_master_ops);
>> + kfree(dev_priv->comp_master);
>> +
>> intel_display_power_get(dev_priv, POWER_DOMAIN_INIT);
>>
>> drm_atomic_helper_shutdown(dev);
>> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
>> index 09ab12458244..620f41e13dbe 100644
>> --- a/drivers/gpu/drm/i915/i915_drv.h
>> +++ b/drivers/gpu/drm/i915/i915_drv.h
>> @@ -2119,6 +2119,9 @@ struct drm_i915_private {
>>
>> struct i915_pmu pmu;
>>
>> + struct i915_component_master *comp_master;
>> + struct component_match *master_match;
>> +
>> /*
>> * NOTE: This is the dri1/ums dungeon, don't add stuff here. Your patch
>> * will be rejected. Instead look for a better place.
>> diff --git a/include/drm/i915_component.h b/include/drm/i915_component.h
>> index 346b1f5cb180..52313bc227b2 100644
>> --- a/include/drm/i915_component.h
>> +++ b/include/drm/i915_component.h
>> @@ -121,4 +121,20 @@ struct i915_audio_component {
>> const struct i915_audio_component_audio_ops *audio_ops;
>> };
>>
>> +/**
>> + * struct i915_component_master - Used for communication between i915
>> + * and any other drivers for the services of different feature.
>> + */
>> +struct i915_component_master {
>> + /**
>> + * @i915_kdev: Kdev of I915. Used from the client component for
>> + * removing the reference to mei_cldev.
>> + */
>> + struct device *i915_kdev;
>> +
>> + /*
>> + * Add here the interface details between I915 and interested modules.
>> + */
>> +};
>> +
>> #endif /* _I915_COMPONENT_H_ */
>> --
>> 2.7.4
>>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 9+ messages in thread
* [RFC 3/3] drm/i915: Initialize HDCP2.2 and its MEI interface
2018-07-11 14:11 [RFC 0/3] I915 component master Ramalingam C
2018-07-11 14:11 ` [RFC 1/3] component: alloc component_match without any comp to match Ramalingam C
2018-07-11 14:11 ` [RFC 2/3] drm/i915: component master at i915 driver load Ramalingam C
@ 2018-07-11 14:11 ` Ramalingam C
2018-07-11 14:21 ` ✗ Fi.CI.BAT: failure for I915 component master Patchwork
3 siblings, 0 replies; 9+ messages in thread
From: Ramalingam C @ 2018-07-11 14:11 UTC (permalink / raw)
To: intel-gfx, daniel, tomas.winkler, alexander.usyskin
Initialize HDCP2.2 support. This includes the mei interface
initialization along with required component registration.
v2:
mei interface handle is protected with mutex. [Chris Wilson]
v3:
Notifiers are used for the mei interface state.
v4:
Poll for mei client device state
Error msg for out of mem [Uma]
Inline req for init function removed [Uma]
v5:
Rebase as Part of reordering.
Component is used for the I915 and MEI_HDCP interface [Daniel]
v6:
HDCP2.2 uses the I915 component master to communicate with mei_hdcp [Daniel]
Signed-off-by: Ramalingam C <ramalingam.c@intel.com>
---
drivers/gpu/drm/i915/intel_dp.c | 3 +-
drivers/gpu/drm/i915/intel_drv.h | 5 ++-
drivers/gpu/drm/i915/intel_hdcp.c | 78 ++++++++++++++++++++++++++++++++++++++-
drivers/gpu/drm/i915/intel_hdmi.c | 2 +-
include/drm/i915_component.h | 60 ++++++++++++++++++++++++++++++
5 files changed, 144 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 5be07e1d816d..12eb5bd33b7e 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -6406,7 +6406,8 @@ intel_dp_init_connector(struct intel_digital_port *intel_dig_port,
intel_dp_add_properties(intel_dp, connector);
if (is_hdcp_supported(dev_priv, port) && !intel_dp_is_edp(intel_dp)) {
- int ret = intel_hdcp_init(intel_connector, &intel_dp_hdcp_shim);
+ int ret = intel_hdcp_init(intel_connector, &intel_dp_hdcp_shim,
+ false);
if (ret)
DRM_DEBUG_KMS("HDCP init failed, skipping.\n");
}
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 5799788c8f5d..c8b363772958 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -1963,11 +1963,14 @@ void intel_hdcp_atomic_check(struct drm_connector *connector,
struct drm_connector_state *old_state,
struct drm_connector_state *new_state);
int intel_hdcp_init(struct intel_connector *connector,
- const struct intel_hdcp_shim *hdcp_shim);
+ const struct intel_hdcp_shim *hdcp_shim,
+ bool hdcp2_supported);
int intel_hdcp_enable(struct intel_connector *connector);
int intel_hdcp_disable(struct intel_connector *connector);
int intel_hdcp_check_link(struct intel_connector *connector);
bool is_hdcp_supported(struct drm_i915_private *dev_priv, enum port port);
+int intel_hdcp_component_init(struct drm_i915_private *dev_priv);
+bool is_hdcp2_supported(struct drm_i915_private *dev_priv);
/* intel_psr.c */
#define CAN_PSR(dev_priv) (HAS_PSR(dev_priv) && dev_priv->psr.sink_support)
diff --git a/drivers/gpu/drm/i915/intel_hdcp.c b/drivers/gpu/drm/i915/intel_hdcp.c
index 65bbe5874eee..39fece04bbee 100644
--- a/drivers/gpu/drm/i915/intel_hdcp.c
+++ b/drivers/gpu/drm/i915/intel_hdcp.c
@@ -8,13 +8,19 @@
#include <drm/drmP.h>
#include <drm/drm_hdcp.h>
+#include <drm/i915_component.h>
#include <linux/i2c.h>
#include <linux/random.h>
+#include <linux/component.h>
#include "intel_drv.h"
#include "i915_reg.h"
#define KEY_LOAD_TRIES 5
+#define GET_MEI_DDI_INDEX(port) (((port) == PORT_A) ? DDI_A : \
+ (enum hdcp_physical_port)(port))
+
+static int intel_hdcp2_init(struct intel_connector *connector);
static int intel_hdcp_poll_ksv_fifo(struct intel_digital_port *intel_dig_port,
const struct intel_hdcp_shim *shim)
@@ -743,11 +749,15 @@ bool is_hdcp_supported(struct drm_i915_private *dev_priv, enum port port)
}
int intel_hdcp_init(struct intel_connector *connector,
- const struct intel_hdcp_shim *hdcp_shim)
+ const struct intel_hdcp_shim *hdcp_shim,
+ bool hdcp2_supported)
{
struct intel_hdcp *hdcp = &connector->hdcp;
int ret;
+ if (!hdcp_shim)
+ return -EINVAL;
+
ret = drm_connector_attach_content_protection_property(
&connector->base);
if (ret)
@@ -757,6 +767,10 @@ int intel_hdcp_init(struct intel_connector *connector,
mutex_init(&hdcp->hdcp_mutex);
INIT_DELAYED_WORK(&hdcp->hdcp_check_work, intel_hdcp_check_work);
INIT_WORK(&hdcp->hdcp_prop_work, intel_hdcp_prop_work);
+
+ if (hdcp2_supported)
+ intel_hdcp2_init(connector);
+
return 0;
}
@@ -896,3 +910,65 @@ int intel_hdcp_check_link(struct intel_connector *connector)
mutex_unlock(&hdcp->hdcp_mutex);
return ret;
}
+
+
+static int i915_hdcp_component_match(struct device *dev, void *data)
+{
+ return !strcmp(dev->driver->name, "mei_hdcp");
+}
+
+static int initialize_mei_hdcp_data(struct intel_connector *connector)
+{
+ struct intel_hdcp *hdcp = &connector->hdcp;
+ struct mei_hdcp_data *data = &hdcp->mei_data;
+ enum port port;
+
+ if (connector->encoder) {
+ port = connector->encoder->port;
+ data->port = GET_MEI_DDI_INDEX(port);
+ }
+
+ data->port_type = INTEGRATED;
+ data->protocol = hdcp->hdcp_shim->hdcp_protocol();
+
+ data->k = 1;
+ if (!data->streams)
+ data->streams = kcalloc(data->k,
+ sizeof(struct hdcp2_streamid_type),
+ GFP_KERNEL);
+ if (!data->streams) {
+ DRM_ERROR("Out of Memory\n");
+ return -ENOMEM;
+ }
+
+ data->streams[0].stream_id = 0;
+ data->streams[0].stream_type = hdcp->content_type;
+
+ return 0;
+}
+
+bool is_hdcp2_supported(struct drm_i915_private *dev_priv)
+{
+ return ((INTEL_GEN(dev_priv) >= 10 || IS_GEMINILAKE(dev_priv) ||
+ IS_KABYLAKE(dev_priv)) && IS_ENABLED(CONFIG_INTEL_MEI_HDCP));
+}
+
+static int intel_hdcp2_init(struct intel_connector *connector)
+{
+ struct drm_i915_private *dev_priv = to_i915(connector->base.dev);
+ struct intel_hdcp *hdcp = &connector->hdcp;
+ int ret;
+
+ WARN_ON(!is_hdcp2_supported(dev_priv));
+ ret = initialize_mei_hdcp_data(connector);
+ if (ret)
+ goto exit;
+
+ component_match_add(dev_priv->drm.dev, &dev_priv->master_match,
+ i915_hdcp_component_match, dev_priv);
+
+ hdcp->hdcp2_supported = true;
+
+exit:
+ return ret;
+}
diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
index 8363fbd18ee8..7988f958d835 100644
--- a/drivers/gpu/drm/i915/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/intel_hdmi.c
@@ -2366,7 +2366,7 @@ void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port,
if (is_hdcp_supported(dev_priv, port)) {
int ret = intel_hdcp_init(intel_connector,
- &intel_hdmi_hdcp_shim);
+ &intel_hdmi_hdcp_shim, false);
if (ret)
DRM_DEBUG_KMS("HDCP init failed, skipping.\n");
}
diff --git a/include/drm/i915_component.h b/include/drm/i915_component.h
index 52313bc227b2..f208a83ea2c9 100644
--- a/include/drm/i915_component.h
+++ b/include/drm/i915_component.h
@@ -24,6 +24,10 @@
#ifndef _I915_COMPONENT_H_
#define _I915_COMPONENT_H_
+#include <linux/mei_cl_bus.h>
+#include <linux/mei_hdcp.h>
+#include <drm/drm_hdcp.h>
+
/* MAX_PORT is the number of port
* It must be sync with I915_MAX_PORTS defined i915_drv.h
*/
@@ -121,6 +125,54 @@ struct i915_audio_component {
const struct i915_audio_component_audio_ops *audio_ops;
};
+struct i915_hdcp_component_ops {
+ /**
+ * @owner: mei_hdcp module
+ */
+ struct module *owner;
+ int (*initiate_hdcp2_session)(struct mei_cl_device *cldev,
+ struct mei_hdcp_data *data,
+ struct hdcp2_ake_init *ake_data);
+ int
+ (*verify_receiver_cert_prepare_km)(struct mei_cl_device *cldev,
+ struct mei_hdcp_data *data,
+ struct hdcp2_ake_send_cert *rx_cert,
+ bool *km_stored,
+ struct hdcp2_ake_no_stored_km
+ *ek_pub_km,
+ size_t *msg_sz);
+ int (*verify_hprime)(struct mei_cl_device *cldev,
+ struct mei_hdcp_data *data,
+ struct hdcp2_ake_send_hprime *rx_hprime);
+ int (*store_pairing_info)(struct mei_cl_device *cldev,
+ struct mei_hdcp_data *data,
+ struct hdcp2_ake_send_pairing_info
+ *pairing_info);
+ int (*initiate_locality_check)(struct mei_cl_device *cldev,
+ struct mei_hdcp_data *data,
+ struct hdcp2_lc_init *lc_init_data);
+ int (*verify_lprime)(struct mei_cl_device *cldev,
+ struct mei_hdcp_data *data,
+ struct hdcp2_lc_send_lprime *rx_lprime);
+ int (*get_session_key)(struct mei_cl_device *cldev,
+ struct mei_hdcp_data *data,
+ struct hdcp2_ske_send_eks *ske_data);
+ int
+ (*repeater_check_flow_prepare_ack)(struct mei_cl_device *cldev,
+ struct mei_hdcp_data *data,
+ struct hdcp2_rep_send_receiverid_list
+ *rep_topology,
+ struct hdcp2_rep_send_ack
+ *rep_send_ack);
+ int (*verify_mprime)(struct mei_cl_device *cldev,
+ struct mei_hdcp_data *data,
+ struct hdcp2_rep_stream_ready *stream_ready);
+ int (*enable_hdcp_authentication)(struct mei_cl_device *cldev,
+ struct mei_hdcp_data *data);
+ int (*close_hdcp_session)(struct mei_cl_device *cldev,
+ struct mei_hdcp_data *data);
+};
+
/**
* struct i915_component_master - Used for communication between i915
* and any other drivers for the services of different feature.
@@ -131,6 +183,14 @@ struct i915_component_master {
* removing the reference to mei_cldev.
*/
struct device *i915_kdev;
+ /**
+ * @mei_cldev: mei client device, used as parameter for ops
+ */
+ struct mei_cl_device *mei_cldev;
+ /**
+ * @ops: Ops implemented by mei_hdcp driver, used by i915 driver.
+ */
+ const struct i915_hdcp_component_ops *hdcp_ops;
/*
* Add here the interface details between I915 and interested modules.
--
2.7.4
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 9+ messages in thread* ✗ Fi.CI.BAT: failure for I915 component master
2018-07-11 14:11 [RFC 0/3] I915 component master Ramalingam C
` (2 preceding siblings ...)
2018-07-11 14:11 ` [RFC 3/3] drm/i915: Initialize HDCP2.2 and its MEI interface Ramalingam C
@ 2018-07-11 14:21 ` Patchwork
3 siblings, 0 replies; 9+ messages in thread
From: Patchwork @ 2018-07-11 14:21 UTC (permalink / raw)
To: Ramalingam C; +Cc: intel-gfx
== Series Details ==
Series: I915 component master
URL : https://patchwork.freedesktop.org/series/46312/
State : failure
== Summary ==
Applying: component: alloc component_match without any comp to match
Applying: drm/i915: component master at i915 driver load
Applying: drm/i915: Initialize HDCP2.2 and its MEI interface
error: sha1 information is lacking or useless (drivers/gpu/drm/i915/intel_drv.h).
error: could not build fake ancestor
Patch failed at 0003 drm/i915: Initialize HDCP2.2 and its MEI interface
Use 'git am --show-current-patch' to see the failed patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 9+ messages in thread