diff options
author | Leo Chen <yinchiuan@google.com> | 2023-08-15 06:26:06 +0000 |
---|---|---|
committer | Leo Chen <yinchiuan@google.com> | 2023-08-23 06:56:00 +0000 |
commit | 2ccf04c16d30086931e02220fd24ed38f341c181 (patch) | |
tree | cc4e1cce22196439a899ff4355007df9afb5efaa | |
parent | 573d3753c867db7d06cc6df42fcdd4678c2baa36 (diff) | |
download | zuma-2ccf04c16d30086931e02220fd24ed38f341c181.tar.gz |
libhwc2.1: libdisplayinterface: override sendHistogramChannelIoctl
If control is REQUEST, call histogram_channel_request_ioctl which
creates the drm event to request the histogram data.
If control is CANCEL, call histogram_channel_cancel_ioctl which
frees the drm event to cancel the histogram data request.
Bug: 255986866
Bug: 227384721
Test: use aidl_hist_client to test multi channel histogram
Change-Id: I2d87aa7e92128ac0430ae12ad3a913fc4db960b4
Signed-off-by: Leo Chen <yinchiuan@google.com>
-rw-r--r-- | libhwc2.1/libdisplayinterface/ExynosDisplayDrmInterfaceModule.cpp | 23 | ||||
-rw-r--r-- | libhwc2.1/libdisplayinterface/ExynosDisplayDrmInterfaceModule.h | 12 |
2 files changed, 32 insertions, 3 deletions
diff --git a/libhwc2.1/libdisplayinterface/ExynosDisplayDrmInterfaceModule.cpp b/libhwc2.1/libdisplayinterface/ExynosDisplayDrmInterfaceModule.cpp index 1973006..83fc581 100644 --- a/libhwc2.1/libdisplayinterface/ExynosDisplayDrmInterfaceModule.cpp +++ b/libhwc2.1/libdisplayinterface/ExynosDisplayDrmInterfaceModule.cpp @@ -51,3 +51,26 @@ ExynosPrimaryDisplayDrmInterfaceModule::ExynosPrimaryDisplayDrmInterfaceModule(E std::memcpy(mMonitorDescription.data(), panelModel.c_str(), mMonitorDescription.size()); } + +// TODO: b/295990513 - Remove the if defined after kernel prebuilts are merged. +#if defined(EXYNOS_HISTOGRAM_CHANNEL_REQUEST) +int32_t ExynosPrimaryDisplayDrmInterfaceModule::sendHistogramChannelIoctl(HistogramChannelIoctl_t control, uint8_t channelId) const { + struct exynos_drm_histogram_channel_request histogramRequest; + + histogramRequest.crtc_id = mDrmCrtc->id(); + histogramRequest.hist_id = channelId; + + if (control == HistogramChannelIoctl_t::REQUEST) { + ATRACE_NAME(String8::format("requestIoctl #%u", channelId).string()); + return mDrmDevice->CallVendorIoctl(DRM_IOCTL_EXYNOS_HISTOGRAM_CHANNEL_REQUEST, + (void *)&histogramRequest); + } else if (control == HistogramChannelIoctl_t::CANCEL) { + ATRACE_NAME(String8::format("cancelIoctl #%u", channelId).string()); + return mDrmDevice->CallVendorIoctl(DRM_IOCTL_EXYNOS_HISTOGRAM_CHANNEL_CANCEL, + (void *)&histogramRequest); + } else { + ALOGE("%s: unknown control %d", __func__, (int)control); + return BAD_VALUE; + } +} +#endif diff --git a/libhwc2.1/libdisplayinterface/ExynosDisplayDrmInterfaceModule.h b/libhwc2.1/libdisplayinterface/ExynosDisplayDrmInterfaceModule.h index 45783b1..f654d4b 100644 --- a/libhwc2.1/libdisplayinterface/ExynosDisplayDrmInterfaceModule.h +++ b/libhwc2.1/libdisplayinterface/ExynosDisplayDrmInterfaceModule.h @@ -23,10 +23,16 @@ namespace zuma { - class ExynosPrimaryDisplayDrmInterfaceModule : public gs201::ExynosPrimaryDisplayDrmInterfaceModule { +class ExynosPrimaryDisplayDrmInterfaceModule + : public gs201::ExynosPrimaryDisplayDrmInterfaceModule { public: - ExynosPrimaryDisplayDrmInterfaceModule(ExynosDisplay *exynosDisplay); - }; + ExynosPrimaryDisplayDrmInterfaceModule(ExynosDisplay *exynosDisplay); +// TODO: b/295990513 - Remove the if defined after kernel prebuilts are merged. +#if defined(EXYNOS_HISTOGRAM_CHANNEL_REQUEST) + virtual int32_t sendHistogramChannelIoctl(HistogramChannelIoctl_t control, + uint8_t channelId) const override; +#endif +}; using ExynosExternalDisplayDrmInterfaceModule = gs201::ExynosExternalDisplayDrmInterfaceModule; |