Received: by 10.223.176.5 with SMTP id f5csp1344657wra; Wed, 7 Feb 2018 17:52:17 -0800 (PST) X-Google-Smtp-Source: AH8x224odVOijJfbFgyl8wThdGZQ1z/UYNSLf40Y+d6TpDnY4+N/xtDDPDl4lFQv97qahzQRPqTr X-Received: by 10.98.213.198 with SMTP id d189mr7779238pfg.136.1518054737505; Wed, 07 Feb 2018 17:52:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518054737; cv=none; d=google.com; s=arc-20160816; b=D/yklzcTrLZnnEfLAVPhw2SSnsmNBkJOKzjksKIGpRZCH2+8YnJQCOwdl8YzFMecot MuDB89QaBKIU/aW6yd1Yly5pnqXtqC4opp4ryFAoJRSz5m4W7RwW+e6uqcXtzS+q5mRB qhbWKudIvPvCVMBSoSMAta+6KSu+NFIP1VyclmgrHbwJQUDKBksQe7RVH/JU5O9aa1Ae mwBrNqiqmPWAADVJpBagqF+6qrvEfBYyUD3WYIT+srqixeo7LbmY1IVboq1M2N/eDxWG YDAsrVV6o60pSFeuA3b44AfRT/vw7eVV0RUZZV6UOFVnDwx4A2/mh51GG4xNxeYsCXGo 3Tmw== 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=httj6leLYkGb7m9IuutrbE0renRPJk2S32ydJl/7ygc=; b=U2HKDvlcIz8/hwdffiPQ33Sxv44V1YGyl7c/sWJoecu87APi2Y7bSG8UEqL5zCxfLc jIw/cThzhWzoonTaO1Bi1bCNXVJDN9pQHpqVVVw85PNedYzY0XbQs2aieMxnn5LL+dPX tJENLW8ul25pPxORulrIlawVF2aBy6uy++X1iNbsoIgSoC3mqWbL+NeEqhSRpkgmJjdT N8Qfy2n/1FGI6tGwPPJANatv1I+F44yghlzy8pvNcHG/ES1806R5hK2q8Gg3JKkAjbsz p4ao/isbFujqyHyy+J0pOBJIAqkqapQ2Zqq4ZTPyTNS6LZUe7poIF5pmJR2Pxh5wYOot t4cQ== 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 33-v6si281043plg.793.2018.02.07.17.52.03; Wed, 07 Feb 2018 17:52:17 -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 S1752100AbeBHBvT (ORCPT + 99 others); Wed, 7 Feb 2018 20:51:19 -0500 Received: from mail-pg0-f68.google.com ([74.125.83.68]:46907 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752046AbeBHBvP (ORCPT ); Wed, 7 Feb 2018 20:51:15 -0500 Received: by mail-pg0-f68.google.com with SMTP id a11so1061512pgu.13 for ; Wed, 07 Feb 2018 17:51:15 -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=httj6leLYkGb7m9IuutrbE0renRPJk2S32ydJl/7ygc=; b=gNU4SjWfunVR3xckPfdgpfwfKUemchzDmb4ZOJAq7pTqXqqC/5u4d0Q3q9tF2NqRhT MDEy5vttpeNhwWszxj8INOv16k7DV0sSIs0LQ+ppJzJAfsjIf/9fw55/VWP+KBbNRVoR vMb9DOJ2c+lXwiKR6l8fcaLeNn4axbb8mXhYBShqY6a8YWo25U/vKZO7iv9A/m4cJa8S 6XwZd5oNRQTimQYwKI9kPMBjFlecK2FkMKL9O5IeWliPh/w7OJ2BtYhRIDBH2BkzANYf yZ6Bme9Hoc5f8eFQC9DuSkZXqm142OZHAQdO/lpzx6zW5730oIGe8n86P46Cq7Grv8fE B64Q== X-Gm-Message-State: APf1xPDx+Tg7/M3GHajRp4yzvPzzPN+jgPmwaGHgeVcCgVM4gxc3T6XC kUjU9e2BiL4jDu3/AuZwfXKk/A== X-Received: by 10.101.81.197 with SMTP id i5mr6554235pgq.220.1518054674555; Wed, 07 Feb 2018 17:51:14 -0800 (PST) Received: from mka.mtv.corp.google.com ([2620:0:1000:1600:5ff4:666d:2881:a60]) by smtp.gmail.com with ESMTPSA id k195sm5072205pgc.61.2018.02.07.17.51.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Feb 2018 17:51:13 -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 v2 2/2] amdgpu/dc/dml: Support clang option for stack alignment Date: Wed, 7 Feb 2018 17:51:03 -0800 Message-Id: <20180208015103.169603-2-mka@chromium.org> X-Mailer: git-send-email 2.16.0.rc1.238.g530d649a79-goog In-Reply-To: <20180208015103.169603-1-mka@chromium.org> References: <20180208015103.169603-1-mka@chromium.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org DML 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. Reported-by: Guenter Roeck Signed-off-by: Matthias Kaehlcke --- Changes in v2: - use consistent syntax and formatting for assignment of cc_stack_align drivers/gpu/drm/amd/display/dc/dml/Makefile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/display/dc/dml/Makefile b/drivers/gpu/drm/amd/display/dc/dml/Makefile index b8cadf833e71..a92189eddab0 100644 --- a/drivers/gpu/drm/amd/display/dc/dml/Makefile +++ b/drivers/gpu/drm/amd/display/dc/dml/Makefile @@ -24,7 +24,13 @@ # It provides the general basic services required by other DAL # subcomponents. -subdir-ccflags-y += -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 + +subdir-ccflags-y += -mhard-float -msse $(cc_stack_align) DML = display_mode_lib.o display_rq_dlg_calc.o \ display_rq_dlg_helpers.o dml1_display_rq_dlg_calc.o \ -- 2.16.0.rc1.238.g530d649a79-goog