From patchwork Thu Feb 8 01:51:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Kaehlcke X-Patchwork-Id: 10206455 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E3AA46056E for ; Thu, 8 Feb 2018 01:51:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D630A2916A for ; Thu, 8 Feb 2018 01:51:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CAB2F2932E; Thu, 8 Feb 2018 01:51:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 66EA629325 for ; Thu, 8 Feb 2018 01:51:17 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5DF556E0DB; Thu, 8 Feb 2018 01:51:16 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pg0-f68.google.com (mail-pg0-f68.google.com [74.125.83.68]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6F16C6E0DB for ; Thu, 8 Feb 2018 01:51:15 +0000 (UTC) Received: by mail-pg0-f68.google.com with SMTP id g2so1062857pgn.7 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=JjzT6QWKECYJ9x3E9XcBmnU9EbWod9lF9m530j9azsUT3u4tzEorHBfFMgVaPpUIIo UcbJqZQRKCGaN4pQgC3g0pyF5cklYrXycZ+Zb+CteQqxxmlKCLwcF7rj7b+pK9qg6GyS u5zkn518rfrFjtlggaUdp+efRcPeiKK+uIFT7SYsiZg+tcfdRIuerauO7PbkBo5fNc07 Y8osnCRG78P9zlwyH3chthPiBdUUhZzjF4PJGql5jp1ibMDRGRsXH9sCS59Pvx4mD/wr JeXdWGgjnRedp6pEiKjTJSwLVHdU38iURR7z4ZvtANbsKCHLDYEA8b39n5xCr4cE0api 9aSg== X-Gm-Message-State: APf1xPD2acpyJZ+b7DJ0SlpA0SY7391+ZupLG8xcqV6piEl+QAjXHphR Il1ImYK4T/eRY+AC3KRx9d18Ag== X-Google-Smtp-Source: AH8x226tQG9cSrcep1WBenRAizisQ/fyON9UAIgNgre3solwi2o9lQnrubWi7WRXinBGt6K2CptlJw== 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 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> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Craig Bergstrom , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Justin TerAvest , Matthias Kaehlcke , amd-gfx@lists.freedesktop.org, Guenter Roeck MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 Reviewed-by: Guenter Roeck --- 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 \