PINE64
Screen refresh delay with kernel errors - Printable Version

+- PINE64 (https://forum.pine64.org)
+-- Forum: Pinebook Pro (https://forum.pine64.org/forumdisplay.php?fid=111)
+--- Forum: General Discussion on Pinebook Pro (https://forum.pine64.org/forumdisplay.php?fid=112)
+--- Thread: Screen refresh delay with kernel errors (/showthread.php?tid=10326)

Pages: 1 2 3 4


Screen refresh delay with kernel errors - shawnanastasio - 06-18-2020

After receiving my new Pinebook Pro with the default Manjaro KDE installation, I've noticed that the screen frequently lags and seems to skip updates. This is even noticeable when typing commands in the terminal and seeing a ~1s delay between pressing some keys and seeing it appear on screen.

After some investigation, it seems the lag spikes correspond with messages like these appearing in the kernel log (dmesg):
Code:
[ 1431.158451] rockchip-dp ff970000.edp: Failed to apply PSR -110
[ 1431.158495] [drm:analogix_dp_bridge_atomic_enable [analogix_dp]] *ERROR* Failed to disable psr -110

I've looked online for people with the same issue, but I could only come up with one bug report on a kernel mailing list with no replies. Is this a known bug that can be worked around, or is it possible my unit has a hardware issue?


RE: Screen refresh delay with kernel errors - shawnanastasio - 06-19-2020

A small update.

It seems that the failing component is the display's Panel Self-Refresh feature which results in the DisplayPort bus being re-link trained frequently. My current theory is that this link training occasionally fails and results in the frame skips.

By disabling the PSR feature entirely in the kernel with a patch like this, the issue goes away and the laptop becomes usable. This is more of a workaround than an actual fix though, and I do believe the hardware is faulty here.

In case anybody is curious or runs into this issue and wants to try the workaround, here's the patch:

Code:
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
index 76736fb8e..a49dd6b3c 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
@@ -978,12 +978,13 @@ static int analogix_dp_commit(struct analogix_dp_device *dp)
    ret = analogix_dp_fast_link_train_detection(dp);
    if (ret)
        return ret;
-
+    /*
    if (analogix_dp_detect_sink_psr(dp)) {
        ret = analogix_dp_enable_sink_psr(dp);
        if (ret)
            return ret;
    }
+    */

    return ret;
}



RE: Screen refresh delay with kernel errors - phuzy - 06-21-2020

(06-19-2020, 07:24 PM)shawnanastasio Wrote: A small update.

It seems that the failing component is the display's Panel Self-Refresh feature which results in the DisplayPort bus being re-link trained frequently. My current theory is that this link training occasionally fails and results in the frame skips.

By disabling the PSR feature entirely in the kernel with a patch like this, the issue goes away and the laptop becomes usable. This is more of a workaround than an actual fix though, and I do believe the hardware is faulty here.

In case anybody is curious or runs into this issue and wants to try the workaround, here's the patch:

Code:
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
index 76736fb8e..a49dd6b3c 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
@@ -978,12 +978,13 @@ static int analogix_dp_commit(struct analogix_dp_device *dp)
    ret = analogix_dp_fast_link_train_detection(dp);
    if (ret)
        return ret;
-
+    /*
    if (analogix_dp_detect_sink_psr(dp)) {
        ret = analogix_dp_enable_sink_psr(dp);
        if (ret)
            return ret;
    }
+    */

    return ret;
}

As a linux novice, do you have any resources that would point me in the right direction to apply this fix myself?


RE: Screen refresh delay with kernel errors - HaxNet - 06-21-2020

how do you apply this patch?


RE: Screen refresh delay with kernel errors - mtnygard - 06-23-2020

I'm muddling through build the kernel with this patch.

1. Clone the linux-pinebookpro repo from https://gitlab.manjaro.org/manjaro-arm/packages/core/linux-pinebookpro.git
2. cd into that directory
3. run makepkg
4. Fix whatever makepkg complains about and goto step 3

So far, I've had to install some extra dependencies with 'pacman -S blah blah' and fix checksums with 'updpkgsums'. Still working through other errors.


RE: Screen refresh delay with kernel errors - shawnanastasio - 06-23-2020

I would suggest using manjaro's linux-aarch64 repository instead which seems to be a much more minimal patchset that tracks upstream.


RE: Screen refresh delay with kernel errors - mtnygard - 06-23-2020

(06-23-2020, 06:38 PM)shawnanastasio Wrote: I would suggest using manjaro's linux-aarch64 repository instead which seems to be a much more minimal patchset that tracks upstream.

Thanks, that's timely. I was hitting errors in the "prepare()" function on the other one.


RE: Screen refresh delay with kernel errors - xmixahlx - 06-23-2020

interesting that i don't see the same issue with 5.7.3-hwaccel on debian ... which kernel version are you using?


RE: Screen refresh delay with kernel errors - 65a - 06-23-2020

I wouldn't be surprised if PSR is not enabled correctly, so it's detected but in a weird state. The -110 error is ETIMEOUT, which I think means the panel has timed out responding to the PSR command (maybe it doesn't support it but reports it anyway?)


RE: Screen refresh delay with kernel errors - mtnygard - 06-24-2020

(06-23-2020, 06:38 PM)shawnanastasio Wrote: I would suggest using manjaro's linux-aarch64 repository instead which seems to be a much more minimal patchset that tracks upstream.

OK, so the process I just used was like this:

1. Clone the linux-aarch64 repo from https://gitlab.manjaro.org/manjaro-arm/packages/core/linux-aarch64
2. cd into there
3. Run "makepkg -o" to fetch sources, verify checksums, and apply patches but *not* compile
4. Manually edit the offending file with @shawnanastasio's change to comment out that if block
5. Run "makepkg -e" to compile and package without re-downloading sources
6. Wait a long, long time. Like "go to bed" long
7. See a successful compile!
8. Learn about MAKEFLAGS="-j2" and slap forehead.
9. Use "pacman -U ./linux-aarch64-5.7.5-1-aarch64.tar.xz". Worry a bit when pacman says it wants to replace linux-pinebookpro with the new package.
10. Use "pacman -U ./linux-aarch64-headers-5.7.5-1-aarch64.tar.xz" to make sure my headers match my kernel.
11. Reboot
12. Enjoy buttery-smooth trackpad responsiveness and a clean dmesg output!