Skip to content

evdi: harden software colour path and color_props advertisement - #2

Merged
iDoMeteor merged 2 commits into
iDoMeteor:add-crtc-color-managementfrom
onetr1ck:wip/color-mgmt-followups
Aug 15, 2026
Merged

evdi: harden software colour path and color_props advertisement#2
iDoMeteor merged 2 commits into
iDoMeteor:add-crtc-color-managementfrom
onetr1ck:wip/color-mgmt-followups

Conversation

@onetr1ck

@onetr1ck onetr1ck commented Aug 14, 2026

Copy link
Copy Markdown

Based on your colour management branch (after the earlier damage/cursor/color_props work).

This keeps applying only real compositor GAMMA_LUT and CTM blobs, with no gamma↔CTM synthesis. color_props=both|gamma|ctm at module load chooses which DRM properties the CRTC advertises so Mutter can be steered like apple-drm (CTM only) or gamma only; reload the module to change it.

Identity transforms are skipped, diagonal CTMs fuse into a 256-entry LUT (composing with an existing gamma when both are set), GRABPIX uses a per-call scratch row, and full-dirty runs only when the effective apply payload changes. While colour is active, the software cursor path is forced so DisplayLinkManager cursor events do not leave an untinted pointer. color_status dumps the per-card apply path.

Tested on a DisplayLink dock with GNOME Night Light (color_props=ctm). Happy for you to take any of this into the upstream PR or leave it. DisplayLink#44 is still the long-standing gamma ramp request if you want a Closes link on DisplayLink#584.

@onetr1ck onetr1ck changed the title evdi: runtime color_apply for gamma vs CTM evdi: colour follow-ups (damage, cursor, color_props advertisement) Aug 14, 2026
Apply only compositor GAMMA_LUT/CTM blobs (no gamma↔CTM synthesis).
Which properties the CRTC advertises is selected at module load with
color_props=both|gamma|ctm so Mutter can be steered like apple-drm
(CTM-only) or gamma-only; reload the module to change it.

Skip identity transforms, fuse diagonal CTMs into a 256-entry LUT for
a cheap hot path, reuse a per-device GRABPIX scratch row, and full-dirty
only when the effective apply payload changes so static Night Light
updates still re-grab without spamming USB on no-op churn.

Add a read-only color_status parameter for per-card apply path and
scale dumps.
@onetr1ck onetr1ck changed the title evdi: colour follow-ups (damage, cursor, color_props advertisement) evdi: harden software colour path and color_props advertisement Aug 14, 2026
@onetr1ck
onetr1ck force-pushed the wip/color-mgmt-followups branch from e7a872c to 56df938 Compare August 14, 2026 21:04
Diagonal CTM fuse overwrote a compositor gamma LUT when both were set;
compose CTM-then-gamma into the table instead. Shared GRABPIX scratch
could be freed under concurrent grab — use a per-call buffer.

DisplayLinkManager enables cursor events, so the SW tint path never ran
and the pointer stayed day-white under Night Light. While colour is
active, hide the HW cursor event and SW-blend with the same transform,
re-advertising on colour change so DLM does not double-draw.
@onetr1ck

Copy link
Copy Markdown
Author

Pushed another commit: fuse composes with an existing gamma LUT, GRABPIX uses a per-call scratch, and while colour is active we SW-blend the cursor and hide the HW cursor event so DisplayLinkManager does not leave it untinted.

For DisplayLink DisplayLink#584, worth linking DisplayLink#44 (gamma ramp, open since 2016) if you have not already — that looks like the long-standing issue this closes.

@iDoMeteor
iDoMeteor merged commit 5d340e0 into iDoMeteor:add-crtc-color-management Aug 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants