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

Switch to use dirty fb for plane update #1449

Open
wants to merge 1 commit into
base: celadon/r/mr0/stable
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
From 240e659af7471caca08ae469984b7be98bf2fedc Mon Sep 17 00:00:00 2001
From: "Li, HaihongX" <[email protected]>
Date: Thu, 26 May 2022 16:01:02 +0800
Subject: [PATCH] Switch to use dirty fb for plane update

Switch to call function drmModeDirtyFB in
DrmDisplayCompositor::CommitFrame.

Tracked-On: OAM-102301
Signed-off-by: Li, HaihongX <[email protected]>
---
compositor/DrmDisplayCompositor.cpp | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)

diff --git a/compositor/DrmDisplayCompositor.cpp b/compositor/DrmDisplayCompositor.cpp
index f741b6f..d998061 100644
--- a/compositor/DrmDisplayCompositor.cpp
+++ b/compositor/DrmDisplayCompositor.cpp
@@ -221,6 +221,29 @@ int DrmDisplayCompositor::CommitFrame(DrmDisplayComposition *display_comp,
ALOGE("Could not locate crtc for display %d", display_);
return -ENODEV;
}
+ if (!mode_.needs_modeset) {
+ if (test_only)
+ return 0;
+ for (DrmCompositionPlane &comp_plane : comp_planes) {
+ std::vector<size_t> &source_layers = comp_plane.source_layers();
+ if (comp_plane.type() == DrmCompositionPlane::Type::kDisable)
+ continue;
+ DrmHwcLayer &layer = layers[source_layers.front()];
+ if (!layer.FbIdHandle) {
+ ALOGE("Expected a valid framebuffer for pset");
+ return -1;
+ }
+ hwc_rect_t display_frame;
+ display_frame = layer.display_frame;
+ drmModeClip clip;
+ clip.x1 = display_frame.left;
+ clip.y1 = display_frame.top;
+ clip.x2 = display_frame.right - display_frame.left;
+ clip.y2 = display_frame.bottom - display_frame.top;
+ drmModeDirtyFB(drm->fd(), layer.FbIdHandle->GetFbId(), &clip, 1);
+ }
+ return 0;
+ }

drmModeAtomicReqPtr pset = drmModeAtomicAlloc();
if (!pset) {
--
2.36.1

Loading