Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp2249590pxb; Mon, 11 Jan 2021 05:10:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJxghuoUI5ZwtYW2KKPEgooQNQKqtyzi9O/1HicsvjDeue43PO2XKNyEYu2axupfV9Ma9F1E X-Received: by 2002:a17:906:7146:: with SMTP id z6mr10615929ejj.379.1610370624607; Mon, 11 Jan 2021 05:10:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610370624; cv=none; d=google.com; s=arc-20160816; b=UPK+WIDTpi2bEyI/tR7epOChVKMCm9mSfA0K6+RgM7gDziQAsPpFze90gJ9Q8jVuHF abo63UW62A8wkPQvJQkXQGpA0jkWI0rcZG0uVQlP5fcMoZZmZ2gaWMXFWFIXsoyStmtG yNwyO6yJXOWiSNvarrWjPzX0A10m0HjfrmJqVkWhENS+sYcyjER4QO0psM44jSjCa9d2 h6Z8BQh6Gsjz261UV91IaW/RIzqZAzDaws9fchhVdl1WFDIvRtkkdWBvCPzIftQvo1Rw QgJ7i24IYTlUCNmCnOZyT3ee5eo9WOfXRWeQGT/L/Ui6ND/kNzUJqWc/lfZuUQkYOZ3+ XYiw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=lXOWeR9801FrisPggQzBoR4P1LZC0ogSzc7qiclRxzA=; b=ciEAzFUMyxIysQJgH0R+vPg+4lvuuzyjhsHfiz6o4myInFZnS/WjPHVuSqyWx8NPlm ghMBnwt+n6pl2+znvMsSaj56FDqTSd0Y2iPHRtBUsMemDNIY6Nes5feolHMhSMZmVJ7J noeilJEHgnA3dSRtLhwIA2eyZfPokMqbi+AoHYHoTXCpx36m8ecFI6Zk+10qr8lIFNoQ Dg6o9nndKEMvpH3w9CNN5XsGbyDYUfsxPGsrHBdkqQq9LOE8qhd6Y+cC1S19/eaf7E6P gW9YcCRapNcP2dLdSwfk7F2qoT+A+lNtmsNIqjM3hOdMdvsbvNESoYtiZLIjP71S/gQU K3kA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Mf2f7LJM; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ck10si6857067edb.568.2021.01.11.05.09.56; Mon, 11 Jan 2021 05:10:24 -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; dkim=pass header.i=@chromium.org header.s=google header.b=Mf2f7LJM; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726889AbhAKLgN (ORCPT + 99 others); Mon, 11 Jan 2021 06:36:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725868AbhAKLgN (ORCPT ); Mon, 11 Jan 2021 06:36:13 -0500 Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com [IPv6:2a00:1450:4864:20::52d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D3125C061786 for ; Mon, 11 Jan 2021 03:35:32 -0800 (PST) Received: by mail-ed1-x52d.google.com with SMTP id g24so18383338edw.9 for ; Mon, 11 Jan 2021 03:35:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=lXOWeR9801FrisPggQzBoR4P1LZC0ogSzc7qiclRxzA=; b=Mf2f7LJM9bPXCaZWpu+DA3F8zjBC3NYdKnghIBztANh6OSOVMK4LbhwONJlFeqAU6H pPSrTCV6Jx9bvjcyGbOIGMOKxmMwu/jHp1FqUYKRJnRF7aa8ssiiz/i2Ojgla86zeC67 RFZq1mjsHkMRdKKz0w0brsi7WTIhAR8EMNdFY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=lXOWeR9801FrisPggQzBoR4P1LZC0ogSzc7qiclRxzA=; b=l3bZMLSPrN06TsZ9GsgYNxDk+kqHqJf9FFtWn3dKOyWu8Mi1n0BNhll1cdsZrqx/ZL XYGFwvPJiSnyymsEOQblUUQdTSHvU1ZVLtxvXlUqGs7jeA36VYwCP0/IRvSAYlgsjQl6 9azxrkyTEYdvfPF4KyfGbfUx8eSOI09LU09Zrd5TxtyTBwDYuwhzHOWDm+yhGM/Nlvxh Z/bdZe9GSiuv01zjsp/H5D5hpDjgk1iQd6BRE0K/fFQPNiYSKoGNak0JgVPdP17gDVpp TWvtZuGFKsttNWn+DiqUYTIZ5l3RRVyvdpPTogF2X14x9zGlB0LD3FUENAu1C3G3RJ4j BJDA== X-Gm-Message-State: AOAM53095cWVHj8dtzWx0IEX8uSu4JO1LKr6B7IHhNsoSF8u/vT9Ul3A v+VXvkQRkhJj1sSLuKUaAwo28g== X-Received: by 2002:a05:6402:307c:: with SMTP id bs28mr13865398edb.186.1610364931540; Mon, 11 Jan 2021 03:35:31 -0800 (PST) Received: from alco.lan ([80.71.134.83]) by smtp.gmail.com with ESMTPSA id rs27sm6982564ejb.21.2021.01.11.03.35.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Jan 2021 03:35:30 -0800 (PST) From: Ricardo Ribalda To: Ezequiel Garcia , 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 Cc: Ricardo Ribalda Subject: [PATCH] hantro: Format IOCTLs compliance fixes Date: Mon, 11 Jan 2021 12:35:29 +0100 Message-Id: <20210111113529.45488-1-ribalda@chromium.org> X-Mailer: git-send-email 2.30.0.284.gd98b1dd5eaa7-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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)); + return 0; } -- 2.30.0.284.gd98b1dd5eaa7-goog