1/*
2 * Copyright 2019 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
17package [email protected];
18
19import @2.1::Display;
20import @2.1::IComposerCallback;
21
22interface IComposerCallback extends @2.1::IComposerCallback {
23    /**
24     * Notifies the client that a vsync event has occurred. This callback must
25     * only be triggered when vsync is enabled for this display (through
26     * setVsyncEnabled).
27     *
28     * @param display is the display which has received a vsync event
29     * @param timestamp is the CLOCK_MONOTONIC time at which the vsync event
30     *        occurred, in nanoseconds.
31     * @param vsyncPeriodNanos is the display vsync period in nanoseconds i.e. the next onVsync_2_4
32     *        is expected to be called vsyncPeriodNanos nanoseconds after this call.
33     */
34    oneway onVsync_2_4(Display display, int64_t timestamp, VsyncPeriodNanos vsyncPeriodNanos);
35
36    /**
37     * Notifies the client that the previously reported timing for vsync period change has been
38     * updated. This may occur if the composer missed the deadline for changing the vsync period
39     * or the client submitted a refresh frame too late.
40     *
41     * @param display is the display which vsync period change is in progress
42     * @param updatedTimeline is the new timeline for the vsync period change.
43     */
44    oneway onVsyncPeriodTimingChanged(Display display, VsyncPeriodChangeTimeline updatedTimeline);
45
46    /**
47     * Notifies the client that the conditions which previously led to returning
48     * SEAMLESS_NOT_POSSIBLE from setActiveConfigWithConstraints have changed and now seamless may
49     * be possible. Client should retry calling setActiveConfigWithConstraints.
50     *
51     * @param display is a display setActiveConfigWithConstraints previously failed with
52     * SEAMLESS_NOT_POSSIBLE.
53     */
54    oneway onSeamlessPossible(Display display);
55};
56