From: Daniel Vetter <daniel@ffwll.ch>
To: Ramalingam C <ramalingam.c@intel.com>
Cc: daniel.vetter@ffwll.ch, intel-gfx@lists.freedesktop.org,
dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v2 5/8] drm/i915/sysfs: Node for hdcp srm
Date: Mon, 11 Mar 2019 14:57:58 +0100 [thread overview]
Message-ID: <20190311135758.GI2665@phenom.ffwll.local> (raw)
In-Reply-To: <20190309040452.23699-6-ramalingam.c@intel.com>
On Sat, Mar 09, 2019 at 09:34:49AM +0530, Ramalingam C wrote:
> Binary Sysfs entry is created to pass the HDCP SRM table into
> kerel for the HDCP authentication purpose.
>
> Signed-off-by: Ramalingam C <ramalingam.c@intel.com>
I think the srm stuff would sit very well in the drm core:
- sysfs file created in the overall drm directory, not in each driver
directory
- validation code in core
- one function exported to drivers to get latest srm/version, so that
every time they do a hdcp enable they can check whether they need to
update the srm.
So this and previous patch as drm core changes, with a simple patch to tie
it into drm/i915.
I also still think that we don't really need userspace for this, since the
use-case is that you echo $latest_srm_file > $sysfs_srm_file once at boot.
Really doesn't need userspace imo.
-Daniel
> ---
> drivers/gpu/drm/i915/i915_sysfs.c | 32 +++++++++++++++++++++++++++++++
> 1 file changed, 32 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/i915_sysfs.c b/drivers/gpu/drm/i915/i915_sysfs.c
> index 41313005af42..4621e944a24e 100644
> --- a/drivers/gpu/drm/i915/i915_sysfs.c
> +++ b/drivers/gpu/drm/i915/i915_sysfs.c
> @@ -576,6 +576,36 @@ static void i915_setup_error_capture(struct device *kdev) {}
> static void i915_teardown_error_capture(struct device *kdev) {}
> #endif
>
> +static ssize_t
> +i915_srm_write(struct file *filp, struct kobject *kobj,
> + struct bin_attribute *attr, char *buf,
> + loff_t offset, size_t count)
> +{
> + struct device *kdev = kobj_to_dev(kobj);
> + struct drm_i915_private *dev_priv = kdev_minor_to_i915(kdev);
> +
> + return intel_hdcp_srm_update(dev_priv, buf, count);
> +}
> +
> +static const struct bin_attribute srm_attrs = {
> + .attr = {.name = "hdcp_srm", .mode = S_IWUSR},
> + .read = NULL,
> + .write = i915_srm_write,
> + .mmap = NULL,
> + .private = (void *)0
> +};
> +
> +static void i915_setup_hdcp_srm(struct device *kdev)
> +{
> + if (sysfs_create_bin_file(&kdev->kobj, &srm_attrs))
> + DRM_ERROR("error_state sysfs setup failed\n");
> +}
> +
> +static void i915_teardown_hdcp_srm(struct device *kdev)
> +{
> + sysfs_remove_bin_file(&kdev->kobj, &srm_attrs);
> +}
> +
> void i915_setup_sysfs(struct drm_i915_private *dev_priv)
> {
> struct device *kdev = dev_priv->drm.primary->kdev;
> @@ -623,12 +653,14 @@ void i915_setup_sysfs(struct drm_i915_private *dev_priv)
> DRM_ERROR("RPS sysfs setup failed\n");
>
> i915_setup_error_capture(kdev);
> + i915_setup_hdcp_srm(kdev);
> }
>
> void i915_teardown_sysfs(struct drm_i915_private *dev_priv)
> {
> struct device *kdev = dev_priv->drm.primary->kdev;
>
> + i915_teardown_hdcp_srm(kdev);
> i915_teardown_error_capture(kdev);
>
> if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv))
> --
> 2.19.1
>
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2019-03-11 13:58 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-09 4:04 [PATCH v2 0/8] HDCP2.2 Phase II Ramalingam C
2019-03-09 4:04 ` [PATCH v2 1/8] drm/i915: debugfs: HDCP2.2 capability read Ramalingam C
2019-03-09 4:04 ` [PATCH v2 2/8] drm: Add Content protection type property Ramalingam C
2019-03-09 4:04 ` [PATCH v2 3/8] drm/i915: Attach content " Ramalingam C
2019-03-09 4:04 ` [PATCH v2 4/8] drm/i915: HDCP SRM parsing and revocation check Ramalingam C
2019-03-09 4:04 ` [PATCH v2 5/8] drm/i915/sysfs: Node for hdcp srm Ramalingam C
2019-03-11 13:57 ` Daniel Vetter [this message]
2019-03-09 4:04 ` [PATCH v2 6/8] drm: Add CP downstream_info property Ramalingam C
2019-03-09 4:04 ` [PATCH v2 7/8] drm/i915: Populate downstream info for HDCP1.4 Ramalingam C
2019-03-09 4:04 ` [PATCH v2 8/8] drm/i915: Populate downstream info for HDCP2.2 Ramalingam C
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=20190311135758.GI2665@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=daniel.vetter@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=ramalingam.c@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