boot/init: Graphics can also mean DRM
# Ensures graphics have been initialized and are ready to be used.
-#
-# Currently this only handles the "legacy fbdev" style of framebuffers.
class Tasks::Graphics < SingletonTask
+ def initialize()
+ add_dependency(
+ :Any,
+ Dependencies::Task.new(FBDev.instance),
+ Dependencies::Task.new(DRM.instance),
+ )
+
+ # Make the Graphics target depend on this task.
+ Targets[:Graphics].add_dependency(:Task, self)
+ end
+
+ def run()
+ # no-op
+ end
+
+ def ux_priority()
+ -100
+ end
+end
+
+# Handles the "legacy fbdev" style of framebuffers.
+class Tasks::Graphics::FBDev < SingletonTask
def initialize()
add_dependency(
:Files,
@@ -11,9 +31,6 @@ class Tasks::Graphics < SingletonTask
# This is only incidental to the fact that /dev/fb0 wouldn't exist for
# users of the "Graphics" dependency.
add_dependency(:Mount, "/dev")
-
- # Make the Graphics target depend on this task.
- Targets[:Graphics].add_dependency(:Task, self)
end
def run()
@@ -26,3 +43,23 @@ class Tasks::Graphics < SingletonTask
-100
end
end
+
+# Handles DRM
+# (Does nothing, only handles dependencies)
+class Tasks::Graphics::DRM < SingletonTask
+ def initialize()
+ add_dependency(
+ :Files,
+ "/dev/dri/card0",
+ )
+ add_dependency(:Mount, "/dev")
+ end
+
+ def run()
+ # no-op
+ end
+
+ def ux_priority()
+ -100
+ end
+end
