drm_hwcomposer: Implement getDisplayPhysicalOrientation()
Implement ComposerClient::getDisplayPhysicalOrientation() by querying
the DRM display panel orientation property and translating the result to
the correct common::Transform enum value.
The result is used by SurfaceFlinger to correctly rotate the image
before displaying it to the user.
Signed-off-by: Tim Van Patten <timvp@google.com>
diff --git a/compositor/DisplayInfo.h b/compositor/DisplayInfo.h
new file mode 100644
index 0000000..bbcbff8
--- /dev/null
+++ b/compositor/DisplayInfo.h
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include <cstdint>
+
+enum class Colorspace : int32_t {
+ kDefault,
+ kSmpte170MYcc,
+ kBt709Ycc,
+ kXvycc601,
+ kXvycc709,
+ kSycc601,
+ kOpycc601,
+ kOprgb,
+ kBt2020Cycc,
+ kBt2020Rgb,
+ kBt2020Ycc,
+ kDciP3RgbD65,
+ kDciP3RgbTheater,
+ kRgbWideFixed,
+ kRgbWideFloat,
+ kBt601Ycc,
+};
+
+/**
+ * Display panel orientation property values.
+ */
+enum PanelOrientation {
+ kModePanelOrientationNormal = 0,
+ kModePanelOrientationBottomUp,
+ kModePanelOrientationLeftUp,
+ kModePanelOrientationRightUp
+};