linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Revert "media: cedrus: Allow using the current dst buffer as reference"
@ 2019-01-24  9:55 Paul Kocialkowski
  2019-01-24 10:32 ` Greg KH
  0 siblings, 1 reply; 3+ messages in thread
From: Paul Kocialkowski @ 2019-01-24  9:55 UTC (permalink / raw)
  To: linux-media, devel, linux-arm-kernel, linux-kernel
  Cc: Maxime Ripard, Paul Kocialkowski, Mauro Carvalho Chehab,
	Thomas Petazzoni, Hans Verkuil, Tomasz Figa

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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] Revert "media: cedrus: Allow using the current dst buffer as reference"
  2019-01-24  9:55 [PATCH] Revert "media: cedrus: Allow using the current dst buffer as reference" Paul Kocialkowski
@ 2019-01-24 10:32 ` Greg KH
  2019-01-24 12:40   ` Paul Kocialkowski
  0 siblings, 1 reply; 3+ messages in thread
From: Greg KH @ 2019-01-24 10:32 UTC (permalink / raw)
  To: Paul Kocialkowski
  Cc: linux-media, devel, linux-arm-kernel, linux-kernel, Hans Verkuil,
	Maxime Ripard, Tomasz Figa, Thomas Petazzoni,
	Mauro Carvalho Chehab

On Thu, Jan 24, 2019 at 10:55:42AM +0100, Paul Kocialkowski wrote:
> 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(-)

No signed-off-by?  :(

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Revert "media: cedrus: Allow using the current dst buffer as reference"
  2019-01-24 10:32 ` Greg KH
@ 2019-01-24 12:40   ` Paul Kocialkowski
  0 siblings, 0 replies; 3+ messages in thread
From: Paul Kocialkowski @ 2019-01-24 12:40 UTC (permalink / raw)
  To: Greg KH
  Cc: linux-media, devel, linux-arm-kernel, linux-kernel, Hans Verkuil,
	Maxime Ripard, Tomasz Figa, Thomas Petazzoni,
	Mauro Carvalho Chehab

Hi,

On Thu, 2019-01-24 at 11:32 +0100, Greg KH wrote:
> On Thu, Jan 24, 2019 at 10:55:42AM +0100, Paul Kocialkowski wrote:
> > 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(-)
> 
> No signed-off-by?  :(

Woops, sorry about that. Will fix in v2!

Cheers,

Paul

-- 
Paul Kocialkowski, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-01-24 12:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-24  9:55 [PATCH] Revert "media: cedrus: Allow using the current dst buffer as reference" Paul Kocialkowski
2019-01-24 10:32 ` Greg KH
2019-01-24 12:40   ` Paul Kocialkowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).