Re: [PATCH v7 03/11] media: platform: Improve s_selection flow for bug fixing

From: Tomasz Figa
Date: Wed Mar 11 2020 - 07:03:09 EST


Hi Xia,

On Tue, Mar 3, 2020 at 9:35 PM Xia Jiang <xia.jiang@xxxxxxxxxxxx> wrote:
>
> Get correct compose value in mtk_jpeg_s_selection function.

It's a good practice to describe why the current code is wrong and new is good.

>
> Signed-off-by: Xia Jiang <xia.jiang@xxxxxxxxxxxx>
> ---
> drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>

Thanks for the patch. Please see my comment inline.

> diff --git a/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c b/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c
> index da0dae4b0fc9..fb2c8d026580 100644
> --- a/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c
> +++ b/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c
> @@ -492,8 +492,8 @@ static int mtk_jpeg_s_selection(struct file *file, void *priv,
> case V4L2_SEL_TGT_COMPOSE:
> s->r.left = 0;
> s->r.top = 0;
> - s->r.width = ctx->out_q.w;
> - s->r.height = ctx->out_q.h;
> + ctx->out_q.w = s->r.width;
> + ctx->out_q.h = s->r.height;
> break;
> default:
> return -EINVAL;

The decoder compose target means the visible rectangle of the decoded
image, which comes from the stream metadata. It's not something that
can be set by the userspace.

Best regards,
Tomasz