mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] media: mediatek: vcodec: Force capture queue format to MM21
@ 2023-02-09  7:40 Yunfei Dong
  2023-02-09  8:57 ` Tommaso Merciai
  0 siblings, 1 reply; 5+ messages in thread
From: Yunfei Dong @ 2023-02-09  7:40 UTC (permalink / raw)
  To: Yunfei Dong, Chen-Yu Tsai, Nicolas Dufresne, Hans Verkuil,
	AngeloGioacchino Del Regno, Benjamin Gaignard, Tiffany Lin
  Cc: Mauro Carvalho Chehab, Matthias Brugger, Hsin-Yi Wang,
	Fritz Koenig, Daniel Vetter, Steve Cho, linux-media, devicetree,
	linux-kernel, linux-arm-kernel, linux-mediatek,
	Project_Global_Chrome_Upstream_Group

In order to conver the format of capture queue from mediatek MM21 to
standard yuv420 with Libyuv, need to force capture queue format to
MM21 for Libyuv can't covert mediatek MT21 format.

Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.org>
---
 drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec.c b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec.c
index 641f533c417f..4f5e9c20214f 100644
--- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec.c
+++ b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec.c
@@ -41,7 +41,7 @@ static bool mtk_vdec_get_cap_fmt(struct mtk_vcodec_ctx *ctx, int format_index)
 	const struct mtk_video_fmt *fmt;
 	struct mtk_q_data *q_data;
 	int num_frame_count = 0, i;
-	bool ret = true;
+	bool ret = false;
 
 	for (i = 0; i < *dec_pdata->num_formats; i++) {
 		if (dec_pdata->vdec_formats[i].type != MTK_FMT_FRAME)
@@ -63,7 +63,7 @@ static bool mtk_vdec_get_cap_fmt(struct mtk_vcodec_ctx *ctx, int format_index)
 	case V4L2_PIX_FMT_H264_SLICE:
 	case V4L2_PIX_FMT_VP9_FRAME:
 		if (fmt->fourcc == V4L2_PIX_FMT_MM21)
-			ret = false;
+			ret = true;
 		break;
 	default:
 		ret = true;
-- 
2.18.0


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

* Re: [PATCH] media: mediatek: vcodec: Force capture queue format to MM21
  2023-02-09  7:40 [PATCH] media: mediatek: vcodec: Force capture queue format to MM21 Yunfei Dong
@ 2023-02-09  8:57 ` Tommaso Merciai
  2023-02-09 12:56   ` AngeloGioacchino Del Regno
  0 siblings, 1 reply; 5+ messages in thread
From: Tommaso Merciai @ 2023-02-09  8:57 UTC (permalink / raw)
  To: Yunfei Dong
  Cc: Chen-Yu Tsai, Nicolas Dufresne, Hans Verkuil,
	AngeloGioacchino Del Regno, Benjamin Gaignard, Tiffany Lin,
	Mauro Carvalho Chehab, Matthias Brugger, Hsin-Yi Wang,
	Fritz Koenig, Daniel Vetter, Steve Cho, linux-media, devicetree,
	linux-kernel, linux-arm-kernel, linux-mediatek,
	Project_Global_Chrome_Upstream_Group

Hi Yunfei Dong,

On Thu, Feb 09, 2023 at 03:40:25PM +0800, Yunfei Dong wrote:
> In order to conver the format of capture queue from mediatek MM21 to
> standard yuv420 with Libyuv, need to force capture queue format to
> MM21 for Libyuv can't covert mediatek MT21 format.

Sorry, just some clarifications on my side, just to understand :)
The problem is that libyuv can't convert mm21 format into yuv420
than you need to use mm21 (forcing this).
Did I understand correctly?

Thanks in advance,
Tommaso

> 
> Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.org>
> ---
>  drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec.c b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec.c
> index 641f533c417f..4f5e9c20214f 100644
> --- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec.c
> +++ b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec.c
> @@ -41,7 +41,7 @@ static bool mtk_vdec_get_cap_fmt(struct mtk_vcodec_ctx *ctx, int format_index)
>  	const struct mtk_video_fmt *fmt;
>  	struct mtk_q_data *q_data;
>  	int num_frame_count = 0, i;
> -	bool ret = true;
> +	bool ret = false;
>  
>  	for (i = 0; i < *dec_pdata->num_formats; i++) {
>  		if (dec_pdata->vdec_formats[i].type != MTK_FMT_FRAME)
> @@ -63,7 +63,7 @@ static bool mtk_vdec_get_cap_fmt(struct mtk_vcodec_ctx *ctx, int format_index)
>  	case V4L2_PIX_FMT_H264_SLICE:
>  	case V4L2_PIX_FMT_VP9_FRAME:
>  		if (fmt->fourcc == V4L2_PIX_FMT_MM21)
> -			ret = false;
> +			ret = true;
>  		break;
>  	default:
>  		ret = true;
> -- 
> 2.18.0
> 

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

* Re: [PATCH] media: mediatek: vcodec: Force capture queue format to MM21
  2023-02-09  8:57 ` Tommaso Merciai
@ 2023-02-09 12:56   ` AngeloGioacchino Del Regno
  2023-02-10  5:56     ` Yunfei Dong (董云飞)
  2023-02-10  7:27     ` Tommaso Merciai
  0 siblings, 2 replies; 5+ messages in thread
From: AngeloGioacchino Del Regno @ 2023-02-09 12:56 UTC (permalink / raw)
  To: Tommaso Merciai, Yunfei Dong
  Cc: Chen-Yu Tsai, Nicolas Dufresne, Hans Verkuil, Benjamin Gaignard,
	Tiffany Lin, Mauro Carvalho Chehab, Matthias Brugger,
	Hsin-Yi Wang, Fritz Koenig, Daniel Vetter, Steve Cho,
	linux-media, devicetree, linux-kernel, linux-arm-kernel,
	linux-mediatek, Project_Global_Chrome_Upstream_Group

Il 09/02/23 09:57, Tommaso Merciai ha scritto:
> Hi Yunfei Dong,
> 
> On Thu, Feb 09, 2023 at 03:40:25PM +0800, Yunfei Dong wrote:
>> In order to conver the format of capture queue from mediatek MM21 to
>> standard yuv420 with Libyuv, need to force capture queue format to
>> MM21 for Libyuv can't covert mediatek MT21 format.
> 
> Sorry, just some clarifications on my side, just to understand :)
> The problem is that libyuv can't convert mm21 format into yuv420
> than you need to use mm21 (forcing this).
> Did I understand correctly?
> 

vcodec can output either MM21 or MT21C; libyuv can't handle the MT21C format,
at least for now, hence he is forcing vcodec to always give MM21 for things
to actually work... at a later time, I hope and suppose that this driver will
change to not force anything anymore.

> Thanks in advance,
> Tommaso
> 

Yunfei, since this is required to get "basic" functionality, this commit needs
a Fixes tag: can you please add the right one?

Thanks!
Angelo



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

* Re: [PATCH] media: mediatek: vcodec: Force capture queue format to MM21
  2023-02-09 12:56   ` AngeloGioacchino Del Regno
@ 2023-02-10  5:56     ` Yunfei Dong (董云飞)
  2023-02-10  7:27     ` Tommaso Merciai
  1 sibling, 0 replies; 5+ messages in thread
From: Yunfei Dong (董云飞) @ 2023-02-10  5:56 UTC (permalink / raw)
  To: tomm.merciai, angelogioacchino.delregno
  Cc: nicolas, linux-kernel, frkoenig,
	Tiffany Lin (林慧珊),
	wenst, linux-media, stevecho, devicetree, linux-mediatek,
	mchehab, daniel, Project_Global_Chrome_Upstream_Group, hsinyi,
	benjamin.gaignard, linux-arm-kernel, hverkuil-cisco,
	matthias.bgg

Hi AngeloGioacchino,

Thanks for your suggestion.
Add Fixes tag in patch v2.

Best Regards,
Yunfei Dong

On Thu, 2023-02-09 at 13:56 +0100, AngeloGioacchino Del Regno wrote:
> Il 09/02/23 09:57, Tommaso Merciai ha scritto:
> > Hi Yunfei Dong,
> > 
> > On Thu, Feb 09, 2023 at 03:40:25PM +0800, Yunfei Dong wrote:
> > > In order to conver the format of capture queue from mediatek MM21
> > > to
> > > standard yuv420 with Libyuv, need to force capture queue format
> > > to
> > > MM21 for Libyuv can't covert mediatek MT21 format.
> > 
> > Sorry, just some clarifications on my side, just to understand :)
> > The problem is that libyuv can't convert mm21 format into yuv420
> > than you need to use mm21 (forcing this).
> > Did I understand correctly?
> > 
> 
> vcodec can output either MM21 or MT21C; libyuv can't handle the MT21C
> format,
> at least for now, hence he is forcing vcodec to always give MM21 for
> things
> to actually work... at a later time, I hope and suppose that this
> driver will
> change to not force anything anymore.
> 
> > Thanks in advance,
> > Tommaso
> > 
> 
> Yunfei, since this is required to get "basic" functionality, this
> commit needs
> a Fixes tag: can you please add the right one?
> 
> Thanks!
> Angelo
> 
> 

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

* Re: [PATCH] media: mediatek: vcodec: Force capture queue format to MM21
  2023-02-09 12:56   ` AngeloGioacchino Del Regno
  2023-02-10  5:56     ` Yunfei Dong (董云飞)
@ 2023-02-10  7:27     ` Tommaso Merciai
  1 sibling, 0 replies; 5+ messages in thread
From: Tommaso Merciai @ 2023-02-10  7:27 UTC (permalink / raw)
  To: AngeloGioacchino Del Regno
  Cc: Yunfei Dong, Chen-Yu Tsai, Nicolas Dufresne, Hans Verkuil,
	Benjamin Gaignard, Tiffany Lin, Mauro Carvalho Chehab,
	Matthias Brugger, Hsin-Yi Wang, Fritz Koenig, Daniel Vetter,
	Steve Cho, linux-media, devicetree, linux-kernel,
	linux-arm-kernel, linux-mediatek,
	Project_Global_Chrome_Upstream_Group

Hi Angelo,

On Thu, Feb 09, 2023 at 01:56:45PM +0100, AngeloGioacchino Del Regno wrote:
> Il 09/02/23 09:57, Tommaso Merciai ha scritto:
> > Hi Yunfei Dong,
> > 
> > On Thu, Feb 09, 2023 at 03:40:25PM +0800, Yunfei Dong wrote:
> > > In order to conver the format of capture queue from mediatek MM21 to
> > > standard yuv420 with Libyuv, need to force capture queue format to
> > > MM21 for Libyuv can't covert mediatek MT21 format.
> > 
> > Sorry, just some clarifications on my side, just to understand :)
> > The problem is that libyuv can't convert mm21 format into yuv420
> > than you need to use mm21 (forcing this).
> > Did I understand correctly?
> > 
> 
> vcodec can output either MM21 or MT21C; libyuv can't handle the MT21C format,
> at least for now, hence he is forcing vcodec to always give MM21 for things
> to actually work... at a later time, I hope and suppose that this driver will
> change to not force anything anymore.

Thanks for the explanation!

Regards,
Tommaso

> 
> > Thanks in advance,
> > Tommaso
> > 
> 
> Yunfei, since this is required to get "basic" functionality, this commit needs
> a Fixes tag: can you please add the right one?
> 
> Thanks!
> Angelo
> 
> 

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

end of thread, other threads:[~2023-02-10  7:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-09  7:40 [PATCH] media: mediatek: vcodec: Force capture queue format to MM21 Yunfei Dong
2023-02-09  8:57 ` Tommaso Merciai
2023-02-09 12:56   ` AngeloGioacchino Del Regno
2023-02-10  5:56     ` Yunfei Dong (董云飞)
2023-02-10  7:27     ` Tommaso Merciai

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®