nvkms-dpy: don't clamp DP sinks to 6 bpc on undefined EDID depth - #1275
Open
Wintch wants to merge 1 commit into
Open
nvkms-dpy: don't clamp DP sinks to 6 bpc on undefined EDID depth#1275Wintch wants to merge 1 commit into
Wintch wants to merge 1 commit into
Conversation
…efined
An EDID 1.4 digital sink that leaves the Video Input Definition Color Bit
Depth field at 000 ("undefined") is parsed into input.u.digital.bpc = 0.
The DisplayPort branch of nvDpyGetOutputColorFormatInfo() tests `bpc < 8`,
so an undeclared depth is treated as a request for 6 bpc and the link is
driven at 18 bpp for every mode the sink advertises.
The DSI branch of the same function already treats an unrecognized bpc as
8. Make the DP branch agree: only clamp to 6 when the sink actually
declared a depth below 8, and otherwise fall through to the existing 8 bpc
default. EDIDs that declare a depth are unaffected.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The DisplayPort branch of
nvDpyGetOutputColorFormatInfo()treats "the sink did not declarea color depth" as "the sink wants 6 bpc", and drives the link at 18 bpp for every mode. The
DSI branch of the same function already treats that same input as 8 bpc, so the two
branches disagree on identical input.
Present on
mainatnvkms-dpy.c:3468;measured on the
595.71.05tag, where the same line is 3456.Why it happens
For a digital sink with EDID >= 1.4,
nvt_edid.c:932maps the "undefined" encoding of the Video Input Definition byte (offset 0x14, bits 6-4 =
000) to zero:The DP branch then does:
0 < 8is true, so the sink is driven at 6 bpc. The DSI branch a few lines above handles thesame "we don't know" case the other way:
Why nothing corrects the value afterwards
Tree-wide (
grep -rn 'digital\.bpc[[:space:]]*=' src/),input.u.digital.bpcis written inthree places:
src/common/modeset/timing/nvt_edid.c:914-932— the base-block switch above.nvt_edidext_displayid20.c:314— the Display Parameters block of a DisplayID 2.x extension.
nvkms-dpy.c:2258— inside
CreateParsedEdidFromNVT_TIMING(), reached only fromGetFixedModeTimings()(
nvkms-dpy.c:627) for DSI panels and DP serializers, which synthesize a parsed EDID fromRM-supplied timings with a caller-provided bpc. It does not run for a sink that has a real
EDID.
So for a real sink EDID the only override is the DisplayID 2.x one, and that is gated purely
on the extension's version byte, at
nvt_edid.c:1101:The DisplayID 1.3 parser never writes
digital.bpc. So for any DisplayPort sink with aDisplayID 1.x extension — or with no DisplayID extension — that leaves base-block Color Bit
Depth undefined, the 6 bpc clamp is unconditional. On an ordinary monitor that surfaces as
banding, which is easy to misattribute to the panel.
Why fix the consumer and not the parser
bpc = 0carries real information: "the sink did not declare a depth", which is distinctfrom "the sink declared 8". Defaulting to 8 in
nvt_edid.cwould erase that distinction forevery consumer of the parsed EDID. Fixing it at the point of use preserves parse fidelity and
limits the change to the one branch that misreads it.
Reproduced on
595.71.05, open kernel modules, Debian 13, kernel 6.12.1000x14=0x80(digital, Color Bit Depth undefined),DisplayID extension version byte
0x12(DisplayID 1.2)Before:
After:
24 bpp, on every mode this sink advertises. Reproduced on every attempt, on both X11and Wayland.
The sink confirms the change independently of the driver: its companion device reports the
bpc in use back to the host over HID, and that field goes from
06to08— matching whatthe same GPU negotiates for the same mode under Windows.
Reproducing without this hardware
The clamp reproduces on any EDID 1.4 digital sink you can EDID-override. Clear bits 6-4 of
base byte
0x14(Color Bit Depth -> "undefined"), fix the base-block checksum at0x7F,feed it as an override, and the attach log reports 18 bpp. Restoring the bits, or applying
this patch, restores 24 bpp.
Testing
Built and booted
nvidia-kernel-open-dkms595.71.05 with this change on GA104 / kernel6.12.100, X11 and Wayland. Other sinks on the system are unaffected: an EDID that declares a
depth does not reach the modified condition with a different result than before.
Context
Longer write-up, including a separate and still-unresolved 90 Hz failure on this same sink
that this patch does not fix:
https://forums.developer.nvidia.com/t/hp-reverb-g2-clamped-to-6-bpc-because-its-edid-leaves-color-depth-undefined-root-cause-found-two-line-patch-but-90-hz-still-fails-to-light/379240