Skip to content

Commit 3f30a6e

Browse files
committed
Merge tag 'amd-drm-fixes-6.2-2023-01-19' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes
amd-drm-fixes-6.2-2023-01-19: amdgpu: - Fix display scaling - Fix RN/CZN power reporting on some firmware versions - Colorspace fixes - Fix resource freeing in error case in CS IOCTL - Fix warning on driver unload - GC11 fixes - DCN 3.1.4/5 S/G display workarounds Signed-off-by: Dave Airlie <[email protected]> From: Alex Deucher <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 parents 6bb517d + a52287d commit 3f30a6e

File tree

8 files changed

+33
-18
lines changed

8 files changed

+33
-18
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,9 @@ static bool amdgpu_gfx_is_compute_multipipe_capable(struct amdgpu_device *adev)
156156
return amdgpu_compute_multipipe == 1;
157157
}
158158

159+
if (adev->ip_versions[GC_HWIP][0] > IP_VERSION(9, 0, 0))
160+
return true;
161+
159162
/* FIXME: spreading the queues across pipes causes perf regressions
160163
* on POLARIS11 compute workloads */
161164
if (adev->asic_type == CHIP_POLARIS11)

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,7 @@ void amdgpu_vmid_free_reserved(struct amdgpu_device *adev,
497497
!--id_mgr->reserved_use_count) {
498498
/* give the reserved ID back to normal round robin */
499499
list_add(&id_mgr->reserved->list, &id_mgr->ids_lru);
500+
id_mgr->reserved = NULL;
500501
}
501502
vm->reserved_vmid[vmhub] = false;
502503
mutex_unlock(&id_mgr->lock);

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,14 @@ void amdgpu_job_free_resources(struct amdgpu_job *job)
161161
struct dma_fence *f;
162162
unsigned i;
163163

164-
/* use sched fence if available */
165-
f = job->base.s_fence ? &job->base.s_fence->finished : &job->hw_fence;
164+
/* Check if any fences where initialized */
165+
if (job->base.s_fence && job->base.s_fence->finished.ops)
166+
f = &job->base.s_fence->finished;
167+
else if (job->hw_fence.ops)
168+
f = &job->hw_fence;
169+
else
170+
f = NULL;
171+
166172
for (i = 0; i < job->num_ibs; ++i)
167173
amdgpu_ib_free(ring->adev, &job->ibs[i], f);
168174
}

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1287,17 +1287,24 @@ static int gfx_v11_0_sw_init(void *handle)
12871287

12881288
switch (adev->ip_versions[GC_HWIP][0]) {
12891289
case IP_VERSION(11, 0, 0):
1290-
case IP_VERSION(11, 0, 1):
12911290
case IP_VERSION(11, 0, 2):
12921291
case IP_VERSION(11, 0, 3):
1293-
case IP_VERSION(11, 0, 4):
12941292
adev->gfx.me.num_me = 1;
12951293
adev->gfx.me.num_pipe_per_me = 1;
12961294
adev->gfx.me.num_queue_per_pipe = 1;
12971295
adev->gfx.mec.num_mec = 2;
12981296
adev->gfx.mec.num_pipe_per_mec = 4;
12991297
adev->gfx.mec.num_queue_per_pipe = 4;
13001298
break;
1299+
case IP_VERSION(11, 0, 1):
1300+
case IP_VERSION(11, 0, 4):
1301+
adev->gfx.me.num_me = 1;
1302+
adev->gfx.me.num_pipe_per_me = 1;
1303+
adev->gfx.me.num_queue_per_pipe = 1;
1304+
adev->gfx.mec.num_mec = 1;
1305+
adev->gfx.mec.num_pipe_per_mec = 4;
1306+
adev->gfx.mec.num_queue_per_pipe = 4;
1307+
break;
13011308
default:
13021309
adev->gfx.me.num_me = 1;
13031310
adev->gfx.me.num_pipe_per_me = 1;

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1503,8 +1503,6 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
15031503
case IP_VERSION(3, 0, 1):
15041504
case IP_VERSION(3, 1, 2):
15051505
case IP_VERSION(3, 1, 3):
1506-
case IP_VERSION(3, 1, 4):
1507-
case IP_VERSION(3, 1, 5):
15081506
case IP_VERSION(3, 1, 6):
15091507
init_data.flags.gpu_vm_support = true;
15101508
break;
@@ -1730,10 +1728,6 @@ static void amdgpu_dm_fini(struct amdgpu_device *adev)
17301728
adev->dm.vblank_control_workqueue = NULL;
17311729
}
17321730

1733-
for (i = 0; i < adev->dm.display_indexes_num; i++) {
1734-
drm_encoder_cleanup(&adev->dm.mst_encoders[i].base);
1735-
}
1736-
17371731
amdgpu_dm_destroy_drm_device(&adev->dm);
17381732

17391733
#if defined(CONFIG_DRM_AMD_SECURE_DISPLAY)
@@ -5311,8 +5305,6 @@ static void fill_stream_properties_from_drm_display_mode(
53115305

53125306
timing_out->aspect_ratio = get_aspect_ratio(mode_in);
53135307

5314-
stream->output_color_space = get_output_color_space(timing_out);
5315-
53165308
stream->out_transfer_func->type = TF_TYPE_PREDEFINED;
53175309
stream->out_transfer_func->tf = TRANSFER_FUNCTION_SRGB;
53185310
if (stream->signal == SIGNAL_TYPE_HDMI_TYPE_A) {
@@ -5323,6 +5315,8 @@ static void fill_stream_properties_from_drm_display_mode(
53235315
adjust_colour_depth_from_display_info(timing_out, info);
53245316
}
53255317
}
5318+
5319+
stream->output_color_space = get_output_color_space(timing_out);
53265320
}
53275321

53285322
static void fill_audio_info(struct audio_info *audio_info,
@@ -9530,8 +9524,8 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev,
95309524
goto fail;
95319525
}
95329526

9533-
if (dm_old_con_state->abm_level !=
9534-
dm_new_con_state->abm_level)
9527+
if (dm_old_con_state->abm_level != dm_new_con_state->abm_level ||
9528+
dm_old_con_state->scaling != dm_new_con_state->scaling)
95359529
new_crtc_state->connectors_changed = true;
95369530
}
95379531

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,6 @@ static const struct drm_connector_helper_funcs dm_dp_mst_connector_helper_funcs
468468
static void amdgpu_dm_encoder_destroy(struct drm_encoder *encoder)
469469
{
470470
drm_encoder_cleanup(encoder);
471-
kfree(encoder);
472471
}
473472

474473
static const struct drm_encoder_funcs amdgpu_dm_encoder_funcs = {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ static const struct out_csc_color_matrix_type output_csc_matrix[] = {
9090
{ 0xE00, 0xF349, 0xFEB7, 0x1000, 0x6CE, 0x16E3,
9191
0x24F, 0x200, 0xFCCB, 0xF535, 0xE00, 0x1000} },
9292
{ COLOR_SPACE_YCBCR2020_TYPE,
93-
{ 0x1000, 0xF149, 0xFEB7, 0x0000, 0x0868, 0x15B2,
94-
0x01E6, 0x0000, 0xFB88, 0xF478, 0x1000, 0x0000} },
93+
{ 0x1000, 0xF149, 0xFEB7, 0x1004, 0x0868, 0x15B2,
94+
0x01E6, 0x201, 0xFB88, 0xF478, 0x1000, 0x1004} },
9595
{ COLOR_SPACE_YCBCR709_BLACK_TYPE,
9696
{ 0x0000, 0x0000, 0x0000, 0x1000, 0x0000, 0x0000,
9797
0x0000, 0x0200, 0x0000, 0x0000, 0x0000, 0x1000} },

drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1171,6 +1171,7 @@ static int renoir_get_smu_metrics_data(struct smu_context *smu,
11711171
int ret = 0;
11721172
uint32_t apu_percent = 0;
11731173
uint32_t dgpu_percent = 0;
1174+
struct amdgpu_device *adev = smu->adev;
11741175

11751176

11761177
ret = smu_cmn_get_metrics_table(smu,
@@ -1196,7 +1197,11 @@ static int renoir_get_smu_metrics_data(struct smu_context *smu,
11961197
*value = metrics->AverageUvdActivity / 100;
11971198
break;
11981199
case METRICS_AVERAGE_SOCKETPOWER:
1199-
*value = (metrics->CurrentSocketPower << 8) / 1000;
1200+
if (((adev->ip_versions[MP1_HWIP][0] == IP_VERSION(12, 0, 1)) && (adev->pm.fw_version >= 0x40000f)) ||
1201+
((adev->ip_versions[MP1_HWIP][0] == IP_VERSION(12, 0, 0)) && (adev->pm.fw_version >= 0x373200)))
1202+
*value = metrics->CurrentSocketPower << 8;
1203+
else
1204+
*value = (metrics->CurrentSocketPower << 8) / 1000;
12001205
break;
12011206
case METRICS_TEMPERATURE_EDGE:
12021207
*value = (metrics->GfxTemperature / 100) *

0 commit comments

Comments
 (0)