AMD

[SRU] Backport xorg-server 1.20.13 to focal

Bug #1947820 reported by Bin Li
20
This bug affects 2 people
Affects Status Importance Assigned to Milestone
AMD
Fix Released
Undecided
Unassigned
OEM Priority Project
Fix Released
Critical
Bin Li
xorg-server (Ubuntu)
Invalid
Undecided
Unassigned
Focal
Fix Released
Undecided
Timo Aaltonen

Bug Description

[Impact]
The delay phenomenon is serious in 'External display mode' during the 'On-demand' mode working.
Please reference lp:1940247 and lp:1919118.

[Fix]
 I installed 21.10 on Raptor12(ThinkPad-P15-Gen-2i), with xorg-server 2:1.20.13-1ubuntu1 and nvidia-495.38 test driver, this issue is solved. But in 20.04, it's still 2:1.20.11-1ubuntu1~20.04.2.

[Test]
On Raptor12(ThinkPad-P15-Gen-2i), P17 Gen 2 and P1 Gen 4, with latest 20.04, it could be reproduced.

[Where problems could occur]
Although the nvidia driver is not released, I thought it's no harm to upgrade xorg-server first.

Bin Li (binli)
no longer affects: linux-firmware (Ubuntu)
tags: added: oem-priority originate-from-1919118 sutton
Changed in oem-priority:
assignee: nobody → Bin Li (binli)
importance: Undecided → Critical
Revision history for this message
Bin Li (binli) wrote :

https://bugs.launchpad.net/nvidia-drivers-ubuntu/+bug/1940247/comments/15

NV update for NV#3374575:
Hi Kevin - This is an expected issue for all drivers with the currently shipping X server (1.20.9 in the bug report): https://gitlab.freedesktop.org/xorg/xserver/-/issues/1028 . https://bugs.launchpad.net/ubuntu/+source/xorg-server/+bug/1875015 .

The issue is that X Present doesn't support synchronizing to PRIME heads. When the external display (via Reverse PRIME) is the only head left, X Present vsync apps have nothing to sync to and throttle to 1 FPS by default. The only solution right now is to disable vsync, try adding a .sh script in /etc/profile.d with the following contents:
export CLUTTER_VBLANK=none
export vblank_mode=0

That should fix the 1 FPS issue but obviously you won't have vsync. If the system is muxed such that external displays are connected to the iGPU in this configuration, you won't have the problem.

Revision history for this message
Bin Li (binli) wrote :

@timo,

I compared the impish-devel and focal-devel, looks like one commit, but it changed a lot, modesetting-disable-reverse-prime-offload-udl.diff was removed. Do we need we bisect a real commit or just merge the whole commit? Thanks!

commit 460dfc66cac9bc75a6dfed86be6e71e6fb429df9 (HEAD -> ubuntu/impish-devel, tag: import/2%1.20.13-1ubuntu1, origin/ubuntu/impish-proposed, origin/ubuntu/impish-devel, origin/ubuntu/devel, origin/HEAD, ubuntu/devel)
Author: Timo Aaltonen <email address hidden>
Date: Tue Aug 10 12:32:48 2021 +0300

    2:1.20.13-1ubuntu1 (patches unapplied)

    Imported using git-ubuntu import.

Revision history for this message
Bin Li (binli) wrote :

I tried to apply the patch in https://gitlab.freedesktop.org/xorg/xserver/-/issues/1028 . But it didn't work for the delay phenomenon.

From 346e44407dc0beeed1e1ef3eebeeaa0bae2b3ac1 Mon Sep 17 00:00:00 2001
From: Lukasz Spintzyk <email address hidden>
Date: Mon, 18 May 2020 13:29:54 +0200
Subject: [PATCH] Fix for DisplayLink screens refresing with 1FPS

This is fixing issue described here:
https://gitlab.freedesktop.org/xorg/xserver/-/issues/1028

This commit is modifying ms_randr_crtc_covering_drawable introduced in commit:
Since https://gitlab.freedesktop.org/xorg/xserver/-/commit/325f694e97a117aec47aa2e1a9b2b28c3c47994e

Since ms_randr_crtc_covering_drawable intended to be RandR-based implementation of ms_dri2_crtc_covering_drawable
it is still using ms_first_output whereas RRFirstOutput replacement is aval
---
 hw/xfree86/drivers/modesetting/vblank.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/xfree86/drivers/modesetting/vblank.c b/hw/xfree86/drivers/modesetting/vblank.c
index 50d2fd3a4..a0d62e8b4 100644
--- a/hw/xfree86/drivers/modesetting/vblank.c
+++ b/hw/xfree86/drivers/modesetting/vblank.c
@@ -266,7 +266,7 @@ ms_covering_randr_crtc(ScreenPtr pScreen, BoxPtr box, Bool screen_is_ms)
         ScreenPtr slave;

         if (dixPrivateKeyRegistered(rrPrivKey))
- primary_output = ms_first_output(scrn->pScreen);
+ primary_output = RRFirstOutput(scrn->pScreen);
         if (!primary_output || !primary_output->crtc)
             return NULL;

Revision history for this message
Bin Li (binli) wrote (last edit ):

So I tried to build the xorg-server 2:1.20.13-1ubuntu1 from impish directly, and with NVIDIA 495.46 driver this issue is fixed.
The new xorg-server don't include xwayland package any more, so I still used the old xwayland 2:1.20.11.

And I pushed the xorg-server in my ppa.
https://launchpad.net/~binli/+archive/ubuntu/ppa

Changed in oem-priority:
status: New → Triaged
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Timo Aaltonen (tjaalton)
affects: xorg-server → xorg-server (Ubuntu)
Changed in xorg-server (Ubuntu):
status: New → Confirmed
Timo Aaltonen (tjaalton)
Changed in xorg-server (Ubuntu):
status: New → Invalid
Changed in xorg-server (Ubuntu Focal):
assignee: nobody → Timo Aaltonen (tjaalton)
Revision history for this message
Chris Halse Rogers (raof) wrote : Please test proposed package

Hello Bin, or anyone else affected,

Accepted xorg-server into focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/xorg-server/2:1.20.13-1ubuntu1~20.04.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-focal to verification-done-focal. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-focal. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in xorg-server (Ubuntu Focal):
status: New → Fix Committed
tags: added: verification-needed verification-needed-focal
Revision history for this message
Ubuntu SRU Bot (ubuntu-sru-bot) wrote : Autopkgtest regression report (xorg-server/2:1.20.13-1ubuntu1~20.04.1)

All autopkgtests for the newly accepted xorg-server (2:1.20.13-1ubuntu1~20.04.1) for focal have finished running.
The following regressions have been reported in tests triggered by the package:

aptdaemon/1.1.1+bzr982-0ubuntu32.3 (arm64)

Please visit the excuses page listed below and investigate the failures, proceeding afterwards as per the StableReleaseUpdates policy regarding autopkgtest regressions [1].

https://people.canonical.com/~ubuntu-archive/proposed-migration/focal/update_excuses.html#xorg-server

[1] https://wiki.ubuntu.com/StableReleaseUpdates#Autopkgtest_Regressions

Thank you!

Revision history for this message
Bin Li (binli) wrote (last edit ):

For autopkgtest for pyfai/0.19.0+dfsg1-1build1, it prompts 'timed out', but I don't know what's the reason.

autopkgtest [08:38:39]: test command2: - - - - - - - - - - results - - - - - - - - - -
command2 FAIL timed out
autopkgtest [08:38:40]: @@@@@@@@@@@@@@@@@@@@ summary
command1 FAIL non-zero exit status 1
command2 FAIL timed out

Revision history for this message
Timo Aaltonen (tjaalton) wrote :

pyfai? the list only shows aptdaemon failing on arm64, and it has been failing for a long time now, so we can disregard that one

Alex Tu (alextu)
tags: added: originate-from-1947372 somerville
tags: added: originate-from-1948411
tags: removed: originate-from-1947372 originate-from-1948411 somerville
Revision history for this message
Bin Li (binli) wrote :

I did a test with testing nvidia driver 495.46.run, it will have a lag issue when use 'on-demand' mode in 'external-only' mode. After enabled the proposed and did 'apt-dist upgrade', now I use latest xserver-xorg-core, this issue is fixed now.

xserver-xorg-core:amd64 (2:1.20.11-1ubuntu1~20.04.2, 2:1.20.13-1ubuntu1~20.04.1
xwayland:amd64 (2:1.20.11-1ubuntu1~20.04.2, 2:1.20.13-1ubuntu1~20.04.1)

kernel: 5.14.0.1008.8-oem

Revision history for this message
Bin Li (binli) wrote :

Next step we will build a deb package to test if it works or not. I will update it later. Thanks!

Revision history for this message
Bin Li (binli) wrote :

Verified with the 495.46 deb packages which made by alberto, this issue is fixed.

tags: added: verification-done verification-done-focal
removed: verification-needed verification-needed-focal
Revision history for this message
Bin Li (binli) wrote :

Hi timo,

 Do you know when these xorg packages are in updates channel? We need this fix in our OEM project next week. Thanks!

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package xorg-server - 2:1.20.13-1ubuntu1~20.04.2

---------------
xorg-server (2:1.20.13-1ubuntu1~20.04.2) focal-security; urgency=medium

  * SECURITY UPDATE: SProcRenderCompositeGlyphs out-of-bounds access
    - debian/patches/CVE-2021-4008.patch: check lengths in render/render.c.
    - CVE-2021-4008
  * SECURITY UPDATE: SProcXFixesCreatePointerBarrier out-of-bounds access
    - debian/patches/CVE-2021-4009.patch: use sizes in xfixes/cursor.c.
    - CVE-2021-4009
  * SECURITY UPDATE: SProcScreenSaverSuspend out-of-bounds access
    - debian/patches/CVE-2021-4010.patch: fix logic in Xext/saver.c.
    - CVE-2021-4010
  * SECURITY UPDATE: SwapCreateRegister out-of-bounds access
    - debian/patches/CVE-2021-4011.patch: fix length in record/record.c.
    - CVE-2021-4011

 -- Marc Deslauriers <email address hidden> Tue, 14 Dec 2021 09:14:13 -0500

Changed in xorg-server (Ubuntu Focal):
status: Fix Committed → Fix Released
Bin Li (binli)
Changed in oem-priority:
status: Triaged → Fix Released
Alex Hung (alexhung)
Changed in amd:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.