dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Pekka Paalanen <ppaalanen@gmail.com>
To: James Park <james.park@lagfreegames.com>
Cc: dri-devel <dri-devel@lists.freedesktop.org>,
	"Michel Dänzer" <michel@daenzer.net>,
	"James Park" <jpark37@lagfreegames.com>
Subject: Re: [PATCH] drm: Fix drm.h uapi header for Windows
Date: Mon, 7 Dec 2020 10:51:09 +0200	[thread overview]
Message-ID: <20201207105109.599273be@eldfell> (raw)
In-Reply-To: <CABjik9dirbf13ZiVBvufitGJXja6Xvn=EqTG_VtvBHjaAwJATg@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 2639 bytes --]

On Fri, 4 Dec 2020 11:07:41 -0800
James Park <james.park@lagfreegames.com> wrote:

> I could adjust the block to look like this:
> 
> #ifdef DRM_FOURCC_STANDALONE
> #if defined(__linux__)
> #include <linux/types.h>
> #else
> #include <stdint.h>
> typedef uint32_t __u32;
> typedef uint64_t __u64;
> #endif
> #else
> #include "drm.h"
> #endif
> 
> Alternatively, I could create a new common header to be included from both
> drm.h and drm_fourcc.h, drm_base_types.h or something like that:
> 
> #ifdef DRM_FOURCC_STANDALONE
> #include "drm_base_types.h"
> #else
> #include "drm.h"
> #endif

Hi,

my point is, any solution relying on DRM_FOURCC_STANDALONE will fail
sometimes, because there is no reason why userspace would *not* #define
DRM_FOURCC_STANDALONE. Hence, #ifdef DRM_FOURCC_STANDALONE is
completely moot, you have to make the headers work in any include
order when DRM_FOURCC_STANDALONE is defined anyway.


Thanks.
pq

> On Fri, Dec 4, 2020 at 7:58 AM Daniel Vetter <daniel@ffwll.ch> wrote:
> 
> > On Fri, Dec 4, 2020 at 9:12 AM Pekka Paalanen <ppaalanen@gmail.com> wrote:  
> > >
> > > On Thu, 3 Dec 2020 21:45:14 +0100
> > > Daniel Vetter <daniel@ffwll.ch> wrote:
> > >  
> > > > On Thu, Dec 3, 2020 at 7:55 PM James Park <james.park@lagfreegames.com>  
> > wrote:  
> > > > >
> > > > > The trailing underscore for  DRM_FOURCC_STANDALONE_ isn't
> > > > > intentional, right? Should I put all the integer types, or just the
> > > > > ones that are used in that file?  
> > > >
> > > > Yeah that trailing _ just slipped in. And I'd just do the types
> > > > already used. I don't think anything else than __u32 (for drm fourcc)
> > > > and __u64 (for drm modifier) is needed.  
> > >
> > > Hi,
> > >
> > > can that create conflicts if userspace first includes drm_fourcc.h and
> > > then drm.h?
> > >
> > > I would find it natural to userspace have generic headers including
> > > drm_fourcc.h and then DRM-specific C-files including drm.h as well
> > > (through libdrm headers). I think Weston might already do this.
> > >
> > > The generic userspace (weston) header would obviously #define
> > > DRM_FOURCC_STANDALONE, because it is used by non-DRM C-files as well.  
> >
> > Hm yes that would break. I guess we could just include the linux types
> > header for this. And I guess on windows you'd need to have that from
> > somewhere. Or we just require that users of the standalone header pull
> > the right header or defines in first?
> > -Daniel
> > --
> > Daniel Vetter
> > Software Engineer, Intel Corporation
> > http://blog.ffwll.ch
> >  


[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2020-12-07  8:51 UTC|newest]

Thread overview: 68+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-01 10:01 drm: Fix drm.h uapi header for Windows James Park
2020-12-01 10:01 ` [PATCH] " James Park
2020-12-02  8:46   ` Simon Ser
2020-12-02  9:07     ` James Park
2020-12-02  9:07       ` James Park
2020-12-02 11:42   ` Michel Dänzer
2020-12-02 12:46     ` Daniel Vetter
2020-12-02 18:06       ` Michel Dänzer
2020-12-02 19:47         ` James Park
2020-12-02 22:25           ` Daniel Vetter
2020-12-03  1:24             ` James Park
2020-12-03  9:05             ` Pekka Paalanen
2020-12-03 12:54             ` Ville Syrjälä
2020-12-03 13:13               ` Simon Ser
2020-12-03  8:18           ` Michel Dänzer
2020-12-03 14:52             ` Daniel Vetter
2020-12-03 18:55               ` James Park
2020-12-03 20:45                 ` Daniel Vetter
2020-12-04  4:53                   ` [PATCH] drm: Allow drm_fourcc.h without including drm.h James Park
2020-12-04  4:53                     ` James Park
2020-12-04  8:53                       ` Simon Ser
2020-12-04  9:47                         ` James Park
2020-12-04 10:08                           ` James Park
2020-12-04 14:46                       ` kernel test robot
2020-12-04 22:29                       ` kernel test robot
2020-12-04  8:11                   ` [PATCH] drm: Fix drm.h uapi header for Windows Pekka Paalanen
2020-12-04 15:58                     ` Daniel Vetter
2020-12-04 19:07                       ` James Park
2020-12-06  0:39                         ` [PATCH] drm: drm_basic_types.h, DRM_FOURCC_STANDALONE James Park
2020-12-06  0:39                           ` James Park
2020-12-07  9:45                             ` Simon Ser
2020-12-07  9:55                               ` James Park
2020-12-07  9:59                                 ` Simon Ser
2020-12-07 10:05                                   ` James Park
2020-12-07 10:15                                     ` Simon Ser
2020-12-07 17:25                             ` kernel test robot
2020-12-07 18:15                               ` James Park
2020-12-07 18:15                                 ` James Park
2020-12-08 12:31                                   ` Simon Ser
2020-12-08 18:32                                     ` James Park
2020-12-09 10:15                                       ` Simon Ser
2020-12-09 10:18                                   ` Simon Ser
2020-12-09 11:03                                     ` James Park
2020-12-09 11:03                                       ` James Park
2020-12-10  8:35                                         ` Pekka Paalanen
2020-12-10  9:12                                           ` James Park
2020-12-10  9:12                                             ` James Park
2021-02-01 21:45                                               ` James Park
2021-02-02 17:28                                                 ` Emil Velikov
2021-02-02 18:14                                                   ` James Park
2021-02-02 22:48                                                     ` Emil Velikov
2021-02-02 23:05                                                       ` Simon Ser
2021-02-02  8:51                                               ` Simon Ser
2021-02-02  8:52                                                 ` Simon Ser
2020-12-07  8:51                         ` Pekka Paalanen [this message]
2020-12-07  9:08                           ` [PATCH] drm: Fix drm.h uapi header for Windows James Park
2020-12-07 10:35                             ` Pekka Paalanen
2020-12-07 10:44                               ` Pekka Paalanen
2020-12-07 10:47                                 ` Simon Ser
2020-12-07 10:49                                   ` James Park
2020-12-07 10:53                                     ` Simon Ser
2020-12-07 11:01                                       ` James Park
2020-12-07 11:14                                       ` Pekka Paalanen
2020-12-08  1:08                                         ` James Park
2021-08-17 17:21                                           ` Jason Ekstrand
2020-12-07  9:48                         ` Simon Ser
2020-12-07 10:00                           ` James Park
2020-12-07 10:02                             ` Simon Ser

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201207105109.599273be@eldfell \
    --to=ppaalanen@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=james.park@lagfreegames.com \
    --cc=jpark37@lagfreegames.com \
    --cc=michel@daenzer.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).