hwc2: Fix the non-secure WriteBack output use case
If Output buffer of Virtual Display is non-secure, set SKIP flag on the
secure layers because if SDE H/W access the non-secure WriteBack output
buffer from secure context, it will result in SMMU fault.
CRs-Fixed: 2115027
Change-Id: I9577f244b62a987cab99168b756ac6f6ff379ba6
diff --git a/sdm/libs/hwc2/hwc_display_virtual.cpp b/sdm/libs/hwc2/hwc_display_virtual.cpp
index 8837ad0..9cefa49 100644
--- a/sdm/libs/hwc2/hwc_display_virtual.cpp
+++ b/sdm/libs/hwc2/hwc_display_virtual.cpp
@@ -123,6 +123,16 @@
BuildLayerStack();
layer_stack_.output_buffer = output_buffer_;
+ // If Output buffer of Virtual Display is not secure, set SKIP flag on the secure layers.
+ if (output_buffer_ && !output_buffer_->flags.secure && layer_stack_.flags.secure_present) {
+ for (auto hwc_layer : layer_set_) {
+ Layer *layer = hwc_layer->GetSDMLayer();
+ if (layer->input_buffer.flags.secure) {
+ layer_stack_.flags.skip_present = true;
+ layer->flags.skip = true;
+ }
+ }
+ }
status = PrepareLayerStack(out_num_types, out_num_requests);
return status;
}