From: Jani Nikula <jani.nikula@intel.com>
To: Suraj Kandpal <suraj.kandpal@intel.com>,
intel-xe@lists.freedesktop.org, intel-gfx@lists.freedesktop.org
Cc: ankit.k.nautiyal@intel.com, Suraj Kandpal <suraj.kandpal@intel.com>
Subject: Re: [PATCH 1/2] drm/i915/hdcp: Do not use inline intel_de_read
Date: Thu, 19 Jun 2025 13:59:01 +0300 [thread overview]
Message-ID: <c8af491ced7eba64ffcd7ad84d260948f3fd0f01@intel.com> (raw)
In-Reply-To: <20250619102804.3377807-2-suraj.kandpal@intel.com>
On Thu, 19 Jun 2025, Suraj Kandpal <suraj.kandpal@intel.com> wrote:
> Do not use intel_de_read() inline in the WARN_ON functions.
> While we are at it make the comparision for stream_type u8 to u8.
>
> Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
> ---
> drivers/gpu/drm/i915/display/intel_dp_hdcp.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_dp_hdcp.c b/drivers/gpu/drm/i915/display/intel_dp_hdcp.c
> index 7bd775fb65a0..3620f7853c8f 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp_hdcp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp_hdcp.c
> @@ -805,10 +805,13 @@ intel_dp_mst_hdcp2_stream_encryption(struct intel_connector *connector,
> enum pipe pipe = (enum pipe)cpu_transcoder;
> enum port port = dig_port->base.port;
> int ret;
> + u32 val;
> + u8 stream_type;
>
> + val = intel_de_read(display, HDCP2_AUTH_STREAM(display, cpu_transcoder, port));
> + stream_type = REG_FIELD_GET8(AUTH_STREAM_TYPE, val);
The size in GET8 is not really about the size of the field, it's about
the size of the register/value, and how the field is defined.
It should be REG_FIELD_GET() for 32-bit registers.
But then should AUTH_STREAM_TYPE be defined via REG_GENMASK()?
#define AUTH_STREAM_TYPE_MASK REG_GENMASK(31, 31)
Would be more consistent:
stream_type = REG_FIELD_GET(AUTH_STREAM_TYPE_MASK, val);
> drm_WARN_ON(display->drm, enable &&
> - !!(intel_de_read(display, HDCP2_AUTH_STREAM(display, cpu_transcoder, port))
> - & AUTH_STREAM_TYPE) != data->streams[0].stream_type);
> + stream_type == data->streams[0].stream_type);
Comparing it like this certainly makes much more sense, but shouldn't it
remain != instead of ==?
BR,
Jani.
>
> ret = intel_dp_mst_toggle_hdcp_stream_select(connector, enable);
> if (ret)
--
Jani Nikula, Intel
next prev parent reply other threads:[~2025-06-19 10:59 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-19 10:28 [PATCH 0/2] Changes in hdcp2_stream_encryption Suraj Kandpal
2025-06-19 10:28 ` [PATCH 1/2] drm/i915/hdcp: Do not use inline intel_de_read Suraj Kandpal
2025-06-19 10:59 ` Jani Nikula [this message]
2025-06-19 11:36 ` Kandpal, Suraj
2025-06-19 10:28 ` [PATCH 2/2] drm/i915/hdcp: Use HDCP2_STREAM_STATUS instead of HDCP2_AUTH_STREAM Suraj Kandpal
2025-06-19 10:36 ` ✓ CI.KUnit: success for Changes in hdcp2_stream_encryption Patchwork
2025-06-19 11:44 ` ✓ Xe.CI.BAT: " Patchwork
2025-06-19 23:23 ` ✗ Xe.CI.Full: failure " Patchwork
-- strict thread matches above, loose matches on Subject: below --
2025-06-19 11:33 [PATCH 0/2] " Suraj Kandpal
2025-06-19 11:33 ` [PATCH 1/2] drm/i915/hdcp: Do not use inline intel_de_read Suraj Kandpal
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=c8af491ced7eba64ffcd7ad84d260948f3fd0f01@intel.com \
--to=jani.nikula@intel.com \
--cc=ankit.k.nautiyal@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=suraj.kandpal@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.