Skip to content

Commit f0ce651

Browse files
committed
Add kernel patch for gru-kevin cursor lag, fixes #225
Added additioanl kernel patch to correct analogix_dp_transfer failue
1 parent 4716adf commit f0ce651

File tree

3 files changed

+89
-2
lines changed

3 files changed

+89
-2
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
From 6958888b47956821a2bbbaeeb2deb27d32337bf0 Mon Sep 17 00:00:00 2001
2+
From: SolidHal <[email protected]>
3+
Date: Wed, 23 Dec 2020 09:24:11 -0800
4+
Subject: [PATCH 1/2] drm/bridge: analogix_dp: Don't return -EBUSY when
5+
msg->size is 0 in aux transaction
6+
7+
The analogix_dp_transfer() will return -EBUSY if num_transferred is zero.
8+
But sometimes we will send a bare address packet to start the transaction,
9+
like drm_dp_i2c_xfer() show:
10+
......
11+
/* Send a bare address packet to start the transaction.
12+
* Zero sized messages specify an address only (bare
13+
* address) transaction.
14+
*/
15+
msg.buffer = NULL;
16+
msg.size = 0;
17+
err = drm_dp_i2c_do_msg(aux, &msg);
18+
......
19+
20+
In this case, the msg->size is zero, so the num_transferred will be zero too.
21+
We can't return -EBUSY here, let's we return num_transferred if num_transferred
22+
equals msg->size.
23+
24+
from: https://chromium.googlesource.com/chromiumos/third_party/kernel/+/e7629f9b475ce9a0b70126e907049b0e1468010d%5E%21/#F0
25+
---
26+
drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c | 2 +-
27+
1 file changed, 1 insertion(+), 1 deletion(-)
28+
29+
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c
30+
index 914c569ab8c1..ee6cda10bca4 100644
31+
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c
32+
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c
33+
@@ -1222,7 +1222,7 @@ ssize_t analogix_dp_transfer(struct analogix_dp_device *dp,
34+
(msg->request & ~DP_AUX_I2C_MOT) == DP_AUX_NATIVE_READ)
35+
msg->reply = DP_AUX_NATIVE_REPLY_ACK;
36+
37+
- return num_transferred > 0 ? num_transferred : -EBUSY;
38+
+ return (num_transferred == msg->size) ? num_transferred : -EBUSY;
39+
40+
aux_error:
41+
/* if aux err happen, reset aux */
42+
--
43+
2.20.1
44+
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
From 30dcb9e2d1af10290d0764860b47b6f4848a1b93 Mon Sep 17 00:00:00 2001
2+
From: SolidHal <[email protected]>
3+
Date: Wed, 23 Dec 2020 10:03:26 -0800
4+
Subject: [PATCH 2/2] drm/rockchip: Only wait for panel ACK on PSR entry
5+
6+
This patch was brought upstream already from chromium/rockchip but
7+
was done so incorrectly.
8+
9+
We currently wait for the panel to mirror our intended PSR state
10+
before continuing on both PSR enter and PSR exit. This is really
11+
only important to do when we're entering PSR, since we want to
12+
be sure the last frame we pushed is being served from the panel's
13+
internal fb before shutting down the soc blocks (vop/analogix).
14+
15+
This patch changes the behavior such that we only wait for the
16+
panel to complete the PSR transition when we're entering PSR, and
17+
to skip verification when we're exiting.
18+
19+
Without this, the system essentially freezes for ~100ms while it waits for
20+
confirmation that PSR is disabled. The most noticible behavior is the cursor jumping
21+
on quick inputs.
22+
23+
from: https://chromium.googlesource.com/chromiumos/third_party/kernel/+/e47a7da072d1a2ca8fdc62f3e32291c0d1a41145%5E%21/#F0
24+
---
25+
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 2 +-
26+
1 file changed, 1 insertion(+), 1 deletion(-)
27+
28+
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
29+
index aa1bb86293fd..163bc069f77a 100644
30+
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
31+
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
32+
@@ -1055,7 +1055,7 @@ static int analogix_dp_disable_psr(struct analogix_dp_device *dp)
33+
psr_vsc.db[0] = 0;
34+
psr_vsc.db[1] = 0;
35+
36+
- return analogix_dp_send_psr_spd(dp, &psr_vsc, true);
37+
+ return analogix_dp_send_psr_spd(dp, &psr_vsc, false);
38+
}
39+
40+
/*
41+
--
42+
2.20.1
43+

scripts/BuildScripts/KernelScripts/patchKernel.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ if [ "$TARGET" == "$ARCH_ARMHF" ]; then
4141
for i in "$PATCHES"/DTS/*.patch; do echo $i; patch -p1 < $i; done
4242
for i in "$PATCHES"/kernel/*.patch; do echo $i; patch -p1 < $i; done
4343
elif [ "$TARGET" == "$ARCH_ARM64" ]; then
44-
echo skip for now
44+
#echo skip for now
4545
#for i in "$PATCHES"/kernel/*.patch; do echo $i; patch -p1 < $i; done
46-
# for i in "$PATCHES"/drm/*.patch; do echo $i; patch -p1 < $i; done
46+
for i in "$PATCHES"/drm/*.patch; do echo $i; patch -p1 < $i; done
4747
# for i in "$PATCHES"/cros-drm/*.patch; do echo $i; patch -p1 < $i; done
4848
# for i in "$PATCHES"/alarm/*.patch; do echo $i; patch -p1 < $i; done
4949
else

0 commit comments

Comments
 (0)