From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f171.google.com (mail-qk1-f171.google.com [209.85.222.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6763A3D75AC for ; Fri, 20 Mar 2026 17:42:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774028583; cv=none; b=LA3iI82u3BVOJoIel7WA0KqXpdodkg524BtFCtVM1ykvnIruANOq2SN160RObz19cujn7Sdpa5A16zVFOAFwQjy2rQksu1gVjao1TmtMluwMYDgzw2mcctDgW+0SY4wHZCGzU1x5wFiZ1qxiXnRvMnYtTZVUm6T3KyNJmSjhXKc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774028583; c=relaxed/simple; bh=Ng6lkfIzPn2qUTr6WUPLQTGicLlvh0rZQdiVPA9WRok=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=ZNGWgQ7tEJUL5gjqpiPhCdCJZjaaWAjqt/8IElCFvNhLLpqEIiljx8l2HK2jq50Th4CWI1GoyYz9C0AwY9azKRhtFs/sGn+NdMCHDLWJEmS3pKpu+RKLtaidqL0/DXhfJCAqpg3pwxMoKFNQ85sB2WuKbEHd3O3t0XpyfaXkLl0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ndufresne.ca; spf=pass smtp.mailfrom=ndufresne.ca; dkim=pass (2048-bit key) header.d=ndufresne-ca.20230601.gappssmtp.com header.i=@ndufresne-ca.20230601.gappssmtp.com header.b=l9pIve2L; arc=none smtp.client-ip=209.85.222.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ndufresne.ca Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ndufresne.ca Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ndufresne-ca.20230601.gappssmtp.com header.i=@ndufresne-ca.20230601.gappssmtp.com header.b="l9pIve2L" Received: by mail-qk1-f171.google.com with SMTP id af79cd13be357-8cd7c372929so181582085a.0 for ; Fri, 20 Mar 2026 10:42:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ndufresne-ca.20230601.gappssmtp.com; s=20230601; t=1774028578; x=1774633378; darn=vger.kernel.org; h=mime-version:user-agent:references:in-reply-to:date:cc:to:from :subject:message-id:from:to:cc:subject:date:message-id:reply-to; bh=4b7bHDEHMNg+ZOh92aXYeYMSzd5GgyCONDythGrcDzA=; b=l9pIve2LYLw9Wv7OdRYJ9KvM4IKMtL4RSzwsWgtsXEolZIXt0S/kLZxc2yXotPV3A/ J/big7428hibFm6qYlMScxVkWkhTVC30nYsumM9SdrX3LTDFj5bWIKcKIBKAhIZ56q9i 1nLcayqX4hhSWDUFPzNiT1avcly30PxzKS5tqG4u1Ch8EbxDI1jwF519pBwrntWnM8Ch Niz2PhjnDcQ+unPBwQMnBajFVCINdUWuuWRnO+zUUzBeYneD/9LwzJCOpi/O1lxNSf0V NaNBNlNCFdiraYI2WoLaV96OcMtJScFie8McLvE7iG4X5US8JlSSvhd8miyPtT9fb76k UZUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774028578; x=1774633378; h=mime-version:user-agent:references:in-reply-to:date:cc:to:from :subject:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=4b7bHDEHMNg+ZOh92aXYeYMSzd5GgyCONDythGrcDzA=; b=GVe2ZpRsl9NFJfL+AKpOl8OykrFP6yyozzr2rAG0CDzQKwTSiblSL31EFeKy1DA1Xf G4D6B2GbscpEwdFtLa+2BYVPjzZJAw055xjDPx+TKlQ1ZaNv8C+RbEA4j0hnlRjQyy0b eUsEXLTDYbBeCjg2i+I/+eBUm23PYbNNqpoi/fPtbpldDpSGAS2Nu4Pti2Awc4MEzHlG zRFricqz/S8aM/ugzi09dpet3ZlGBI8rYwghOZ5XpcwPqciji4vgc3GkQexkQEjB5wOy dxdDjmexFYiry/LVRsopOicHi9WHs92NeSdyEcE6+87GoK+BD6K+GHk6me74DJxz5pzr 6s1A== X-Forwarded-Encrypted: i=1; AJvYcCVhnatY66l7iBXi+wLreZgdtiOi7cgy/ifUrBbOrhQhx823HCgU/0gF7fdYh+QafU9cAYeO2gtu2NgnPQk=@vger.kernel.org X-Gm-Message-State: AOJu0YyNsGoCm3Y+1nwS0UZUkOQQJQXDcJGhnmyUEbEF39lzgODbeia7 N+THbhT6riMsTh86LQUrYgWuwzhmVq5JBkReMTLXTdTSXeR/vUxofy5aT4Z7cHbIabc= X-Gm-Gg: ATEYQzwmOi2wA8U+LpSeJcLvKJlaLmZO1jqUb71lXyokfnR8kDRX+AsFtahwlIY9hhU tdLvUhWbRkchn+MYrNFfam2GpmkPZSAAptmiq2dCFFaWSpY+omx7MpITGHkJalkAS+wQzPmPolT gzMmCMh3EBMtvPH0JyNTS7nivZekxzSm3l9TLdXlNvi8etm6CBwHX7sPiSpID64zwRjO8XKSwbK 4J7IdUC+wKQu7vHGmK3YY6kdhrP2zlzER/icdYqMBxTXkHWQVk+6Foe1RHdYBZuKefi3TPeXNVS c2lxyDjO5DqyVqdM8LawGqD5tScwzn+BOrO9OfEc174emz/ArQy07TlfBV9Z09Y6L8GQUofdqt7 rBI85WRaOce9e4gbzn6P8aVxlx5Aen6eipPFXNlj3uQTUoiFDOYOwcBDohO7ayeIzQ5S7pBHJkS 5oSvvL+0IjZu5aEV4lhPt8OzxOcHLK X-Received: by 2002:a05:620a:4606:b0:8cd:b2e9:7d88 with SMTP id af79cd13be357-8cfc7f4df71mr539139685a.44.1774028577988; Fri, 20 Mar 2026 10:42:57 -0700 (PDT) Received: from ?IPv6:2606:6d00:11:b76d::5ac? ([2606:6d00:11:b76d::5ac]) by smtp.gmail.com with ESMTPSA id af79cd13be357-8cfc8f5d128sm210466385a.8.2026.03.20.10.42.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Mar 2026 10:42:57 -0700 (PDT) Message-ID: Subject: Re: [PATCH v3 09/27] media: rockchip: rga: announce and sync colorimetry From: Nicolas Dufresne To: Sven =?ISO-8859-1?Q?P=FCschel?= , Jacob Chen , Ezequiel Garcia , Mauro Carvalho Chehab , Heiko Stuebner , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, kernel@pengutronix.de Date: Fri, 20 Mar 2026 13:42:56 -0400 In-Reply-To: <20260127-spu-rga3-v3-9-77b273067beb@pengutronix.de> References: <20260127-spu-rga3-v3-0-77b273067beb@pengutronix.de> <20260127-spu-rga3-v3-9-77b273067beb@pengutronix.de> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-oe7RpPV93eR3PfJ/4+yO" User-Agent: Evolution 3.58.3 (3.58.3-1.fc43) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 --=-oe7RpPV93eR3PfJ/4+yO Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Le mardi 27 janvier 2026 =C3=A0 15:39 +0100, Sven P=C3=BCschel a =C3=A9crit= =C2=A0: > Announce the capability to adjust the quantization and ycbcr_enc on the > capture side and check if the SET_CSC flag is set when the colorimetry > is changed. Furthermore copy the colorimetry from the output to the > capture side to fix the currently failing v4l2-compliance tests, which > expect exactly this behavior. >=20 > Signed-off-by: Sven P=C3=BCschel Reviewed-by: Nicolas Dufresne > --- > =C2=A0drivers/media/platform/rockchip/rga/rga.c | 37 ++++++++++++++++++++= +++++++++++ > =C2=A01 file changed, 37 insertions(+) >=20 > diff --git a/drivers/media/platform/rockchip/rga/rga.c b/drivers/media/pl= atform/rockchip/rga/rga.c > index 20d1d9cb7625d..cf9d5702598fa 100644 > --- a/drivers/media/platform/rockchip/rga/rga.c > +++ b/drivers/media/platform/rockchip/rga/rga.c > @@ -437,6 +437,15 @@ static int vidioc_enum_fmt(struct file *file, void *= priv, struct v4l2_fmtdesc *f > =C2=A0 fmt =3D &formats[f->index]; > =C2=A0 f->pixelformat =3D fmt->fourcc; > =C2=A0 > + if (f->type !=3D V4L2_BUF_TYPE_VIDEO_CAPTURE && > + =C2=A0=C2=A0=C2=A0 f->type !=3D V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) > + return 0; > + > + /* allow changing the quantization and xfer func for YUV formats */ > + if (v4l2_is_format_yuv(v4l2_format_info(f->pixelformat))) > + f->flags |=3D V4L2_FMT_FLAG_CSC_QUANTIZATION | > + =C2=A0=C2=A0=C2=A0 V4L2_FMT_FLAG_CSC_YCBCR_ENC; > + > =C2=A0 return 0; > =C2=A0} > =C2=A0 > @@ -459,8 +468,25 @@ static int vidioc_g_fmt(struct file *file, void *pri= v, struct v4l2_format *f) > =C2=A0static int vidioc_try_fmt(struct file *file, void *priv, struct v4l= 2_format *f) > =C2=A0{ > =C2=A0 struct v4l2_pix_format_mplane *pix_fmt =3D &f->fmt.pix_mp; > + struct rga_ctx *ctx =3D file_to_rga_ctx(file); > =C2=A0 struct rga_fmt *fmt; > =C2=A0 > + if (V4L2_TYPE_IS_CAPTURE(f->type)) { > + const struct rga_frame *frm; > + > + frm =3D rga_get_frame(ctx, f->type); > + if (IS_ERR(frm)) > + return PTR_ERR(frm); > + > + if (!(pix_fmt->flags & V4L2_PIX_FMT_FLAG_SET_CSC)) { > + pix_fmt->quantization =3D frm->pix.quantization; > + pix_fmt->ycbcr_enc =3D frm->pix.ycbcr_enc; > + } > + /* disallow values not announced in vidioc_enum_fmt */ > + pix_fmt->colorspace =3D frm->pix.colorspace; > + pix_fmt->xfer_func =3D frm->pix.xfer_func; > + } > + > =C2=A0 fmt =3D rga_fmt_find(pix_fmt->pixelformat); > =C2=A0 if (!fmt) > =C2=A0 fmt =3D &formats[0]; > @@ -506,6 +532,17 @@ static int vidioc_s_fmt(struct file *file, void *pri= v, struct v4l2_format *f) > =C2=A0 frm->fmt =3D rga_fmt_find(pix_fmt->pixelformat); > =C2=A0 frm->stride =3D pix_fmt->plane_fmt[0].bytesperline; > =C2=A0 > + /* > + * Copy colorimetry from output to capture as required by the > + * v4l2-compliance tests > + */ > + if (V4L2_TYPE_IS_OUTPUT(f->type)) { > + ctx->out.pix.colorspace =3D pix_fmt->colorspace; > + ctx->out.pix.ycbcr_enc =3D pix_fmt->ycbcr_enc; > + ctx->out.pix.quantization =3D pix_fmt->quantization; > + ctx->out.pix.xfer_func =3D pix_fmt->xfer_func; > + } > + > =C2=A0 /* Reset crop settings */ > =C2=A0 frm->crop.left =3D 0; > =C2=A0 frm->crop.top =3D 0; --=-oe7RpPV93eR3PfJ/4+yO Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQTvDVKBFcTDwhoEbxLZQZRRKWBy9AUCab2HIAAKCRDZQZRRKWBy 9Px4AQChjkhhOucaVISHeRAYH5X7ODkjIye5JGejpkeHL63PSQEAk4KAcyPF14o8 SuHYOv4/KXqhuyvwujnnCWprB/iW7QE= =HbxP -----END PGP SIGNATURE----- --=-oe7RpPV93eR3PfJ/4+yO--