On 01/12/2025 08:27, Christian König wrote:
On 11/28/25 16:08, Tvrtko Ursulin wrote:
There is no need to draw the panic screen via the slow MMIO access on
APUs, since the frame buffer is guaranteed to be CPU accessible.

Well that is actually not correct. It is only guaranteed to be CPU accessible 
on 64bit kernels!

I suggest to use the appropriate test function to see if a BO is fully CPU 
accessible or not and just drop the check for the 
AMDGPU_GEM_CREATE_NO_CPU_ACCESS flag.

BTW: It is perfectly normal for the framebuffer to not be in VRAM on APUs! So 
the check below is broken as well.

Hmm I also misread the tail end of this function. It wouldn't even work if frame buffer was non-contiguous since it uses ttm_bo_kmap.

Never mind then, archive to /dev/null please.

Regards,

Tvrtko


Lets skip setting the .set_pixel method which allows the DRM panic core to
just work and it renders much more quickly.

Signed-off-by: Tvrtko Ursulin <[email protected]>
Cc: Alex Deucher <[email protected]>
Cc: "Christian König" <[email protected]>
Cc: Melissa Wen <[email protected]>
Cc: Rodrigo Siqueira <[email protected]>
---
FWIW this draws the panic faster, but.. the whole DRM panic setup only
appears to work with non-tiled modes. There is something broken in the
dcn10_reset_surface_dcc_and_tiling() code with "more advanced" modes
where thing the turning off compression seems to trigger some weird
display engine behaviour. (On the Steam Deck at least.)
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
index b5d34797d606..7f75f1319d3f 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
@@ -1900,7 +1900,8 @@ int amdgpu_display_get_scanout_buffer(struct drm_plane 
*plane,
sb->pitch[0] = fb->pitches[0]; - if (abo->flags & AMDGPU_GEM_CREATE_NO_CPU_ACCESS) {
+       if (!(amdgpu_ttm_adev(abo->tbo.bdev)->flags & AMD_IS_APU) &&
+           (abo->flags & AMDGPU_GEM_CREATE_NO_CPU_ACCESS)) {
                if (abo->tbo.resource->mem_type != TTM_PL_VRAM) {
                        drm_warn(plane->dev, "amdgpu panic, framebuffer not in 
VRAM\n");
                        return -EINVAL;


Reply via email to