AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] drm/amdgpu: Do not change amdgpu framebuffer format during page flip
@ 2020-12-29 21:10 Zhan Liu
  2021-01-03 15:43 ` Christian König
  2021-01-05 12:51 ` Dan Carpenter
  0 siblings, 2 replies; 5+ messages in thread
From: Zhan Liu @ 2020-12-29 21:10 UTC (permalink / raw)
  To: amd-gfx, zhan.liu, Nikola.Cornij, Stylon.Wang, Chao-kai.Wang,
	dri-devel, Nicholas.Kazlauskas, bas

[Why]
Driver cannot change amdgpu framebuffer (afb) format while doing
page flip. Force system doing so will cause ioctl error, and result in
breaking several functionalities including FreeSync.

If afb format is forced to change during page flip, following message
will appear in dmesg.log:

"[drm:drm_mode_page_flip_ioctl [drm]]
Page flip is not allowed to change frame buffer format."

[How]
Do not change afb format while doing page flip. It is okay to check
whether afb format is valid here, however, forcing afb format change
shouldn't happen here.

Signed-off-by: Zhan Liu <zhan.liu@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Thanks Nick and Bas. Here is my second patch for review.

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
index a638709e9c92..8a12e27ff4ec 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
@@ -832,7 +832,8 @@ static int convert_tiling_flags_to_modifier(struct amdgpu_framebuffer *afb)
 			if (!format_info)
 				return -EINVAL;
 
-			afb->base.format = format_info;
+			if (!afb->base.format)
+				afb->base.format = format_info;
 		}
 	}
 
-- 
2.25.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-01-07 17:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-12-29 21:10 [PATCH v2] drm/amdgpu: Do not change amdgpu framebuffer format during page flip Zhan Liu
2021-01-03 15:43 ` Christian König
2021-01-07 17:32   ` Daniel Vetter
2021-01-07 17:38     ` Liu, Zhan
2021-01-05 12:51 ` Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox