1*4d7e907cSAndroid Build Coastguard Worker/* 2*4d7e907cSAndroid Build Coastguard Worker * Copyright (C) 2016 The Android Open Source Project 3*4d7e907cSAndroid Build Coastguard Worker * 4*4d7e907cSAndroid Build Coastguard Worker * Licensed under the Apache License, Version 2.0 (the "License"); 5*4d7e907cSAndroid Build Coastguard Worker * you may not use this file except in compliance with the License. 6*4d7e907cSAndroid Build Coastguard Worker * You may obtain a copy of the License at 7*4d7e907cSAndroid Build Coastguard Worker * 8*4d7e907cSAndroid Build Coastguard Worker * http://www.apache.org/licenses/LICENSE-2.0 9*4d7e907cSAndroid Build Coastguard Worker * 10*4d7e907cSAndroid Build Coastguard Worker * Unless required by applicable law or agreed to in writing, software 11*4d7e907cSAndroid Build Coastguard Worker * distributed under the License is distributed on an "AS IS" BASIS, 12*4d7e907cSAndroid Build Coastguard Worker * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13*4d7e907cSAndroid Build Coastguard Worker * See the License for the specific language governing permissions and 14*4d7e907cSAndroid Build Coastguard Worker * limitations under the License. 15*4d7e907cSAndroid Build Coastguard Worker */ 16*4d7e907cSAndroid Build Coastguard Worker 17*4d7e907cSAndroid Build Coastguard Workerpackage [email protected]; 18*4d7e907cSAndroid Build Coastguard Worker 19*4d7e907cSAndroid Build Coastguard Workerinterface IComposerCallback { 20*4d7e907cSAndroid Build Coastguard Worker enum Connection : int32_t { 21*4d7e907cSAndroid Build Coastguard Worker INVALID = 0, 22*4d7e907cSAndroid Build Coastguard Worker 23*4d7e907cSAndroid Build Coastguard Worker /** The display has been connected */ 24*4d7e907cSAndroid Build Coastguard Worker CONNECTED = 1, 25*4d7e907cSAndroid Build Coastguard Worker /** The display has been disconnected */ 26*4d7e907cSAndroid Build Coastguard Worker DISCONNECTED = 2, 27*4d7e907cSAndroid Build Coastguard Worker }; 28*4d7e907cSAndroid Build Coastguard Worker 29*4d7e907cSAndroid Build Coastguard Worker /** 30*4d7e907cSAndroid Build Coastguard Worker * Notifies the client that the given display has either been connected or 31*4d7e907cSAndroid Build Coastguard Worker * disconnected. Every active display (even a built-in physical display) 32*4d7e907cSAndroid Build Coastguard Worker * must trigger at least one hotplug notification, even if it only occurs 33*4d7e907cSAndroid Build Coastguard Worker * immediately after callback registration. 34*4d7e907cSAndroid Build Coastguard Worker * 35*4d7e907cSAndroid Build Coastguard Worker * Displays which have been connected are assumed to be in PowerMode::OFF, 36*4d7e907cSAndroid Build Coastguard Worker * and the onVsync callback should not be called for a display until vsync 37*4d7e907cSAndroid Build Coastguard Worker * has been enabled with setVsyncEnabled. 38*4d7e907cSAndroid Build Coastguard Worker * 39*4d7e907cSAndroid Build Coastguard Worker * The client may call back into the device while the callback is in 40*4d7e907cSAndroid Build Coastguard Worker * progress. The device must serialize calls to this callback such that 41*4d7e907cSAndroid Build Coastguard Worker * only one thread is calling it at a time. 42*4d7e907cSAndroid Build Coastguard Worker * 43*4d7e907cSAndroid Build Coastguard Worker * @param display is the display that triggers the hotplug event. 44*4d7e907cSAndroid Build Coastguard Worker * @param connected indicates whether the display is connected or 45*4d7e907cSAndroid Build Coastguard Worker * disconnected. 46*4d7e907cSAndroid Build Coastguard Worker */ 47*4d7e907cSAndroid Build Coastguard Worker @callflow(next="*") 48*4d7e907cSAndroid Build Coastguard Worker onHotplug(Display display, Connection connected); 49*4d7e907cSAndroid Build Coastguard Worker 50*4d7e907cSAndroid Build Coastguard Worker /** 51*4d7e907cSAndroid Build Coastguard Worker * Notifies the client to trigger a screen refresh. This forces all layer 52*4d7e907cSAndroid Build Coastguard Worker * state for this display to be resent, and the display to be validated 53*4d7e907cSAndroid Build Coastguard Worker * and presented, even if there have been no changes. 54*4d7e907cSAndroid Build Coastguard Worker 55*4d7e907cSAndroid Build Coastguard Worker * This refresh will occur some time after the callback is initiated, but 56*4d7e907cSAndroid Build Coastguard Worker * not necessarily before it returns. It is safe to trigger this callback 57*4d7e907cSAndroid Build Coastguard Worker * from other functions which call into the device. 58*4d7e907cSAndroid Build Coastguard Worker * 59*4d7e907cSAndroid Build Coastguard Worker * @param display is the display to refresh. 60*4d7e907cSAndroid Build Coastguard Worker */ 61*4d7e907cSAndroid Build Coastguard Worker @callflow(next="*") 62*4d7e907cSAndroid Build Coastguard Worker oneway onRefresh(Display display); 63*4d7e907cSAndroid Build Coastguard Worker 64*4d7e907cSAndroid Build Coastguard Worker /** 65*4d7e907cSAndroid Build Coastguard Worker * Notifies the client that a vsync event has occurred. This callback must 66*4d7e907cSAndroid Build Coastguard Worker * only be triggered when vsync is enabled for this display (through 67*4d7e907cSAndroid Build Coastguard Worker * setVsyncEnabled). 68*4d7e907cSAndroid Build Coastguard Worker * 69*4d7e907cSAndroid Build Coastguard Worker * @param display is the display which has received a vsync event 70*4d7e907cSAndroid Build Coastguard Worker * @param timestamp is the CLOCK_MONOTONIC time at which the vsync event 71*4d7e907cSAndroid Build Coastguard Worker * occurred, in nanoseconds. 72*4d7e907cSAndroid Build Coastguard Worker */ 73*4d7e907cSAndroid Build Coastguard Worker @callflow(next="*") 74*4d7e907cSAndroid Build Coastguard Worker oneway onVsync(Display display, int64_t timestamp); 75*4d7e907cSAndroid Build Coastguard Worker}; 76