Skip to contentSkip to conversation

android: libdrm_platform: add liblog shared dependency

PATCH In review Mauro Rossi 5 participants 15 messages Mar 17, 2019 – Jun 24, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 android: libdrm_platform: add liblog shared dependency

Fixes the following building error:

FAILED: $(OUT)/obj/SHARED_LIBRARIES/libdrm_platform_intermediates/LINKED/libdrm_platform.so
...
external/libdrm/xf86drm.c:146: error: undefined reference to '__android_log_vprint' clang.real: error: linker command failed with exit code 1 (use -v to see invocation)

---
 Android.mk | 3 +++
 1 file changed, 3 insertions(+)
Android.mk +3 -0
index f2c78bc1..f832b24e 100644
@@ -61,6 +61,9 @@ LOCAL_EXPORT_C_INCLUDE_DIRS := \
        $(LOCAL_PATH) \
        $(LOCAL_PATH)/include/drm
 
+LOCAL_SHARED_LIBRARIES := \
+	liblog
+
 LOCAL_C_INCLUDES := \
        $(LOCAL_PATH)/include/drm
 
Signature · 6 lines
2.19.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#1 lore raw

Hi,
I used the option --subject-prefix="PATCH libdrm"
but it did not go as expected.

Anyway, the patch is for Android build of mesa/drm Mauro

Quoted 28 lines · Mauro Rossi

Fixes the following building error:

FAILED: $(OUT)/obj/SHARED_LIBRARIES/libdrm_platform_intermediates/LINKED/libdrm_platform.so
...
external/libdrm/xf86drm.c:146: error: undefined reference to '__android_log_vprint' clang.real: error: linker command failed with exit code 1 (use -v to see invocation)

---
 Android.mk | 3 +++
 1 file changed, 3 insertions(+)
Android.mk +3 -1
index f2c78bc1..f832b24e 100644
@@ -61,6 +61,9 @@ LOCAL_EXPORT_C_INCLUDE_DIRS := \
        $(LOCAL_PATH) \
        $(LOCAL_PATH)/include/drm
 
+LOCAL_SHARED_LIBRARIES := \
+       liblog
+
 LOCAL_C_INCLUDES := \
        $(LOCAL_PATH)/include/drm
 
--
Quoted 2 lines

2.19.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Reviewed-by
#2 lore raw

This is probably a good idea!

Quoted 35 lines · Mauro Rossi

Hi,
I used the option --subject-prefix="PATCH libdrm"
but it did not go as expected.

Anyway, the patch is for Android build of mesa/drm Mauro

Quoted 27 lines · Mauro Rossi

Fixes the following building error:

FAILED: $(OUT)/obj/SHARED_LIBRARIES/libdrm_platform_intermediates/LINKED/libdrm_platform.so
...
external/libdrm/xf86drm.c:146: error: undefined reference to '__android_log_vprint' clang.real: error: linker command failed with exit code 1 (use -v to see invocation)

---
  Android.mk | 3 +++
  1 file changed, 3 insertions(+)
Android.mk +3 -0
index f2c78bc1..f832b24e 100644
@@ -61,6 +61,9 @@ LOCAL_EXPORT_C_INCLUDE_DIRS := \
         $(LOCAL_PATH) \
         $(LOCAL_PATH)/include/drm
 
+LOCAL_SHARED_LIBRARIES := \
+       liblog
+
  LOCAL_C_INCLUDES := \
         $(LOCAL_PATH)/include/drm
 
Quoted 8 lines
Quoted 3 lines

--
2.19.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#3 lore raw

On a second note, this does not apply on libdrm/master due to:

LOCAL_SHARED_LIBRARIES := \
libcutils

My thinking is that libcutils probably can be replaced with liblog, but I'm not 100% sure.

Rob.

Quoted 50 lines · Robert Foss

This is probably a good idea!

Quoted 44 lines · Mauro Rossi

Hi,
I used the option --subject-prefix="PATCH libdrm"
but it did not go as expected.

Anyway, the patch is for Android build of mesa/drm Mauro

Quoted 25 lines · Mauro Rossi

Fixes the following building error:

FAILED: $(OUT)/obj/SHARED_LIBRARIES/libdrm_platform_intermediates/LINKED/libdrm_platform.so

...
external/libdrm/xf86drm.c:146: error: undefined reference to '__android_log_vprint' clang.real: error: linker command failed with exit code 1 (use -v to see invocation)

---
  Android.mk | 3 +++

  1 file changed, 3 insertions(+)
Android.mk +0 -0
index f2c78bc1..f832b24e 100644
@@ -61,6 +61,9 @@ LOCAL_EXPORT_C_INCLUDE_DIRS := \
          $(LOCAL_PATH) \

         $(LOCAL_PATH)/include/drm

Android.mk +3 -0
+LOCAL_SHARED_LIBRARIES := \
+       liblog
+
Quoted 6 lines

  LOCAL_C_INCLUDES := \
         $(LOCAL_PATH)/include/drm

Signature · 1 line
2.19.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#4 lore raw

Hi Robert,

Quoted 6 lines · Robert Foss

On a second note, this does not apply on libdrm/master due to:

LOCAL_SHARED_LIBRARIES := \
libcutils

Sorry, we have an additional Google patch, not present in libdrm/master that adds libdrm_platform module, but it is for a specific Google issue. [1]

However with libdrm module we have both liblog and libcutils shared dependencies

[1] http://git.osdn.net/view?p=android-x86/external-libdrm.git;a=commit;h=8ccbfeab9fb2bddf4585339a0bcbea2f1e3ffa1e

Mauro

Quoted 61 lines

My thinking is that libcutils probably can be replaced with liblog, but I'm not 100% sure.

Rob.

Quoted 53 lines · Robert Foss

This is probably a good idea!

Quoted 47 lines · Mauro Rossi

Hi,
I used the option --subject-prefix="PATCH libdrm"
but it did not go as expected.

Anyway, the patch is for Android build of mesa/drm Mauro

Quoted 32 lines · Mauro Rossi

Fixes the following building error:

FAILED:
$(OUT)/obj/SHARED_LIBRARIES/libdrm_platform_intermediates/LINKED/libdrm_platform.so

...
external/libdrm/xf86drm.c:146: error: undefined reference to '__android_log_vprint'
clang.real: error: linker command failed with exit code 1 (use -v to see invocation)

---
  Android.mk | 3 +++
  1 file changed, 3 insertions(+)
Android.mk +3 -1
index f2c78bc1..f832b24e 100644
@@ -61,6 +61,9 @@ LOCAL_EXPORT_C_INCLUDE_DIRS := \
         $(LOCAL_PATH) \
         $(LOCAL_PATH)/include/drm
 
+LOCAL_SHARED_LIBRARIES := \
+       liblog
+
  LOCAL_C_INCLUDES := \
         $(LOCAL_PATH)/include/drm
 
--
Quoted 2 lines

2.19.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#5 lore raw

Hey Mauro,

Quoted 10 lines · Mauro Rossi

Hi Robert,

Quoted 6 lines · Robert Foss

On a second note, this does not apply on libdrm/master due to:

LOCAL_SHARED_LIBRARIES := \
libcutils

Quoted 6 lines

Sorry, we have an additional Google patch, not present in libdrm/master that adds libdrm_platform module, but it is for a specific Google issue. [1]

However with libdrm module we have both liblog and libcutils shared dependencies

[1] http://git.osdn.net/view?p=android-x86/external-libdrm.git;a=commit;h=8ccbfeab9fb2bddf4585339a0bcbea2f1e3ffa1e

Do you know if [1] causes incompatibility issues with earlier android verions? If not I would suggest upstreaming it too.

Quoted 64 lines

Mauro

Quoted 61 lines

My thinking is that libcutils probably can be replaced with liblog, but I'm not 100% sure.

Rob.

Quoted 53 lines · Robert Foss

This is probably a good idea!

Quoted 47 lines · Mauro Rossi

Hi,
I used the option --subject-prefix="PATCH libdrm"
but it did not go as expected.

Anyway, the patch is for Android build of mesa/drm Mauro

Quoted 32 lines · Mauro Rossi

Fixes the following building error:

FAILED:
$(OUT)/obj/SHARED_LIBRARIES/libdrm_platform_intermediates/LINKED/libdrm_platform.so

...
external/libdrm/xf86drm.c:146: error: undefined reference to '__android_log_vprint'
clang.real: error: linker command failed with exit code 1 (use -v to see invocation)

---
   Android.mk | 3 +++
   1 file changed, 3 insertions(+)
Android.mk +3 -1
index f2c78bc1..f832b24e 100644
@@ -61,6 +61,9 @@ LOCAL_EXPORT_C_INCLUDE_DIRS := \
          $(LOCAL_PATH) \
          $(LOCAL_PATH)/include/drm
 
+LOCAL_SHARED_LIBRARIES := \
+       liblog
+
   LOCAL_C_INCLUDES := \
          $(LOCAL_PATH)/include/drm
 
--
Quoted 2 lines

2.19.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Quoted 5 lines

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#6 lore raw

Hi,

Quoted 17 lines · Robert Foss

Hey Mauro,

Quoted 13 lines · Mauro Rossi

Hi Robert,

Quoted 6 lines · Robert Foss

On a second note, this does not apply on libdrm/master due to:

LOCAL_SHARED_LIBRARIES := \
libcutils

Sorry, we have an additional Google patch, not present in libdrm/master that adds libdrm_platform module, but it is for a specific Google issue. [1]

Quoted 6 lines
Quoted 3 lines

However with libdrm module we have both liblog and libcutils shared dependencies

[1] http://git.osdn.net/view?p=android-x86/external-libdrm.git;a=commit;h=8ccbfeab9fb2bddf4585339a0bcbea2f1e3ffa1e

Do you know if [1] causes incompatibility issues with earlier android verions? If not I would suggest upstreaming it too.

I used those patches to build with nougat-x86 and there was no issue.

To be precise I did a double rookie mistake, because __android_log_vprint not used in upstream libdrm and libdrm_platform not used either.

Now starting from my mistakes, let's see if there is anything useful to libdrm project

In our builds Chih-Wei Huang said that libdrm_platform is not used, meaning not added to packages list,
however with oreo-x86 the build error appeared and the liblog dependency.

__android_log_vprint is used with __ANDROID__ braces
in a special patch [2] by Chih-Wei Huang which adds capability to print logs in logcat

If it's not too invasive in libdrm, it could be useful. Cheers
Mauro

[2] http://git.osdn.net/view?p=android-x86/external-libdrm.git;a=commitdiff;h=bcee43063ffd52a8677029c9ae6f4203563460f4;hp=81d7264033db4946a00003bf1ee82eb6c21260f9

Quoted 65 lines
Quoted 65 lines

Mauro

Quoted 61 lines

My thinking is that libcutils probably can be replaced with liblog, but I'm not 100% sure.

Rob.

Quoted 53 lines · Robert Foss

This is probably a good idea!

Quoted 47 lines · Mauro Rossi

Hi,
I used the option --subject-prefix="PATCH libdrm"
but it did not go as expected.

Anyway, the patch is for Android build of mesa/drm Mauro

Quoted 32 lines · Mauro Rossi

Fixes the following building error:

FAILED:
$(OUT)/obj/SHARED_LIBRARIES/libdrm_platform_intermediates/LINKED/libdrm_platform.so

...
external/libdrm/xf86drm.c:146: error: undefined reference to '__android_log_vprint'
clang.real: error: linker command failed with exit code 1 (use -v to see invocation)

---
   Android.mk | 3 +++
   1 file changed, 3 insertions(+)
Android.mk +3 -1
index f2c78bc1..f832b24e 100644
@@ -61,6 +61,9 @@ LOCAL_EXPORT_C_INCLUDE_DIRS := \
          $(LOCAL_PATH) \
          $(LOCAL_PATH)/include/drm
 
+LOCAL_SHARED_LIBRARIES := \
+       liblog
+
   LOCAL_C_INCLUDES := \
          $(LOCAL_PATH)/include/drm
 
--
Quoted 2 lines

2.19.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Quoted 5 lines
Quoted 5 lines

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#7 lore raw

Hey,

Quoted 43 lines · Mauro Rossi

Hi,

Quoted 17 lines · Robert Foss

Hey Mauro,

Quoted 13 lines · Mauro Rossi

Hi Robert,

Quoted 6 lines · Robert Foss

On a second note, this does not apply on libdrm/master due to:

LOCAL_SHARED_LIBRARIES := \
libcutils

Sorry, we have an additional Google patch, not present in libdrm/master that adds libdrm_platform module, but it is for a specific Google issue. [1]

Quoted 6 lines
Quoted 3 lines

However with libdrm module we have both liblog and libcutils shared dependencies

[1] http://git.osdn.net/view?p=android-x86/external-libdrm.git;a=commit;h=8ccbfeab9fb2bddf4585339a0bcbea2f1e3ffa1e

Do you know if [1] causes incompatibility issues with earlier android verions? If not I would suggest upstreaming it too.

I used those patches to build with nougat-x86 and there was no issue.

To be precise I did a double rookie mistake, because __android_log_vprint not used in upstream libdrm and libdrm_platform not used either.

Now starting from my mistakes, let's see if there is anything useful to libdrm project

In our builds Chih-Wei Huang said that libdrm_platform is not used, meaning not added to packages list,
however with oreo-x86 the build error appeared and the liblog dependency.

__android_log_vprint is used with __ANDROID__ braces
in a special patch [2] by Chih-Wei Huang which adds capability to print logs in logcat

Quoted 5 lines

If it's not too invasive in libdrm, it could be useful. Cheers
Mauro

[2] http://git.osdn.net/view?p=android-x86/external-libdrm.git;a=commitdiff;h=bcee43063ffd52a8677029c9ae6f4203563460f4;hp=81d7264033db4946a00003bf1ee82eb6c21260f9

[2] Seems like a good idea to me.
Logcat really is the only intended path for logging on Android, and redirecting our logs there does make sense to me.

But, I'm not sure about I like the way [2] disregards log-levels in drmMsg().

Rob.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#8 lore raw
Quoted 51 lines · Robert Foss

Hey,

Quoted 48 lines · Mauro Rossi

Hi,

Quoted 17 lines · Robert Foss

Hey Mauro,

Quoted 13 lines · Mauro Rossi

Hi Robert,

Quoted 6 lines · Robert Foss

On a second note, this does not apply on libdrm/master due to:

LOCAL_SHARED_LIBRARIES := \
          libcutils

Sorry, we have an additional Google patch, not present in libdrm/master that adds libdrm_platform module, but it is for a specific Google issue. [1]

Quoted 7 lines
Quoted 4 lines

However with libdrm module we have both liblog and libcutils shared dependencies

[1] http://git.osdn.net/view?p=android-x86/external-libdrm.git;a=commit;h=8ccbfeab9fb2bddf4585339a0bcbea2f1e3ffa1e

Do you know if [1] causes incompatibility issues with earlier android verions? If not I would suggest upstreaming it too.

I used those patches to build with nougat-x86 and there was no issue.

To be precise I did a double rookie mistake, because __android_log_vprint not used in upstream libdrm and libdrm_platform not used either.

Now starting from my mistakes, let's see if there is anything useful to libdrm project

In our builds Chih-Wei Huang said that libdrm_platform is not used, meaning not added to packages list,
however with oreo-x86 the build error appeared and the liblog dependency.

  __android_log_vprint is used with __ANDROID__ braces
in a special patch [2] by Chih-Wei Huang which adds capability to print logs in logcat

If it's not too invasive in libdrm, it could be useful. Cheers
Mauro

Quoted 8 lines
Quoted 2 lines

[2] http://git.osdn.net/view?p=android-x86/external-libdrm.git;a=commitdiff;h=bcee43063ffd52a8677029c9ae6f4203563460f4;hp=81d7264033db4946a00003bf1ee82eb6c21260f9

[2] Seems like a good idea to me.
Logcat really is the only intended path for logging on Android, and redirecting our logs there does make sense to me.

But, I'm not sure about I like the way [2] disregards log-levels in drmMsg().

Yeah, I think it's a good idea. I see that in mesa we include "android/log.h", not "log/log.h", will need to make sure we get that correctly, maybe older versions did "log/log.h"?

// Tapani
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#9 lore raw
Quoted 67 lines · Tapani Pälli
Quoted 66 lines · Robert Foss

Hey,

Quoted 51 lines · Mauro Rossi

Hi,

Quoted 22 lines · Robert Foss

Hey Mauro,

Quoted 18 lines · Mauro Rossi

Hi Robert,

Quoted 6 lines · Robert Foss

On a second note, this does not apply on libdrm/master due to:

LOCAL_SHARED_LIBRARIES := \
libcutils

Sorry, we have an additional Google patch, not present in libdrm/master that adds libdrm_platform module, but it is for a specific Google issue. [1]

However with libdrm module we have both liblog and libcutils shared dependencies

Quoted 7 lines
Quoted 3 lines

[1]
http://git.osdn.net/view?p=android-x86/external-libdrm.git;a=commit;h=8ccbfeab9fb2bddf4585339a0bcbea2f1e3ffa1e

Do you know if [1] causes incompatibility issues with earlier android verions?
If not I would suggest upstreaming it too.

I used those patches to build with nougat-x86 and there was no issue.

To be precise I did a double rookie mistake, because __android_log_vprint not used in upstream libdrm and libdrm_platform not used either.

Now starting from my mistakes, let's see if there is anything useful to libdrm project

In our builds Chih-Wei Huang said that libdrm_platform is not used, meaning not added to packages list,
however with oreo-x86 the build error appeared and the liblog dependency.

__android_log_vprint is used with __ANDROID__ braces
in a special patch [2] by Chih-Wei Huang which adds capability to print logs
in logcat

Quoted 7 lines

If it's not too invasive in libdrm, it could be useful. Cheers
Mauro

[2]
http://git.osdn.net/view?p=android-x86/external-libdrm.git;a=commitdiff;h=bcee43063ffd52a8677029c9ae6f4203563460f4;hp=81d7264033db4946a00003bf1ee82eb6c21260f9

[2] Seems like a good idea to me.
Logcat really is the only intended path for logging on Android, and redirecting our logs there does make sense to me.

Quoted 8 lines
Quoted 3 lines

But, I'm not sure about I like the way [2] disregards log-levels in drmMsg().

Yeah, I think it's a good idea. I see that in mesa we include "android/log.h", not "log/log.h", will need to make sure we get that correctly, maybe older versions did "log/log.h"?

I would also be in favour of adding logcat support to libdrm.

Mauro, please respin when you have the time.

Thanks
Emil
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#10 lore raw

Hi Emil, Chih-Wei,

what about the series of latest three patches we have in oreo-x86 branch?

[oreo-x86 branch]
http://git.osdn.net/view?p=android-x86/external-libdrm.git;a=history;f=Android.mk;h=f832b24e99007c75ce3a8d9a3ece34d4e475e957;hb=refs/heads/oreo-x86

My doubt is about the one "android: make libdrm*.so available to the vendor partition",
should we keep it (and send to mesa/drm) so that we will simply have our x86 branches aligned to mesa/drm,
or should we skip it in both cases?

Once this is assessed I will either send the series of 3 or just the android logging one.
Mauro

Mauro

Quoted 77 lines · Emil Velikov
Quoted 67 lines · Tapani Pälli
Quoted 66 lines · Robert Foss

Hey,

Quoted 51 lines · Mauro Rossi

Hi,

Quoted 22 lines · Robert Foss

Hey Mauro,

Quoted 18 lines · Mauro Rossi

Hi Robert,

Quoted 6 lines · Robert Foss

On a second note, this does not apply on libdrm/master due to:

LOCAL_SHARED_LIBRARIES := \
libcutils

Sorry, we have an additional Google patch, not present in libdrm/master that adds libdrm_platform module, but it is for a specific Google issue. [1]

However with libdrm module we have both liblog and libcutils shared dependencies

Quoted 7 lines
Quoted 3 lines

[1]
http://git.osdn.net/view?p=android-x86/external-libdrm.git;a=commit;h=8ccbfeab9fb2bddf4585339a0bcbea2f1e3ffa1e

Do you know if [1] causes incompatibility issues with earlier android verions?
If not I would suggest upstreaming it too.

I used those patches to build with nougat-x86 and there was no issue.

To be precise I did a double rookie mistake, because __android_log_vprint not used in upstream libdrm and libdrm_platform not used either.

Now starting from my mistakes, let's see if there is anything useful to libdrm project

In our builds Chih-Wei Huang said that libdrm_platform is not used, meaning not added to packages list,
however with oreo-x86 the build error appeared and the liblog dependency.

__android_log_vprint is used with __ANDROID__ braces
in a special patch [2] by Chih-Wei Huang which adds capability to print logs
in logcat

Quoted 7 lines

If it's not too invasive in libdrm, it could be useful. Cheers
Mauro

[2]
http://git.osdn.net/view?p=android-x86/external-libdrm.git;a=commitdiff;h=bcee43063ffd52a8677029c9ae6f4203563460f4;hp=81d7264033db4946a00003bf1ee82eb6c21260f9

[2] Seems like a good idea to me.
Logcat really is the only intended path for logging on Android, and redirecting our logs there does make sense to me.

Quoted 8 lines
Quoted 3 lines

But, I'm not sure about I like the way [2] disregards log-levels in drmMsg().

Yeah, I think it's a good idea. I see that in mesa we include "android/log.h", not "log/log.h", will need to make sure we get that correctly, maybe older versions did "log/log.h"?

Quoted 6 lines

I would also be in favour of adding logcat support to libdrm.

Mauro, please respin when you have the time.

Thanks
Emil

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#11 lore raw

Here is patch using include <android/log.h>
which should suffice for the purpose.
Cheers

Mauro

Quoted 14 lines · Mauro Rossi

Hi Emil, Chih-Wei,

what about the series of latest three patches we have in oreo-x86 branch?

[oreo-x86 branch]
http://git.osdn.net/view?p=android-x86/external-libdrm.git;a=history;f=Android.mk;h=f832b24e99007c75ce3a8d9a3ece34d4e475e957;hb=refs/heads/oreo-x86

My doubt is about the one "android: make libdrm*.so available to the vendor partition",
should we keep it (and send to mesa/drm) so that we will simply have our x86 branches aligned to mesa/drm,
or should we skip it in both cases?

Quoted 90 lines

Once this is assessed I will either send the series of 3 or just the android logging one.
Mauro

Mauro

Quoted 83 lines · Emil Velikov
Quoted 67 lines · Tapani Pälli
Quoted 66 lines · Robert Foss

Hey,

Quoted 51 lines · Mauro Rossi

Hi,

Quoted 22 lines · Robert Foss

Hey Mauro,

Quoted 18 lines · Mauro Rossi

Hi Robert,

Quoted 6 lines · Robert Foss

On a second note, this does not apply on libdrm/master due to:

LOCAL_SHARED_LIBRARIES := \
libcutils

Sorry, we have an additional Google patch, not present in libdrm/master that adds libdrm_platform module, but it is for a specific Google issue. [1]

However with libdrm module we have both liblog and libcutils shared dependencies

Quoted 7 lines
Quoted 3 lines

[1]
http://git.osdn.net/view?p=android-x86/external-libdrm.git;a=commit;h=8ccbfeab9fb2bddf4585339a0bcbea2f1e3ffa1e

Do you know if [1] causes incompatibility issues with earlier android verions?
If not I would suggest upstreaming it too.

I used those patches to build with nougat-x86 and there was no issue.

To be precise I did a double rookie mistake, because __android_log_vprint not used in upstream libdrm and libdrm_platform not used either.

Now starting from my mistakes, let's see if there is anything useful to libdrm project

In our builds Chih-Wei Huang said that libdrm_platform is not used, meaning not added to packages list,
however with oreo-x86 the build error appeared and the liblog dependency.

__android_log_vprint is used with __ANDROID__ braces
in a special patch [2] by Chih-Wei Huang which adds capability to print logs
in logcat

Quoted 7 lines

If it's not too invasive in libdrm, it could be useful. Cheers
Mauro

[2]
http://git.osdn.net/view?p=android-x86/external-libdrm.git;a=commitdiff;h=bcee43063ffd52a8677029c9ae6f4203563460f4;hp=81d7264033db4946a00003bf1ee82eb6c21260f9

[2] Seems like a good idea to me.
Logcat really is the only intended path for logging on Android, and redirecting our logs there does make sense to me.

Quoted 8 lines
Quoted 3 lines

But, I'm not sure about I like the way [2] disregards log-levels in drmMsg().

Yeah, I think it's a good idea. I see that in mesa we include "android/log.h", not "log/log.h", will need to make sure we get that correctly, maybe older versions did "log/log.h"?

I would also be in favour of adding logcat support to libdrm.

Mauro, please respin when you have the time.

Thanks
Emil

From d8841affdf5ba969945dae50508dc813f057f147 Mon Sep 17 00:00:00 2001
From: Chih-Wei Huang <[email protected]>
Date: Fri, 11 Jan 2019 17:19:39 +0800
Subject: [PATCH] Android: redirect debug messages to logcat (v2)

(v1) original version using include <log/log.h>

(v2) include <android/log.h>

---
 Android.mk |  1 +
 xf86drm.c  | 10 ++++++++++
 2 files changed, 11 insertions(+)
Android.mk +1 -0
index df0275ec..f2c78bc1 100644
@@ -97,6 +97,7 @@ LOCAL_EXPORT_C_INCLUDE_DIRS := \
 	$(LOCAL_PATH)/android
 
 LOCAL_SHARED_LIBRARIES := \
+	liblog \
 	libcutils
 
 LOCAL_C_INCLUDES := \
xf86drm.c +10 -0
index fe822cad..a7ba855c 100644
@@ -71,6 +71,10 @@
 
 #include "util_math.h"
 
+#ifdef __ANDROID__
+#include <android/log.h>
+#endif
+
 #ifdef __OpenBSD__
 #define DRM_PRIMARY_MINOR_NAME  "drm"
 #define DRM_CONTROL_MINOR_NAME  "drmC"
@@ -140,16 +144,22 @@ drm_public void drmSetServerInfo(drmServerInfoPtr info)
 static int DRM_PRINTFLIKE(1, 0)
 drmDebugPrint(const char *format, va_list ap)
 {
+#ifdef __ANDROID__
+    return __android_log_vprint(ANDROID_LOG_DEBUG, "libdrm", format, ap);
+#else
     return vfprintf(stderr, format, ap);
+#endif
 }
 
 drm_public void
 drmMsg(const char *format, ...)
 {
     va_list ap;
+#ifndef __ANDROID__
     const char *env;
     if (((env = getenv("LIBGL_DEBUG")) && strstr(env, "verbose")) ||
         (drm_server_info && drm_server_info->debug_print))
+#endif
     {
         va_start(ap, format);
         if (drm_server_info) {
Signature · 1 line
2.20.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#12 lore raw

Sorry for the late reply since I didn't notice it. (I rarely read the ML)

The patch of Jiyong Park is the one he submitted to the ML before.
https://patchwork.kernel.org/patch/9864539/
https://patchwork.kernel.org/patch/10109599/

I'm not sure why it's not merged. Maybe just forgotten.

The 2nd and 3rd patch (mine and Mauro's) could be combined into one before submission, I think.

Mauro Rossi <[email protected]> 於 2019年4月27日 週六 上午6:06寫道:

Quoted 109 lines

Here is patch using include <android/log.h>
which should suffice for the purpose.
Cheers

Mauro

Quoted 101 lines · Mauro Rossi

Hi Emil, Chih-Wei,

what about the series of latest three patches we have in oreo-x86 branch?

[oreo-x86 branch]
http://git.osdn.net/view?p=android-x86/external-libdrm.git;a=history;f=Android.mk;h=f832b24e99007c75ce3a8d9a3ece34d4e475e957;hb=refs/heads/oreo-x86

My doubt is about the one "android: make libdrm*.so available to the vendor partition",
should we keep it (and send to mesa/drm) so that we will simply have our x86 branches aligned to mesa/drm,
or should we skip it in both cases?

Once this is assessed I will either send the series of 3 or just the android logging one.
Mauro

Mauro

Quoted 80 lines · Emil Velikov
Quoted 67 lines · Tapani Pälli
Quoted 66 lines · Robert Foss

Hey,

Quoted 51 lines · Mauro Rossi

Hi,

Quoted 22 lines · Robert Foss

Hey Mauro,

Quoted 18 lines · Mauro Rossi

Hi Robert,

Quoted 6 lines · Robert Foss

On a second note, this does not apply on libdrm/master due to:

LOCAL_SHARED_LIBRARIES := \
libcutils

Sorry, we have an additional Google patch, not present in libdrm/master that adds libdrm_platform module, but it is for a specific Google issue. [1]

However with libdrm module we have both liblog and libcutils shared dependencies

Quoted 7 lines
Quoted 3 lines

[1]
http://git.osdn.net/view?p=android-x86/external-libdrm.git;a=commit;h=8ccbfeab9fb2bddf4585339a0bcbea2f1e3ffa1e

Do you know if [1] causes incompatibility issues with earlier android verions?
If not I would suggest upstreaming it too.

I used those patches to build with nougat-x86 and there was no issue.

To be precise I did a double rookie mistake, because __android_log_vprint not used in upstream libdrm and libdrm_platform not used either.

Now starting from my mistakes, let's see if there is anything useful to libdrm project

In our builds Chih-Wei Huang said that libdrm_platform is not used, meaning not added to packages list,
however with oreo-x86 the build error appeared and the liblog dependency.

__android_log_vprint is used with __ANDROID__ braces
in a special patch [2] by Chih-Wei Huang which adds capability to print logs
in logcat

Quoted 7 lines

If it's not too invasive in libdrm, it could be useful. Cheers
Mauro

[2]
http://git.osdn.net/view?p=android-x86/external-libdrm.git;a=commitdiff;h=bcee43063ffd52a8677029c9ae6f4203563460f4;hp=81d7264033db4946a00003bf1ee82eb6c21260f9

[2] Seems like a good idea to me.
Logcat really is the only intended path for logging on Android, and redirecting our logs there does make sense to me.

Quoted 8 lines
Quoted 3 lines

But, I'm not sure about I like the way [2] disregards log-levels in drmMsg().

Yeah, I think it's a good idea. I see that in mesa we include "android/log.h", not "log/log.h", will need to make sure we get that correctly, maybe older versions did "log/log.h"?

I would also be in favour of adding logcat support to libdrm.

Mauro, please respin when you have the time.

--
Chih-Wei
Android-x86 project
http://www.android-x86.org
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#13 lore raw
In reply to Tapani Pälli

Hi,

I can try replacing <log/log.h> with <android/log.h>,
but I would like to get confirmation from Chih-Wei, the original author of [1]

Mauro

[1] http://git.osdn.net/view?p=android-x86/external-libdrm.git;a=commit;h=9d2a4cc3a16b5b464fda0a0c321dd1f5acadaa33

Quoted 74 lines · Tapani Pälli
Quoted 62 lines · Robert Foss

Hey,

Quoted 51 lines · Mauro Rossi

Hi,

Quoted 22 lines · Robert Foss

Hey Mauro,

Quoted 18 lines · Mauro Rossi

Hi Robert,

Quoted 6 lines · Robert Foss

On a second note, this does not apply on libdrm/master due to:

LOCAL_SHARED_LIBRARIES := \
libcutils

Sorry, we have an additional Google patch, not present in libdrm/master that adds libdrm_platform module, but it is for a specific Google issue. [1]

However with libdrm module we have both liblog and libcutils shared dependencies

Quoted 7 lines
Quoted 3 lines

[1]
http://git.osdn.net/view?p=android-x86/external-libdrm.git;a=commit;h=8ccbfeab9fb2bddf4585339a0bcbea2f1e3ffa1e

Do you know if [1] causes incompatibility issues with earlier android verions?
If not I would suggest upstreaming it too.

I used those patches to build with nougat-x86 and there was no issue.

To be precise I did a double rookie mistake, because __android_log_vprint not used in upstream libdrm and libdrm_platform not used either.

Now starting from my mistakes, let's see if there is anything useful to libdrm project

In our builds Chih-Wei Huang said that libdrm_platform is not used, meaning not added to packages list,
however with oreo-x86 the build error appeared and the liblog dependency.

__android_log_vprint is used with __ANDROID__ braces
in a special patch [2] by Chih-Wei Huang which adds capability to print logs
in logcat

Quoted 7 lines

If it's not too invasive in libdrm, it could be useful. Cheers
Mauro

[2]
http://git.osdn.net/view?p=android-x86/external-libdrm.git;a=commitdiff;h=bcee43063ffd52a8677029c9ae6f4203563460f4;hp=81d7264033db4946a00003bf1ee82eb6c21260f9

Quoted 7 lines

[2] Seems like a good idea to me.
Logcat really is the only intended path for logging on Android, and redirecting our logs there does make sense to me.

But, I'm not sure about I like the way [2] disregards log-levels in drmMsg().

Quoted 5 lines

Yeah, I think it's a good idea. I see that in mesa we include "android/log.h", not "log/log.h", will need to make sure we get that correctly, maybe older versions did "log/log.h"?

// Tapani

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#14 lore raw
In reply to Mauro Rossi

It seems like there is no usage of __android_log_vprint in upstream libdrm. Perhaps this was against libdrm with some android specific changes on top?

Quoted 18 lines · Mauro Rossi

Fixes the following building error:

FAILED: $(OUT)/obj/SHARED_LIBRARIES/libdrm_platform_intermediates/LINKED/libdrm_platform.so
...
external/libdrm/xf86drm.c:146: error: undefined reference to '__android_log_vprint' clang.real: error: linker command failed with exit code 1 (use -v to see invocation)

---
  Android.mk | 3 +++
  1 file changed, 3 insertions(+)
Android.mk +0 -0
index f2c78bc1..f832b24e 100644

Android.mk LOCAL_EXPORT_C_INCLUDE_DIRS := \ · line 69

Quoted 9 lines
Android.mk +3 -0
@@ -61,6 +61,9 @@ LOCAL_EXPORT_C_INCLUDE_DIRS := \
         $(LOCAL_PATH) \
         $(LOCAL_PATH)/include/drm
 
+LOCAL_SHARED_LIBRARIES := \
+	liblog
+
  LOCAL_C_INCLUDES := \
         $(LOCAL_PATH)/include/drm
 

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel