diff --git a/local/recipes/drivers/linux-kpi/source/src/c_headers/linux/amdgpu_stubs.h b/local/recipes/drivers/linux-kpi/source/src/c_headers/linux/amdgpu_stubs.h index 234afdfa1a..c31618fda2 100644 --- a/local/recipes/drivers/linux-kpi/source/src/c_headers/linux/amdgpu_stubs.h +++ b/local/recipes/drivers/linux-kpi/source/src/c_headers/linux/amdgpu_stubs.h @@ -52,6 +52,8 @@ static inline u32 div64_u64_rem_u32(u64 dividend, u64 divisor, u32 *remainder) { return (u32)(dividend / divisor); } +#define ilog2(n) ((unsigned int)(8 * sizeof(unsigned long long) - __builtin_clzll((n)) - 1)) + #define _THIS_IP_ ((void *)0) struct va_format { const char *fmt; diff --git a/local/recipes/gpu/amdgpu/recipe.toml b/local/recipes/gpu/amdgpu/recipe.toml index bc29b5ee9d..d6e37209fa 100644 --- a/local/recipes/gpu/amdgpu/recipe.toml +++ b/local/recipes/gpu/amdgpu/recipe.toml @@ -54,6 +54,8 @@ export CFLAGS="-std=gnu11 -D__redox__ -D__KERNEL__ -DCONFIG_DRM_AMDGPU -DCONFIG_ -I${AMD_SRC}/display/dc/dcn301 \ -I${AMD_SRC}/display/dc/dcn31 \ -I${AMD_SRC}/display/dc/dcn32 \ + -I${AMD_SRC}/display/dc/dpp \ + -I${AMD_SRC}/display/dc/mmhubbub \ -I${AMD_SRC}/display/modules \ -I${AMD_SRC}/display/modules/freesync \ -I${AMD_SRC}/display/modules/color \ @@ -71,13 +73,18 @@ export CFLAGS="-std=gnu11 -D__redox__ -D__KERNEL__ -DCONFIG_DRM_AMDGPU -DCONFIG_ "${TARGET_CC}" -c ${CFLAGS} "${REDOX_GLUE}/amdgpu_redox_main.c" -o amdgpu_redox_main.o "${TARGET_CC}" -c ${CFLAGS} "${REDOX_GLUE}/redox_stubs.c" -o redox_stubs.o -# Stage 2: DCN31 hardware display files (RDNA2 GPU — Navi21/22/23/24) +# Stage 2: DCN hardware display files # -# These DCN 3.1 hardware backend files have been proven to compile against -# the linux-kpi compatibility headers. They form the minimal verified subset -# of the imported Linux Display Core tree. Additional DCN revisions (dcn20, -# dcn30, dcn32) will be added as their compile triage completes. -DISPLAY_SRCS="${AMD_SRC}/display/dc/dcn31/dcn31_afmt.c +# These DCN hardware backend files have been proven to compile against +# the linux-kpi compatibility headers. DCN31 covers RDNA2 (Navi21-24), +# DCN20 covers RDNA1 (Navi10/14/12), DCN30 covers additional RDNA2. +DISPLAY_SRCS="${AMD_SRC}/display/dc/dcn20/dcn20_dwb.c +${AMD_SRC}/display/dc/dcn20/dcn20_dwb_scl.c +${AMD_SRC}/display/dc/dcn20/dcn20_vmid.c +${AMD_SRC}/display/dc/dcn30/dcn30_afmt.c +${AMD_SRC}/display/dc/dcn30/dcn30_mmhubbub.c +${AMD_SRC}/display/dc/dcn30/dcn30_vpg.c +${AMD_SRC}/display/dc/dcn31/dcn31_afmt.c ${AMD_SRC}/display/dc/dcn31/dcn31_vpg.c ${AMD_SRC}/display/dc/dcn31/dcn31_apg.c ${AMD_SRC}/display/dc/dcn31/dcn31_panel_cntl.c"