Skip to content

Commit 38c1e0c

Browse files
committed
Merge tag 'drm-fixes-2023-02-10' of git://anongit.freedesktop.org/drm/drm
Pull drm fixes from Dave Airlie: "Weekly fixes. The amdgpu had a few small fixes to display flicker on certain configurations, however it was found the the flicker was lessened but there were other unintended consequences, so for now they've been reverted and replaced with an option for users to test with so future fixes can be developed. Otherwise apart from the usual bunch of i915 and amdgpu, there's a client, virtio-gpu and an nvidiafb fix that reorders its loading to avoid failure. client: - refcount fix amdgpu: - a bunch of attempted flicker fixes that regressed turned into a user workaround option for now - Properly fix S/G display with AGP aperture enabled - Fix cursor offset with 180 rotation - SMU13 fixes - Use TGID for GPUVM traces - Fix oops on in fence error path - Don't run IB tests on hw rings when sw rings are in use - memory leak fix i915: - Display watermark fix - fbdev fix for PSR, FBC, DRRS - Move fd_install after last use of fence - Initialize the obj flags for shmem objects - Fix VBT DSI DVO port handling virtio-gpu: - fence fix nvidiafb: - regression fix for driver load when no hw supported" * tag 'drm-fixes-2023-02-10' of git://anongit.freedesktop.org/drm/drm: (27 commits) Revert "drm/amd/display: disable S/G display on DCN 3.1.5" Revert "drm/amd/display: disable S/G display on DCN 2.1.0" Revert "drm/amd/display: disable S/G display on DCN 3.1.2/3" drm/amdgpu: add S/G display parameter drm/amdgpu/smu: skip pptable init under sriov amd/amdgpu: remove test ib on hw ring drm/amdgpu/fence: Fix oops due to non-matching drm_sched init/fini drm/amdgpu: Use the TGID for trace_amdgpu_vm_update_ptes drm/amdgpu: Add unique_id support for GC 11.0.1/2 drm/amd/pm: bump SMU 13.0.7 driver_if header version drm/amd/pm: bump SMU 13.0.0 driver_if header version drm/amd/pm: add SMU 13.0.7 missing GetPptLimit message mapping drm/amd/display: fix cursor offset on rotation 180 drm/amd/amdgpu: enable athub cg 11.0.3 Revert "drm/amd/display: disable S/G display on DCN 3.1.4" drm/amd/display: properly handling AGP aperture in vm setup drm/amd/display: disable S/G display on DCN 3.1.2/3 drm/amd/display: disable S/G display on DCN 2.1.0 drm/i915: Fix VBT DSI DVO port handling drm/client: fix circular reference counting issue ...
2 parents 1424c3e + 777c1e0 commit 38c1e0c

26 files changed

+200
-119
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,7 @@ extern int amdgpu_num_kcq;
243243

244244
#define AMDGPU_VCNFW_LOG_SIZE (32 * 1024)
245245
extern int amdgpu_vcnfw_log;
246+
extern int amdgpu_sg_display;
246247

247248
#define AMDGPU_VM_MAX_NUM_CTX 4096
248249
#define AMDGPU_SG_THRESHOLD (256*1024*1024)

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1220,10 +1220,13 @@ static int amdgpu_cs_sync_rings(struct amdgpu_cs_parser *p)
12201220
* next job actually sees the results from the previous one
12211221
* before we start executing on the same scheduler ring.
12221222
*/
1223-
if (!s_fence || s_fence->sched != sched)
1223+
if (!s_fence || s_fence->sched != sched) {
1224+
dma_fence_put(fence);
12241225
continue;
1226+
}
12251227

12261228
r = amdgpu_sync_fence(&p->gang_leader->explicit_sync, fence);
1229+
dma_fence_put(fence);
12271230
if (r)
12281231
return r;
12291232
}

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ int amdgpu_num_kcq = -1;
186186
int amdgpu_smartshift_bias;
187187
int amdgpu_use_xgmi_p2p = 1;
188188
int amdgpu_vcnfw_log;
189+
int amdgpu_sg_display = -1; /* auto */
189190

190191
static void amdgpu_drv_delayed_reset_work_handler(struct work_struct *work);
191192

@@ -931,6 +932,16 @@ module_param_named(num_kcq, amdgpu_num_kcq, int, 0444);
931932
MODULE_PARM_DESC(vcnfw_log, "Enable vcnfw log(0 = disable (default value), 1 = enable)");
932933
module_param_named(vcnfw_log, amdgpu_vcnfw_log, int, 0444);
933934

935+
/**
936+
* DOC: sg_display (int)
937+
* Disable S/G (scatter/gather) display (i.e., display from system memory).
938+
* This option is only relevant on APUs. Set this option to 0 to disable
939+
* S/G display if you experience flickering or other issues under memory
940+
* pressure and report the issue.
941+
*/
942+
MODULE_PARM_DESC(sg_display, "S/G Display (-1 = auto (default), 0 = disable)");
943+
module_param_named(sg_display, amdgpu_sg_display, int, 0444);
944+
934945
/**
935946
* DOC: smu_pptable_id (int)
936947
* Used to override pptable id. id = 0 use VBIOS pptable.

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,13 @@ void amdgpu_fence_driver_sw_fini(struct amdgpu_device *adev)
618618
if (!ring || !ring->fence_drv.initialized)
619619
continue;
620620

621-
if (!ring->no_scheduler)
621+
/*
622+
* Notice we check for sched.ops since there's some
623+
* override on the meaning of sched.ready by amdgpu.
624+
* The natural check would be sched.ready, which is
625+
* set as drm_sched_init() finishes...
626+
*/
627+
if (ring->sched.ops)
622628
drm_sched_fini(&ring->sched);
623629

624630
for (j = 0; j <= ring->fence_drv.num_fences_mask; ++j)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ struct amdgpu_ring {
295295
#define amdgpu_ring_parse_cs(r, p, job, ib) ((r)->funcs->parse_cs((p), (job), (ib)))
296296
#define amdgpu_ring_patch_cs_in_place(r, p, job, ib) ((r)->funcs->patch_cs_in_place((p), (job), (ib)))
297297
#define amdgpu_ring_test_ring(r) (r)->funcs->test_ring((r))
298-
#define amdgpu_ring_test_ib(r, t) (r)->funcs->test_ib((r), (t))
298+
#define amdgpu_ring_test_ib(r, t) ((r)->funcs->test_ib ? (r)->funcs->test_ib((r), (t)) : 0)
299299
#define amdgpu_ring_get_rptr(r) (r)->funcs->get_rptr((r))
300300
#define amdgpu_ring_get_wptr(r) (r)->funcs->get_wptr((r))
301301
#define amdgpu_ring_set_wptr(r) (r)->funcs->set_wptr((r))

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -974,7 +974,7 @@ int amdgpu_vm_ptes_update(struct amdgpu_vm_update_params *params,
974974
trace_amdgpu_vm_update_ptes(params, frag_start, upd_end,
975975
min(nptes, 32u), dst, incr,
976976
upd_flags,
977-
vm->task_info.pid,
977+
vm->task_info.tgid,
978978
vm->immediate.fence_context);
979979
amdgpu_vm_pte_update_flags(params, to_amdgpu_bo_vm(pt),
980980
cursor.level, pe_start, dst,

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6877,7 +6877,6 @@ static const struct amdgpu_ring_funcs gfx_v9_0_ring_funcs_gfx = {
68776877
.emit_gds_switch = gfx_v9_0_ring_emit_gds_switch,
68786878
.emit_hdp_flush = gfx_v9_0_ring_emit_hdp_flush,
68796879
.test_ring = gfx_v9_0_ring_test_ring,
6880-
.test_ib = gfx_v9_0_ring_test_ib,
68816880
.insert_nop = amdgpu_ring_insert_nop,
68826881
.pad_ib = amdgpu_ring_generic_pad_ib,
68836882
.emit_switch_buffer = gfx_v9_ring_emit_sb,

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,9 @@ static int soc21_common_early_init(void *handle)
641641
AMD_CG_SUPPORT_GFX_CGLS |
642642
AMD_CG_SUPPORT_REPEATER_FGCG |
643643
AMD_CG_SUPPORT_GFX_MGCG |
644-
AMD_CG_SUPPORT_HDP_SD;
644+
AMD_CG_SUPPORT_HDP_SD |
645+
AMD_CG_SUPPORT_ATHUB_MGCG |
646+
AMD_CG_SUPPORT_ATHUB_LS;
645647
adev->pg_flags = AMD_PG_SUPPORT_VCN |
646648
AMD_PG_SUPPORT_VCN_DPG |
647649
AMD_PG_SUPPORT_JPEG;

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

Lines changed: 33 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1184,24 +1184,38 @@ static void mmhub_read_system_context(struct amdgpu_device *adev, struct dc_phy_
11841184

11851185
memset(pa_config, 0, sizeof(*pa_config));
11861186

1187-
logical_addr_low = min(adev->gmc.fb_start, adev->gmc.agp_start) >> 18;
1188-
pt_base = amdgpu_gmc_pd_addr(adev->gart.bo);
1189-
1190-
if (adev->apu_flags & AMD_APU_IS_RAVEN2)
1191-
/*
1192-
* Raven2 has a HW issue that it is unable to use the vram which
1193-
* is out of MC_VM_SYSTEM_APERTURE_HIGH_ADDR. So here is the
1194-
* workaround that increase system aperture high address (add 1)
1195-
* to get rid of the VM fault and hardware hang.
1196-
*/
1197-
logical_addr_high = max((adev->gmc.fb_end >> 18) + 0x1, adev->gmc.agp_end >> 18);
1198-
else
1199-
logical_addr_high = max(adev->gmc.fb_end, adev->gmc.agp_end) >> 18;
1200-
12011187
agp_base = 0;
12021188
agp_bot = adev->gmc.agp_start >> 24;
12031189
agp_top = adev->gmc.agp_end >> 24;
12041190

1191+
/* AGP aperture is disabled */
1192+
if (agp_bot == agp_top) {
1193+
logical_addr_low = adev->gmc.vram_start >> 18;
1194+
if (adev->apu_flags & AMD_APU_IS_RAVEN2)
1195+
/*
1196+
* Raven2 has a HW issue that it is unable to use the vram which
1197+
* is out of MC_VM_SYSTEM_APERTURE_HIGH_ADDR. So here is the
1198+
* workaround that increase system aperture high address (add 1)
1199+
* to get rid of the VM fault and hardware hang.
1200+
*/
1201+
logical_addr_high = (adev->gmc.fb_end >> 18) + 0x1;
1202+
else
1203+
logical_addr_high = adev->gmc.vram_end >> 18;
1204+
} else {
1205+
logical_addr_low = min(adev->gmc.fb_start, adev->gmc.agp_start) >> 18;
1206+
if (adev->apu_flags & AMD_APU_IS_RAVEN2)
1207+
/*
1208+
* Raven2 has a HW issue that it is unable to use the vram which
1209+
* is out of MC_VM_SYSTEM_APERTURE_HIGH_ADDR. So here is the
1210+
* workaround that increase system aperture high address (add 1)
1211+
* to get rid of the VM fault and hardware hang.
1212+
*/
1213+
logical_addr_high = max((adev->gmc.fb_end >> 18) + 0x1, adev->gmc.agp_end >> 18);
1214+
else
1215+
logical_addr_high = max(adev->gmc.fb_end, adev->gmc.agp_end) >> 18;
1216+
}
1217+
1218+
pt_base = amdgpu_gmc_pd_addr(adev->gart.bo);
12051219

12061220
page_table_start.high_part = (u32)(adev->gmc.gart_start >> 44) & 0xF;
12071221
page_table_start.low_part = (u32)(adev->gmc.gart_start >> 12);
@@ -1503,6 +1517,8 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
15031517
case IP_VERSION(3, 0, 1):
15041518
case IP_VERSION(3, 1, 2):
15051519
case IP_VERSION(3, 1, 3):
1520+
case IP_VERSION(3, 1, 4):
1521+
case IP_VERSION(3, 1, 5):
15061522
case IP_VERSION(3, 1, 6):
15071523
init_data.flags.gpu_vm_support = true;
15081524
break;
@@ -1511,6 +1527,9 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
15111527
}
15121528
break;
15131529
}
1530+
if (init_data.flags.gpu_vm_support &&
1531+
(amdgpu_sg_display == 0))
1532+
init_data.flags.gpu_vm_support = false;
15141533

15151534
if (init_data.flags.gpu_vm_support)
15161535
adev->mode_info.gpu_vm_support = true;

drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3626,7 +3626,7 @@ void dcn10_set_cursor_position(struct pipe_ctx *pipe_ctx)
36263626
(int)hubp->curs_attr.width || pos_cpy.x
36273627
<= (int)hubp->curs_attr.width +
36283628
pipe_ctx->plane_state->src_rect.x) {
3629-
pos_cpy.x = temp_x + viewport_width;
3629+
pos_cpy.x = 2 * viewport_width - temp_x;
36303630
}
36313631
}
36323632
} else {

0 commit comments

Comments
 (0)