drm/amdgpu: Fix atomics on GFX12
Subsystems (2)
PATCH 1/1 drm/amdgpu: Fix atomics on GFX12
If PCIe supports atomics, configure register to prevent DF from breaking atomics in separate load/store operations.
Signed-off-by David Belanger <[email protected]>
Reviewed-by Hawking Zhang <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/Makefile | 3 +- drivers/gpu/drm/amd/amdgpu/amdgpu_df.h | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 5 +++ drivers/gpu/drm/amd/amdgpu/df_v4_15.c | 45 +++++++++++++++++++ drivers/gpu/drm/amd/amdgpu/df_v4_15.h | 30 +++++++++++++ drivers/gpu/drm/amd/amdgpu/soc24.c | 4 ++ .../amd/include/asic_reg/df/df_4_15_offset.h | 28 ++++++++++++ .../amd/include/asic_reg/df/df_4_15_sh_mask.h | 28 ++++++++++++ 8 files changed, 143 insertions(+), 1 deletion(-) create mode 100644 drivers/gpu/drm/amd/amdgpu/df_v4_15.c create mode 100644 drivers/gpu/drm/amd/amdgpu/df_v4_15.h create mode 100644 drivers/gpu/drm/amd/include/asic_reg/df/df_4_15_offset.h create mode 100644 drivers/gpu/drm/amd/include/asic_reg/df/df_4_15_sh_mask.h
drivers/gpu/drm/amd/amdgpu/Makefile +2 -1
@@ -106,7 +106,8 @@ amdgpu-y += \ df_v1_7.o \ df_v3_6.o \ df_v4_3.o \ - df_v4_6_2.o + df_v4_6_2.o \ + df_v4_15.o # add GMC block amdgpu-y += \
drivers/gpu/drm/amd/amdgpu/amdgpu_df.h +1 -0
@@ -33,6 +33,7 @@ struct amdgpu_df_hash_status {struct amdgpu_df_funcs {void (*sw_init)(struct amdgpu_device *adev);void (*sw_fini)(struct amdgpu_device *adev); +void (*hw_init)(struct amdgpu_device *adev);void (*enable_broadcast_mode)(struct amdgpu_device *adev,bool enable);u32 (*get_fb_channel_number)(struct amdgpu_device *adev);
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c +5 -0
@@ -37,6 +37,7 @@#include "df_v3_6.h" #include "df_v4_3.h" #include "df_v4_6_2.h" +#include "df_v4_15.h" #include "nbio_v6_1.h" #include "nbio_v7_0.h" #include "nbio_v7_4.h"
@@ -2803,6 +2804,10 @@ int amdgpu_discovery_set_ip_blocks(struct amdgpu_device *adev)case IP_VERSION (4 ,6 ,2 ): adev->df.funcs = &df_v4_6_2_funcs;break ; +case IP_VERSION (4 ,15 ,0 ): +case IP_VERSION (4 ,15 ,1 ): + adev->df.funcs = &df_v4_15_funcs; +break ;default :break ; }
drivers/gpu/drm/amd/amdgpu/df_v4_15.c new file +45 -0
45 lines not on this page · raw message
drivers/gpu/drm/amd/amdgpu/df_v4_15.h new file +30 -0
@@ -0,0 +1,30 @@ +/* +* Copyright 2024 Advanced Micro Devices, Inc. +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR +* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +* OTHER DEALINGS IN THE SOFTWARE. +* +*/ + +#ifndef __DF_V4_15_H__ +#define __DF_V4_15_H__ + +extern const struct amdgpu_df_funcs df_v4_15_funcs; + +#endif /* __DF_V4_15_H__ */ +
drivers/gpu/drm/amd/amdgpu/soc24.c +4 -0
@@ -484,6 +484,10 @@ static int soc24_common_hw_init(void *handle)*/ if (adev->nbio.funcs->remap_hdp_registers) adev->nbio.funcs->remap_hdp_registers (adev); + +if (adev->df.funcs->hw_init) + adev->df.funcs->hw_init (adev); +/* enable the doorbell aperture */ soc24_enable_doorbell_aperture (adev, true);
drivers/gpu/drm/amd/include/asic_reg/df/df_4_15_offset.h new file +28 -0
@@ -0,0 +1,28 @@ +/* +* Copyright (C) 2024 Advanced Micro Devices, Inc. +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included +* in all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +* THE COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef _df_4_15_OFFSET_HEADER +#define _df_4_15_OFFSET_HEADER + +#define regNCSConfigurationRegister1 0x0901 +#define regNCSConfigurationRegister1_BASE_IDX 4 + +#endif
drivers/gpu/drm/amd/include/asic_reg/df/df_4_15_sh_mask.h new file +28 -0
@@ -0,0 +1,28 @@ +/* +* Copyright (C) 2024 Advanced Micro Devices, Inc. +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included +* in all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +* THE COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef _df_4_15_SH_MASK_HEADER +#define _df_4_15_SH_MASK_HEADER + +#define NCSConfigurationRegister1__DisIntAtomicsLclProcessing__SHIFT 0x3 +#define NCSConfigurationRegister1__DisIntAtomicsLclProcessing_MASK 0x0003FFF8L + +#endif
Signature · 1 line
2.41.0