mirror of
https://github.com/armbian/build.git
synced 2025-09-19 04:31:38 +02:00
I have changed the way the patches are generated a bit. Instead of using orange-pi branch from megous tree for 6.6 kernel, I have used the following kernel branches a83t-suspend, af8133j, anx, audio, axp, cam, drm, err, fixes, mbus, modem, opi3, pb, pinetab, pp, ppkb, samuel, speed, tbs-a711, ths These branches were carefully chosen to include only allwinner related patches and remove importing of the rockchip related patches into the allwinner kernel. Following patches are modified to fix patch application failure - patches.armbian/arm64-dts-sun50i-h616-orangepi-zero2-reg_usb1_vbus-status-ok.patch - patches.armbian/arm64-dts-sun50i-h616-orangepi-zero2-Enable-GPU-mali.patch - patches.armbian/arm64-dts-allwinner-h616-Add-efuse_xlate-cpu-frequency-scaling-v1_6_2.patch - patches.armbian/arm64-dts-allwinner-h616-LED-green_power_on-red_status_heartbeat.patch - patches.armbian/arm64-dts-allwinner-overlay-Add-Overlays-for-sunxi64.patch - patches.armbian/arm64-dts-sun50i-h616-bigtreetech-cb1.patch Following patches are modified because of kernel api change to fix compilation failure - patches.armbian/drv-gpu-drm-sun4i-Add-HDMI-audio-sun4i-hdmi-encoder.patch - patches.armbian/drv-of-Device-Tree-Overlay-ConfigFS-interface.patch
129 lines
5.0 KiB
Diff
129 lines
5.0 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
|
Date: Wed, 4 Jan 2023 12:29:56 +0200
|
|
Subject: media: sun6i-csi: capture: Use subdev operation to access bridge
|
|
format
|
|
|
|
Replace the sun6i_csi_bridge helper functions sun6i_csi_bridge_format()
|
|
and sun6i_csi_bridge_dimensions() that access the bridge fields from the
|
|
capture side with usage of the subdev .get_fmt() operation. This
|
|
decouples the bridge and capture side better by using abstractions
|
|
provided by the V4L2 subdev API, and prepares for usage of the subdev
|
|
active state in the bridge.
|
|
|
|
The sun6i_csi_bridge_dimensions() helper is now unused and is removed.
|
|
The sun6i_csi_bridge_format() helper will be removed in a subsequent
|
|
change.
|
|
|
|
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
|
(cherry picked from commit e728c6bbead7a10d9ffd1139e416e1199b5837a6)
|
|
---
|
|
drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_bridge.c | 13 +-----
|
|
drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_bridge.h | 7 ---
|
|
drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_capture.c | 23 ++++++----
|
|
3 files changed, 17 insertions(+), 26 deletions(-)
|
|
|
|
diff --git a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_bridge.c b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_bridge.c
|
|
index e573413123b9..b0542b7ebbd4 100644
|
|
--- a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_bridge.c
|
|
+++ b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_bridge.c
|
|
@@ -15,17 +15,8 @@
|
|
|
|
/* Helpers */
|
|
|
|
-void sun6i_csi_bridge_dimensions(struct sun6i_csi_device *csi_dev,
|
|
- unsigned int *width, unsigned int *height)
|
|
-{
|
|
- if (width)
|
|
- *width = csi_dev->bridge.mbus_format.width;
|
|
- if (height)
|
|
- *height = csi_dev->bridge.mbus_format.height;
|
|
-}
|
|
-
|
|
-void sun6i_csi_bridge_format(struct sun6i_csi_device *csi_dev,
|
|
- u32 *mbus_code, u32 *field)
|
|
+static void sun6i_csi_bridge_format(struct sun6i_csi_device *csi_dev,
|
|
+ u32 *mbus_code, u32 *field)
|
|
{
|
|
if (mbus_code)
|
|
*mbus_code = csi_dev->bridge.mbus_format.code;
|
|
diff --git a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_bridge.h b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_bridge.h
|
|
index 44653b38f722..722b633b7893 100644
|
|
--- a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_bridge.h
|
|
+++ b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_bridge.h
|
|
@@ -49,13 +49,6 @@ struct sun6i_csi_bridge {
|
|
struct sun6i_csi_bridge_source source_mipi_csi2;
|
|
};
|
|
|
|
-/* Helpers */
|
|
-
|
|
-void sun6i_csi_bridge_dimensions(struct sun6i_csi_device *csi_dev,
|
|
- unsigned int *width, unsigned int *height);
|
|
-void sun6i_csi_bridge_format(struct sun6i_csi_device *csi_dev,
|
|
- u32 *mbus_code, u32 *field);
|
|
-
|
|
/* Format */
|
|
|
|
const struct sun6i_csi_bridge_format *
|
|
diff --git a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_capture.c b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_capture.c
|
|
index cf6aadbc130b..03d4adec054c 100644
|
|
--- a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_capture.c
|
|
+++ b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_capture.c
|
|
@@ -893,11 +893,14 @@ static int sun6i_csi_capture_link_validate(struct media_link *link)
|
|
const struct sun6i_csi_capture_format *capture_format;
|
|
const struct sun6i_csi_bridge_format *bridge_format;
|
|
unsigned int capture_width, capture_height;
|
|
- unsigned int bridge_width, bridge_height;
|
|
const struct v4l2_format_info *format_info;
|
|
u32 pixelformat, capture_field;
|
|
- u32 mbus_code, bridge_field;
|
|
+ struct v4l2_subdev_format fmt = {
|
|
+ .which = V4L2_SUBDEV_FORMAT_ACTIVE,
|
|
+ .pad = SUN6I_CSI_BRIDGE_PAD_SOURCE,
|
|
+ };
|
|
bool match;
|
|
+ int ret;
|
|
|
|
sun6i_csi_capture_dimensions(csi_dev, &capture_width, &capture_height);
|
|
|
|
@@ -906,18 +909,21 @@ static int sun6i_csi_capture_link_validate(struct media_link *link)
|
|
if (WARN_ON(!capture_format))
|
|
return -EINVAL;
|
|
|
|
- sun6i_csi_bridge_dimensions(csi_dev, &bridge_width, &bridge_height);
|
|
+ ret = v4l2_subdev_call_state_active(&csi_dev->bridge.subdev, pad,
|
|
+ get_fmt, &fmt);
|
|
+ if (ret)
|
|
+ return ret;
|
|
|
|
- sun6i_csi_bridge_format(csi_dev, &mbus_code, &bridge_field);
|
|
- bridge_format = sun6i_csi_bridge_format_find(mbus_code);
|
|
+ bridge_format = sun6i_csi_bridge_format_find(fmt.format.code);
|
|
if (WARN_ON(!bridge_format))
|
|
return -EINVAL;
|
|
|
|
/* No cropping/scaling is supported. */
|
|
- if (capture_width != bridge_width || capture_height != bridge_height) {
|
|
+ if (capture_width != fmt.format.width ||
|
|
+ capture_height != fmt.format.height) {
|
|
v4l2_err(v4l2_dev,
|
|
"invalid input/output dimensions: %ux%u/%ux%u\n",
|
|
- bridge_width, bridge_height, capture_width,
|
|
+ fmt.format.width, fmt.format.height, capture_width,
|
|
capture_height);
|
|
return -EINVAL;
|
|
}
|
|
@@ -949,7 +955,8 @@ static int sun6i_csi_capture_link_validate(struct media_link *link)
|
|
/* With raw input mode, we need a 1:1 match between input and output. */
|
|
if (bridge_format->input_format == SUN6I_CSI_INPUT_FMT_RAW ||
|
|
capture_format->input_format_raw) {
|
|
- match = sun6i_csi_capture_format_match(pixelformat, mbus_code);
|
|
+ match = sun6i_csi_capture_format_match(pixelformat,
|
|
+ fmt.format.code);
|
|
if (!match)
|
|
goto invalid;
|
|
}
|
|
--
|
|
Armbian
|
|
|