drm-shim: Return -EINVAL instead of abort()ing on unknown ioctls.
authorEric Anholt <eric@anholt.net>
Mon, 20 Jul 2020 18:21:36 +0000 (11:21 -0700)
committerMarge Bot <eric+marge@anholt.net>
Thu, 30 Jul 2020 19:59:20 +0000 (19:59 +0000)
I had this as abort() in my original implementation since I was doing
drm-shim and my kernel driver in parallel based around using a SW
simulator, and I wanted to always update both, but it means that people's
new feature detection code can easily end up breaing their drm-shim
shader-db runs (such as intel's kernel_has_dynamic_config_support()
checking for -ENOENT instead of -EINVAL for a feature, which showed up on
my personal runner but not fd.o's for reasons I'm unclear on).

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5994>

src/drm-shim/device.c

index 2ad25344087f6dd7a6ca7a8cd1dfc885c7f2fbee..97bb1183ea88fc474a21884f9df27402accaf401 100644 (file)
@@ -261,7 +261,7 @@ drm_shim_ioctl(int fd, unsigned long request, void *arg)
               nr, request);
    }
 
-   abort();
+   return -EINVAL;
 }
 
 void