metal: fix updating of blob properties#1115
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors object-id access by extending ObjWithId support to Rc<T> (and adding an Option helper), then uses those utilities in the Metal DRM backend to improve how blob-backed DRM properties (mode, gamma LUT, HDR metadata) are tracked and refreshed.
Changes:
- Add
ObjWithIdblanket impl forRc<T>and introduceObjWithIdOptExt::id_or_default()forOption<T>. - Migrate several
ObjWithIdimpls fromRc<...>wrappers to the underlying types, and makePropBlobimplementObjWithId. - Update Metal backend blob-property handling to compare blob IDs against cached blob objects and adjust HDR metadata retrieval behavior.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/video/drm.rs | Makes PropBlob implement ObjWithId (removing the inherent id() method in favor of the trait). |
| src/utils/obj_and_id.rs | Adds ObjWithId for Rc<T> and an Option extension trait for defaulting IDs. |
| src/tree/workspace.rs | Moves ObjWithId impl to WorkspaceNode (leveraging new Rc<T> blanket impl). |
| src/tree/output.rs | Moves ObjWithId impl to OutputNode (leveraging new Rc<T> blanket impl). |
| src/state.rs | Moves ObjWithId impls to ConnectorData / DrmDevData (leveraging new Rc<T> blanket impl). |
| src/ifs/wl_surface/xdg_surface/xdg_toplevel/xdg_toplevel_icon_v1.rs | Moves ObjWithId impl to XdgToplevelIconV1 (leveraging new Rc<T> blanket impl). |
| src/ifs/wl_surface/commit_timeline.rs | Moves ObjWithId impl to Inner (leveraging new Rc<T> blanket impl). |
| src/cursor_user.rs | Moves ObjWithId impl to CursorUser (leveraging new Rc<T> blanket impl). |
| src/backends/metal/video.rs | Adjusts HDR metadata initialization and blob-id change detection for connector/crtc properties. |
| src/backends/metal/transaction.rs | Imports ObjWithId (needed now that PropBlob::id() is trait-based). |
| src/backend.rs | Moves ObjWithId impl to BackendGammaLut (leveraging new Rc<T> blanket impl). |
💡 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.