Commit ec39fc48 authored by Andrii Chepurnyi's avatar Andrii Chepurnyi
Browse files

drm_hwcomposer: Add ability to skip HWC composition



On some systems with a single DRM plane,
the composition will be created using a non-DRM
module(like some blitter/OpenGL). Add property
option hwc.drm.skip_composition to skip all composition
logic from drm_hwcomposer.

Signed-off-by: Andrii Chepurnyi's avatarAndrii Chepurnyi <andrii_chepurnyi@epam.com>
parent 2619aabb
Pipeline #177679 passed with stage
in 47 seconds
......@@ -896,6 +896,15 @@ void DrmHwcTwo::HwcDisplay::MarkValidated(
}
}
HWC2::Error DrmHwcTwo::HwcDisplay::SkipHwcComposition(
uint32_t *num_types, uint32_t * /*num_requests*/) {
for (std::pair<const hwc2_layer_t, DrmHwcTwo::HwcLayer> &l : layers_) {
l.second.set_validated_type(HWC2::Composition::Client);
++*num_types;
}
return HWC2::Error::HasChanges;
}
HWC2::Error DrmHwcTwo::HwcDisplay::ValidateDisplay(uint32_t *num_types,
uint32_t *num_requests) {
supported(__func__);
......@@ -1383,10 +1392,21 @@ hwc2_function_pointer_t DrmHwcTwo::HookDevGetFunction(
return ToHook<HWC2_PFN_SET_VSYNC_ENABLED>(
DisplayHook<decltype(&HwcDisplay::SetVsyncEnabled),
&HwcDisplay::SetVsyncEnabled, int32_t>);
case HWC2::FunctionDescriptor::ValidateDisplay:
return ToHook<HWC2_PFN_VALIDATE_DISPLAY>(
DisplayHook<decltype(&HwcDisplay::ValidateDisplay),
&HwcDisplay::ValidateDisplay, uint32_t *, uint32_t *>);
case HWC2::FunctionDescriptor::ValidateDisplay: {
bool skipComposition = property_get_bool("hwc.drm.skip_composition",
false);
auto
ret = (skipComposition)
? ToHook<HWC2_PFN_VALIDATE_DISPLAY>(
DisplayHook<decltype(&HwcDisplay::SkipHwcComposition),
&HwcDisplay::SkipHwcComposition,
uint32_t *, uint32_t *>)
: ToHook<HWC2_PFN_VALIDATE_DISPLAY>(
DisplayHook<decltype(&HwcDisplay::ValidateDisplay),
&HwcDisplay::ValidateDisplay, uint32_t *,
uint32_t *>);
return ret;
}
#if PLATFORM_SDK_VERSION > 27
case HWC2::FunctionDescriptor::GetRenderIntents:
return ToHook<HWC2_PFN_GET_RENDER_INTENTS>(
......
......@@ -222,6 +222,7 @@ class DrmHwcTwo : public hwc2_device_t {
HWC2::Error SetPowerMode(int32_t mode);
HWC2::Error SetVsyncEnabled(int32_t enabled);
HWC2::Error ValidateDisplay(uint32_t *num_types, uint32_t *num_requests);
HWC2::Error SkipHwcComposition(uint32_t *num_types, uint32_t *num_requests);
HwcLayer *get_layer(hwc2_layer_t layer) {
auto it = layers_.find(layer);
if (it == layers_.end())
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment