Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp968045pxj; Fri, 21 May 2021 03:26:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwfli1cc/h9b+NxH52Dl5ILtPwh8CCpyO8tQeIvBmVAfPtbEi+/VSqDEpeKdAgcKtb2gfUd X-Received: by 2002:a02:5b85:: with SMTP id g127mr3545390jab.80.1621592802312; Fri, 21 May 2021 03:26:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621592802; cv=none; d=google.com; s=arc-20160816; b=GMn/aZ9cneM3C/kpGNeYcH8RwebHI2S373g2LUY4L1pxFTm3XpxpuvBUWamXVxCmcI kKvqvIYiYlVY7nbwuc0pq9qGYoRO/HL749GV8R7ag1y1AQCPa4Dutor33i7tXok/no7z 9LAUbjbLyxn3/sKlh+wGijgTizUpZ3pe8xltXRaKijcx/ESlq4fuSsaJb/cpFs0hNL1D pMlJRfZM4tJS+PSnJO+rqQ6kjJI/qWlKSo+DlpTkl/Ry7LohZKk8tpfegGxGhnxL/0tn n+/iTNBhQ/nK10Bekrom+gV2tvk4DXnhiGLzGSPbhyeNCSjCfJpUgz81zlOJhPF0hrF6 cUoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=6v2xJJNz+8HWwlmw70n+P9Pe4twee3C0WXLKPwPDcwQ=; b=i5305RMvDShPu1wInRBXoRckc72rtg5Gbbbp5+uoLXBV0SL63Fq31Kw5UqZgEAvhm4 8OroonuY90BlOLZodQbRh7ulFI95IAi7/lJU1EAsRkcYgvB5Ck2oNpu1de4pC5/IWcsk 9v1+giOmSyj3EKh4tIZoCr6iVUpkgtIxgmJIQ4kdPMdP8Sq5pOOrRadhRyPnQzQ56Zrt A0ktdiLcr+W9xBg67hf4q7Huzrg6clpdl2li2RMmOc6CajQYbBv682KxJHfnkgmLGghy ORnOvi/USgmMyYp2XjzYLiUmYxzey19NtdS4b63sZay7geEUc0WE8ClnFvodKifCna65 jcbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=toHvOupg; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b18si5901239ile.24.2021.05.21.03.26.29; Fri, 21 May 2021 03:26:42 -0700 (PDT) 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=@google.com header.s=20161025 header.b=toHvOupg; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235212AbhEUIII (ORCPT + 99 others); Fri, 21 May 2021 04:08:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39616 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235417AbhEUIIH (ORCPT ); Fri, 21 May 2021 04:08:07 -0400 Received: from mail-io1-xd32.google.com (mail-io1-xd32.google.com [IPv6:2607:f8b0:4864:20::d32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 74B32C0613CE for ; Fri, 21 May 2021 01:06:44 -0700 (PDT) Received: by mail-io1-xd32.google.com with SMTP id t11so19240915iol.9 for ; Fri, 21 May 2021 01:06:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=6v2xJJNz+8HWwlmw70n+P9Pe4twee3C0WXLKPwPDcwQ=; b=toHvOupgQlvnzTBQKiq/TXqrmEEJULGhFpWLVs2IjH/4pc+gBTPWSyg2tgw0Cc9UgP 5+xi9qDR2o9BROfVhs3/pUtTnk25OV3Ss34DTIGPFY/is9wTapmxNHYdq8Ih4iNeeo96 w0Uh6QQrhxyfLaMO/MRMHiEpxwbjN9/x+/eAUC0vArQTdWwu/NXuQpzTSfQCE86C93Zf mpI0a//FVwGKmR7jxyU80AEm7Mcx0hXwz2Z5G/Sg/8Gtla2HiE+rJNFabZhICOAjPdJ9 wmbSkxFpk5Ygw+ybK21UleGsHjKBUTHsM4wnczGkHTYJ6oK0xls1bbblKJXAtU2rKu36 t1Ow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=6v2xJJNz+8HWwlmw70n+P9Pe4twee3C0WXLKPwPDcwQ=; b=WmlotomkDq89mTCVH0wjGvCyS1sRr9/mDQKIIeJmx/51s2oesYe7myszvHEz2UroHz kpBQ5MwEZRpenuTDzJG67ECXcEHPjYOgT6WAmqy0UxwsZTYAO3mt61qfwtTwsPSgBOcs xqNqghA+SxRzkIYR+MFR/dMB0JcNpp2SrpzWRWrssqznotzr00F3zbfPpHP0rewiBs3V C2QXTZOi/Wqpdztu3c63o1Xq5fUjgErZvFSsCS8K2OauvILK4KVXINQjO90E8Vd20HNn ka3O2A7antizGCgbFFYwCilKrGAP0WtTmGzN97MdvOo7oUNn/WNv+YxdiTConQLpiW/f FFzA== X-Gm-Message-State: AOAM533hQqSSe2/mAgfn9cKw2YPbWAsEHOukfGYDCn6d4In2oMy93Cnd jjp8Ss0HS7lvaJ2PzAeRjy9ha6O4o2xBteIRotz2Zg== X-Received: by 2002:a5d:9744:: with SMTP id c4mr10567537ioo.76.1621584403538; Fri, 21 May 2021 01:06:43 -0700 (PDT) MIME-Version: 1.0 References: <20210521070139.20644-1-irui.wang@mediatek.com> <20210521070139.20644-7-irui.wang@mediatek.com> In-Reply-To: <20210521070139.20644-7-irui.wang@mediatek.com> From: Tzung-Bi Shih Date: Fri, 21 May 2021 16:06:32 +0800 Message-ID: Subject: Re: [PATCH v4,6/6] media: mtk-vcodec: Support MT8192 H264 4K encoding To: Irui Wang Cc: Alexandre Courbot , Hans Verkuil , Tiffany Lin , Andrew-CT Chen , Mauro Carvalho Chehab , Rob Herring , Matthias Brugger , Tomasz Figa , Hsin-Yi Wang , Maoguang Meng , Longfei Wang , Yong Wu , Yunfei Dong , Fritz Koenig , Tzung-Bi Shih , linux-media@vger.kernel.org, "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Linux Kernel Mailing List , "moderated list:ARM/Mediatek SoC support" , srv_heupstream@mediatek.com, "moderated list:ARM/Mediatek SoC support" , Project_Global_Chrome_Upstream_Group@mediatek.com Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 21, 2021 at 3:02 PM Irui Wang wrote: > fsize->type = V4L2_FRMSIZE_TYPE_STEPWISE; > - fsize->stepwise = mtk_venc_framesizes; > + fsize->stepwise = > + (ctx->dev->enc_capability & MTK_VENC_4K_CAPABILITY_ENABLE) ? > + mtk_venc_4k_framesizes : mtk_venc_hd_framesizes; Use a normal if .. else .. is more readable. > @@ -1210,6 +1231,9 @@ int mtk_vcodec_enc_ctrls_setup(struct mtk_vcodec_ctx *ctx) > { > const struct v4l2_ctrl_ops *ops = &mtk_vcodec_enc_ctrl_ops; > struct v4l2_ctrl_handler *handler = &ctx->ctrl_hdl; > + const u8 h264_max_level = > + (ctx->dev->enc_capability & MTK_VENC_4K_CAPABILITY_ENABLE) ? > + V4L2_MPEG_VIDEO_H264_LEVEL_5_1 : V4L2_MPEG_VIDEO_H264_LEVEL_4_2; Again, I would like it to be a normal if .. else ..