Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp468021ybc; Fri, 22 Nov 2019 08:02:18 -0800 (PST) X-Google-Smtp-Source: APXvYqzzdTeuIIuJBtgPfAOwWlh48oe0VOtkPyofuuf9dCRsO2GceffLSpu+MmjsVt5XnTgxgPfV X-Received: by 2002:a50:978f:: with SMTP id e15mr1957380edb.298.1574438538855; Fri, 22 Nov 2019 08:02:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574438538; cv=none; d=google.com; s=arc-20160816; b=KyHooMNq2kOSxyM2hxU8UyQMngdUu/b/DOLRCHBIEKS7amZ5lMJ48jxjQgfTLpEcMK MpKz9Oc+HXeMGic/Oq9sqEAcQMrX44vVK+G/1HwDZ0jGmHxXZHiv8/qYRhkb4/On/3iJ lQAHZQjPj0XVIOxLRXfoFarMhV45sZhvqZ0ygsGc8151+zotoV3Le8x6qjpMOU3E2XLF n+0hjMkjgZeMwCs5zb0g1CY7+cLXgbDzdP8x3hTcP5g+Pe9mtQtxdrFmDx3sJmW7U+IY UR/O447kTL3a95EUPOhxZ4LEBja8CTBEKDf40TEBuP12N/ohZTjpGkEKrK6zrFDaxABP YAyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=o/W4ayAOoACKQZVXBLP2Z/cgRT7wVm7u2PBZdtOrT5o=; b=Pr2/1z+1xaBQP+1aeE3DiTSXMOPDDj2X8LpNP+MwJZwJ/wLD3q8/J0+7THtv5wZyHz AG5QMf2w+6st1QAmUnjFTurhRhsj9wiwO36KpsFIhKc0N+ij37Z8nJAutUyXOYbtxzr2 36yOSx7KHW9IV98vkjx4bcedrWsIt5Y9bJJVVRvU4h01/Ofq3F9Fwi83U2GDklRGr8zH atzjknCQGj4Iqfd4SmV1gsB36vKHcScXbIaRonRBP7Kah8dVxs/qiGSspBmpYN6NID3N EtA3cA6arQ/9PHq9/5URviVH5OvvUbI/azjIDtHVuYmACrSO9GGpblUthnER3I49B+WN HdRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=jMlY2xqV; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id n15si4677230ejr.94.2019.11.22.08.01.52; Fri, 22 Nov 2019 08:02:18 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=jMlY2xqV; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1726686AbfKVQA0 (ORCPT + 99 others); Fri, 22 Nov 2019 11:00:26 -0500 Received: from mail-ed1-f66.google.com ([209.85.208.66]:35298 "EHLO mail-ed1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726546AbfKVQA0 (ORCPT ); Fri, 22 Nov 2019 11:00:26 -0500 Received: by mail-ed1-f66.google.com with SMTP id r16so6480252edq.2 for ; Fri, 22 Nov 2019 08:00:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=o/W4ayAOoACKQZVXBLP2Z/cgRT7wVm7u2PBZdtOrT5o=; b=jMlY2xqV1U4GP7NURAVPe7R9M0XRzk21qdvgXiCy5WaPBW/haBCpJXOt0hccpIbKpe yZOeBm+fYdAMGqoSFsMQGijq8Jpf5mgze83nD+dW4wrqmoE+DyRjZkonzlFprHEjuPen 2eYXyMwCOyLUaqisdC/+8UftZHcskza9UjbXg= 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:content-transfer-encoding; bh=o/W4ayAOoACKQZVXBLP2Z/cgRT7wVm7u2PBZdtOrT5o=; b=jhJVrxYTp0ndhlqDsBCKilbj8ZRPlKJ2sIElFYdxq7kpe359fTcDULhwNmEtyf92UO GP/y0in4JAgzPDSBTeyH7IJwU9AizOs/Mb3QqCK9QHMrG+mAyCrB+r7eSMKokWQcRrhQ 2MFgsNQzTpMWuO5qwqbuogO9h51JIRlR/FSccD1uB4TdDzat/i5du5N+1kfVNemGQMhd K2kggPZEvcE6N1tsr/RH3IHpr9S78BGdKcBIBJrqFGspmnYww3awGW5WuskKcxbl7W+g WQC78AQ985BaLZ1N8umVth6CZUJcEkG1Xf5y/ZLXDIEwzB7gXGOsFvWrep/fiKbA5Sfg Cfvg== X-Gm-Message-State: APjAAAUQN1bDdsIBicBft0yRUZ2VdoH4ugOErHMpFFGq/qBMMsHjFgnK vIA4JTYQfsirYAZHxuk5FGl6JdhN04U= X-Received: by 2002:aa7:d2cf:: with SMTP id k15mr1935627edr.267.1574438419730; Fri, 22 Nov 2019 08:00:19 -0800 (PST) Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com. [209.85.128.50]) by smtp.gmail.com with ESMTPSA id r22sm328201edt.47.2019.11.22.08.00.17 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 22 Nov 2019 08:00:18 -0800 (PST) Received: by mail-wm1-f50.google.com with SMTP id t26so8174244wmi.4 for ; Fri, 22 Nov 2019 08:00:17 -0800 (PST) X-Received: by 2002:a1c:40c1:: with SMTP id n184mr17914395wma.116.1574438417276; Fri, 22 Nov 2019 08:00:17 -0800 (PST) MIME-Version: 1.0 References: <20191122051608.128717-1-hiroh@chromium.org> <767528be59275265072896e5c679e97575615fdd.camel@ndufresne.ca> In-Reply-To: <767528be59275265072896e5c679e97575615fdd.camel@ndufresne.ca> From: Tomasz Figa Date: Sat, 23 Nov 2019 01:00:06 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] media: hantro: Support H264 profile control To: Nicolas Dufresne Cc: Hirokazu Honda , Ezequiel Garcia , Mauro Carvalho Chehab , Greg KH , Linux Media Mailing List , devel@driverdev.osuosl.org, Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Nov 23, 2019 at 12:09 AM Nicolas Dufresne wr= ote: > > Le vendredi 22 novembre 2019 =C3=A0 14:16 +0900, Hirokazu Honda a =C3=A9c= rit : > > The Hantro G1 decoder supports H.264 profiles from Baseline to High, wi= th > > the exception of the Extended profile. > > > > Expose the V4L2_CID_MPEG_VIDEO_H264_PROFILE control, so that the > > applications can query the driver for the list of supported profiles. > > Thanks for this patch. Do you think we could also add the LEVEL control > so the profile/level enumeration becomes complete ? > > I'm thinking it would be nice if the v4l2 compliance test make sure > that codecs do implement these controls (both stateful and stateless), > it's essential for stack with software fallback, or multiple capable > codec hardware but with different capabilities. > Level is a difficult story, because it also specifies the number of macroblocks per second, but for decoders like this the number of macroblocks per second it can handle depends on things the driver might be not aware of - clock frequencies, DDR throughput, system load, etc. My take on this is that the decoder driver should advertise the highest resolution the decoder can handle due to hardware constraints. Performance related things depend on the integration details and should be managed elsewhere. For example Android and Chrome OS manage expected decoding performance in per-board configuration files. > > > > Signed-off-by: Hirokazu Honda > > --- > > drivers/staging/media/hantro/hantro_drv.c | 10 ++++++++++ > > 1 file changed, 10 insertions(+) > > > > diff --git a/drivers/staging/media/hantro/hantro_drv.c b/drivers/stagin= g/media/hantro/hantro_drv.c > > index 6d9d41170832..9387619235d8 100644 > > --- a/drivers/staging/media/hantro/hantro_drv.c > > +++ b/drivers/staging/media/hantro/hantro_drv.c > > @@ -355,6 +355,16 @@ static const struct hantro_ctrl controls[] =3D { > > .def =3D V4L2_MPEG_VIDEO_H264_START_CODE_ANNEX_B, > > .max =3D V4L2_MPEG_VIDEO_H264_START_CODE_ANNEX_B, > > }, > > + }, { > > + .codec =3D HANTRO_H264_DECODER, > > + .cfg =3D { > > + .id =3D V4L2_CID_MPEG_VIDEO_H264_PROFILE, > > + .min =3D V4L2_MPEG_VIDEO_H264_PROFILE_BASELINE, > > + .max =3D V4L2_MPEG_VIDEO_H264_PROFILE_HIGH, > > + .menu_skip_mask =3D > > + BIT(V4L2_MPEG_VIDEO_H264_PROFILE_EXTENDED), > > + .def =3D V4L2_MPEG_VIDEO_H264_PROFILE_MAIN, > > + } > > }, { > > }, > > }; >