OSDN Git Service

Implement DRM hotplug events
[android-x86/external-drmfb-composer.git] / DrmHotplugThread.h
diff --git a/DrmHotplugThread.h b/DrmHotplugThread.h
new file mode 100644 (file)
index 0000000..bdfe767
--- /dev/null
@@ -0,0 +1,34 @@
+// SPDX-License-Identifier: Apache-2.0
+// Copyright (C) 2019 Stephan Gerhold
+
+#pragma once
+
+#include "GraphicsThread.h"
+
+namespace android {
+namespace hardware {
+namespace graphics {
+namespace composer {
+namespace V2_1 {
+namespace drmfb {
+
+struct DrmDevice;
+
+struct DrmHotplugThread : public GraphicsThread {
+    DrmHotplugThread(DrmDevice& device);
+
+protected:
+    void work(std::unique_lock<std::mutex>& lock) override;
+
+private:
+    bool receiveEvent(int fd);
+
+    DrmDevice& mDevice;
+};
+
+}  // namespace drmfb
+}  // namespace V2_1
+}  // namespace composer
+}  // namespace graphics
+}  // namespace hardware
+}  // namespace android