Re: [PATCH v4] dma-buf: Add a capabilities directory

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jun 01, 2022 at 04:13:14PM +0000, Simon Ser wrote:
> To discover support for new DMA-BUF IOCTLs, user-space has no
> choice but to try to perform the IOCTL on an existing DMA-BUF.

Which is correct and how all kernel features work (sorry I missed the
main goal of this patch earlier and focused only on the sysfs stuff).

> However, user-space may want to figure out whether or not the
> IOCTL is available before it has a DMA-BUF at hand, e.g. at
> initialization time in a Wayland compositor.

Why not just do the ioctl in a test way?  That's how we determine kernel
features, we do not poke around in sysfs to determine what is, or is
not, present at runtime.

> Add a /sys/kernel/dmabuf/caps directory which allows the DMA-BUF
> subsystem to advertise supported features. Add a
> sync_file_import_export entry which indicates that importing and
> exporting sync_files from/to DMA-BUFs is supported.

No, sorry, this is not a sustainable thing to do for all kernel features
over time.  Please just do the ioctl and go from there.  sysfs is not
for advertising what is and is not enabled/present in a kernel with
regards to functionality or capabilities of the system.

If sysfs were to export this type of thing, it would have to do it for
everything, not just some random tiny thing of one kernel driver.

So no, sorry, this is not ok to be merged.

greg k-h



[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux