All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ramalingam C <ramalingam.c@intel.com>
To: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	daniel.vetter@intel.com
Cc: Tomas Winkler <tomas.winkler@intel.com>
Subject: [PATCH v7 03/11] drm: generic fn converting be24 to cpu and vice versa
Date: Tue,  7 May 2019 21:57:37 +0530	[thread overview]
Message-ID: <20190507162745.25600-4-ramalingam.c@intel.com> (raw)
In-Reply-To: <20190507162745.25600-1-ramalingam.c@intel.com>

Existing functions for converting a 3bytes(be24) of big endian value
into u32 of little endian and vice versa are renamed as

s/drm_hdcp2_seq_num_to_u32/drm_hdcp_be24_to_cpu
s/drm_hdcp2_u32_to_seq_num/drm_hdcp_cpu_to_be24

Signed-off-by: Ramalingam C <ramalingam.c@intel.com>
Suggested-by: Daniel Vetter <daniel@ffwll.ch>
cc: Tomas Winkler <tomas.winkler@intel.com>
---
 drivers/gpu/drm/i915/intel_hdcp.c | 5 +++--
 drivers/misc/mei/hdcp/mei_hdcp.c  | 2 +-
 include/drm/drm_hdcp.h            | 4 ++--
 3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_hdcp.c b/drivers/gpu/drm/i915/intel_hdcp.c
index b8c8d6d1a33d..c308dfee9ca4 100644
--- a/drivers/gpu/drm/i915/intel_hdcp.c
+++ b/drivers/gpu/drm/i915/intel_hdcp.c
@@ -1305,7 +1305,7 @@ int hdcp2_propagate_stream_management_info(struct intel_connector *connector)
 
 	/* Prepare RepeaterAuth_Stream_Manage msg */
 	msgs.stream_manage.msg_id = HDCP_2_2_REP_STREAM_MANAGE;
-	drm_hdcp2_u32_to_seq_num(msgs.stream_manage.seq_num_m, hdcp->seq_num_m);
+	drm_hdcp_cpu_to_be24(msgs.stream_manage.seq_num_m, hdcp->seq_num_m);
 
 	/* K no of streams is fixed as 1. Stored as big-endian. */
 	msgs.stream_manage.k = cpu_to_be16(1);
@@ -1370,7 +1370,8 @@ int hdcp2_authenticate_repeater_topology(struct intel_connector *connector)
 	}
 
 	/* Converting and Storing the seq_num_v to local variable as DWORD */
-	seq_num_v = drm_hdcp2_seq_num_to_u32(msgs.recvid_list.seq_num_v);
+	seq_num_v =
+		drm_hdcp_be24_to_cpu((const u8 *)msgs.recvid_list.seq_num_v);
 
 	if (seq_num_v < hdcp->seq_num_v) {
 		/* Roll over of the seq_num_v from repeater. Reauthenticate. */
diff --git a/drivers/misc/mei/hdcp/mei_hdcp.c b/drivers/misc/mei/hdcp/mei_hdcp.c
index 90b6ae8e9dae..2f192d6d8b54 100644
--- a/drivers/misc/mei/hdcp/mei_hdcp.c
+++ b/drivers/misc/mei/hdcp/mei_hdcp.c
@@ -576,7 +576,7 @@ static int mei_hdcp_verify_mprime(struct device *dev,
 
 	memcpy(verify_mprime_in.m_prime, stream_ready->m_prime,
 	       HDCP_2_2_MPRIME_LEN);
-	drm_hdcp2_u32_to_seq_num(verify_mprime_in.seq_num_m, data->seq_num_m);
+	drm_hdcp_cpu_to_be24(verify_mprime_in.seq_num_m, data->seq_num_m);
 	memcpy(verify_mprime_in.streams, data->streams,
 	       (data->k * sizeof(struct hdcp2_streamid_type)));
 
diff --git a/include/drm/drm_hdcp.h b/include/drm/drm_hdcp.h
index f243408ecf26..1cc66df05a43 100644
--- a/include/drm/drm_hdcp.h
+++ b/include/drm/drm_hdcp.h
@@ -252,13 +252,13 @@ struct hdcp2_rep_stream_ready {
  * host format and back
  */
 static inline
-u32 drm_hdcp2_seq_num_to_u32(u8 seq_num[HDCP_2_2_SEQ_NUM_LEN])
+u32 drm_hdcp_be24_to_cpu(const u8 seq_num[HDCP_2_2_SEQ_NUM_LEN])
 {
 	return (u32)(seq_num[2] | seq_num[1] << 8 | seq_num[0] << 16);
 }
 
 static inline
-void drm_hdcp2_u32_to_seq_num(u8 seq_num[HDCP_2_2_SEQ_NUM_LEN], u32 val)
+void drm_hdcp_cpu_to_be24(u8 seq_num[HDCP_2_2_SEQ_NUM_LEN], u32 val)
 {
 	seq_num[0] = val >> 16;
 	seq_num[1] = val >> 8;
-- 
2.19.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2019-05-07 16:27 UTC|newest]

Thread overview: 70+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-07 16:27 [PATCH v7 00/11] HDCP2.2 Phase II Ramalingam C
2019-05-07 16:27 ` [PATCH v7 01/11] drm: move content protection property to mode_config Ramalingam C
2019-05-07 16:27 ` [PATCH v7 02/11] drm/i915: debugfs: HDCP2.2 capability read Ramalingam C
2019-05-07 16:27 ` Ramalingam C [this message]
2019-05-07 16:27 ` [PATCH v7 04/11] drm: revocation check at drm subsystem Ramalingam C
2019-07-04 10:53   ` Pekka Paalanen
2019-09-12  0:15   ` Harry Wentland
2019-09-12  1:14     ` Deucher, Alexander
2019-09-12  6:54     ` Ramalingam C
2019-09-12 15:49       ` Harry Wentland
2019-05-07 16:27 ` [PATCH v7 05/11] drm/i915: SRM revocation check for HDCP1.4 and 2.2 Ramalingam C
2019-05-07 16:27 ` [PATCH v7 06/11] drm/hdcp: gathering hdcp related code into drm_hdcp.c Ramalingam C
2019-05-07 16:27 ` [PATCH v7 07/11] drm: Add Content protection type property Ramalingam C
2019-07-04 11:11   ` Pekka Paalanen
2019-07-04 10:36     ` Ramalingam C
2019-07-05 13:00       ` Pekka Paalanen
2019-07-05  6:33         ` Ramalingam C
2019-07-05 14:12           ` Pekka Paalanen
2019-05-07 16:27 ` [PATCH v7 08/11] drm/i915: Attach content " Ramalingam C
2019-05-07 16:27 ` [PATCH v7 09/11] drm: uevent for connector status change Ramalingam C
2019-05-10 12:12   ` Paul Kocialkowski
2019-05-10 14:54     ` Daniel Vetter
2019-05-13  9:02       ` Paul Kocialkowski
2019-05-13  9:34         ` Daniel Vetter
2019-05-13 10:11           ` Ser, Simon
2019-05-13 15:04             ` Daniel Vetter
2019-05-14  6:18               ` Ser, Simon
2019-05-13 17:14           ` Paul Kocialkowski
2019-05-14 11:09             ` Daniel Vetter
2019-05-14 14:12               ` Paul Kocialkowski
2019-05-14 14:28                 ` Daniel Vetter
2019-05-15  7:43                   ` Paul Kocialkowski
2019-05-15  7:48                     ` Daniel Vetter
2019-05-14  8:02           ` Pekka Paalanen
2019-05-14  8:18             ` Ser, Simon
2019-05-14 11:02               ` Daniel Vetter
2019-05-14 13:36                 ` Pekka Paalanen
2019-05-14 13:58                   ` Paul Kocialkowski
2019-05-14 14:34                   ` Daniel Vetter
2019-05-15  7:37                     ` Pekka Paalanen
2019-05-15  7:49                       ` Paul Kocialkowski
2019-05-15  8:24                       ` Daniel Vetter
2019-05-16  8:22                         ` Pekka Paalanen
2019-05-16 12:24                           ` Daniel Vetter
2019-05-17 10:08                             ` Pekka Paalanen
2019-05-20 16:11                               ` Daniel Vetter
2019-05-20 16:24                                 ` Paul Kocialkowski
2019-05-21  6:55                                 ` Pekka Paalanen
2019-05-21  7:52                                   ` Daniel Vetter
2019-05-21  9:01                                     ` Pekka Paalanen
2019-05-21  9:42                                       ` Daniel Vetter
2019-06-03  9:50                                     ` Michel Dänzer
2019-06-03 15:08                                       ` Daniel Vetter
2019-06-03 15:19                                         ` Ser, Simon
2019-06-04  7:06                                           ` Pekka Paalanen
2019-05-13 21:20     ` Lyude Paul
2019-05-14 11:12       ` Daniel Vetter
2019-07-04 11:12   ` Pekka Paalanen
2019-07-04 10:42     ` Ramalingam C
2019-07-05 13:36       ` Pekka Paalanen
2019-05-07 16:27 ` [PATCH v7 10/11] drm/hdcp: update content protection property with uevent Ramalingam C
2019-07-04 11:14   ` Pekka Paalanen
2019-07-04 11:11     ` Ramalingam C
2019-07-05 13:59       ` Pekka Paalanen
2019-07-04 23:51     ` Ramalingam C
2019-05-07 16:27 ` [PATCH v7 11/11] drm/i915: update the hdcp state " Ramalingam C
2019-05-07 16:45 ` ✗ Fi.CI.CHECKPATCH: warning for HDCP2.2 Phase II (rev9) Patchwork
2019-05-07 16:52 ` ✗ Fi.CI.SPARSE: " Patchwork
2019-05-07 17:37 ` ✓ Fi.CI.BAT: success " Patchwork
2019-05-08  0:41 ` ✓ Fi.CI.IGT: " 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=20190507162745.25600-4-ramalingam.c@intel.com \
    --to=ramalingam.c@intel.com \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=tomas.winkler@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.