Saurabh Shah | 56f610d | 2012-08-07 15:27:06 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2010 The Android Open Source Project |
Anjaneya Prasad Musunuri | ec710f7 | 2021-02-10 18:24:40 +0530 | [diff] [blame] | 3 | * Copyright (C) 2012-2014, 2016-2021 The Linux Foundation. All rights reserved. |
Saurabh Shah | 56f610d | 2012-08-07 15:27:06 -0700 | [diff] [blame] | 4 | * |
| 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 Parmar | 6748115 | 2022-05-27 14:09:25 -0700 | [diff] [blame] | 21 | /* |
| 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 Shah | 56f610d | 2012-08-07 15:27:06 -0700 | [diff] [blame] | 57 | #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 Shah | 86c1729 | 2013-02-08 15:24:13 -0800 | [diff] [blame] | 65 | #include <binder/IBinder.h> |
| 66 | #include <IQClient.h> |
Naseer Ahmed | 7a7b66d | 2014-07-23 17:56:26 -0400 | [diff] [blame] | 67 | #include <IQHDMIClient.h> |
Saurabh Shah | 56f610d | 2012-08-07 15:27:06 -0700 | [diff] [blame] | 68 | |
Naseer Ahmed | 4957c52 | 2013-11-12 18:07:15 -0500 | [diff] [blame] | 69 | |
Saurabh Shah | 56f610d | 2012-08-07 15:27:06 -0700 | [diff] [blame] | 70 | namespace qService { |
| 71 | // ---------------------------------------------------------------------------- |
Naseer Ahmed | 4957c52 | 2013-11-12 18:07:15 -0500 | [diff] [blame] | 72 | |
Saurabh Shah | 56f610d | 2012-08-07 15:27:06 -0700 | [diff] [blame] | 73 | class IQService : public android::IInterface |
| 74 | { |
| 75 | public: |
| 76 | DECLARE_META_INTERFACE(QService); |
| 77 | enum { |
Lakshmi Narayana Kalavala | 25fe12c | 2019-12-11 20:44:55 -0800 | [diff] [blame] | 78 | COMMAND_LIST_START = android::IBinder::FIRST_CALL_TRANSACTION, |
Gurkaran Singh | ccdabde | 2021-11-12 15:26:28 -0800 | [diff] [blame] | 79 | 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 Kalavala | 25fe12c | 2019-12-11 20:44:55 -0800 | [diff] [blame] | 81 | 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 Radhakrishnan | 5ae3e52 | 2020-05-17 02:43:23 -0700 | [diff] [blame] | 118 | SET_VSYNC_STATE = 50, // Enable/disable Vsync |
| 119 | NOTIFY_TUI_TRANSITION = 51, // Notify TUI transition prepare/start/stop |
Anjaneya Prasad Musunuri | ec710f7 | 2021-02-10 18:24:40 +0530 | [diff] [blame] | 120 | GET_DISPLAY_PORT_ID = 52, // Get the port id for a given display |
| 121 | SET_NOISE_PLUGIN_OVERRIDE = 53, // Override NoisePlugIn parameters |
Xu Yang | c9a67ed | 2021-08-31 14:35:32 +0800 | [diff] [blame] | 122 | SET_DIMMING_ENABLE = 54, // Set display dimming enablement |
| 123 | SET_DIMMING_MIN_BL = 55, // Set display dimming minimal backlight value |
Sandeep Gangadharaiah | b2d5793 | 2022-02-17 09:37:00 -0500 | [diff] [blame] | 124 | DUMP_CODE_COVERAGE = 56, // Dump the code coverage data for userspace projects |
Gurkaran Singh | e56ce36 | 2022-03-03 19:05:58 -0800 | [diff] [blame] | 125 | UPDATE_TRANSFER_TIME = 57, // Update transfer time |
Gurkaran Singh | ccdabde | 2021-11-12 15:26:28 -0800 | [diff] [blame] | 126 | SET_JITTER_CONFIG = 58, // Watchdog TE Jitter Configuration |
Ping Li | 0d04e0e | 2022-09-02 12:59:44 -0700 | [diff] [blame] | 127 | RETRIEVE_DEMURATN_FILES = 59, // Retrieve DemuraTn files from TVM |
Qing Huang | 431303c | 2022-06-20 17:15:14 +0800 | [diff] [blame] | 128 | SET_DEMURA_STATE = 60, // Enable/disable demura feature |
Lakshmi Narayana Kalavala | 25fe12c | 2019-12-11 20:44:55 -0800 | [diff] [blame] | 129 | COMMAND_LIST_END = 400, |
Saurabh Shah | 56f610d | 2012-08-07 15:27:06 -0700 | [diff] [blame] | 130 | }; |
Naseer Ahmed | 4957c52 | 2013-11-12 18:07:15 -0500 | [diff] [blame] | 131 | |
Saurabh Shah | 56f610d | 2012-08-07 15:27:06 -0700 | [diff] [blame] | 132 | enum { |
| 133 | END = 0, |
| 134 | START, |
| 135 | }; |
Naseer Ahmed | 4957c52 | 2013-11-12 18:07:15 -0500 | [diff] [blame] | 136 | |
Naseer Ahmed | 35a268c | 2014-06-24 19:07:13 -0400 | [diff] [blame] | 137 | enum { |
| 138 | DEBUG_ALL, |
| 139 | DEBUG_MDPCOMP, |
| 140 | DEBUG_VSYNC, |
Saurabh Shah | 24eec8a | 2014-08-22 15:07:25 -0700 | [diff] [blame] | 141 | DEBUG_VD, |
| 142 | DEBUG_PIPE_LIFECYCLE, |
Ramkumar Radhakrishnan | befbdbe | 2015-01-14 20:14:40 -0800 | [diff] [blame] | 143 | DEBUG_DRIVER_CONFIG, |
| 144 | DEBUG_ROTATOR, |
Zohaib Alam | 29c43c3 | 2015-06-08 10:38:16 -0400 | [diff] [blame] | 145 | DEBUG_QDCM, |
Rohit Kulkarni | aa5111b | 2017-06-13 10:26:39 -0700 | [diff] [blame] | 146 | DEBUG_SCALAR, |
Saurabh Dubey | d90a6a4 | 2017-10-24 16:28:01 +0530 | [diff] [blame] | 147 | DEBUG_CLIENT, |
| 148 | DEBUG_DISPLAY, |
Ajay Singh Parmar | 6748115 | 2022-05-27 14:09:25 -0700 | [diff] [blame] | 149 | DEBUG_IWE, |
| 150 | DEBUG_MAX_VAL = DEBUG_IWE, // Used to check each bit of the debug command paramater. |
Saurabh Dubey | d90a6a4 | 2017-10-24 16:28:01 +0530 | [diff] [blame] | 151 | // Update DEBUG_MAX_VAL when adding new debug tag. |
Naseer Ahmed | 35a268c | 2014-06-24 19:07:13 -0400 | [diff] [blame] | 152 | }; |
| 153 | |
Ramkumar Radhakrishnan | 952081f | 2015-01-30 18:25:32 -0800 | [diff] [blame] | 154 | enum { |
Jeykumar Sankaran | 14d41a8 | 2015-03-11 14:13:43 -0700 | [diff] [blame] | 155 | PREF_POST_PROCESSING, |
Nitesh Gupta | 889490f | 2015-04-10 19:09:19 +0530 | [diff] [blame] | 156 | PREF_PARTIAL_UPDATE, |
Jeykumar Sankaran | 14d41a8 | 2015-03-11 14:13:43 -0700 | [diff] [blame] | 157 | ENABLE_PARTIAL_UPDATE, |
| 158 | }; |
| 159 | |
Sushil Chauhan | 380a59d | 2018-03-19 15:47:50 -0700 | [diff] [blame] | 160 | enum { |
| 161 | QSYNC_MODE_NONE, |
| 162 | QSYNC_MODE_CONTINUOUS, |
| 163 | QSYNC_MODE_ONESHOT, // Not supported |
| 164 | }; |
| 165 | |
Ramkumar Radhakrishnan | 5ae3e52 | 2020-05-17 02:43:23 -0700 | [diff] [blame] | 166 | enum { |
| 167 | TUI_TRANSITION_PREPARE, |
| 168 | TUI_TRANSITION_START, |
| 169 | TUI_TRANSITION_END, |
| 170 | }; |
| 171 | |
Naseer Ahmed | 7a7b66d | 2014-07-23 17:56:26 -0400 | [diff] [blame] | 172 | // 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 Shah | 86c1729 | 2013-02-08 15:24:13 -0800 | [diff] [blame] | 175 | virtual void connect(const android::sp<qClient::IQClient>& client) = 0; |
Naseer Ahmed | 7a7b66d | 2014-07-23 17:56:26 -0400 | [diff] [blame] | 176 | // 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 Ahmed | 4957c52 | 2013-11-12 18:07:15 -0500 | [diff] [blame] | 179 | // 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 Shah | 56f610d | 2012-08-07 15:27:06 -0700 | [diff] [blame] | 184 | }; |
| 185 | |
| 186 | // ---------------------------------------------------------------------------- |
| 187 | |
| 188 | class BnQService : public android::BnInterface<IQService> |
| 189 | { |
| 190 | public: |
| 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 |