Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp2202135pxb; Mon, 11 Jan 2021 03:51:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJybP1f4cur9ZlCWZFIuQl41L0i5nWSd4tToTSWWyb1STgt4oqXyUbZUl66dG7P0RBz1GDuN X-Received: by 2002:aa7:c886:: with SMTP id p6mr14268034eds.352.1610365862733; Mon, 11 Jan 2021 03:51:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610365862; cv=none; d=google.com; s=arc-20160816; b=VLXExvxm9nK20XxXSjcxe2A/zOCf12Kc/mgTmXvS7UbVJoYyNuORMr4AXPfgxa0ZWA aGMA5nmMHzamxkhM0si2HCyYcPXdN+kUSwkHGB8HCeAevhqOdGWKmNl70zo3/t9S0zge RxCgLsQ/8JDL21lNmshALeQ3c0vOAig8Sf4t0fXVtddk1MiM/fmc2KBREY9uXGoG9LZC Jmb7oTjfMEnGyLofXAGwvA+VojDy2g/N8QFgIkNRWN9rsYuCWmossj7U6OaP6Tlvt2bU BcscfHb5gIa7Gm5egoXuQnvd7eDuYXf1xcplXgxwur3UaUWa+Enq7fFTSWf31ZZtkqbj 5NgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:organization:references:in-reply-to:date:to:from:subject :message-id; bh=sqKMdjqC8ySbwel5gnxD8K8VIbXs+veqVR26XEDoBRs=; b=iK4ZY6gsMRlNuRkfCpt6t3YUwssQdfAqfvkFuxoO/6FTgEbfoo0NlLFqTr6cW7OjW1 4y9t1EjE3Q9SV71aeG/H0KSOV5Yj0LDCvvh+IHp7GuVEIacUX3UtfKaMCDTHgy9XFjvo yGL62u+rE5JtRs4KFJztfV7HIpJFiM3ZfP82z7BnkEIJcUSzKEZ3ny0Xf44CMi5jLqL0 QEUdInx/zBS5XkDaBFXLt7h/blxHLLSqu566FNHLtYYOMEcNm2JxLsnpE9YVc+IX7b1d ywWEwSYbE/H25bkkxLOu0IGDVm3qSA1+IxblAlx5soGeOIrOMwMOUI5Doun1Zu/zDKi0 LtRw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 1si6624027edv.426.2021.01.11.03.50.39; Mon, 11 Jan 2021 03:51:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730021AbhAKLtj (ORCPT + 99 others); Mon, 11 Jan 2021 06:49:39 -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