blob: 920f27c54f2abc8901e1191a1ae8d95127f3cebc [file] [log] [blame]
Saurabh Shah56f610d2012-08-07 15:27:06 -07001/*
2 * Copyright (C) 2010 The Android Open Source Project
Qing Huangda3a91d2019-01-15 14:34:11 +08003 * Copyright (C) 2012-2014, 2016-2019 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
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 Shah86c17292013-02-08 15:24:13 -080029#include <binder/IBinder.h>
30#include <IQClient.h>
Naseer Ahmed7a7b66d2014-07-23 17:56:26 -040031#include <IQHDMIClient.h>
Saurabh Shah56f610d2012-08-07 15:27:06 -070032
Naseer Ahmed4957c522013-11-12 18:07:15 -050033
Saurabh Shah56f610d2012-08-07 15:27:06 -070034namespace qService {
35// ----------------------------------------------------------------------------
Naseer Ahmed4957c522013-11-12 18:07:15 -050036
Saurabh Shah56f610d2012-08-07 15:27:06 -070037class IQService : public android::IInterface
38{
39public:
40 DECLARE_META_INTERFACE(QService);
41 enum {
Lakshmi Narayana Kalavala25fe12c2019-12-11 20:44:55 -080042 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 Shah56f610d2012-08-07 15:27:06 -070083 };
Naseer Ahmed4957c522013-11-12 18:07:15 -050084
Saurabh Shah56f610d2012-08-07 15:27:06 -070085 enum {
86 END = 0,
87 START,
88 };
Naseer Ahmed4957c522013-11-12 18:07:15 -050089
Naseer Ahmed35a268c2014-06-24 19:07:13 -040090 enum {
91 DEBUG_ALL,
92 DEBUG_MDPCOMP,
93 DEBUG_VSYNC,
Saurabh Shah24eec8a2014-08-22 15:07:25 -070094 DEBUG_VD,
95 DEBUG_PIPE_LIFECYCLE,
Ramkumar Radhakrishnanbefbdbe2015-01-14 20:14:40 -080096 DEBUG_DRIVER_CONFIG,
97 DEBUG_ROTATOR,
Zohaib Alam29c43c32015-06-08 10:38:16 -040098 DEBUG_QDCM,
Rohit Kulkarniaa5111b2017-06-13 10:26:39 -070099 DEBUG_SCALAR,
Saurabh Dubeyd90a6a42017-10-24 16:28:01 +0530100 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 Ahmed35a268c2014-06-24 19:07:13 -0400104 };
105
Ramkumar Radhakrishnan952081f2015-01-30 18:25:32 -0800106 enum {
Jeykumar Sankaran14d41a82015-03-11 14:13:43 -0700107 PREF_POST_PROCESSING,
Nitesh Gupta889490f2015-04-10 19:09:19 +0530108 PREF_PARTIAL_UPDATE,
Jeykumar Sankaran14d41a82015-03-11 14:13:43 -0700109 ENABLE_PARTIAL_UPDATE,
110 };
111
Sushil Chauhan380a59d2018-03-19 15:47:50 -0700112 enum {
113 QSYNC_MODE_NONE,
114 QSYNC_MODE_CONTINUOUS,
115 QSYNC_MODE_ONESHOT, // Not supported
116 };
117
Naseer Ahmed7a7b66d2014-07-23 17:56:26 -0400118 // 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 Shah86c17292013-02-08 15:24:13 -0800121 virtual void connect(const android::sp<qClient::IQClient>& client) = 0;
Naseer Ahmed7a7b66d2014-07-23 17:56:26 -0400122 // 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 Ahmed4957c522013-11-12 18:07:15 -0500125 // 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 Shah56f610d2012-08-07 15:27:06 -0700130};
131
132// ----------------------------------------------------------------------------
133
134class BnQService : public android::BnInterface<IQService>
135{
136public:
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