blob: 683c93c4ec3fb53b77a80676a6cb3c9fc3590b78 [file] [log] [blame]
Saurabh Shah56f610d2012-08-07 15:27:06 -07001/*
2 * Copyright (C) 2010 The Android Open Source Project
Arun Kumar K.Rc62935a2013-12-03 16:47:47 -08003 * Copyright (C) 2012-2014, 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>
Saurabh Shah56f610d2012-08-07 15:27:06 -070031
Naseer Ahmed4957c522013-11-12 18:07:15 -050032
Saurabh Shah56f610d2012-08-07 15:27:06 -070033namespace qService {
34// ----------------------------------------------------------------------------
Naseer Ahmed4957c522013-11-12 18:07:15 -050035
Saurabh Shah56f610d2012-08-07 15:27:06 -070036class IQService : public android::IInterface
37{
38public:
39 DECLARE_META_INTERFACE(QService);
40 enum {
Naseer Ahmed4957c522013-11-12 18:07:15 -050041 COMMAND_LIST_START = android::IBinder::FIRST_CALL_TRANSACTION,
Saurabh Shahcd018352014-11-11 13:54:19 -080042 SECURING = 2, // Hardware securing start/end notification
43 UNSECURING = 3, // Hardware unsecuring start/end notification
44 CONNECT = 4, // Connect to qservice
45 SCREEN_REFRESH = 5, // Refresh screen through SF invalidate
46 EXTERNAL_ORIENTATION = 6,// Set external orientation
47 BUFFER_MIRRORMODE = 7, // Buffer mirrormode
48 CHECK_EXTERNAL_STATUS = 8,// Check status of external display
49 GET_DISPLAY_ATTRIBUTES = 9,// Get display attributes
50 SET_HSIC_DATA = 10, // Set HSIC on dspp
51 GET_DISPLAY_VISIBLE_REGION = 11,// Get the visibleRegion for dpy
52 SET_SECONDARY_DISPLAY_STATUS = 12,// Sets secondary display status
53 SET_MAX_PIPES_PER_MIXER = 13,// Set max pipes per mixer for MDPComp
54 SET_VIEW_FRAME = 14, // Set view frame of display
55 DYNAMIC_DEBUG = 15, // Enable more logging on the fly
56 SET_IDLE_TIMEOUT = 16, // Set idle timeout for GPU fallback
57 TOGGLE_BWC = 17, // Toggle BWC On/Off on targets that support
Raj Kamal0d53fc62014-11-25 17:36:36 +053058 /* Enable/Disable/Set refresh rate dynamically */
59 CONFIGURE_DYN_REFRESH_RATE = 18,
Naseer Ahmed4957c522013-11-12 18:07:15 -050060 COMMAND_LIST_END = 400,
Saurabh Shah56f610d2012-08-07 15:27:06 -070061 };
Naseer Ahmed4957c522013-11-12 18:07:15 -050062
Saurabh Shah56f610d2012-08-07 15:27:06 -070063 enum {
64 END = 0,
65 START,
66 };
Naseer Ahmed4957c522013-11-12 18:07:15 -050067
Naseer Ahmed35a268c2014-06-24 19:07:13 -040068 enum {
69 DEBUG_ALL,
70 DEBUG_MDPCOMP,
71 DEBUG_VSYNC,
Saurabh Shah24eec8a2014-08-22 15:07:25 -070072 DEBUG_VD,
73 DEBUG_PIPE_LIFECYCLE,
Naseer Ahmed35a268c2014-06-24 19:07:13 -040074 };
75
Naseer Ahmed4957c522013-11-12 18:07:15 -050076 // Register a client that can be notified
Saurabh Shah86c17292013-02-08 15:24:13 -080077 virtual void connect(const android::sp<qClient::IQClient>& client) = 0;
Naseer Ahmed4957c522013-11-12 18:07:15 -050078 // Generic function to dispatch binder commands
79 // The type of command decides how the data is parceled
80 virtual android::status_t dispatch(uint32_t command,
81 const android::Parcel* inParcel,
82 android::Parcel* outParcel) = 0;
Saurabh Shah56f610d2012-08-07 15:27:06 -070083};
84
85// ----------------------------------------------------------------------------
86
87class BnQService : public android::BnInterface<IQService>
88{
89public:
90 virtual android::status_t onTransact( uint32_t code,
91 const android::Parcel& data,
92 android::Parcel* reply,
93 uint32_t flags = 0);
94};
95
96// ----------------------------------------------------------------------------
97}; // namespace qService
98
99#endif // ANDROID_IQSERVICE_H