Skip to content

drm/compositor: allow to explicitly enable/disable explicit sync #1697

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/backend/drm/compositor/frame_result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use crate::{
utils::{Buffer as BufferCoords, Physical, Point, Rectangle, Scale, Size, Transform},
};

use super::{DrmScanoutBuffer, ScanoutBuffer};
use super::{Capabilities, DrmScanoutBuffer, ScanoutBuffer};

/// Result for [`DrmCompositor::render_frame`][super::DrmCompositor::render_frame]
///
Expand Down Expand Up @@ -52,14 +52,14 @@ pub struct RenderFrameResult<'a, B: Buffer, F: Framebuffer, E> {
pub cursor_element: Option<&'a E>,

pub(super) primary_plane_element_id: Id,
pub(super) supports_fencing: bool,
pub(super) capabilities: Capabilities,
}

impl<B: Buffer, F: Framebuffer, E> RenderFrameResult<'_, B, F, E> {
/// Returns if synchronization with kms submission can't be guaranteed through the available apis.
pub fn needs_sync(&self) -> bool {
if let PrimaryPlaneElement::Swapchain(ref element) = self.primary_element {
!self.supports_fencing || !element.sync.is_exportable()
!self.capabilities.contains(Capabilities::EXPLICIT_SYNC) || !element.sync.is_exportable()
} else {
false
}
Expand Down
Loading
Loading