Skip to content
  • Arnd Bergmann's avatar
    ac5d44fb
    drm/amd/display: fix incompatible structure layouts · ac5d44fb
    Arnd Bergmann authored
    
    
    Building the amd display driver with link-time optimizations revealed a bug
    that caused dal_cmd_tbl_helper_dce80_get_table() and
    dal_cmd_tbl_helper_dce110_get_table() get called with an incompatible
    return type between the two callers in command_table_helper.c and
    command_table_helper2.c:
    
    drivers/gpu/drm/amd/amdgpu/../display/dc/bios/dce80/command_table_helper_dce80.h:31: error: type of 'dal_cmd_tbl_helper_dce80_get_table' does not match original declaration [-Werror=lto-type-mismatch]
     const struct command_table_helper *dal_cmd_tbl_helper_dce80_get_table(void);
    
    drivers/gpu/drm/amd/amdgpu/../display/dc/bios/dce80/command_table_helper_dce80.c:351: note: 'dal_cmd_tbl_helper_dce80_get_table' was previously declared here
     const struct command_table_helper *dal_cmd_tbl_helper_dce80_get_table(void)
    
    drivers/gpu/drm/amd/amdgpu/../display/dc/bios/dce110/command_table_helper_dce110.h:32: error: type of 'dal_cmd_tbl_helper_dce110_get_table' does not match original declaration [-Werror=lto-type-mismatch]
     const struct command_table_helper *dal_cmd_tbl_helper_dce110_get_table(void);
    
    drivers/gpu/drm/amd/amdgpu/../display/dc/bios/dce110/command_table_helper_dce110.c:361: note: 'dal_cmd_tbl_helper_dce110_get_table' was previously declared here
     const struct command_table_helper *dal_cmd_tbl_helper_dce110_get_table(void)
    
    The two versions of the structure are obviously derived from the same
    one, but have diverged over time, before they got added to the kernel.
    
    This moves the structure to a new shared header file and uses the superset
    of the members, to ensure the interfaces are all compatible.
    
    Fixes: ae79c310 ("drm/amd/display: Add DCE12 bios parser support")
    Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
    Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
    ac5d44fb
    drm/amd/display: fix incompatible structure layouts
    Arnd Bergmann authored
    
    
    Building the amd display driver with link-time optimizations revealed a bug
    that caused dal_cmd_tbl_helper_dce80_get_table() and
    dal_cmd_tbl_helper_dce110_get_table() get called with an incompatible
    return type between the two callers in command_table_helper.c and
    command_table_helper2.c:
    
    drivers/gpu/drm/amd/amdgpu/../display/dc/bios/dce80/command_table_helper_dce80.h:31: error: type of 'dal_cmd_tbl_helper_dce80_get_table' does not match original declaration [-Werror=lto-type-mismatch]
     const struct command_table_helper *dal_cmd_tbl_helper_dce80_get_table(void);
    
    drivers/gpu/drm/amd/amdgpu/../display/dc/bios/dce80/command_table_helper_dce80.c:351: note: 'dal_cmd_tbl_helper_dce80_get_table' was previously declared here
     const struct command_table_helper *dal_cmd_tbl_helper_dce80_get_table(void)
    
    drivers/gpu/drm/amd/amdgpu/../display/dc/bios/dce110/command_table_helper_dce110.h:32: error: type of 'dal_cmd_tbl_helper_dce110_get_table' does not match original declaration [-Werror=lto-type-mismatch]
     const struct command_table_helper *dal_cmd_tbl_helper_dce110_get_table(void);
    
    drivers/gpu/drm/amd/amdgpu/../display/dc/bios/dce110/command_table_helper_dce110.c:361: note: 'dal_cmd_tbl_helper_dce110_get_table' was previously declared here
     const struct command_table_helper *dal_cmd_tbl_helper_dce110_get_table(void)
    
    The two versions of the structure are obviously derived from the same
    one, but have diverged over time, before they got added to the kernel.
    
    This moves the structure to a new shared header file and uses the superset
    of the members, to ensure the interfaces are all compatible.
    
    Fixes: ae79c310 ("drm/amd/display: Add DCE12 bios parser support")
    Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
    Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Loading