aboutsummaryrefslogtreecommitdiffci
diff refs
from: back
to: back
| flip
diff options
context:
space:
mode:
-rw-r--r--README.md5
-rw-r--r--config/foreign-socs.config68
-rw-r--r--kernel-surface.spec8
-rwxr-xr-xmake-sources.sh4
-rw-r--r--patches/camera/0027-media-i2c-ov13858-fix-bayer-order-when-mirrored.patch71
5 files changed, 130 insertions, 26 deletions
diff --git a/README.md b/README.md
index 9867efa..bb8fcbd 100644
--- a/README.md
+++ b/README.md
@@ -51,7 +51,7 @@ rpm2archive -n - < kernel-core-*.aarch64.rpm |
If the extraction comes up empty, `rpm -qlp kernel-core-*.aarch64.rpm | grep
config` says whether the package still carries the file at all.
-Three fragments are merged on top with `scripts/kconfig/merge_config.sh`:
+Four fragments are merged on top with `scripts/kconfig/merge_config.sh`:
* `config/surface.config` – the drivers the patch set enables (SAM stack and
its new RTC, CAMSS and the CSI-2 D-PHY, fastrpc, ath12k, AudioReach).
@@ -59,6 +59,9 @@ Three fragments are merged on top with `scripts/kconfig/merge_config.sh`:
and dm-snapshot/overlayfs built in for `dracut`'s `dmsquash-live`, the EFI
stub because GRUB's aarch64 `linux` command loads the kernel as an EFI
application, and xz module compression.
+* `config/foreign-socs.config` – the ARM64 platforms this machine is not.
+ Fedora's config enables every platform it supports because a distribution
+ kernel has to boot on all of them; this one boots on `qcom,x1p42100` alone.
* `config/no-debug-info.config` – DWARF and BTF off. The package produces no
`-debuginfo` subpackage (`%global debug_package %{nil}`) and strips modules
at install time, so the DWARF was compiled only to be discarded, and it is
diff --git a/config/foreign-socs.config b/config/foreign-socs.config
new file mode 100644
index 0000000..5926d06
--- /dev/null
+++ b/config/foreign-socs.config
@@ -0,0 +1,68 @@
+# Config fragment turning off the ARM64 platforms this machine is not.
+#
+# Two platforms are deliberately kept:
+#
+# ARCH_QCOM what this machine is.
+# ARCH_VEXPRESS cheap, and it is the ARM reference/model platform that pulls
+# in the AMBA PrimeCell parts a QEMU `virt` guest expects,
+# which is how an image built from this kernel can be smoke
+# tested without the hardware in hand.
+
+# Allwinner
+# CONFIG_ARCH_SUNXI is not set
+
+# Apple M-series
+# CONFIG_ARCH_APPLE is not set
+
+# Broadcom, including Raspberry Pi
+# CONFIG_ARCH_BCM is not set
+# CONFIG_ARCH_BCM2835 is not set
+
+# Black Sesame
+# CONFIG_ARCH_BST is not set
+
+# CIX
+# CONFIG_ARCH_CIX is not set
+
+# Texas Instruments K3
+# CONFIG_ARCH_K3 is not set
+
+# HiSilicon
+# CONFIG_ARCH_HISI is not set
+
+# Amlogic
+# CONFIG_ARCH_MESON is not set
+
+# Marvell EBU
+# CONFIG_ARCH_MVEBU is not set
+
+# NXP: i.MX, Layerscape and S32
+# CONFIG_ARCH_NXP is not set
+# CONFIG_ARCH_LAYERSCAPE is not set
+# CONFIG_ARCH_MXC is not set
+# CONFIG_ARCH_S32 is not set
+
+# Renesas
+# CONFIG_ARCH_RENESAS is not set
+
+# Rockchip
+# CONFIG_ARCH_ROCKCHIP is not set
+
+# AMD Seattle
+# CONFIG_ARCH_SEATTLE is not set
+
+# Socionext SynQuacer
+# CONFIG_ARCH_SYNQUACER is not set
+
+# NVIDIA Tegra
+# CONFIG_ARCH_TEGRA is not set
+
+# Cavium ThunderX and ThunderX2 servers
+# CONFIG_ARCH_THUNDER is not set
+# CONFIG_ARCH_THUNDER2 is not set
+
+# AppliedMicro X-Gene
+# CONFIG_ARCH_XGENE is not set
+
+# Xilinx ZynqMP
+# CONFIG_ARCH_ZYNQMP is not set
diff --git a/kernel-surface.spec b/kernel-surface.spec
index 7c4fab2..1f39f30 100644
--- a/kernel-surface.spec
+++ b/kernel-surface.spec
@@ -56,6 +56,7 @@ Source2: base-aarch64.config
Source3: surface.config
Source4: live-image.config
Source5: no-debug-info.config
+Source6: foreign-socs.config
BuildRequires: bc
BuildRequires: binutils
@@ -170,7 +171,7 @@ CONFIG_BUILD_SALT="%{kverrel}"
EOF
ARCH=arm64 scripts/kconfig/merge_config.sh -m -O . \
- .config .release.config %{SOURCE3} %{SOURCE4} %{SOURCE5}
+ .config .release.config %{SOURCE3} %{SOURCE4} %{SOURCE5} %{SOURCE6}
make ARCH=arm64 olddefconfig
# merge_config.sh is only advisory about symbols it could not set, so check the
@@ -246,6 +247,11 @@ fi
%ghost %attr(0644,root,root) /boot/vmlinuz-%{kverrel}
%changelog
+* Mon Sep 07 2026 Saya Andy 7.2.3-4
+- Turn off all the ARM64 platform kernel modules besides qcom and vexpress
+ (used in qemu)
+- Fix Bayer order in rear camera resulting in color space shift
+
* Mon Sep 07 2026 Saya Andy 7.2.3-3
- Key the /usr/lib/surface-dtb copy of the device tree by kernel version. This
package is installonly, so an unqualified path there conflicts between two
diff --git a/make-sources.sh b/make-sources.sh
index 7271bf8..5c11ee2 100755
--- a/make-sources.sh
+++ b/make-sources.sh
@@ -139,10 +139,10 @@ echo "${tarball} (${index} directories, ${total} patches)"
#--------------------------------------
# Base config and fragments
#--------------------------------------
-for cfg in base-aarch64 surface live-image no-debug-info; do
+for cfg in base-aarch64 surface live-image no-debug-info foreign-socs; do
cp "${script_dir}/config/${cfg}.config" "${output_dir}/${cfg}.config"
done
-echo "${output_dir}/{base-aarch64,surface,live-image,no-debug-info}.config"
+echo "${output_dir}/{base-aarch64,surface,live-image,no-debug-info,foreign-socs}.config"
if [[ ${skip_download} == true ]]; then
exit 0
diff --git a/patches/camera/0027-media-i2c-ov13858-fix-bayer-order-when-mirrored.patch b/patches/camera/0027-media-i2c-ov13858-fix-bayer-order-when-mirrored.patch
index 06b8495..d465f8d 100644
--- a/patches/camera/0027-media-i2c-ov13858-fix-bayer-order-when-mirrored.patch
+++ b/patches/camera/0027-media-i2c-ov13858-fix-bayer-order-when-mirrored.patch
@@ -1,26 +1,53 @@
-media: i2c: ov13858: report the right bayer order when mirrored
+media: i2c: ov13858: report the right bayer order
-The driver always advertises MEDIA_BUS_FMT_SGRBG10_1X10, but the horizontal
-mirror moves the Bayer phase by one column, so the sensor actually delivers
-RGGB while HFLIP is set. The Surface Pro 12in has the rear ov13858 mounted
-upside down (rotation = <180> in DT), so both flips end up enabled and every
-frame is debayered with the wrong pattern: the two greens land in the red and
-blue output channels and the picture comes out desaturated, close to
-monochrome.
+The driver advertises MEDIA_BUS_FMT_SGRBG10_1X10 unconditionally, but that is
+not what the sensor delivers in any flip state on the Surface Pro 12in. The
+horizontal mirror moves the Bayer phase by one column, and the native order is
+GBRG rather than GRBG, so the two correct codes are GBRG unmirrored and BGGR
+mirrored.
-Measured on a Surface Pro 12in by capturing raw frames off the CAMSS RDI node
-and comparing the mean absolute difference of the two diagonal pairs of each
-2x2 quad (the two green samples correlate far better than red against blue):
+The rear ov13858 is mounted upside down (rotation = <180> in DT), so userspace
+enables both flips to compensate and every frame is then debayered as RGGB
+while the sensor emits BGGR. Red and blue are exchanged: an orange object comes
+out cyan, warm wood comes out blue, while neutrals are unaffected, which is
+what makes it easy to mistake for a white balance problem.
- hflip=0 vflip=0 diagonal 4.29 antidiagonal 6.84 -> greens diagonal
- hflip=1 vflip=0 diagonal 7.03 antidiagonal 4.31 -> greens antidiagonal
- hflip=0 vflip=1 diagonal 4.35 antidiagonal 6.84 -> greens diagonal
- hflip=1 vflip=1 diagonal 6.93 antidiagonal 4.34 -> greens antidiagonal
+Two measurements on a Surface Pro 12in, from raw frames captured off the CAMSS
+RDI video node. The first locates the green pair by comparing the mean absolute
+difference of the diagonal against the antidiagonal samples of each 2x2 quad,
+the two greens correlating far better than red against blue:
+
+ hflip=0 vflip=0 diagonal 8.65 antidiagonal 56.82 -> greens diagonal
+ hflip=1 vflip=0 diagonal 56.25 antidiagonal 8.34 -> greens antidiagonal
+ hflip=0 vflip=1 diagonal 13.21 antidiagonal 55.94 -> greens diagonal
+ hflip=1 vflip=1 diagonal 56.04 antidiagonal 13.16 -> greens antidiagonal
So only the horizontal mirror moves the phase; the ISP Y window offset written
-for VFLIP compensates the vertical one. Derive the media bus code from HFLIP
-and tag the control with V4L2_CTRL_FLAG_MODIFY_LAYOUT so userspace knows to
-renegotiate the format after toggling it.
+for VFLIP compensates the vertical one.
+
+That test cannot tell red from blue, because GBRG and GRBG share a green
+diagonal just as BGGR and RGGB share a green antidiagonal. Resolving the
+remaining ambiguity needs colour: a scene of objects with known colour was
+captured in all four states, and the red channel identified as the one whose
+ratio to blue matches the scene. The rejected assignment is the reciprocal, so
+the margin is large:
+
+ hflip=0 vflip=0 R/B 1.651 (reciprocal 0.606) -> GBRG
+ hflip=0 vflip=1 R/B 1.622 (reciprocal 0.616) -> GBRG
+ hflip=1 vflip=0 R/B 1.651 (reciprocal 0.606) -> BGGR
+ hflip=1 vflip=1 R/B 1.625 (reciprocal 0.615) -> BGGR
+
+Derive the media bus code from HFLIP and tag the control with
+V4L2_CTRL_FLAG_MODIFY_LAYOUT so userspace knows to renegotiate the format after
+toggling it.
+
+The native order disagreeing with upstream is suspicious in itself. The removal
+of the per-mode {0x3811, 0x04} and {0x3813, 0x05} ISP window offsets in
+"media: i2c: ov13858: add rotate control support", which now writes 1 or 2 into
+those registers from the flip handlers, changes the X parity, and that patch
+also sets BIT(3) of ROTATE_CONTROL when HFLIP is clear while VFLIP sets BIT(4)
+when set. Whether the phase should instead be corrected there is left alone
+here: this patch only reports what the sensor is measured to emit.
--- a/drivers/media/i2c/ov13858.c
+++ b/drivers/media/i2c/ov13858.c
@@ -51,14 +78,14 @@ renegotiate the format after toggling it.
-static void ov13858_update_pad_format(const struct ov13858_mode *mode,
+/*
-+ * Mirroring shifts the Bayer phase by one column, so the native GRBG order
-+ * becomes RGGB. The vertical flip is compensated by the ISP Y window offset
++ * Mirroring shifts the Bayer phase by one column, so the native GBRG order
++ * becomes BGGR. The vertical flip is compensated by the ISP Y window offset
+ * and leaves the order alone.
+ */
+static u32 ov13858_get_format_code(struct ov13858 *ov13858)
+{
-+ return ov13858->hflip->val ? MEDIA_BUS_FMT_SRGGB10_1X10
-+ : MEDIA_BUS_FMT_SGRBG10_1X10;
++ return ov13858->hflip->val ? MEDIA_BUS_FMT_SBGGR10_1X10
++ : MEDIA_BUS_FMT_SGBRG10_1X10;
+}
+
+static void ov13858_update_pad_format(struct ov13858 *ov13858,