drm: revocation check at drm subsystem

On every hdcp revocation check request SRM is read from fw file
/lib/firmware/display_hdcp_srm.bin

SRM table is parsed and stored at drm_hdcp.c, with functions exported
for the services for revocation check from drivers (which
implements the HDCP authentication)

This patch handles the HDCP1.4 and 2.2 versions of SRM table.

v2:
  moved the uAPI to request_firmware_direct() [Daniel]
v3:
  kdoc added. [Daniel]
  srm_header unified and bit field definitions are removed. [Daniel]
  locking improved. [Daniel]
  vrl length violation is fixed. [Daniel]
v4:
  s/__swab16/be16_to_cpu [Daniel]
  be24_to_cpu is done through a global func [Daniel]
  Unused variables are removed. [Daniel]
  unchecked return values are dropped from static funcs [Daniel]

Signed-off-by: Ramalingam C <ramalingam.c@intel.com>
Acked-by: Satyeshwar Singh <satyeshwar.singh@intel.com>
Reviewed-by: Daniel Vetter <daniel@ffwll.ch>
Acked-by: Dave Airlie <airlied@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20190507162745.25600-5-ramalingam.c@intel.com
This commit is contained in:
Ramalingam C
2019-05-09 09:44:41 +02:00
committed by Daniel Vetter
parent 0de655cae4
commit 6498bf5800
6 changed files with 370 additions and 1 deletions
+24
View File
@@ -265,4 +265,28 @@ void drm_hdcp_cpu_to_be24(u8 seq_num[HDCP_2_2_SEQ_NUM_LEN], u32 val)
seq_num[2] = val;
}
#define DRM_HDCP_SRM_GEN1_MAX_BYTES (5 * 1024)
#define DRM_HDCP_1_4_SRM_ID 0x8
#define DRM_HDCP_SRM_ID_MASK (0xF << 4)
#define DRM_HDCP_1_4_VRL_LENGTH_SIZE 3
#define DRM_HDCP_1_4_DCP_SIG_SIZE 40
#define DRM_HDCP_2_SRM_ID 0x9
#define DRM_HDCP_2_INDICATOR 0x1
#define DRM_HDCP_2_INDICATOR_MASK 0xF
#define DRM_HDCP_2_VRL_LENGTH_SIZE 3
#define DRM_HDCP_2_DCP_SIG_SIZE 384
#define DRM_HDCP_2_NO_OF_DEV_PLUS_RESERVED_SZ 4
#define DRM_HDCP_2_KSV_COUNT_2_LSBITS(byte) (((byte) & 0xC) >> 6)
struct hdcp_srm_header {
u8 srm_id;
u8 reserved;
__be16 srm_version;
u8 srm_gen_no;
} __packed;
struct drm_device;
bool drm_hdcp_check_ksvs_revoked(struct drm_device *dev,
u8 *ksvs, u32 ksv_count);
#endif