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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D85C1C04A68 for ; Tue, 26 Jul 2022 14:40:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229757AbiGZOka (ORCPT ); Tue, 26 Jul 2022 10:40:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49572 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239346AbiGZOk3 (ORCPT ); Tue, 26 Jul 2022 10:40:29 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5A9556423 for ; Tue, 26 Jul 2022 07:40:28 -0700 (PDT) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id ED8121FEAA; Tue, 26 Jul 2022 14:40:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1658846426; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=eTmDdk3BCJXU66FNIOyDwXn3D4Z4E7It/BpD50zR37c=; b=slnjENGecyoF9cdEgc3AdMM/bgS3ZaMTCjuJhT/ATqsSIq8r2k+z9jerENWV2+GKZiz019 IydVJQpgTKEvbsa17clvsvC2q/L4NvNOwqgQQMgtpcrTLiiusoTKu3CofLq1DdztGY4bLt dpm80iIgIcQHtQLXGDZzjssGyaBIWPw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1658846426; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=eTmDdk3BCJXU66FNIOyDwXn3D4Z4E7It/BpD50zR37c=; b=+9jOMyM9GYJd8e7hl0Ul/rnbsYdkLNTVLbIlMof86f5aY6/bt7N77Vxg7HIHi07pzV74et uKa9ispc+GfyPZDA== Received: from kitsune.suse.cz (kitsune.suse.cz [10.100.12.127]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 45C7B2C141; Tue, 26 Jul 2022 14:40:25 +0000 (UTC) Date: Tue, 26 Jul 2022 16:40:24 +0200 From: Michal =?iso-8859-1?Q?Such=E1nek?= To: Javier Martinez Canillas Cc: Thomas Zimmermann , airlied@linux.ie, daniel@ffwll.ch, deller@gmx.de, maxime@cerno.tech, sam@ravnborg.org, mpe@ellerman.id.au, benh@kernel.crashing.org, paulus@samba.org, geert@linux-m68k.org, mark.cave-ayland@ilande.co.uk, linux-fbdev@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, dri-devel@lists.freedesktop.org Subject: Re: [PATCH v2 09/10] drm/ofdrm: Add per-model device function Message-ID: <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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7b1a2807-59c7-d524-af8e-1ec634c740a7@redhat.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org 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. Thanks Michal 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 03A36C00140 for ; Tue, 26 Jul 2022 14:41:19 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4Lsfjp3WGhz3c3L for ; Wed, 27 Jul 2022 00:41:18 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=slnjENGe; dkim=fail reason="signature verification failed" header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=+9jOMyM9; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=suse.de (client-ip=195.135.220.29; helo=smtp-out2.suse.de; envelope-from=msuchanek@suse.de; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=slnjENGe; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=+9jOMyM9; dkim-atps=neutral Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4Lsfj41GmBz3bZY for ; Wed, 27 Jul 2022 00:40:40 +1000 (AEST) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id ED8121FEAA; Tue, 26 Jul 2022 14:40:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1658846426; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=eTmDdk3BCJXU66FNIOyDwXn3D4Z4E7It/BpD50zR37c=; b=slnjENGecyoF9cdEgc3AdMM/bgS3ZaMTCjuJhT/ATqsSIq8r2k+z9jerENWV2+GKZiz019 IydVJQpgTKEvbsa17clvsvC2q/L4NvNOwqgQQMgtpcrTLiiusoTKu3CofLq1DdztGY4bLt dpm80iIgIcQHtQLXGDZzjssGyaBIWPw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1658846426; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=eTmDdk3BCJXU66FNIOyDwXn3D4Z4E7It/BpD50zR37c=; b=+9jOMyM9GYJd8e7hl0Ul/rnbsYdkLNTVLbIlMof86f5aY6/bt7N77Vxg7HIHi07pzV74et uKa9ispc+GfyPZDA== Received: from kitsune.suse.cz (kitsune.suse.cz [10.100.12.127]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 45C7B2C141; Tue, 26 Jul 2022 14:40:25 +0000 (UTC) Date: Tue, 26 Jul 2022 16:40:24 +0200 From: Michal =?iso-8859-1?Q?Such=E1nek?= To: Javier Martinez Canillas Subject: Re: [PATCH v2 09/10] drm/ofdrm: Add per-model device function Message-ID: <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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7b1a2807-59c7-d524-af8e-1ec634c740a7@redhat.com> User-Agent: Mutt/1.10.1 (2018-07-13) 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" 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. Thanks Michal 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 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 2B0EAC00140 for ; Tue, 26 Jul 2022 14:40:30 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6409B8F644; Tue, 26 Jul 2022 14:40:29 +0000 (UTC) Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by gabe.freedesktop.org (Postfix) with ESMTPS id 573068F69D for ; Tue, 26 Jul 2022 14:40:28 +0000 (UTC) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id ED8121FEAA; Tue, 26 Jul 2022 14:40:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1658846426; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=eTmDdk3BCJXU66FNIOyDwXn3D4Z4E7It/BpD50zR37c=; b=slnjENGecyoF9cdEgc3AdMM/bgS3ZaMTCjuJhT/ATqsSIq8r2k+z9jerENWV2+GKZiz019 IydVJQpgTKEvbsa17clvsvC2q/L4NvNOwqgQQMgtpcrTLiiusoTKu3CofLq1DdztGY4bLt dpm80iIgIcQHtQLXGDZzjssGyaBIWPw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1658846426; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=eTmDdk3BCJXU66FNIOyDwXn3D4Z4E7It/BpD50zR37c=; b=+9jOMyM9GYJd8e7hl0Ul/rnbsYdkLNTVLbIlMof86f5aY6/bt7N77Vxg7HIHi07pzV74et uKa9ispc+GfyPZDA== Received: from kitsune.suse.cz (kitsune.suse.cz [10.100.12.127]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 45C7B2C141; Tue, 26 Jul 2022 14:40:25 +0000 (UTC) Date: Tue, 26 Jul 2022 16:40:24 +0200 From: Michal =?iso-8859-1?Q?Such=E1nek?= To: Javier Martinez Canillas Subject: Re: [PATCH v2 09/10] drm/ofdrm: Add per-model device function Message-ID: <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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7b1a2807-59c7-d524-af8e-1ec634c740a7@redhat.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-fbdev@vger.kernel.org, Thomas Zimmermann , airlied@linux.ie, mpe@ellerman.id.au, 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, geert@linux-m68k.org, sam@ravnborg.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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. Thanks Michal