[PATCH xf86-video-amdgpu] Set correct DRM event context version

Michel Dänzer michel at daenzer.net
Mon Apr 10 08:37:50 UTC 2017


From: Daniel Stone <daniels at collabora.com>

DRM_EVENT_CONTEXT_VERSION is the latest context version supported by
whatever version of libdrm is present. We were blindly asserting we
supported whatever version that may be, even if we actually didn't.

With libdrm 2.4.78, setting a higher context version than 2 will attempt
to call the page_flip_handler2 vfunc if it was non-NULL, which being a
random chunk of stack memory, it might well have been.

Set the version as 2, which should be bumped only with the appropriate
version checks.

Signed-off-by: Daniel Stone <daniels at collabora.com>
(Ported from xserver commit 0c8e6ed85810e96d84173a52d628863802a78d82)

Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
---
 src/drmmode_display.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 2cdea90ad..f58d28f1a 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -2362,7 +2362,7 @@ Bool drmmode_pre_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int cpp)
 
 	xf86InitialConfiguration(pScrn, TRUE);
 
-	drmmode->event_context.version = DRM_EVENT_CONTEXT_VERSION;
+	drmmode->event_context.version = 2;
 	drmmode->event_context.vblank_handler = amdgpu_drm_queue_handler;
 	drmmode->event_context.page_flip_handler = amdgpu_drm_queue_handler;
 
-- 
2.11.0



More information about the amd-gfx mailing list