blob: ddb9bbd4bc888ca40be59438686a7cd0014cc559 [file] [log] [blame]
Dominik Laskowski3cb3d4e2019-11-21 11:14:45 -08001/*
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
17#pragma once
18
Marin Shalamanov228f46b2021-01-28 21:11:45 +010019#include <cstdint>
Dominik Laskowski3cb3d4e2019-11-21 11:14:45 -080020#include <type_traits>
21
Marc Kassisbdf7e4b2022-11-04 17:26:48 +010022#include <ui/GraphicTypes.h>
Dominik Laskowski3cb3d4e2019-11-21 11:14:45 -080023#include <ui/Size.h>
Marin Shalamanov228f46b2021-01-28 21:11:45 +010024#include <utils/Flattenable.h>
Dominik Laskowski3cb3d4e2019-11-21 11:14:45 -080025#include <utils/Timers.h>
26
Marin Shalamanova7fe3042021-01-29 21:02:08 +010027namespace android::ui {
Dominik Laskowski3cb3d4e2019-11-21 11:14:45 -080028
Marin Shalamanov228f46b2021-01-28 21:11:45 +010029// This value is going to be serialized over binder so we prefer a fixed width type.
30using DisplayModeId = int32_t;
31
Marin Shalamanova7fe3042021-01-29 21:02:08 +010032// Mode supported by physical display.
Huihong Luo38603fd2022-02-21 14:32:54 -080033struct DisplayMode {
Marin Shalamanov228f46b2021-01-28 21:11:45 +010034 DisplayModeId id;
Dominik Laskowski3cb3d4e2019-11-21 11:14:45 -080035 ui::Size resolution;
36 float xDpi = 0;
37 float yDpi = 0;
Marc Kassisbdf7e4b2022-11-04 17:26:48 +010038 std::vector<ui::Hdr> supportedHdrTypes;
Dominik Laskowski3cb3d4e2019-11-21 11:14:45 -080039
Alec Mourid122a1c2023-09-30 01:36:33 +000040 // Some modes have peak refresh rate lower than the panel vsync rate.
Alec Mouri55e31032023-10-02 20:34:18 +000041 float peakRefreshRate = 0.f;
Alec Mourid122a1c2023-09-30 01:36:33 +000042 float vsyncRate = 0.f;
Dominik Laskowski3cb3d4e2019-11-21 11:14:45 -080043 nsecs_t appVsyncOffset = 0;
44 nsecs_t sfVsyncOffset = 0;
45 nsecs_t presentationDeadline = 0;
Marin Shalamanov228f46b2021-01-28 21:11:45 +010046 int32_t group = -1;
Marin Shalamanov228f46b2021-01-28 21:11:45 +010047};
Dominik Laskowski3cb3d4e2019-11-21 11:14:45 -080048
Marin Shalamanova7fe3042021-01-29 21:02:08 +010049} // namespace android::ui