From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mout-p-102.mailbox.org (mout-p-102.mailbox.org [80.241.56.152]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 564DC306D26 for ; Sat, 3 Jan 2026 10:44:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=80.241.56.152 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767437059; cv=none; b=oxSWNKGVa3TavGfFhHVGrffF80pdQGG7VBfj3QsBtYeOfaKNZicDNFHsTgG62Q7KqB4TlVuknPpiYkvuNXqfW5zu4c77WDCyflFX6dEe2z5n2ogcGkuBYe0etQ5NVOVM4i8VcRnZWSeoSYvt36vgVubDzFfWJGlzMcu91G8lDVQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767437059; c=relaxed/simple; bh=Q490h70nD1q9mLKhZrcgkHWBp8ifCWlFiPf83Y6LE9o=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=RJwAIJWJBxDxT2418ZvNPcM9CsUVu5cD5r1zhmMnSx/cNxhQU4XxJzXnQ5/G4TSqgSctfmf6QioWUJds2OemaeabHjpj8+XKyAohbgvEEiOA+1TPLGpjH5kUx7aIjztPR0RUlj6dOOALuv/WirOPlqDw+JeBeHuV+xHx8yH4O0I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=mailbox.org; spf=pass smtp.mailfrom=mailbox.org; dkim=pass (2048-bit key) header.d=mailbox.org header.i=@mailbox.org header.b=fG6uFlDz; arc=none smtp.client-ip=80.241.56.152 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=mailbox.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mailbox.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=mailbox.org header.i=@mailbox.org header.b="fG6uFlDz" Received: from smtp102.mailbox.org (smtp102.mailbox.org [IPv6:2001:67c:2050:b231:465::102]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-102.mailbox.org (Postfix) with ESMTPS id 4djxy54Y1bz9v6q; Sat, 3 Jan 2026 11:44:13 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812; t=1767437053; 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=Q490h70nD1q9mLKhZrcgkHWBp8ifCWlFiPf83Y6LE9o=; b=fG6uFlDzocisagfyyAB0++nE5/QjrSCGtrUY/4snWl01tEjYQbzp5OCldcmUhS6ZzrULuS +BU6AvO6OpNWl58oKTFr505vxeprxzi2YLA9iT6OJ05ICk/kNvX2+RfgnnxP0dIhQMDtyd nFlJUn4CKrHwIyPBYEAqj/6YwA86HFbVnx0gqoWEwG53WQDIekjJ3igH6NAJk/1P2z3By9 Ie6sJiGKiU50msFt1OQXn+trHJBE7HcT0GBviV+5UAP52Wvc+QQkPlAiRNDgiI20tib1mA b1wFGw4KLaRVfbnJQdRG18eE8EivbCyPyBgZu0yngbBK1ZtosIgQgN05Qg6iVg== Message-ID: Subject: Re: [PATCH] gpu: nova-core: use stable name() method in Chipset Display impl From: Maurice Hieronymus To: Danilo Krummrich Cc: Alice Ryhl , Alexandre Courbot , David Airlie , Simona Vetter , nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Date: Sat, 03 Jan 2026 11:44:09 +0100 In-Reply-To: References: <20260101184137.80445-1-mhi@mailbox.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MBO-RS-ID: 5c8225c05414e845f56 X-MBO-RS-META: ms4ecxrcrreiq778guup4eppkrfkzd5b On Sat, 2026-01-03 at 10:52 +0100, Danilo Krummrich wrote: > On Thu Jan 1, 2026 at 7:41 PM CET, Maurice Hieronymus wrote: > > Chipset's Display was using Debug formatting ("{self:?}"), which is > > not > > guaranteed to be stable. Use the existing name() method instead, > > which > > provides stable lowercase strings suitable for firmware path > > generation. > >=20 > > Signed-off-by: Maurice Hieronymus > > --- > > =C2=A0drivers/gpu/nova-core/gpu.rs | 10 +--------- > > =C2=A01 file changed, 1 insertion(+), 9 deletions(-) > >=20 > > diff --git a/drivers/gpu/nova-core/gpu.rs b/drivers/gpu/nova- > > core/gpu.rs > > index 629c9d2dc994..be8c882338ea 100644 > > --- a/drivers/gpu/nova-core/gpu.rs > > +++ b/drivers/gpu/nova-core/gpu.rs > > @@ -107,17 +107,9 @@ pub(crate) fn arch(&self) -> Architecture { > > =C2=A0=C2=A0=C2=A0=C2=A0 } > > =C2=A0} > > =C2=A0 > > -// TODO > > -// > > -// The resulting strings are used to generate firmware paths, > > hence the > > -// generated strings have to be stable. > > -// > > -// Hence, replace with something like strum_macros > > derive(Display). > > -// > > -// For now, redirect to fmt::Debug for convenience. > > =C2=A0impl fmt::Display for Chipset { > > =C2=A0=C2=A0=C2=A0=C2=A0 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> f= mt::Result { > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 write!(f, "{self:?}") > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 write!(f, "{}", self.name()= ) > > =C2=A0=C2=A0=C2=A0=C2=A0 } > > =C2=A0} >=20 > This also converts the printed string to lowercase. While this is not > that big a > deal, the solution we are looking for instead is what the TODO > comment says: be > able to derive a Display implementation (for enums). >=20 > Now that we have syn in the kernel, this seems quite straight forward > to > implement. Are you interested in working on this instead? >=20 Definitely! The Display implementation should print the enum value as it is, without changing the case, correct? I will have a look into that and send a new patch set in the next few days. > Thanks, > Danilo