Skip to contentSkip to conversation

drm/amd/display: fix dml-wrapper file discovery for out-of-tree builds

PATCH In review Prike Liang 2 participants 2 messages Sep 20 – Sep 23

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amd/display: fix dml-wrapper file discovery for out-of-tree builds

Anchor the object search to the DML wrapper top-level Makefile directory. This allows source files in subdirectories to be properly discovered and compiled with the required FPU CFLAGS, fixing SSE compilation errors.

---
 drivers/gpu/drm/amd/display/dc/dml2_wrapper/Makefile | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dml2_wrapper/Makefile +3 -2
index f8a17d622c32..2c84233db00c 100644
@@ -32,8 +32,9 @@ subdir-ccflags-y += -I$(FULL_AMD_DISPLAY_PATH)/dc/dml2_wrapper/dml21_wrapper
 
 # Add FPU flags to all dml2_wrapper files by default, remove NO_FPU flags.
 # FPU flags step 1: Find all .c files in dal/dc/dml2_wrapper and it's subfolders
-DML2_WRAPPER_ABS_PATH := $(FULL_AMD_DISPLAY_PATH)/dc/dml2_wrapper
-DML2_WRAPPER_C_FILES := $(shell find $(DML2_WRAPPER_ABS_PATH) -name '*.c' -type f)
+THIS_MAKEFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
+DML2_WRAPPER_ABS_PATH := $(patsubst %/,%,$(dir $(THIS_MAKEFILE_PATH)))
+DML2_WRAPPER_C_FILES := $(shell find $(DML2_WRAPPER_ABS_PATH) -name '*.c')
 
 # FPU flags step 2: Convert to .o and make paths relative to $(AMDDALPATH)/dc/dml2_wrapper/
 DML2_WRAPPER_RELATIVE_O_FILES := $(patsubst $(DML2_WRAPPER_ABS_PATH)/%,dc/dml2_wrapper/%,$(patsubst %.c,%.o,$(DML2_WRAPPER_C_FILES)))
Signature · 1 line
2.34.1
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Prike Liang

Anchor the object search to the DML wrapper top-level Makefile directory. This allows source files in subdirectories to be properly discovered and compiled with the required FPU CFLAGS, fixing SSE compilation errors.

Thanks!

Quoted 20 lines
---
 drivers/gpu/drm/amd/display/dc/dml2_wrapper/Makefile | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dml2_wrapper/Makefile +3 -2
index f8a17d622c32..2c84233db00c 100644
@@ -32,8 +32,9 @@ subdir-ccflags-y += -I$(FULL_AMD_DISPLAY_PATH)/dc/dml2_wrapper/dml21_wrapper
 
 # Add FPU flags to all dml2_wrapper files by default, remove NO_FPU flags.
 # FPU flags step 1: Find all .c files in dal/dc/dml2_wrapper and it's subfolders
-DML2_WRAPPER_ABS_PATH := $(FULL_AMD_DISPLAY_PATH)/dc/dml2_wrapper
-DML2_WRAPPER_C_FILES := $(shell find $(DML2_WRAPPER_ABS_PATH) -name '*.c' -type f)
+THIS_MAKEFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
+DML2_WRAPPER_ABS_PATH := $(patsubst %/,%,$(dir $(THIS_MAKEFILE_PATH)))
+DML2_WRAPPER_C_FILES := $(shell find $(DML2_WRAPPER_ABS_PATH) -name '*.c')
 
 # FPU flags step 2: Convert to .o and make paths relative to $(AMDDALPATH)/dc/dml2_wrapper/
 DML2_WRAPPER_RELATIVE_O_FILES := $(patsubst $(DML2_WRAPPER_ABS_PATH)/%,dc/dml2_wrapper/%,$(patsubst %.c,%.o,$(DML2_WRAPPER_C_FILES)))