From 23ec7fd7e40d6153ff4017d41b19fc37e29bb8c9 Mon Sep 17 00:00:00 2001 From: Martijn Braam Date: Thu, 20 Jul 2023 22:38:21 +0200 Subject: [PATCH] Add faster mode for the Librem 5 --- config/purism,librem5.conf | 12 ++++++++++++ src/mode.c | 3 +++ 2 files changed, 15 insertions(+) diff --git a/config/purism,librem5.conf b/config/purism,librem5.conf index d760dbc..7850b67 100644 --- a/config/purism,librem5.conf +++ b/config/purism,librem5.conf @@ -21,6 +21,18 @@ Rear: { {Type: "Mode", Entity: "csi"}, ); }, + { + Width: 1052; + Height: 780; + Rate: 30; + Format: "GRBG8"; + Rotate: 270; + Pipeline: ( + {Type: "Mode", Entity: "s5k3l6xx"}, + {Type: "Mode", Entity: "imx8mq-mipi-csi2"}, + {Type: "Mode", Entity: "csi"}, + ); + }, ); }; diff --git a/src/mode.c b/src/mode.c index 2a6e419..1b450a9 100644 --- a/src/mode.c +++ b/src/mode.c @@ -274,6 +274,9 @@ libmegapixels_mode_width_to_bytes(int index, uint32_t width) uint32_t libmegapixels_mode_width_to_padding(int index, uint32_t width) { + if (mode_lut[index].bpp == 8) { + return 0; + } uint64_t bytes_per_width = libmegapixels_mode_width_to_bytes(index, width); uint64_t remainder = bytes_per_width % 8; if (remainder == 0)