1d39a514dd0540cf47e121775a77e9ac1b578bdb1Ben Fennema/*
2d39a514dd0540cf47e121775a77e9ac1b578bdb1Ben Fennema* Copyright (c) 2017, The Linux Foundation. All rights reserved.
3d39a514dd0540cf47e121775a77e9ac1b578bdb1Ben Fennema*
4d39a514dd0540cf47e121775a77e9ac1b578bdb1Ben Fennema* Redistribution and use in source and binary forms, with or without
5d39a514dd0540cf47e121775a77e9ac1b578bdb1Ben Fennema* modification, are permitted provided that the following conditions are
6d39a514dd0540cf47e121775a77e9ac1b578bdb1Ben Fennema* met:
7d39a514dd0540cf47e121775a77e9ac1b578bdb1Ben Fennema*     * Redistributions of source code must retain the above copyright
8d39a514dd0540cf47e121775a77e9ac1b578bdb1Ben Fennema*       notice, this list of conditions and the following disclaimer.
9d39a514dd0540cf47e121775a77e9ac1b578bdb1Ben Fennema*     * Redistributions in binary form must reproduce the above
10d39a514dd0540cf47e121775a77e9ac1b578bdb1Ben Fennema*       copyright notice, this list of conditions and the following
11d39a514dd0540cf47e121775a77e9ac1b578bdb1Ben Fennema*       disclaimer in the documentation and/or other materials provided
12d39a514dd0540cf47e121775a77e9ac1b578bdb1Ben Fennema*       with the distribution.
13d39a514dd0540cf47e121775a77e9ac1b578bdb1Ben Fennema*     * Neither the name of The Linux Foundation nor the names of its
14d39a514dd0540cf47e121775a77e9ac1b578bdb1Ben Fennema*       contributors may be used to endorse or promote products derived
15d39a514dd0540cf47e121775a77e9ac1b578bdb1Ben Fennema*       from this software without specific prior written permission.
16d39a514dd0540cf47e121775a77e9ac1b578bdb1Ben Fennema*
17d39a514dd0540cf47e121775a77e9ac1b578bdb1Ben Fennema* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
18d39a514dd0540cf47e121775a77e9ac1b578bdb1Ben Fennema* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
19d39a514dd0540cf47e121775a77e9ac1b578bdb1Ben Fennema* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
20d39a514dd0540cf47e121775a77e9ac1b578bdb1Ben Fennema* ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
21d39a514dd0540cf47e121775a77e9ac1b578bdb1Ben Fennema* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22d39a514dd0540cf47e121775a77e9ac1b578bdb1Ben Fennema* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23d39a514dd0540cf47e121775a77e9ac1b578bdb1Ben Fennema* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
24d39a514dd0540cf47e121775a77e9ac1b578bdb1Ben Fennema* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
25d39a514dd0540cf47e121775a77e9ac1b578bdb1Ben Fennema* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
26d39a514dd0540cf47e121775a77e9ac1b578bdb1Ben Fennema* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
27d39a514dd0540cf47e121775a77e9ac1b578bdb1Ben Fennema* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28d39a514dd0540cf47e121775a77e9ac1b578bdb1Ben Fennema*/
29d39a514dd0540cf47e121775a77e9ac1b578bdb1Ben Fennema
30d39a514dd0540cf47e121775a77e9ac1b578bdb1Ben Fennema#ifndef __HW_COLOR_MANAGER_DRM_H__
31d39a514dd0540cf47e121775a77e9ac1b578bdb1Ben Fennema#define __HW_COLOR_MANAGER_DRM_H__
32d39a514dd0540cf47e121775a77e9ac1b578bdb1Ben Fennema
33d39a514dd0540cf47e121775a77e9ac1b578bdb1Ben Fennema#include <drm_interface.h>
34d39a514dd0540cf47e121775a77e9ac1b578bdb1Ben Fennema#include <private/color_params.h>
35d39a514dd0540cf47e121775a77e9ac1b578bdb1Ben Fennema
36d39a514dd0540cf47e121775a77e9ac1b578bdb1Ben Fennemausing sde_drm::DRMPPFeatureID;
37d39a514dd0540cf47e121775a77e9ac1b578bdb1Ben Fennemausing sde_drm::DRMPPFeatureInfo;
38d39a514dd0540cf47e121775a77e9ac1b578bdb1Ben Fennema
39d39a514dd0540cf47e121775a77e9ac1b578bdb1Ben Fennemanamespace sdm {
40d39a514dd0540cf47e121775a77e9ac1b578bdb1Ben Fennema
41d39a514dd0540cf47e121775a77e9ac1b578bdb1Ben Fennemaclass HWColorManagerDrm {
42d39a514dd0540cf47e121775a77e9ac1b578bdb1Ben Fennema public:
43d39a514dd0540cf47e121775a77e9ac1b578bdb1Ben Fennema  static DisplayError (*GetDrmFeature[kMaxNumPPFeatures])(const PPFeatureInfo &in_data,
44d39a514dd0540cf47e121775a77e9ac1b578bdb1Ben Fennema                                                          DRMPPFeatureInfo *out_data);
45d39a514dd0540cf47e121775a77e9ac1b578bdb1Ben Fennema  static void FreeDrmFeatureData(DRMPPFeatureInfo *feature);
46d39a514dd0540cf47e121775a77e9ac1b578bdb1Ben Fennema  static uint32_t GetFeatureVersion(const DRMPPFeatureInfo &feature);
47d39a514dd0540cf47e121775a77e9ac1b578bdb1Ben Fennema  static DRMPPFeatureID ToDrmFeatureId(uint32_t id);
48d39a514dd0540cf47e121775a77e9ac1b578bdb1Ben Fennema protected:
49d39a514dd0540cf47e121775a77e9ac1b578bdb1Ben Fennema  HWColorManagerDrm() {}
50d39a514dd0540cf47e121775a77e9ac1b578bdb1Ben Fennema
51d39a514dd0540cf47e121775a77e9ac1b578bdb1Ben Fennema private:
52d39a514dd0540cf47e121775a77e9ac1b578bdb1Ben Fennema  static DisplayError GetDrmPCC(const PPFeatureInfo &in_data, DRMPPFeatureInfo *out_data);
53d39a514dd0540cf47e121775a77e9ac1b578bdb1Ben Fennema  static DisplayError GetDrmIGC(const PPFeatureInfo &in_data, DRMPPFeatureInfo *out_data);
54d39a514dd0540cf47e121775a77e9ac1b578bdb1Ben Fennema  static DisplayError GetDrmPGC(const PPFeatureInfo &in_data, DRMPPFeatureInfo *out_data);
55d39a514dd0540cf47e121775a77e9ac1b578bdb1Ben Fennema  static DisplayError GetDrmMixerGC(const PPFeatureInfo &in_data, DRMPPFeatureInfo *out_data);
56d39a514dd0540cf47e121775a77e9ac1b578bdb1Ben Fennema  static DisplayError GetDrmPAV2(const PPFeatureInfo &in_data, DRMPPFeatureInfo *out_data);
57d39a514dd0540cf47e121775a77e9ac1b578bdb1Ben Fennema  static DisplayError GetDrmDither(const PPFeatureInfo &in_data, DRMPPFeatureInfo *out_data);
58d39a514dd0540cf47e121775a77e9ac1b578bdb1Ben Fennema  static DisplayError GetDrmGamut(const PPFeatureInfo &in_data, DRMPPFeatureInfo *out_data);
59d39a514dd0540cf47e121775a77e9ac1b578bdb1Ben Fennema  static DisplayError GetDrmPADither(const PPFeatureInfo &in_data, DRMPPFeatureInfo *out_data);
60d39a514dd0540cf47e121775a77e9ac1b578bdb1Ben Fennema};
61d39a514dd0540cf47e121775a77e9ac1b578bdb1Ben Fennema
62d39a514dd0540cf47e121775a77e9ac1b578bdb1Ben Fennema}  // namespace sdm
63d39a514dd0540cf47e121775a77e9ac1b578bdb1Ben Fennema
64d39a514dd0540cf47e121775a77e9ac1b578bdb1Ben Fennema#endif  // __HW_COLOR_MANAGER_DRM_H__
65