Skip to content

Commit aa97239

Browse files
Hermes Wulumag
authored andcommitted
drm/bridge: it6505: fix HDCP CTS KSV list read with UNIGRAF DPR-100.
When running the HDCP CTS test with UNIGRAF DPR-100. KSV list must be read from DP_AUX_HDCP_KSV_FIFO in an AUX request, and can not separate with multiple read requests. The AUX operation command "CMD_AUX_GET_KSV_LIST" reads the KSV list with AUX FIFO and is able to read DP_AUX_HDCP_KSV_FIFO in an AUX request. Add it6505_get_ksvlist() which uses CMD_AUX_GET_KSV_LIST operation to read the KSV list. Reviewed-by: Dmitry Baryshkov <[email protected]> Signed-off-by: Hermes Wu <[email protected]> Reviewed-by: AngeloGioacchino Del Regno <[email protected]> Signed-off-by: Dmitry Baryshkov <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/20241230-v7-upstream-v7-7-e0fdd4844703@ite.corp-partner.google.com
1 parent 8c01b0b commit aa97239

File tree

1 file changed

+36
-12
lines changed

1 file changed

+36
-12
lines changed

drivers/gpu/drm/bridge/ite-it6505.c

Lines changed: 36 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1189,6 +1189,37 @@ static int it6505_get_edid_block(void *data, u8 *buf, unsigned int block,
11891189
return 0;
11901190
}
11911191

1192+
static int it6505_get_ksvlist(struct it6505 *it6505, u8 *buf, size_t len)
1193+
{
1194+
struct device *dev = it6505->dev;
1195+
enum aux_cmd_reply reply;
1196+
int request_size, ret;
1197+
int i = 0;
1198+
1199+
do {
1200+
request_size = min_t(int, (int)len - i, 15);
1201+
1202+
ret = it6505_aux_do_transfer(it6505, CMD_AUX_GET_KSV_LIST,
1203+
DP_AUX_HDCP_KSV_FIFO,
1204+
buf + i, request_size, &reply);
1205+
1206+
DRM_DEV_DEBUG_DRIVER(dev, "request_size = %d, ret =%d", request_size, ret);
1207+
if (ret < 0)
1208+
return ret;
1209+
1210+
i += request_size;
1211+
} while (i < len);
1212+
1213+
DRM_DEV_DEBUG_DRIVER(dev, "ksv read cnt = %d down_stream_cnt=%d ", i, i / 5);
1214+
1215+
for (i = 0 ; i < len; i += 5) {
1216+
DRM_DEV_DEBUG_DRIVER(dev, "ksv[%d] = %02X%02X%02X%02X%02X",
1217+
i / 5, buf[i], buf[i + 1], buf[i + 2], buf[i + 3], buf[i + 4]);
1218+
}
1219+
1220+
return len;
1221+
}
1222+
11921223
static void it6505_variable_config(struct it6505 *it6505)
11931224
{
11941225
it6505->link_rate_bw_code = HBR;
@@ -1970,7 +2001,7 @@ static int it6505_setup_sha1_input(struct it6505 *it6505, u8 *sha1_input)
19702001
{
19712002
struct device *dev = it6505->dev;
19722003
u8 binfo[2];
1973-
int down_stream_count, i, err, msg_count = 0;
2004+
int down_stream_count, err, msg_count = 0;
19742005

19752006
err = it6505_get_dpcd(it6505, DP_AUX_HDCP_BINFO, binfo,
19762007
ARRAY_SIZE(binfo));
@@ -1995,18 +2026,11 @@ static int it6505_setup_sha1_input(struct it6505 *it6505, u8 *sha1_input)
19952026
down_stream_count);
19962027
return 0;
19972028
}
2029+
err = it6505_get_ksvlist(it6505, sha1_input, down_stream_count * 5);
2030+
if (err < 0)
2031+
return err;
19982032

1999-
for (i = 0; i < down_stream_count; i++) {
2000-
err = it6505_get_dpcd(it6505, DP_AUX_HDCP_KSV_FIFO +
2001-
(i % 3) * DRM_HDCP_KSV_LEN,
2002-
sha1_input + msg_count,
2003-
DRM_HDCP_KSV_LEN);
2004-
2005-
if (err < 0)
2006-
return err;
2007-
2008-
msg_count += 5;
2009-
}
2033+
msg_count += down_stream_count * 5;
20102034

20112035
it6505->hdcp_down_stream_count = down_stream_count;
20122036
sha1_input[msg_count++] = binfo[0];

0 commit comments

Comments
 (0)