mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
To: Maxime Ripard <maxime.ripard@bootlin.com>,
	hans.verkuil@cisco.com, acourbot@chromium.org,
	sakari.ailus@linux.intel.com,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: tfiga@chromium.org, posciak@chromium.org,
	Chen-Yu Tsai <wens@csie.org>,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-media@vger.kernel.org, nicolas.dufresne@collabora.com,
	jenskuske@gmail.com, linux-sunxi@googlegroups.com,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Subject: Re: [PATCH 4/9] media: cedrus: make engine type more generic
Date: Thu, 21 Jun 2018 11:33:44 +0200	[thread overview]
Message-ID: <4fcfed23bfae158699c23329f92d6f2e968dc062.camel@bootlin.com> (raw)
In-Reply-To: <20180613140714.1686-5-maxime.ripard@bootlin.com>

[-- Attachment #1: Type: text/plain, Size: 3982 bytes --]

Hi,

On Wed, 2018-06-13 at 16:07 +0200, Maxime Ripard wrote:
> 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.

With the comment below taken in account, this is:

Acked-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>

> Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.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 {

Feel free to rename to cedrus_codec when rebasing on top of the latest
patchset introducing the driver.

Cheers,

Paul

> +	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++) {
-- 
Paul Kocialkowski, Bootlin (formerly Free Electrons)
Embedded Linux and kernel engineering
https://bootlin.com

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2018-06-21  9:34 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-13 14:07 [PATCH 0/9] media: cedrus: Add H264 decoding support Maxime Ripard
2018-06-13 14:07 ` [PATCH 1/9] CHROMIUM: v4l: Add H264 low-level decoder API compound controls Maxime Ripard
2018-06-15 11:59   ` Hans Verkuil
2018-06-15 13:01     ` Guenter Roeck
2018-07-12 16:38     ` Maxime Ripard
2018-07-12 16:47       ` Andrew Lunn
2018-06-21  8:58   ` Paul Kocialkowski
2018-08-21 16:58   ` Ezequiel Garcia
2018-08-21 17:07     ` Nicolas Dufresne
2018-08-22 13:07       ` Paul Kocialkowski
2018-08-22 13:38         ` Tomasz Figa
2018-08-22 13:52           ` Nicolas Dufresne
2018-08-22 14:45           ` Paul Kocialkowski
2018-08-28  8:11             ` Tomasz Figa
2018-09-07  7:54               ` Tomasz Figa
2018-08-22  9:15     ` Maxime Ripard
2018-08-22  9:54       ` Tomasz Figa
2018-08-22 13:03         ` Paul Kocialkowski
2018-08-22 13:24           ` Tomasz Figa
2018-08-22 14:03             ` Nicolas Dufresne
2018-08-22 14:30             ` Paul Kocialkowski
2018-06-13 14:07 ` [PATCH 2/9] media: cedrus: Add wrappers around container_of for our buffers Maxime Ripard
2018-06-21  9:03   ` Paul Kocialkowski
2018-06-13 14:07 ` [PATCH 3/9] media: cedrus: Add a macro to check for the validity of a control Maxime Ripard
2018-06-21  9:13   ` Paul Kocialkowski
2018-06-13 14:07 ` [PATCH 4/9] media: cedrus: make engine type more generic Maxime Ripard
2018-06-21  9:33   ` Paul Kocialkowski [this message]
2018-06-13 14:07 ` [PATCH 5/9] media: cedrus: Remove MPEG1 support Maxime Ripard
2018-06-13 14:07 ` [PATCH 6/9] media: cedrus: Add ops structure Maxime Ripard
2018-06-21  9:49   ` Paul Kocialkowski
2018-06-25 13:29     ` Maxime Ripard
2018-06-25 13:48       ` Paul Kocialkowski
2018-06-13 14:07 ` [PATCH 7/9] media: cedrus: Move IRQ maintainance to cedrus_dec_ops Maxime Ripard
2018-06-21 15:35   ` Paul Kocialkowski
2018-06-25 14:18     ` Paul Kocialkowski
2018-06-25 16:15       ` Maxime Ripard
2018-06-25 15:38   ` Paul Kocialkowski
2018-06-25 15:49     ` Paul Kocialkowski
2018-06-25 19:01       ` Maxime Ripard
2018-06-27 17:58       ` Maxime Ripard
2018-06-13 14:07 ` [PATCH 8/9] media: cedrus: Add start and stop decoder operations Maxime Ripard
2018-06-21 15:38   ` Paul Kocialkowski
2018-06-25 13:32     ` Maxime Ripard
2018-06-25 13:42       ` Paul Kocialkowski
2018-06-13 14:07 ` [PATCH 9/9] media: cedrus: Add H264 decoding support Maxime Ripard
2018-07-27 13:56   ` Paul Kocialkowski
2018-07-27 14:01     ` Chen-Yu Tsai
2018-07-27 14:03       ` Paul Kocialkowski
2018-07-30 12:54   ` Paul Kocialkowski
2018-06-14 13:00 ` [PATCH 0/9] " Tomasz Figa
2018-06-14 16:37   ` Maxime Ripard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4fcfed23bfae158699c23329f92d6f2e968dc062.camel@bootlin.com \
    --to=paul.kocialkowski@bootlin.com \
    --cc=acourbot@chromium.org \
    --cc=hans.verkuil@cisco.com \
    --cc=jenskuske@gmail.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-sunxi@googlegroups.com \
    --cc=maxime.ripard@bootlin.com \
    --cc=nicolas.dufresne@collabora.com \
    --cc=posciak@chromium.org \
    --cc=sakari.ailus@linux.intel.com \
    --cc=tfiga@chromium.org \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=wens@csie.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®