Skip to content

Check linear scan-out as the reference does (P-104) - #125

Merged
jwinarske merged 1 commit into
mainfrom
fix/scans-out-linear-parity
Oct 20, 2026
Merged

jwinarske merged 1 commit into
mainfrom
fix/scans-out-linear-parity

Conversation

@jwinarske

Copy link
Copy Markdown
Owner

This is part of moving the parity baseline to drm-cxx 2a050f5. Upstream's 102dd69 (drm-cxx#364) made two choices that drmkit's earlier fix for the same finding (P-48) did not.

  • A plane without IN_FORMATS: scans_out accepted any modifier for a format in the bare list. The reference reads the bare list as linear only, so INVALID is also accepted and AFBC is not. A probed plane already gets a linear-only table, so this changes only capabilities built by hand. Three test fixtures that built an IN_FORMATS table without setting has_format_modifiers now set it.
  • Canvas reservation: it accepted a plane that could host a canvas in any format. The reference's plane_hosts_canvas asks, once the canvas exists, that the plane take the canvas's own format linear. canvas_reservation now takes the canvas's fourcc and checks it with scans_out_linear.

Kept, and recorded in P-104: the cursor takes the legacy path only on a cursor plane that takes ARGB8888 linear, the format the legacy ioctls hand the kernel. The reference takes it on any cursor format.

Tests:

  • scans_out_reads_the_layout_from_in_formats now carries upstream's ScansOutWithoutInFormatsIsLinearOnly.
  • New: overflow_reserves_only_a_plane_that_takes_the_canvas_as_it_is. It fails with the old host check.

Checks: clippy over the workspace with all features, workspace tests, the scene, planes, cursor and CSD tests on vkms, and rustdoc all pass. semver-checks reports no update needed.

Upstream's 102dd69 (drm-cxx#364) made two choices drmkit's earlier fix
for the same finding (P-48) did not.

A plane without IN_FORMATS scanned out any modifier its bare list had a
format for; the reference reads the bare list as linear only. A probed
plane already gets a linear-only table, so this changes only
capabilities built by hand.

The canvas reservation accepted a plane that could host a canvas in any
format; the reference, once the canvas exists, asks that the plane take
the canvas's own format linear. canvas_reservation now takes the
canvas's fourcc and checks it with scans_out_linear.

The cursor's legacy path stays limited to a cursor plane that takes
ARGB8888 linear, the format the legacy ioctls hand the kernel.

Signed-off-by: Joel Winarske <joel.winarske@linux.com>
@jwinarske
jwinarske force-pushed the fix/scans-out-linear-parity branch from b006309 to 2ee014f Compare October 20, 2026 19:14
@jwinarske
jwinarske merged commit 41a5926 into main Oct 20, 2026
10 checks passed
@jwinarske
jwinarske deleted the fix/scans-out-linear-parity branch October 20, 2026 19:19
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.

1 participant