Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / Atom feed
From: "Jernej Škrabec" <jernej.skrabec@gmail.com>
To: Maxime Ripard <maxime.ripard@bootlin.com>
Cc: linux-arm-kernel@lists.infradead.org,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	acourbot@chromium.org, jonas@kwiboo.se, jenskuske@gmail.com,
	linux-sunxi@googlegroups.com, linux-kernel@vger.kernel.org,
	tfiga@chromium.org,
	Paul Kocialkowski <paul.kocialkowski@bootlin.com>,
	Chen-Yu Tsai <wens@csie.org>,
	hans.verkuil@cisco.com,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	sakari.ailus@linux.intel.com, nicolas.dufresne@collabora.com,
	Ezequiel Garcia <ezequiel@collabora.com>,
	posciak@chromium.org, linux-media@vger.kernel.org
Subject: Re: [PATCH v3 2/2] media: cedrus: Add H264 decoding support
Date: Tue, 12 Feb 2019 18:40:56 +0100
Message-ID: <3363003.VFAkYA4tHV@jernej-laptop> (raw)
In-Reply-To: <20190212124713.cqms5jofw433nx6m@flea>

Dne torek, 12. februar 2019 ob 13:47:13 CET je Maxime Ripard napisal(a):
> On Mon, Feb 11, 2019 at 04:48:17PM -0300, Ezequiel Garcia wrote:
> > On Mon, 2019-02-11 at 15:39 +0100, Maxime Ripard wrote:
> > > Introduce some basic H264 decoding support in cedrus. So far, only the
> > > baseline profile videos have been tested, and some more advanced
> > > features
> > > used in higher profiles are not even implemented.
> > > 
> > > Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
> > 
> > [..]
> > 
> > > +static void _cedrus_write_ref_list(struct cedrus_ctx *ctx,
> > > +				   struct cedrus_run *run,
> > > +				   const u8 *ref_list, u8 
num_ref,
> > > +				   enum cedrus_h264_sram_off sram)
> > > +{
> > > +	const struct v4l2_ctrl_h264_decode_param *decode =
> > > run->h264.decode_param; +	struct vb2_queue *cap_q =
> > > &ctx->fh.m2m_ctx->cap_q_ctx.q;
> > > +	const struct vb2_buffer *dst_buf = &run->dst->vb2_buf;
> > > +	struct cedrus_dev *dev = ctx->dev;
> > > +	u8 sram_array[CEDRUS_MAX_REF_IDX];
> > > +	unsigned int size, i;
> > > +
> > > +	memset(sram_array, 0, sizeof(sram_array));
> > > +
> > > +	for (i = 0; i < num_ref; i++) {
> > > +		const struct v4l2_h264_dpb_entry *dpb;
> > > +		const struct cedrus_buffer *cedrus_buf;
> > > +		const struct vb2_v4l2_buffer *ref_buf;
> > > +		unsigned int position;
> > > +		int buf_idx;
> > > +		u8 dpb_idx;
> > > +
> > > +		dpb_idx = ref_list[i];
> > > +		dpb = &decode->dpb[dpb_idx];
> > > +
> > > +		if (!(dpb->flags & V4L2_H264_DPB_ENTRY_FLAG_ACTIVE))
> > > +			continue;
> > > +
> > > +		if (dst_buf->timestamp == dpb->timestamp)
> > > +			buf_idx = dst_buf->index;
> > > +		else
> > > +			buf_idx = vb2_find_timestamp(cap_q, dpb-
>timestamp, 0);
> > > +
> > > +		if (buf_idx < 0)
> > > +			continue;
> > > +
> > > +		ref_buf = to_vb2_v4l2_buffer(ctx->dst_bufs[buf_idx]);
> > > +		cedrus_buf = vb2_v4l2_to_cedrus_buffer(ref_buf);
> > > +		position = cedrus_buf->codec.h264.position;
> > > +
> > > +		sram_array[i] |= position << 1;
> > > +		if (ref_buf->field == V4L2_FIELD_BOTTOM)
> > > +			sram_array[i] |= BIT(0);
> > > +	}
> > > +
> > > +	size = min((unsigned int)ALIGN(num_ref, 4), sizeof(sram_array));
> > 
> > Perhaps s/unsigned int/size_t, so the arguments to min() have the same
> > type?
> > 
> > Otherwise, I got this warning:
> > 
> > /home/zeta/repos/linux/media_tree/drivers/staging/media/sunxi/cedrus/cedru
> > s_h264.c: In function ‘_cedrus_write_ref_list’:
> > /home/zeta/repos/linux/media_tree/include/linux/kernel.h:846:29: warning:
> > comparison of distinct pointer types lacks a cast> 
> >    (!!(sizeof((typeof(x) *)1 == (typeof(y) *)1)))
> 
> Strange, I didn't notice any warning. I'll make sure to fix it.

I guess this is one of those warnings which pops out only on 64-bit platforms.

Best regards,
Jernej




_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply index

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-11 14:39 [PATCH v3 0/2] " Maxime Ripard
2019-02-11 14:39 ` [PATCH v3 1/2] media: uapi: Add H264 low-level decoder API compound controls Maxime Ripard
2019-02-11 15:16   ` Hans Verkuil
2019-02-11 15:21     ` Hans Verkuil
2019-02-12 13:05       ` Maxime Ripard
2019-02-12 21:17         ` Ezequiel Garcia
2019-02-11 17:16     ` Nicolas Dufresne
2019-02-11 17:12   ` Ezequiel Garcia
2019-02-12 10:23     ` Maxime Ripard
2019-02-11 19:53   ` Ezequiel Garcia
2019-02-11 14:39 ` [PATCH v3 2/2] media: cedrus: Add H264 decoding support Maxime Ripard
2019-02-11 19:21   ` [linux-sunxi] " Jernej Škrabec
2019-02-12 10:43     ` Maxime Ripard
2019-02-12 17:46       ` Jernej Škrabec
2019-02-11 19:48   ` Ezequiel Garcia
2019-02-12 12:47     ` Maxime Ripard
2019-02-12 17:40       ` Jernej Škrabec [this message]
2019-02-14 20:42   ` Jernej Škrabec
2019-02-14 21:27   ` Jernej Škrabec
2019-02-12 12:50 ` [PATCH v3 0/2] " Tomasz Figa
2019-02-12 21:22   ` Ezequiel Garcia
2019-02-13  3:02     ` Tomasz Figa
2019-02-13 16:28       ` Ezequiel Garcia
2019-02-14 15:47         ` Maxime Ripard

Reply instructions:

You may reply publically 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=3363003.VFAkYA4tHV@jernej-laptop \
    --to=jernej.skrabec@gmail.com \
    --cc=acourbot@chromium.org \
    --cc=ezequiel@collabora.com \
    --cc=hans.verkuil@cisco.com \
    --cc=jenskuske@gmail.com \
    --cc=jonas@kwiboo.se \
    --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=paul.kocialkowski@bootlin.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

Linux-ARM-Kernel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-arm-kernel/0 linux-arm-kernel/git/0.git
	git clone --mirror https://lore.kernel.org/linux-arm-kernel/1 linux-arm-kernel/git/1.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-arm-kernel linux-arm-kernel/ https://lore.kernel.org/linux-arm-kernel \
		linux-arm-kernel@lists.infradead.org infradead-linux-arm-kernel@archiver.kernel.org
	public-inbox-index linux-arm-kernel


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.infradead.lists.linux-arm-kernel


AGPL code for this site: git clone https://public-inbox.org/ public-inbox