From patchwork Wed Nov 2 18:08:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Jernej_=C5=A0krabec?= X-Patchwork-Id: 13028760 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3CF9DC433FE for ; Wed, 2 Nov 2022 18:13:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=S4VrykSu1I3OaNAdkkovNQYViw5Cy7tBmnzOQR7pN7g=; b=vqC+25T0fhSB/7 rrQMQROGqMH+tifcJ99z5VTzbDAXcUh/+7ba5gUqnpBRsoxY1gjfhs/wddkgSwHTviEBZwvxess9y WNN0lE8y2hwhQXZBvdeFVlRZCdtZhJLMwssJJxdKSHWw2iiOnK8DH9+ExTV9vWXDt8+HdIMISbLUV weBZiUaq6r9GyMR7XLFWIIDkrp1GtvtQW7xXP5lsaDgQ2ihzX6O+35yNAEesuwEIXicUjTzCgV/5m AYoQqh17SSAzgzFjAOE26AlAGXwTheO6njacV98XzyvpJUkGFosIpX1BDUyB+JgQsrDYQ0V+geb5m a5+x8K4iicE6qHM8U7OA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oqIE8-00CrXL-5O; Wed, 02 Nov 2022 18:12:36 +0000 Received: from mail-ej1-x635.google.com ([2a00:1450:4864:20::635]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oqIA2-00Cofe-8N for linux-arm-kernel@lists.infradead.org; Wed, 02 Nov 2022 18:08:24 +0000 Received: by mail-ej1-x635.google.com with SMTP id y14so47489703ejd.9 for ; Wed, 02 Nov 2022 11:08:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Fz8kU4WpE9TC4fsj366svqLLQU9rq3YiiGANcwE6/pc=; b=Lu9iDaPkeibob9D2zukTHvmKRrirbpzfH6LT1C6M0zP/qXy54iExH7mDioyv4Ul7Sx 6QRjy8MQZ+j2abjXnhQcIEmsc23UDoysXuAY+MJJJJmoiscmNOBXQnCnCTXXSDYhJpFq KVnNSlVUijf+ZlFCsEdQM7lLeAvW65pZxBILlTiJEdAjG8mD0eRAPjZ/58nR5X4cNBdD us1xsek5nl1pl3IyD31KHZjNAnw5Wv0LMiwobX/uFy7PomCQFtN5B2oShrzht1oLfiJ+ dJ3F3lwCKO4xoYlQ+3DWdfona/UynPlWzKQ/mrii70uT9qIIvujTdVdA+xd2twOp5Duh FDcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Fz8kU4WpE9TC4fsj366svqLLQU9rq3YiiGANcwE6/pc=; b=tChDjKXWTH6iWWH0HwR/Sk0VCnRRU3nut7AEnmPlzkRq591UWjqakN4ONjsA4fWUmN K7BxyMsXC5/JS6rXXCHzmAZRHMAeSRhqUCORsTYW9BV74I5uedvqYdDd8jJ46uotuT7y +EoeXsqK5cL1Ucx9qwbyJXcQx/adfk5rey0QR3Ab/vLuElcGiRQ69WV7wHpy45QuUEFE JtFWITRov0bw1RX+DTK+0nnrNL/AmkCaPUS7rZcuam8MMwgPNmby/YDXVIjo8x4/Tjhy YkTiSYEUcojonaKt2JxMSnwkcYLZ+IFjg3HU4MO+r2uKCES8I4r04DWrgvTHqUyAKtSx z30g== X-Gm-Message-State: ACrzQf2rgOUbgCU4PmXID+pny59Aiqwm7pzdBnYbiksXPtBk9/UZWkKk 39iAKMvvj5623fqwqnMPssk= X-Google-Smtp-Source: AMsMyM4iFCLAEnI0uHlhwGw0+az0UFMMmCWDTBTRtbk0uQWbXxdgPdZEkcZEWF+GLLv8aO6NBF5ChQ== X-Received: by 2002:a17:906:401:b0:73d:af73:b78 with SMTP id d1-20020a170906040100b0073daf730b78mr25917180eja.122.1667412500919; Wed, 02 Nov 2022 11:08:20 -0700 (PDT) Received: from kista.localdomain (82-149-19-102.dynamic.telemach.net. [82.149.19.102]) by smtp.gmail.com with ESMTPSA id gy8-20020a170906f24800b007317f017e64sm5677460ejb.134.2022.11.02.11.08.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Nov 2022 11:08:20 -0700 (PDT) From: Jernej Skrabec To: mripard@kernel.org, paul.kocialkowski@bootlin.com Cc: mchehab@kernel.org, gregkh@linuxfoundation.org, wens@csie.org, samuel@sholland.org, hverkuil-cisco@xs4all.nl, linux-media@vger.kernel.org, linux-staging@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, Jernej Skrabec Subject: [PATCH v2 03/11] media: cedrus: use helper to set default formats Date: Wed, 2 Nov 2022 19:08:02 +0100 Message-Id: <20221102180810.267252-4-jernej.skrabec@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221102180810.267252-1-jernej.skrabec@gmail.com> References: <20221102180810.267252-1-jernej.skrabec@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221102_110822_402962_E7183CC2 X-CRM114-Status: GOOD ( 12.40 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Now that set output format helper is available, let's use that for setting default values. Advantage of this is that values will be always valid. Current code produced invalid default values for V3s SoC, which doesn't support MPEG2 decoding. Signed-off-by: Jernej Skrabec --- drivers/staging/media/sunxi/cedrus/cedrus.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/drivers/staging/media/sunxi/cedrus/cedrus.c b/drivers/staging/media/sunxi/cedrus/cedrus.c index 55c54dfdc585..2f284a58d787 100644 --- a/drivers/staging/media/sunxi/cedrus/cedrus.c +++ b/drivers/staging/media/sunxi/cedrus/cedrus.c @@ -361,16 +361,8 @@ static int cedrus_open(struct file *file) ret = PTR_ERR(ctx->fh.m2m_ctx); goto err_ctrls; } - ctx->dst_fmt.pixelformat = V4L2_PIX_FMT_NV12_32L32; - cedrus_prepare_format(&ctx->dst_fmt); - ctx->src_fmt.pixelformat = V4L2_PIX_FMT_MPEG2_SLICE; - /* - * TILED_NV12 has more strict requirements, so copy the width and - * height to src_fmt to ensure that is matches the dst_fmt resolution. - */ - ctx->src_fmt.width = ctx->dst_fmt.width; - ctx->src_fmt.height = ctx->dst_fmt.height; - cedrus_prepare_format(&ctx->src_fmt); + + cedrus_reset_out_format(ctx); v4l2_fh_add(&ctx->fh);