From c045df24d5b1e497461add562c6054a8901d2035 Mon Sep 17 00:00:00 2001 From: Taylor R Campbell Date: Fri, 29 Jul 2022 18:57:44 +0000 Subject: [PATCH] WIP: amdgpu: trace gfx ring wptr --- .../bsd/drm2/dist/drm/amd/amdgpu/amdgpu_device.c | 10 ++++++++++ .../bsd/drm2/dist/drm/amd/amdgpu/amdgpu_gfx_v8_0.c | 9 +++++++++ 2 files changed, 19 insertions(+) diff --git a/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_device.c b/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_device.c index 452ed5a2c3b2..57a6544bc1c6 100644 --- a/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_device.c +++ b/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_device.c @@ -877,6 +877,16 @@ static int amdgpu_device_wb_init(struct amdgpu_device *adev) return r; } + device_printf(adev->dev, + "wb_obj=%p mem_type=0x%x placement=0x%x kmap_type=0x%x pa=0x%llx gpu_addr=0x%llx wb=%p\n", + adev->wb.wb_obj, + adev->wb.wb_obj->tbo.mem.mem_type, + adev->wb.wb_obj->tbo.mem.placement, + (int)adev->wb.wb_obj->kmap.bo_kmap_type, + (unsigned long long)page_to_phys(adev->wb.wb_obj->tbo.ttm->pages[0]), + (unsigned long long)adev->wb.gpu_addr, + adev->wb.wb); + adev->wb.num_wb = AMDGPU_MAX_WB; memset(&adev->wb.used, 0, sizeof(adev->wb.used)); diff --git a/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_gfx_v8_0.c b/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_gfx_v8_0.c index 56407a92cd47..452954c9d71b 100644 --- a/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_gfx_v8_0.c +++ b/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_gfx_v8_0.c @@ -2015,6 +2015,12 @@ static int gfx_v8_0_sw_init(void *handle) ring->doorbell_index = adev->doorbell_index.gfx_ring0; } + device_printf(adev->dev, "%s ring @ %p:" + " %s doorbell 0x%"PRIx32"\n", + ring->name, ring, + (ring->use_doorbell ? "use" : "don't use"), + ring->doorbell_index); + r = amdgpu_ring_init(adev, ring, 1024, &adev->gfx.eop_irq, AMDGPU_CP_IRQ_GFX_ME0_PIPE0_EOP); if (r) @@ -6030,6 +6036,9 @@ static void gfx_v8_0_ring_set_wptr_gfx(struct amdgpu_ring *ring) { struct amdgpu_device *adev = ring->adev; + device_printf(adev->dev, "%s ring @ %p: write wptr 0x%"PRIx64"\n", + ring->name, ring, ring->wptr); + if (ring->use_doorbell) { /* XXX check if swapping is necessary on BE */ adev->wb.wb[ring->wptr_offs] = lower_32_bits(ring->wptr);