diff options
author | Demon000 <demonsingur@gmail.com> | 2020-05-21 01:40:04 +0300 |
---|---|---|
committer | Arian <arian.kulmer@web.de> | 2021-11-30 18:32:12 +0100 |
commit | 67aa63a9a78bfe7ee2f10e78c986ed94fb8c0139 (patch) | |
tree | 3c161dfda543f7c0c31b790aaf37517ac400c8f9 | |
parent | 0772004a58d81182606039e3dca677eda3acb48e (diff) |
sdm: mark FOD pressed layer by setting a bit on ZPOS
Change-Id: Ie1503da41766c31c9ec31bbb4282ae9ed62defce
-rw-r--r-- | sdm/include/core/layer_stack.h | 13 | ||||
-rw-r--r-- | sdm/libs/core/Android.mk | 4 | ||||
-rw-r--r-- | sdm/libs/core/drm/hw_device_drm.cpp | 8 | ||||
-rw-r--r-- | sdm/libs/hwc2/Android.mk | 4 | ||||
-rw-r--r-- | sdm/libs/hwc2/hwc_display.cpp | 6 | ||||
-rw-r--r-- | sdm/libs/hwc2/hwc_layers.cpp | 7 | ||||
-rw-r--r-- | sdm/libs/hwc2/hwc_layers.h | 6 |
7 files changed, 47 insertions, 1 deletions
diff --git a/sdm/include/core/layer_stack.h b/sdm/include/core/layer_stack.h index 4f075adc..294f7242 100644 --- a/sdm/include/core/layer_stack.h +++ b/sdm/include/core/layer_stack.h @@ -43,6 +43,10 @@ #include "layer_buffer.h" #include "sdm_types.h" +#ifdef FOD_ZPOS +#include <drm/sde_drm.h> +#endif + namespace sdm { /*! @brief This enum represents display layer blending types. @@ -191,6 +195,14 @@ struct LayerFlags { uint32_t sde_preferred : 1; //! This flag shall be set by client to indicate that this layer //! will be composed by display device, layer with this flag //! will have highest priority. To be used by OEMs only. + +#ifdef FOD_ZPOS + uint32_t reserved : 25; //!< This flag reserves the remaining 4 * 8 - (6 + 1) bits to + //!< avoid future ABI breakage + + uint32_t fod_pressed : 1; //!< This flag shall be set internally to mark the fod pressed + //!< layer +#endif }; uint32_t flags = 0; //!< For initialization purpose only. @@ -460,4 +472,3 @@ struct LayerStack { } // namespace sdm #endif // __LAYER_STACK_H__ - diff --git a/sdm/libs/core/Android.mk b/sdm/libs/core/Android.mk index c934de06..8f6cb237 100644 --- a/sdm/libs/core/Android.mk +++ b/sdm/libs/core/Android.mk @@ -26,6 +26,10 @@ ifeq ($(ENABLE_HYP),true) LOCAL_CFLAGS += -DHYPERVISOR endif +ifeq ($(TARGET_USES_FOD_ZPOS), true) + LOCAL_CFLAGS += -DFOD_ZPOS +endif + LOCAL_ADDITIONAL_DEPENDENCIES := $(common_deps) LOCAL_SRC_FILES := core_interface.cpp \ core_impl.cpp \ diff --git a/sdm/libs/core/drm/hw_device_drm.cpp b/sdm/libs/core/drm/hw_device_drm.cpp index d1b6ae3f..25b349e4 100644 --- a/sdm/libs/core/drm/hw_device_drm.cpp +++ b/sdm/libs/core/drm/hw_device_drm.cpp @@ -1175,7 +1175,15 @@ void HWDeviceDRM::SetupAtomic(HWLayers *hw_layers, bool validate) { if (update_config) { drm_atomic_intf_->Perform(DRMOps::PLANE_SET_ALPHA, pipe_id, layer.plane_alpha); +#ifdef FOD_ZPOS + uint32_t z_order = pipe_info->z_order; + if (layer.flags.fod_pressed) { + z_order |= FOD_PRESSED_LAYER_ZORDER; + } + drm_atomic_intf_->Perform(DRMOps::PLANE_SET_ZORDER, pipe_id, z_order); +#else drm_atomic_intf_->Perform(DRMOps::PLANE_SET_ZORDER, pipe_id, pipe_info->z_order); +#endif DRMBlendType blending = {}; SetBlending(layer.blending, &blending); diff --git a/sdm/libs/hwc2/Android.mk b/sdm/libs/hwc2/Android.mk index bdaeeb23..c291d727 100644 --- a/sdm/libs/hwc2/Android.mk +++ b/sdm/libs/hwc2/Android.mk @@ -48,6 +48,10 @@ ifeq ($(TARGET_BOARD_AUTO), true) LOCAL_CFLAGS += -DCONFIG_BASEID_FROM_PROP endif +ifeq ($(TARGET_USES_FOD_ZPOS), true) +LOCAL_CFLAGS += -DFOD_ZPOS +endif + LOCAL_SRC_FILES := hwc_session.cpp \ hwc_session_services.cpp \ hwc_display.cpp \ diff --git a/sdm/libs/hwc2/hwc_display.cpp b/sdm/libs/hwc2/hwc_display.cpp index 937c0a78..51d8dae5 100644 --- a/sdm/libs/hwc2/hwc_display.cpp +++ b/sdm/libs/hwc2/hwc_display.cpp @@ -675,6 +675,12 @@ void HWCDisplay::BuildLayerStack() { layer->flags.solid_fill = true; } +#ifdef FOD_ZPOS + if (hwc_layer->IsFodPressed()) { + layer->flags.fod_pressed = true; + } +#endif + if (!hwc_layer->IsDataSpaceSupported()) { layer->flags.skip = true; } diff --git a/sdm/libs/hwc2/hwc_layers.cpp b/sdm/libs/hwc2/hwc_layers.cpp index ecc18028..60a225dc 100644 --- a/sdm/libs/hwc2/hwc_layers.cpp +++ b/sdm/libs/hwc2/hwc_layers.cpp @@ -543,6 +543,13 @@ HWC2::Error HWCLayer::SetLayerVisibleRegion(hwc_region_t visible) { HWC2::Error HWCLayer::SetLayerZOrder(uint32_t z) { if (z_ != z) { +#ifdef FOD_ZPOS + if (z & FOD_PRESSED_LAYER_ZORDER) { + fod_pressed_ = true; + z &= ~FOD_PRESSED_LAYER_ZORDER; + } +#endif + geometry_changes_ |= kZOrder; z_ = z; } diff --git a/sdm/libs/hwc2/hwc_layers.h b/sdm/libs/hwc2/hwc_layers.h index f6e9d718..0effbb93 100644 --- a/sdm/libs/hwc2/hwc_layers.h +++ b/sdm/libs/hwc2/hwc_layers.h @@ -119,6 +119,9 @@ class HWCLayer { void SetLayerAsMask(); bool BufferLatched() { return buffer_flipped_; } void ResetBufferFlip() { buffer_flipped_ = false; } +#ifdef FOD_ZPOS + bool IsFodPressed() { return fod_pressed_; } +#endif private: Layer *layer_ = nullptr; @@ -139,6 +142,9 @@ class HWCLayer { bool non_integral_source_crop_ = false; bool has_metadata_refresh_rate_ = false; bool buffer_flipped_ = false; +#ifdef FOD_ZPOS + bool fod_pressed_ = false; +#endif // Composition requested by client(SF) Original HWC2::Composition client_requested_orig_ = HWC2::Composition::Device; |