Set correct DRM event context version
PATCH 1/1 Set correct DRM event context version
From: Daniel Stone <[email protected]>
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.
(Ported from xserver commit 0c8e6ed85810e96d84173a52d628863802a78d82)
--- src/drmmode_display.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
src/drmmode_display.c +1 -1
@@ -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;
Signature · 6 lines
2.11.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 20170410083751.19692-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org
PATCH 1/1 Set correct DRM event context version
From: Daniel Stone <[email protected]>
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.
(Ported from xserver commit 0c8e6ed85810e96d84173a52d628863802a78d82)
--- src/drmmode_display.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
src/drmmode_display.c +1 -1
@@ -2538,7 +2538,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 = radeon_drm_queue_handler; drmmode->event_context.page_flip_handler = radeon_drm_queue_handler;
Signature · 6 lines
2.11.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 20170410083751.19692-2-michel-otUistvHUpPR7s880joybQ@public.gmane.org
Emil Velikov
Reviewed-byQuoted 10 lines · Michel Dänzer
From: Daniel Stone <[email protected]>
DRM_EVENT_CONTEXT_VERSIONis 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_handler2vfunc if it was non-NULL, which being a random chunk of stack memory, it might well have been.
Should be safe since we use xnfcalloc [in RADEONGetRec].
Regardless, the amdgpu and ati patches are
Thanks
Emil
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): CACvgo503KR+UdfiXQBuy7753tDhOSaF4yXP5vUvbFsw5L1ma-Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Quoted 7 lines · Emil Velikov
Quoted 6 lines · Michel Dänzer
From: Daniel Stone <[email protected]>
DRM_EVENT_CONTEXT_VERSIONis 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.
Quoted 5 lines
Quoted 4 lines
With libdrm 2.4.78, setting a higher context version than 2 will attempt to call the
page_flip_handler2vfunc if it was non-NULL, which being a random chunk of stack memory, it might well have been.Should be safe since we use xnfcalloc [in RADEONGetRec].
That's a good point, thanks (applies equally to the modesetting driver AFAICT); I'll drop the second paragraph from the commit log.
Quoted 2 lines
Regardless, the amdgpu and ati patches are
Reviewed-by Emil Velikov <[email protected]>
Thanks!
Signature · 7 lines
Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Deucher, Alexander
Reviewed-by Alex DeucherQuoted 17 lines
-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Michel Dänzer
Sent: Monday, April 10, 2017 4:38 AM
To: [email protected]
Subject: [PATCH xf86-video-ati] Set correct DRM event context versionFrom: Daniel Stone <[email protected]>
DRM_EVENT_CONTEXT_VERSIONis 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_handler2vfunc if it was non-NULL, which being a random chunk of stack memory, it might well have been.
Quoted 8 lines
Set the version as 2, which should be bumped only with the appropriate version checks.
Signed-off-by Daniel Stone <[email protected]>(Ported from xserver commit
0c8e6ed85810e96d84173a52d628863802a78d82)Signed-off-by Michel Dänzer <[email protected]>
Quoted 21 lines
--- src/drmmode_display.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)src/drmmode_display.c +1
-1@@ -2538,7 +2538,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 =
radeon_drm_queue_handler;
drmmode->event_context.page_flip_handler=radeon_drm_queue_handler;
Quoted 7 lines
--
2.11.0_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Deucher, Alexander
Reviewed-by Alex DeucherQuoted 17 lines
-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Michel Dänzer
Sent: Monday, April 10, 2017 4:38 AM
To: [email protected]
Subject: [PATCH xf86-video-amdgpu] Set correct DRM event context versionFrom: Daniel Stone <[email protected]>
DRM_EVENT_CONTEXT_VERSIONis 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_handler2vfunc if it was non-NULL, which being a random chunk of stack memory, it might well have been.
Quoted 8 lines
Set the version as 2, which should be bumped only with the appropriate version checks.
Signed-off-by Daniel Stone <[email protected]>(Ported from xserver commit
0c8e6ed85810e96d84173a52d628863802a78d82)Signed-off-by Michel Dänzer <[email protected]>
Quoted 21 lines
--- src/drmmode_display.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)src/drmmode_display.c +1
-1@@ -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;
Quoted 7 lines
--
2.11.0_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx