Skip to content

Commit 6da601f

Browse files
committed
Don't use shadow buffer for system memory layers
There is no benefit at all to blit buffers that are already in local memory. Add a check to avoid the useless blit. Signed-off-by: Weifeng Liu <[email protected]>
1 parent e6aeda8 commit 6da601f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

hwc2_device/HwcLayer.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,8 @@ void HwcLayer::ImportFb() {
301301
is_pixel_blend_mode_supported = false;
302302

303303
int kms_fd = parent_->GetPipe().device->GetFd();
304-
bool use_shadow_fds = parent_->GetPipe().device->GetName() == "virtio_gpu" &&
304+
bool use_shadow_fds = has_local_memory_flag(layer_data_.bi->usage) &&
305+
parent_->GetPipe().device->GetName() == "virtio_gpu" &&
305306
!allow_p2p_ && (intel_dgpu_fd() >= 0) &&
306307
!virtio_gpu_allow_p2p(kms_fd) && InitializeBlitter(layer_data_.bi.value());
307308
layer_data_.bi->use_shadow_fds = use_shadow_fds;

0 commit comments

Comments
 (0)