Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix drm::control::Device::add_planar_buffer when GBM Bo uses DrmModifier::Invalid #192

Merged
merged 1 commit into from
Mar 27, 2024

Conversation

tronical
Copy link
Contributor

When adding a GBM supplied buffer via add_planar_buffer, since commit 6cb3a27 the modifiers are fetched directly from the planar buffer trait. What the code does not take into account though is when the GBM bo returns DrmModifier::Invalid. In that case add_fb2 expects 0 as modifier in the array for each plane, instead of DRM_FORMAT_MOD_INVALID.

@tronical
Copy link
Contributor Author

One could argue that the PlanarBuffer implementation of BufferObject in gbm, fn modifiers(&self) -> Option<Modifier> should return None for DrmModifier::Invalid. I can make a PR for that - separately - but meanwhile I think since the ::Invalid variant does exist, it makes sense to "support" it.

@tronical
Copy link
Contributor Author

I force-pushed to get the formatting fixed (my bad).

@tronical
Copy link
Contributor Author

The CI failure looks bogus. The error about the invalid cast looks like it was from a build of an earlier sha. The latest build in https://github.com/Smithay/drm-rs/actions/runs/8346623741 has only the (seemingly unrelated) drm_syncobj failures.

@Drakulix
Copy link
Member

Could you rebase? #190 should have fixed CI.

…ier::Invalid

When adding a GBM supplied buffer via add_planar_buffer, since commit
6cb3a27 the modifiers are fetched
directly from the planar buffer trait. What the code does not take into
account though is when the GBM bo returns DrmModifier::Invalid. In that
case add_fb2 expects 0 as modifier in the array for each plane,
instead of DRM_FORMAT_MOD_INVALID.
@tronical
Copy link
Contributor Author

Done :)

@Drakulix Drakulix merged commit d926544 into Smithay:develop Mar 27, 2024
16 checks passed
@Drakulix
Copy link
Member

Thanks!

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