All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] package/sdl2: disable OpenGL ES 1.1 with sunxi-mali as libgles provider
@ 2017-06-04 21:59 Romain Naour
  2017-06-05  8:54 ` Thomas Petazzoni
  0 siblings, 1 reply; 3+ messages in thread
From: Romain Naour @ 2017-06-04 21:59 UTC (permalink / raw)
  To: buildroot

OpenGL ES 1.1 and OpenGL ES 2.0 can't be enabled at the same time
with sunxi-mali as libgles provider due to conflicting types for
'GLintptr' in GLES2/gl2.h and GLES/gl.h

Fixes:
http://autobuild.buildroot.net/results/258/25898b45cefde9661d8ac87dd84bc883bb5283d1

Signed-off-by: Romain Naour <romain.naour@gmail.com>
---
 package/sdl2/sdl2.mk | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/package/sdl2/sdl2.mk b/package/sdl2/sdl2.mk
index a0a4489..2917475 100644
--- a/package/sdl2/sdl2.mk
+++ b/package/sdl2/sdl2.mk
@@ -111,6 +111,13 @@ else
 SDL2_CONF_OPTS += --disable-video-opengles
 endif
 
+# OpenGL ES 1.1 and OpenGL ES 2.0 can't be enabled at the same time
+# with sunxi-mali as libgles provider due to conflicting types for
+# 'GLintptr' in GLES2/gl2.h and GLES/gl.h
+ifeq ($(BR2_PACKAGE_SUNXI_MALI),y)
+SDL2_CONF_OPTS += --disable-video-opengles1
+endif
+
 ifeq ($(BR2_PACKAGE_TSLIB),y)
 SDL2_DEPENDENCIES += tslib
 SDL2_CONF_OPTS += --enable-input-tslib
-- 
2.9.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [Buildroot] [PATCH] package/sdl2: disable OpenGL ES 1.1 with sunxi-mali as libgles provider
  2017-06-04 21:59 [Buildroot] [PATCH] package/sdl2: disable OpenGL ES 1.1 with sunxi-mali as libgles provider Romain Naour
@ 2017-06-05  8:54 ` Thomas Petazzoni
  2017-06-05 10:30   ` Romain Naour
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Petazzoni @ 2017-06-05  8:54 UTC (permalink / raw)
  To: buildroot

Hello,

On Sun,  4 Jun 2017 23:59:32 +0200, Romain Naour wrote:

> +# OpenGL ES 1.1 and OpenGL ES 2.0 can't be enabled at the same time
> +# with sunxi-mali as libgles provider due to conflicting types for
> +# 'GLintptr' in GLES2/gl2.h and GLES/gl.h
> +ifeq ($(BR2_PACKAGE_SUNXI_MALI),y)
> +SDL2_CONF_OPTS += --disable-video-opengles1
> +endif

This doesn't feel like the right fix:

 - We had a somewhat similar problem (though not exactly the same) with
   odroid-mali, and it was fixed in odroid-mali.

 - You're fixing the problem with sdl2, but fundamentally the real
   problem is in sunxi-mali headers. Which means the exact same problem
   can happen with other users of sunxi-mali than sdl2.

So, it should be fixed in sunxi-mali. To me, it looks like GLES/gl.h is
bogus and needs to be updated. Of course, you need to be careful and
make sure that the change of type definition doesn't affect the width
of the types: sunxi-mali is binary only, so you cannot change its ABI.

But for example, GLES/gl.h contains:

typedef int * GLintptr;

while GLES2/gl2.h contains:

typedef khronos_intptr_t GLintptr;

with:

typedef signed   long  int     khronos_intptr_t;

So, changing GLES/gl.h to define GLintptr to be khronos_intptr_t should
be fine. Of course, the same change needs to be done for the other
types.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Buildroot] [PATCH] package/sdl2: disable OpenGL ES 1.1 with sunxi-mali as libgles provider
  2017-06-05  8:54 ` Thomas Petazzoni
@ 2017-06-05 10:30   ` Romain Naour
  0 siblings, 0 replies; 3+ messages in thread
From: Romain Naour @ 2017-06-05 10:30 UTC (permalink / raw)
  To: buildroot

Hi Thomas,

Le 05/06/2017 ? 10:54, Thomas Petazzoni a ?crit :
> Hello,
> 
> On Sun,  4 Jun 2017 23:59:32 +0200, Romain Naour wrote:
> 
>> +# OpenGL ES 1.1 and OpenGL ES 2.0 can't be enabled at the same time
>> +# with sunxi-mali as libgles provider due to conflicting types for
>> +# 'GLintptr' in GLES2/gl2.h and GLES/gl.h
>> +ifeq ($(BR2_PACKAGE_SUNXI_MALI),y)
>> +SDL2_CONF_OPTS += --disable-video-opengles1
>> +endif
> 
> This doesn't feel like the right fix:
> 
>  - We had a somewhat similar problem (though not exactly the same) with
>    odroid-mali, and it was fixed in odroid-mali.
> 
>  - You're fixing the problem with sdl2, but fundamentally the real
>    problem is in sunxi-mali headers. Which means the exact same problem
>    can happen with other users of sunxi-mali than sdl2.

Indeed, I'm not so happy with this patch but I didn't wanted to modify the sunxi
headers...

> 
> So, it should be fixed in sunxi-mali. To me, it looks like GLES/gl.h is
> bogus and needs to be updated. Of course, you need to be careful and
> make sure that the change of type definition doesn't affect the width
> of the types: sunxi-mali is binary only, so you cannot change its ABI.
> 
> But for example, GLES/gl.h contains:
> 
> typedef int * GLintptr;
> 
> while GLES2/gl2.h contains:
> 
> typedef khronos_intptr_t GLintptr;
> 
> with:
> 
> typedef signed   long  int     khronos_intptr_t;
> 
> So, changing GLES/gl.h to define GLintptr to be khronos_intptr_t should
> be fine. Of course, the same change needs to be done for the other
> types.

I'll try.

Best regards,
Romain

> 
> Best regards,
> 
> Thomas
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-06-05 10:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-04 21:59 [Buildroot] [PATCH] package/sdl2: disable OpenGL ES 1.1 with sunxi-mali as libgles provider Romain Naour
2017-06-05  8:54 ` Thomas Petazzoni
2017-06-05 10:30   ` Romain Naour

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.