Skip to content

Commit d0c97a5

Browse files
Hermes Wulumag
authored andcommitted
drm/bridge: it6505: improve AUX operation for edid read
The original AUX operation using data registers is limited to 4 bytes. The AUX operation command CMD_AUX_I2C_EDID_READ uses AUX FIFO and is capable of reading 16 bytes. This improves the speed of EDID read. 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-2-e0fdd4844703@ite.corp-partner.google.com
1 parent c148702 commit d0c97a5

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1076,10 +1076,13 @@ static ssize_t it6505_aux_do_transfer(struct it6505 *it6505,
10761076
size_t size, enum aux_cmd_reply *reply)
10771077
{
10781078
int i, ret_size, ret = 0, request_size;
1079+
int fifo_max_size = (cmd == CMD_AUX_I2C_EDID_READ) ? AUX_FIFO_MAX_SIZE : 4;
10791080

10801081
mutex_lock(&it6505->aux_lock);
1081-
for (i = 0; i < size; i += 4) {
1082-
request_size = min((int)size - i, 4);
1082+
i = 0;
1083+
do {
1084+
request_size = min_t(int, (int)size - i, fifo_max_size);
1085+
10831086
ret_size = it6505_aux_operation(it6505, cmd, address + i,
10841087
buffer + i, request_size,
10851088
reply);
@@ -1088,8 +1091,9 @@ static ssize_t it6505_aux_do_transfer(struct it6505 *it6505,
10881091
goto aux_op_err;
10891092
}
10901093

1094+
i += request_size;
10911095
ret += ret_size;
1092-
}
1096+
} while (i < size);
10931097

10941098
aux_op_err:
10951099
mutex_unlock(&it6505->aux_lock);

0 commit comments

Comments
 (0)