From patchwork Thu Feb 8 01:21:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Kaehlcke X-Patchwork-Id: 10206401 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 7FD08601BE for ; Thu, 8 Feb 2018 01:22:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6F271286C8 for ; Thu, 8 Feb 2018 01:22:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6263D291BA; Thu, 8 Feb 2018 01:22:12 +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 24879286C8 for ; Thu, 8 Feb 2018 01:22:12 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BF7586E21F; Thu, 8 Feb 2018 01:22:10 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-io0-f194.google.com (mail-io0-f194.google.com [209.85.223.194]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3A79B6E21F for ; Thu, 8 Feb 2018 01:22:10 +0000 (UTC) Received: by mail-io0-f194.google.com with SMTP id c17so4101779iod.1 for ; Wed, 07 Feb 2018 17:22:10 -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=3gxRx4aPVmTDaH5C8dPB+WnAmhBIYUCKjP0DmdAc0iA=; b=WUHoaoG6VKjlhvJtNjjMjeVQl8CxJCB2209TQFKcqbwt0vA1+QE6b23lsHVZULfv2X cWnNscoGeNiGIe1ASUCIh48+5kRTjYNKIKDa9JVYPyd1AFLZBAue8Oj57nIJ1nLVJtfM CY2Q/wY/HCuEdefDIpbhjnUT/5GTbcVxIn5gCVb/+Uc2wfVIzmdcx/EQKQvLABJ1DvXA pnPC3o7Pf0iFbcPxE9C1Fq+FStmmLtCd5Qx4+hWadLrYjyjMGyaMV8rMyPEi2FuE7vXI W4yB3mKaaniM2DsodTAt9tlAPVC0tk7JgPKn3MxJNyWKofSwc5HDKGzNdMS6vw9liMWR WP2A== X-Gm-Message-State: APf1xPBRYyuqzNa8B/PeVSr7WEEQLM0D0sdVJ5lvC16gZ+buCMJpAklI XEuYttJ32D0y5zX6Rq3tMii/9A== X-Google-Smtp-Source: AH8x225gxRrIcEKFgygxM9qQH7v3rRlGNw9CtN8c1Y7N1zFiuhqYz3PpXg9xggeR06oMwC+f+RnGJg== X-Received: by 10.107.19.9 with SMTP id b9mr10369100ioj.251.1518052929032; Wed, 07 Feb 2018 17:22:09 -0800 (PST) Received: from mka.mtv.corp.google.com ([2620:0:1000:1600:5ff4:666d:2881:a60]) by smtp.gmail.com with ESMTPSA id b69sm2848311ioa.65.2018.02.07.17.22.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Feb 2018 17:22:08 -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 2/2] amdgpu/dc/dml: Support clang option for stack alignment Date: Wed, 7 Feb 2018 17:21:56 -0800 Message-Id: <20180208012156.165934-2-mka@chromium.org> X-Mailer: git-send-email 2.16.0.rc1.238.g530d649a79-goog In-Reply-To: <20180208012156.165934-1-mka@chromium.org> References: <20180208012156.165934-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 --- 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..740975931d21 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 \