Skip to content

Commit c5a0236

Browse files
committed
Use client composition for dGPU local memory layers
Tracked-On: OAM-132617 Signed-off-by: Weifeng Liu <[email protected]>
1 parent 803fa7f commit c5a0236

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

backend/Backend.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,9 @@ bool Backend::IsClientLayer(HwcDisplay *display, HwcLayer *layer) {
123123
!layer->IsLayerUsableAsDevice() ||
124124
display->color_transform_hint() != HAL_COLOR_TRANSFORM_IDENTITY ||
125125
(layer->GetLayerData().pi.RequireScalingOrPhasing() &&
126-
display->GetHwc2()->GetResMan().ForcedScalingWithGpu()) ||
127-
(!IsVideoLayer(layer) && IsDownScaling(layer)) ||
126+
display->GetHwc2()->GetResMan().ForcedScalingWithGpu()) ||
127+
(!IsVideoLayer(layer) && IsDownScaling(layer)) ||
128+
(has_local_memory_flag(layer->GetLayerData().bi->usage) && !layer->GetAllowP2P()) ||
128129
(!display->IsInHeadlessMode() && display->GetPipe().device->IsIvshmDev());
129130
}
130131

hwc2_device/HwcLayer.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ class HwcLayer {
6767
return layer_data_;
6868
}
6969

70+
bool GetAllowP2P() const {
71+
return allow_p2p_;
72+
}
7073
// Layer hooks
7174
HWC2::Error SetCursorPosition(int32_t /*x*/, int32_t /*y*/);
7275
HWC2::Error SetLayerBlendMode(int32_t mode);

0 commit comments

Comments
 (0)