From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.codeaurora.org by pdx-caf-mail.web.codeaurora.org (Dovecot) with LMTP id erp8ABcJGVurVwAAmS7hNA ; Thu, 07 Jun 2018 10:32:40 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id DA3C6607F7; Thu, 7 Jun 2018 10:32:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=unavailable autolearn_force=no version=3.4.0 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by smtp.codeaurora.org (Postfix) with ESMTP id 6AE1E607DC; Thu, 7 Jun 2018 10:32:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 6AE1E607DC Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753511AbeFGKch (ORCPT + 25 others); Thu, 7 Jun 2018 06:32:37 -0400 Received: from metis.ext.pengutronix.de ([85.220.165.71]:36045 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752590AbeFGKcf (ORCPT ); Thu, 7 Jun 2018 06:32:35 -0400 Received: from lupine.hi.pengutronix.de ([2001:67c:670:100:3ad5:47ff:feaf:1a17] helo=lupine) by metis.ext.pengutronix.de with esmtp (Exim 4.89) (envelope-from ) id 1fQsDX-0001Gh-VA; Thu, 07 Jun 2018 12:32:31 +0200 Message-ID: <1528367543.3308.6.camel@pengutronix.de> Subject: Re: [RFC PATCH 2/2] media: docs-rst: Add encoder UAPI specification to Codec Interfaces From: Philipp Zabel To: Hans Verkuil , 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, Tiffany Lin =?UTF-8?Q?=28=E6=9E=97=E6=85=A7=E7=8F=8A=29?= , Andrew-CT Chen =?UTF-8?Q?=28=E9=99=B3=E6=99=BA=E8=BF=AA=29?= , Stanimir Varbanov , todor.tomov@linaro.org, nicolas@ndufresne.ca, Paul Kocialkowski , Laurent Pinchart Date: Thu, 07 Jun 2018 12:32:23 +0200 In-Reply-To: <41fd04f2-fc44-1792-81e6-a3d4d384adc5@xs4all.nl> 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> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.22.6-1+deb9u1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 2001:67c:670:100:3ad5:47ff:feaf:1a17 X-SA-Exim-Mail-From: p.zabel@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. regards Philipp