Re: [Mesa-dev] [PATCH 2/2] Android: EGL: fix missing nativewindow.h include on O

2017-08-24 Thread Chih-Wei Huang
2017-08-24 22:02 GMT+08:00 Rob Herring :
> On Thu, Aug 24, 2017 at 4:08 AM, Chih-Wei Huang  
> wrote:
>> 2017-08-24 1:25 GMT+08:00 Rob Herring :
>>
>> I'm also trying to fix it.
>> Seems it only requires the headers instead
>> of the shared library. Adding libnativewindow to
>> LOCAL_SHARED_LIBRARIES would add the
>> unnecessary dependency to libGLES_mesa.so.
>
> Then the correct way to do this is LOCAL_HEADER_LIBRARIES instead.

Right. Unfortunately these two libs don't define
cc_library_headers in their Android.bp
so we can't use it.

>> Locally I fixed it in this way:
>>
>> diff --git a/src/egl/Android.mk b/src/egl/Android.mk
>> index 4ccbb9b..9e96aca 100644
>> --- a/src/egl/Android.mk
>> +++ b/src/egl/Android.mk
>> @@ -43,6 +43,8 @@ LOCAL_CFLAGS := \
>> -D_EGL_BUILT_IN_DRIVER_DRI2
>>
>>  LOCAL_C_INCLUDES := \
>> +   frameworks/native/libs/arect/include \
>> +   frameworks/native/libs/nativewindow/include \
>
> Doing external includes this way is exactly what we don't want to do.
> There's a defined way to do cross project headers.

Agree.
But better than add extra unnecessary dependency IMO.

Fortunately we have a much better solution
as suggested by Emil.
I just tested it and it works as expected.
Since it only needs the name ANativeWindow,
forward declaration fits the purpose perfectly.


-- 
Chih-Wei
Android-x86 project
http://www.android-x86.org
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 2/2] Android: EGL: fix missing nativewindow.h include on O

2017-08-24 Thread Rob Herring
On Thu, Aug 24, 2017 at 4:08 AM, Chih-Wei Huang  wrote:
> 2017-08-24 1:25 GMT+08:00 Rob Herring :
>> The build against AOSP master and O is broken:
>>
>> external/mesa3d/include/EGL/eglplatform.h:100:10: fatal error: 
>> 'android/native_window.h' file not found
>>
>> native_window.h has moved and is now part of libnativewindow library, so
>> add this dependency.
>>
>> Signed-off-by: Rob Herring 
>> ---
>>  src/egl/Android.mk | 4 
>>  1 file changed, 4 insertions(+)
>>
>> diff --git a/src/egl/Android.mk b/src/egl/Android.mk
>> index 00553226773e..3852deb4364c 100644
>> --- a/src/egl/Android.mk
>> +++ b/src/egl/Android.mk
>> @@ -58,6 +58,10 @@ LOCAL_SHARED_LIBRARIES := \
>> libgralloc_drm \
>> libsync
>>
>> +ifeq ($(filter $(MESA_ANDROID_MAJOR_VERSION),5 6 7),)
>> +LOCAL_SHARED_LIBRARIES += libnativewindow
>> +endif
>
> I'm also trying to fix it.
> Seems it only requires the headers instead
> of the shared library. Adding libnativewindow to
> LOCAL_SHARED_LIBRARIES would add the
> unnecessary dependency to libGLES_mesa.so.

Then the correct way to do this is LOCAL_HEADER_LIBRARIES instead.

>
> Locally I fixed it in this way:
>
> diff --git a/src/egl/Android.mk b/src/egl/Android.mk
> index 4ccbb9b..9e96aca 100644
> --- a/src/egl/Android.mk
> +++ b/src/egl/Android.mk
> @@ -43,6 +43,8 @@ LOCAL_CFLAGS := \
> -D_EGL_BUILT_IN_DRIVER_DRI2
>
>  LOCAL_C_INCLUDES := \
> +   frameworks/native/libs/arect/include \
> +   frameworks/native/libs/nativewindow/include \

Doing external includes this way is exactly what we don't want to do.
There's a defined way to do cross project headers.

Rob
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 2/2] Android: EGL: fix missing nativewindow.h include on O

2017-08-24 Thread Eric Engestrom
On Thursday, 2017-08-24 11:07:27 +0100, Emil Velikov wrote:
> On 23 August 2017 at 18:25, Rob Herring  wrote:
> > The build against AOSP master and O is broken:
> >
> > external/mesa3d/include/EGL/eglplatform.h:100:10: fatal error: 
> > 'android/native_window.h' file not found
> >
> > native_window.h has moved and is now part of libnativewindow library, so
> > add this dependency.
> >
> That ones seems resolved upstream [1] in a rather nice way IMHO.
> Note that we cannot use the upstream header since there's local changes in 
> Mesa.
> 
> I've attempted to address the underlying issue by moving from implicit
> to explicit, Vulkan-like, platform detection/selection here [2]. I'll
> see about getting that sorted with Khronos, but using a patch similar
> to [1] might be the better option?
> 
> What do you guys think?

I agree, it's cleaner to align with Khronos and simply forward declare
the struct, rather than having to track changes in include paths and
libraries.
Sending this patch in a minute.

> -Emil
> 
> [1] 
> https://github.com/KhronosGroup/EGL-Registry/commit/89be4fbc3ace60f03c0f3b221fff3b6c772bc21e
> [2] 
> http://patchwork.freedesktop.org/bundle/evelikov/explicit-platforms-for-eglplatform/
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 2/2] Android: EGL: fix missing nativewindow.h include on O

2017-08-24 Thread Tapani Pälli

Hi;

On 08/24/2017 12:08 PM, Chih-Wei Huang wrote:

2017-08-24 1:25 GMT+08:00 Rob Herring :

The build against AOSP master and O is broken:

external/mesa3d/include/EGL/eglplatform.h:100:10: fatal error: 
'android/native_window.h' file not found

native_window.h has moved and is now part of libnativewindow library, so
add this dependency.

Signed-off-by: Rob Herring 
---
  src/egl/Android.mk | 4 
  1 file changed, 4 insertions(+)

diff --git a/src/egl/Android.mk b/src/egl/Android.mk
index 00553226773e..3852deb4364c 100644
--- a/src/egl/Android.mk
+++ b/src/egl/Android.mk
@@ -58,6 +58,10 @@ LOCAL_SHARED_LIBRARIES := \
 libgralloc_drm \
 libsync

+ifeq ($(filter $(MESA_ANDROID_MAJOR_VERSION),5 6 7),)
+LOCAL_SHARED_LIBRARIES += libnativewindow
+endif


I'm also trying to fix it.
Seems it only requires the headers instead
of the shared library. Adding libnativewindow to
LOCAL_SHARED_LIBRARIES would add the
unnecessary dependency to libGLES_mesa.so.

Locally I fixed it in this way:

diff --git a/src/egl/Android.mk b/src/egl/Android.mk
index 4ccbb9b..9e96aca 100644
--- a/src/egl/Android.mk
+++ b/src/egl/Android.mk
@@ -43,6 +43,8 @@ LOCAL_CFLAGS := \
 -D_EGL_BUILT_IN_DRIVER_DRI2

  LOCAL_C_INCLUDES := \
+   frameworks/native/libs/arect/include \
+   frameworks/native/libs/nativewindow/include \
 $(MESA_TOP)/src/egl/main \
 $(MESA_TOP)/src/egl/drivers/dri2 \
 $(MESA_TOP)/src/gallium/include



  # This controls enabling building of driver libraries
  ifneq ($(HAVE_I915_DRI),)
  LOCAL_REQUIRED_MODULES += i915_dri
--


This matches what we do in Android-IA:

https://github.com/intel/external-mesa/commit/643cc9b43aee0565d4d672beaca185bf476a7ee3

// Tapani
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 2/2] Android: EGL: fix missing nativewindow.h include on O

2017-08-24 Thread Emil Velikov
On 23 August 2017 at 18:25, Rob Herring  wrote:
> The build against AOSP master and O is broken:
>
> external/mesa3d/include/EGL/eglplatform.h:100:10: fatal error: 
> 'android/native_window.h' file not found
>
> native_window.h has moved and is now part of libnativewindow library, so
> add this dependency.
>
That ones seems resolved upstream [1] in a rather nice way IMHO.
Note that we cannot use the upstream header since there's local changes in Mesa.

I've attempted to address the underlying issue by moving from implicit
to explicit, Vulkan-like, platform detection/selection here [2]. I'll
see about getting that sorted with Khronos, but using a patch similar
to [1] might be the better option?

What do you guys think?
-Emil

[1] 
https://github.com/KhronosGroup/EGL-Registry/commit/89be4fbc3ace60f03c0f3b221fff3b6c772bc21e
[2] 
http://patchwork.freedesktop.org/bundle/evelikov/explicit-platforms-for-eglplatform/
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 2/2] Android: EGL: fix missing nativewindow.h include on O

2017-08-24 Thread Chih-Wei Huang
2017-08-24 1:25 GMT+08:00 Rob Herring :
> The build against AOSP master and O is broken:
>
> external/mesa3d/include/EGL/eglplatform.h:100:10: fatal error: 
> 'android/native_window.h' file not found
>
> native_window.h has moved and is now part of libnativewindow library, so
> add this dependency.
>
> Signed-off-by: Rob Herring 
> ---
>  src/egl/Android.mk | 4 
>  1 file changed, 4 insertions(+)
>
> diff --git a/src/egl/Android.mk b/src/egl/Android.mk
> index 00553226773e..3852deb4364c 100644
> --- a/src/egl/Android.mk
> +++ b/src/egl/Android.mk
> @@ -58,6 +58,10 @@ LOCAL_SHARED_LIBRARIES := \
> libgralloc_drm \
> libsync
>
> +ifeq ($(filter $(MESA_ANDROID_MAJOR_VERSION),5 6 7),)
> +LOCAL_SHARED_LIBRARIES += libnativewindow
> +endif

I'm also trying to fix it.
Seems it only requires the headers instead
of the shared library. Adding libnativewindow to
LOCAL_SHARED_LIBRARIES would add the
unnecessary dependency to libGLES_mesa.so.

Locally I fixed it in this way:

diff --git a/src/egl/Android.mk b/src/egl/Android.mk
index 4ccbb9b..9e96aca 100644
--- a/src/egl/Android.mk
+++ b/src/egl/Android.mk
@@ -43,6 +43,8 @@ LOCAL_CFLAGS := \
-D_EGL_BUILT_IN_DRIVER_DRI2

 LOCAL_C_INCLUDES := \
+   frameworks/native/libs/arect/include \
+   frameworks/native/libs/nativewindow/include \
$(MESA_TOP)/src/egl/main \
$(MESA_TOP)/src/egl/drivers/dri2 \
$(MESA_TOP)/src/gallium/include


>  # This controls enabling building of driver libraries
>  ifneq ($(HAVE_I915_DRI),)
>  LOCAL_REQUIRED_MODULES += i915_dri
> --



-- 
Chih-Wei
Android-x86 project
http://www.android-x86.org
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev