On Fri, Oct 18, 2019 at 05:07:56PM +1100, Jonathan Gray wrote:
> 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.

Yeah, I've looked at my 10-video.conf config and I have modesetting and
intel configuration there, where intel is enabled and modesetting is
commented out. I don't remember why I switched from modesetting to
intel.

I guess I can switch back to modesetting and see how it goes.

> 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);

With above patch, it fails with the same way, kdump is a bit different
though:


 47654 Xorg     CALL  ioctl(9,DRM_IOCTL_I915_GEM_MMAP,0x7f7ffffc5cc8)
 47654 Xorg     RET   ioctl -1 errno 22 Invalid argument
 47654 Xorg     CALL  clock_gettime(CLOCK_MONOTONIC,0x7f7ffffc5670)
 47654 Xorg     STRU  struct timespec { 235.067149715 }
 47654 Xorg     RET   clock_gettime 0
 47654 Xorg     CALL  write(3,0x7f7ffffc4f10,0xd)
 47654 Xorg     GIO   fd 3 wrote 13 bytes
       "[   235.067] "
 47654 Xorg     RET   write 13/0xd
 47654 Xorg     CALL  write(3,0x7f7ffffc56e0,0x3b)
 47654 Xorg     GIO   fd 3 wrote 59 bytes
       "__kgem_bo_map__cpu: failed -22, throttling/cleaning caches
       "
 47654 Xorg     RET   write 59/0x3b
 47654 Xorg     CALL  kbind(0x7f7ffffc5be8,24,0x2bb7bd85ef194579)
 47654 Xorg     RET   kbind 0
 47654 Xorg     CALL  kbind(0x7f7ffffc5be8,24,0x2bb7bd85ef194579)
 47654 Xorg     RET   kbind 0
 47654 Xorg     CALL  write(2,0x1eb75ef96cb,0x4)
 47654 Xorg     GIO   fd 2 wrote 4 bytes
       "(EE)"
 47654 Xorg     RET   write 4
 47654 Xorg     CALL  clock_gettime(CLOCK_MONOTONIC,0x7f7ffffc5630)
 47654 Xorg     STRU  struct timespec { 235.067185487 }
 47654 Xorg     RET   clock_gettime 0
 47654 Xorg     CALL  write(3,0x7f7ffffc4ed0,0xd)
 47654 Xorg     GIO   fd 3 wrote 13 bytes
       "[   235.067] "
 47654 Xorg     RET   write 13/0xd
 47654 Xorg     CALL  write(3,0x1eb75ef96cb,0x4)
 47654 Xorg     GIO   fd 3 wrote 4 bytes
       "(EE)"
 47654 Xorg     RET   write 4
 47654 Xorg     CALL  write(2,0x1eb75ef63ed,0x1)
 47654 Xorg     GIO   fd 2 wrote 1 bytes
       " "
 47654 Xorg     RET   write 1
 47654 Xorg     CALL  write(3,0x1eb75ef63ed,0x1)
 47654 Xorg     GIO   fd 3 wrote 1 bytes
       " "
 47654 Xorg     RET   write 1
 47654 Xorg     CALL  write(2,0x7f7ffffc56a0,0x15)
 47654 Xorg     GIO   fd 2 wrote 21 bytes
       "
        Fatal server error:
       "
 47654 Xorg     RET   write 21/0x15
 47654 Xorg     CALL  write(3,0x7f7ffffc56a0,0x15)
 47654 Xorg     GIO   fd 3 wrote 21 bytes
       "
        Fatal server error:
       "
 47654 Xorg     RET   write 21/0x15
 47654 Xorg     CALL  write(2,0x1eb75ef96cb,0x4)
 47654 Xorg     GIO   fd 2 wrote 4 bytes
       "(EE)"
 47654 Xorg     RET   write 4
 47654 Xorg     CALL  clock_gettime(CLOCK_MONOTONIC,0x7f7ffffc5710)
 47654 Xorg     STRU  struct timespec { 235.067220494 }
 47654 Xorg     RET   clock_gettime 0
 47654 Xorg     CALL  write(3,0x7f7ffffc4fb0,0xd)
 47654 Xorg     GIO   fd 3 wrote 13 bytes
       "[   235.067] "
 47654 Xorg     RET   write 13/0xd
 47654 Xorg     CALL  write(3,0x1eb75ef96cb,0x4)
 47654 Xorg     GIO   fd 3 wrote 4 bytes
       "(EE)"
 47654 Xorg     RET   write 4
 47654 Xorg     CALL  write(2,0x1eb75ef63ed,0x1)
 47654 Xorg     GIO   fd 2 wrote 1 bytes
       " "
 47654 Xorg     RET   write 1
 47654 Xorg     CALL  write(3,0x1eb75ef63ed,0x1)
 47654 Xorg     GIO   fd 3 wrote 1 bytes
       " "
 47654 Xorg     RET   write 1
 47654 Xorg     CALL  write(2,0x7f7ffffc5780,0x46)
 47654 Xorg     GIO   fd 2 wrote 70 bytes
       "__kgem_bo_map__cpu:697 assertion 'err != -EINVAL || bo->prime' failed
       "
 47654 Xorg     RET   write 70/0x46
 47654 Xorg     CALL  write(3,0x7f7ffffc5780,0x46)
 47654 Xorg     GIO   fd 3 wrote 70 bytes
       "__kgem_bo_map__cpu:697 assertion 'err != -EINVAL || bo->prime' failed
       "
 47654 Xorg     RET   write 70/0x46
 47654 Xorg     CALL  write(2,0x1eb75ef96cb,0x4)
 47654 Xorg     GIO   fd 2 wrote 4 bytes
       "(EE)"
 47654 Xorg     RET   write 4
 47654 Xorg     CALL  clock_gettime(CLOCK_MONOTONIC,0x7f7ffffc5630)
 47654 Xorg     STRU  struct timespec { 235.067255662 }
 47654 Xorg     RET   clock_gettime 0
 47654 Xorg     CALL  write(3,0x7f7ffffc4ed0,0xd)
 47654 Xorg     GIO   fd 3 wrote 13 bytes
       "[   235.067] "
 47654 Xorg     RET   write 13/0xd
 47654 Xorg     CALL  write(3,0x1eb75ef96cb,0x4)
 47654 Xorg     GIO   fd 3 wrote 4 bytes
       "(EE)"
 47654 Xorg     RET   write 4
 47654 Xorg     CALL  write(2,0x1eb75ef63ed,0x1)
 47654 Xorg     GIO   fd 2 wrote 1 bytes
       " "
 47654 Xorg     RET   write 1
 47654 Xorg     CALL  write(3,0x1eb75ef63ed,0x1)
 47654 Xorg     GIO   fd 3 wrote 1 bytes
       " "
 47654 Xorg     RET   write 1
 47654 Xorg     CALL  write(2,0x7f7ffffc56a0,0x1)
 47654 Xorg     GIO   fd 2 wrote 1 bytes
       "
       "
 47654 Xorg     RET   write 1
 47654 Xorg     CALL  write(3,0x7f7ffffc56a0,0x1)
 47654 Xorg     GIO   fd 3 wrote 1 bytes
       "
       "
 47654 Xorg     RET   write 1
 47654 Xorg     CALL  write(2,0x1eb75ef96cb,0x4)
 47654 Xorg     GIO   fd 2 wrote 4 bytes
       "(EE)"
 47654 Xorg     RET   write 4
 47654 Xorg     CALL  clock_gettime(CLOCK_MONOTONIC,0x7f7ffffc5620)
 47654 Xorg     STRU  struct timespec { 235.067290372 }
 47654 Xorg     RET   clock_gettime 0
 47654 Xorg     CALL  write(3,0x7f7ffffc4ec0,0xd)
 47654 Xorg     GIO   fd 3 wrote 13 bytes
       "[   235.067] "
 47654 Xorg     RET   write 13/0xd
 47654 Xorg     CALL  write(3,0x1eb75ef96cb,0x4)
 47654 Xorg     GIO   fd 3 wrote 4 bytes
       "(EE)"
 47654 Xorg     RET   write 4
 47654 Xorg     CALL  write(2,0x1eb75ef63ed,0x1)
 47654 Xorg     GIO   fd 2 wrote 1 bytes
       " "
 47654 Xorg     RET   write 1
 47654 Xorg     CALL  write(3,0x1eb75ef63ed,0x1)
 47654 Xorg     GIO   fd 3 wrote 1 bytes
       " "
 47654 Xorg     RET   write 1
 47654 Xorg     CALL  write(2,0x7f7ffffc5690,0x55)
 47654 Xorg     GIO   fd 2 wrote 85 bytes
       "
        Please consult the The X.Org Foundation support 
                 at http://wiki.x.org
         for help. 
       "
 47654 Xorg     RET   write 85/0x55
 47654 Xorg     CALL  write(3,0x7f7ffffc5690,0x55)
 47654 Xorg     GIO   fd 3 wrote 85 bytes
       "
        Please consult the The X.Org Foundation support 
                 at http://wiki.x.org
         for help. 
       "
 47654 Xorg     RET   write 85/0x55
 47654 Xorg     CALL  write(2,0x1eb75ef96cb,0x4)
 47654 Xorg     GIO   fd 2 wrote 4 bytes
       "(EE)"
 47654 Xorg     RET   write 4
 47654 Xorg     CALL  clock_gettime(CLOCK_MONOTONIC,0x7f7ffffc5620)
 47654 Xorg     STRU  struct timespec { 235.067325505 }
 47654 Xorg     RET   clock_gettime 0
 47654 Xorg     CALL  write(3,0x7f7ffffc4ec0,0xd)
 47654 Xorg     GIO   fd 3 wrote 13 bytes
       "[   235.067] "
 47654 Xorg     RET   write 13/0xd
 47654 Xorg     CALL  write(3,0x1eb75ef96cb,0x4)
 47654 Xorg     GIO   fd 3 wrote 4 bytes
       "(EE)"
 47654 Xorg     RET   write 4
 47654 Xorg     CALL  write(2,0x1eb75ef63ed,0x1)
 47654 Xorg     GIO   fd 2 wrote 1 bytes
       " "
 47654 Xorg     RET   write 1
 47654 Xorg     CALL  write(3,0x1eb75ef63ed,0x1)
 47654 Xorg     GIO   fd 3 wrote 1 bytes
       " "
 47654 Xorg     RET   write 1
 47654 Xorg     CALL  write(2,0x7f7ffffc5690,0x54)
 47654 Xorg     GIO   fd 2 wrote 84 bytes
       "Please also check the log file at "/var/log/Xorg.0.log" for additional 
information.
       "
 47654 Xorg     RET   write 84/0x54
 47654 Xorg     CALL  write(3,0x7f7ffffc5690,0x54)
 47654 Xorg     GIO   fd 3 wrote 84 bytes
       "Please also check the log file at "/var/log/Xorg.0.log" for additional 
information.
       "
 47654 Xorg     RET   write 84/0x54
 47654 Xorg     CALL  write(2,0x1eb75ef96cb,0x4)
 47654 Xorg     GIO   fd 2 wrote 4 bytes
       "(EE)"
 47654 Xorg     RET   write 4
 47654 Xorg     CALL  clock_gettime(CLOCK_MONOTONIC,0x7f7ffffc5630)
 47654 Xorg     STRU  struct timespec { 235.067445010 }
 47654 Xorg     RET   clock_gettime 0
 47654 Xorg     CALL  write(3,0x7f7ffffc4ed0,0xd)
 47654 Xorg     GIO   fd 3 wrote 13 bytes
       "[   235.067] "
 47654 Xorg     RET   write 13/0xd
 47654 Xorg     CALL  write(3,0x1eb75ef96cb,0x4)
 47654 Xorg     GIO   fd 3 wrote 4 bytes
       "(EE)"
 47654 Xorg     RET   write 4
 47654 Xorg     CALL  write(2,0x1eb75ef63ed,0x1)
 47654 Xorg     GIO   fd 2 wrote 1 bytes
       " "
 47654 Xorg     RET   write 1
 47654 Xorg     CALL  write(3,0x1eb75ef63ed,0x1)
 47654 Xorg     GIO   fd 3 wrote 1 bytes
       " "
 47654 Xorg     RET   write 1
 47654 Xorg     CALL  write(2,0x7f7ffffc56a0,0x1)
 47654 Xorg     GIO   fd 2 wrote 1 bytes
       "
       "
 47654 Xorg     RET   write 1
 47654 Xorg     CALL  write(3,0x7f7ffffc56a0,0x1)
 47654 Xorg     GIO   fd 3 wrote 1 bytes
       "
       "
 47654 Xorg     RET   write 1
 47654 Xorg     CALL  close(4)
 47654 Xorg     RET   close 0
 47654 Xorg     CALL  unlink(0x1ee63c60482)
 47654 Xorg     NAMI  "/tmp/.X11-unix/X0"
 47654 Xorg     RET   unlink 0
 47654 Xorg     CALL  unlink(0x1eb76151500)
 47654 Xorg     NAMI  "/tmp/.X0-lock"
 47654 Xorg     RET   unlink 0
 47654 Xorg     CALL  kbind(0x7f7ffffc5a78,24,0x2bb7bd85ef194579)
 47654 Xorg     RET   kbind 0
 47654 Xorg     CALL  kbind(0x7f7ffffc5a58,24,0x2bb7bd85ef194579)
 47654 Xorg     RET   kbind 0
 47654 Xorg     CALL  kbind(0x7f7ffffc5a78,24,0x2bb7bd85ef194579)
 47654 Xorg     RET   kbind 0
 47654 Xorg     CALL  kbind(0x7f7ffffc5a78,24,0x2bb7bd85ef194579)
 47654 Xorg     RET   kbind 0
 47654 Xorg     CALL  kbind(0x7f7ffffc5a78,24,0x2bb7bd85ef194579)
 47654 Xorg     RET   kbind 0
 47654 Xorg     CALL  kbind(0x7f7ffffc5aa8,24,0x2bb7bd85ef194579)
 47654 Xorg     RET   kbind 0
 47654 Xorg     CALL  ioctl(6,PCIOCSETVGA,0x7f7ffffc5b48)
 47654 Xorg     RET   ioctl -1 errno 22 Invalid argument
 47654 Xorg     CALL  ioctl(8,WSDISPLAYIO_SMODE,0x7f7ffffc5b4c)
 47654 Xorg     RET   ioctl 0
 47654 Xorg     CALL  ioctl(8,_IO('v',5),0x1)
 47654 Xorg     PSIG  SIGUSR2 caught handler=0x1eb75fd9230 mask=0<>
 47654 Xorg     RET   ioctl 0
 47654 Xorg     CALL  sigreturn(0x7f7ffffc5680)
 47654 Xorg     RET   sigreturn JUSTRETURN
 47654 Xorg     CALL  close(8)
 47654 Xorg     RET   close 0
 47654 Xorg     CALL  write(2,0x1eb75ef96cb,0x4)
 47654 Xorg     GIO   fd 2 wrote 4 bytes
       "(EE)"
 47654 Xorg     RET   write 4
 47654 Xorg     CALL  clock_gettime(CLOCK_MONOTONIC,0x7f7ffffc5600)
 47654 Xorg     STRU  struct timespec { 235.070392925 }
 47654 Xorg     RET   clock_gettime 0
 47654 Xorg     CALL  write(3,0x7f7ffffc4ea0,0xd)
 47654 Xorg     GIO   fd 3 wrote 13 bytes
       "[   235.070] "
 47654 Xorg     RET   write 13/0xd
 47654 Xorg     CALL  write(3,0x1eb75ef96cb,0x4)
 47654 Xorg     GIO   fd 3 wrote 4 bytes
       "(EE)"
 47654 Xorg     RET   write 4
 47654 Xorg     CALL  write(2,0x1eb75ef63ed,0x1)
 47654 Xorg     GIO   fd 2 wrote 1 bytes
       " "
 47654 Xorg     RET   write 1
 47654 Xorg     CALL  write(3,0x1eb75ef63ed,0x1)
 47654 Xorg     GIO   fd 3 wrote 1 bytes
       " "
 47654 Xorg     RET   write 1
 47654 Xorg     CALL  write(2,0x7f7ffffc5670,0x34)
 47654 Xorg     GIO   fd 2 wrote 52 bytes
       "Server terminated with error (1). Closing log file.
       "
 47654 Xorg     RET   write 52/0x34
 47654 Xorg     CALL  write(3,0x7f7ffffc5670,0x34)
 47654 Xorg     GIO   fd 3 wrote 52 bytes
       "Server terminated with error (1). Closing log file.
       "
 47654 Xorg     RET   write 52/0x34
 47654 Xorg     CALL  close(3)
 47654 Xorg     RET   close 0
 47654 Xorg     CALL  kbind(0x7f7ffffc5ad8,24,0x2bb7bd85ef194579)
 47654 Xorg     RET   kbind 0
 47654 Xorg     CALL  kbind(0x7f7ffffc5aa8,24,0x2bb7bd85ef194579)
 47654 Xorg     RET   kbind 0
 47654 Xorg     CALL  
sigprocmask(SIG_BLOCK,0xa3a2000<SIGALRM|SIGTSTP|SIGCHLD|SIGTTIN|SIGTTOU|SIGVTALRM|SIGWINCH>)
 47654 Xorg     RET   sigprocmask 0<>
 47654 Xorg     CALL  sigaction(SIGABRT,0x7f7ffffc5b58,0x7f7ffffc5b48)
 47654 Xorg     STRU  struct sigaction { handler=SIG_DFL, mask=0x20<SIGABRT>, 
flags=0<> }
 47654 Xorg     STRU  struct sigaction { handler=SIG_DFL, mask=0<>, flags=0<> }
 47654 Xorg     RET   sigaction 0
 47654 Xorg     CALL  kbind(0x7f7ffffc5ac8,24,0x2bb7bd85ef194579)
 47654 Xorg     RET   kbind 0
 47654 Xorg     CALL  sigprocmask(SIG_SETMASK,~0x20<SIGABRT>)
 47654 Xorg     RET   sigprocmask 
0xa3a2000<SIGALRM|SIGTSTP|SIGCHLD|SIGTTIN|SIGTTOU|SIGVTALRM|SIGWINCH>
 47654 Xorg     CALL  thrkill(0,SIGABRT,0)
 47654 Xorg     PSIG  SIGABRT SIG_DFL
 47654 Xorg     NAMI  "Xorg.core"

-- 
Regards,
 Mikolaj

Reply via email to