Merge pull request #4512 from jernejsk/linux5.8

Allwinner/Generic/Rockchip: Update to Linux 5.8
This commit is contained in:
CvH
2020-08-11 19:55:46 +02:00
committed by GitHub
31 changed files with 11772 additions and 14524 deletions

View File

@@ -0,0 +1,82 @@
diff --git a/hostapd-0.8/src/crypto/sha256-internal.c b/hostapd-0.8/src/crypto/sha256-internal.c
index b0613739fbc6..c51983c6d633 100644
--- a/hostapd-0.8/src/crypto/sha256-internal.c
+++ b/hostapd-0.8/src/crypto/sha256-internal.c
@@ -18,16 +18,10 @@
#include "sha256.h"
#include "crypto.h"
-struct sha256_state {
- u64 length;
- u32 state[8], curlen;
- u8 buf[64];
-};
-
-static void sha256_init(struct sha256_state *md);
-static int sha256_process(struct sha256_state *md, const unsigned char *in,
+static void sha256_init(struct sha256_state_rtw *md);
+static int sha256_process(struct sha256_state_rtw *md, const unsigned char *in,
unsigned long inlen);
-static int sha256_done(struct sha256_state *md, unsigned char *out);
+static int sha256_done(struct sha256_state_rtw *md, unsigned char *out);
/**
@@ -41,7 +35,7 @@ static int sha256_done(struct sha256_state *md, unsigned char *out);
int sha256_vector(size_t num_elem, const u8 *addr[], const size_t *len,
u8 *mac)
{
- struct sha256_state ctx;
+ struct sha256_state_rtw ctx;
size_t i;
sha256_init(&ctx);
@@ -94,7 +88,7 @@ static const unsigned long K[64] = {
#endif
/* compress 512-bits */
-static int sha256_compress(struct sha256_state *md, unsigned char *buf)
+static int sha256_compress(struct sha256_state_rtw *md, unsigned char *buf)
{
u32 S[8], W[64], t0, t1;
u32 t;
@@ -137,7 +131,7 @@ static int sha256_compress(struct sha256_state *md, unsigned char *buf)
/* Initialize the hash state */
-static void sha256_init(struct sha256_state *md)
+static void sha256_init(struct sha256_state_rtw *md)
{
md->curlen = 0;
md->length = 0;
@@ -158,7 +152,7 @@ static void sha256_init(struct sha256_state *md)
@param inlen The length of the data (octets)
@return CRYPT_OK if successful
*/
-static int sha256_process(struct sha256_state *md, const unsigned char *in,
+static int sha256_process(struct sha256_state_rtw *md, const unsigned char *in,
unsigned long inlen)
{
unsigned long n;
@@ -199,7 +193,7 @@ static int sha256_process(struct sha256_state *md, const unsigned char *in,
@param out [out] The destination of the hash (32 bytes)
@return CRYPT_OK if successful
*/
-static int sha256_done(struct sha256_state *md, unsigned char *out)
+static int sha256_done(struct sha256_state_rtw *md, unsigned char *out)
{
int i;
diff --git a/include/rtw_security.h b/include/rtw_security.h
index 21b9c35ce34c..374e6ca86c47 100644
--- a/include/rtw_security.h
+++ b/include/rtw_security.h
@@ -168,7 +168,7 @@ struct security_priv {
u8 bWepDefaultKeyIdxSet;
};
-struct sha256_state {
+struct sha256_state_rtw {
u64 length;
u32 state[8], curlen;
u8 buf[64];

View File

@@ -3,8 +3,8 @@
# Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv)
PKG_NAME="RTL8192CU"
PKG_VERSION="9a5fe3e94176c5154515834e99c00069d0bf1fd7"
PKG_SHA256="1488e6fdfc51d7a7ec8fb95d1c3b212d64f3e66e8d2f7e6637bf3dd642a75289"
PKG_VERSION="0f37bd7f97573f835e4dedb4b2628c1ceedd71ad"
PKG_SHA256="0291b11b11b0949769270ba28b279194c3f77a407922cb1221d06c13cbbb5a13"
PKG_LICENSE="GPL"
PKG_SITE="https://github.com/pvaret/rtl8192cu-fixes"
PKG_URL="$PKG_SITE/archive/$PKG_VERSION.tar.gz"

View File

@@ -3,8 +3,8 @@
# Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv)
PKG_NAME="RTL8192DU"
PKG_VERSION="68ee70c46aeeb81220f5981f62a57916fd896cc8"
PKG_SHA256="f35aa7b832561a9d771cbb92acfe83498de05a985de94ec7acf995d5b244a10a"
PKG_VERSION="d6185ff4a242ebf553e9e9980da21591660e8f8c"
PKG_SHA256="fef5ab863b3f4f3d6e7e4af891aca6bcb5a080fc9a0a4bd88abef82e8966c35d"
PKG_LICENSE="GPL"
PKG_SITE="https://github.com/lwfinger/rtl8192du"
PKG_URL="https://github.com/lwfinger/rtl8192du/archive/$PKG_VERSION.tar.gz"

View File

@@ -3,8 +3,8 @@
# Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv)
PKG_NAME="RTL8192EU"
PKG_VERSION="83b5aff2a54785608129ac2a7db659a9699508ee"
PKG_SHA256="09b6bf64ea0686a4ecc6ec25191b32e384b903edf9cc1d2f891c56cf7b7e6d5e"
PKG_VERSION="925ac2be34dd608a7ca42daebf9713f0c1bcec74"
PKG_SHA256="0cc55fd22443d8b4010f1cd64a8164378b93e63193b42d1796b101713c41c07b"
PKG_LICENSE="GPL"
PKG_SITE="https://github.com/Mange/rtl8192eu-linux-driver"
PKG_URL="https://github.com/Mange/rtl8192eu-linux-driver/archive/$PKG_VERSION.tar.gz"

View File

@@ -3,8 +3,8 @@
# Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv)
PKG_NAME="RTL8812AU"
PKG_VERSION="d88d8b2e2a1b33ebdd62b8a5de307b37c39d8477"
PKG_SHA256="c5b2fcc6cbf6901e63f75ece49a8ce3219004536cfc585b9815b34d943c9f311"
PKG_VERSION="8af27f5bebe1c890879fb2cc50e672a7f55c6505"
PKG_SHA256="6badcf35d7f42e0f906000d7cf59b0afcdc7d97f41de16e54158cf53e1518c58"
PKG_LICENSE="GPL"
PKG_SITE="https://github.com/MilhouseVH/RTL8812AU"
PKG_URL="https://github.com/MilhouseVH/RTL8812AU/archive/$PKG_VERSION.tar.gz"

View File

@@ -22,8 +22,8 @@ case "$LINUX" in
PKG_SOURCE_NAME="linux-$LINUX-$PKG_VERSION.tar.gz"
;;
*)
PKG_VERSION="5.7.6"
PKG_SHA256="9fd4c93dc6df53efa904134aa2ede6100f7453c11383490dd32ebbed84f610e6"
PKG_VERSION="5.8"
PKG_SHA256="e7f75186aa0642114af8f19d99559937300ca27acaf7451b36d4f9b0f85cf1f5"
PKG_URL="https://www.kernel.org/pub/linux/kernel/v5.x/$PKG_NAME-$PKG_VERSION.tar.xz"
PKG_PATCH_DIRS="default"
;;

View File

@@ -1,66 +0,0 @@
From 168200b6d6ea0cb5765943ec5da5b8149701f36a Mon Sep 17 00:00:00 2001
From: Leo Yan <leo.yan@linaro.org>
Date: Tue, 5 May 2020 21:36:42 +0800
Subject: [PATCH] perf cs-etm: Move definition of 'traceid_list' global
variable from header file
The variable 'traceid_list' is defined in the header file cs-etm.h,
if multiple C files include cs-etm.h the compiler might complaint for
multiple definition of 'traceid_list'.
To fix multiple definition error, move the definition of 'traceid_list'
into cs-etm.c.
Fixes: cd8bfd8c973e ("perf tools: Add processing of coresight metadata")
Reported-by: Thomas Backlund <tmb@mageia.org>
Signed-off-by: Leo Yan <leo.yan@linaro.org>
Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Reviewed-by: Mike Leach <mike.leach@linaro.org>
Tested-by: Mike Leach <mike.leach@linaro.org>
Tested-by: Thomas Backlund <tmb@mageia.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Suzuki Poulouse <suzuki.poulose@arm.com>
Cc: Tor Jeremiassen <tor@ti.com>
Cc: linux-arm-kernel@lists.infradead.org
Link: http://lore.kernel.org/lkml/20200505133642.4756-1-leo.yan@linaro.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/cs-etm.c | 3 +++
tools/perf/util/cs-etm.h | 3 ---
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c
index 3c802fde4954..c283223fb31f 100644
--- a/tools/perf/util/cs-etm.c
+++ b/tools/perf/util/cs-etm.c
@@ -94,6 +94,9 @@ struct cs_etm_queue {
struct cs_etm_traceid_queue **traceid_queues;
};
+/* RB tree for quick conversion between traceID and metadata pointers */
+static struct intlist *traceid_list;
+
static int cs_etm__update_queues(struct cs_etm_auxtrace *etm);
static int cs_etm__process_queues(struct cs_etm_auxtrace *etm);
static int cs_etm__process_timeless_queues(struct cs_etm_auxtrace *etm,
diff --git a/tools/perf/util/cs-etm.h b/tools/perf/util/cs-etm.h
index 650ecc2a6349..4ad925d6d799 100644
--- a/tools/perf/util/cs-etm.h
+++ b/tools/perf/util/cs-etm.h
@@ -114,9 +114,6 @@ enum cs_etm_isa {
CS_ETM_ISA_T32,
};
-/* RB tree for quick conversion between traceID and metadata pointers */
-struct intlist *traceid_list;
-
struct cs_etm_queue;
struct cs_etm_packet {
--
2.27.0

View File

@@ -1,12 +0,0 @@
diff --git a/arch/arm/kernel/vdso.c b/arch/arm/kernel/vdso.c
index e0330a25e1..28cfe7bad1 100644
--- a/arch/arm/kernel/vdso.c
+++ b/arch/arm/kernel/vdso.c
@@ -184,6 +184,7 @@ static void __init patch_vdso(void *ehdr)
if (!cntvct_ok) {
vdso_nullpatch_one(&einfo, "__vdso_gettimeofday");
vdso_nullpatch_one(&einfo, "__vdso_clock_gettime");
+ vdso_nullpatch_one(&einfo, "__vdso_clock_gettime64");
}
}

View File

@@ -0,0 +1,57 @@
diff -Naur NVIDIA-Linux-x86_64-340.108-old/kernel/nvidia-modules-common.mk NVIDIA-Linux-x86_64-340.108-new/kernel/nvidia-modules-common.mk
--- NVIDIA-Linux-x86_64-340.108-old/kernel/nvidia-modules-common.mk 2019-12-11 23:04:24.000000000 +0100
+++ NVIDIA-Linux-x86_64-340.108-new/kernel/nvidia-modules-common.mk 2020-08-04 16:18:14.073333322 +0200
@@ -222,6 +222,7 @@
define BUILD_MODULE_RULE
$(1): build-sanity-checks $(3)
@echo "NVIDIA: calling KBUILD..."; \
+ touch .nv-kernel.o.cmd; \
$$(MAKE) "CC=$$(CC)" NV_MODULE_SUFFIX=$$(strip $(2)) $$(KBUILD_PARAMS) modules; \
echo "NVIDIA: left KBUILD."; \
if ! [ -f $(1) ]; then \
diff -Naur NVIDIA-Linux-x86_64-340.108-old/kernel/nv-linux.h NVIDIA-Linux-x86_64-340.108-new/kernel/nv-linux.h
--- NVIDIA-Linux-x86_64-340.108-old/kernel/nv-linux.h 2020-08-01 20:34:33.900000000 +0200
+++ NVIDIA-Linux-x86_64-340.108-new/kernel/nv-linux.h 2020-08-03 13:10:17.693333317 +0200
@@ -669,11 +669,19 @@
# define KM_FREE_RECORD(a,b,c)
#endif
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)
+#define NV_VMALLOC(ptr, size) \
+ { \
+ (ptr) = __vmalloc(size, GFP_KERNEL); \
+ VM_ALLOC_RECORD(ptr, size, "vm_vmalloc"); \
+ }
+#else
#define NV_VMALLOC(ptr, size) \
{ \
(ptr) = __vmalloc(size, GFP_KERNEL, PAGE_KERNEL); \
VM_ALLOC_RECORD(ptr, size, "vm_vmalloc"); \
}
+#endif
#define NV_VFREE(ptr, size) \
{ \
diff -Naur NVIDIA-Linux-x86_64-340.108-old/kernel/os-mlock.c NVIDIA-Linux-x86_64-340.108-new/kernel/os-mlock.c
--- NVIDIA-Linux-x86_64-340.108-old/kernel/os-mlock.c 2019-12-11 23:04:24.000000000 +0100
+++ NVIDIA-Linux-x86_64-340.108-new/kernel/os-mlock.c 2020-08-03 13:11:06.536666663 +0200
@@ -44,11 +44,19 @@
return rmStatus;
}
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)
+ down_read(&mm->mmap_lock);
+ ret = NV_GET_USER_PAGES((unsigned long)address,
+ page_count, write, force, user_pages, NULL);
+ up_read(&mm->mmap_lock);
+ pinned = ret;
+#else
down_read(&mm->mmap_sem);
ret = NV_GET_USER_PAGES((unsigned long)address,
page_count, write, force, user_pages, NULL);
up_read(&mm->mmap_sem);
pinned = ret;
+#endif
if (ret < 0)
{

View File

@@ -6,8 +6,8 @@ PKG_NAME="xf86-video-nvidia"
# Remember to run "python packages/x11/driver/xf86-video-nvidia/scripts/make_nvidia_udev.py" and commit changes to
# "packages/x11/driver/xf86-video-nvidia/udev.d/96-nvidia.rules" whenever bumping version.
# Host may require installation of python-lxml and python-requests packages.
PKG_VERSION="440.82"
PKG_SHA256="89feda0c3e54c9c0d0528760bbb5cf4d8e57408fb3df2728653f3a1b73c110a9"
PKG_VERSION="450.57"
PKG_SHA256="8a65da18761a2e6547d681b0d87201a46d822e71a318c89a849767a95fbd1e07"
PKG_ARCH="x86_64"
PKG_LICENSE="nonfree"
PKG_SITE="http://www.nvidia.com/"

View File

@@ -1,35 +0,0 @@
From b54cae6b96e4891708ee72d3c98766348c3feece Mon Sep 17 00:00:00 2001
From: MilhouseVH <milhouseVH.github@nmacleod.com>
Date: Mon, 13 Apr 2020 01:30:59 +0100
Subject: [PATCH] NVIDIA 440.82 - Kernel 5.7 Patch
Credit: Isaak I. Aleksandrov, https://gitlab.com/snippets/1965550
---
kernel/conftest.sh | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/kernel/conftest.sh b/kernel/conftest.sh
index 8f807a1..af29636 100755
--- a/kernel/conftest.sh
+++ b/kernel/conftest.sh
@@ -143,6 +143,7 @@ test_headers() {
FILES="$FILES video/nv_internal.h"
FILES="$FILES asm/book3s/64/hash-64k.h"
FILES="$FILES asm/set_memory.h"
+ FILES="$FILES asm/pgtable.h"
FILES="$FILES asm/prom.h"
FILES="$FILES asm/powernv.h"
FILES="$FILES asm/tlbflush.h"
@@ -466,6 +467,9 @@ compile_test() {
# It does not exist on all architectures.
#
CODE="
+ #if defined(NV_ASM_PGTABLE_H_PRESENT)
+ #include <asm/pgtable.h>
+ #endif
#if defined(NV_ASM_SET_MEMORY_H_PRESENT)
#include <asm/set_memory.h>
#else
--
2.20.1

View File

@@ -246,6 +246,8 @@ ATTRS{device}=="0x1e84", GOTO="configure_nvidia"
ATTRS{device}=="0x1e87", GOTO="configure_nvidia"
ATTRS{device}=="0x1e89", GOTO="configure_nvidia"
ATTRS{device}=="0x1e90", GOTO="configure_nvidia"
ATTRS{device}=="0x1e91", GOTO="configure_nvidia"
ATTRS{device}=="0x1e93", GOTO="configure_nvidia"
ATTRS{device}=="0x1eb0", GOTO="configure_nvidia"
ATTRS{device}=="0x1eb1", GOTO="configure_nvidia"
ATTRS{device}=="0x1eb5", GOTO="configure_nvidia"
@@ -254,29 +256,44 @@ ATTRS{device}=="0x1eb8", GOTO="configure_nvidia"
ATTRS{device}=="0x1ec2", GOTO="configure_nvidia"
ATTRS{device}=="0x1ec7", GOTO="configure_nvidia"
ATTRS{device}=="0x1ed0", GOTO="configure_nvidia"
ATTRS{device}=="0x1ed1", GOTO="configure_nvidia"
ATTRS{device}=="0x1ed3", GOTO="configure_nvidia"
ATTRS{device}=="0x1ef5", GOTO="configure_nvidia"
ATTRS{device}=="0x1f02", GOTO="configure_nvidia"
ATTRS{device}=="0x1f06", GOTO="configure_nvidia"
ATTRS{device}=="0x1f07", GOTO="configure_nvidia"
ATTRS{device}=="0x1f08", GOTO="configure_nvidia"
ATTRS{device}=="0x1f09", GOTO="configure_nvidia"
ATTRS{device}=="0x1f0a", GOTO="configure_nvidia"
ATTRS{device}=="0x1f10", GOTO="configure_nvidia"
ATTRS{device}=="0x1f11", GOTO="configure_nvidia"
ATTRS{device}=="0x1f12", GOTO="configure_nvidia"
ATTRS{device}=="0x1f14", GOTO="configure_nvidia"
ATTRS{device}=="0x1f15", GOTO="configure_nvidia"
ATTRS{device}=="0x1f36", GOTO="configure_nvidia"
ATTRS{device}=="0x1f42", GOTO="configure_nvidia"
ATTRS{device}=="0x1f47", GOTO="configure_nvidia"
ATTRS{device}=="0x1f50", GOTO="configure_nvidia"
ATTRS{device}=="0x1f51", GOTO="configure_nvidia"
ATTRS{device}=="0x1f54", GOTO="configure_nvidia"
ATTRS{device}=="0x1f55", GOTO="configure_nvidia"
ATTRS{device}=="0x1f76", GOTO="configure_nvidia"
ATTRS{device}=="0x1f82", GOTO="configure_nvidia"
ATTRS{device}=="0x1f91", GOTO="configure_nvidia"
ATTRS{device}=="0x1f95", GOTO="configure_nvidia"
ATTRS{device}=="0x1f96", GOTO="configure_nvidia"
ATTRS{device}=="0x1f99", GOTO="configure_nvidia"
ATTRS{device}=="0x1fb8", GOTO="configure_nvidia"
ATTRS{device}=="0x1fb9", GOTO="configure_nvidia"
ATTRS{device}=="0x1ff9", GOTO="configure_nvidia"
ATTRS{device}=="0x20b0", GOTO="configure_nvidia"
ATTRS{device}=="0x20f1", GOTO="configure_nvidia"
ATTRS{device}=="0x2182", GOTO="configure_nvidia"
ATTRS{device}=="0x2184", GOTO="configure_nvidia"
ATTRS{device}=="0x2187", GOTO="configure_nvidia"
ATTRS{device}=="0x2188", GOTO="configure_nvidia"
ATTRS{device}=="0x2191", GOTO="configure_nvidia"
ATTRS{device}=="0x2192", GOTO="configure_nvidia"
ATTRS{device}=="0x21c4", GOTO="configure_nvidia"
ATTRS{device}=="0x21d1", GOTO="configure_nvidia"
GOTO="configure_nvidia-legacy"

View File

@@ -1,26 +0,0 @@
From 553421da73a5762107818f6e91771b54d80ff88e Mon Sep 17 00:00:00 2001
From: Jernej Skrabec <jernej.skrabec@siol.net>
Date: Sat, 4 Apr 2020 11:31:29 +0200
Subject: [PATCH 3/3] ARM: dts: sun8i-h3: increase mali frequency
Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
---
arch/arm/boot/dts/sun8i-h3.dtsi | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/boot/dts/sun8i-h3.dtsi b/arch/arm/boot/dts/sun8i-h3.dtsi
index e83aa6866e7e..808769cb6665 100644
--- a/arch/arm/boot/dts/sun8i-h3.dtsi
+++ b/arch/arm/boot/dts/sun8i-h3.dtsi
@@ -207,7 +207,7 @@ mali: gpu@1c40000 {
resets = <&ccu RST_BUS_GPU>;
assigned-clocks = <&ccu CLK_GPU>;
- assigned-clock-rates = <384000000>;
+ assigned-clock-rates = <576000000>;
};
ths: thermal-sensor@1c25000 {
--
2.26.0

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,269 +0,0 @@
From d5aecd289babf3adcf5a837b067a5efddb097d99 Mon Sep 17 00:00:00 2001
From: Jernej Skrabec <jernej.skrabec@siol.net>
Date: Sat, 9 May 2020 22:06:43 +0200
Subject: [PATCH] media: cedrus: Implement runtime PM
This allows the VE clocks and PLL_VE to be disabled most of the time.
A runtime PM reference is held while streaming.
Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Ezequiel Garcia <ezequiel@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
---
drivers/staging/media/sunxi/cedrus/cedrus.c | 7 ++
.../staging/media/sunxi/cedrus/cedrus_hw.c | 106 ++++++++++++------
.../staging/media/sunxi/cedrus/cedrus_hw.h | 3 +
.../staging/media/sunxi/cedrus/cedrus_video.c | 33 ++++--
4 files changed, 104 insertions(+), 45 deletions(-)
diff --git a/drivers/staging/media/sunxi/cedrus/cedrus.c b/drivers/staging/media/sunxi/cedrus/cedrus.c
index 05a85517ff60..bc27f9430eeb 100644
--- a/drivers/staging/media/sunxi/cedrus/cedrus.c
+++ b/drivers/staging/media/sunxi/cedrus/cedrus.c
@@ -16,6 +16,7 @@
#include <linux/platform_device.h>
#include <linux/module.h>
#include <linux/of.h>
+#include <linux/pm.h>
#include <media/v4l2-device.h>
#include <media/v4l2-ioctl.h>
@@ -551,12 +552,18 @@ static const struct of_device_id cedrus_dt_match[] = {
};
MODULE_DEVICE_TABLE(of, cedrus_dt_match);
+static const struct dev_pm_ops cedrus_dev_pm_ops = {
+ SET_RUNTIME_PM_OPS(cedrus_hw_suspend,
+ cedrus_hw_resume, NULL)
+};
+
static struct platform_driver cedrus_driver = {
.probe = cedrus_probe,
.remove = cedrus_remove,
.driver = {
.name = CEDRUS_NAME,
.of_match_table = of_match_ptr(cedrus_dt_match),
+ .pm = &cedrus_dev_pm_ops,
},
};
module_platform_driver(cedrus_driver);
diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_hw.c b/drivers/staging/media/sunxi/cedrus/cedrus_hw.c
index daf5f244f93b..1744e6fcc999 100644
--- a/drivers/staging/media/sunxi/cedrus/cedrus_hw.c
+++ b/drivers/staging/media/sunxi/cedrus/cedrus_hw.c
@@ -19,6 +19,7 @@
#include <linux/dma-mapping.h>
#include <linux/interrupt.h>
#include <linux/clk.h>
+#include <linux/pm_runtime.h>
#include <linux/regmap.h>
#include <linux/reset.h>
#include <linux/soc/sunxi/sunxi_sram.h>
@@ -140,6 +141,64 @@ static irqreturn_t cedrus_irq(int irq, void *data)
return IRQ_HANDLED;
}
+int cedrus_hw_suspend(struct device *device)
+{
+ struct cedrus_dev *dev = dev_get_drvdata(device);
+
+ reset_control_assert(dev->rstc);
+
+ clk_disable_unprepare(dev->ram_clk);
+ clk_disable_unprepare(dev->mod_clk);
+ clk_disable_unprepare(dev->ahb_clk);
+
+ return 0;
+}
+
+int cedrus_hw_resume(struct device *device)
+{
+ struct cedrus_dev *dev = dev_get_drvdata(device);
+ int ret;
+
+ ret = clk_prepare_enable(dev->ahb_clk);
+ if (ret) {
+ dev_err(dev->dev, "Failed to enable AHB clock\n");
+
+ return ret;
+ }
+
+ ret = clk_prepare_enable(dev->mod_clk);
+ if (ret) {
+ dev_err(dev->dev, "Failed to enable MOD clock\n");
+
+ goto err_ahb_clk;
+ }
+
+ ret = clk_prepare_enable(dev->ram_clk);
+ if (ret) {
+ dev_err(dev->dev, "Failed to enable RAM clock\n");
+
+ goto err_mod_clk;
+ }
+
+ ret = reset_control_reset(dev->rstc);
+ if (ret) {
+ dev_err(dev->dev, "Failed to apply reset\n");
+
+ goto err_ram_clk;
+ }
+
+ return 0;
+
+err_ram_clk:
+ clk_disable_unprepare(dev->ram_clk);
+err_mod_clk:
+ clk_disable_unprepare(dev->mod_clk);
+err_ahb_clk:
+ clk_disable_unprepare(dev->ahb_clk);
+
+ return ret;
+}
+
int cedrus_hw_probe(struct cedrus_dev *dev)
{
const struct cedrus_variant *variant;
@@ -236,42 +295,17 @@ int cedrus_hw_probe(struct cedrus_dev *dev)
goto err_sram;
}
- ret = clk_prepare_enable(dev->ahb_clk);
- if (ret) {
- dev_err(dev->dev, "Failed to enable AHB clock\n");
-
- goto err_sram;
- }
-
- ret = clk_prepare_enable(dev->mod_clk);
- if (ret) {
- dev_err(dev->dev, "Failed to enable MOD clock\n");
-
- goto err_ahb_clk;
- }
-
- ret = clk_prepare_enable(dev->ram_clk);
- if (ret) {
- dev_err(dev->dev, "Failed to enable RAM clock\n");
-
- goto err_mod_clk;
- }
-
- ret = reset_control_reset(dev->rstc);
- if (ret) {
- dev_err(dev->dev, "Failed to apply reset\n");
-
- goto err_ram_clk;
+ pm_runtime_enable(dev->dev);
+ if (!pm_runtime_enabled(dev->dev)) {
+ ret = cedrus_hw_resume(dev->dev);
+ if (ret)
+ goto err_pm;
}
return 0;
-err_ram_clk:
- clk_disable_unprepare(dev->ram_clk);
-err_mod_clk:
- clk_disable_unprepare(dev->mod_clk);
-err_ahb_clk:
- clk_disable_unprepare(dev->ahb_clk);
+err_pm:
+ pm_runtime_disable(dev->dev);
err_sram:
sunxi_sram_release(dev->dev);
err_mem:
@@ -282,11 +316,9 @@ int cedrus_hw_probe(struct cedrus_dev *dev)
void cedrus_hw_remove(struct cedrus_dev *dev)
{
- reset_control_assert(dev->rstc);
-
- clk_disable_unprepare(dev->ram_clk);
- clk_disable_unprepare(dev->mod_clk);
- clk_disable_unprepare(dev->ahb_clk);
+ pm_runtime_disable(dev->dev);
+ if (!pm_runtime_status_suspended(dev->dev))
+ cedrus_hw_suspend(dev->dev);
sunxi_sram_release(dev->dev);
diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_hw.h b/drivers/staging/media/sunxi/cedrus/cedrus_hw.h
index 604ff932fbf5..45f641f0bfa2 100644
--- a/drivers/staging/media/sunxi/cedrus/cedrus_hw.h
+++ b/drivers/staging/media/sunxi/cedrus/cedrus_hw.h
@@ -22,6 +22,9 @@ void cedrus_engine_disable(struct cedrus_dev *dev);
void cedrus_dst_format_set(struct cedrus_dev *dev,
struct v4l2_pix_format *fmt);
+int cedrus_hw_suspend(struct device *device);
+int cedrus_hw_resume(struct device *device);
+
int cedrus_hw_probe(struct cedrus_dev *dev);
void cedrus_hw_remove(struct cedrus_dev *dev);
diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_video.c b/drivers/staging/media/sunxi/cedrus/cedrus_video.c
index ed3f511f066f..16d82309e7b6 100644
--- a/drivers/staging/media/sunxi/cedrus/cedrus_video.c
+++ b/drivers/staging/media/sunxi/cedrus/cedrus_video.c
@@ -13,6 +13,8 @@
* Marek Szyprowski, <m.szyprowski@samsung.com>
*/
+#include <linux/pm_runtime.h>
+
#include <media/videobuf2-dma-contig.h>
#include <media/v4l2-device.h>
#include <media/v4l2-ioctl.h>
@@ -450,12 +452,24 @@ static int cedrus_start_streaming(struct vb2_queue *vq, unsigned int count)
return -EINVAL;
}
- if (V4L2_TYPE_IS_OUTPUT(vq->type) &&
- dev->dec_ops[ctx->current_codec]->start)
- ret = dev->dec_ops[ctx->current_codec]->start(ctx);
+ if (V4L2_TYPE_IS_OUTPUT(vq->type)) {
+ ret = pm_runtime_get_sync(dev->dev);
+ if (ret < 0)
+ goto err_cleanup;
- if (ret)
- cedrus_queue_cleanup(vq, VB2_BUF_STATE_QUEUED);
+ if (dev->dec_ops[ctx->current_codec]->start) {
+ ret = dev->dec_ops[ctx->current_codec]->start(ctx);
+ if (ret)
+ goto err_pm;
+ }
+ }
+
+ return 0;
+
+err_pm:
+ pm_runtime_put(dev->dev);
+err_cleanup:
+ cedrus_queue_cleanup(vq, VB2_BUF_STATE_QUEUED);
return ret;
}
@@ -465,9 +479,12 @@ static void cedrus_stop_streaming(struct vb2_queue *vq)
struct cedrus_ctx *ctx = vb2_get_drv_priv(vq);
struct cedrus_dev *dev = ctx->dev;
- if (V4L2_TYPE_IS_OUTPUT(vq->type) &&
- dev->dec_ops[ctx->current_codec]->stop)
- dev->dec_ops[ctx->current_codec]->stop(ctx);
+ if (V4L2_TYPE_IS_OUTPUT(vq->type)) {
+ if (dev->dec_ops[ctx->current_codec]->stop)
+ dev->dec_ops[ctx->current_codec]->stop(ctx);
+
+ pm_runtime_put(dev->dev);
+ }
cedrus_queue_cleanup(vq, VB2_BUF_STATE_ERROR);
}
--
2.27.0

View File

@@ -13,70 +13,6 @@ Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
include/media/hevc-ctrls.h | 11 +++++
4 files changed, 63 insertions(+)
diff --git a/Documentation/media/uapi/v4l/ext-ctrls-codec.rst b/Documentation/media/uapi/v4l/ext-ctrls-codec.rst
index d4fc5f25aa14..e8e707642336 100644
--- a/Documentation/media/uapi/v4l/ext-ctrls-codec.rst
+++ b/Documentation/media/uapi/v4l/ext-ctrls-codec.rst
@@ -4196,6 +4196,47 @@ enum v4l2_mpeg_video_hevc_size_of_length_field -
- ``padding[6]``
- Applications and drivers must set this to zero.
+``V4L2_CID_MPEG_VIDEO_HEVC_SCALING_MATRIX (struct)``
+ Specifies the scaling matrix (as extracted from the bitstream) for
+ the associated HEVC slice data. The bitstream parameters are
+ defined according to :ref:`hevc`, section 7.4.5 "Scaling list
+ data semantics". For further documentation, refer to the above
+ specification, unless there is an explicit comment stating
+ otherwise.
+
+ .. note::
+
+ This compound control is not yet part of the public kernel API and
+ it is expected to change.
+
+.. c:type:: v4l2_ctrl_hevc_scaling_matrix
+
+.. cssclass:: longtable
+
+.. flat-table:: struct v4l2_ctrl_hevc_scaling_matrix
+ :header-rows: 0
+ :stub-columns: 0
+ :widths: 1 1 2
+
+ * - __u8
+ - ``scaling_list_4x4[6][16]``
+ -
+ * - __u8
+ - ``scaling_list_8x8[6][64]``
+ -
+ * - __u8
+ - ``scaling_list_16x16[6][64]``
+ -
+ * - __u8
+ - ``scaling_list_32x32[2][64]``
+ -
+ * - __u8
+ - ``scaling_list_dc_coef_16x16[6]``
+ -
+ * - __u8
+ - ``scaling_list_dc_coef_32x32[2]``
+ -
+
``V4L2_CID_MPEG_VIDEO_HEVC_DECODE_MODE (enum)``
Specifies the decoding mode to use. Currently exposes slice-based and
frame-based decoding but new modes might be added later on.
diff --git a/Documentation/media/uapi/v4l/pixfmt-compressed.rst b/Documentation/media/uapi/v4l/pixfmt-compressed.rst
index 561bda112809..3aabc322daa4 100644
--- a/Documentation/media/uapi/v4l/pixfmt-compressed.rst
+++ b/Documentation/media/uapi/v4l/pixfmt-compressed.rst
@@ -207,6 +207,7 @@ Compressed Formats
* ``V4L2_CID_MPEG_VIDEO_HEVC_SPS``
* ``V4L2_CID_MPEG_VIDEO_HEVC_PPS``
* ``V4L2_CID_MPEG_VIDEO_HEVC_SLICE_PARAMS``
+ * ``V4L2_CID_MPEG_VIDEO_HEVC_SCALING_MATRIX``
See the :ref:`associated Codec Control IDs <v4l2-mpeg-hevc>`.
Buffers associated with this pixel format must contain the appropriate
number of macroblocks to decode a full corresponding frame.
diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c b/drivers/media/v4l2-core/v4l2-ctrls.c
index 93d33d1db4e8..94c3e64ffb8b 100644
--- a/drivers/media/v4l2-core/v4l2-ctrls.c
@@ -337,29 +273,6 @@ Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
include/media/hevc-ctrls.h | 5 ++++-
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/Documentation/media/uapi/v4l/ext-ctrls-codec.rst b/Documentation/media/uapi/v4l/ext-ctrls-codec.rst
index e8e707642336..0d85a3ec0a45 100644
--- a/Documentation/media/uapi/v4l/ext-ctrls-codec.rst
+++ b/Documentation/media/uapi/v4l/ext-ctrls-codec.rst
@@ -3991,6 +3991,9 @@ enum v4l2_mpeg_video_hevc_size_of_length_field -
* - __u32
- ``data_bit_offset``
- Offset (in bits) to the video data in the current slice data.
+ * - __u32
+ - ``slice_segment_addr``
+ -
* - __u8
- ``nal_unit_type``
-
@@ -4068,7 +4071,7 @@ enum v4l2_mpeg_video_hevc_size_of_length_field -
- ``num_rps_poc_lt_curr``
- The number of reference pictures in the long-term set.
* - __u8
- - ``padding[7]``
+ - ``padding[5]``
- Applications and drivers must set this to zero.
* - struct :c:type:`v4l2_hevc_dpb_entry`
- ``dpb[V4L2_HEVC_DPB_ENTRIES_NUM_MAX]``
diff --git a/include/media/hevc-ctrls.h b/include/media/hevc-ctrls.h
index 1592e52c3614..3e2e32098312 100644
--- a/include/media/hevc-ctrls.h

View File

@@ -177,7 +177,7 @@ index 43643ad31730..d840bc07cba6 100644
}
+#ifdef CONFIG_DRM_SUN8I_DW_HDMI_CEC
+static bool sun8i_hdmi_phy_cec_pin_read(struct cec_adapter *adap)
+static int sun8i_hdmi_phy_cec_pin_read(struct cec_adapter *adap)
+{
+ struct sun8i_hdmi_phy *phy = cec_get_drvdata(adap);
+ unsigned int val;

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More