Saurabh Shah | 56f610d | 2012-08-07 15:27:06 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2010 The Android Open Source Project |
Rohit Kulkarni | aa5111b | 2017-06-13 10:26:39 -0700 | [diff] [blame] | 3 | * Copyright (C) 2012-2014, 2016-2017 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 { |
Naseer Ahmed | 4957c52 | 2013-11-12 18:07:15 -0500 | [diff] [blame] | 42 | COMMAND_LIST_START = android::IBinder::FIRST_CALL_TRANSACTION, |
Tatenda Chipeperekwa | f51c599 | 2015-08-24 15:10:56 -0700 | [diff] [blame] | 43 | GET_PANEL_BRIGHTNESS = 2, // Provides ability to set the panel brightness |
| 44 | SET_PANEL_BRIGHTNESS = 3, // Provides ability to get the panel brightness |
Naseer Ahmed | 7a7b66d | 2014-07-23 17:56:26 -0400 | [diff] [blame] | 45 | CONNECT_HWC_CLIENT = 4, // Connect to qservice |
Saurabh Shah | cd01835 | 2014-11-11 13:54:19 -0800 | [diff] [blame] | 46 | SCREEN_REFRESH = 5, // Refresh screen through SF invalidate |
| 47 | EXTERNAL_ORIENTATION = 6,// Set external orientation |
| 48 | BUFFER_MIRRORMODE = 7, // Buffer mirrormode |
| 49 | CHECK_EXTERNAL_STATUS = 8,// Check status of external display |
| 50 | GET_DISPLAY_ATTRIBUTES = 9,// Get display attributes |
| 51 | SET_HSIC_DATA = 10, // Set HSIC on dspp |
| 52 | GET_DISPLAY_VISIBLE_REGION = 11,// Get the visibleRegion for dpy |
| 53 | SET_SECONDARY_DISPLAY_STATUS = 12,// Sets secondary display status |
| 54 | SET_MAX_PIPES_PER_MIXER = 13,// Set max pipes per mixer for MDPComp |
| 55 | SET_VIEW_FRAME = 14, // Set view frame of display |
| 56 | DYNAMIC_DEBUG = 15, // Enable more logging on the fly |
| 57 | SET_IDLE_TIMEOUT = 16, // Set idle timeout for GPU fallback |
| 58 | TOGGLE_BWC = 17, // Toggle BWC On/Off on targets that support |
Raj Kamal | 0d53fc6 | 2014-11-25 17:36:36 +0530 | [diff] [blame] | 59 | /* Enable/Disable/Set refresh rate dynamically */ |
Arun Kumar K.R | f2d85a7 | 2014-12-10 19:19:10 -0800 | [diff] [blame] | 60 | CONFIGURE_DYN_REFRESH_RATE = 18, |
Manoj Kumar AVM | 2d019a4 | 2015-06-22 18:02:46 -0700 | [diff] [blame] | 61 | CONTROL_PARTIAL_UPDATE = 19, // Provides ability to enable/disable partial update |
Tatenda Chipeperekwa | f51c599 | 2015-08-24 15:10:56 -0700 | [diff] [blame] | 62 | TOGGLE_SCREEN_UPDATES = 20, // Provides ability to set the panel brightness |
Ramkumar Radhakrishnan | 952081f | 2015-01-30 18:25:32 -0800 | [diff] [blame] | 63 | SET_FRAME_DUMP_CONFIG = 21, // Provides ability to set the frame dump config |
Naseer Ahmed | 6bbd0a1 | 2015-01-23 11:57:10 -0500 | [diff] [blame] | 64 | SET_S3D_MODE = 22, // Set the 3D mode as specified in msm_hdmi_modes.h |
Naseer Ahmed | 7a7b66d | 2014-07-23 17:56:26 -0400 | [diff] [blame] | 65 | CONNECT_HDMI_CLIENT = 23, // Connect HDMI CEC HAL Client |
Zohaib Alam | 83ea46d | 2015-03-23 15:44:19 -0400 | [diff] [blame] | 66 | QDCM_SVC_CMDS = 24, // request QDCM services. |
Saurabh Shah | 90c55cf | 2015-02-10 15:37:39 -0800 | [diff] [blame] | 67 | SET_ACTIVE_CONFIG = 25, //Set a specified display config |
| 68 | GET_ACTIVE_CONFIG = 26, //Get the current config index |
| 69 | GET_CONFIG_COUNT = 27, //Get the number of supported display configs |
| 70 | GET_DISPLAY_ATTRIBUTES_FOR_CONFIG = 28, //Get attr for specified config |
Tatenda Chipeperekwa | 4207288 | 2015-03-24 11:50:27 -0700 | [diff] [blame] | 71 | SET_DISPLAY_MODE = 29, // Set display mode to command or video mode |
Prabhanjan Kandula | db274fa | 2015-03-30 22:35:09 +0530 | [diff] [blame] | 72 | SET_CAMERA_STATUS = 30, // To notify display when camera is on and off |
Dileep Marchya | d4afd48 | 2015-07-10 00:00:20 -0700 | [diff] [blame] | 73 | MIN_HDCP_ENCRYPTION_LEVEL_CHANGED = 31, |
Prabhanjan Kandula | 8f8f6c7 | 2015-10-05 14:40:36 +0530 | [diff] [blame] | 74 | GET_BW_TRANSACTION_STATUS = 32, //Client can query BW transaction status. |
Ramkumar Radhakrishnan | 6884047 | 2016-05-09 13:01:25 -0700 | [diff] [blame] | 75 | SET_LAYER_MIXER_RESOLUTION = 33, // Enables client to set layer mixer resolution. |
Naseer Ahmed | ad49544 | 2016-06-27 14:59:18 -0400 | [diff] [blame] | 76 | SET_COLOR_MODE = 34, // Overrides the QDCM mode on the display |
Naseer Ahmed | 48a392c | 2016-11-03 20:12:00 -0400 | [diff] [blame] | 77 | GET_HDR_CAPABILITIES = 35, // Get HDR capabilities for legacy HWC interface |
Naseer Ahmed | 6776dae | 2017-05-09 11:49:41 -0400 | [diff] [blame] | 78 | SET_COLOR_MODE_BY_ID = 36, // Overrides the QDCM mode using the given mode ID |
Prabhanjan Kandula | 63a613f | 2017-09-14 19:29:46 -0700 | [diff] [blame] | 79 | GET_COMPOSER_STATUS = 37, // Get composer init status-true if primary display init is done |
Naseer Ahmed | 4957c52 | 2013-11-12 18:07:15 -0500 | [diff] [blame] | 80 | COMMAND_LIST_END = 400, |
Saurabh Shah | 56f610d | 2012-08-07 15:27:06 -0700 | [diff] [blame] | 81 | }; |
Naseer Ahmed | 4957c52 | 2013-11-12 18:07:15 -0500 | [diff] [blame] | 82 | |
Saurabh Shah | 56f610d | 2012-08-07 15:27:06 -0700 | [diff] [blame] | 83 | enum { |
| 84 | END = 0, |
| 85 | START, |
| 86 | }; |
Naseer Ahmed | 4957c52 | 2013-11-12 18:07:15 -0500 | [diff] [blame] | 87 | |
Naseer Ahmed | 35a268c | 2014-06-24 19:07:13 -0400 | [diff] [blame] | 88 | enum { |
| 89 | DEBUG_ALL, |
| 90 | DEBUG_MDPCOMP, |
| 91 | DEBUG_VSYNC, |
Saurabh Shah | 24eec8a | 2014-08-22 15:07:25 -0700 | [diff] [blame] | 92 | DEBUG_VD, |
| 93 | DEBUG_PIPE_LIFECYCLE, |
Ramkumar Radhakrishnan | befbdbe | 2015-01-14 20:14:40 -0800 | [diff] [blame] | 94 | DEBUG_DRIVER_CONFIG, |
| 95 | DEBUG_ROTATOR, |
Zohaib Alam | 29c43c3 | 2015-06-08 10:38:16 -0400 | [diff] [blame] | 96 | DEBUG_QDCM, |
Rohit Kulkarni | aa5111b | 2017-06-13 10:26:39 -0700 | [diff] [blame] | 97 | DEBUG_SCALAR, |
Saurabh Dubey | d90a6a4 | 2017-10-24 16:28:01 +0530 | [diff] [blame] | 98 | DEBUG_CLIENT, |
| 99 | DEBUG_DISPLAY, |
| 100 | DEBUG_MAX_VAL = DEBUG_DISPLAY, // Used to check each bit of the debug command paramater. |
| 101 | // Update DEBUG_MAX_VAL when adding new debug tag. |
Naseer Ahmed | 35a268c | 2014-06-24 19:07:13 -0400 | [diff] [blame] | 102 | }; |
| 103 | |
Ramkumar Radhakrishnan | 952081f | 2015-01-30 18:25:32 -0800 | [diff] [blame] | 104 | enum { |
Jeykumar Sankaran | 14d41a8 | 2015-03-11 14:13:43 -0700 | [diff] [blame] | 105 | PREF_POST_PROCESSING, |
Nitesh Gupta | 889490f | 2015-04-10 19:09:19 +0530 | [diff] [blame] | 106 | PREF_PARTIAL_UPDATE, |
Jeykumar Sankaran | 14d41a8 | 2015-03-11 14:13:43 -0700 | [diff] [blame] | 107 | ENABLE_PARTIAL_UPDATE, |
| 108 | }; |
| 109 | |
Naseer Ahmed | 7a7b66d | 2014-07-23 17:56:26 -0400 | [diff] [blame] | 110 | // Register a HWC client that can be notified |
| 111 | // This client is generic and is intended to get |
| 112 | // dispatches of all events calling into QService |
Saurabh Shah | 86c1729 | 2013-02-08 15:24:13 -0800 | [diff] [blame] | 113 | virtual void connect(const android::sp<qClient::IQClient>& client) = 0; |
Naseer Ahmed | 7a7b66d | 2014-07-23 17:56:26 -0400 | [diff] [blame] | 114 | // Register an HDMI client. This client gets notification of HDMI events |
| 115 | // such as plug/unplug and CEC messages |
| 116 | virtual void connect(const android::sp<qClient::IQHDMIClient>& client) = 0; |
Naseer Ahmed | 4957c52 | 2013-11-12 18:07:15 -0500 | [diff] [blame] | 117 | // Generic function to dispatch binder commands |
| 118 | // The type of command decides how the data is parceled |
| 119 | virtual android::status_t dispatch(uint32_t command, |
| 120 | const android::Parcel* inParcel, |
| 121 | android::Parcel* outParcel) = 0; |
Saurabh Shah | 56f610d | 2012-08-07 15:27:06 -0700 | [diff] [blame] | 122 | }; |
| 123 | |
| 124 | // ---------------------------------------------------------------------------- |
| 125 | |
| 126 | class BnQService : public android::BnInterface<IQService> |
| 127 | { |
| 128 | public: |
| 129 | virtual android::status_t onTransact( uint32_t code, |
| 130 | const android::Parcel& data, |
| 131 | android::Parcel* reply, |
| 132 | uint32_t flags = 0); |
| 133 | }; |
| 134 | |
| 135 | // ---------------------------------------------------------------------------- |
| 136 | }; // namespace qService |
| 137 | |
| 138 | #endif // ANDROID_IQSERVICE_H |