On Thu, Oct 17, 2019 at 06:10:55PM +0000, Mikolaj Kucharski wrote: > On Thu, Oct 17, 2019 at 05:38:50PM +0000, Mikolaj Kucharski wrote: > > On Fri, Oct 18, 2019 at 01:10:08AM +1100, Jonathan Gray wrote: > > > > With intel driver compiled with above Git commit Xorg dies with: > > > > > > > > Fatal server error: > > > > [ 137.310] (EE) __kgem_bo_map__cpu:697 assertion 'err != -EINVAL || > > > > bo->prime' failed > > > > > > What is the value of err when this occurs? > > > > It was later in the email, in the Xorg.0.log output, see below. > > > > > The ktrace output at around this point would also help. > > > > Ok, will try to get this. > > Ok, I have `bt full` output, ktrace / kdump output and Xorg.0.log from > that particular crash.
They call the ioctl with the old (wrong) size and have their own local definitions. Try the following diff. Note that there has not been a xf86-video-intel release since 2.99.917 in 2014 and modesetting is the default for your hardware. Linux seems to have some kludge to zero extend up to the real size when called with the wrong size: https://www.kernel.org/doc/Documentation/ioctl/botching-up-ioctls.rst "The drm core checks the passed-in size for each ioctl call and zero-extends any mismatches between kernel and userspace." We do ioctl copyin/copyout in sys_ioctl() not in drm. diff --git a/src/sna/kgem.c b/src/sna/kgem.c index 9c0708a6..471d1f98 100644 --- a/src/sna/kgem.c +++ b/src/sna/kgem.c @@ -682,7 +682,7 @@ retry_wc: static void *__kgem_bo_map__cpu(struct kgem *kgem, struct kgem_bo *bo) { - struct local_i915_gem_mmap arg; + struct local_i915_gem_mmap2 arg; int err; VG_CLEAR(arg); @@ -691,7 +691,7 @@ static void *__kgem_bo_map__cpu(struct kgem *kgem, struct kgem_bo *bo) retry: arg.handle = bo->handle; arg.size = bytes(bo); - if ((err = do_ioctl(kgem->fd, LOCAL_IOCTL_I915_GEM_MMAP, &arg))) { + if ((err = do_ioctl(kgem->fd, LOCAL_IOCTL_I915_GEM_MMAP_v2, &arg))) { DBG(("%s: failed %d, throttling/cleaning caches\n", __FUNCTION__, err)); assert(err != -EINVAL || bo->prime);
