blob: 78cbd2aea3048b213562b4a4b7efc1a3957e080d [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>
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 {
Naseer Ahmed4957c522013-11-12 18:07:15 -050042 COMMAND_LIST_START = android::IBinder::FIRST_CALL_TRANSACTION,
Saurabh Shahcd018352014-11-11 13:54:19 -080043 SECURING = 2, // Hardware securing start/end notification
44 UNSECURING = 3, // Hardware unsecuring start/end notification
Naseer Ahmed7a7b66d2014-07-23 17:56:26 -040045 CONNECT_HWC_CLIENT = 4, // Connect to qservice
Saurabh Shahcd018352014-11-11 13:54:19 -080046 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 Kamal0d53fc62014-11-25 17:36:36 +053059 /* Enable/Disable/Set refresh rate dynamically */
Arun Kumar K.Rf2d85a72014-12-10 19:19:10 -080060 CONFIGURE_DYN_REFRESH_RATE = 18,
61 SET_PARTIAL_UPDATE = 19, // Preference on partial update feature
Naseer Ahmed78951b22014-12-10 18:19:21 -050062 TOGGLE_SCREEN_UPDATE = 20, // Provides ability to disable screen updates
Ramkumar Radhakrishnan952081f2015-01-30 18:25:32 -080063 SET_FRAME_DUMP_CONFIG = 21, // Provides ability to set the frame dump config
Naseer Ahmed6bbd0a12015-01-23 11:57:10 -050064 SET_S3D_MODE = 22, // Set the 3D mode as specified in msm_hdmi_modes.h
Naseer Ahmed7a7b66d2014-07-23 17:56:26 -040065 CONNECT_HDMI_CLIENT = 23, // Connect HDMI CEC HAL Client
Naseer Ahmed4957c522013-11-12 18:07:15 -050066 COMMAND_LIST_END = 400,
Saurabh Shah56f610d2012-08-07 15:27:06 -070067 };
Naseer Ahmed4957c522013-11-12 18:07:15 -050068
Saurabh Shah56f610d2012-08-07 15:27:06 -070069 enum {
70 END = 0,
71 START,
72 };
Naseer Ahmed4957c522013-11-12 18:07:15 -050073
Naseer Ahmed35a268c2014-06-24 19:07:13 -040074 enum {
75 DEBUG_ALL,
76 DEBUG_MDPCOMP,
77 DEBUG_VSYNC,
Saurabh Shah24eec8a2014-08-22 15:07:25 -070078 DEBUG_VD,
79 DEBUG_PIPE_LIFECYCLE,
Ramkumar Radhakrishnanbefbdbe2015-01-14 20:14:40 -080080 DEBUG_DRIVER_CONFIG,
81 DEBUG_ROTATOR,
Naseer Ahmed35a268c2014-06-24 19:07:13 -040082 };
83
Ramkumar Radhakrishnan952081f2015-01-30 18:25:32 -080084 enum {
85 DUMP_PRIMARY_DISPLAY,
86 DUMP_HDMI_DISPLAY,
87 DUMP_VIRTUAL_DISPLAY,
88 };
89
Naseer Ahmed7a7b66d2014-07-23 17:56:26 -040090 // Register a HWC client that can be notified
91 // This client is generic and is intended to get
92 // dispatches of all events calling into QService
Saurabh Shah86c17292013-02-08 15:24:13 -080093 virtual void connect(const android::sp<qClient::IQClient>& client) = 0;
Naseer Ahmed7a7b66d2014-07-23 17:56:26 -040094 // Register an HDMI client. This client gets notification of HDMI events
95 // such as plug/unplug and CEC messages
96 virtual void connect(const android::sp<qClient::IQHDMIClient>& client) = 0;
Naseer Ahmed4957c522013-11-12 18:07:15 -050097 // Generic function to dispatch binder commands
98 // The type of command decides how the data is parceled
99 virtual android::status_t dispatch(uint32_t command,
100 const android::Parcel* inParcel,
101 android::Parcel* outParcel) = 0;
Saurabh Shah56f610d2012-08-07 15:27:06 -0700102};
103
104// ----------------------------------------------------------------------------
105
106class BnQService : public android::BnInterface<IQService>
107{
108public:
109 virtual android::status_t onTransact( uint32_t code,
110 const android::Parcel& data,
111 android::Parcel* reply,
112 uint32_t flags = 0);
113};
114
115// ----------------------------------------------------------------------------
116}; // namespace qService
117
118#endif // ANDROID_IQSERVICE_H