Skip to content
This repository was archived by the owner on Oct 8, 2024. It is now read-only.

Commit 4d5d131

Browse files
committed
Fix bug for VPP compositon
1) overlay plane not universal can't be count as avail planes for video 2) VPP can't deal with solid color(no input buffer), drop solid color layer for temp solution 3) Video Planes don't have to only contain 1 layer(ResetLayers) Change-Id: Ie2b285598ea77bd1038b1dfe5d630cf7bf1aa816 Tracked-On: None Tests: Android video playback with UI composited by VPP path Signed-off-by: Lin Johnson <johnson.lin@intel.com>
1 parent 379fb5b commit 4d5d131

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

common/compositor/va/varenderer.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,8 @@ bool VARenderer::Draw(const MediaState& state, NativeSurface* surface) {
271271

272272
for (uint32_t i = 0; i < total_layers; i++) {
273273
layer_in = state.layers_.at(i);
274+
if (layer_in->IsSolidColor())
275+
continue;
274276
ScopedVABufferID& pipeline_buffer = pipeline_buffers.at(i);
275277
// Get Input Surface.
276278
OverlayBuffer* buffer_in = layer_in->GetBuffer();
@@ -374,7 +376,6 @@ bool VARenderer::Draw(const MediaState& state, NativeSurface* surface) {
374376
ret |= vaEndPicture(va_display_, va_context_);
375377

376378
surface->ResetDamage();
377-
378379
return ret == VA_STATUS_SUCCESS ? true : false;
379380
}
380381

common/display/displayplanemanager.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,12 @@ bool DisplayPlaneManager::ValidateLayers(
140140
if (layers[lindex].IsVideoLayer())
141141
video_layers++;
142142
}
143+
size_t avail_planes = overlay_planes_.size() - composition.size();
144+
if (!(overlay_planes_[overlay_planes_.size() - 1]->IsUniversal()))
145+
avail_planes--;
143146
// If video layers is more than available planes
144147
// We are going to force all the layers bo be composited by VA path
145-
if (video_layers >= overlay_planes_.size() - composition.size()) {
148+
if (video_layers >= avail_planes) {
146149
ForceVppForAllLayers(commit_planes, composition, layers, add_index,
147150
mark_later, false);
148151
*re_validation_needed = false;

common/display/displayplanestate.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,11 +210,12 @@ void DisplayPlaneState::ResetLayers(const std::vector<OverlayLayer> &layers,
210210

211211
*rects_updated = rect_updated;
212212

213+
if (has_video)
214+
private_data_->type_ = DisplayPlanePrivateState::PlaneType::kVideo;
215+
213216
if (private_data_->source_layers_.size() == 1) {
214217
if (private_data_->has_cursor_layer_) {
215218
private_data_->type_ = DisplayPlanePrivateState::PlaneType::kCursor;
216-
} else if (has_video) {
217-
private_data_->type_ = DisplayPlanePrivateState::PlaneType::kVideo;
218219
} else {
219220
private_data_->type_ = DisplayPlanePrivateState::PlaneType::kNormal;
220221
}

0 commit comments

Comments
 (0)