aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/bcm27xx/patches-5.10/950-0515-rpivid-Request-maximum-hevc-clock.patch
diff options
context:
space:
mode:
authorÁlvaro Fernández Rojas <noltari@gmail.com>2021-08-21 10:54:34 +0200
committerÁlvaro Fernández Rojas <noltari@gmail.com>2021-08-21 19:07:07 +0200
commit8299d1f057439f94c6a4412e2e5c5082b82a30c9 (patch)
tree1bf678d61f11f7394493be464c7876e496f7faed /target/linux/bcm27xx/patches-5.10/950-0515-rpivid-Request-maximum-hevc-clock.patch
parent33b6885975ce376ff075362b7f0890326043111b (diff)
downloadupstream-8299d1f057439f94c6a4412e2e5c5082b82a30c9.tar.gz
upstream-8299d1f057439f94c6a4412e2e5c5082b82a30c9.tar.bz2
upstream-8299d1f057439f94c6a4412e2e5c5082b82a30c9.zip
bcm27xx: add kernel 5.10 support
Rebased RPi foundation patches on linux 5.10.59, removed applied and reverted patches, wireless patches and defconfig patches. bcm2708: boot tested on RPi B+ v1.2 bcm2709: boot tested on RPi 4B v1.1 4G bcm2711: boot tested on RPi 4B v1.1 4G Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Diffstat (limited to 'target/linux/bcm27xx/patches-5.10/950-0515-rpivid-Request-maximum-hevc-clock.patch')
-rw-r--r--target/linux/bcm27xx/patches-5.10/950-0515-rpivid-Request-maximum-hevc-clock.patch51
1 files changed, 51 insertions, 0 deletions
diff --git a/target/linux/bcm27xx/patches-5.10/950-0515-rpivid-Request-maximum-hevc-clock.patch b/target/linux/bcm27xx/patches-5.10/950-0515-rpivid-Request-maximum-hevc-clock.patch
new file mode 100644
index 0000000000..eb25cbefd3
--- /dev/null
+++ b/target/linux/bcm27xx/patches-5.10/950-0515-rpivid-Request-maximum-hevc-clock.patch
@@ -0,0 +1,51 @@
+From a292e26529c7f46a549625f94bdbba004d8caa5f Mon Sep 17 00:00:00 2001
+From: Dom Cobley <popcornmix@gmail.com>
+Date: Mon, 22 Feb 2021 18:50:50 +0000
+Subject: [PATCH] rpivid: Request maximum hevc clock
+
+Query maximum and minimum clock from driver
+and use those
+
+Signed-off-by: Dom Cobley <popcornmix@gmail.com>
+---
+ drivers/staging/media/rpivid/rpivid_video.c | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+--- a/drivers/staging/media/rpivid/rpivid_video.c
++++ b/drivers/staging/media/rpivid/rpivid_video.c
+@@ -490,6 +490,7 @@ static int rpivid_start_streaming(struct
+ {
+ struct rpivid_ctx *ctx = vb2_get_drv_priv(vq);
+ struct rpivid_dev *dev = ctx->dev;
++ long max_hevc_clock = clk_round_rate(dev->clock, ULONG_MAX);
+ int ret = 0;
+
+ if (ctx->src_fmt.pixelformat != V4L2_PIX_FMT_HEVC_SLICE)
+@@ -498,7 +499,7 @@ static int rpivid_start_streaming(struct
+ if (V4L2_TYPE_IS_OUTPUT(vq->type) && dev->dec_ops->start)
+ ret = dev->dec_ops->start(ctx);
+
+- ret = clk_set_rate(dev->clock, 500 * 1000 * 1000);
++ ret = clk_set_rate(dev->clock, max_hevc_clock);
+ if (ret) {
+ dev_err(dev->dev, "Failed to set clock rate\n");
+ goto out;
+@@ -519,12 +520,18 @@ static void rpivid_stop_streaming(struct
+ {
+ struct rpivid_ctx *ctx = vb2_get_drv_priv(vq);
+ struct rpivid_dev *dev = ctx->dev;
++ long min_hevc_clock = clk_round_rate(dev->clock, 0);
++ int ret;
+
+ if (V4L2_TYPE_IS_OUTPUT(vq->type) && dev->dec_ops->stop)
+ dev->dec_ops->stop(ctx);
+
+ rpivid_queue_cleanup(vq, VB2_BUF_STATE_ERROR);
+
++ ret = clk_set_rate(dev->clock, min_hevc_clock);
++ if (ret)
++ dev_err(dev->dev, "Failed to set minimum clock rate\n");
++
+ clk_disable_unprepare(dev->clock);
+ }
+