diff --git a/hwc2_device/HwcLayer.cpp b/hwc2_device/HwcLayer.cpp index d2b03687..6190ebe9 100644 --- a/hwc2_device/HwcLayer.cpp +++ b/hwc2_device/HwcLayer.cpp @@ -272,6 +272,7 @@ static bool InitializeBlitter(BufferInfo &bi) { } void HwcLayer::ImportFb() { + FILE * fBlit; if (!IsLayerUsableAsDevice() || !buffer_handle_updated_) { return; } @@ -301,10 +302,14 @@ void HwcLayer::ImportFb() { is_pixel_blend_mode_supported = false; int kms_fd = parent_->GetPipe().device->GetFd(); - bool use_shadow_fds = parent_->GetPipe().device->GetName() == "virtio_gpu" && + + fBlit = fopen("/vendor/etc/dgpu-blit.cfg", "r"); + bool use_shadow_fds = fBlit && parent_->GetPipe().device->GetName() == "virtio_gpu" && !allow_p2p_ && (intel_dgpu_fd() >= 0) && !virtio_gpu_allow_p2p(kms_fd) && InitializeBlitter(layer_data_.bi.value()); layer_data_.bi->use_shadow_fds = use_shadow_fds; + if (fBlit) + fclose(fBlit); if (allow_p2p_) { for (int fd: layer_data_.bi->prime_fds) {