Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp646229ybl; Fri, 10 Jan 2020 04:32:30 -0800 (PST) X-Google-Smtp-Source: APXvYqyKn/3VFP5SdWUw0oP1BztLTahW4AuAMOTESYFlG2ctVn5fTmRnfJbYa3O8P+ZLGBd0/SzD X-Received: by 2002:aca:72cd:: with SMTP id p196mr1909892oic.99.1578659550817; Fri, 10 Jan 2020 04:32:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578659550; cv=none; d=google.com; s=arc-20160816; b=YR4Nxjbhpy02Sxwkrh0oKUZZyPq2cO/OSN6OTHOlmzhTPce9BScb1b1YW1saq2QL1s CPGNsr6k271qel0+GLtd8LAXmdtF77UPmMD8AEl6rkA5jn/smcvIfX+K/RoLo+wRnLcJ /5nkdfvb0xZYhvjvYFXHj574e1sjnskdaQCNggHz0XnaPiDncdftkfaXAtZ2muaaf+i1 2in6DWSYF9DpZuo+XScSbO5S2/eJxEd1qq7fBQe7KZDyPYAuYx1mgKd161HQY8OEXHOH UPXgVuBeWW9h2MnoPcLieh0kgH3+UWDAa72YLm70lBHrKs2TllC4OSkpft4QepMJS5Mf SJNg== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=Q4tGujyc0qMIli9sFFN1Y2SjsV4ntbfAJ95PuThwHNo=; b=dWL9QQyqjmBygrvFrr/IMI+ZW4Z4/zbkmZad3q1gpmP13993POVcSqeq832p5Qa2an EezQDa3JC2HP2kQvLtZxnlxvmASQGl/pZS4JV1Vx/qyXrrdCqI8gz0ks4b469oUVUS+g HyK90h+9pTcPX1rqzzik+ZxROw42B5lwHUDWUTa+05UqBLxgUTPJWn5qYKnvRmE/+tmb +18cQW3MAwYSwIFqDeOzHjbj+lTZEHjDhkqzmIu9vztXS/7Uj1apQqFPa5o+qaxn0NbS g5cosbuv/sGV/Gqm55rUkrflxBkCcu/nbvURUvOfIuZHvjMHGVcdZ74lMANfQz+nuoZR DIbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@xs4all.nl header.s=s1 header.b=wVy1VAbU; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u3si1078525oif.167.2020.01.10.04.32.19; Fri, 10 Jan 2020 04:32:30 -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=@xs4all.nl header.s=s1 header.b=wVy1VAbU; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728167AbgAJMbP (ORCPT + 99 others); Fri, 10 Jan 2020 07:31:15 -0500 Received: from lb2-smtp-cloud8.xs4all.net ([194.109.24.25]:46383 "EHLO lb2-smtp-cloud8.xs4all.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727924AbgAJMbP (ORCPT ); Fri, 10 Jan 2020 07:31:15 -0500 Received: from [IPv6:2001:420:44c1:2577:c967:e1d3:183a:b8ef] ([IPv6:2001:420:44c1:2577:c967:e1d3:183a:b8ef]) by smtp-cloud8.xs4all.net with ESMTPA id ptRUimnGnpLtbptRXiQX2R; Fri, 10 Jan 2020 13:31:12 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xs4all.nl; s=s1; t=1578659472; bh=Q4tGujyc0qMIli9sFFN1Y2SjsV4ntbfAJ95PuThwHNo=; h=Subject:To:From:Message-ID:Date:MIME-Version:Content-Type:From: Subject; b=wVy1VAbUe9iHSsSMlQRYcvuUGVHHOkYaXBCi0ulHQzsBqeDXnTlWE3dPY3Cd9N1T5 ym08+Bx6xkVDafW0WyHGEryJhllacfjUsyH2wbDdc4aYGfP52TKIG5qS//HO3YTP7A 6x2hJWc0vaXoRvlK3yxgd201kjp7KNhTnyxZ51jj55d0rRQT8Mg87BhZ+4OwOu36vR uYm8fLnZJEVjmizDcRvj0FL9KLrJxugUppzrEZk6/hTBZPiELHW7Hx0oEA/Agi15xX ongBXCUp69XYdiBOzglUD+FCZy02wl/UhCkWbnhLBTI5Yq99nq/pteqEEZSv7WI9Gu XFHhMzM3GOvDg== Subject: Re: [PATCH] media: hantro: Support H264 profile control To: Tomasz Figa , Nicolas Dufresne Cc: Hirokazu Honda , Ezequiel Garcia , Mauro Carvalho Chehab , Greg KH , Linux Media Mailing List , devel@driverdev.osuosl.org, Linux Kernel Mailing List References: <20191122051608.128717-1-hiroh@chromium.org> <767528be59275265072896e5c679e97575615fdd.camel@ndufresne.ca> From: Hans Verkuil Message-ID: Date: Fri, 10 Jan 2020 13:31:08 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-CMAE-Envelope: MS4wfCFM+zo00wI7D/Z3xha1mTiaLvB2X7xakAJsEjudm/mMCDqgPaS0ALMhUjD7FGbvE9gaHbDCUeW6n1mMAlU7QRFfJKjoy/BBOSUPUQFvcX/o45cNq4c6 5eZpmXxjvHYyiGX9RlfZvSEvEfdVejRHqa8EPYDEpLHNZxIrFZdBP3+M8/B2npPNo2Jt1GKe4CiPY6HdBF4Zd5tKqTjkcWTCB+Mxo45kl1Lgr/yHvk5OXcas zoKjDuUji2iCldwA4CtG5rwyJROW8e9Ow+nP4xAZKA1smJnTD3I/HL4APkxK4ZAe91FOwEfm7Aft6utF2gb40RLhIxZe4c+egotdX28vGAjX+zy8cOj5TPvW +F31IZeiVZzkbHd6PZ/fwkHt3Q01X919mz3KU9GjzXjLQGHLwSdpmI/+h/CjDNDZHfsq5lO2+dXYP61cEroyLFU5pDOudC66+OuldyAgD10cCKoig7L6P8VZ wvHGZLe4PZGqBMqu404KcZzZiv80OtiP8smSOkHJQp6pubqkkve9gU1cPactlH2ZTufUXax+8bQWNoNO61wqk8N06yA7vkxzkkABaA== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/29/19 1:16 AM, Tomasz Figa wrote: > On Sat, Nov 23, 2019 at 1:52 AM Nicolas Dufresne wrote: >> >> Le samedi 23 novembre 2019 à 01:00 +0900, Tomasz Figa a écrit : >>> On Sat, Nov 23, 2019 at 12:09 AM Nicolas Dufresne wrote: >>>> Le vendredi 22 novembre 2019 à 14:16 +0900, Hirokazu Honda a écrit : >>>>> The Hantro G1 decoder supports H.264 profiles from Baseline to High, with >>>>> 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. >> >> When you read datasheet, the HW is always rated to maximum level (and >> it's a range) with the assumption of a single stream. It seems much >> easier to expose this as-is, statically then to start doing some math >> with data that isn't fully exposed to the user. This is about filtering >> of multiple CODEC instances, it does not need to be rocket science, >> specially that the amount of missing data is important (e.g. usage of >> tiles, compression, IPP all have an impact on the final performance). >> All we want to know in userspace is if this HW is even possibly capable >> of LEVEL X, and if not, we'll look for another one. >> > > Agreed, one could potentially define it this way, but would it be > really useful for the userspace and the users? I guess it could enable > slightly faster fallback to software decoding in the extreme case of > the hardware not supporting the level at all, but I suspect that the > majority of cases would be the hardware just being unusably slow. > > Also, as I mentioned before, we already return the range of supported > resolutions, which in practice should map to the part of the level > that may depend on hardware capabilities rather than performance, so > exposing levels as well would add redundancy to the information > exposed. There is a lot of discussion here, but it all revolves around a potential LEVEL control. So I gather everyone is OK with merging this patch? If not, let me know asap. Regards, Hans > >>> >>>>> 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/staging/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[] = { >>>>> .def = V4L2_MPEG_VIDEO_H264_START_CODE_ANNEX_B, >>>>> .max = V4L2_MPEG_VIDEO_H264_START_CODE_ANNEX_B, >>>>> }, >>>>> + }, { >>>>> + .codec = HANTRO_H264_DECODER, >>>>> + .cfg = { >>>>> + .id = V4L2_CID_MPEG_VIDEO_H264_PROFILE, >>>>> + .min = V4L2_MPEG_VIDEO_H264_PROFILE_BASELINE, >>>>> + .max = V4L2_MPEG_VIDEO_H264_PROFILE_HIGH, >>>>> + .menu_skip_mask = >>>>> + BIT(V4L2_MPEG_VIDEO_H264_PROFILE_EXTENDED), >>>>> + .def = V4L2_MPEG_VIDEO_H264_PROFILE_MAIN, >>>>> + } >>>>> }, { >>>>> }, >>>>> };