drm: add PrepareDrmObjectProperties trait - #1107
Merged
Merged
Conversation
mahkoh
force-pushed
the
jorth-drm-property-value
branch
from
July 18, 2026 17:32
76b77db to
25e2e54
Compare
There was a problem hiding this comment.
Pull request overview
This PR introduces a reusable mechanism for tracking, updating, diffing, and emitting DRM object property changes (with optional logging), and refactors the Metal DRM backend to use it, reducing bespoke per-object property handling.
Changes:
- Add
DrmPropertyValue<T>,PrepareDrmObjectProperties/PrepareDrmObjectProperty, and logging helpers for preparing atomic DRM property changes. - Refactor Metal DRM state structs to store property IDs + typed values in
*StatePropsand generate updates/changes via#[derive(PrepareDrmObjectProperties)]. - Relax
Resetto no longer requireDefault, and updateBoxCachebounds accordingly.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/video/drm.rs | Adds generic property/value wrapper, property-prep traits, logging support, and extends DRM object/value conversion helpers. |
| src/utils/reset.rs | Changes Reset trait semantics (drops Default supertrait) and expands numeric impls via macro. |
| src/utils/box_cache.rs | Updates BoxReset cache usage to require Default explicitly where construction is needed. |
| src/backends/metal/video.rs | Refactors property collection/storage to use DrmPropertyValue and new *StateProps structs. |
| src/backends/metal/transaction.rs | Refactors transaction diff/prepare logic to use PrepareDrmObjectProperties derive and reset() instead of Default. |
| src/backends/metal/present.rs | Updates runtime plane-property mutation to use DrmPropertyValue { id, value } layout. |
| jay-proc/src/lib.rs | Exposes the new #[derive(PrepareDrmObjectProperties)] proc-macro. |
| jay-proc/src/drm_object_properties.rs | Implements proc-macro that generates property update/diff/prepare + a specialized reset for property-holder structs. |
| algorithms/src/triangles.rs | Adds a targeted Clippy suppression for a small loop. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
No description provided.