From patchwork Sat Apr 22 10:39:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pin-yen Lin X-Patchwork-Id: 13220968 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 43F89C7618E for ; Sat, 22 Apr 2023 10:40:42 +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: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:In-Reply-To:References: List-Owner; bh=wJ7aSWKXEwQJnVJ7ew4uAz24HBpVFIG88p0BeuDBLL4=; b=izE3eVFmB89fCj rUnj+iQz4RMZV+UPuAoJctkOwDlwYdVos61bxkhR+IQSUEUBPJKzOr16uVkzmHepLBb2SfpKEOFpm riDwF+5H9x9ZAkuilZz2szn3D7WJMFH+E6IFsf6EBk38g9UNkPWD0Y49s7UaM3o0NxV4P+rFtCOP6 pyWtqgxJIS08uK3PGwEQ0dZ2/fQHO+PH5gmE95lKlLTQxep6w2hVK+AzJo+wggG3yuKjrfMmNZrdE FSFFTCjzubOI1PC+iC7dixMUVBlT0h0i1fZUOaN4TCAkY7/HdNlRMVKynYrAFIbPwxF1kmfG8Vh40 +O04Zimp/r8f384f8qnQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pqAeK-00ClWS-1N; Sat, 22 Apr 2023 10:39:24 +0000 Received: from mail-pl1-x633.google.com ([2607:f8b0:4864:20::633]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pqAeG-00ClQb-2B for linux-arm-kernel@lists.infradead.org; Sat, 22 Apr 2023 10:39:22 +0000 Received: by mail-pl1-x633.google.com with SMTP id d9443c01a7336-1a52667955dso33424785ad.1 for ; Sat, 22 Apr 2023 03:39:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1682159955; x=1684751955; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=VwFMHD30sqUe/T7ly/CJPme7mMd8qDj0hDd4kicbgfQ=; b=ewG2D7wdS60JREzAvKokBNWOZ7UcwGBzs908jvdjHMrHYP29OwKPg+EVXSR4yNUfnn fty/BawtqqosvAmOT6sFTxbv+1W46qp3nSFjYCvQZ0ncwAEKiNg0fAPlqyWNYkw3jwJ8 T8p/cJyO/phS3fq38f4z75mTQD16C2swRQ10s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682159955; x=1684751955; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=VwFMHD30sqUe/T7ly/CJPme7mMd8qDj0hDd4kicbgfQ=; b=FRrrPMZzdx4+8gHJLjnGEtFnEytva7ZGMIbVzcEmeRgSSeiKiEtnuqT0+pVrharZvV VCijRp4uzgHdhsPAhChud5PvnijeAL9kPTNiiJ58eB6y3zgI8XHhOy/t7PM63MohjS3V QFDS1YduXgkRbFjWcbrVEwwlxEc9J1EtTXBK1W4OGgDqxJdO/Fekawe5BPSugh/hRdQj BsUOAfURvQExOGmb7yyb3007dZ8ety6GEAsJttq4Db8aMBAXujEesen8EHdzS9XazAIi twpuFLCVfX5MtX2wATTNaSjr74At74LDViKgPapN03nrrzo6Sad96XKJnIOaQsGOczBO +c9w== X-Gm-Message-State: AAQBX9cOVhEvW4BX06pb/5NEVTEWK8qgtDXXI2VOBmUiMkLHyOkUHdAv LaoWUr9YERfODXBE+wf8zxP1Sg== X-Google-Smtp-Source: AKy350ZFr/ruuyY8q22yZySnT8vteG7lqkSxAD4UjnYogF8dD+F+Bkmuc4hJmjU41ovyHJpko1ErlQ== X-Received: by 2002:a17:902:c94c:b0:1a5:2fbd:d094 with SMTP id i12-20020a170902c94c00b001a52fbdd094mr10186859pla.9.1682159955385; Sat, 22 Apr 2023 03:39:15 -0700 (PDT) Received: from treapking.tpe.corp.google.com ([2401:fa00:1:10:c5d6:106b:dcb1:8d57]) by smtp.gmail.com with ESMTPSA id ls17-20020a17090b351100b0023a9564763bsm5627694pjb.29.2023.04.22.03.39.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 22 Apr 2023 03:39:14 -0700 (PDT) From: Pin-yen Lin To: Tiffany Lin , Andrew-CT Chen , Yunfei Dong , Mauro Carvalho Chehab , Matthias Brugger , AngeloGioacchino Del Regno Cc: Chen-Yu Tsai , linux-mediatek@lists.infradead.org (moderated list:ARM/Mediatek SoC support), linux-kernel@vger.kernel.org (open list:ARM/Mediatek SoC support), linux-media@vger.kernel.org (open list:MEDIA INPUT INFRASTRUCTURE (V4L/DVB)), linux-arm-kernel@lists.infradead.org (moderated list:ARM/Mediatek SoC support), Pin-yen Lin , Hans Verkuil Subject: [PATCH] media: mediatek: vcodec: Only apply 4K frame sizes on decoder formats Date: Sat, 22 Apr 2023 18:39:05 +0800 Message-ID: <20230422103905.1995271-1-treapking@chromium.org> X-Mailer: git-send-email 2.40.0.634.g4ca3ef3211-goog MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230422_033920_786060_317B1847 X-CRM114-Status: GOOD ( 11.55 ) 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 When VCODEC_CAPABILITY_4K_DISABLED is not set in dec_capability, skip formats that are not MTK_FMT_DEC so only decoder formats is updated in mtk_init_vdec_params. Fixes: e25528e1dbe5 ("media: mediatek: vcodec: Use 4K frame size when supported by stateful decoder") Signed-off-by: Pin-yen Lin Reviewed-by: Chen-Yu Tsai Reviewed-by: Yunfei Dong --- .../media/platform/mediatek/vcodec/mtk_vcodec_dec_stateful.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_stateful.c b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_stateful.c index 29991551cf61..0fbd030026c7 100644 --- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_stateful.c +++ b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_stateful.c @@ -584,6 +584,9 @@ static void mtk_init_vdec_params(struct mtk_vcodec_ctx *ctx) if (!(ctx->dev->dec_capability & VCODEC_CAPABILITY_4K_DISABLED)) { for (i = 0; i < num_supported_formats; i++) { + if (mtk_video_formats[i].type != MTK_FMT_DEC) + continue; + mtk_video_formats[i].frmsize.max_width = VCODEC_DEC_4K_CODED_WIDTH; mtk_video_formats[i].frmsize.max_height =