From: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
To: linux-media@vger.kernel.org, devel@driverdev.osuosl.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Cc: Maxime Ripard <maxime.ripard@bootlin.com>,
Paul Kocialkowski <paul.kocialkowski@bootlin.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
Hans Verkuil <hverkuil@xs4all.nl>,
Tomasz Figa <tfiga@chromium.org>
Subject: [PATCH] Revert "media: cedrus: Allow using the current dst buffer as reference"
Date: Thu, 24 Jan 2019 10:55:42 +0100 [thread overview]
Message-ID: <20190124095542.22321-1-paul.kocialkowski@bootlin.com> (raw)
This reverts commit cf20ae1535eb690a87c29b9cc7af51881384e967.
The vb2_find_timestamp helper was modified to allow finding buffers
regardless of their current state in the queue. This means that we
no longer have to take particular care of references to the current
capture buffer.
---
drivers/staging/media/sunxi/cedrus/cedrus_dec.c | 13 -------------
drivers/staging/media/sunxi/cedrus/cedrus_dec.h | 2 --
drivers/staging/media/sunxi/cedrus/cedrus_mpeg2.c | 10 ++++------
3 files changed, 4 insertions(+), 21 deletions(-)
diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_dec.c b/drivers/staging/media/sunxi/cedrus/cedrus_dec.c
index 2c295286766c..443fb037e1cf 100644
--- a/drivers/staging/media/sunxi/cedrus/cedrus_dec.c
+++ b/drivers/staging/media/sunxi/cedrus/cedrus_dec.c
@@ -22,19 +22,6 @@
#include "cedrus_dec.h"
#include "cedrus_hw.h"
-int cedrus_reference_index_find(struct vb2_queue *queue,
- struct vb2_buffer *vb2_buf, u64 timestamp)
-{
- /*
- * Allow using the current capture buffer as reference, which can occur
- * for field-coded pictures.
- */
- if (vb2_buf->timestamp == timestamp)
- return vb2_buf->index;
- else
- return vb2_find_timestamp(queue, timestamp, 0);
-}
-
void cedrus_device_run(void *priv)
{
struct cedrus_ctx *ctx = priv;
diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_dec.h b/drivers/staging/media/sunxi/cedrus/cedrus_dec.h
index 8d0fc248220f..d1ae7903677b 100644
--- a/drivers/staging/media/sunxi/cedrus/cedrus_dec.h
+++ b/drivers/staging/media/sunxi/cedrus/cedrus_dec.h
@@ -16,8 +16,6 @@
#ifndef _CEDRUS_DEC_H_
#define _CEDRUS_DEC_H_
-int cedrus_reference_index_find(struct vb2_queue *queue,
- struct vb2_buffer *vb2_buf, u64 timestamp);
void cedrus_device_run(void *priv);
#endif
diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_mpeg2.c b/drivers/staging/media/sunxi/cedrus/cedrus_mpeg2.c
index 81c66a8aa1ac..cb45fda9aaeb 100644
--- a/drivers/staging/media/sunxi/cedrus/cedrus_mpeg2.c
+++ b/drivers/staging/media/sunxi/cedrus/cedrus_mpeg2.c
@@ -10,7 +10,6 @@
#include <media/videobuf2-dma-contig.h>
#include "cedrus.h"
-#include "cedrus_dec.h"
#include "cedrus_hw.h"
#include "cedrus_regs.h"
@@ -160,8 +159,8 @@ static void cedrus_mpeg2_setup(struct cedrus_ctx *ctx, struct cedrus_run *run)
cedrus_write(dev, VE_DEC_MPEG_PICBOUNDSIZE, reg);
/* Forward and backward prediction reference buffers. */
- forward_idx = cedrus_reference_index_find(cap_q, &run->dst->vb2_buf,
- slice_params->forward_ref_ts);
+ forward_idx = vb2_find_timestamp(cap_q,
+ slice_params->forward_ref_ts, 0);
fwd_luma_addr = cedrus_dst_buf_addr(ctx, forward_idx, 0);
fwd_chroma_addr = cedrus_dst_buf_addr(ctx, forward_idx, 1);
@@ -169,9 +168,8 @@ static void cedrus_mpeg2_setup(struct cedrus_ctx *ctx, struct cedrus_run *run)
cedrus_write(dev, VE_DEC_MPEG_FWD_REF_LUMA_ADDR, fwd_luma_addr);
cedrus_write(dev, VE_DEC_MPEG_FWD_REF_CHROMA_ADDR, fwd_chroma_addr);
- backward_idx = cedrus_reference_index_find(cap_q, &run->dst->vb2_buf,
- slice_params->backward_ref_ts);
-
+ backward_idx = vb2_find_timestamp(cap_q,
+ slice_params->backward_ref_ts, 0);
bwd_luma_addr = cedrus_dst_buf_addr(ctx, backward_idx, 0);
bwd_chroma_addr = cedrus_dst_buf_addr(ctx, backward_idx, 1);
--
2.20.1
next reply other threads:[~2019-01-24 9:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-24 9:55 Paul Kocialkowski [this message]
2019-01-24 10:32 ` Greg KH
2019-01-24 12:40 ` Paul Kocialkowski
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=20190124095542.22321-1-paul.kocialkowski@bootlin.com \
--to=paul.kocialkowski@bootlin.com \
--cc=devel@driverdev.osuosl.org \
--cc=hverkuil@xs4all.nl \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=maxime.ripard@bootlin.com \
--cc=mchehab@kernel.org \
--cc=tfiga@chromium.org \
--cc=thomas.petazzoni@bootlin.com \
/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®