Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5739618rdb; Wed, 13 Dec 2023 19:26:06 -0800 (PST) X-Google-Smtp-Source: AGHT+IFmRvk0jEANkh8d5LB2AZ8JuamGk+XUWbGYFIJb8jiT8gNxmdWu3yTeGP/haKrP26fid9fd X-Received: by 2002:a9d:6d02:0:b0:6d8:119d:a0a8 with SMTP id o2-20020a9d6d02000000b006d8119da0a8mr10357682otp.13.1702524363775; Wed, 13 Dec 2023 19:26:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702524363; cv=none; d=google.com; s=arc-20160816; b=R2Lg4KOdioHaUDQyF2ufVtKTMxZJ3ybUI7Kg1XT3HdGAv3LZDsMzU5b1A3sCsQgaa1 PigR/4ePXcuXQpHmarEZHiUDYpCOZkovfcwpn8E+kxktA+xPwfl4uH6nnc/8IC3nWiqr I93we8iPAeYXvfF+bjBJoNteNtC3fatHDs+4CAP/yimjB+4Ttt/+exOoxOtssiOBjLGD OpxnAbflzLWy/8Lt32rnHILj2yBKQhlBRwuGRG8z+GYXoBdzOOXFq7RCFMKendLAQU0d epHs0Wdc2+gHqUWB/wdLxnVmauBJyXFWmgfMzVbH+TVNVqjwILZV3TsUvIx8cu9H24O4 6KFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:thread-index:thread-topic :content-transfer-encoding:mime-version:subject:references :in-reply-to:message-id:cc:to:from:date:dkim-signature:dkim-filter; bh=ijcDfjdAHPSkgI60gYNqmpLjOskbQcDua+7+LnRVJzY=; fh=a2gmKGddxQYxIkpviE932GXDG39PW07uTn6xD6sKRfQ=; b=06fSam+dxbTnS6fXCg/4dHGO/b2SI5bODnoY3A5O/PJi7kgJD+yR8ZMtqojb9XzqlC b84Qq+AYN9phKJ5ZO+muJooa3UX+JdjmDra+VaKbNO2qOBPV4Psi8KATI4QGvmtPJjZd iIyi6TdM24aVbNqpSB9oUImuMvlNI0Lu6jha6avr+d333cCDzDR4RmrFkOmlWRD2zmeP eSKAVaP5z77HIot14oLenORNqjS75j7Mkvn2ArcWqkSo+a9fFTOdiLAeSx9J/oJaMS7r SCh55983t+MXxZmMgGkeXkswJihN0Kw7dS9oCQgvXYLP0TqeM/z8VTqtVZS+k/QIBfq/ g8/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@raptorengineering.com header.s=B8E824E6-0BE2-11E6-931D-288C65937AAD header.b=JmklQYzW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=raptorengineering.com Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id c37-20020a634e25000000b005c682e0ced3si10593982pgb.97.2023.12.13.19.26.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 19:26:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@raptorengineering.com header.s=B8E824E6-0BE2-11E6-931D-288C65937AAD header.b=JmklQYzW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=raptorengineering.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id A6987808693F; Wed, 13 Dec 2023 19:25:25 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230034AbjLNDVQ (ORCPT + 99 others); Wed, 13 Dec 2023 22:21:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229525AbjLNDVQ (ORCPT ); Wed, 13 Dec 2023 22:21:16 -0500 X-Greylist: delayed 493 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Wed, 13 Dec 2023 19:21:21 PST Received: from raptorengineering.com (mail.raptorengineering.com [23.155.224.40]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BBABC85; Wed, 13 Dec 2023 19:21:21 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by mail.rptsys.com (Postfix) with ESMTP id 454B78285335; Wed, 13 Dec 2023 21:13:07 -0600 (CST) Received: from mail.rptsys.com ([127.0.0.1]) by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id aJF90hcXi7Us; Wed, 13 Dec 2023 21:13:03 -0600 (CST) Received: from localhost (localhost [127.0.0.1]) by mail.rptsys.com (Postfix) with ESMTP id C3CB28285337; Wed, 13 Dec 2023 21:13:03 -0600 (CST) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.rptsys.com C3CB28285337 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raptorengineering.com; s=B8E824E6-0BE2-11E6-931D-288C65937AAD; t=1702523583; bh=ijcDfjdAHPSkgI60gYNqmpLjOskbQcDua+7+LnRVJzY=; h=Date:From:To:Message-ID:MIME-Version; b=JmklQYzWjHfnhGBk0Pue29Qiptfb7YADfyXDqn0JfVXKwGNbTbAmFZG3wiYCyMqNe rfAr7pp8jfi9zjR0+vw1Pgwi+/hhDR84MDQViA6vnu/RRW42LYFNMaBEOFkaxVqHPr jfugf/dzymBNIbcy+lefHFKr3DOfOjzhVf3hA9Vw= X-Virus-Scanned: amavisd-new at rptsys.com Received: from mail.rptsys.com ([127.0.0.1]) by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id vndKCEKQZBqx; Wed, 13 Dec 2023 21:13:03 -0600 (CST) Received: from vali.starlink.edu (localhost [127.0.0.1]) by mail.rptsys.com (Postfix) with ESMTP id 90B9D8285335; Wed, 13 Dec 2023 21:13:03 -0600 (CST) Date: Wed, 13 Dec 2023 21:13:01 -0600 (CST) From: Timothy Pearson To: Samuel Holland Cc: Michael Ellerman , linux-kernel , amd-gfx , linux-arch , linux-arm-kernel , loongarch@lists.linux.dev, linuxppc-dev , x86 , linux-riscv@lists.infradead.org, Christoph Hellwig , Timothy Pearson Message-ID: <1124363169.403562.1702523581672.JavaMail.zimbra@raptorengineeringinc.com> In-Reply-To: <7ed20fcf-8a9d-40d5-b913-b5d2da443cd6@sifive.com> References: <20231208055501.2916202-1-samuel.holland@sifive.com> <20231208055501.2916202-11-samuel.holland@sifive.com> <87h6kpdj20.fsf@mail.lhotse> <7ed20fcf-8a9d-40d5-b913-b5d2da443cd6@sifive.com> Subject: Re: [RFC PATCH 10/12] drm/amd/display: Use ARCH_HAS_KERNEL_FPU_SUPPORT MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Mailer: Zimbra 8.5.0_GA_3042 (ZimbraWebClient - GC112 (Linux)/8.5.0_GA_3042) Thread-Topic: drm/amd/display: Use ARCH_HAS_KERNEL_FPU_SUPPORT Thread-Index: 3gIP2WGRdA0OkYkVtH266e032Oz33A== X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Wed, 13 Dec 2023 19:25:25 -0800 (PST) ----- Original Message ----- > From: "Samuel Holland" > To: "Michael Ellerman" > Cc: "linux-kernel" , "amd-gfx" , "linux-arch" > , "linux-arm-kernel" , loongarch@lists.linux.dev, > "linuxppc-dev" , "x86" , linux-riscv@lists.infradead.org, "Christoph > Hellwig" , "Timothy Pearson" > Sent: Wednesday, December 13, 2023 7:03:20 PM > Subject: Re: [RFC PATCH 10/12] drm/amd/display: Use ARCH_HAS_KERNEL_FPU_SUPPORT > On 2023-12-11 6:23 AM, Michael Ellerman wrote: >> Hi Samuel, >> >> Thanks for trying to clean all this up. >> >> One problem below. >> >> Samuel Holland writes: >>> Now that all previously-supported architectures select >>> ARCH_HAS_KERNEL_FPU_SUPPORT, this code can depend on that symbol instead >>> of the existing list of architectures. It can also take advantage of the >>> common kernel-mode FPU API and method of adjusting CFLAGS. >>> >>> Signed-off-by: Samuel Holland >> ... >>> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/dc_fpu.c >>> b/drivers/gpu/drm/amd/display/amdgpu_dm/dc_fpu.c >>> index 4ae4720535a5..b64f917174ca 100644 >>> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/dc_fpu.c >>> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/dc_fpu.c >>> @@ -87,20 +78,9 @@ void dc_fpu_begin(const char *function_name, const int line) >>> WARN_ON_ONCE(!in_task()); >>> preempt_disable(); >>> depth = __this_cpu_inc_return(fpu_recursion_depth); >>> - >>> if (depth == 1) { >>> -#if defined(CONFIG_X86) || defined(CONFIG_LOONGARCH) >>> + BUG_ON(!kernel_fpu_available()); >>> kernel_fpu_begin(); >>> -#elif defined(CONFIG_PPC64) >>> - if (cpu_has_feature(CPU_FTR_VSX_COMP)) >>> - enable_kernel_vsx(); >>> - else if (cpu_has_feature(CPU_FTR_ALTIVEC_COMP)) >>> - enable_kernel_altivec(); >> >> Note altivec. >> >>> - else if (!cpu_has_feature(CPU_FTR_FPU_UNAVAILABLE)) >>> - enable_kernel_fp(); >>> -#elif defined(CONFIG_ARM64) >>> - kernel_neon_begin(); >>> -#endif >>> } >>> >>> TRACE_DCN_FPU(true, function_name, line, depth); >>> diff --git a/drivers/gpu/drm/amd/display/dc/dml/Makefile >>> b/drivers/gpu/drm/amd/display/dc/dml/Makefile >>> index ea7d60f9a9b4..5aad0f572ba3 100644 >>> --- a/drivers/gpu/drm/amd/display/dc/dml/Makefile >>> +++ b/drivers/gpu/drm/amd/display/dc/dml/Makefile >>> @@ -25,40 +25,8 @@ >>> # It provides the general basic services required by other DAL >>> # subcomponents. >>> >>> -ifdef CONFIG_X86 >>> -dml_ccflags-$(CONFIG_CC_IS_GCC) := -mhard-float >>> -dml_ccflags := $(dml_ccflags-y) -msse >>> -endif >>> - >>> -ifdef CONFIG_PPC64 >>> -dml_ccflags := -mhard-float -maltivec >>> -endif >> >> And altivec is enabled in the flags there. >> >> That doesn't match your implementation for powerpc in patch 7, which >> only deals with float. >> >> I suspect the AMD driver actually doesn't need altivec enabled, but I >> don't know that for sure. It compiles without it, but I don't have a GPU >> to actually test. I've added Timothy on Cc who added the support for >> powerpc to the driver originally, hopefully he has a test system. If you would like me to test I'm happy to do so, but I am travelling until Friday so would need to wait until then. Thanks!