|
From: Robert B. <bo...@o-...> - 2009-09-18 14:55:03
|
Hi, As someone who works a lot with OpenGL applications I've often found it to be a shame that Valgrind doesn't know about any of the drm ioctls which can result in a lot of noise when using memcheck. More recently the libdrm developers have started memsetting all their ioctl structures to avoid complaints from Valgrind, but that's not ideal and isn't enough for all the warnings. I've attached a patch for coregrind/m_syswrap/syswrap-linux.c that describes enough of the drm ioctls that I can remove the memsets in libdrm and run the applications I work on with Valgrind knowing what's going on. In include/vki/vki-linux-drm.h I've tried to add all the structures and ioctl definitions so it should be relatively straight forward to add additional drm ioctls to syswrap-linux.c in an incremental fashion. For reference, I'm running with intel i965 hardware with the i915 drm module and I'm building linux, mesa and libdrm from git master which also implies I'm running using the GEM memory manager. It's likely that this patch is missing some ioctls if your setup diverges from mine, but it's what I can most easily test. I'd love to get some feedback on this patch and to know if this is something that could be accepted upstream? I've also attached a file called drm-ioctls.txt that is basically lots of boilerplate snippets of code that have been generated with various vim macros from the original drm ioctl declarations. Using these as a starting point to add further ioctls should remove some of the tedium. kind regards, - Robert -- Robert Bragg, Intel Open Source Technology Center |