[igt-dev] [PATCH i-g-t 1/2] lib/ioctl_wrappers: Keep IGT working without pread/pwrite ioctls

Dixit, Ashutosh ashutosh.dixit at intel.com
Fri Sep 4 23:34:18 UTC 2020


On Fri, 04 Sep 2020 09:20:25 -0700, Ashutosh Dixit wrote:
>
> The general direction at this time is to phase out pread/write ioctls
> and not support them in future products. This means IGT must be
> modified to handle the absence of pread/write ioctls. This patch does
> this as follows:
>
> * __gem_read, gem_read, __gem_write and gem_write calls which are
>   wrappers around the pread/pwrite ioctls have been renamed to
>   __gem_pread, gem_pread, __gem_pwrite and gem_pwrite. These will now
>   only be used where the pread/pwrite ioctls must absolutely be used,
>   such as tests which test these ioctls or must otherwise only use the
>   pread/pwrite ioctl's.

It seemed to me that these new functions (__gem_pread, gem_pread,
__gem_pwrite and gem_pwrite) were not needed after all since the callers of
these functions would anyway have to call gem_require_pread_pwrite() to
skip when the pread/pwrite ioctls were unavailable. Therefore
gem_require_pread_pwrite() itself indicates that only the pread/pwrite
ioctls must be used. Therefore I have dropped __gem_pread, gem_pread,
__gem_pwrite and gem_pwrite in v2. This results in further simplification
and also the two previous patches have been squashed into a single patch in
v2.

> * The new gem_read and gem_write function calls are now treated as
>   general purpose calls to read/write to a gem object. They now try
>   doing the read/write using the pread/pwrite ioctls first but when
>   these ioctls are unavailable they fall back to doing the read/write
>   using a combination of mmap and memcpy.


More information about the igt-dev mailing list