diff options
author | Jeremy DeHaan <jdehaan@google.com> | 2023-03-10 18:18:28 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2023-03-10 18:18:28 +0000 |
commit | 3cbddb096bff57077e48c9aff9cf750f2d723aeb (patch) | |
tree | 1ff2ee76e843d30dfacf6d17259b83a2f0476008 | |
parent | 9e588bfddf124fbc643e5d07236315f6341ca930 (diff) | |
parent | bb704f51b9d940d11d2ded217e2c3640006b1dc4 (diff) | |
download | zuma-3cbddb096bff57077e48c9aff9cf750f2d723aeb.tar.gz |
Merge "libhwc2.1: use panel model in EDID" into udc-dev am: bb704f51b9
Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/google/graphics/zuma/+/21778959
Change-Id: I54baf96d2fc47e8db97f53313aa485d7178e4669
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r-- | libhwc2.1/Android.mk | 1 | ||||
-rw-r--r-- | libhwc2.1/libdisplayinterface/ExynosDisplayDrmInterfaceModule.cpp | 53 | ||||
-rw-r--r-- | libhwc2.1/libdisplayinterface/ExynosDisplayDrmInterfaceModule.h | 6 |
3 files changed, 59 insertions, 1 deletions
diff --git a/libhwc2.1/Android.mk b/libhwc2.1/Android.mk index 0c6d82d..a6b6fba 100644 --- a/libhwc2.1/Android.mk +++ b/libhwc2.1/Android.mk @@ -26,6 +26,7 @@ LOCAL_SRC_FILES += \ ../../gs101/libhwc2.1/libvirtualdisplay/ExynosVirtualDisplayModule.cpp \ ../../gs101/libhwc2.1/libdisplayinterface/ExynosDisplayDrmInterfaceModule.cpp \ ../../gs201/libhwc2.1/libdisplayinterface/ExynosDisplayDrmInterfaceModule.cpp \ + ../../zuma/libhwc2.1/libdisplayinterface/ExynosDisplayDrmInterfaceModule.cpp \ ../../zuma/libhwc2.1/libcolormanager/DisplayColorModule.cpp \ ../../zuma/libhwc2.1/libdevice/ExynosDeviceModule.cpp diff --git a/libhwc2.1/libdisplayinterface/ExynosDisplayDrmInterfaceModule.cpp b/libhwc2.1/libdisplayinterface/ExynosDisplayDrmInterfaceModule.cpp new file mode 100644 index 0000000..1973006 --- /dev/null +++ b/libhwc2.1/libdisplayinterface/ExynosDisplayDrmInterfaceModule.cpp @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "ExynosDisplayDrmInterfaceModule.h" +#include "ExynosPrimaryDisplayModule.h" + +using namespace zuma; + +//////////////////////////////////////////////////// ExynosPrimaryDisplayDrmInterfaceModule ////////////////////////////////////////////////////////////////// +ExynosPrimaryDisplayDrmInterfaceModule::ExynosPrimaryDisplayDrmInterfaceModule(ExynosDisplay *exynosDisplay) + : gs201::ExynosPrimaryDisplayDrmInterfaceModule(exynosDisplay) +{ + ExynosPrimaryDisplayModule* display = (ExynosPrimaryDisplayModule*)mExynosDisplay; + const std::string &sysfs = display->getPanelSysfsPath(display->getBuiltInDisplayType()); + std::string panelModel; + + if (sysfs.empty()) { + return; + } + + if (readLineFromFile(sysfs + "/panel_model", panelModel, '\n') != OK) { + return; + } + + /* + * VESA EDID Standard requires monitor descriptor data to terminate + * with '\n' character and to pad with ' ' characters if < 13 bytes. + */ + if (panelModel.size() < MONITOR_DESCRIPTOR_DATA_LENGTH) { + panelModel += '\n'; + panelModel.append(MONITOR_DESCRIPTOR_DATA_LENGTH - panelModel.size(), ' '); + } + + if (panelModel.size() > MONITOR_DESCRIPTOR_DATA_LENGTH) { + ALOGE("Panel model longer than maximum %u bytes", MONITOR_DESCRIPTOR_DATA_LENGTH); + return; + } + + std::memcpy(mMonitorDescription.data(), panelModel.c_str(), mMonitorDescription.size()); +} diff --git a/libhwc2.1/libdisplayinterface/ExynosDisplayDrmInterfaceModule.h b/libhwc2.1/libdisplayinterface/ExynosDisplayDrmInterfaceModule.h index 2232ce3..45783b1 100644 --- a/libhwc2.1/libdisplayinterface/ExynosDisplayDrmInterfaceModule.h +++ b/libhwc2.1/libdisplayinterface/ExynosDisplayDrmInterfaceModule.h @@ -23,7 +23,11 @@ namespace zuma { -using ExynosPrimaryDisplayDrmInterfaceModule = gs201::ExynosPrimaryDisplayDrmInterfaceModule; + class ExynosPrimaryDisplayDrmInterfaceModule : public gs201::ExynosPrimaryDisplayDrmInterfaceModule { +public: + ExynosPrimaryDisplayDrmInterfaceModule(ExynosDisplay *exynosDisplay); + }; + using ExynosExternalDisplayDrmInterfaceModule = gs201::ExynosExternalDisplayDrmInterfaceModule; } // namespace zuma |