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