Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp379986ybg; Sun, 26 Jul 2020 07:31:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwmggSZVTzNIgH5W4HOUJO80VKRu7WGBhoPsDp83CPGQV0NAEOrvhCgwcM08EXw+7LhKvqm X-Received: by 2002:a50:8a62:: with SMTP id i89mr17794172edi.324.1595773869585; Sun, 26 Jul 2020 07:31:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595773869; cv=none; d=google.com; s=arc-20160816; b=pcTrP57zvX11m/Z9nzbK31C3AUc/SeQcusKxlMiQ6+4hKenMpPu5buvCV1doyOZPrX BD7fcxZK4VBZNEv+Y+xML9RE0O0BJ8UEWyfqA2oxkNgF7qCtNHJ2rAjfsyfEj0UBbPhq xhIMh+sOoRH9rtricXPErYgntjL6GiRb4inmgl9PDI+XS7KVG1kf8e+1CDVKGb3lLW0K 7dI8sv9NbJmK5R4Z0PWf6a1qeVtrdOwok6axw/nRc1/tJ5vwOCtO6kg9QfYsGGYX28w8 ppDQGcbp7hDVHDqHT9icqMY8F+Se2zl9tlf4pGZA6gvJGjnnHWDD0UClBq2YD/Ch7PUm Tu/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=7NgctBmCqLgQBnHYafy5r5rDsgw6j6oRlbINnPPqer0=; b=xJzEH+j2r20fDsIQIjbnbeYjxqowHJtcBghSjSYkDPeBy6fLTOTSAFM3plH7wYVPs7 ncf5hi4AFZ6tGtynJijSHbWD3g7gFkXEom2qP0nte7dLvqAA1CzcOKmBOZqBIDQ4HqoI xXdck6Rd+jF/a7jcVA5I+1JECyojw4Fb523ID538DQKK5LMk346IFVyd83AF5sBOVZRX MvIPAcZCirJ4dANhEXrQbynx5qAZI2o+X6t4ljXavNYSVFXKj3AN51nISAimgeVzga0J C0T0uSiryHUVDqvkA8Eg7hcBxmaCYTY7cjp+yepP/F170kx6Wp173UzCNoNn44zRb9Kx mkwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@vanguardiasur-com-ar.20150623.gappssmtp.com header.s=20150623 header.b=cPtQupmk; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x26si3997357edr.586.2020.07.26.07.30.47; Sun, 26 Jul 2020 07:31:09 -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=@vanguardiasur-com-ar.20150623.gappssmtp.com header.s=20150623 header.b=cPtQupmk; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726753AbgGZO3N (ORCPT + 99 others); Sun, 26 Jul 2020 10:29:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42016 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725949AbgGZO3N (ORCPT ); Sun, 26 Jul 2020 10:29:13 -0400 Received: from mail-ej1-x644.google.com (mail-ej1-x644.google.com [IPv6:2a00:1450:4864:20::644]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DCB39C0619D5 for ; Sun, 26 Jul 2020 07:29:12 -0700 (PDT) Received: by mail-ej1-x644.google.com with SMTP id rk21so14522506ejb.2 for ; Sun, 26 Jul 2020 07:29:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vanguardiasur-com-ar.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=7NgctBmCqLgQBnHYafy5r5rDsgw6j6oRlbINnPPqer0=; b=cPtQupmk1fewrsDSJE9eb5vshcj32eD6Ersn4gDO9eNd6Ue1J8TTT513AbOaU188zs AFhrKzbGgOthhgLIv7kksB+ClxWzSueRE1uglOlaoNsTsZyf9B+bzJiS+tpChshZNnBx jG7QPFt44f1VS8a/+nZT2WeMe/G9NCBDPPm4HUnwcT9dy/zwJ5SzHwOmd7CTs+gwiBqj bzjRkzNxOgk/XBF69w5CuAJhiGIlAC4SmYNINF4Buj0bhy9eQvwlc8yYeeo6BUAlSJfO rCpj9D4E/yEXL1JlRHqSpG0lcFfNFaw3IXioKQHV91iwjY8z8na9xqtHPwMYUOlv9L+k +zCA== 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=7NgctBmCqLgQBnHYafy5r5rDsgw6j6oRlbINnPPqer0=; b=YEvm/Z5xRPUA/30Gb++fH7diU/akhruniOQCrx0arOnT4lZPn8c25fq4vgHfspFI07 c1UZnTadbkcv+pxE8yldbolNgRDU5kuORbQWwZyu/gRYj694z05l717sj/vS0cIKiRZh kD8jXDdLn2rgCEe+dMSlYlzD8NlZr05e3eymJSMxXewk3IpvbY8mrpIsWrW3JsW6f8PV W41BmH4Q3r7KDjt5vlbJE9jqAwgk2NQg4S+ejtCYL8r1idUbbdFasTiFFEq0DAC/xQOq iRgpd9M0xqRB0L6EF0uWsUlCPZmJ8DGGUeFM5HdjKmVU3bktWlyDsSRoQdcEJ6eaTfkn AJMA== X-Gm-Message-State: AOAM532qcZ0jQt6pI+5AiWAph2pQUs7QDd2S6tw7uYJY6cztIOK1xei2 JStYXhcOCiUhYgCIRymRjpto0qP/v1pHHYDQCreHkIFobLw= X-Received: by 2002:a17:906:1e43:: with SMTP id i3mr16626277ejj.92.1595773751471; Sun, 26 Jul 2020 07:29:11 -0700 (PDT) MIME-Version: 1.0 References: <20200713060842.471356-1-acourbot@chromium.org> <20200713060842.471356-8-acourbot@chromium.org> In-Reply-To: <20200713060842.471356-8-acourbot@chromium.org> From: Ezequiel Garcia Date: Sun, 26 Jul 2020 11:29:00 -0300 Message-ID: Subject: Re: [PATCH v3 07/16] media: mtk-vcodec: venc: specify supported formats per-chip To: Alexandre Courbot Cc: Tiffany Lin , Andrew-CT Chen , Hans Verkuil , Yunfei Dong , Maoguang Meng , linux-media , "moderated list:ARM/Mediatek SoC support" , devicetree , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Alexandre, Last review on my side, this series looks mostly good. On Mon, 13 Jul 2020 at 03:09, Alexandre Courbot wrote: > > Different chips have different supported bitrate ranges. Move the list s/bitrate ranges/formats > of supported formats to the platform data, and split the output and > capture formats into two lists to make it easier to find the default > format for each queue. > > Signed-off-by: Alexandre Courbot > Acked-by: Tiffany Lin > --- > .../platform/mtk-vcodec/mtk_vcodec_drv.h | 8 ++ > .../platform/mtk-vcodec/mtk_vcodec_enc.c | 122 +++++++----------- > .../platform/mtk-vcodec/mtk_vcodec_enc_drv.c | 40 ++++++ > 3 files changed, 95 insertions(+), 75 deletions(-) > > diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h b/drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h > index b8f913de8d80..59b4b750666b 100644 > --- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h > +++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h > @@ -313,6 +313,10 @@ enum mtk_chip { > * @has_lt_irq: whether the encoder uses the LT irq > * @min_birate: minimum supported encoding bitrate > * @max_bitrate: maximum supported encoding bitrate > + * @capture_formats: array of supported capture formats > + * @num_capture_formats: number of entries in capture_formats > + * @output_formats: array of supported output formats > + * @num_output_formats: number of entries in output_formats > */ > struct mtk_vcodec_enc_pdata { > enum mtk_chip chip; > @@ -321,6 +325,10 @@ struct mtk_vcodec_enc_pdata { > bool has_lt_irq; > unsigned long min_bitrate; > unsigned long max_bitrate; > + const struct mtk_video_fmt *capture_formats; > + size_t num_capture_formats; > + const struct mtk_video_fmt *output_formats; > + size_t num_output_formats; > }; > > /** > diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c > index 50ba9da59153..05743a745a11 100644 > --- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c > +++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c > @@ -23,47 +23,9 @@ > #define DFT_CFG_WIDTH MTK_VENC_MIN_W > #define DFT_CFG_HEIGHT MTK_VENC_MIN_H > #define MTK_MAX_CTRLS_HINT 20 > -#define OUT_FMT_IDX 0 > -#define CAP_FMT_IDX 4 > - > > static void mtk_venc_worker(struct work_struct *work); > > -static const struct mtk_video_fmt mtk_video_formats[] = { > - { > - .fourcc = V4L2_PIX_FMT_NV12M, > - .type = MTK_FMT_FRAME, > - .num_planes = 2, Again, not an issue with your patch, so feel free to ignore this. You may avoid keeping track of num_planes (or any other property of the pixel format) and use v4l2_fill_pixfmt_mp to get all the information you need. Thanks, Ezequiel