Skip to content

Commit 155c6b1

Browse files
committed
Merge tag 'amd-drm-next-6.3-2023-01-27' of https://gitlab.freedesktop.org/agd5f/linux into drm-next
amd-drm-next-6.3-2023-01-27: amdgpu: - GC11 fixes - SMU13 fixes - Freesync fixes - DP MST fixes - DP MST code rework and cleanup - AV1 fixes for VCN4 - DCN 3.2.x fixes - PSR fixes - DML optimizations - DC link code rework Signed-off-by: Dave Airlie <airlied@redhat.com> From: Alex Deucher <alexander.deucher@amd.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230127225917.2419162-1-alexander.deucher@amd.com
2 parents dae437d + cdf657f commit 155c6b1

109 files changed

Lines changed: 4136 additions & 3356 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3038,6 +3038,18 @@ static int amdgpu_device_ip_suspend_phase2(struct amdgpu_device *adev)
30383038
(adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_SDMA))
30393039
continue;
30403040

3041+
/* Once swPSP provides the IMU, RLC FW binaries to TOS during cold-boot.
3042+
* These are in TMR, hence are expected to be reused by PSP-TOS to reload
3043+
* from this location and RLC Autoload automatically also gets loaded
3044+
* from here based on PMFW -> PSP message during re-init sequence.
3045+
* Therefore, the psp suspend & resume should be skipped to avoid destroy
3046+
* the TMR and reload FWs again for IMU enabled APU ASICs.
3047+
*/
3048+
if (amdgpu_in_reset(adev) &&
3049+
(adev->flags & AMD_IS_APU) && adev->gfx.imu.funcs &&
3050+
adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_PSP)
3051+
continue;
3052+
30413053
/* XXX handle errors */
30423054
r = adev->ip_blocks[i].version->funcs->suspend(adev);
30433055
/* XXX handle errors */

drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -549,8 +549,8 @@ struct amdgpu_mst_connector {
549549

550550
struct drm_dp_mst_topology_mgr mst_mgr;
551551
struct amdgpu_dm_dp_aux dm_dp_aux;
552-
struct drm_dp_mst_port *port;
553-
struct amdgpu_connector *mst_port;
552+
struct drm_dp_mst_port *mst_output_port;
553+
struct amdgpu_connector *mst_root;
554554
bool is_mst_connector;
555555
struct amdgpu_encoder *mst_encoder;
556556
};

drivers/gpu/drm/amd/amdgpu/imu_v11_0.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ MODULE_FIRMWARE("amdgpu/gc_11_0_0_imu.bin");
3535
MODULE_FIRMWARE("amdgpu/gc_11_0_1_imu.bin");
3636
MODULE_FIRMWARE("amdgpu/gc_11_0_2_imu.bin");
3737
MODULE_FIRMWARE("amdgpu/gc_11_0_3_imu.bin");
38+
MODULE_FIRMWARE("amdgpu/gc_11_0_4_imu.bin");
3839

3940
static int imu_v11_0_init_microcode(struct amdgpu_device *adev)
4041
{

drivers/gpu/drm/amd/amdgpu/mes_v11_0.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ MODULE_FIRMWARE("amdgpu/gc_11_0_2_mes.bin");
4040
MODULE_FIRMWARE("amdgpu/gc_11_0_2_mes1.bin");
4141
MODULE_FIRMWARE("amdgpu/gc_11_0_3_mes.bin");
4242
MODULE_FIRMWARE("amdgpu/gc_11_0_3_mes1.bin");
43+
MODULE_FIRMWARE("amdgpu/gc_11_0_4_mes.bin");
44+
MODULE_FIRMWARE("amdgpu/gc_11_0_4_mes1.bin");
4345

4446
static int mes_v11_0_hw_fini(void *handle);
4547
static int mes_v11_0_kiq_hw_init(struct amdgpu_device *adev);
@@ -196,7 +198,6 @@ static int mes_v11_0_add_hw_queue(struct amdgpu_mes *mes,
196198
mes_add_queue_pkt.trap_handler_addr = input->tba_addr;
197199
mes_add_queue_pkt.tma_addr = input->tma_addr;
198200
mes_add_queue_pkt.is_kfd_process = input->is_kfd_process;
199-
mes_add_queue_pkt.trap_en = 1;
200201

201202
/* For KFD, gds_size is re-used for queue size (needed in MES for AQL queues) */
202203
mes_add_queue_pkt.is_aql_queue = input->is_aql_queue;

drivers/gpu/drm/amd/amdgpu/soc21.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ static const struct amdgpu_video_codec_info vcn_4_0_0_video_codecs_encode_array_
5252
{
5353
{codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_MPEG4_AVC, 4096, 2304, 0)},
5454
{codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_HEVC, 4096, 2304, 0)},
55+
{codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_AV1, 8192, 4352, 0)},
5556
};
5657

5758
static const struct amdgpu_video_codec_info vcn_4_0_0_video_codecs_encode_array_vcn1[] =

drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c

Lines changed: 46 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1710,7 +1710,7 @@ static int vcn_v4_0_dec_msg(struct amdgpu_cs_parser *p, struct amdgpu_job *job,
17101710

17111711
create = ptr + addr + offset - start;
17121712

1713-
/* H246, HEVC and VP9 can run on any instance */
1713+
/* H264, HEVC and VP9 can run on any instance */
17141714
if (create[0] == 0x7 || create[0] == 0x10 || create[0] == 0x11)
17151715
continue;
17161716

@@ -1724,7 +1724,29 @@ static int vcn_v4_0_dec_msg(struct amdgpu_cs_parser *p, struct amdgpu_job *job,
17241724
return r;
17251725
}
17261726

1727-
#define RADEON_VCN_ENGINE_TYPE_DECODE (0x00000003)
1727+
#define RADEON_VCN_ENGINE_TYPE_ENCODE (0x00000002)
1728+
#define RADEON_VCN_ENGINE_TYPE_DECODE (0x00000003)
1729+
1730+
#define RADEON_VCN_ENGINE_INFO (0x30000001)
1731+
#define RADEON_VCN_ENGINE_INFO_MAX_OFFSET 16
1732+
1733+
#define RENCODE_ENCODE_STANDARD_AV1 2
1734+
#define RENCODE_IB_PARAM_SESSION_INIT 0x00000003
1735+
#define RENCODE_IB_PARAM_SESSION_INIT_MAX_OFFSET 64
1736+
1737+
/* return the offset in ib if id is found, -1 otherwise
1738+
* to speed up the searching we only search upto max_offset
1739+
*/
1740+
static int vcn_v4_0_enc_find_ib_param(struct amdgpu_ib *ib, uint32_t id, int max_offset)
1741+
{
1742+
int i;
1743+
1744+
for (i = 0; i < ib->length_dw && i < max_offset && ib->ptr[i] >= 8; i += ib->ptr[i]/4) {
1745+
if (ib->ptr[i + 1] == id)
1746+
return i;
1747+
}
1748+
return -1;
1749+
}
17281750

17291751
static int vcn_v4_0_ring_patch_cs_in_place(struct amdgpu_cs_parser *p,
17301752
struct amdgpu_job *job,
@@ -1734,27 +1756,35 @@ static int vcn_v4_0_ring_patch_cs_in_place(struct amdgpu_cs_parser *p,
17341756
struct amdgpu_vcn_decode_buffer *decode_buffer;
17351757
uint64_t addr;
17361758
uint32_t val;
1759+
int idx;
17371760

17381761
/* The first instance can decode anything */
17391762
if (!ring->me)
17401763
return 0;
17411764

1742-
/* unified queue ib header has 8 double words. */
1743-
if (ib->length_dw < 8)
1744-
return 0;
1745-
1746-
val = amdgpu_ib_get_value(ib, 6); //RADEON_VCN_ENGINE_TYPE
1747-
if (val != RADEON_VCN_ENGINE_TYPE_DECODE)
1748-
return 0;
1749-
1750-
decode_buffer = (struct amdgpu_vcn_decode_buffer *)&ib->ptr[10];
1751-
1752-
if (!(decode_buffer->valid_buf_flag & 0x1))
1765+
/* RADEON_VCN_ENGINE_INFO is at the top of ib block */
1766+
idx = vcn_v4_0_enc_find_ib_param(ib, RADEON_VCN_ENGINE_INFO,
1767+
RADEON_VCN_ENGINE_INFO_MAX_OFFSET);
1768+
if (idx < 0) /* engine info is missing */
17531769
return 0;
17541770

1755-
addr = ((u64)decode_buffer->msg_buffer_address_hi) << 32 |
1756-
decode_buffer->msg_buffer_address_lo;
1757-
return vcn_v4_0_dec_msg(p, job, addr);
1771+
val = amdgpu_ib_get_value(ib, idx + 2); /* RADEON_VCN_ENGINE_TYPE */
1772+
if (val == RADEON_VCN_ENGINE_TYPE_DECODE) {
1773+
decode_buffer = (struct amdgpu_vcn_decode_buffer *)&ib->ptr[idx + 6];
1774+
1775+
if (!(decode_buffer->valid_buf_flag & 0x1))
1776+
return 0;
1777+
1778+
addr = ((u64)decode_buffer->msg_buffer_address_hi) << 32 |
1779+
decode_buffer->msg_buffer_address_lo;
1780+
return vcn_v4_0_dec_msg(p, job, addr);
1781+
} else if (val == RADEON_VCN_ENGINE_TYPE_ENCODE) {
1782+
idx = vcn_v4_0_enc_find_ib_param(ib, RENCODE_IB_PARAM_SESSION_INIT,
1783+
RENCODE_IB_PARAM_SESSION_INIT_MAX_OFFSET);
1784+
if (idx >= 0 && ib->ptr[idx + 2] == RENCODE_ENCODE_STANDARD_AV1)
1785+
return vcn_v4_0_limit_sched(p, job);
1786+
}
1787+
return 0;
17581788
}
17591789

17601790
static const struct amdgpu_ring_funcs vcn_v4_0_unified_ring_vm_funcs = {

0 commit comments

Comments
 (0)