mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-04 20:19:47 +08:00
drm/amdgpu: Add VCN_5_0_1 support
Add vcn support for VCN_5_0_1 v2: rebase, squash in fixes (Alex) Signed-off-by: Sonny Jiang <sonjiang@amd.com> Acked-by: Leo Liu <leo.liu@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
c406fca4b5
commit
346492f30c
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright 2017 Advanced Micro Devices, Inc.
|
# Copyright 2017-2024 Advanced Micro Devices, Inc. All rights reserved.
|
||||||
#
|
#
|
||||||
# Permission is hereby granted, free of charge, to any person obtaining a
|
# Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
# copy of this software and associated documentation files (the "Software"),
|
# copy of this software and associated documentation files (the "Software"),
|
||||||
@ -200,6 +200,7 @@ amdgpu-y += \
|
|||||||
vcn_v4_0_3.o \
|
vcn_v4_0_3.o \
|
||||||
vcn_v4_0_5.o \
|
vcn_v4_0_5.o \
|
||||||
vcn_v5_0_0.o \
|
vcn_v5_0_0.o \
|
||||||
|
vcn_v5_0_1.o \
|
||||||
amdgpu_jpeg.o \
|
amdgpu_jpeg.o \
|
||||||
jpeg_v1_0.o \
|
jpeg_v1_0.o \
|
||||||
jpeg_v2_0.o \
|
jpeg_v2_0.o \
|
||||||
|
|||||||
@ -1031,7 +1031,8 @@ int amdgpu_vcn_unified_ring_test_ib(struct amdgpu_ring *ring, long timeout)
|
|||||||
struct amdgpu_device *adev = ring->adev;
|
struct amdgpu_device *adev = ring->adev;
|
||||||
long r;
|
long r;
|
||||||
|
|
||||||
if (amdgpu_ip_version(adev, UVD_HWIP, 0) != IP_VERSION(4, 0, 3)) {
|
if ((amdgpu_ip_version(adev, UVD_HWIP, 0) != IP_VERSION(4, 0, 3)) &&
|
||||||
|
(amdgpu_ip_version(adev, UVD_HWIP, 0) != IP_VERSION(5, 0, 1))) {
|
||||||
r = amdgpu_vcn_enc_ring_test_ib(ring, timeout);
|
r = amdgpu_vcn_enc_ring_test_ib(ring, timeout);
|
||||||
if (r)
|
if (r)
|
||||||
goto error;
|
goto error;
|
||||||
@ -1082,7 +1083,9 @@ void amdgpu_vcn_setup_ucode(struct amdgpu_device *adev)
|
|||||||
ALIGN(le32_to_cpu(hdr->ucode_size_bytes), PAGE_SIZE);
|
ALIGN(le32_to_cpu(hdr->ucode_size_bytes), PAGE_SIZE);
|
||||||
|
|
||||||
if (amdgpu_ip_version(adev, UVD_HWIP, 0) ==
|
if (amdgpu_ip_version(adev, UVD_HWIP, 0) ==
|
||||||
IP_VERSION(4, 0, 3))
|
IP_VERSION(4, 0, 3) ||
|
||||||
|
amdgpu_ip_version(adev, UVD_HWIP, 0) ==
|
||||||
|
IP_VERSION(5, 0, 1))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2016 Advanced Micro Devices, Inc.
|
* Copyright 2016-2024 Advanced Micro Devices, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
* copy of this software and associated documentation files (the "Software"),
|
* copy of this software and associated documentation files (the "Software"),
|
||||||
@ -163,20 +163,30 @@
|
|||||||
#define SOC24_DPG_MODE_OFFSET(ip, inst_idx, reg) \
|
#define SOC24_DPG_MODE_OFFSET(ip, inst_idx, reg) \
|
||||||
({ \
|
({ \
|
||||||
uint32_t internal_reg_offset, addr; \
|
uint32_t internal_reg_offset, addr; \
|
||||||
bool video_range, aon_range; \
|
bool video_range, video1_range, aon_range, aon1_range; \
|
||||||
\
|
\
|
||||||
addr = (adev->reg_offset[ip##_HWIP][inst_idx][reg##_BASE_IDX] + reg); \
|
addr = (adev->reg_offset[ip##_HWIP][inst_idx][reg##_BASE_IDX] + reg); \
|
||||||
addr <<= 2; \
|
addr <<= 2; \
|
||||||
video_range = ((((0xFFFFF & addr) >= (VCN_VID_SOC_ADDRESS)) && \
|
video_range = ((((0xFFFFF & addr) >= (VCN_VID_SOC_ADDRESS)) && \
|
||||||
((0xFFFFF & addr) < ((VCN_VID_SOC_ADDRESS + 0x2600))))); \
|
((0xFFFFF & addr) < ((VCN_VID_SOC_ADDRESS + 0x2600))))); \
|
||||||
|
video1_range = ((((0xFFFFF & addr) >= (VCN1_VID_SOC_ADDRESS)) && \
|
||||||
|
((0xFFFFF & addr) < ((VCN1_VID_SOC_ADDRESS + 0x2600))))); \
|
||||||
aon_range = ((((0xFFFFF & addr) >= (VCN_AON_SOC_ADDRESS)) && \
|
aon_range = ((((0xFFFFF & addr) >= (VCN_AON_SOC_ADDRESS)) && \
|
||||||
((0xFFFFF & addr) < ((VCN_AON_SOC_ADDRESS + 0x600))))); \
|
((0xFFFFF & addr) < ((VCN_AON_SOC_ADDRESS + 0x600))))); \
|
||||||
|
aon1_range = ((((0xFFFFF & addr) >= (VCN1_AON_SOC_ADDRESS)) && \
|
||||||
|
((0xFFFFF & addr) < ((VCN1_AON_SOC_ADDRESS + 0x600))))); \
|
||||||
if (video_range) \
|
if (video_range) \
|
||||||
internal_reg_offset = ((0xFFFFF & addr) - (VCN_VID_SOC_ADDRESS) + \
|
internal_reg_offset = ((0xFFFFF & addr) - (VCN_VID_SOC_ADDRESS) + \
|
||||||
(VCN_VID_IP_ADDRESS)); \
|
(VCN_VID_IP_ADDRESS)); \
|
||||||
else if (aon_range) \
|
else if (aon_range) \
|
||||||
internal_reg_offset = ((0xFFFFF & addr) - (VCN_AON_SOC_ADDRESS) + \
|
internal_reg_offset = ((0xFFFFF & addr) - (VCN_AON_SOC_ADDRESS) + \
|
||||||
(VCN_AON_IP_ADDRESS)); \
|
(VCN_AON_IP_ADDRESS)); \
|
||||||
|
else if (video1_range) \
|
||||||
|
internal_reg_offset = ((0xFFFFF & addr) - (VCN1_VID_SOC_ADDRESS) + \
|
||||||
|
(VCN_VID_IP_ADDRESS)); \
|
||||||
|
else if (aon1_range) \
|
||||||
|
internal_reg_offset = ((0xFFFFF & addr) - (VCN1_AON_SOC_ADDRESS) + \
|
||||||
|
(VCN_AON_IP_ADDRESS)); \
|
||||||
else \
|
else \
|
||||||
internal_reg_offset = (0xFFFFF & addr); \
|
internal_reg_offset = (0xFFFFF & addr); \
|
||||||
\
|
\
|
||||||
|
|||||||
1105
drivers/gpu/drm/amd/amdgpu/vcn_v5_0_1.c
Normal file
1105
drivers/gpu/drm/amd/amdgpu/vcn_v5_0_1.c
Normal file
File diff suppressed because it is too large
Load Diff
37
drivers/gpu/drm/amd/amdgpu/vcn_v5_0_1.h
Normal file
37
drivers/gpu/drm/amd/amdgpu/vcn_v5_0_1.h
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2024 Advanced Micro Devices, Inc. All rights reserved.
|
||||||
|
*
|
||||||
|
* 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 __VCN_v5_0_1_H__
|
||||||
|
#define __VCN_v5_0_1_H__
|
||||||
|
|
||||||
|
#define VCN_VID_SOC_ADDRESS 0x1FC00
|
||||||
|
#define VCN_AON_SOC_ADDRESS 0x1F800
|
||||||
|
#define VCN1_VID_SOC_ADDRESS 0x48300
|
||||||
|
#define VCN1_AON_SOC_ADDRESS 0x48000
|
||||||
|
|
||||||
|
#define VCN_VID_IP_ADDRESS 0x0
|
||||||
|
#define VCN_AON_IP_ADDRESS 0x30000
|
||||||
|
|
||||||
|
extern const struct amdgpu_ip_block_version vcn_v5_0_1_ip_block;
|
||||||
|
|
||||||
|
#endif /* __VCN_v5_0_1_H__ */
|
||||||
Loading…
Reference in New Issue
Block a user