From patchwork Thu Feb 8 20:53:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Kaehlcke X-Patchwork-Id: 10208023 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 16B6A60327 for ; Thu, 8 Feb 2018 20:53:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 076F9296A6 for ; Thu, 8 Feb 2018 20:53:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F05ED296A8; Thu, 8 Feb 2018 20:53:53 +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 B033F296A6 for ; Thu, 8 Feb 2018 20:53:53 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2A2A16E6AA; Thu, 8 Feb 2018 20:53:52 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pg0-f65.google.com (mail-pg0-f65.google.com [74.125.83.65]) by gabe.freedesktop.org (Postfix) with ESMTPS id E45786E6AA for ; Thu, 8 Feb 2018 20:53:50 +0000 (UTC) Received: by mail-pg0-f65.google.com with SMTP id j9so1581741pgp.11 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=CFYq5rZX8Kbqld8MIr+4czVvP+mNFfiKXrWmFLCZvmlpLFjxkfA2GPpUFhOXhcjM9I 6R71qkV3SjU8M9P1d87ZW4Rgfzmvw3hRptPfOcXeI7uWK9BHzcLFL9zQj+48L1X5d1k2 9YLxBRkqDg/LfZjHZPH/qvsxcYZob9d2GKE9pR4alee8R1TRO+pniKa5dnzPa446qEbV P0zHUgmWnSPpG3qqqzTJEVQyjt0SlIGMJIH1Vf8couzsrTQ3dsmVtM0TdisWxn8UPGNk nGA5FZ0a7l72+7dE4+RHJGV81M+dPCWRwRkMtvm2yekqaTH0rlefV/voARFo9LL+6dNv Au/w== X-Gm-Message-State: APf1xPBUPwwUsvhn3/D702SBLqw484WszipCU7MNdhz+fyv1U4OjrZdZ Mn9XfxDdQAyjcX9X/dz7M2sSgQ== X-Google-Smtp-Source: AH8x226/WRl0PT8rYbe+bnTkITVLnt7dT22uGEYR/v5x2B5NYNxozy06IpclAR40WcnBPgAto3sNyA== 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 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> 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 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 Reviewed-by: Harry Wentland --- 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)