Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp3925722ybz; Mon, 4 May 2020 12:16:05 -0700 (PDT) X-Google-Smtp-Source: APiQypL8CopM/ZsYGyKVDj13j7RvEuf7pvaSFusTq61NH4VQgfCquE1pcnF6nh6mBMLP6c/Fxeba X-Received: by 2002:a17:906:e210:: with SMTP id gf16mr16839186ejb.214.1588619765458; Mon, 04 May 2020 12:16:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588619765; cv=none; d=google.com; s=arc-20160816; b=Wbm4ph38bQB4Gc3zg1TztAqsZLOH8C4lYRh1gLCD9v6DtGvrFhytoFIfbuQytEPiUe X+TX3t3VhbpAsyfEzn64Au6jKEg8vc8ZZOcglhozUkt1MvlOoJyAWLMVX8kbK1lIIVeX 9YN68fIV2E+cjSrOSQzYnQaoVbsz9/6Ad16C+1x3gh/LZX0zIUsjauRfcerwChfTu3me Iba9fWouoUh0L7GfQo19tC9hjbmeZg/E80CynDXA1Dw0wN/9WHoamKPbeOzoRfO601p2 /gJqGy9DwqT8xVHG3/qAHpsFC4L/E+QlURJN5x1Nl4+cqF0agxDDZQo9MLm7oNZvLj37 Whkg== 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:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=ygElWv9/jIz1+u5oISqxIJstP2VgQE99+MrAGWA5QB4=; b=tnb6zaHw4GvuUOudZFIZLrgQ4G/QykTk1Lu88RMVEhQeW6rXbYLWmY/1EMlDG2QBVw mHXgqaaj930r/ga0ei/HmFp42oSQyzTlrz/5TZh3vNZ8no0/2PtIKKpJwVKqNsu05g5p TzindPI8sA7RU+16j8VCIIBFtOJwTeV+aB3F90avRUOu2rlcpxni3wCH9LZjnTgumjij zSW6HvqNoXiVOkBLBNbbabpISO1LwvLeTHnQ5bODy5xDcwOru0ITpVjJSqTfKKavdEoc aNokpWSeOIXXkGTdDZU49VJp2mGu3wRnNORZqh8JGLSeOyLw08OWsfMhtKt4Mo8pjKA2 AYqQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j3si7265827ejo.146.2020.05.04.12.15.41; Mon, 04 May 2020 12:16:05 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727825AbgEDTOB convert rfc822-to-8bit (ORCPT + 99 others); Mon, 4 May 2020 15:14:01 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:60840 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725956AbgEDTOB (ORCPT ); Mon, 4 May 2020 15:14:01 -0400 Received: from localhost (unknown [IPv6:2a01:e0a:2c:6930:5cf4:84a1:2763:fe0d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: bbrezillon) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 53FBB2A0E46; Mon, 4 May 2020 20:13:58 +0100 (BST) Date: Mon, 4 May 2020 21:13:54 +0200 From: Boris Brezillon To: Nicolas Dufresne Cc: Ezequiel Garcia , Hans Verkuil , linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Tomasz Figa , kernel@collabora.com, Jonas Karlman , Heiko Stuebner , Alexandre Courbot , Jeffrey Kardatzke Subject: Re: [PATCH v2 2/3] media: uapi: Add VP9 stateless decoder controls Message-ID: <20200504211354.5b8cafd4@collabora.com> In-Reply-To: <98946a03023451d44c2ebb2da719fa7dd3e530f6.camel@collabora.com> References: <20200410115113.31728-1-ezequiel@collabora.com> <20200410115113.31728-3-ezequiel@collabora.com> <9126475c-275d-71ab-0308-6ae85e22446b@xs4all.nl> <20200502203707.402ea3cd@collabora.com> <98946a03023451d44c2ebb2da719fa7dd3e530f6.camel@collabora.com> Organization: Collabora X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 04 May 2020 14:38:23 -0400 Nicolas Dufresne wrote: > Le lundi 04 mai 2020 à 14:01 -0400, Nicolas Dufresne a écrit : > > Le samedi 02 mai 2020 à 19:55 -0300, Ezequiel Garcia a écrit : > > > +Nicolas > > > > > > On Sat, 2020-05-02 at 20:37 +0200, Boris Brezillon wrote: > > > > On Fri, 01 May 2020 13:57:49 -0300 > > > > Ezequiel Garcia wrote: > > > > > > > > > > > + > > > > > > > +.. tabularcolumns:: |p{1.5cm}|p{6.3cm}|p{9.4cm}| > > > > > > > + > > > > > > > +.. flat-table:: enum v4l2_vp9_reset_frame_context > > > > > > > + :header-rows: 0 > > > > > > > + :stub-columns: 0 > > > > > > > + :widths: 1 2 > > > > > > > + > > > > > > > + * - ``V4L2_VP9_RESET_FRAME_CTX_NONE`` > > > > > > > + - Do not reset any frame context. > > > > > > > + * - ``V4L2_VP9_RESET_FRAME_CTX_NONE_ALT`` > > > > > > > + - Do not reset any frame context. This is an alternative value for > > > > > > > + V4L2_VP9_RESET_FRAME_CTX_NONE. > > > > > > > > > > > > Add `` around V4L2_VP9_RESET_FRAME_CTX_NONE. > > > > > > > > > > > > > > > > Hm, now that I look closer, what's the point > > > > > of having the NONE_ALT in our uAPI if it > > > > > has same meaning as NONE? > > > > > > > > > > I think it can be removed. > > > > > > > > The intent was to match the spec so that one can pass the value > > > > extracted from the bitstream directly. > > > > reset_frame_contextspecifies whether the frame context should be reset > > to default values: > > − 0 or 1 means do not reset any frame context > > − 2 resets just the context specified in the frame header > > − 3 resets all cont > > > > But aren't we going too far by making this an emum ? In Microsfot DXVA, > > we pass that value without interpreting it in userspace. For the > > following RKVDEC, it is (suspiciously ?) ignored. Maybe just passing > > over the value would make more sense, less work ? > > I have looked deeper. So basically when 2 and 3, that needs to be done > by userspace is set back the associated probs arrays to their default > values (see section 10.5 or the spec). > > https://github.com/rockchip-linux/mpp/blob/develop/mpp/codec/dec/vp9/vp9d_parser.c#L1021 > > It seems that for both VAAPI And DXVA, the drivers takes care of that > reset. So I'd like to ask, shall we code these defaults inside the > driver ? I think we do similar things in JPEG side. But if we keep it > the way it is, this should be strictly documented, otherwise anyone > porting from DXVA or VAAPI will be tricked by this. IIRC, some book keeping had to be done in userspace anyway, so I didn't feel the need for resetting probe context in kernel space (tt's always hard to draw a clear line of what should be done in userspace and what should be automated by kernel drivers for those stateless decoders). I suspect some engines have hardware probs contexts, and in that case, you'd have to reset those when this field is set to 2 or 3, but that's not the case here.