Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1837BCA0EEB for ; Tue, 19 Aug 2025 15:15:35 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 93C8810E206; Tue, 19 Aug 2025 15:15:34 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="dNS3n9qB"; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4D19B10E206 for ; Tue, 19 Aug 2025 15:15:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1755616532; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=urdHsObaOG1jXX610/w2zRrgWA6yWvXip6MOdg1GGfA=; b=dNS3n9qBIMspx1/1nBlXytv0S6Tt8WtmHdSiuR3aYDbzIca+lgJoA4uoPWxHn4QE8r4NON JMbCqjIXpIbK1IbSmbEyyLsSXNmjlLKEmP3URizj8bM69QqN8yilgT5EeusqyTo+Z2soTS SABDj40J/oj0vFKhVqnbE0ujk7Kf+oY= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-547-_jI_wXpxOvq6L2PPYzYAZA-1; Tue, 19 Aug 2025 11:15:31 -0400 X-MC-Unique: _jI_wXpxOvq6L2PPYzYAZA-1 X-Mimecast-MFC-AGG-ID: _jI_wXpxOvq6L2PPYzYAZA_1755616529 Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-3b9e41475edso3846512f8f.2 for ; Tue, 19 Aug 2025 08:15:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755616528; x=1756221328; h=in-reply-to:references:to:from:subject:cc:message-id:date :content-transfer-encoding:mime-version:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=Qd6/RQ1WG+Wmnc4LLsuUrv6AI8lT/mvMMHnCxjiHteY=; b=UOGvKIT+xXs5z0diCU28R7ePm/J0i17UrmnoyoKtWYSwfs8yudq9h4Z1B85aqDdNMr pK1FVtFOEPIn497nMuyskkIEQGucM84VjcUVaZedeMeZc+Iz5dMF10a4fyjG6Za2u+RH IZb6yfnh1hzoR3yivXT0CpUAqhV3EY+tGC9l2b0Q9XbpR8+dEiLXmU5AyIZP1f8sgffD VZAZpJOFAq6m96CIAcWYNaiTGHsjfaAPz+hJk34p2Ff7rRPQJk+mFzo7xOBq5YpDqjKi uJ0rTGkqYkCs/CXcG1/EtcgLMIAxzHAIcxZWvhwFzx2GrZC9N3G7YGqe0sRf1nTTxuaJ TxCg== X-Forwarded-Encrypted: i=1; AJvYcCVhycqX8CoU9F+2ah2Ym5S3lgWxajyLSFoR1XYalukVYC8FqNtIen8sEdMKWwpSDaitTtasXBsu@lists.freedesktop.org X-Gm-Message-State: AOJu0YzIpbRjCZUKb3HBJPkfsq9HrfIrGK4NA/s5dajaMsxcPMQB7frb k3fHI8EgNBHaPPUkXX6pFt4DElzZAEE1Anu/d1KAY5rOPG5hJBMVJcVluCLrImndfeYNhgWUdyQ A7Buzfw+xGY7ud4iz+UKINGiUEqI+w+3hEXJjxSw8X1BshAelUr/1fga78aR6z+Zb3Ki6WuJMxu /SU2cG X-Gm-Gg: ASbGncveizRlIt0BSJ+3Pl+f6BidfZs14XMg0PcFZS/aG5DsM7vACrBjhoS2J9LgbB1 naJ28ikniWyRFxWv9jQDqeLGkmlQsF23hQ3kAb1OhPQ2crxFEHmZiekZVNIXpeHaAgRVNE5doLT sNNMnI+bModCEYsNjAAjfdgWGu5rK1kU95u/5vybml9nYugCy1ovQlifEJ4VlgvOZb48QipESYC 62tIq6xDNEY15MXtUlC92GLUbItIiYf1gHcj9+mULg/A0fWRigImW3P8W8RM4bS/WG2CpYzZMav ItF+AAq+Fp4KwKVJjb2wEnQ/o7tMTyhtmiMQIAfyrw8zrQ== X-Received: by 2002:a05:6000:2481:b0:3b7:8c98:2f4c with SMTP id ffacd0b85a97d-3c0ecc3220fmr2136745f8f.33.1755616528361; Tue, 19 Aug 2025 08:15:28 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGXgoHOcG7SErbazMSNgqLyfCjntf4p02QTg/yNpblkgOV2M1ujm0obFgPSzikT/gDFxwYADg== X-Received: by 2002:a05:6000:2481:b0:3b7:8c98:2f4c with SMTP id ffacd0b85a97d-3c0ecc3220fmr2136708f8f.33.1755616527801; Tue, 19 Aug 2025 08:15:27 -0700 (PDT) Received: from localhost ([2001:9e8:8986:8500:d724:cc1e:d6eb:bc50]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3c077789d2esm4063774f8f.55.2025.08.19.08.15.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 19 Aug 2025 08:15:27 -0700 (PDT) Mime-Version: 1.0 Date: Tue, 19 Aug 2025 17:15:26 +0200 Message-Id: Cc: , , , , , , , , , , , , , , , , , , , , , , , , , , , "Daniel Stone" Subject: Re: [PATCH V11 07/47] drm/colorop: Add BYPASS property From: "Sebastian Wick" To: "Alex Hung" , , X-Mailer: aerc 0.20.1 References: <20250815035047.3319284-1-alex.hung@amd.com> <20250815035047.3319284-8-alex.hung@amd.com> In-Reply-To: <20250815035047.3319284-8-alex.hung@amd.com> X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: JG7dVq5IvkiYHItheJWOXVOmXRjopx2KfiWboqJ3ZH4_1755616529 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 X-BeenThere: amd-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion list for AMD gfx List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: amd-gfx-bounces@lists.freedesktop.org Sender: "amd-gfx" On Fri Aug 15, 2025 at 5:49 AM CEST, Alex Hung wrote: > From: Harry Wentland > > We want to be able to bypass each colorop at all times. > Introduce a new BYPASS boolean property for this. > > Reviewed-by: Simon Ser > Reviewed-by: Louis Chauvet > Signed-off-by: Alex Hung > Signed-off-by: Harry Wentland > Reviewed-by: Daniel Stone > Reviewed-by: Melissa Wen > --- > v6: > - clarify that bypass is only valid if BYPASS prop exists (Louis Chauvet= ) > > drivers/gpu/drm/drm_atomic_uapi.c | 6 +++++- > drivers/gpu/drm/drm_colorop.c | 15 +++++++++++++++ > include/drm/drm_colorop.h | 22 ++++++++++++++++++++++ > 3 files changed, 42 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/drm_atomic_uapi.c b/drivers/gpu/drm/drm_atom= ic_uapi.c > index 52b5a9b5523e..44665efbef55 100644 > --- a/drivers/gpu/drm/drm_atomic_uapi.c > +++ b/drivers/gpu/drm/drm_atomic_uapi.c > @@ -650,7 +650,9 @@ static int drm_atomic_colorop_set_property(struct drm= _colorop *colorop, > =09=09struct drm_colorop_state *state, struct drm_file *file_priv, > =09=09struct drm_property *property, uint64_t val) > { > -=09if (property =3D=3D colorop->curve_1d_type_property) { > +=09if (property =3D=3D colorop->bypass_property) { > +=09=09state->bypass =3D val; > +=09} else if (property =3D=3D colorop->curve_1d_type_property) { > =09=09state->curve_1d_type =3D val; > =09} else { > =09=09drm_dbg_atomic(colorop->dev, > @@ -670,6 +672,8 @@ drm_atomic_colorop_get_property(struct drm_colorop *c= olorop, > { > =09if (property =3D=3D colorop->type_property) { > =09=09*val =3D colorop->type; > +=09} else if (property =3D=3D colorop->bypass_property) { > +=09=09*val =3D state->bypass; > =09} else if (property =3D=3D colorop->curve_1d_type_property) { > =09=09*val =3D state->curve_1d_type; > =09} else { > diff --git a/drivers/gpu/drm/drm_colorop.c b/drivers/gpu/drm/drm_colorop.= c > index 6fbc3c284d33..11c37916c758 100644 > --- a/drivers/gpu/drm/drm_colorop.c > +++ b/drivers/gpu/drm/drm_colorop.c > @@ -79,6 +79,17 @@ static int drm_plane_colorop_init(struct drm_device *d= ev, struct drm_colorop *co > =09=09=09=09 colorop->type_property, > =09=09=09=09 colorop->type); > =20 > +=09/* bypass */ > +=09prop =3D drm_property_create_bool(dev, DRM_MODE_PROP_ATOMIC, > +=09=09=09=09=09"BYPASS"); > +=09if (!prop) > +=09=09return -ENOMEM; > + > +=09colorop->bypass_property =3D prop; > +=09drm_object_attach_property(&colorop->base, > +=09=09=09=09 colorop->bypass_property, > +=09=09=09=09 1); > + > =09return ret; > } > =20 > @@ -136,6 +147,7 @@ int drm_plane_colorop_curve_1d_init(struct drm_device= *dev, struct drm_colorop * > =09/* initialize 1D curve only attribute */ > =09prop =3D drm_property_create_enum(dev, DRM_MODE_PROP_ATOMIC, "CURVE_1= D_TYPE", > =09=09=09=09=09enum_list, len); > + > =09if (!prop) > =09=09return -ENOMEM; > =20 > @@ -152,6 +164,8 @@ static void __drm_atomic_helper_colorop_duplicate_sta= te(struct drm_colorop *colo > =09=09=09=09=09=09=09struct drm_colorop_state *state) > { > =09memcpy(state, colorop->state, sizeof(*state)); > + > +=09state->bypass =3D true; > } > =20 > struct drm_colorop_state * > @@ -190,6 +204,7 @@ static void __drm_colorop_state_reset(struct drm_colo= rop_state *colorop_state, > =09u64 val; > =20 > =09colorop_state->colorop =3D colorop; > +=09colorop_state->bypass =3D true; > =20 > =09if (colorop->curve_1d_type_property) { > =09=09drm_object_property_get_default_value(&colorop->base, > diff --git a/include/drm/drm_colorop.h b/include/drm/drm_colorop.h > index fa167e642e0d..49e6564c17ba 100644 > --- a/include/drm/drm_colorop.h > +++ b/include/drm/drm_colorop.h > @@ -82,6 +82,16 @@ struct drm_colorop_state { > =09 * information. > =09 */ > =20 > + > +=09/** > +=09 * @bypass: > +=09 * > +=09 * When the property BYPASS exists on this colorop, this stores > +=09 * the requested bypass state: true if colorop shall be bypassed, > +=09 * false if colorop is enabled. > +=09 */ > +=09bool bypass; > + > =09/** > =09 * @curve_1d_type: > =09 * > @@ -171,6 +181,18 @@ struct drm_colorop { > =09 */ > =09struct drm_property *type_property; > =20 > +=09/** > +=09 * @bypass_property: > +=09 * > +=09 * Boolean property to control enablement of the color > +=09 * operation. Setting bypass to "true" shall always be supported This doesn't actually seem to be the case when the patches later in the series are to be believed. Somewhere else it says The BYPASS property is not mandatory for a colorop, as long as the entire pipeline can get bypassed by setting the COLOR_PIPELINE on a plane to '0'. and later there is a "drm/colorop: allow non-bypass colorops" patch. So I'm pretty sure this instance here should be adjusted. > +=09 * in order to allow compositors to quickly fall back to > +=09 * alternate methods of color processing. This is important > +=09 * since setting color operations can fail due to unique > +=09 * HW constraints. > +=09 */ > +=09struct drm_property *bypass_property; > + > =09/** > =09 * @curve_1d_type_property: > =09 *