Received: by 10.223.176.5 with SMTP id f5csp2369930wra; Thu, 8 Feb 2018 12:55:24 -0800 (PST) X-Google-Smtp-Source: AH8x22519iL3N8VTBy3Q0HvipDUitInOS9toRAb3ByVHmKKGSQGesKw0dIW44Ibl2q+ahthUbrlI X-Received: by 10.98.105.199 with SMTP id e190mr354472pfc.70.1518123324263; Thu, 08 Feb 2018 12:55:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518123324; cv=none; d=google.com; s=arc-20160816; b=RlP0YQs06OGN7//wIBH4oQmyiIwQQeaMJvFGvnxCVZjendWQgGKWCFrADHzMkwKcCF VNuI1uQW98mxlVBRkIyXTjKKuqDlr6m4ytkaQHjHTfzv/cLvSUVLPrMYR1Qk+Ma+GgYG aKSIko0FMjbiMm5u9DDL/WHUrJ0bJEnVTTx5ncPm2q1AqHDkN2DWtKeRvW3fnCV/vyPy WoHJXrd11TKfCp0MdKP0My6pAECLE8Ny1o9R3PCGlRvrkt4aL2AhpXYr1rTHob15gX25 HxxtC7UY8oiZlTd9Ukz3QB9SdiZK++fZRXJHLZyOxWXv8emGU3zdtjAlefVA5lbw2IBs F9vA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=LEWJDvkBt71Eyxb5cnqxRZTSr4qz6pa5UaIBdxiXLCw=; b=QupCXNFTbFaHmghvIqzTXCCuKKlDOUqT2RcXH0TmESCqOeniUwR+alMbdFibRm2VB5 Nh6Or44dQcniJCEF9VXxHA/VDcv1vGiYCXtWxg7765zDstwT8hIe7bvpd88N3lUrdShR VTZ8RhCKQloam2VEu3e20Zqp8dn9zeRV2du8dYnm6cBUgtrK8wsGx+4ae8c4KV0l01uO MvqEQ7IM0HeVGOgmjjsC77aNGggYdw2hdeFEsFaIPlZ1lKXf+QzFhDdZADYYfFRNX2H2 jk4qhdRla4jtp0PkBrgXgjjFDHJXRqxek8K2EV0BoduCQtVKR9hkGt/GQED8NcVF57rr VOtQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g5si407482pgo.780.2018.02.08.12.55.09; Thu, 08 Feb 2018 12:55:24 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752508AbeBHUyH (ORCPT + 99 others); Thu, 8 Feb 2018 15:54:07 -0500 Received: from mail-pg0-f68.google.com ([74.125.83.68]:38252 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752464AbeBHUxv (ORCPT ); Thu, 8 Feb 2018 15:53:51 -0500 Received: by mail-pg0-f68.google.com with SMTP id l18so2140841pgc.5 for ; Thu, 08 Feb 2018 12:53:50 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=LEWJDvkBt71Eyxb5cnqxRZTSr4qz6pa5UaIBdxiXLCw=; b=ZGyih9RkQIyailGXepVlZ7rFwjFLnR+0mfkBK03hQnnEE0fIpg9EcshW2ErmQZoiPf dVUqVzGkwOMnbzPcIPNcM2WDdQRrTEWv65EGm8JlKSEhii2pssuAiQNjdPDIggIeikOF KaPyKgOQ1fKYm6+v1VQXJAhnEWgs6eoR3Dmp393oD7TomT9ruGYg2wtGltzoRXp899oC cxfimT+3V9hksua/Q4bPaYkMWyEdKvJC3XydrEa8QMzQyi17MI0nooGV24PHGkj6v6qC oGITN5rh+Ej3IaTknm6md/PoPUZwQZNQpsZ9ZhgHV9WkPMmht0RrrkmL4AC+nx4tzKbk sKyQ== X-Gm-Message-State: APf1xPBRHHI2lgQtUYALxBZmPPHZr9NyJOJHbu0LrME7elvHeCQMZyFl 9mg+soDWnu5bkuGJkdZ4PDhcvw== X-Received: by 10.99.50.66 with SMTP id y63mr359171pgy.157.1518123230320; Thu, 08 Feb 2018 12:53:50 -0800 (PST) Received: from mka.mtv.corp.google.com ([2620:0:1000:1600:5ff4:666d:2881:a60]) by smtp.gmail.com with ESMTPSA id 205sm33094pfw.77.2018.02.08.12.53.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Feb 2018 12:53:49 -0800 (PST) From: Matthias Kaehlcke To: Alex Deucher , =?UTF-8?q?Christian=20K=C3=B6nig?= , David Zhou , David Airlie , Harry Wentland , Felix Kuehling , Dmytro Laktyushkin Cc: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Guenter Roeck , Justin TerAvest , Craig Bergstrom , Matthias Kaehlcke Subject: [PATCH v3 4/4] amdgpu/dc/calcs: Support clang option for stack alignment Date: Thu, 8 Feb 2018 12:53:16 -0800 Message-Id: <20180208205316.93330-4-mka@chromium.org> X-Mailer: git-send-email 2.16.0.rc1.238.g530d649a79-goog In-Reply-To: <20180208205316.93330-1-mka@chromium.org> References: <20180208205316.93330-1-mka@chromium.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org calcs uses the compiler option -mpreferred-stack-boundary=4 to configure a stack alignment of 16 bytes. Clang uses the option -mstack-alignment instead, which expects as parameter the alignment in bytes, and not a power of two like -mpreferred-stack-boundary. Probe for both compiler options and use the correct one, similar to what is done in arch/x86/Makefile. Signed-off-by: Matthias Kaehlcke --- Changes in v3: - patch added Note to self: if this patterns proliferates further we probably want to put the evaluation of the correct compiler flag in some common place. drivers/gpu/drm/amd/display/dc/calcs/Makefile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/display/dc/calcs/Makefile b/drivers/gpu/drm/amd/display/dc/calcs/Makefile index af0f452f3c9f..95f332ee3e7e 100644 --- a/drivers/gpu/drm/amd/display/dc/calcs/Makefile +++ b/drivers/gpu/drm/amd/display/dc/calcs/Makefile @@ -24,7 +24,13 @@ # It calculates Bandwidth and Watermarks values for HW programming # -calcs_ccflags := -mhard-float -msse -mpreferred-stack-boundary=4 +ifneq ($(call cc-option, -mpreferred-stack-boundary=4),) + cc_stack_align := -mpreferred-stack-boundary=4 +else ifneq ($(call cc-option, -mstack-alignment=16),) + cc_stack_align := -mstack-alignment=16 +endif + +calcs_ccflags := -mhard-float -msse $(cc_stack_align) CFLAGS_dcn_calcs.o := $(calcs_ccflags) CFLAGS_dcn_calc_auto.o := $(calcs_ccflags) -- 2.16.0.rc1.238.g530d649a79-goog