blob: 5060c8cdb1353ab89771785448e6116540d5d01d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
/*
* Copyright (C) 2021 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.
*/
#ifndef EXYNOS_DISPLAY_DRM_INTERFACE_MODULE_GS201_H
#define EXYNOS_DISPLAY_DRM_INTERFACE_MODULE_GS201_H
#include <drm/samsung_drm.h>
#include "../../gs101/libhwc2.1/libdisplayinterface/ExynosDisplayDrmInterfaceModule.h"
namespace gs201 {
using namespace displaycolor;
class ExynosDisplayDrmInterfaceModule : public gs101::ExynosDisplayDrmInterfaceModule {
static constexpr size_t sizeCgcDmaLut = 2 * 3 * DRM_SAMSUNG_CGC_DMA_LUT_ENTRY_CNT; // 16bit BGR
static constexpr int32_t disabledCgc = -1;
static constexpr size_t sizeCgCDataInfo = 2;
public:
ExynosDisplayDrmInterfaceModule(ExynosDisplay *exynosDisplay);
virtual ~ExynosDisplayDrmInterfaceModule();
virtual int32_t initDrmDevice(DrmDevice *drmDevice);
virtual int32_t setDisplayColorSetting(
ExynosDisplayDrmInterface::DrmModeAtomicReq &drmReq);
/* For Histogram */
virtual int32_t setDisplayHistogramSetting(
ExynosDisplayDrmInterface::DrmModeAtomicReq &drmReq) override;
virtual void registerHistogramInfo(const std::shared_ptr<IDLHistogram> &info) override;
private:
int32_t createCgcDMAFromIDqe(const IDisplayColorGS101::IDqe::CgcData &cgcData);
int32_t setCgcLutDmaProperty(const DrmProperty &prop,
ExynosDisplayDrmInterface::DrmModeAtomicReq &drmReq);
/* For Histogram */
int32_t setHistoPosProperty(
const DrmProperty &prop,
ExynosDisplayDrmInterface::DrmModeAtomicReq &drmReq);
bool mCgcEnabled = false;
using CGCDataInfo = std::pair<int32_t, struct cgc_dma_lut *>;
std::vector<CGCDataInfo> mCGCDataInfos;
size_t iCGCDataInfo = 0;
/* For Histogram */
std::shared_ptr<IDLHistogram> mHistogramInfo;
};
class ExynosPrimaryDisplayDrmInterfaceModule : public ExynosDisplayDrmInterfaceModule {
public:
ExynosPrimaryDisplayDrmInterfaceModule(ExynosDisplay *exynosDisplay);
virtual ~ExynosPrimaryDisplayDrmInterfaceModule();
};
using ExynosExternalDisplayDrmInterfaceModule = gs101::ExynosExternalDisplayDrmInterfaceModule;
} // namespace gs201
#endif // EXYNOS_DISPLAY_DRM_INTERFACE_MODULE_GS201_H
|