The image is distorted while use iGPU rendering and output via AMD GPU

Bug #1937988 reported by jeremyszu
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OEM Priority Project
Fix Released
Critical
Shengyao Xue
mesa (Ubuntu)
Fix Released
Undecided
Unassigned
Focal
Fix Released
Undecided
Unassigned
Hirsute
Fix Released
Undecided
Unassigned

Bug Description

[Impact]
Image is distorted with PRIME, caused by mismatch in stride alignment between intel and amdgpu/nvidia after intel bumped the alignment to 256 bytes.

[Fix]
Upstream fixed it in 21.2-series, and backport to 21.0.x needs four commits in total.

[Test case]
1. Connect a monitor on the AMD GPU.
2. Power on the system and boot into OS.
3. Run below command to launch glxgears
Cmd> DRI_PRIME=1 glxgears -info

* Expected result
The image is not distorted while running the glxgears

* Actual result
The image is distorted while running the glxgears

[Where things might go wrong]
This is a regression caused by the intel driver, so the backports merely fix what got broken. Regressions would only manifest on hybrid graphics platforms.

---

Here is the upstream bug for tracking this issue.
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11942?commit_id=505f815e5ead8c9872bbda4c1ff3aeaee7223d64

jeremyszu (os369510)
tags: added: oem-priority originate-from-1931050 sutton
tags: added: originate-from-1917700
tags: added: originate-from-1904984 somerville
Changed in oem-priority:
assignee: nobody → Shengyao Xue (xueshengyao)
importance: Undecided → Critical
status: New → In Progress
Revision history for this message
Shengyao Xue (xueshengyao) wrote :

the fix commit not upstream to mesa yet, after it lands to upstream, we can backport the commit in to Ubuntu and start SRU process. I tried backport the commit to Focal's mesa, it works.

Revision history for this message
jeremyszu (os369510) wrote :

@Shengyao,

Thanks, would you please share the ppa you tested here that we could give it a try?

Revision history for this message
Shengyao Xue (xueshengyao) wrote :

@Jeremy, this is the PPA for testing on Focal:

https://launchpad.net/~xueshengyao/+archive/ubuntu/mesa

based on the latest focal-updates' version: 20.2.6-0ubuntu0.20.04.1

mesa (20.2.6-0ubuntu0.20.04.1dri1) focal; urgency=medium

  * test build for backport upstream merge request:
    https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11942
    see patches/loader_add_dri_image_use_scanout.diff

Revision history for this message
jeremyszu (os369510) wrote :

@Shengyao,

We still can reproduce this issue by following:

1. boot from dGPU (AMD)
2. DRI_PRIME=1 gxlgear
3. resize the window slowly.

tags: added: fossa-edge-staging
Revision history for this message
jeremyszu (os369510) wrote :

I did submit a discussion to discuss about "Launch using Dedicated Graphic Card" design.
https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/4509

Revision history for this message
Shengyao Xue (xueshengyao) wrote :

@Jeremy, there is a new version of mesa the PPA in #3:

mesa (20.2.6-0ubuntu0.20.04.1dri2) focal; urgency=medium)

You means the -dri2 version of mesa still has the issue? if yes, could you pls paste a video or screenshot about that? many thanks.

Revision history for this message
jeremyszu (os369510) wrote :

@Shengyao,

I meant the -dri1.
I think the -dri2 is backported from https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11877#.

Let's discuss it on upstream thread.

jeremyszu (os369510)
summary: - The image is distrorted while use iGPU rendering and output via AMD GPU
+ The image is distorted while use iGPU rendering and output via AMD GPU
Revision history for this message
Shengyao Xue (xueshengyao) wrote :

the fix in https://launchpad.net/~xueshengyao/+archive/ubuntu/mesa is much easier for Focal(only 2 lines changed), but it was based on a workaround cannot upstream.

And the latest upstream mesa fixed this issue, so I cherry-picked 4 Mesa's upstream commits to Focal:

a3a4517f4147a0a7c1b34a4bcd42de45d552df5f

55d1b8f929bbba58734bc7b1f79a6f53ab5aa0e8

0e856b95c59d4b9d1909bd96eca0296dd14b41ff

f1a66e7c90ceb4796085989d0d8374689753121e

and made a new package:

https://launchpad.net/~xueshengyao/+archive/ubuntu/mesa2

it fixed this issue in my testing.

I also attached the debdiff.

@Timo, could you please help on the SRU process? many thanks.

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

for hirsute/focal you need to rebase on 21.1.3

impish will get this via 21.2.0~rc4

no longer affects: oem-priority/focal
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "mesa_20.2.6-0ubuntu0.20.04.1to2.debdiff" seems to be a debdiff. The ubuntu-sponsors team has been subscribed to the bug report so that they can review and hopefully sponsor the debdiff. If the attachment isn't a patch, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are member of the ~ubuntu-sponsors, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issue please contact him.]

tags: added: patch
Revision history for this message
Shengyao Xue (xueshengyao) wrote :

@Timo, Thanks for help, I rebased to 21.0.3, on Focal and Hirsute.

This is the debdiff for Focal, thanks.

Revision history for this message
Shengyao Xue (xueshengyao) wrote :

And this is the debdiff for Hirsute, thanks.

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

impish-proposed has 21.2.0-1

Changed in mesa (Ubuntu):
status: New → Fix Committed
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Please test proposed package

Hello jeremyszu, or anyone else affected,

Accepted mesa into hirsute-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/mesa/21.0.3-0ubuntu0.3 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-hirsute to verification-done-hirsute. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-hirsute. 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 mesa (Ubuntu Hirsute):
status: New → Fix Committed
tags: added: verification-needed verification-needed-hirsute
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Hello jeremyszu, or anyone else affected,

Accepted mesa into focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/mesa/21.0.3-0ubuntu0.3~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 mesa (Ubuntu Focal):
status: New → Fix Committed
tags: added: verification-needed-focal
Revision history for this message
Ubuntu SRU Bot (ubuntu-sru-bot) wrote : Autopkgtest regression report (mesa/21.0.3-0ubuntu0.3~20.04.1)

All autopkgtests for the newly accepted mesa (21.0.3-0ubuntu0.3~20.04.1) for focal have finished running.
The following regressions have been reported in tests triggered by the package:

gtk+3.0/3.24.20-0ubuntu1 (ppc64el)

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#mesa

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

Thank you!

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

gtk+3.0/3.24.20-0ubuntu1 (ppc64el)

this got fixed by a retry

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

After upgraded to latest mesa, this issue is fixed. Now it works fine on 5.10.0-oem or 5.13.0-oem kernel. Thanks!

$ DRI_PRIME=1 glxgears -info
Running synchronized to the vertical refresh. The framerate should be
approximately the same as the monitor refresh rate.
GL_RENDERER = Mesa Intel(R) Graphics (RKL GT1)
GL_VERSION = 4.6 (Compatibility Profile) Mesa 21.0.3
GL_VENDOR = Intel
GL_EXTENSIONS = GL_ARB_multisample ...
VisualID 1337, 0x539
305 frames in 5.0 seconds = 60.916 FPS
300 frames in 5.0 seconds = 59.999 FPS
300 frames in 5.0 seconds = 59.986 FPS

$ glxgears -info
Running synchronized to the vertical refresh. The framerate should be
approximately the same as the monitor refresh rate.
GL_RENDERER = AMD Radeon (TM) Pro WX 3200 Series (POLARIS12, DRM 3.40.0, 5.10.0-1038-oem, LLVM 12.0.0)
GL_VERSION = 4.6 (Compatibility Profile) Mesa 21.0.3
GL_VENDOR = AMD
GL_EXTENSIONS = GL_ARB_multisample ...
VisualID 1337, 0x539
350 frames in 5.0 seconds = 69.915 FPS
300 frames in 5.0 seconds = 59.959 FPS
300 frames in 5.0 seconds = 59.979 FPS

tags: added: verification-done-focal
removed: verification-needed-focal
Changed in oem-priority:
status: In Progress → Fix Committed
Revision history for this message
Bin Li (binli) wrote :

Installed 21.04 on P348 and reproduced this issue, after upgraded to proposed packages, this issue is fixed.
$ DRI_PRIME=1 glxgears -info
Running synchronized to the vertical refresh. The framerate should be
approximately the same as the monitor refresh rate.
GL_RENDERER = Mesa Intel(R) Graphics (RKL GT1)
GL_VERSION = 4.6 (Compatibility Profile) Mesa 21.0.3
GL_VENDOR = Intel
GL_EXTENSIONS = GL_ARB_multisample ...
VisualID 509, 0x1fd
305 frames in 5.0 seconds = 60.917 FPS
300 frames in 5.0 seconds = 59.809 FPS
301 frames in 5.0 seconds = 60.000 FPS

$ glxgears -info
Running synchronized to the vertical refresh. The framerate should be
approximately the same as the monitor refresh rate.
GL_RENDERER = AMD Radeon (TM) Pro WX 3200 Series (POLARIS12, DRM 3.40.0, 5.11.0-25-generic, LLVM 12.0.0)
GL_VERSION = 4.6 (Compatibility Profile) Mesa 21.0.3
GL_VENDOR = AMD
GL_EXTENSIONS = GL_ARB_multisample ...
VisualID 509, 0x1fd
304 frames in 5.0 seconds = 60.782 FPS
300 frames in 5.0 seconds = 59.800 FPS

tags: added: verification-done verification-done-hirsute
removed: verification-needed verification-needed-hirsute
Bin Li (binli)
tags: added: originate-from-1935587
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package mesa - 21.0.3-0ubuntu0.3

---------------
mesa (21.0.3-0ubuntu0.3) hirsute; urgency=medium

  * 0001-Cherry-pick-upstream-commits-to-fix-the-distored-dis.diff:
    Fix a distorted display issue on I+A platforms. (LP: #1937988)

 -- Shengyao Xue <email address hidden> Wed, 04 Aug 2021 01:13:12 +0800

Changed in mesa (Ubuntu Hirsute):
status: Fix Committed → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Update Released

The verification of the Stable Release Update for mesa has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

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

This bug was fixed in the package mesa - 21.0.3-0ubuntu0.3~20.04.1

---------------
mesa (21.0.3-0ubuntu0.3~20.04.1) focal; urgency=medium

  * 0001-Cherry-pick-upstream-commits-to-fix-the-distored-dis.diff:
    Fix a distorted display issue on I+A platforms. (LP: #1937988)

 -- Shengyao Xue <email address hidden> Wed, 04 Aug 2021 01:13:12 +0800

Changed in mesa (Ubuntu Focal):
status: Fix Committed → Fix Released
Changed in oem-priority:
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package mesa - 21.2.1-2ubuntu2

---------------
mesa (21.2.1-2ubuntu2) impish; urgency=medium

  * Revert previous change and use -O2 for ppc64el.

 -- Timo Aaltonen <email address hidden> Wed, 15 Sep 2021 18:29:13 +0300

Changed in mesa (Ubuntu):
status: Fix Committed → 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.