From mboxrd@z Thu Jan 1 00:00:00 1970 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 lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (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 6D6E9C25B06 for ; Fri, 5 Aug 2022 00:29:27 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4LzRLG0kPXz3cD7 for ; Fri, 5 Aug 2022 10:29:26 +1000 (AEST) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=kernel.crashing.org (client-ip=63.228.1.57; helo=gate.crashing.org; envelope-from=benh@kernel.crashing.org; receiver=) Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by lists.ozlabs.org (Postfix) with ESMTP id 4LzRKp1PKMz2y2F for ; Fri, 5 Aug 2022 10:29:01 +1000 (AEST) Received: from ip6-localhost (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id 2750McTg009481; Thu, 4 Aug 2022 19:22:39 -0500 Message-ID: Subject: Re: [PATCH v2 09/10] drm/ofdrm: Add per-model device function From: Benjamin Herrenschmidt To: Michal =?ISO-8859-1?Q?Such=E1nek?= , Javier Martinez Canillas Date: Fri, 05 Aug 2022 10:22:38 +1000 In-Reply-To: <20220726144024.GP17705@kitsune.suse.cz> References: <20220720142732.32041-1-tzimmermann@suse.de> <20220720142732.32041-10-tzimmermann@suse.de> <7b1a2807-59c7-d524-af8e-1ec634c740a7@redhat.com> <20220726144024.GP17705@kitsune.suse.cz> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.5-0ubuntu1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-fbdev@vger.kernel.org, Thomas Zimmermann , airlied@linux.ie, deller@gmx.de, mark.cave-ayland@ilande.co.uk, linuxppc-dev@lists.ozlabs.org, dri-devel@lists.freedesktop.org, paulus@samba.org, maxime@cerno.tech, daniel@ffwll.ch, geert@linux-m68k.org, sam@ravnborg.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Tue, 2022-07-26 at 16:40 +0200, Michal Suchánek wrote: > Hello, > > On Tue, Jul 26, 2022 at 03:38:37PM +0200, Javier Martinez Canillas wrote: > > On 7/20/22 16:27, Thomas Zimmermann wrote: > > > Add a per-model device-function structure in preparation of adding > > > color-management support. Detection of the individual models has been > > > taken from fbdev's offb. > > > > > > Signed-off-by: Thomas Zimmermann > > > --- > > > > Reviewed-by: Javier Martinez Canillas > > > > [...] > > > > > +static bool is_avivo(__be32 vendor, __be32 device) > > > +{ > > > + /* This will match most R5xx */ > > > + return (vendor == 0x1002) && > > > + ((device >= 0x7100 && device < 0x7800) || (device >= 0x9400)); > > > +} > > > > Maybe add some constant macros to not have these magic numbers ? > > This is based on the existing fbdev implementation's magic numbers: > > drivers/video/fbdev/offb.c: ((*did >= 0x7100 && *did < 0x7800) || > > Of course, it would be great if somebody knowledgeable could clarify > those. I don't think anybody remembers :-) Vendor 0x1002 is PCI_VENDOR_ID_ATI, but the rest is basically ranges of PCI IDs for which we don't have symbolic constants. Cheers, Ben.