All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH xf86-video-amdgpu] Set correct DRM event context version
@ 2017-04-10  8:37 Michel Dänzer
       [not found] ` <20170410083751.19692-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Michel Dänzer @ 2017-04-10  8:37 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

From: Daniel Stone <daniels@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@collabora.com>
(Ported from xserver commit 0c8e6ed85810e96d84173a52d628863802a78d82)

Signed-off-by: Michel Dänzer <michel.daenzer@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

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

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

end of thread, other threads:[~2017-04-11  5:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-10  8:37 [PATCH xf86-video-amdgpu] Set correct DRM event context version Michel Dänzer
     [not found] ` <20170410083751.19692-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org>
2017-04-10  8:37   ` [PATCH xf86-video-ati] " Michel Dänzer
     [not found]     ` <20170410083751.19692-2-michel-otUistvHUpPR7s880joybQ@public.gmane.org>
2017-04-10  9:42       ` Emil Velikov
     [not found]         ` <CACvgo503KR+UdfiXQBuy7753tDhOSaF4yXP5vUvbFsw5L1ma-Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-04-11  5:58           ` Michel Dänzer
2017-04-10 14:51       ` Deucher, Alexander
2017-04-10 14:51   ` [PATCH xf86-video-amdgpu] " Deucher, Alexander

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.