Saurabh Shah | 56f610d | 2012-08-07 15:27:06 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2010 The Android Open Source Project |
Qing Huang | da3a91d | 2019-01-15 14:34:11 +0800 | [diff] [blame] | 3 | * Copyright (C) 2012-2014, 2016-2019 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 | |
| 21 | #ifndef ANDROID_IQSERVICE_H |
| 22 | #define ANDROID_IQSERVICE_H |
| 23 | |
| 24 | #include <stdint.h> |
| 25 | #include <sys/types.h> |
| 26 | #include <utils/Errors.h> |
| 27 | #include <utils/RefBase.h> |
| 28 | #include <binder/IInterface.h> |
Saurabh Shah | 86c1729 | 2013-02-08 15:24:13 -0800 | [diff] [blame] | 29 | #include <binder/IBinder.h> |
| 30 | #include <IQClient.h> |
Naseer Ahmed | 7a7b66d | 2014-07-23 17:56:26 -0400 | [diff] [blame] | 31 | #include <IQHDMIClient.h> |
Saurabh Shah | 56f610d | 2012-08-07 15:27:06 -0700 | [diff] [blame] | 32 | |
Naseer Ahmed | 4957c52 | 2013-11-12 18:07:15 -0500 | [diff] [blame] | 33 | |
Saurabh Shah | 56f610d | 2012-08-07 15:27:06 -0700 | [diff] [blame] | 34 | namespace qService { |
| 35 | // ---------------------------------------------------------------------------- |
Naseer Ahmed | 4957c52 | 2013-11-12 18:07:15 -0500 | [diff] [blame] | 36 | |
Saurabh Shah | 56f610d | 2012-08-07 15:27:06 -0700 | [diff] [blame] | 37 | class IQService : public android::IInterface |
| 38 | { |
| 39 | public: |
| 40 | DECLARE_META_INTERFACE(QService); |
| 41 | enum { |
Lakshmi Narayana Kalavala | 25fe12c | 2019-12-11 20:44:55 -0800 | [diff] [blame] | 42 | COMMAND_LIST_START = android::IBinder::FIRST_CALL_TRANSACTION, |
| 43 | GET_PANEL_BRIGHTNESS = 2, // Provides ability to set the panel brightness |
| 44 | SET_PANEL_BRIGHTNESS = 3, // Provides ability to get the panel brightness |
| 45 | CONNECT_HWC_CLIENT = 4, // Connect to qservice |
| 46 | SCREEN_REFRESH = 5, // Refresh screen through SF invalidate |
| 47 | GET_DISPLAY_VISIBLE_REGION = 11, // Get the visibleRegion for dpy |
| 48 | SET_SECONDARY_DISPLAY_STATUS = 12, // Sets secondary display status |
| 49 | SET_MAX_PIPES_PER_MIXER = 13, // Set max pipes per mixer for MDPComp |
| 50 | DYNAMIC_DEBUG = 15, // Enable more logging on the fly |
| 51 | SET_IDLE_TIMEOUT = 16, // Set idle timeout for GPU fallback |
| 52 | CONFIGURE_DYN_REFRESH_RATE = 18, // Enable/Disable/Set refresh rate dynamically |
| 53 | CONTROL_PARTIAL_UPDATE = 19, // Provides ability to enable/disable partial update |
| 54 | TOGGLE_SCREEN_UPDATES = 20, // Provides ability to set the panel brightness |
| 55 | SET_FRAME_DUMP_CONFIG = 21, // Provides ability to set the frame dump config |
| 56 | CONNECT_HDMI_CLIENT = 23, // Connect HDMI CEC HAL Client |
| 57 | QDCM_SVC_CMDS = 24, // request QDCM services. |
| 58 | SET_ACTIVE_CONFIG = 25, // Set a specified display config |
| 59 | GET_ACTIVE_CONFIG = 26, // Get the current config index |
| 60 | GET_CONFIG_COUNT = 27, // Get the number of supported display configs |
| 61 | GET_DISPLAY_ATTRIBUTES_FOR_CONFIG = 28, // Get attr for specified config |
| 62 | SET_DISPLAY_MODE = 29, // Set display mode to command or video mode |
| 63 | SET_CAMERA_STATUS = 30, // To notify display when camera is on and off |
| 64 | MIN_HDCP_ENCRYPTION_LEVEL_CHANGED = 31, |
| 65 | GET_BW_TRANSACTION_STATUS = 32, // Client can query BW transaction status. |
| 66 | SET_LAYER_MIXER_RESOLUTION = 33, // Enables client to set layer mixer resolution. |
| 67 | SET_COLOR_MODE = 34, // Overrides the QDCM mode on the display |
| 68 | SET_COLOR_MODE_BY_ID = 36, // Overrides the QDCM mode using the given mode ID |
| 69 | GET_COMPOSER_STATUS = 37, // Get composer init status-true if primary display init is done |
| 70 | SET_QSYNC_MODE = 38, // Set qsync mode. 0 - (none)disable qsync, 1 - continuous mode. |
| 71 | SET_COLOR_MODE_WITH_RENDER_INTENT = 39, // Overrides the QDCM mode with render intent |
| 72 | SET_IDLE_PC = 40, // Enable/disable Idle power collapse |
| 73 | SET_DPPS_AD4_ROI_CONFIG = 41, // Set ad4 roi config for debug |
| 74 | SET_DSI_CLK = 42, // Set DSI Clk. |
| 75 | GET_DSI_CLK = 43, // Get DSI Clk. |
| 76 | GET_SUPPORTED_DSI_CLK = 44, // Get supported DSI Clk. |
| 77 | SET_COLOR_MODE_FROM_CLIENT = 45, // Overrides the QDCM mode using the given mode ID |
| 78 | SET_FRAME_TRIGGER_MODE = 46, // Set frame trigger mode for debug |
| 79 | SET_PANEL_LUMINANCE = 47, // Set Panel Luminance attributes. |
| 80 | SET_BRIGHTNESS_SCALE = 48, // Set brightness scale ratio |
| 81 | SET_COLOR_SAMPLING_ENABLED = 49, // Toggle the collection of display color stats |
| 82 | COMMAND_LIST_END = 400, |
Saurabh Shah | 56f610d | 2012-08-07 15:27:06 -0700 | [diff] [blame] | 83 | }; |
Naseer Ahmed | 4957c52 | 2013-11-12 18:07:15 -0500 | [diff] [blame] | 84 | |
Saurabh Shah | 56f610d | 2012-08-07 15:27:06 -0700 | [diff] [blame] | 85 | enum { |
| 86 | END = 0, |
| 87 | START, |
| 88 | }; |
Naseer Ahmed | 4957c52 | 2013-11-12 18:07:15 -0500 | [diff] [blame] | 89 | |
Naseer Ahmed | 35a268c | 2014-06-24 19:07:13 -0400 | [diff] [blame] | 90 | enum { |
| 91 | DEBUG_ALL, |
| 92 | DEBUG_MDPCOMP, |
| 93 | DEBUG_VSYNC, |
Saurabh Shah | 24eec8a | 2014-08-22 15:07:25 -0700 | [diff] [blame] | 94 | DEBUG_VD, |
| 95 | DEBUG_PIPE_LIFECYCLE, |
Ramkumar Radhakrishnan | befbdbe | 2015-01-14 20:14:40 -0800 | [diff] [blame] | 96 | DEBUG_DRIVER_CONFIG, |
| 97 | DEBUG_ROTATOR, |
Zohaib Alam | 29c43c3 | 2015-06-08 10:38:16 -0400 | [diff] [blame] | 98 | DEBUG_QDCM, |
Rohit Kulkarni | aa5111b | 2017-06-13 10:26:39 -0700 | [diff] [blame] | 99 | DEBUG_SCALAR, |
Saurabh Dubey | d90a6a4 | 2017-10-24 16:28:01 +0530 | [diff] [blame] | 100 | DEBUG_CLIENT, |
| 101 | DEBUG_DISPLAY, |
| 102 | DEBUG_MAX_VAL = DEBUG_DISPLAY, // Used to check each bit of the debug command paramater. |
| 103 | // Update DEBUG_MAX_VAL when adding new debug tag. |
Naseer Ahmed | 35a268c | 2014-06-24 19:07:13 -0400 | [diff] [blame] | 104 | }; |
| 105 | |
Ramkumar Radhakrishnan | 952081f | 2015-01-30 18:25:32 -0800 | [diff] [blame] | 106 | enum { |
Jeykumar Sankaran | 14d41a8 | 2015-03-11 14:13:43 -0700 | [diff] [blame] | 107 | PREF_POST_PROCESSING, |
Nitesh Gupta | 889490f | 2015-04-10 19:09:19 +0530 | [diff] [blame] | 108 | PREF_PARTIAL_UPDATE, |
Jeykumar Sankaran | 14d41a8 | 2015-03-11 14:13:43 -0700 | [diff] [blame] | 109 | ENABLE_PARTIAL_UPDATE, |
| 110 | }; |
| 111 | |
Sushil Chauhan | 380a59d | 2018-03-19 15:47:50 -0700 | [diff] [blame] | 112 | enum { |
| 113 | QSYNC_MODE_NONE, |
| 114 | QSYNC_MODE_CONTINUOUS, |
| 115 | QSYNC_MODE_ONESHOT, // Not supported |
| 116 | }; |
| 117 | |
Naseer Ahmed | 7a7b66d | 2014-07-23 17:56:26 -0400 | [diff] [blame] | 118 | // Register a HWC client that can be notified |
| 119 | // This client is generic and is intended to get |
| 120 | // dispatches of all events calling into QService |
Saurabh Shah | 86c1729 | 2013-02-08 15:24:13 -0800 | [diff] [blame] | 121 | virtual void connect(const android::sp<qClient::IQClient>& client) = 0; |
Naseer Ahmed | 7a7b66d | 2014-07-23 17:56:26 -0400 | [diff] [blame] | 122 | // Register an HDMI client. This client gets notification of HDMI events |
| 123 | // such as plug/unplug and CEC messages |
| 124 | virtual void connect(const android::sp<qClient::IQHDMIClient>& client) = 0; |
Naseer Ahmed | 4957c52 | 2013-11-12 18:07:15 -0500 | [diff] [blame] | 125 | // Generic function to dispatch binder commands |
| 126 | // The type of command decides how the data is parceled |
| 127 | virtual android::status_t dispatch(uint32_t command, |
| 128 | const android::Parcel* inParcel, |
| 129 | android::Parcel* outParcel) = 0; |
Saurabh Shah | 56f610d | 2012-08-07 15:27:06 -0700 | [diff] [blame] | 130 | }; |
| 131 | |
| 132 | // ---------------------------------------------------------------------------- |
| 133 | |
| 134 | class BnQService : public android::BnInterface<IQService> |
| 135 | { |
| 136 | public: |
| 137 | virtual android::status_t onTransact( uint32_t code, |
| 138 | const android::Parcel& data, |
| 139 | android::Parcel* reply, |
| 140 | uint32_t flags = 0); |
| 141 | }; |
| 142 | |
| 143 | // ---------------------------------------------------------------------------- |
| 144 | }; // namespace qService |
| 145 | |
| 146 | #endif // ANDROID_IQSERVICE_H |