Skip to content

Commit c1dd5d2

Browse files
committed
Merge tag 'amd-drm-fixes-6.0-2022-08-31' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes
amd-drm-fixes-6.0-2022-08-31: amdgpu: - FRU error message fix - MES 11 updates - DCN 3.2.x fixes - DCN 3.1.4 fixes - Fix possible use after free in CS IOCTL - SMU 13.0.x fixes - Fix iolink reporting on devices with direct connections to CPU - GFX10 tap delay firmware fixes Signed-off-by: Dave Airlie <airlied@redhat.com> From: Alex Deucher <alexander.deucher@amd.com> Link: https://patchwork.freedesktop.org/patch/msgid/20220831212312.5921-1-alexander.deucher@amd.com
2 parents a71f395 + 39c84b8 commit c1dd5d2

23 files changed

Lines changed: 234 additions & 96 deletions

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5524,7 +5524,8 @@ bool amdgpu_device_is_peer_accessible(struct amdgpu_device *adev,
55245524
~*peer_adev->dev->dma_mask : ~((1ULL << 32) - 1);
55255525
resource_size_t aper_limit =
55265526
adev->gmc.aper_base + adev->gmc.aper_size - 1;
5527-
bool p2p_access = !(pci_p2pdma_distance_many(adev->pdev,
5527+
bool p2p_access = !adev->gmc.xgmi.connected_to_cpu &&
5528+
!(pci_p2pdma_distance_many(adev->pdev,
55285529
&peer_adev->dev, 1, true) < 0);
55295530

55305531
return pcie_p2p && p2p_access && (adev->gmc.visible_vram_size &&

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,15 @@ static bool is_fru_eeprom_supported(struct amdgpu_device *adev)
6666
return true;
6767
case CHIP_SIENNA_CICHLID:
6868
if (strnstr(atom_ctx->vbios_version, "D603",
69+
sizeof(atom_ctx->vbios_version))) {
70+
if (strnstr(atom_ctx->vbios_version, "D603GLXE",
6971
sizeof(atom_ctx->vbios_version)))
70-
return true;
71-
else
72+
return false;
73+
else
74+
return true;
75+
} else {
7276
return false;
77+
}
7378
default:
7479
return false;
7580
}

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,10 @@ void amdgpu_job_free(struct amdgpu_job *job)
159159
amdgpu_sync_free(&job->sync);
160160
amdgpu_sync_free(&job->sched_sync);
161161

162-
dma_fence_put(&job->hw_fence);
162+
if (!job->hw_fence.ops)
163+
kfree(job);
164+
else
165+
dma_fence_put(&job->hw_fence);
163166
}
164167

165168
int amdgpu_job_submit(struct amdgpu_job *job, struct drm_sched_entity *entity,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2401,7 +2401,7 @@ static int psp_load_smu_fw(struct psp_context *psp)
24012401
static bool fw_load_skip_check(struct psp_context *psp,
24022402
struct amdgpu_firmware_info *ucode)
24032403
{
2404-
if (!ucode->fw)
2404+
if (!ucode->fw || !ucode->ucode_size)
24052405
return true;
24062406

24072407
if (ucode->ucode_id == AMDGPU_UCODE_ID_SMC &&

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

Lines changed: 35 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4274,35 +4274,45 @@ static int gfx_v10_0_init_microcode(struct amdgpu_device *adev)
42744274

42754275
}
42764276

4277-
info = &adev->firmware.ucode[AMDGPU_UCODE_ID_GLOBAL_TAP_DELAYS];
4278-
info->ucode_id = AMDGPU_UCODE_ID_GLOBAL_TAP_DELAYS;
4279-
info->fw = adev->gfx.rlc_fw;
4280-
adev->firmware.fw_size +=
4281-
ALIGN(adev->gfx.rlc.global_tap_delays_ucode_size_bytes, PAGE_SIZE);
4277+
if (adev->gfx.rlc.global_tap_delays_ucode_size_bytes) {
4278+
info = &adev->firmware.ucode[AMDGPU_UCODE_ID_GLOBAL_TAP_DELAYS];
4279+
info->ucode_id = AMDGPU_UCODE_ID_GLOBAL_TAP_DELAYS;
4280+
info->fw = adev->gfx.rlc_fw;
4281+
adev->firmware.fw_size +=
4282+
ALIGN(adev->gfx.rlc.global_tap_delays_ucode_size_bytes, PAGE_SIZE);
4283+
}
42824284

4283-
info = &adev->firmware.ucode[AMDGPU_UCODE_ID_SE0_TAP_DELAYS];
4284-
info->ucode_id = AMDGPU_UCODE_ID_SE0_TAP_DELAYS;
4285-
info->fw = adev->gfx.rlc_fw;
4286-
adev->firmware.fw_size +=
4287-
ALIGN(adev->gfx.rlc.se0_tap_delays_ucode_size_bytes, PAGE_SIZE);
4285+
if (adev->gfx.rlc.se0_tap_delays_ucode_size_bytes) {
4286+
info = &adev->firmware.ucode[AMDGPU_UCODE_ID_SE0_TAP_DELAYS];
4287+
info->ucode_id = AMDGPU_UCODE_ID_SE0_TAP_DELAYS;
4288+
info->fw = adev->gfx.rlc_fw;
4289+
adev->firmware.fw_size +=
4290+
ALIGN(adev->gfx.rlc.se0_tap_delays_ucode_size_bytes, PAGE_SIZE);
4291+
}
42884292

4289-
info = &adev->firmware.ucode[AMDGPU_UCODE_ID_SE1_TAP_DELAYS];
4290-
info->ucode_id = AMDGPU_UCODE_ID_SE1_TAP_DELAYS;
4291-
info->fw = adev->gfx.rlc_fw;
4292-
adev->firmware.fw_size +=
4293-
ALIGN(adev->gfx.rlc.se1_tap_delays_ucode_size_bytes, PAGE_SIZE);
4293+
if (adev->gfx.rlc.se1_tap_delays_ucode_size_bytes) {
4294+
info = &adev->firmware.ucode[AMDGPU_UCODE_ID_SE1_TAP_DELAYS];
4295+
info->ucode_id = AMDGPU_UCODE_ID_SE1_TAP_DELAYS;
4296+
info->fw = adev->gfx.rlc_fw;
4297+
adev->firmware.fw_size +=
4298+
ALIGN(adev->gfx.rlc.se1_tap_delays_ucode_size_bytes, PAGE_SIZE);
4299+
}
42944300

4295-
info = &adev->firmware.ucode[AMDGPU_UCODE_ID_SE2_TAP_DELAYS];
4296-
info->ucode_id = AMDGPU_UCODE_ID_SE2_TAP_DELAYS;
4297-
info->fw = adev->gfx.rlc_fw;
4298-
adev->firmware.fw_size +=
4299-
ALIGN(adev->gfx.rlc.se2_tap_delays_ucode_size_bytes, PAGE_SIZE);
4301+
if (adev->gfx.rlc.se2_tap_delays_ucode_size_bytes) {
4302+
info = &adev->firmware.ucode[AMDGPU_UCODE_ID_SE2_TAP_DELAYS];
4303+
info->ucode_id = AMDGPU_UCODE_ID_SE2_TAP_DELAYS;
4304+
info->fw = adev->gfx.rlc_fw;
4305+
adev->firmware.fw_size +=
4306+
ALIGN(adev->gfx.rlc.se2_tap_delays_ucode_size_bytes, PAGE_SIZE);
4307+
}
43004308

4301-
info = &adev->firmware.ucode[AMDGPU_UCODE_ID_SE3_TAP_DELAYS];
4302-
info->ucode_id = AMDGPU_UCODE_ID_SE3_TAP_DELAYS;
4303-
info->fw = adev->gfx.rlc_fw;
4304-
adev->firmware.fw_size +=
4305-
ALIGN(adev->gfx.rlc.se3_tap_delays_ucode_size_bytes, PAGE_SIZE);
4309+
if (adev->gfx.rlc.se3_tap_delays_ucode_size_bytes) {
4310+
info = &adev->firmware.ucode[AMDGPU_UCODE_ID_SE3_TAP_DELAYS];
4311+
info->ucode_id = AMDGPU_UCODE_ID_SE3_TAP_DELAYS;
4312+
info->fw = adev->gfx.rlc_fw;
4313+
adev->firmware.fw_size +=
4314+
ALIGN(adev->gfx.rlc.se3_tap_delays_ucode_size_bytes, PAGE_SIZE);
4315+
}
43064316

43074317
info = &adev->firmware.ucode[AMDGPU_UCODE_ID_CP_MEC1];
43084318
info->ucode_id = AMDGPU_UCODE_ID_CP_MEC1;

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ static int mes_v11_0_add_hw_queue(struct amdgpu_mes *mes,
183183
mes_add_queue_pkt.trap_handler_addr = input->tba_addr;
184184
mes_add_queue_pkt.tma_addr = input->tma_addr;
185185
mes_add_queue_pkt.is_kfd_process = input->is_kfd_process;
186+
mes_add_queue_pkt.trap_en = 1;
186187

187188
return mes_v11_0_submit_pkt_and_poll_completion(mes,
188189
&mes_add_queue_pkt, sizeof(mes_add_queue_pkt),

drivers/gpu/drm/amd/display/dc/core/dc.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1094,7 +1094,8 @@ static void disable_dangling_plane(struct dc *dc, struct dc_state *context)
10941094
dc->current_state->stream_count != context->stream_count)
10951095
should_disable = true;
10961096

1097-
if (old_stream && !dc->current_state->res_ctx.pipe_ctx[i].top_pipe) {
1097+
if (old_stream && !dc->current_state->res_ctx.pipe_ctx[i].top_pipe &&
1098+
!dc->current_state->res_ctx.pipe_ctx[i].prev_odm_pipe) {
10981099
struct pipe_ctx *old_pipe, *new_pipe;
10991100

11001101
old_pipe = &dc->current_state->res_ctx.pipe_ctx[i];

drivers/gpu/drm/amd/display/dc/dcn31/dcn31_dio_link_encoder.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,9 @@ static bool has_query_dp_alt(struct link_encoder *enc)
104104
{
105105
struct dc_dmub_srv *dc_dmub_srv = enc->ctx->dmub_srv;
106106

107+
if (enc->ctx->dce_version >= DCN_VERSION_3_15)
108+
return true;
109+
107110
/* Supports development firmware and firmware >= 4.0.11 */
108111
return dc_dmub_srv &&
109112
!(dc_dmub_srv->dmub->fw_version >= DMUB_FW_VERSION(4, 0, 0) &&

drivers/gpu/drm/amd/display/dc/dcn314/dcn314_dio_stream_encoder.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,7 @@ static void enc314_stream_encoder_dp_unblank(
317317
/* switch DP encoder to CRTC data, but reset it the fifo first. It may happen
318318
* that it overflows during mode transition, and sometimes doesn't recover.
319319
*/
320+
REG_UPDATE(DIG_FIFO_CTRL0, DIG_FIFO_READ_START_LEVEL, 0x7);
320321
REG_UPDATE(DP_STEER_FIFO, DP_STEER_FIFO_RESET, 1);
321322
udelay(10);
322323

drivers/gpu/drm/amd/display/dc/dcn314/dcn314_optc.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@ static void optc314_set_odm_combine(struct timing_generator *optc, int *opp_id,
9898
REG_UPDATE(OPTC_WIDTH_CONTROL,
9999
OPTC_SEGMENT_WIDTH, mpcc_hactive);
100100

101-
REG_SET(OTG_H_TIMING_CNTL, 0, OTG_H_TIMING_DIV_MODE, opp_cnt - 1);
101+
REG_UPDATE(OTG_H_TIMING_CNTL,
102+
OTG_H_TIMING_DIV_MODE, opp_cnt - 1);
102103
optc1->opp_count = opp_cnt;
103104
}
104105

0 commit comments

Comments
 (0)