Received: by 10.223.176.5 with SMTP id f5csp1354726wra; Wed, 7 Feb 2018 18:05:38 -0800 (PST) X-Google-Smtp-Source: AH8x2254xiqHbkyMSDy65xDFlGGMinko1lvhyxNlve/iPWE3k4fM7H/NSu/Vl9il7XyQ2/spcTl+ X-Received: by 2002:a17:902:7b8f:: with SMTP id w15-v6mr8142343pll.219.1518055538595; Wed, 07 Feb 2018 18:05:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518055538; cv=none; d=google.com; s=arc-20160816; b=EZZRgT1CUlZuHFwjo6sC0YwdQoNUvnnFxU7SWwGPCDwV6HpDVqqwOP3tAEz2Y6JDKl /XjLjRRdOCAWxNeoMxJuPGUJDjyehxHn+sWpvtDxDaxbYvNbJKNI5HvhY6oBFg720bBs xhaZ27QX/v8XM+Ea2J/j2WUB5jARjyDf95P5cv70Zb2Dkigv/f86M1TTZv6jfkQ1mkai 5sFUDycB6Aoa3mS2Q0Xg/YtSQxZJj6n5gTQQHcA6oc9RJflkJNUUHXdqih0H3UYcM+lh gABgOKvJkq0HvKaMKddqlxbzQhBIrWn+8lb8nas8/vZVoJZOiuBCV2fzpOIjmnUruYV0 E/4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=9Ip1BNROOdugha3Mfz03/tlLXNzaY4dLNjaSbG1RRC8=; b=vceTpgARkdcnuYP8YezCRTjw5zs/uEKLd+zM6Uv0HHwXADkvr9TN9XXEI//DZ/OkR0 uVa07XnxDXlYIYjEToIW6i+gnHvLVUHtwzRGcAV8Lj2D+k6ZvtLPinmygXdXeuJbLXhU RSvZL5JM7TCmzKmYXyuon4vNcusH2n1PjkF519LV063ls+XU8f3FCBreyqR9BXkank/S ad2ieHVgQP1vJ1//B4W6MalO0Dkpw9b8XxKzi28gmqdQQc7idNMC3SjQ1Uyl0sU5JZnb SeR5HaIZmiAuC+xkUIY6PMkazGedsDNvBJgsQeI8sGs7qIo/Uzy665K0pb+zh5DekRUH hntw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=F/GbDHGe; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 60-v6si2003265plc.444.2018.02.07.18.05.25; Wed, 07 Feb 2018 18:05:38 -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; dkim=pass header.i=@google.com header.s=20161025 header.b=F/GbDHGe; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751910AbeBHCEq (ORCPT + 99 others); Wed, 7 Feb 2018 21:04:46 -0500 Received: from mail-io0-f193.google.com ([209.85.223.193]:34307 "EHLO mail-io0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751130AbeBHCEp (ORCPT ); Wed, 7 Feb 2018 21:04:45 -0500 Received: by mail-io0-f193.google.com with SMTP id c17so4183132iod.1 for ; Wed, 07 Feb 2018 18:04:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=9Ip1BNROOdugha3Mfz03/tlLXNzaY4dLNjaSbG1RRC8=; b=F/GbDHGeSVvWdV1DivYBwE56A6D7KDQoNjB7cXAe0UrT2k2Bw/7MnpZyEhysjgcz33 hc4n6GtAI/pjO2F7GbTjaLTovulJjgX++g81PcQqbBte5jrw0MKjJWzcYVHSRkEQ+H2Z H5znYCSSQGWJkzhW7K/AdFGmo3AetwQinDl2nEt7LXHJJegbzCk7JLgBAztqzRLzFnTx McF0vPAvFQdjjKlHFeRi9oRRFK+HCJP4b8NpbsIOBexDKjnsgz5ZWUdjPzk7+YnlkFLY q5b9hnKm/ZH2+N/TTx3R1YhED2qPQFEncfOh+PJezc30nPCDFpWwXSuoMybay7MHebFk 5SAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=9Ip1BNROOdugha3Mfz03/tlLXNzaY4dLNjaSbG1RRC8=; b=FUpQLkDtJgCyCWCuQ+kgKm26+gldMkgPO20T38wNe4F3rnfMqHeEaJfiaH3Kb8WCK9 SSxE2BZ9fI6YA/QTH5y5epTROl0mrQ/lHaqrTP+qGwkUiyz0tyZnDjiPeWnYjAq4Adnw VNMADWoA7tyfKDnp9y+i81IvZiNc/0NdpmaL4AaQyRY//EvOeh2KmuRMEMZ1A0pi2QaL XFxtZqViO/n4L2YGjbKjPeQn3BKcQ+HkU5l7cu8Ah9UZrd7R1UGbGiWieBIrHgvqPgRc tOHU5QSKQUsQKedckmzxzXH0fpRtJHyx9zZqCcodWIx7Kl36Y9YbMu0OGS+XxGO5s8jb Zjfw== X-Gm-Message-State: APf1xPCyZ/o7WXvgvh0tjxBCsx3eanUtLziIgqjlRn2jg0kWTcAIZlG7 MF8AmQgMrE7JqZyBm+p22MiAvADHJUoa67rg6c0ZAA== X-Received: by 10.107.162.147 with SMTP id l141mr10668480ioe.1.1518055484274; Wed, 07 Feb 2018 18:04:44 -0800 (PST) MIME-Version: 1.0 Received: by 10.2.168.134 with HTTP; Wed, 7 Feb 2018 18:04:43 -0800 (PST) In-Reply-To: <20180208015103.169603-2-mka@chromium.org> References: <20180208015103.169603-1-mka@chromium.org> <20180208015103.169603-2-mka@chromium.org> From: Guenter Roeck Date: Wed, 7 Feb 2018 18:04:43 -0800 Message-ID: Subject: Re: [PATCH v2 2/2] amdgpu/dc/dml: Support clang option for stack alignment To: Matthias Kaehlcke Cc: Alex Deucher , =?UTF-8?Q?Christian_K=C3=B6nig?= , David Zhou , David Airlie , Harry Wentland , Felix Kuehling , Dmytro Laktyushkin , amd-gfx list , Maling list - DRI developers , linux-kernel , Guenter Roeck , Justin TerAvest , Craig Bergstrom Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 7, 2018 at 5:51 PM, Matthias Kaehlcke wrote: > 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 Guenter > --- > 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 >