author | sky zhou <sky.zhou@amlogic.com> | 2020-01-08 09:18:40 (GMT) |
---|---|---|
committer | sky zhou <sky.zhou@amlogic.com> | 2020-05-21 10:59:54 (GMT) |
commit | 2d9226612aeccc940692c85059cb95328d732419 (patch) | |
tree | ac07a5fce8df37869bbdc53e1ab3127a9e35ef46 | |
parent | 97e0d2961551e837db39c480b25592bcec4d57ba (diff) | |
download | hwcomposer-2d9226612aeccc940692c85059cb95328d732419.zip hwcomposer-2d9226612aeccc940692c85059cb95328d732419.tar.gz hwcomposer-2d9226612aeccc940692c85059cb95328d732419.tar.bz2 |
hwcomposer: fixedpipeline skip set null mode. [1/1]
PD#SWPL-19166
Problem:
systemcontrol & hwc set mode at same time.
Solution:
For fixedpipeline, still let sc to set mode.
For dualdisplay&keystone, keep it.
Verify:
verify on franklin
Change-Id: I7d230c749cacf22f38322ff11359ac990db13897
Signed-off-by: sky zhou <sky.zhou@amlogic.com>
-rw-r--r-- | common/display/HwDisplayCrtc.cpp | 45 | ||||
-rw-r--r-- | common/display/include/HwDisplayCrtc.h | 1 | ||||
-rw-r--r-- | common/hwc/FixedDisplayPipe.cpp | 3 |
3 files changed, 31 insertions, 18 deletions
diff --git a/common/display/HwDisplayCrtc.cpp b/common/display/HwDisplayCrtc.cpp index 75afc98..9b4108c 100644 --- a/common/display/HwDisplayCrtc.cpp +++ b/common/display/HwDisplayCrtc.cpp @@ -31,6 +31,7 @@ HwDisplayCrtc::HwDisplayCrtc(int drvFd, int32_t id) { mId = id; mDrvFd = drvFd; mFirstPresent = true; + mBinded = false; /*for old vpu, always one channel. *for new vpu, it can be 1 or 2. */ @@ -38,6 +39,7 @@ HwDisplayCrtc::HwDisplayCrtc(int drvFd, int32_t id) { memset(&nullHdr, 0, sizeof(nullHdr)); hdrVideoInfo = malloc(sizeof(vframe_master_display_colour_s_t)); + } HwDisplayCrtc::~HwDisplayCrtc() { @@ -47,26 +49,38 @@ HwDisplayCrtc::~HwDisplayCrtc() { int32_t HwDisplayCrtc::bind( std::shared_ptr<HwDisplayConnector> connector, std::vector<std::shared_ptr<HwDisplayPlane>> planes) { - MESON_ASSERT(connector != NULL && planes.size() > 0 , "crtc setup with invalid infos."); + if (mBinded) { + if (mConnector.get()) + mConnector->setCrtc(NULL); + mConnector.reset(); + mPlanes.clear(); + mBinded = false; + } + mConnector = connector; mConnector->setCrtc(this); mPlanes = planes; + mBinded = true; return 0; } int32_t HwDisplayCrtc::unbind() { - static drm_mode_info_t nullMode = { - DRM_DISPLAY_MODE_NULL, - 0, 0, - 0, 0, - 60.0 - }; - std::string dispmode(nullMode.name); - writeCurDisplayMode(dispmode); - if (mConnector.get()) - mConnector->setCrtc(NULL); - mConnector.reset(); - mPlanes.clear(); + if (mBinded) { + static drm_mode_info_t nullMode = { + DRM_DISPLAY_MODE_NULL, + 0, 0, + 0, 0, + 60.0 + }; + std::string dispmode(nullMode.name); + writeCurDisplayMode(dispmode); + if (mConnector.get()) + mConnector->setCrtc(NULL); + mConnector.reset(); + mPlanes.clear(); + + mBinded = false; + } return 0; } @@ -150,10 +164,7 @@ int32_t HwDisplayCrtc::update() { mId, displayMode.c_str(), mModes.size(), mCurModeInfo.name); } } else { - /*clear mode info.*/ - memset(&mCurModeInfo, 0, sizeof(mCurModeInfo)); - strcpy(mCurModeInfo.name, DRM_DISPLAY_MODE_NULL); - setMode(mCurModeInfo); + MESON_LOGD("crtc(%d) update with no connector", mId); } return 0; diff --git a/common/display/include/HwDisplayCrtc.h b/common/display/include/HwDisplayCrtc.h index f9c1260..db2efd7 100644 --- a/common/display/include/HwDisplayCrtc.h +++ b/common/display/include/HwDisplayCrtc.h @@ -83,6 +83,7 @@ protected: std::vector<std::shared_ptr<HwDisplayPlane>> mPlanes; void * hdrVideoInfo; + bool mBinded; std::mutex mMutex; }; diff --git a/common/hwc/FixedDisplayPipe.cpp b/common/hwc/FixedDisplayPipe.cpp index 3ce90c0..3302c88 100644 --- a/common/hwc/FixedDisplayPipe.cpp +++ b/common/hwc/FixedDisplayPipe.cpp @@ -42,9 +42,10 @@ void FixedDisplayPipe::handleEvent(drm_display_event event, int val) { MESON_LOGD("handleEvent DRM_EVENT_HDMITX_HOTPLUG %d VS %d", pipe->cfg.hwcConnectorType, targetConnector); if (pipe->cfg.hwcConnectorType != targetConnector) { - /*reset vout displaymode, it will be null.*/ + #if 0 /*TODO: for fixed pipe, let systemcontrol to set displaymode.*/ pipe->hwcCrtc->unbind(); pipe->modeCrtc->unbind(); + #endif /* we need latest connector status, and no one will update *connector not bind to crtc, we update here. */ |