summaryrefslogtreecommitdiff
path: root/drmdisplaycompositor.h
diff options
context:
space:
mode:
authorSean Paul <seanpaul@chromium.org>2015-11-17 14:46:56 -0500
committerSean Paul <seanpaul@chromium.org>2015-11-19 14:02:58 -0500
commit35301f498c372f3ad2bbbc969acda39056131b26 (patch)
tree8eecceb23d8eaf3dc6e5ee9083ca68519718f5ec /drmdisplaycompositor.h
parent2b4b1eea6b7075efe356af8bb2e948201635c5c2 (diff)
drm_hwcomposer: Create mode blob on modeset queue
Instead of creating the mode blob right before doing the modeset, create it as soon as the modeset is queued. This will allow us to use the blob for both atomic test as well as commit. In addition to keeping the blob around, store the blob's id while the mode is active so we don't need to look it up when/if the next modeset comes in. Bug: 25379136 Test: Tested on smaug Change-Id: I60e6f83310ea0601388bb31b63d25c6fd7b8fc4d Signed-off-by: Sean Paul <seanpaul@chromium.org>
Diffstat (limited to 'drmdisplaycompositor.h')
-rw-r--r--drmdisplaycompositor.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/drmdisplaycompositor.h b/drmdisplaycompositor.h
index 9a3e7cc..a1cff13 100644
--- a/drmdisplaycompositor.h
+++ b/drmdisplaycompositor.h
@@ -123,6 +123,13 @@ class DrmDisplayCompositor {
std::queue<FrameState> frame_queue_;
};
+ struct ModeState {
+ bool needs_modeset = false;
+ DrmMode mode;
+ uint32_t blob_id = 0;
+ uint32_t old_blob_id = 0;
+ };
+
DrmDisplayCompositor(const DrmDisplayCompositor &) = delete;
// We'll wait for acquire fences to fire for kAcquireWaitTimeoutMs,
@@ -142,6 +149,8 @@ class DrmDisplayCompositor {
void ApplyFrame(std::unique_ptr<DrmDisplayComposition> composition,
int status);
+ std::tuple<int, uint32_t> CreateModeBlob(const DrmMode &mode);
+
DrmResources *drm_;
int display_;
@@ -154,8 +163,7 @@ class DrmDisplayCompositor {
bool initialized_;
bool active_;
- DrmMode next_mode_;
- bool needs_modeset_;
+ ModeState mode_;
int framebuffer_index_;
DrmFramebuffer framebuffers_[DRM_DISPLAY_BUFFERS];