Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Yann E. MORIN <yann.morin.1998@free.fr>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 0/3] package/ti-stgx: tentative bump (branch yem/ti-sgx-stuff)
Date: Sat, 12 Dec 2020 18:39:36 +0100	[thread overview]
Message-ID: <20201212173936.GB3281876@scaer> (raw)
In-Reply-To: <20201212100634.GA3281876@scaer>

Adam, All,

On 2020-12-12 11:06 +0100, Yann E. MORIN spake thusly:
> On 2020-12-11 12:19 -0800, Adam Duskett spake thusly:
[--SNIP--]
> > Yann, you will have to either include Markus' patch or find a
> > different solution.
[--SNIP--]
> However, I suspect this patch is very incorrect for anything else that
> does have the eglGetPlatformDisplayEXT extension, like most other GL
> implmentations such as mesa...

OK, so after another day hacking around this issue, I think I eventually
nailed the reason why the upstream patch does not work. It is trying to
cast the nativeDisplay (an int) into a quintptr (an unsigned int). And
of course, this causes quite some grief to the compiler.

So, I have now two options:

 1. tweak the upstream patch to use a qintptr (not a quintptr) so that it
    now reads something like:

    -        display = getPlatformDisplay(EGL_PLATFORM_GBM_KHR, nativeDisplay, nullptr);
    +        qintptr nativeDisplayPtr = reinterpret_cast<qintptr>(nativeDisplay);
    +        display = getPlatformDisplay(EGL_PLATFORM_GBM_KHR, reinterpret_cast<void *>(nativeDisplayPtr), nullptr);

 2. take an even more direct and expeditious solution, to siply cast
    into a void*, like:

    -        display = getPlatformDisplay(EGL_PLATFORM_GBM_KHR, nativeDisplay, nullptr);
    +        display = getPlatformDisplay(EGL_PLATFORM_GBM_KHR, reinterpret_cast<void *>(nativeDisplay), nullptr);

After all, nativeDisplay is just an opaque type; getPlatformDisplay() is
just expected to pass that value to the lower-level layers that actually
talk to the GL implementation. nativeDisplay is thus either a pointer
already (which can be cast to a void* as the existing code already
does), or it is an integer of some sort, which is supposed to also fit
into a pointer.

Yeah, I know this is probably not true for some ABis, like x32, where
pointers are 32-bit but ints are 64-bit. But Buildroot does not support
x32 or the likes. Furthermore, getPlatformDisplay() anyway expects a
void*, so it would never be able to accomodate such situations.

So, I would be highly tempted to go for solution 2: it is easy, works
always, and it is no much more "meh" than the alternative...

Unless again I still missed something...

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

      reply	other threads:[~2020-12-12 17:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-10 20:47 [Buildroot] [PATCH 0/3] package/ti-stgx: tentative bump (branch yem/ti-sgx-stuff) Yann E. MORIN
2020-12-10 20:47 ` [Buildroot] [PATCH 1/3] configs/beaglebone_qt5: switch to using KMS instead of wayland+weston Yann E. MORIN
2020-12-11 19:08   ` Adam Duskett
2020-12-10 20:47 ` [Buildroot] [PATCH 2/3] package/ti-sgx-demos: use KMS-based demos Yann E. MORIN
2020-12-11 19:08   ` Adam Duskett
2020-12-10 20:47 ` [Buildroot] [PATCH 3/3] package/ti-sgx-{km, um}: bump to SDK 06.01.00.08 versions Yann E. MORIN
2020-12-11 19:09   ` Adam Duskett
2020-12-11 20:19 ` [Buildroot] [PATCH 0/3] package/ti-stgx: tentative bump (branch yem/ti-sgx-stuff) Adam Duskett
2020-12-12 10:06   ` Yann E. MORIN
2020-12-12 17:39     ` Yann E. MORIN [this message]

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=20201212173936.GB3281876@scaer \
    --to=yann.morin.1998@free.fr \
    --cc=buildroot@busybox.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