From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=103.168.172.158 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796056176; b=wMr9nxdaF6/+oPy5kHm0KbCEm/hlvYGIb5D0rtlnuvrXkaGDNBMqs9XTSZtArdBL86R/ +lcIaax6nAIC2K5UeCc4EIUlBrzztCRbnDQ/cDr6Acf8wi9DcS4cEM5jqPcDIHqJ6DXdQ qaxrgp4tRkcpOXsXu6WV16E8lSOPDBLqOssB40m8KwCKCIiuv04bQRNi7bkRalF1eHU6d odU7+F+adB+rmpEenMhrqglW+UIEFM47ye5WX2Y1nnAkfUbBlqIcYJHRwfKYjlQcuscnW h+bSw92xj0v9qAc+YYEWZc0XdpTTUVwnR6hFpEG22kpjjEPTXxQAbhNF07V5QAoWSWQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796056176; h=DMARC-Filter:Received:Received:DKIM-Signature:DKIM-Signature: X-DKIM2-Info:DKIM2-Signature:X-DKIM2-Info:Message-Instance: X-ME-Sender:X-ME-Received:X-ME-Proxy-Cause:X-ME-Proxy:Feedback-ID: Received:Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:Content-Transfer-Encoding: In-Reply-To; bh=ZFJ4ujY4Ys48BtPj96Tf2Dls2E35AKjMEp/9UK4CuOU=; b=Eb4zWYNvA/9/IYfsar6g+TUCr9kCo8QXCeM1scsiVeLjvalclgBPlbn7Ge+dqFQV7kq3 lbJrBXku89lN2ltPg5vEKE4NYvk0jhKXEel/JmADV56MkGMPk0MgDlAGyK284WTNE44Ip TEWLozmDkpwmcvzSlh5opfWM1PmfVD8La5eA6I94QoCcvJgygitCiLuDLb/fDds4FMsjN lxbJvXbg3FDRieSHjFcc1GLYW1Bt9r/lNkKIZpktdQE5YwPBpWunjx+P+3Hr8JugpJM7k 6Yo9et7IkUxMHc1DjCRsoz/oX/w4qmzapLG7mWzw5Gmk4/e9OgvpcNlX/pi7aJEAF+g== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=ragnatech.se; spf=pass smtp.mailfrom=ragnatech.se; dkim=pass header.d=ragnatech.se header.i=@ragnatech.se header.a=rsa-sha256 header.s=fm2 header.b=ivH6b8Jm; dkim=pass header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm3 header.b=YDZ6L2zm; arc=none smtp.remote-ip=103.168.172.158 Received: from fhigh-a7-smtp.messagingengine.com (fhigh-a7-smtp.messagingengine.com [103.168.172.158]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2C9E9606A320 for ; Mon, 30 Nov 2026 16:29:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 2C9E9606A320 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ragnatech.se Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ragnatech.se Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=ragnatech.se header.i=@ragnatech.se header.a=rsa-sha256 header.s=fm2 header.b=ivH6b8Jm; dkim=pass (2048-bit key, unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm3 header.b=YDZ6L2zm Received: from phl-compute-10.internal (phl-compute-10.internal [10.202.2.50]) by mailfhigh.phl.internal (Postfix) with ESMTP id 511F81400937 for ; Mon, 30 Nov 2026 11:29:34 -0500 (EST) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-10.internal (MEProxy); Mon, 30 Nov 2026 11:29:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ragnatech.se; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1796056174; x=1796142574; bh=ZFJ4ujY4Ys48BtPj96Tf2Dls2E35AKjMEp/9UK4CuOU=; b= ivH6b8JmgUX1kcEgZ6QGBI+VbQp4BgK1Qv/tAmdTD+MX5kfyZKQGg9DumaXTwNoN 4nNOWYWj1JQTI7wHjXeucToG/jQt6vDtptwydvVUdMEBo9lkwQtFb58v8R0NC/8T BRq7kFX37htlTiK147zts4uYOvZls1Bu+yE08rqbY7wo0BVBPdgBP4cQfrYv793B 4ed+zNJMpJnwVSIahzjXc++KwoRE1qvycnM0f9zW9KBLhmfQ6/P88KhH9j7Juojl QSOe4Tt+n1Z700trzC4s9/AWp5l0VK5um2TQ8tVyb78Y+y17ztGPhjTrZ3K0Qf3S SDCb+Zh/N3UMdE2wwGYSKg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1796056174; x= 1796142574; bh=ZFJ4ujY4Ys48BtPj96Tf2Dls2E35AKjMEp/9UK4CuOU=; b=Y DZ6L2zmWuhDd/k7wikZs2lD+pXGyteyppGAKYozNXLzzvOEb44K2+BJJRC8BCf2A D5r5HrPa/hh3DrtHcgWHrsFT5eHGVcBzU2GBGeCLtfuiA0uE4kfY786ZefM1yO+h tHxDkxea93KWxo0613lA8W4HK0Tm6wvnEb/A2FOwC3Aqg77AN5DU14v7Ydi3I57F Ul3rUDhMflTBzqZknZfogDjp/l2WEbYxD02tDxVba6RW74+WDd9wp+DDJTnZrGQ6 tgsEhGeF3tI+7IY4WOX80pL8EeOPrsYUK+5VkvbAza+xm0L6xg1IVFD6nJ8FFmNp 1V+CAUlCMbTth7bKj/WSQ== X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-09; repo=github.com/dkim2wg/interop; date=2026-11-03; sw=lmtpprox; action=sign d=ragnatech.se a=rsa-sha256; DKIM2-Signature: i=1; m=1; t=1796056174; d=ragnatech.se; mf=PG5pa2xhcy5zb2Rlcmx1bmRAcmFnbmF0ZWNoLnNlPg==; rt=PGxpbnV4LWtlcm5lbEB2Z2VyLmtlcm5lbC5vcmc+; s=fm2:rsa-sha256:KgTZZG/5Zld42tfcbQDjtO6tfUiY8J/6NePJs4LXCnqZgwQ 12v+dmQ5rl1sOri8mTixjIbbZEs/vYsmo1LbG38Obcft9A/yUNokMEkEGyrsCJUI jiow1zALd/vioZYz0QN8axiHCwkzAkHySzDtIUh+v7qhJJXi+hSHJhvh5snd8cGP fsxf395RJkdda9wG7UbIEqkVPYWDCEIouiy8jWX7VTU9DlqGrN8Eikl0B2Z77RoM QiSB4LinL9ZWzhUfOB6e6DHLqiRsqjOxhtJbttC1WkJU6/tCMdruIpiLCSUB6zdI 2bl4nl6vqrH5hQnXnT5HJ06WHyfYwZlE9zORvrg==; X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-09; repo=github.com/dkim2wg/interop; date=2026-11-03; sw=lmtpprox; action=mi-m=1; hc=13; hn=cc,content-disposition,content-transfer-encoding, content-type,date,feedback-id,from,in-reply-to,message-id, mime-version,references,subject,to; Message-Instance: m=1; h=sha256:A07fBUsqQUHUEnPja3No6QS1f3jCaSaoSA1U7K7Dh0c=:m6xH5cuccPYlB47oQC07XPwPieiVifABWqJRjdOinS8=; X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTGaKie21/XPxha+Ai7cTevwvZ+wpmT8utUe7SMeck7ShXlS5OVPNGnke+mMYu0LQm 3SwceN78rT+Sg2TO0S20i2rNNI+5cN6nTOc9lmZa/QJIeHnQNwsJXIsMuI0TOCQo/gWE6k lX+rPC9qaR5k/FKsjLswlcHgGytsjwKwUw0KuTGL1rzIcPiNtVUY7ApvWyPQpTHOLb/eDz zgZ7PGSqcpKSKAKnehqSTLKv6KK0921IX85M4onasgYh5bIVxfPFGdC7BpCme687HCLYtU Z4BX5f/LnQ3NoSOlhxh3YjMeTBMBe3Ym4hyCuuOMZ16tusIHD1QxdueuAtbSLgGHizifIq jQeW43UHhrk4H4xP+HwUdxYCnAkeqr1zUr2EAyyBEZTHGLzywRFtfRU9/NmQF0btGajjOH 8qGo3NUM71N3IHtkJRcoZFEgTmAhzBDe+vGRfBsOQWxWoYknj0nialpjTrX5vCfrnRR8bb 7rqUiU0/7Cmdnzejk3B0c0CaMOVFXJW7pKRGI5x7qHyd0F7y9/uRnKihZOg8c2fKgpsTp5 JXY06vh2MqnbL9+v8Hf58uoQR4K3DqtsEWlRTYEL1+t0WnlFEPYuffJkBJ4DMtCPgYvyR6 MI6fNiCkXA5YT6jqX760OsxK2106codjZet7Foc7TP/ECws5YKCwuPvKBFPQ X-ME-Proxy: Feedback-ID: i80c9496c:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 30 Nov 2026 11:29:33 -0500 (EST) Date: Mon, 30 Nov 2026 17:29:17 +0100 From: Niklas =?utf-8?Q?S=C3=B6derlund?= To: =?utf-8?Q?Barnab=C3=A1s_P=C5=91cze?= Cc: Mauro Carvalho Chehab , Geert Uytterhoeven , Magnus Damm , Hans Verkuil , Lad Prabhakar , linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH v1] media: rcar-vin: Use V4L2_COLORSPACE_RAW for raw formats Message-ID: <20261130162818.GD3157946@ragnatech.se> References: <20261127102942.2208296-1-barnabas.pocze+renesas@ideasonboard.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20261127102942.2208296-1-barnabas.pocze+renesas@ideasonboard.com> Hi Barnabás, Thanks for your work. On 2026-11-27 11:29:42 +0100, Barnabás Pőcze wrote: > In `rvin_mc_try_format()`, `RVIN_DEFAULT_COLORSPACE` is used unconditionally. > That corresponds to the SRGB color space. However, this is reported even for > raw formats, where `V4L2_COLORSPACE_RAW` would be a better fit. > > So check if the adjusted pixel format has bayer encoding and if so, report > the raw color space, otherwise fall back to `RVIN_DEFAULT_COLORSPACE`. > > Fixes: e87c1a81f158d ("media: rcar-vin: Add support for MEDIA_BUS_FMT_SRGGB8_1X8 format") > Signed-off-by: Barnabás Pőcze > --- > > This is an RFC because this approach feels a bit ad-hoc, and while it solves the > issue at hand, maybe there is a better solution. I thin this works and it solves the issue, Reviewed-by: Niklas Söderlund > > --- > drivers/media/platform/renesas/rcar-vin/rcar-v4l2.c | 10 +++++++--- > 1 file changed, 7 insertions(+), 3 deletions(-) > > diff --git a/drivers/media/platform/renesas/rcar-vin/rcar-v4l2.c b/drivers/media/platform/renesas/rcar-vin/rcar-v4l2.c > index 4961d28f42c78..28573c0bde863 100644 > --- a/drivers/media/platform/renesas/rcar-vin/rcar-v4l2.c > +++ b/drivers/media/platform/renesas/rcar-vin/rcar-v4l2.c > @@ -543,19 +543,23 @@ static int rvin_subscribe_event(struct v4l2_fh *fh, > static void rvin_mc_try_format(struct rvin_dev *vin, > struct v4l2_pix_format *pix) > { > + rvin_format_align(vin, pix); > + > /* > * The V4L2 specification clearly documents the colorspace fields > * as being set by drivers for capture devices. Using the values > * supplied by userspace thus wouldn't comply with the API. Until > * the API is updated force fixed values. > */ > - pix->colorspace = RVIN_DEFAULT_COLORSPACE; > + if (v4l2_is_format_bayer(v4l2_format_info(pix->pixelformat))) > + pix->colorspace = V4L2_COLORSPACE_RAW; > + else > + pix->colorspace = RVIN_DEFAULT_COLORSPACE; > + > pix->xfer_func = V4L2_MAP_XFER_FUNC_DEFAULT(pix->colorspace); > pix->ycbcr_enc = V4L2_MAP_YCBCR_ENC_DEFAULT(pix->colorspace); > pix->quantization = V4L2_MAP_QUANTIZATION_DEFAULT(true, pix->colorspace, > pix->ycbcr_enc); > - > - rvin_format_align(vin, pix); > } > > static int rvin_mc_try_fmt_vid_cap(struct file *file, void *priv, > -- > 2.56.1 > -- Kind Regards, Niklas Söderlund