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

Feature/drm planes #760

Merged
merged 18 commits into from
Feb 15, 2023
Merged

Feature/drm planes #760

merged 18 commits into from
Feb 15, 2023

Conversation

cmeissl
Copy link
Collaborator

@cmeissl cmeissl commented Sep 22, 2022

Current limitations

  • no support for screen-capture DrmCompositor::render_frame now returns a reference to everything needed to implement screencopy. Additional the returned struct implements functions for blitting the frame to a bound buffer.
  • cursor plane known to not work on nvidia (probably related to not using bo flags Cursor) switched to gbm bo write and offscreen rendering -> works now
  • underlay/primary plane direct-scan out check could be relaxed the primary plane can now be used for direct scan-out in more edge cases

TODO

  • anvil: use GbmBufferedSurface as a fallback (or compile time feature)? -> The old behavior can be forced by setting the ANVIL_DISABLE_DRM_COMPOSITOR env variable

@Drakulix Drakulix force-pushed the dev/space-renderer-split branch from 25e70a2 to 5caa01a Compare September 23, 2022 17:00
@cmeissl cmeissl force-pushed the feature/drm_planes branch 2 times, most recently from b23c15c to fe0a6a7 Compare October 3, 2022 11:22
@Drakulix Drakulix force-pushed the dev/space-renderer-split branch 4 times, most recently from df4e3d9 to 7aeda28 Compare October 5, 2022 16:12
@Drakulix Drakulix force-pushed the dev/space-renderer-split branch from a487b58 to 353a96a Compare October 11, 2022 16:00
@cmeissl cmeissl force-pushed the feature/drm_planes branch from fe0a6a7 to f8ccbcc Compare October 15, 2022 13:18
@cmeissl cmeissl force-pushed the feature/drm_planes branch from f8ccbcc to d93d3f6 Compare November 8, 2022 15:26
@cmeissl cmeissl changed the base branch from dev/space-renderer-split to master November 17, 2022 16:51
@cmeissl cmeissl force-pushed the feature/drm_planes branch 10 times, most recently from 19c79e7 to 31ac6d2 Compare November 25, 2022 09:18
mut allocator: A,
framebuffer_exporter: F,
renderer_formats: HashSet<DrmFormat>,
cursor_size: Size<u32, BufferCoords>,
Copy link
Contributor

@bwidawsk bwidawsk Nov 30, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think cursor_size should be an Option because input/cursor isn't required for all compositors.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The drm renderer currently tries to assign whatever fits on the cursor plane, so technically it is not required to be a cursor element. With the latest changes the cursor plane can be completely disabled by not passing it to the constructor.

@cmeissl cmeissl force-pushed the feature/drm_planes branch 5 times, most recently from cfa27cb to a01ace6 Compare December 16, 2022 20:16
@cmeissl cmeissl force-pushed the feature/drm_planes branch 2 times, most recently from dafdfee to 5b969e9 Compare February 15, 2023 14:40
Copy link
Member

@Drakulix Drakulix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few remarks on documentation, but otherwise I am really happy how this has turned out.

///
/// *Note*: This will only return y-inverted for buffer types known to smithay (see [`buffer_type`])
#[cfg(feature = "wayland_frontend")]
pub fn buffer_y_inverted(buffer: &wl_buffer::WlBuffer) -> Option<bool> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For what it is worth, the Result is more self-explanatory. (and thus probably the better fit here)

Otherwise the function needs some docs, what None means.

//! None,
//! );
//!
//! # let device: DrmDevice = unsafe { MaybeUninit::uninit().assume_init() };
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably just use todo!() here, I'm a little scared by using MaybeUninit here. Plus the example is no_run, so it shouldn't cause any real change.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I have also used unreachable!() in those cases.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I never thought about using just todo!() and always used some obscure ways, thanks!

this allows storing the buffer for a plane to prevent
early release
this remove the External variant of UnderlyingStorage,
exposing the TextureId is of no use
debug flags can be enabled at run-time for a renderer
for now the only supported flag is TINT which will
TINT all rendered textures
this increases api ergonomics for the damage tracker
by using IntoIterator instead of a slice
this adds a plane config and state in order to make a
complete plane test
this changes Rectangle::overlaps to no longer
return true for touching rectangles.
the old behavior can be found in Rectangle::overlaps_or_touches
@Drakulix Drakulix merged commit 16ef29e into Smithay:master Feb 15, 2023
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.

6 participants