Saurabh Shah | 56f610d | 2012-08-07 15:27:06 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2010 The Android Open Source Project |
Arun Kumar K.R | c62935a | 2013-12-03 16:47:47 -0800 | [diff] [blame] | 3 | * Copyright (C) 2012-2014, 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> |
Saurabh Shah | 56f610d | 2012-08-07 15:27:06 -0700 | [diff] [blame] | 31 | |
Naseer Ahmed | 4957c52 | 2013-11-12 18:07:15 -0500 | [diff] [blame] | 32 | |
Saurabh Shah | 56f610d | 2012-08-07 15:27:06 -0700 | [diff] [blame] | 33 | namespace qService { |
| 34 | // ---------------------------------------------------------------------------- |
Naseer Ahmed | 4957c52 | 2013-11-12 18:07:15 -0500 | [diff] [blame] | 35 | |
Saurabh Shah | 56f610d | 2012-08-07 15:27:06 -0700 | [diff] [blame] | 36 | class IQService : public android::IInterface |
| 37 | { |
| 38 | public: |
| 39 | DECLARE_META_INTERFACE(QService); |
| 40 | enum { |
Naseer Ahmed | 4957c52 | 2013-11-12 18:07:15 -0500 | [diff] [blame] | 41 | COMMAND_LIST_START = android::IBinder::FIRST_CALL_TRANSACTION, |
| 42 | SECURING, // Hardware securing start/end notification |
| 43 | UNSECURING, // Hardware unsecuring start/end notification |
| 44 | CONNECT, // Connect to qservice |
| 45 | SCREEN_REFRESH, // Refresh screen through SF invalidate |
| 46 | EXTERNAL_ORIENTATION, // Set external orientation |
| 47 | BUFFER_MIRRORMODE, // Buffer mirrormode |
Naseer Ahmed | 78c952e | 2013-11-25 18:12:23 -0500 | [diff] [blame] | 48 | CHECK_EXTERNAL_STATUS, // Check status of external display |
| 49 | GET_DISPLAY_ATTRIBUTES, // Get display attributes |
| 50 | SET_HSIC_DATA, // Set HSIC on dspp |
Arun Kumar K.R | 8e7a62f | 2013-12-06 18:55:41 -0800 | [diff] [blame] | 51 | GET_DISPLAY_VISIBLE_REGION, // Get the visibleRegion for dpy |
Arun Kumar K.R | 33888f5 | 2014-10-09 15:56:33 -0700 | [diff] [blame] | 52 | SET_SECONDARY_DISPLAY_STATUS, // Sets secondary display status |
Jeykumar Sankaran | be93e27 | 2014-06-19 18:15:57 -0700 | [diff] [blame] | 53 | SET_MAX_PIPES_PER_MIXER, // Set max pipes per mixer for MDPComp |
Ramkumar Radhakrishnan | 0a021a8 | 2014-05-19 19:53:56 -0700 | [diff] [blame] | 54 | SET_VIEW_FRAME, // Set view frame of display |
Naseer Ahmed | 35a268c | 2014-06-24 19:07:13 -0400 | [diff] [blame] | 55 | DYNAMIC_DEBUG, // Enable more logging on the fly |
Saurabh Shah | 59562ff | 2014-09-30 16:13:12 -0700 | [diff] [blame] | 56 | SET_IDLE_TIMEOUT, // Set idle timeout for GPU fallback |
Naseer Ahmed | 4957c52 | 2013-11-12 18:07:15 -0500 | [diff] [blame] | 57 | COMMAND_LIST_END = 400, |
Saurabh Shah | 56f610d | 2012-08-07 15:27:06 -0700 | [diff] [blame] | 58 | }; |
Naseer Ahmed | 4957c52 | 2013-11-12 18:07:15 -0500 | [diff] [blame] | 59 | |
Saurabh Shah | 56f610d | 2012-08-07 15:27:06 -0700 | [diff] [blame] | 60 | enum { |
| 61 | END = 0, |
| 62 | START, |
| 63 | }; |
Naseer Ahmed | 4957c52 | 2013-11-12 18:07:15 -0500 | [diff] [blame] | 64 | |
Naseer Ahmed | 35a268c | 2014-06-24 19:07:13 -0400 | [diff] [blame] | 65 | enum { |
| 66 | DEBUG_ALL, |
| 67 | DEBUG_MDPCOMP, |
| 68 | DEBUG_VSYNC, |
Saurabh Shah | 24eec8a | 2014-08-22 15:07:25 -0700 | [diff] [blame] | 69 | DEBUG_VD, |
| 70 | DEBUG_PIPE_LIFECYCLE, |
Naseer Ahmed | 35a268c | 2014-06-24 19:07:13 -0400 | [diff] [blame] | 71 | }; |
| 72 | |
Naseer Ahmed | 4957c52 | 2013-11-12 18:07:15 -0500 | [diff] [blame] | 73 | // Register a client that can be notified |
Saurabh Shah | 86c1729 | 2013-02-08 15:24:13 -0800 | [diff] [blame] | 74 | virtual void connect(const android::sp<qClient::IQClient>& client) = 0; |
Naseer Ahmed | 4957c52 | 2013-11-12 18:07:15 -0500 | [diff] [blame] | 75 | // Generic function to dispatch binder commands |
| 76 | // The type of command decides how the data is parceled |
| 77 | virtual android::status_t dispatch(uint32_t command, |
| 78 | const android::Parcel* inParcel, |
| 79 | android::Parcel* outParcel) = 0; |
Saurabh Shah | 56f610d | 2012-08-07 15:27:06 -0700 | [diff] [blame] | 80 | }; |
| 81 | |
| 82 | // ---------------------------------------------------------------------------- |
| 83 | |
| 84 | class BnQService : public android::BnInterface<IQService> |
| 85 | { |
| 86 | public: |
| 87 | virtual android::status_t onTransact( uint32_t code, |
| 88 | const android::Parcel& data, |
| 89 | android::Parcel* reply, |
| 90 | uint32_t flags = 0); |
| 91 | }; |
| 92 | |
| 93 | // ---------------------------------------------------------------------------- |
| 94 | }; // namespace qService |
| 95 | |
| 96 | #endif // ANDROID_IQSERVICE_H |