mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Harry Wentland <harry.wentland@amd.com>
To: "Matthias Kaehlcke" <mka@chromium.org>,
	"Alex Deucher" <alexander.deucher@amd.com>,
	"Christian König" <christian.koenig@amd.com>,
	"David Zhou" <David1.Zhou@amd.com>,
	"David Airlie" <airlied@linux.ie>,
	"Felix Kuehling" <Felix.Kuehling@amd.com>,
	"Dmytro Laktyushkin" <Dmytro.Laktyushkin@amd.com>
Cc: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org, Guenter Roeck <groeck@chromium.org>,
	Justin TerAvest <teravest@chromium.org>,
	Craig Bergstrom <craigb@chromium.org>
Subject: Re: [PATCH v2 1/2] amdgpu/dc/dml: Consolidate redundant CFLAGS
Date: Thu, 8 Feb 2018 09:33:53 -0500	[thread overview]
Message-ID: <ef9de5a5-a5b3-63a3-7ddb-5d9338019e71@amd.com> (raw)
In-Reply-To: <20180208015103.169603-1-mka@chromium.org>

On 2018-02-07 08:51 PM, Matthias Kaehlcke wrote:
> Use subdir-ccflags instead of specifying the same flags for every source
> file.
> 
> Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
> Reviewed-by: Guenter Roeck <groeck@chromium.org>
> ---
> Changes in v2:
> - added 'Reviewed-by: Guenter Roeck <groeck@chromium.org>' tag
> 
>  drivers/gpu/drm/amd/display/dc/dml/Makefile | 10 +---------
>  1 file changed, 1 insertion(+), 9 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/display/dc/dml/Makefile b/drivers/gpu/drm/amd/display/dc/dml/Makefile
> index 3488af2b5786..b8cadf833e71 100644
> --- a/drivers/gpu/drm/amd/display/dc/dml/Makefile
> +++ b/drivers/gpu/drm/amd/display/dc/dml/Makefile
> @@ -24,15 +24,7 @@
>  # It provides the general basic services required by other DAL
>  # subcomponents.
>  
> -CFLAGS_display_mode_vba.o := -mhard-float -msse -mpreferred-stack-boundary=4
> -CFLAGS_display_mode_lib.o := -mhard-float -msse -mpreferred-stack-boundary=4
> -CFLAGS_display_pipe_clocks.o := -mhard-float -msse -mpreferred-stack-boundary=4
> -CFLAGS_display_rq_dlg_calc.o := -mhard-float -msse -mpreferred-stack-boundary=4
> -CFLAGS_dml1_display_rq_dlg_calc.o := -mhard-float -msse -mpreferred-stack-boundary=4
> -CFLAGS_display_rq_dlg_helpers.o := -mhard-float -msse -mpreferred-stack-boundary=4
> -CFLAGS_soc_bounding_box.o := -mhard-float -msse -mpreferred-stack-boundary=4
> -CFLAGS_dml_common_defs.o := -mhard-float -msse -mpreferred-stack-boundary=4
> -
> +subdir-ccflags-y += -mhard-float -msse -mpreferred-stack-boundary=4

Are you sure this will only apply to dc/dml?

The way the amdgpu build is setup I've seen this flag apply to all of amdgpu, even if specified in a subdirectories build file. The reason being that amdgpu/Makefile recursively includes all other Makefiles in the module.

According to kbuild/makefiles.txt this will have effect for the kbuild file where it's present and all subdirectories:

https://www.kernel.org/doc/Documentation/kbuild/makefiles.txt:
>     subdir-ccflags-y, subdir-asflags-y
> 	The two flags listed above are similar to ccflags-y and asflags-y.
> 	The difference is that the subdir- variants have effect for the kbuild
> 	file where they are present and all subdirectories.
> 	Options specified using subdir-* are added to the commandline before
> 	the options specified using the non-subdir variants.
> 
> 	Example:
> 		subdir-ccflags-y := -Werror

For your 2nd patch you probably want to make a dml_cflags variable that's set different for clang and gcc, and then still set it for all files in DML individually.

You'll probably also have to do the same for dc/calcs/Makefile.

Thanks for finding a good solution for supporting clang. It's been on my list but I haven't had time to find the right flag yet.

Harry

>  
>  DML = display_mode_lib.o display_rq_dlg_calc.o \
>  	  display_rq_dlg_helpers.o dml1_display_rq_dlg_calc.o \
> 

  parent reply	other threads:[~2018-02-08 14:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-08  1:51 Matthias Kaehlcke
2018-02-08  1:51 ` [PATCH v2 2/2] amdgpu/dc/dml: Support clang option for stack alignment Matthias Kaehlcke
2018-02-08  2:04   ` Guenter Roeck
2018-02-08 14:33 ` Harry Wentland [this message]
2018-02-08 18:48   ` [PATCH v2 1/2] amdgpu/dc/dml: Consolidate redundant CFLAGS Matthias Kaehlcke

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ef9de5a5-a5b3-63a3-7ddb-5d9338019e71@amd.com \
    --to=harry.wentland@amd.com \
    --cc=David1.Zhou@amd.com \
    --cc=Dmytro.Laktyushkin@amd.com \
    --cc=Felix.Kuehling@amd.com \
    --cc=airlied@linux.ie \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@amd.com \
    --cc=craigb@chromium.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=groeck@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mka@chromium.org \
    --cc=teravest@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome