lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180613140714.1686-5-maxime.ripard@bootlin.com>
Date:   Wed, 13 Jun 2018 16:07:09 +0200
From:   Maxime Ripard <maxime.ripard@...tlin.com>
To:     hans.verkuil@...co.com, acourbot@...omium.org,
        sakari.ailus@...ux.intel.com,
        Laurent Pinchart <laurent.pinchart@...asonboard.com>
Cc:     tfiga@...omium.org, posciak@...omium.org,
        Paul Kocialkowski <paul.kocialkowski@...tlin.com>,
        Chen-Yu Tsai <wens@...e.org>, linux-kernel@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org, linux-media@...r.kernel.org,
        nicolas.dufresne@...labora.com, jenskuske@...il.com,
        linux-sunxi@...glegroups.com,
        Thomas Petazzoni <thomas.petazzoni@...tlin.com>,
        Maxime Ripard <maxime.ripard@...tlin.com>
Subject: [PATCH 4/9] media: cedrus: make engine type more generic

The sunxi_cedrus_engine enum actually enumerates pretty much the codecs to
use (or we can easily infer the codec engine from the codec).

Since we will need the codec type as well in some later refactoring, make
that structure more useful by just enumerating the codec, and converting
the existing users.

Signed-off-by: Maxime Ripard <maxime.ripard@...tlin.com>
---
 drivers/media/platform/sunxi/cedrus/sunxi_cedrus_common.h | 6 ++++++
 drivers/media/platform/sunxi/cedrus/sunxi_cedrus_hw.c     | 6 +++---
 drivers/media/platform/sunxi/cedrus/sunxi_cedrus_hw.h     | 6 +-----
 drivers/media/platform/sunxi/cedrus/sunxi_cedrus_mpeg2.c  | 2 +-
 4 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/drivers/media/platform/sunxi/cedrus/sunxi_cedrus_common.h b/drivers/media/platform/sunxi/cedrus/sunxi_cedrus_common.h
index b1ed1c8cb130..a5f83c452006 100644
--- a/drivers/media/platform/sunxi/cedrus/sunxi_cedrus_common.h
+++ b/drivers/media/platform/sunxi/cedrus/sunxi_cedrus_common.h
@@ -61,6 +61,12 @@ struct sunxi_cedrus_run {
 	};
 };
 
+enum sunxi_cedrus_codec {
+	SUNXI_CEDRUS_CODEC_MPEG2,
+
+	SUNXI_CEDRUS_CODEC_LAST,
+};
+
 struct sunxi_cedrus_ctx {
 	struct v4l2_fh fh;
 	struct sunxi_cedrus_dev	*dev;
diff --git a/drivers/media/platform/sunxi/cedrus/sunxi_cedrus_hw.c b/drivers/media/platform/sunxi/cedrus/sunxi_cedrus_hw.c
index fc688a5c1ea3..bb46a01214e0 100644
--- a/drivers/media/platform/sunxi/cedrus/sunxi_cedrus_hw.c
+++ b/drivers/media/platform/sunxi/cedrus/sunxi_cedrus_hw.c
@@ -41,7 +41,7 @@
 #define SYSCON_SRAM_C1_MAP_VE	0x7fffffff
 
 int sunxi_cedrus_engine_enable(struct sunxi_cedrus_dev *dev,
-			       enum sunxi_cedrus_engine engine)
+			       enum sunxi_cedrus_codec codec)
 {
 	u32 reg = 0;
 
@@ -53,8 +53,8 @@ int sunxi_cedrus_engine_enable(struct sunxi_cedrus_dev *dev,
 
 	reg |= VE_CTRL_CACHE_BUS_BW_128;
 
-	switch (engine) {
-	case SUNXI_CEDRUS_ENGINE_MPEG:
+	switch (codec) {
+	case SUNXI_CEDRUS_CODEC_MPEG2:
 		reg |= VE_CTRL_DEC_MODE_MPEG;
 		break;
 
diff --git a/drivers/media/platform/sunxi/cedrus/sunxi_cedrus_hw.h b/drivers/media/platform/sunxi/cedrus/sunxi_cedrus_hw.h
index 34f3fae462a8..3236c80bfcf4 100644
--- a/drivers/media/platform/sunxi/cedrus/sunxi_cedrus_hw.h
+++ b/drivers/media/platform/sunxi/cedrus/sunxi_cedrus_hw.h
@@ -23,12 +23,8 @@
 #ifndef _SUNXI_CEDRUS_HW_H_
 #define _SUNXI_CEDRUS_HW_H_
 
-enum sunxi_cedrus_engine {
-	SUNXI_CEDRUS_ENGINE_MPEG,
-};
-
 int sunxi_cedrus_engine_enable(struct sunxi_cedrus_dev *dev,
-			       enum sunxi_cedrus_engine engine);
+			       enum sunxi_cedrus_codec codec);
 void sunxi_cedrus_engine_disable(struct sunxi_cedrus_dev *dev);
 
 int sunxi_cedrus_hw_probe(struct sunxi_cedrus_dev *dev);
diff --git a/drivers/media/platform/sunxi/cedrus/sunxi_cedrus_mpeg2.c b/drivers/media/platform/sunxi/cedrus/sunxi_cedrus_mpeg2.c
index 5be3e3b9ceef..85e6fc2fbdb2 100644
--- a/drivers/media/platform/sunxi/cedrus/sunxi_cedrus_mpeg2.c
+++ b/drivers/media/platform/sunxi/cedrus/sunxi_cedrus_mpeg2.c
@@ -83,7 +83,7 @@ void sunxi_cedrus_mpeg2_setup(struct sunxi_cedrus_ctx *ctx,
 	}
 
 	/* Activate MPEG engine. */
-	sunxi_cedrus_engine_enable(dev, SUNXI_CEDRUS_ENGINE_MPEG);
+	sunxi_cedrus_engine_enable(dev, SUNXI_CEDRUS_CODEC_MPEG2);
 
 	/* Set quantization matrices. */
 	for (i = 0; i < 64; i++) {
-- 
2.17.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ