1 /* 2 * Copyright (C) 2010 The Android Open Source Project 3 * Copyright (C) 2012-2015, The Linux Foundation. All rights reserved. 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> 29 #include <binder/IBinder.h> 30 #include <IQClient.h> 31 32 33 namespace qService { 34 // ---------------------------------------------------------------------------- 35 36 class IQService : public android::IInterface 37 { 38 public: 39 DECLARE_META_INTERFACE(QService); 40 enum { 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 48 CHECK_EXTERNAL_STATUS, // Check status of external display 49 GET_DISPLAY_ATTRIBUTES, // Get display attributes 50 SET_HSIC_DATA, // Set HSIC on dspp 51 GET_DISPLAY_VISIBLE_REGION, // Get the visibleRegion for dpy 52 SET_SECONDARY_DISPLAY_STATUS, // Sets secondary display status 53 SET_PARTIAL_UPDATE, // Preference on partial update feature 54 SET_VIEW_FRAME, // Set view frame of display 55 DYNAMIC_DEBUG, // Enable more logging on the fly 56 SET_IDLE_TIMEOUT, // Set idle timeout for GPU fallback 57 /* Enable/Disable/Set refresh rate dynamically */ 58 CONFIGURE_DYN_REFRESH_RATE, 59 QDCM_SVC_CMDS, // request QDCM services. 60 TOGGLE_SCREEN_UPDATE, // Provides ability to disable screen updates 61 COMMAND_LIST_END = 400, 62 }; 63 64 enum { 65 END = 0, 66 START, 67 }; 68 69 enum { 70 DEBUG_ALL, 71 DEBUG_MDPCOMP, 72 DEBUG_VSYNC, 73 DEBUG_VD, 74 DEBUG_PIPE_LIFECYCLE, 75 }; 76 77 enum { 78 PREF_POST_PROCESSING, 79 PREF_PARTIAL_UPDATE, 80 ENABLE_PARTIAL_UPDATE, 81 }; 82 83 // Register a client that can be notified 84 virtual void connect(const android::sp<qClient::IQClient>& client) = 0; 85 // Generic function to dispatch binder commands 86 // The type of command decides how the data is parceled 87 virtual android::status_t dispatch(uint32_t command, 88 const android::Parcel* inParcel, 89 android::Parcel* outParcel) = 0; 90 }; 91 92 // ---------------------------------------------------------------------------- 93 94 class BnQService : public android::BnInterface<IQService> 95 { 96 public: 97 virtual android::status_t onTransact( uint32_t code, 98 const android::Parcel& data, 99 android::Parcel* reply, 100 uint32_t flags = 0); 101 }; 102 103 // ---------------------------------------------------------------------------- 104 }; // namespace qService 105 106 #endif // ANDROID_IQSERVICE_H 107