Skip to content

Commit 0989c02

Browse files
Hermes Wulumag
authored andcommitted
drm/bridge: it6505: fix HDCP CTS compare V matching
When HDCP negotiation with a repeater device. Checking SHA V' matching must retry 3 times before restarting HDCP. 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-8-e0fdd4844703@ite.corp-partner.google.com
1 parent aa97239 commit 0989c02

File tree

1 file changed

+19
-13
lines changed

1 file changed

+19
-13
lines changed

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

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2058,7 +2058,7 @@ static bool it6505_hdcp_part2_ksvlist_check(struct it6505 *it6505)
20582058
{
20592059
struct device *dev = it6505->dev;
20602060
u8 av[5][4], bv[5][4];
2061-
int i, err;
2061+
int i, err, retry;
20622062

20632063
i = it6505_setup_sha1_input(it6505, it6505->sha1_input);
20642064
if (i <= 0) {
@@ -2067,22 +2067,28 @@ static bool it6505_hdcp_part2_ksvlist_check(struct it6505 *it6505)
20672067
}
20682068

20692069
it6505_sha1_digest(it6505, it6505->sha1_input, i, (u8 *)av);
2070+
/*1B-05 V' must retry 3 times */
2071+
for (retry = 0; retry < 3; retry++) {
2072+
err = it6505_get_dpcd(it6505, DP_AUX_HDCP_V_PRIME(0), (u8 *)bv,
2073+
sizeof(bv));
20702074

2071-
err = it6505_get_dpcd(it6505, DP_AUX_HDCP_V_PRIME(0), (u8 *)bv,
2072-
sizeof(bv));
2075+
if (err < 0) {
2076+
dev_err(dev, "Read V' value Fail %d", retry);
2077+
continue;
2078+
}
20732079

2074-
if (err < 0) {
2075-
dev_err(dev, "Read V' value Fail");
2076-
return false;
2077-
}
2080+
for (i = 0; i < 5; i++) {
2081+
if (bv[i][3] != av[i][0] || bv[i][2] != av[i][1] ||
2082+
av[i][1] != av[i][2] || bv[i][0] != av[i][3])
2083+
break;
20782084

2079-
for (i = 0; i < 5; i++)
2080-
if (bv[i][3] != av[i][0] || bv[i][2] != av[i][1] ||
2081-
bv[i][1] != av[i][2] || bv[i][0] != av[i][3])
2082-
return false;
2085+
DRM_DEV_DEBUG_DRIVER(dev, "V' all match!! %d, %d", retry, i);
2086+
return true;
2087+
}
2088+
}
20832089

2084-
DRM_DEV_DEBUG_DRIVER(dev, "V' all match!!");
2085-
return true;
2090+
DRM_DEV_DEBUG_DRIVER(dev, "V' NOT match!! %d", retry);
2091+
return false;
20862092
}
20872093

20882094
static void it6505_hdcp_wait_ksv_list(struct work_struct *work)

0 commit comments

Comments
 (0)