Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2006130imm; Thu, 7 Jun 2018 04:02:56 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLbt2Wxa22/mNZiK5V2WrnQ7PC6MTKhd761gP0ruCW60SAQ9HtIyWkgwFswf+sb0mmngnKm X-Received: by 2002:a17:902:8b86:: with SMTP id ay6-v6mr1491286plb.295.1528369376489; Thu, 07 Jun 2018 04:02:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528369376; cv=none; d=google.com; s=arc-20160816; b=qvCoaPSBL2tFTThI9XO+cGp4u1bVCKfjObGBQTI4c5+nrU2j+kDpboBc7+/7TQV4s2 4XVV/NQQXDuxpqugsdQe0DmTGVbihBkasNAcadJqjrLuB9USe8lh0mniqSKyfizrHzcz KNoNWom062Ulv5udw1FRDqeDA5Jb/uNweJj8/uvTfWEpHCqKQtui4w4DI+2DgXLmKvHV 0hIK3RHQJXxHDZ8V3Qw+hO0tmwp6+BLnLTcX098O3f+qOM5/VX27AIKiRtnZabFtCCw5 tB2pL3hmwYgGoeRg22GSxg4GkoW2/YdfW8nd/k1sum5137d4mFGXH34vFVs85U+IaLIJ BBAQ== 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:arc-authentication-results; bh=AeCdxQ57E1jVEcNr591pUJ3YAdxBYl8i8QNSA9iyFFw=; b=PY0p+TnhGPQVAU/ybJRYtW47kriS0sIUXJ8z/uZ05CsdX+LW8DZdPQkJ70tuRNHuYx 9JxkQ1GBBlaPpaf4K2dVH+pn3/7UP3rCBf1nBHDauJprGujijnTRkfTOPqk1s6MzykCd 1rn4n63NqAP3r/lYrECRVSoxV0Ga8UbtzxSB/11K3lelVTk+k4raqncCuVw1FRgAGsm9 3qGObCSLAGyXloImrkoJ4PmYyTyOwFMiwu+JaSxwkxvOJs6iDdzgZz7Rpb0l8vd7giBS LcnM5I1URTEj/vIoFzvFRjAIZyewjlXMCsL6dUogBLbNtZSq/3kh5XkZUKhbhlj/p+p3 5M3Q== ARC-Authentication-Results: i=1; mx.google.com; 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 p8-v6si15140938pgd.96.2018.06.07.04.02.41; Thu, 07 Jun 2018 04:02:56 -0700 (PDT) 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; 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 S1753201AbeFGKzD (ORCPT + 99 others); Thu, 7 Jun 2018 06:55:03 -0400 Received: from lb3-smtp-cloud9.xs4all.net ([194.109.24.30]:45736 "EHLO lb3-smtp-cloud9.xs4all.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751472AbeFGKzB (ORCPT ); Thu, 7 Jun 2018 06:55:01 -0400 Received: from [IPv6:2001:420:44c1:2579:708b:15e9:d378:18bf] ([IPv6:2001:420:44c1:2579:708b:15e9:d378:18bf]) by smtp-cloud9.xs4all.net with ESMTPA id QsZDf9EVABFh2QsZHfmf7C; Thu, 07 Jun 2018 12:55:00 +0200 Subject: Re: [RFC PATCH 2/2] media: docs-rst: Add encoder UAPI specification to Codec Interfaces To: Philipp Zabel , Tomasz Figa Cc: Pawel Osciak , Linux Media Mailing List , Linux Kernel Mailing List , Mauro Carvalho Chehab , Alexandre Courbot , kamil@wypas.org, a.hajda@samsung.com, Kyungmin Park , jtp.park@samsung.com, =?UTF-8?B?VGlmZmFueSBMaW4gKOael+aFp+ePiik=?= , =?UTF-8?B?QW5kcmV3LUNUIENoZW4gKOmZs+aZuui/qik=?= , Stanimir Varbanov , todor.tomov@linaro.org, nicolas@ndufresne.ca, Paul Kocialkowski , Laurent Pinchart References: <20180605103328.176255-1-tfiga@chromium.org> <20180605103328.176255-3-tfiga@chromium.org> <1528199628.4074.15.camel@pengutronix.de> <1528208578.4074.19.camel@pengutronix.de> <1528278003.3438.3.camel@pengutronix.de> <41fd04f2-fc44-1792-81e6-a3d4d384adc5@xs4all.nl> <1528367543.3308.6.camel@pengutronix.de> From: Hans Verkuil Message-ID: Date: Thu, 7 Jun 2018 12:54:55 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <1528367543.3308.6.camel@pengutronix.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-CMAE-Envelope: MS4wfIRCWUnWXMudS/XYfB0urAHQxWHSxyAazphAUbDZDga+4EEcnk6deXpDd6SGjlt73B3S0IJeLXiTvl4d7KfGctA9Me8cPo6xAB/+RFaUqvyd9biFFmhU rhdtNs74UNsNvLHmlngXo6YRwO46X1TxiMBZqgj49xxT08L3YkEzPCEUZrXs9KzbzaZ6C1X3tNdG6eKMWB+P7DbeoX5LzTwvBo50PRrysYW2+Fvzfue+MlH9 /TC3VGvhyx6ehJcHWaXC1OXzewh7tkRVRBZ3wk54Spj8G+HqVAEuo1kL3NuUUyVihP5+ipeRrnHdoY0DZHewRcD3tlSalBM2A30yovxaQRBecPlqXtAnzwiJ Ti5j5VRtDn2DaTGHBSMY8SlyEtoNMkLWDmu4Wu67kkSZ+qoytEU5GBMysOjSActiQezDTaGRXupaC/b3YXa7pnAqBBjeXXpCvuCiXBoBZLDf8Lt3PUCEJBht b5at24MBuVEvF2kA55ORNIqMV6MMAR8f58vOLV2eWpAVkIRMlLJZn4i1z9qQK5aySaPaN2gdi6TX57p7wN9kVqkuCj5f3Qr3wp5Hx5mnucVFTdz27pOS65ow 9QBVegD0+wiTWOux9/9GsQTuTE2y1mTGXjSjUyyr1rsU/Ob/LjJFSexh6iXrjlkP05hzEM2gxIosICYoOnW7LMhXK8XSdAiiVdwJfsihLSAM0wfX4awyfrnu eZ5WdKYtZ4gF2nSeXChMX/tueQ4IW/e09RPN6giytmZEVMxcY3ohLneKUEO4gXyDF1UqGGWJyn6wIXtMyqgPfNYHONIPV6044LAsHj3r6oBxJ4QdALy+FM4D QkxpqyDkhwrhIGPN692MpVu3JPv4o5xDrocfNQb9 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/07/18 12:32, Philipp Zabel wrote: > On Thu, 2018-06-07 at 09:27 +0200, Hans Verkuil wrote: > [...] >>>>>> I think it could be useful to enforce the same colorimetry on CAPTURE >>>>>> and OUTPUT queue if the hardware doesn't do any colorspace conversion. >>>>> >>>>> After thinking a bit more on this, I guess it wouldn't overly >>>>> complicate things if we require that the values from OUTPUT queue are >>>>> copied to CAPTURE queue, if the stream doesn't include such >>>>> information or the hardware just can't parse them. >>>> >>>> And for encoders it would be copied from CAPTURE queue to OUTPUT queue? >>>> >>> >>> I guess iy would be from OUTPUT to CAPTURE for encoders as well, since >>> the colorimetry of OUTPUT is ultimately defined by the raw frames that >>> userspace is going to be feeding to the encoder. >> >> Correct. All mem2mem drivers should just copy the colorimetry from the >> output buffers to the capture buffers, unless the decoder hardware is able to >> extract that data from the stream, in which case it can overwrite it for >> the capture buffer. >> >> Currently colorspace converters are not supported since the V4L2 API does >> not provide a way to let userspace define colorimetry for the capture queue. > > Oh, I never realized this limitation [1] ... > > "Image colorspace, from enum v4l2_colorspace. This information > supplements the pixelformat and must be set by the driver for capture > streams and by the application for output streams, see Colorspaces." > > [1] https://linuxtv.org/downloads/v4l-dvb-apis-new/uapi/v4l/pixfmt-v4l2.html > > It's just a bit unintuitive that the initialization sequence requires to > set S_FMT(CAP) first and then S_FMT(OUT) but with colorspace there is > information that flows the opposite way. > >> I have a patch to add a new v4l2_format flag for that since forever, but >> since we do not have any drivers that can do this in the kernel it has never >> been upstreamed. > > Has this patch been posted some time? I think we could add a mem2mem > device to imx-media with support for linear transformations. I don't believe it's ever been posted. It's here: https://git.linuxtv.org/hverkuil/media_tree.git/commit/?h=csc&id=d0e588c1a36604538e16f24cad3444c84f5da73e Regards, Hans