[RFC PATCH v1 2/3] drm: implement decoding of DRM ioctls
Dmitry V. Levin
ldv at altlinux.org
Sun Jun 16 18:15:11 UTC 2019
On Sun, Jun 16, 2019 at 08:56:54PM +0800, Zhibin Li wrote:
> On Thu, Jun 13, 2019 at 10:38 PM Dmitry V. Levin <ldv at altlinux.org> wrote:
> > On Thu, Jun 13, 2019 at 12:47:19AM +0800, Zhibin Li wrote:
> > [...]
> > > > > +#ifdef HAVE_DRM_H
> > > > > +# include <drm.h>
> > > > > +#else
> > > > > +# include <drm/drm.h>
> > > > > +#endif
> > > >
> > > > This means that either <drm.h> or <drm/drm.h> is always available.
> > > > Can we assume this?
> > >
> > > I think so, too. But here's what Patrik said about it:
> > > DRM is a bit tricky in this regard. All userspace applications should go
> > > through libdrm and never access ioctls directly. Some distributions even
> > > remove the drm headers from their kernel headers package to prevent any
> > > misuse.
> > > Will there be a situation that drm headers is removed while libdrm is
> > > absent? In such case they are not available. I'm not so sure about this.
> >
> > libdrm headers are not necessarily installed, so if kernel headers do not
> > provide drm headers, then neither <drm.h> nor <drm/drm.h> is available.
> >
> > We should handle this situation gracefully, either ifdef the whole bulk
> > of drm parsers or bail out at configure stage.
> >
> > When I try to ifdef the whole bulk of drm parsers, everything goes well in
> drm.c
> but in drm_mpers.c, I always get errors like:
>
> mpers-mx32/struct_drm_version.c:7: error: unterminated #if
> 7 | #if defined(HAVE_DRM_H) || defined(HAVE_DRM_DRM_H)
> |
> mpers-m32/struct_drm_version.c:7: error: unterminated #if
> 7 | #if defined(HAVE_DRM_H) || defined(HAVE_DRM_DRM_H)
>
> I guess something goes wrong in the mpers code because the last #endif is
> missing.
> Any clues what might be the cause?
Please have a look at HAVE_LINUX_BTRFS_H ifdefs in btrfs.c for a hint.
--
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20190616/dc5cdc05/attachment.bin>
More information about the Strace-devel
mailing list