summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--flake.nix11
-rw-r--r--hardware/cmsb-001/configuration.nix34
-rw-r--r--hardware/cmsb-001/vc4-kms-v3d-overlay.dts122
-rw-r--r--meson.build19
-rw-r--r--meson_options.txt1
-rw-r--r--subprojects/stela.wrap2
6 files changed, 166 insertions, 23 deletions
diff --git a/flake.nix b/flake.nix
index bddf11a..a0fa002 100644
--- a/flake.nix
+++ b/flake.nix
@@ -40,7 +40,7 @@
version = "0.01";
src = fetchgit {
url = "https://git.akon.city/camu";
- rev = "65b12673bd4d253756e5a0dab455f9935c54b019";
+ rev = "80c5b241c7c6e0fd7e693e0ff36cfebe9cf434a5";
postFetch = ''
export NIX_SSL_CERT_FILE=${cacert}/etc/ssl/certs/ca-bundle.crt
@@ -58,7 +58,7 @@
find subprojects -type d -name .git -prune -execdir rm -r {} +
'';
- sha256 = "QR6bGzHF7AM66Qd3sVMCqGskWsIQuentvgEaLimafR8=";
+ sha256 = "Di1Pt0F53wJ43yPuT5r/MoZcohYCYEWN8pThj0JnIo4=";
};
outputs = [ "out" "dev" ];
nativeBuildInputs = [
@@ -117,6 +117,7 @@
wayland-protocols
wlr-protocols
egl-wayland
+ libraspberrypi
(notcurses.override { multimediaSupport = false; qrcodegenSupport = false; })
libsodium
];
@@ -287,7 +288,11 @@
system = system;
modules = [
({ pkgs, ... }: { nixpkgs.overlays = [
- (self: super: { camu = packages.${system}.default; })
+ (self: super: {
+ camu = packages.${system}.default.overrideAttrs (oldAttrs: {
+ #mesonFlags = ["-Dsink-for-rpi=true"];
+ });
+ })
];})
nixos-hardware.nixosModules.raspberry-pi-3
./hardware/cmsb-001/configuration.nix
diff --git a/hardware/cmsb-001/configuration.nix b/hardware/cmsb-001/configuration.nix
index bbff4e1..799065a 100644
--- a/hardware/cmsb-001/configuration.nix
+++ b/hardware/cmsb-001/configuration.nix
@@ -38,16 +38,14 @@
"usbhid"
"usb_storage"
"vc4"
- "reset-raspberrypi"
+ "v3d"
"bcm2835_dma"
"i2c_bcm2835"
+ "reset-raspberrypi"
];
- boot.kernelModules = [ ];
+ boot.initrd.kernelModules = [];
boot.kernelParams = [ "mitigations=off" "file_caps=1" ];
boot.blacklistedKernelModules = [ "snd_bcm2835" ];
- boot.supportedFilesystems = [ ];
- boot.extraModulePackages = [ ];
- boot.initrd.kernelModules = [ ];
hardware.enableRedistributableFirmware = true;
hardware.graphics.enable = true;
@@ -137,10 +135,11 @@
user = "akiyo";
environment = {
WLR_LIBINPUT_NO_DEVICES = "1";
- LIBGL_ALWAYS_SOFTWARE = "1";
};
program = "${pkgs.camu}/bin/cmv";
};
+ systemd.services."cage-tty1".serviceConfig.StandardOutput = lib.mkForce "journal+console";
+ systemd.services."cage-tty1".wantedBy = [];
# https://pablo.tools/blog/computers/nixos-generate-raspberry-images/
#sdImage = {
@@ -158,6 +157,18 @@
# '';
#};
+ # https://retropie.org.uk/docs/Overclocking/
+ # BOOT/config.txt (changes)
+ # gpu_mem=64
+ # total_mem=1024
+ # arm_freq=1300
+ # gpu_freq=500
+ # core_freq=500
+ # sdram_freq=500
+ # sdram_schmoo=0x02000020
+ # over_voltage=2
+ # over_voltage_sdram=2
+
# https://github.com/NixOS/nixos-hardware/issues/631
hardware.deviceTree = {
enable = true;
@@ -172,10 +183,15 @@
name = "cma-overlay";
dtsFile = ./cma-overlay.dts;
}
- { # https://raw.githubusercontent.com/raspberrypi/linux/refs/heads/rpi-6.6.y/arch/arm/boot/dts/overlays/vc4-fkms-v3d-overlay.dts
- name = "vc4-fkms-v3d";
+ #{ # https://raw.githubusercontent.com/raspberrypi/linux/refs/heads/rpi-6.6.y/arch/arm/boot/dts/overlays/vc4-fkms-v3d-overlay.dts
+ # name = "vc4-fkms-v3d";
+ # # remove '#include "cma-overlay.dts"'
+ # dtsFile = ./vc4-fkms-v3d-overlay.dts;
+ #}
+ { # https://raw.githubusercontent.com/raspberrypi/linux/refs/heads/rpi-6.6.y/arch/arm/boot/dts/overlays/vc4-kms-v3d-overlay.dts
+ name = "vc4-kms-v3d";
# remove '#include "cma-overlay.dts"'
- dtsFile = ./vc4-fkms-v3d-overlay.dts;
+ dtsFile = ./vc4-kms-v3d-overlay.dts;
}
{ # https://raw.githubusercontent.com/raspberrypi/linux/refs/heads/rpi-6.6.y/arch/arm/boot/dts/overlays/disable-bt-overlay.dts
name = "disable-bt";
diff --git a/hardware/cmsb-001/vc4-kms-v3d-overlay.dts b/hardware/cmsb-001/vc4-kms-v3d-overlay.dts
new file mode 100644
index 0000000..0b3275e
--- /dev/null
+++ b/hardware/cmsb-001/vc4-kms-v3d-overlay.dts
@@ -0,0 +1,122 @@
+/*
+ * vc4-kms-v3d-overlay.dts
+ */
+
+/dts-v1/;
+/plugin/;
+
+#include <dt-bindings/clock/bcm2835.h>
+
+/ {
+ compatible = "brcm,bcm2837";
+
+ fragment@1 {
+ target = <&i2c2>;
+ __overlay__ {
+ status = "okay";
+ };
+ };
+
+ fragment@2 {
+ target = <&fb>;
+ __overlay__ {
+ status = "disabled";
+ };
+ };
+
+ fragment@3 {
+ target = <&pixelvalve0>;
+ __overlay__ {
+ status = "okay";
+ };
+ };
+
+ fragment@4 {
+ target = <&pixelvalve1>;
+ __overlay__ {
+ status = "okay";
+ };
+ };
+
+ fragment@5 {
+ target = <&pixelvalve2>;
+ __overlay__ {
+ status = "okay";
+ };
+ };
+
+ fragment@6 {
+ target = <&hvs>;
+ __overlay__ {
+ status = "okay";
+ };
+ };
+
+ fragment@7 {
+ target = <&hdmi>;
+ __overlay__ {
+ status = "okay";
+ };
+ };
+
+ fragment@8 {
+ target = <&v3d>;
+ __overlay__ {
+ status = "okay";
+ };
+ };
+
+ fragment@9 {
+ target = <&vc4>;
+ __overlay__ {
+ status = "okay";
+ };
+ };
+
+ fragment@10 {
+ target = <&clocks>;
+ __overlay__ {
+ claim-clocks = <
+ BCM2835_PLLD_DSI0
+ BCM2835_PLLD_DSI1
+ BCM2835_PLLH_AUX
+ BCM2835_PLLH_PIX
+ >;
+ };
+ };
+
+ fragment@11 {
+ target = <&vec>;
+ __dormant__ {
+ status = "okay";
+ };
+ };
+
+ fragment@12 {
+ target = <&txp>;
+ __overlay__ {
+ status = "okay";
+ };
+ };
+
+ fragment@13 {
+ target = <&hdmi>;
+ __dormant__ {
+ dmas;
+ };
+ };
+
+ fragment@14 {
+ target = <&chosen>;
+ __overlay__ {
+ bootargs = "snd_bcm2835.enable_hdmi=0";
+ };
+ };
+
+ __overrides__ {
+ audio = <0>,"!13";
+ noaudio = <0>,"=13";
+ composite = <0>, "=11";
+ nohdmi = <0>, "-1-7";
+ };
+};
diff --git a/meson.build b/meson.build
index 1b4a0f9..644f5e8 100644
--- a/meson.build
+++ b/meson.build
@@ -22,20 +22,19 @@ common_deps = [alabaster.get_variable('alabaster'), akiyo.get_variable('akiyo')]
no_video = meson.is_subproject()
if not no_video
+ stela_opts = ['poll=inline', 'event-buffer=false', 'pause=true']
if is_linux
- window = 'window=wayland'
+ stela_opts += 'window=wayland'
elif is_android
- window = 'window=glfm'
+ stela_opts += 'window=glfm'
else
- window = 'window=glfw'
+ stela_opts += 'window=glfw'
endif
- stela = subproject('stela', default_options: [
- get_option('sink-use-vulkan') ? 'api=vulkan' : 'api=opengl',
- window,
- 'poll=inline',
- 'event-buffer=false',
- 'pause=true'
- ]).get_variable('stela')
+ stela_opts += get_option('sink-use-vulkan') ? 'api=vulkan' : 'api=opengl'
+ if get_option('sink-for-rpi')
+ stela_opts += 'egl-brcm=true'
+ endif
+ stela = subproject('stela', default_options: stela_opts).get_variable('stela')
endif
subdir('src/util')
diff --git a/meson_options.txt b/meson_options.txt
index 85bc33c..20e034b 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1,6 +1,7 @@
option('sink', type: 'feature', value: 'enabled')
option('sink-only', type: 'boolean', value: false)
option('sink-use-vulkan', type: 'boolean', value: false)
+option('sink-for-rpi', type: 'boolean', value: false)
option('codecs', type: 'array', choices: ['ffmpeg', 'stb_image', 'spng', 'wuffs'], value: ['ffmpeg'])
option('renderer', type: 'combo', choices: ['libplacebo', 'tiger'], value: 'libplacebo')
option('server', type: 'feature', value: 'enabled')
diff --git a/subprojects/stela.wrap b/subprojects/stela.wrap
index 6a95860..6ec3529 100644
--- a/subprojects/stela.wrap
+++ b/subprojects/stela.wrap
@@ -1,4 +1,4 @@
[wrap-git]
url = https://git.akon.city/stela
-revision = 5c0e9eb465c5c291b0d2658ad01f15e050042df1
+revision = e413942a72a30eb373e6024941fa98d24c81d9d9
depth = 1