From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 00B5DC433E0 for ; Mon, 11 Jan 2021 11:49:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9AA79224BD for ; Mon, 11 Jan 2021 11:49:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730261AbhAKLtk (ORCPT ); Mon, 11 Jan 2021 06:49:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59614 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729881AbhAKLtj (ORCPT ); Mon, 11 Jan 2021 06:49:39 -0500 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C7079C061786; Mon, 11 Jan 2021 03:48:58 -0800 (PST) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: ezequiel) with ESMTPSA id AD7F91F44D9B Message-ID: Subject: Re: [PATCH] hantro: Format IOCTLs compliance fixes From: Ezequiel Garcia To: Ricardo Ribalda , Philipp Zabel , Mauro Carvalho Chehab , Greg Kroah-Hartman , linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Date: Mon, 11 Jan 2021 08:48:46 -0300 In-Reply-To: <20210111113529.45488-1-ribalda@chromium.org> References: <20210111113529.45488-1-ribalda@chromium.org> Organization: Collabora Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.38.2-1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Ricardo, On Mon, 2021-01-11 at 12:35 +0100, Ricardo Ribalda wrote: > Clear the reserved fields. > > Fixes: >   fail: v4l2-test-formats.cpp(482): pix_mp.plane_fmt[0].reserved not zeroed > test VIDIOC_TRY_FMT: FAIL >   fail: v4l2-test-formats.cpp(482): pix_mp.plane_fmt[0].reserved not zeroed > test VIDIOC_S_FMT: FAIL > > Signed-off-by: Ricardo Ribalda > --- >  drivers/staging/media/hantro/hantro_v4l2.c | 5 +++++ >  1 file changed, 5 insertions(+) > > diff --git a/drivers/staging/media/hantro/hantro_v4l2.c b/drivers/staging/media/hantro/hantro_v4l2.c > index b668a82d40ad..9b384fbffc93 100644 > --- a/drivers/staging/media/hantro/hantro_v4l2.c > +++ b/drivers/staging/media/hantro/hantro_v4l2.c > @@ -239,6 +239,7 @@ static int hantro_try_fmt(const struct hantro_ctx *ctx, >         const struct hantro_fmt *fmt, *vpu_fmt; >         bool capture = V4L2_TYPE_IS_CAPTURE(type); >         bool coded; > +       int i; >   >         coded = capture == ctx->is_encoder; >   > @@ -293,6 +294,10 @@ static int hantro_try_fmt(const struct hantro_ctx *ctx, >                         pix_mp->width * pix_mp->height * fmt->max_depth; >         } >   > +       for (i = 0; i < pix_mp->num_planes; i++) > +               memset(pix_mp->plane_fmt[i].reserved, 0, > +                      sizeof(pix_mp->plane_fmt[i].reserved)); > + This looks like something that should be handled at the core, probably in drivers/media/v4l2-core/v4l2-ioctl.c::v4l_try_fmt(). Thanks, Ezequiel