summaryrefslogtreecommitdiff
path: root/libhwc2.1/libdisplayinterface
diff options
context:
space:
mode:
authorsusi_su <susisu@google.com>2022-02-21 22:17:15 +0800
committersusi_su <susisu@google.com>2022-05-15 22:35:04 +0800
commit731ff7b902ed160778f812f126288bef7dbba14f (patch)
tree8f87b968898044584141ba3e1803ae9270186c61 /libhwc2.1/libdisplayinterface
parent34b535a29513a95726dfd3991649eab5ba3846e4 (diff)
downloadgs101-731ff7b902ed160778f812f126288bef7dbba14f.tar.gz
libhwc3, libhwc2.1: refactor histogram data struct
To support common histogram interface call from HWC pixel-display aidl, refactor histogram data struct separate WHI-Pro dependent data struct into HistogramInfo.h & histogram_control.h respectively. Bug: 176922790 test: local test with a histogram client program Change-Id: I0466b00cc645faba2fc3e8a761754f2bee2f1c67
Diffstat (limited to 'libhwc2.1/libdisplayinterface')
-rw-r--r--libhwc2.1/libdisplayinterface/ExynosDisplayDrmInterfaceModule.cpp21
-rw-r--r--libhwc2.1/libdisplayinterface/ExynosDisplayDrmInterfaceModule.h10
2 files changed, 15 insertions, 16 deletions
diff --git a/libhwc2.1/libdisplayinterface/ExynosDisplayDrmInterfaceModule.cpp b/libhwc2.1/libdisplayinterface/ExynosDisplayDrmInterfaceModule.cpp
index b42edaa..2969eea 100644
--- a/libhwc2.1/libdisplayinterface/ExynosDisplayDrmInterfaceModule.cpp
+++ b/libhwc2.1/libdisplayinterface/ExynosDisplayDrmInterfaceModule.cpp
@@ -893,18 +893,16 @@ int32_t ExynosDisplayDrmInterfaceModule::setDisplayHistogramSetting(
return NO_ERROR;
}
-int32_t ExynosDisplayDrmInterfaceModule::setHistogramControl(int32_t control) {
+int32_t ExynosDisplayDrmInterfaceModule::setHistogramControl(hidl_histogram_control_t control) {
if ((mHistogramInfoRegistered == false) || (isPrimary() == false)) return NO_ERROR;
int ret = NO_ERROR;
uint32_t crtc_id = mDrmCrtc->id();
- if (control == HISTOGRAM_CONTROL_REQUEST) {
+ if (control == hidl_histogram_control_t::HISTOGRAM_CONTROL_REQUEST) {
ret = mDrmDevice->CallVendorIoctl(DRM_IOCTL_EXYNOS_HISTOGRAM_REQUEST, (void *)&crtc_id);
- ALOGD("Histogram Requested");
- } else if (control == HISTOGRAM_CONTROL_CANCEL) {
+ } else if (control == hidl_histogram_control_t::HISTOGRAM_CONTROL_CANCEL) {
ret = mDrmDevice->CallVendorIoctl(DRM_IOCTL_EXYNOS_HISTOGRAM_CANCEL, (void *)&crtc_id);
- ALOGD("Histogram Canceled");
}
return ret;
@@ -916,14 +914,15 @@ int32_t ExynosDisplayDrmInterfaceModule::setHistogramData(void *bin) {
/*
* There are two handling methods.
* For ContentSampling in HWC_2.3 API, histogram bin needs to be accumulated.
- * For Histogram HIDL, histogram bin need to be sent to HIDL block.
+ * For Histogram IDL, histogram bin need to be sent to IDL block.
*/
- if (mHistogramInfo->getHistogramType() == HistogramInfo::Histogram_Type::HISTOGRAM_HIDL) {
- static_cast<HIDLHistogram *>(mHistogramInfo.get())->CallbackHistogram(bin);
+ if (mHistogramInfo->getHistogramType() == HistogramInfo::HistogramType::HISTOGRAM_HIDL) {
+ (mHistogramInfo.get())->callbackHistogram((char16_t *)bin);
} else {
- /*
- * ContentSampling in HWC2.3 API is not supported
- */
+ /*
+ * ContentSampling in HWC2.3 API is not supported
+ */
+ return -ENOTSUP;
}
return NO_ERROR;
diff --git a/libhwc2.1/libdisplayinterface/ExynosDisplayDrmInterfaceModule.h b/libhwc2.1/libdisplayinterface/ExynosDisplayDrmInterfaceModule.h
index f2e826b..f783c5f 100644
--- a/libhwc2.1/libdisplayinterface/ExynosDisplayDrmInterfaceModule.h
+++ b/libhwc2.1/libdisplayinterface/ExynosDisplayDrmInterfaceModule.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2020 The Android Open Source Project
+ * Copyright (C) 2022 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.
@@ -18,7 +18,7 @@
#define EXYNOS_DISPLAY_DRM_INTERFACE_MODULE_H
#include <gs101/displaycolor/displaycolor_gs101.h>
-#include <gs101/histogram/histogram.h>
+#include <histogram/histogram.h>
#include "ExynosDisplayDrmInterface.h"
@@ -78,7 +78,7 @@ class ExynosDisplayDrmInterfaceModule : public ExynosDisplayDrmInterface {
virtual int32_t setDisplayHistogramSetting(
ExynosDisplayDrmInterface::DrmModeAtomicReq &drmReq);
- void registerHistogramInfo(HistogramInfo *info) {
+ virtual void registerHistogramInfo(IDLHistogram *info) {
if (info)
mHistogramInfo.reset(info);
else
@@ -89,7 +89,7 @@ class ExynosDisplayDrmInterfaceModule : public ExynosDisplayDrmInterface {
else
mHistogramInfoRegistered = false;
}
- int32_t setHistogramControl(int32_t enabled);
+ int32_t setHistogramControl(hidl_histogram_control_t enabled);
virtual int32_t setHistogramData(void *bin);
protected:
@@ -184,7 +184,7 @@ class ExynosDisplayDrmInterfaceModule : public ExynosDisplayDrmInterface {
ExynosDisplayDrmInterface::DrmModeAtomicReq &drmReq);
HistoBlobs mOldHistoBlobs;
- std::shared_ptr<HistogramInfo> mHistogramInfo;
+ std::shared_ptr<IDLHistogram> mHistogramInfo;
bool mHistogramInfoRegistered = false;
private: