diff options
-rw-r--r-- | libhwc2.1/libdisplayinterface/ExynosDisplayDrmInterface.cpp | 27 | ||||
-rw-r--r-- | libhwc2.1/libdisplayinterface/ExynosDisplayDrmInterface.h | 12 | ||||
-rw-r--r-- | libhwc2.1/libdrmresource/.clang-format | 10 | ||||
-rw-r--r-- | libhwc2.1/libdrmresource/drm/drmdevice.cpp | 3 | ||||
-rw-r--r-- | libhwc2.1/libdrmresource/drm/drmplane.cpp | 27 | ||||
-rw-r--r-- | libhwc2.1/libdrmresource/include/drmdevice.h | 2 | ||||
-rw-r--r-- | libhwc2.1/libdrmresource/include/drmplane.h | 2 |
7 files changed, 70 insertions, 13 deletions
diff --git a/libhwc2.1/libdisplayinterface/ExynosDisplayDrmInterface.cpp b/libhwc2.1/libdisplayinterface/ExynosDisplayDrmInterface.cpp index a08de5d..ceb5386 100644 --- a/libhwc2.1/libdisplayinterface/ExynosDisplayDrmInterface.cpp +++ b/libhwc2.1/libdisplayinterface/ExynosDisplayDrmInterface.cpp @@ -1469,6 +1469,33 @@ int32_t ExynosDisplayDrmInterface::setupCommitFromDisplayConfig( return ret; } + if (config.state == config.WIN_STATE_RCD) { + if (plane->block_property().id()) { + if (mBlockState != config.block_area) { + uint32_t blobId = 0; + ret = mDrmDevice->CreatePropertyBlob(&config.block_area, sizeof(config.block_area), + &blobId); + if (ret || (blobId == 0)) { + HWC_LOGE(mExynosDisplay, "Failed to create blocking region blob id=%d, ret=%d", + blobId, ret); + return ret; + } + + mBlockState.mRegion = config.block_area; + if (mBlockState.mBlobId) { + drmReq.addOldBlob(mBlockState.mBlobId); + } + mBlockState.mBlobId = blobId; + } + + if ((ret = drmReq.atomicAddProperty(plane->id(), plane->block_property(), + mBlockState.mBlobId)) < 0) { + HWC_LOGE(mExynosDisplay, "Failed to set blocking region property %d", ret); + return ret; + } + } + } + return NO_ERROR; } diff --git a/libhwc2.1/libdisplayinterface/ExynosDisplayDrmInterface.h b/libhwc2.1/libdisplayinterface/ExynosDisplayDrmInterface.h index 71ecbd3..28ef6cc 100644 --- a/libhwc2.1/libdisplayinterface/ExynosDisplayDrmInterface.h +++ b/libhwc2.1/libdisplayinterface/ExynosDisplayDrmInterface.h @@ -376,6 +376,17 @@ class ExynosDisplayDrmInterface : }; }; + struct BlockingRegionState { + struct decon_win_rect mRegion; + uint32_t mBlobId = 0; + + inline bool operator==(const decon_win_rect &rhs) const { + return mRegion.x == rhs.x && mRegion.y == rhs.y && mRegion.w == rhs.w && + mRegion.h == rhs.h; + } + inline bool operator!=(const decon_win_rect &rhs) const { return !(*this == rhs); } + }; + class DrmReadbackInfo { public: void init(DrmDevice *drmDevice, uint32_t displayId); @@ -414,6 +425,7 @@ class ExynosDisplayDrmInterface : ModeState mActiveModeState; ModeState mDesiredModeState; PartialRegionState mPartialRegionState; + BlockingRegionState mBlockState; /* Mapping plane id to ExynosMPP, key is plane id */ std::unordered_map<uint32_t, ExynosMPP*> mExynosMPPsForPlane; diff --git a/libhwc2.1/libdrmresource/.clang-format b/libhwc2.1/libdrmresource/.clang-format new file mode 100644 index 0000000..d42555c --- /dev/null +++ b/libhwc2.1/libdrmresource/.clang-format @@ -0,0 +1,10 @@ +BasedOnStyle: Google + +AlignOperands: false +AllowShortFunctionsOnASingleLine: Inline +AllowShortIfStatementsOnASingleLine: Never +AlwaysBreakBeforeMultilineStrings: false +ColumnLimit: 100 +CommentPragmas: NOLINT:.* +PenaltyBreakBeforeFirstCallParameter: 100000 +SpacesBeforeTrailingComments: 1 diff --git a/libhwc2.1/libdrmresource/drm/drmdevice.cpp b/libhwc2.1/libdrmresource/drm/drmdevice.cpp index 3312496..3da8b36 100644 --- a/libhwc2.1/libdrmresource/drm/drmdevice.cpp +++ b/libhwc2.1/libdrmresource/drm/drmdevice.cpp @@ -436,8 +436,7 @@ int DrmDevice::AttachWriteback(DrmConnector *display_conn) { return -EINVAL; } -int DrmDevice::CreatePropertyBlob(void *data, size_t length, - uint32_t *blob_id) { +int DrmDevice::CreatePropertyBlob(const void *data, size_t length, uint32_t *blob_id) { struct drm_mode_create_blob create_blob; memset(&create_blob, 0, sizeof(create_blob)); create_blob.length = length; diff --git a/libhwc2.1/libdrmresource/drm/drmplane.cpp b/libhwc2.1/libdrmresource/drm/drmplane.cpp index b3ad507..04161be 100644 --- a/libhwc2.1/libdrmresource/drm/drmplane.cpp +++ b/libhwc2.1/libdrmresource/drm/drmplane.cpp @@ -17,14 +17,15 @@ #define LOG_TAG "hwc-drm-plane" #include "drmplane.h" -#include "drmdevice.h" #include <errno.h> +#include <log/log.h> #include <stdint.h> +#include <xf86drmMode.h> + #include <cinttypes> -#include <log/log.h> -#include <xf86drmMode.h> +#include "drmdevice.h" namespace android { @@ -166,16 +167,17 @@ int DrmPlane::Init() { ALOGI("Could not get hw restrictions property"); if (drm_->GetPlaneProperty(*this, "eotf_lut", &eotf_lut_)) - ALOGI("Could not get eotf_lut property"); + ALOGI("Could not get eotf_lut property"); if (drm_->GetPlaneProperty(*this, "oetf_lut", &oetf_lut_)) - ALOGI("Could not get oetf_lut property"); + ALOGI("Could not get oetf_lut property"); if (drm_->GetPlaneProperty(*this, "gammut_matrix", &gammut_matrix_)) - ALOGI("Could not get gammut_matrix property"); + ALOGI("Could not get gammut_matrix property"); if (drm_->GetPlaneProperty(*this, "tone_mapping", &tone_mapping_)) - ALOGI("Could not get tone_mapping property"); - + ALOGI("Could not get tone_mapping property"); if (drm_->GetPlaneProperty(*this, "colormap", &colormap_)) - ALOGI("Could not get colormap property"); + ALOGI("Could not get colormap property"); + if (drm_->GetPlaneProperty(*this, "block", &block_)) + ALOGI("Could not get block property"); properties_.push_back(&crtc_property_); properties_.push_back(&fb_property_); @@ -203,6 +205,7 @@ int DrmPlane::Init() { properties_.push_back(&gammut_matrix_); properties_.push_back(&tone_mapping_); properties_.push_back(&colormap_); + properties_.push_back(&block_); return 0; } @@ -331,4 +334,8 @@ const DrmProperty &DrmPlane::colormap_property() const { return colormap_; } -} // namespace android +const DrmProperty &DrmPlane::block_property() const { + return block_; +} + +} // namespace android diff --git a/libhwc2.1/libdrmresource/include/drmdevice.h b/libhwc2.1/libdrmresource/include/drmdevice.h index 641ccb6..d3cf066 100644 --- a/libhwc2.1/libdrmresource/include/drmdevice.h +++ b/libhwc2.1/libdrmresource/include/drmdevice.h @@ -75,7 +75,7 @@ class DrmDevice { const std::vector<std::unique_ptr<DrmCrtc>> &crtcs() const; uint32_t next_mode_id(); - int CreatePropertyBlob(void *data, size_t length, uint32_t *blob_id); + int CreatePropertyBlob(const void *data, size_t length, uint32_t *blob_id); int DestroyPropertyBlob(uint32_t blob_id); bool HandlesDisplay(int display) const; void RegisterHotplugHandler(DrmEventHandler *handler) { diff --git a/libhwc2.1/libdrmresource/include/drmplane.h b/libhwc2.1/libdrmresource/include/drmplane.h index 5c7501b..8dab6ef 100644 --- a/libhwc2.1/libdrmresource/include/drmplane.h +++ b/libhwc2.1/libdrmresource/include/drmplane.h @@ -71,6 +71,7 @@ class DrmPlane { const DrmProperty &gammut_matrix_property() const; const DrmProperty &tone_mapping_property() const; const DrmProperty &colormap_property() const; + const DrmProperty &block_property() const; const std::vector<DrmProperty *> &properties() const { return properties_; @@ -113,6 +114,7 @@ class DrmPlane { DrmProperty gammut_matrix_; DrmProperty tone_mapping_; DrmProperty colormap_; + DrmProperty block_; std::vector<DrmProperty *> properties_; std::vector<uint32_t> formats_; |