Make Intel GPUs choose YCbCr420 encoding automatically when required for 4k 60Hz output

Bug #1934489 reported by Werner Sembach
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Incomplete
Undecided
Unassigned
Groovy
In Progress
Undecided
Unassigned
Hirsute
Fix Released
Undecided
Unassigned

Bug Description

SRU Justification:

Impact:
On some setups, while the monitor and the GPU support display modes with pixel clocks of up to 600MHz, the connector might not. This prevents RGB encoding for 4k60Hz, but YCbCr420 encoding might still be possible. However, which color mode is used is decided before the pixel clock capabilities are checked, causing the check to fail and discarding 4k60Hz from the list of possible display modes.

Fix:
This patch fixes the problem by retrying to find a display mode with YCbCr420 enforced and using it, if it is valid. It's very similar to a patch submitted to amdgpu which fixed the same problem.

Testcase:
I personally tested on a Clevo NV40MB, but generally: Find a PC with a current Intel iGPU, but only a HDMI 1.4 output. Connect a 4k@60Hz display supporting YCbCr420 encoding to the HDMI port. Without the patch the maximum that can be set via xrandr is 3840 × 2160 30Hz. With the Patch 3840 × 2160 60Hz can be selected which will use YCbCr420 automatically.

Prerequisite (included in this email patchset as 1/4):
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=3c4442aa22878091f16c8d9592f5f5b6a94d1556

Patchset already got accepted upstream and reached the torvalds tree:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=eacba74d4d561ea6487d944417526e1b025cbebd
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=84d95f77f4aea3f22a486cd04777afd4ab0f0ea5
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=388b863509f76f6a5ecedd7ffdaf184aa813241e
and needs only a minor modifications to apply to ubuntu-focal/hwe-5.8

Commit-hashes:
3c4442aa22878091f16c8d9592f5f5b6a94d1556
eacba74d4d561ea6487d944417526e1b025cbebd
84d95f77f4aea3f22a486cd04777afd4ab0f0ea5
388b863509f76f6a5ecedd7ffdaf184aa813241e

CVE References

Revision history for this message
Werner Sembach (matombo) wrote :

I'm currently resolving the minor merge conflict with ubuntu-5.8 kernel and then test it

description: updated
Revision history for this message
Werner Sembach (matombo) wrote (last edit ):

The bug still exists on 5.11.

The Patchset just got merged after the 5.13 mainline release, so in mainline it will be in 5.14 onwards.

description: updated
Revision history for this message
Werner Sembach (matombo) wrote :

Patchset ported, tested, and sent to kernel-team mailing list

description: updated
Changed in linux (Ubuntu Hirsute):
status: New → In Progress
Changed in linux (Ubuntu Groovy):
status: New → In Progress
Changed in linux (Ubuntu Hirsute):
status: In Progress → Fix Committed
Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote :

This bug is awaiting verification that the kernel in -proposed solves the problem. Please test the kernel and update this bug with the results. If the problem is solved, change the tag 'verification-needed-hirsute' to 'verification-done-hirsute'. If the problem still exists, change the tag 'verification-needed-hirsute' to 'verification-failed-hirsute'.

If verification is not done by 5 working days from today, this fix will be dropped from the source code, and this bug will be closed.

See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you!

tags: added: verification-needed-hirsute
Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote : Missing required logs.

This bug is missing log files that will aid in diagnosing the problem. While running an Ubuntu kernel (not a mainline or third-party kernel) please enter the following command in a terminal window:

apport-collect 1934489

and then change the status of the bug to 'Confirmed'.

If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.

This change has been made by an automated script, maintained by the Ubuntu Kernel Team.

Changed in linux (Ubuntu):
status: New → Incomplete
Revision history for this message
Werner Sembach (matombo) wrote :

Something seems to have broken automatic selection of ycbcr420 (Also in mainline linux releases).

I need more time to figure out what exactly is causing this.

Werner Sembach (matombo)
tags: added: verification-done-hirsute
removed: verification-needed-hirsute
Revision history for this message
Werner Sembach (matombo) wrote :

Ok, turns out it only works on some Intel based laptops. But for them this is still an improvement so I vote for this patch to be keept, as it has no downsides for other devices.

e.g. The Clevo NS50MU Barebone with an i7-1165G7 only outputs 4k@30Hz without this patch, but 4k@60Hz with YCbCr420 with this patch.
Accoring to the spec sheet of the CPU it should be possible to output 4k@60Hz without relying on YCbCr420, but for some reasons this fails. (Didn't check on Windows).

The Clevo L140CU with an i5-10210U cannot output 4k@60Hz with Chroma subsampling.
The spec sheet does not give clear indication whether the CPU supports HDMI 1.4 or 2.0, but it does support 4k@30Hz which should be roughly the same bandwith requirement as 4k@60Hz with chroma subsampling. So i don't know where exactly this fails yet.

TL;DR: Works on Clevo NS50MU, does not work on Clevo L140CU, but also has no negative effect on it -> Patch is still an improvent.

Revision history for this message
Werner Sembach (matombo) wrote :

Offtoppic, but just for reference: Checked the Clevo NS50MU on windows: There 4k@60Hz is also only possible with YCbCr420 so it's no linux specific problem, but propably some strange hardware limitation.

So this device defenetly needs this patch and there is no other fix where 4k@60Hz would run without YCbCr420.

Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (62.5 KiB)

This bug was fixed in the package linux - 5.11.0-34.36

---------------
linux (5.11.0-34.36) hirsute; urgency=medium

  * hirsute/linux: 5.11.0-34.36 -proposed tracker (LP: #1941766)

  * Server boot failure after adding checks for ACPI IRQ override (LP: #1941657)
    - Revert "ACPI: resources: Add checks for ACPI IRQ override"

linux (5.11.0-33.35) hirsute; urgency=medium

  * hirsute/linux: 5.11.0-33.35 -proposed tracker (LP: #1940101)

  * libvirtd fails to create VM (LP: #1940107)
    - sched: Stop PF_NO_SETAFFINITY from being inherited by various init system
      threads

linux (5.11.0-32.34) hirsute; urgency=medium

  * hirsute/linux: 5.11.0-32.34 -proposed tracker (LP: #1939769)

  * Packaging resync (LP: #1786013)
    - debian/dkms-versions -- update from kernel-versions (main/2021.08.16)

  * CVE-2021-3656
    - SAUCE: KVM: nSVM: always intercept VMLOAD/VMSAVE when nested

  * CVE-2021-3653
    - SAUCE: KVM: nSVM: avoid picking up unsupported bits from L2 in int_ctl

  * [regression] USB device is not detected during boot (LP: #1939638)
    - SAUCE: Revert "usb: core: reduce power-on-good delay time of root hub"

  * Support builtin revoked certificates (LP: #1932029)
    - [Packaging] build canonical-revoked-certs.pem from branch/arch certs
    - [Packaging] Revoke 2012 UEFI signing certificate as built-in
    - [Config] Configure CONFIG_SYSTEM_REVOCATION_KEYS with revoked keys

  * Support importing mokx keys into revocation list from the mok table
    (LP: #1928679)
    - SAUCE: integrity: add informational messages when revoking certs

  * Support importing mokx keys into revocation list from the mok table
    (LP: #1928679) // CVE-2020-26541 when certificates are revoked via
    MokListXRT.
    - SAUCE: integrity: Load mokx certs from the EFI MOK config table

  * Include product_sku info to modalias (LP: #1938143)
    - firmware/dmi: Include product_sku info to modalias

  * Fix Ethernet not working by hotplug - RTL8106E (LP: #1930645)
    - net: phy: rename PHY_IGNORE_INTERRUPT to PHY_MAC_INTERRUPT
    - SAUCE: r8169: Use PHY_POLL when RTL8106E enable ASPM

  * [SRU][H/OEM-5.10/OEM-5.13/U] Fix system hang after unplug tbt dock
    (LP: #1938689)
    - SAUCE: igc: fix page fault when thunderbolt is unplugged

  * [Regression] Audio card [8086:9d71] not detected after upgrade from linux
    5.4 to 5.8 (LP: #1915117)
    - [Config] set CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC to y

  * Backlight (screen brightness) on Lenovo P14s AMD Gen2 inop (LP: #1934557)
    - drm/amdgpu/display: only enable aux backlight control for OLED panels

  * Touchpad not working with ASUS TUF F15 (LP: #1937056)
    - pinctrl: tigerlake: Fix GPIO mapping for newer version of software

  * dev_forward_skb: do not scrub skb mark within the same name space
    (LP: #1935040)
    - dev_forward_skb: do not scrub skb mark within the same name space

  * Fix display output on HP hybrid GFX laptops (LP: #1936296)
    - drm/i915: Invoke another _DSM to enable MUX on HP Workstation laptops

  * [SRU][OEM-5.10/H] UBUNTU: SAUCE: Fix backlight control on Samsung 16727
    panel (LP: #1930527)
    - SAUCE: drm/i915: Force DPCD backlight mode for Samsung 16727 pa...

Changed in linux (Ubuntu Hirsute):
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.