Check that the drm fd is i915 before calling i915 ioctls on it
PATCH 1/1 Check that the drm fd is i915 before calling i915 ioctls on it
Signed-off-by Adam Jackson <[email protected]>
--- src/intel_module.c | 14 ++++++++++---- 1 files changed, 10 insertions(+), 4 deletions(-)
src/intel_module.c +10 -4
@@ -392,11 +392,17 @@ static Bool has_kernel_mode_setting(struct pci_device *dev) ret = FALSE; fd =drmOpen (NULL , id);if (fd !=-1 ) { -struct drm_i915_getparam gp; +drmVersionPtr v; - gp.param =I915_PARAM_HAS_GEM ; - gp.value = &ret; - (void )drmIoctl (fd,DRM_IOCTL_I915_GETPARAM , &gp); + v =drmGetVersion (fd); +if (v && !strcmp (v->name,"i915" )) { +struct drm_i915_getparam gp; + + gp.param =I915_PARAM_HAS_GEM ; + gp.value = &ret; + (void )drmIoctl (fd,DRM_IOCTL_I915_GETPARAM , &gp); + } +drmFreeVersion (v);close (fd); }
Signature · 1 line
1.7.7.6