blob: cda8efd91ee6f74d6734607cd8eca04c77406f46 [file] [log] [blame]
Saurabh Shah56f610d2012-08-07 15:27:06 -07001/*
2 * Copyright (C) 2010 The Android Open Source Project
Anjaneya Prasad Musunuriec710f72021-02-10 18:24:40 +05303 * Copyright (C) 2012-2014, 2016-2021 The Linux Foundation. All rights reserved.
Saurabh Shah56f610d2012-08-07 15:27:06 -07004 *
5 * Not a Contribution, Apache license notifications and license are
6 * retained for attribution purposes only.
7
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
11 *
12 * http://www.apache.org/licenses/LICENSE-2.0
13 *
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 */
20
Ajay Singh Parmar67481152022-05-27 14:09:25 -070021/*
22* Changes from Qualcomm Innovation Center are provided under the following license:
23*
24* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
25*
26* Redistribution and use in source and binary forms, with or without
27* modification, are permitted (subject to the limitations in the
28* disclaimer below) provided that the following conditions are met:
29*
30* * Redistributions of source code must retain the above copyright
31* notice, this list of conditions and the following disclaimer.
32*
33* * Redistributions in binary form must reproduce the above
34* copyright notice, this list of conditions and the following
35* disclaimer in the documentation and/or other materials provided
36* with the distribution.
37*
38* * Neither the name of Qualcomm Innovation Center, Inc. nor the names of its
39* contributors may be used to endorse or promote products derived
40* from this software without specific prior written permission.
41*
42* NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
43* GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
44* HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
45* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
46* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
47* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
48* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
49* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
50* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
51* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
52* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
53* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
54* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
55*/
56
Saurabh Shah56f610d2012-08-07 15:27:06 -070057#ifndef ANDROID_IQSERVICE_H
58#define ANDROID_IQSERVICE_H
59
60#include <stdint.h>
61#include <sys/types.h>
62#include <utils/Errors.h>
63#include <utils/RefBase.h>
64#include <binder/IInterface.h>
Saurabh Shah86c17292013-02-08 15:24:13 -080065#include <binder/IBinder.h>
66#include <IQClient.h>
Naseer Ahmed7a7b66d2014-07-23 17:56:26 -040067#include <IQHDMIClient.h>
Saurabh Shah56f610d2012-08-07 15:27:06 -070068
Naseer Ahmed4957c522013-11-12 18:07:15 -050069
Saurabh Shah56f610d2012-08-07 15:27:06 -070070namespace qService {
71// ----------------------------------------------------------------------------
Naseer Ahmed4957c522013-11-12 18:07:15 -050072
Saurabh Shah56f610d2012-08-07 15:27:06 -070073class IQService : public android::IInterface
74{
75public:
76 DECLARE_META_INTERFACE(QService);
77 enum {
Lakshmi Narayana Kalavala25fe12c2019-12-11 20:44:55 -080078 COMMAND_LIST_START = android::IBinder::FIRST_CALL_TRANSACTION,
Gurkaran Singhccdabde2021-11-12 15:26:28 -080079 GET_PANEL_BRIGHTNESS = 2, // Provides ability to get the panel brightness
80 SET_PANEL_BRIGHTNESS = 3, // Provides ability to set the panel brightness
Lakshmi Narayana Kalavala25fe12c2019-12-11 20:44:55 -080081 CONNECT_HWC_CLIENT = 4, // Connect to qservice
82 SCREEN_REFRESH = 5, // Refresh screen through SF invalidate
83 GET_DISPLAY_VISIBLE_REGION = 11, // Get the visibleRegion for dpy
84 SET_SECONDARY_DISPLAY_STATUS = 12, // Sets secondary display status
85 SET_MAX_PIPES_PER_MIXER = 13, // Set max pipes per mixer for MDPComp
86 DYNAMIC_DEBUG = 15, // Enable more logging on the fly
87 SET_IDLE_TIMEOUT = 16, // Set idle timeout for GPU fallback
88 CONFIGURE_DYN_REFRESH_RATE = 18, // Enable/Disable/Set refresh rate dynamically
89 CONTROL_PARTIAL_UPDATE = 19, // Provides ability to enable/disable partial update
90 TOGGLE_SCREEN_UPDATES = 20, // Provides ability to set the panel brightness
91 SET_FRAME_DUMP_CONFIG = 21, // Provides ability to set the frame dump config
92 CONNECT_HDMI_CLIENT = 23, // Connect HDMI CEC HAL Client
93 QDCM_SVC_CMDS = 24, // request QDCM services.
94 SET_ACTIVE_CONFIG = 25, // Set a specified display config
95 GET_ACTIVE_CONFIG = 26, // Get the current config index
96 GET_CONFIG_COUNT = 27, // Get the number of supported display configs
97 GET_DISPLAY_ATTRIBUTES_FOR_CONFIG = 28, // Get attr for specified config
98 SET_DISPLAY_MODE = 29, // Set display mode to command or video mode
99 SET_CAMERA_STATUS = 30, // To notify display when camera is on and off
100 MIN_HDCP_ENCRYPTION_LEVEL_CHANGED = 31,
101 GET_BW_TRANSACTION_STATUS = 32, // Client can query BW transaction status.
102 SET_LAYER_MIXER_RESOLUTION = 33, // Enables client to set layer mixer resolution.
103 SET_COLOR_MODE = 34, // Overrides the QDCM mode on the display
104 SET_COLOR_MODE_BY_ID = 36, // Overrides the QDCM mode using the given mode ID
105 GET_COMPOSER_STATUS = 37, // Get composer init status-true if primary display init is done
106 SET_QSYNC_MODE = 38, // Set qsync mode. 0 - (none)disable qsync, 1 - continuous mode.
107 SET_COLOR_MODE_WITH_RENDER_INTENT = 39, // Overrides the QDCM mode with render intent
108 SET_IDLE_PC = 40, // Enable/disable Idle power collapse
109 SET_DPPS_AD4_ROI_CONFIG = 41, // Set ad4 roi config for debug
110 SET_DSI_CLK = 42, // Set DSI Clk.
111 GET_DSI_CLK = 43, // Get DSI Clk.
112 GET_SUPPORTED_DSI_CLK = 44, // Get supported DSI Clk.
113 SET_COLOR_MODE_FROM_CLIENT = 45, // Overrides the QDCM mode using the given mode ID
114 SET_FRAME_TRIGGER_MODE = 46, // Set frame trigger mode for debug
115 SET_PANEL_LUMINANCE = 47, // Set Panel Luminance attributes.
116 SET_BRIGHTNESS_SCALE = 48, // Set brightness scale ratio
117 SET_COLOR_SAMPLING_ENABLED = 49, // Toggle the collection of display color stats
Ramkumar Radhakrishnan5ae3e522020-05-17 02:43:23 -0700118 SET_VSYNC_STATE = 50, // Enable/disable Vsync
119 NOTIFY_TUI_TRANSITION = 51, // Notify TUI transition prepare/start/stop
Anjaneya Prasad Musunuriec710f72021-02-10 18:24:40 +0530120 GET_DISPLAY_PORT_ID = 52, // Get the port id for a given display
121 SET_NOISE_PLUGIN_OVERRIDE = 53, // Override NoisePlugIn parameters
Xu Yangc9a67ed2021-08-31 14:35:32 +0800122 SET_DIMMING_ENABLE = 54, // Set display dimming enablement
123 SET_DIMMING_MIN_BL = 55, // Set display dimming minimal backlight value
Sandeep Gangadharaiahb2d57932022-02-17 09:37:00 -0500124 DUMP_CODE_COVERAGE = 56, // Dump the code coverage data for userspace projects
Gurkaran Singhe56ce362022-03-03 19:05:58 -0800125 UPDATE_TRANSFER_TIME = 57, // Update transfer time
Gurkaran Singhccdabde2021-11-12 15:26:28 -0800126 SET_JITTER_CONFIG = 58, // Watchdog TE Jitter Configuration
Ping Li0d04e0e2022-09-02 12:59:44 -0700127 RETRIEVE_DEMURATN_FILES = 59, // Retrieve DemuraTn files from TVM
Qing Huang431303c2022-06-20 17:15:14 +0800128 SET_DEMURA_STATE = 60, // Enable/disable demura feature
Lakshmi Narayana Kalavala25fe12c2019-12-11 20:44:55 -0800129 COMMAND_LIST_END = 400,
Saurabh Shah56f610d2012-08-07 15:27:06 -0700130 };
Naseer Ahmed4957c522013-11-12 18:07:15 -0500131
Saurabh Shah56f610d2012-08-07 15:27:06 -0700132 enum {
133 END = 0,
134 START,
135 };
Naseer Ahmed4957c522013-11-12 18:07:15 -0500136
Naseer Ahmed35a268c2014-06-24 19:07:13 -0400137 enum {
138 DEBUG_ALL,
139 DEBUG_MDPCOMP,
140 DEBUG_VSYNC,
Saurabh Shah24eec8a2014-08-22 15:07:25 -0700141 DEBUG_VD,
142 DEBUG_PIPE_LIFECYCLE,
Ramkumar Radhakrishnanbefbdbe2015-01-14 20:14:40 -0800143 DEBUG_DRIVER_CONFIG,
144 DEBUG_ROTATOR,
Zohaib Alam29c43c32015-06-08 10:38:16 -0400145 DEBUG_QDCM,
Rohit Kulkarniaa5111b2017-06-13 10:26:39 -0700146 DEBUG_SCALAR,
Saurabh Dubeyd90a6a42017-10-24 16:28:01 +0530147 DEBUG_CLIENT,
148 DEBUG_DISPLAY,
Ajay Singh Parmar67481152022-05-27 14:09:25 -0700149 DEBUG_IWE,
150 DEBUG_MAX_VAL = DEBUG_IWE, // Used to check each bit of the debug command paramater.
Saurabh Dubeyd90a6a42017-10-24 16:28:01 +0530151 // Update DEBUG_MAX_VAL when adding new debug tag.
Naseer Ahmed35a268c2014-06-24 19:07:13 -0400152 };
153
Ramkumar Radhakrishnan952081f2015-01-30 18:25:32 -0800154 enum {
Jeykumar Sankaran14d41a82015-03-11 14:13:43 -0700155 PREF_POST_PROCESSING,
Nitesh Gupta889490f2015-04-10 19:09:19 +0530156 PREF_PARTIAL_UPDATE,
Jeykumar Sankaran14d41a82015-03-11 14:13:43 -0700157 ENABLE_PARTIAL_UPDATE,
158 };
159
Sushil Chauhan380a59d2018-03-19 15:47:50 -0700160 enum {
161 QSYNC_MODE_NONE,
162 QSYNC_MODE_CONTINUOUS,
163 QSYNC_MODE_ONESHOT, // Not supported
164 };
165
Ramkumar Radhakrishnan5ae3e522020-05-17 02:43:23 -0700166 enum {
167 TUI_TRANSITION_PREPARE,
168 TUI_TRANSITION_START,
169 TUI_TRANSITION_END,
170 };
171
Naseer Ahmed7a7b66d2014-07-23 17:56:26 -0400172 // Register a HWC client that can be notified
173 // This client is generic and is intended to get
174 // dispatches of all events calling into QService
Saurabh Shah86c17292013-02-08 15:24:13 -0800175 virtual void connect(const android::sp<qClient::IQClient>& client) = 0;
Naseer Ahmed7a7b66d2014-07-23 17:56:26 -0400176 // Register an HDMI client. This client gets notification of HDMI events
177 // such as plug/unplug and CEC messages
178 virtual void connect(const android::sp<qClient::IQHDMIClient>& client) = 0;
Naseer Ahmed4957c522013-11-12 18:07:15 -0500179 // Generic function to dispatch binder commands
180 // The type of command decides how the data is parceled
181 virtual android::status_t dispatch(uint32_t command,
182 const android::Parcel* inParcel,
183 android::Parcel* outParcel) = 0;
Saurabh Shah56f610d2012-08-07 15:27:06 -0700184};
185
186// ----------------------------------------------------------------------------
187
188class BnQService : public android::BnInterface<IQService>
189{
190public:
191 virtual android::status_t onTransact( uint32_t code,
192 const android::Parcel& data,
193 android::Parcel* reply,
194 uint32_t flags = 0);
195};
196
197// ----------------------------------------------------------------------------
198}; // namespace qService
199
200#endif // ANDROID_IQSERVICE_H