From 687a100da4d8b9681c90a862c6b158973e70e592 Mon Sep 17 00:00:00 2001 From: Samuel Dionne-Riel Date: Tue, 24 Dec 2019 19:41:17 -0500 Subject: [PATCH] quirks: Implement qualcomm framebuffer quirks as tasks --- modules/module-list.nix | 2 +- modules/quirks/qualcomm/default.nix | 5 +++++ .../qualcomm/framebuffer.nix} | 8 ++------ modules/quirks/qualcomm/msm-fb-handle-task.rb | 11 +++++++++++ modules/quirks/qualcomm/msm-fb-refresher-task.rb | 11 +++++++++++ 5 files changed, 30 insertions(+), 7 deletions(-) create mode 100644 modules/quirks/qualcomm/default.nix rename modules/{quirks-qualcomm.nix => quirks/qualcomm/framebuffer.nix} (90%) create mode 100644 modules/quirks/qualcomm/msm-fb-handle-task.rb create mode 100644 modules/quirks/qualcomm/msm-fb-refresher-task.rb diff --git a/modules/module-list.nix b/modules/module-list.nix index 886f65f9..b0b276be 100644 --- a/modules/module-list.nix +++ b/modules/module-list.nix @@ -28,7 +28,7 @@ ./initrd.nix ./mobile-device.nix ./nixpkgs.nix - ./quirks-qualcomm.nix + ./quirks/qualcomm/default.nix ./system-target.nix ./system-types.nix ] diff --git a/modules/quirks/qualcomm/default.nix b/modules/quirks/qualcomm/default.nix new file mode 100644 index 00000000..21aa2372 --- /dev/null +++ b/modules/quirks/qualcomm/default.nix @@ -0,0 +1,5 @@ +{ + imports = [ + ./framebuffer.nix + ]; +} diff --git a/modules/quirks-qualcomm.nix b/modules/quirks/qualcomm/framebuffer.nix similarity index 90% rename from modules/quirks-qualcomm.nix rename to modules/quirks/qualcomm/framebuffer.nix index 909a2fe0..b13449a2 100644 --- a/modules/quirks-qualcomm.nix +++ b/modules/quirks/qualcomm/framebuffer.nix @@ -34,9 +34,7 @@ in extraUtils = with pkgs; [ msm-fb-handle ]; - initFramebuffer = '' - msm-fb-handle & - ''; + tasks = [ ./msm-fb-handle-task.rb ]; }; }) (mkIf cfg.msm-fb-refresher.enable { @@ -44,9 +42,7 @@ in extraUtils = with pkgs; [ msm-fb-refresher ]; - initFramebuffer = '' - msm-fb-refresher --loop & - ''; + tasks = [ ./msm-fb-refresher-task.rb ]; }; }) ]; diff --git a/modules/quirks/qualcomm/msm-fb-handle-task.rb b/modules/quirks/qualcomm/msm-fb-handle-task.rb new file mode 100644 index 00000000..5fcbffe8 --- /dev/null +++ b/modules/quirks/qualcomm/msm-fb-handle-task.rb @@ -0,0 +1,11 @@ +class Tasks::MSMFBHandle < SingletonTask + def initialize() + add_dependency(:SingletonTask, :Graphics) + end + + def run() + @pid = System.spawn("msm-fb-handle") + end + + # FIXME: cleanup when cleanup is implemented +end diff --git a/modules/quirks/qualcomm/msm-fb-refresher-task.rb b/modules/quirks/qualcomm/msm-fb-refresher-task.rb new file mode 100644 index 00000000..6cc2c97d --- /dev/null +++ b/modules/quirks/qualcomm/msm-fb-refresher-task.rb @@ -0,0 +1,11 @@ +class Tasks::MSMFBRefresher < SingletonTask + def initialize() + add_dependency(:SingletonTask, :Graphics) + end + + def run() + @pid = System.spawn("msm-fb-refresher", "--loop") + end + + # FIXME: cleanup when cleanup is implemented +end