diff mbox series

[v2,1/2] hantro: h264: Get the correct fallback reference buffer

Message ID 20200727170538.32894-2-ezequiel@collabora.com (mailing list archive)
State New, archived
Headers show
Series hantro: postproc related fixes | expand

Commit Message

Ezequiel Garcia July 27, 2020, 5:05 p.m. UTC
If the bitstream and the application are incorrectly configuring
the reference pictures, the hardware will need to fallback
to using some other reference picture.

When the post-processor is enabled, the fallback buffer
should be a shadow buffer (postproc.dec_q), and not a
CAPTURE queue buffer, since the latter is post-processed
and not really the output of the decoder core.

Fixes: 8c2d66b036c77 ("media: hantro: Support color conversion via post-processing")
Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
---
 drivers/staging/media/hantro/hantro_h264.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Philipp Zabel July 28, 2020, 7:29 a.m. UTC | #1
On Mon, 2020-07-27 at 14:05 -0300, Ezequiel Garcia wrote:
> If the bitstream and the application are incorrectly configuring
> the reference pictures, the hardware will need to fallback
> to using some other reference picture.
> 
> When the post-processor is enabled, the fallback buffer
> should be a shadow buffer (postproc.dec_q), and not a
> CAPTURE queue buffer, since the latter is post-processed
> and not really the output of the decoder core.
> 
> Fixes: 8c2d66b036c77 ("media: hantro: Support color conversion via post-processing")
> Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
> ---
>  drivers/staging/media/hantro/hantro_h264.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/media/hantro/hantro_h264.c b/drivers/staging/media/hantro/hantro_h264.c
> index 194d05848077..6dcd47bd9ed3 100644
> --- a/drivers/staging/media/hantro/hantro_h264.c
> +++ b/drivers/staging/media/hantro/hantro_h264.c
> @@ -325,7 +325,7 @@ dma_addr_t hantro_h264_get_ref_buf(struct hantro_ctx *ctx,
>  		 */
>  		dst_buf = hantro_get_dst_buf(ctx);
>  		buf = &dst_buf->vb2_buf;
> -		dma_addr = vb2_dma_contig_plane_dma_addr(buf, 0);
> +		dma_addr = hantro_get_dec_buf_addr(ctx, buf);
>  	}
>  
>  	return dma_addr;

Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>

regards
Philipp
diff mbox series

Patch

diff --git a/drivers/staging/media/hantro/hantro_h264.c b/drivers/staging/media/hantro/hantro_h264.c
index 194d05848077..6dcd47bd9ed3 100644
--- a/drivers/staging/media/hantro/hantro_h264.c
+++ b/drivers/staging/media/hantro/hantro_h264.c
@@ -325,7 +325,7 @@  dma_addr_t hantro_h264_get_ref_buf(struct hantro_ctx *ctx,
 		 */
 		dst_buf = hantro_get_dst_buf(ctx);
 		buf = &dst_buf->vb2_buf;
-		dma_addr = vb2_dma_contig_plane_dma_addr(buf, 0);
+		dma_addr = hantro_get_dec_buf_addr(ctx, buf);
 	}
 
 	return dma_addr;