Skip to content
Snippets Groups Projects
  1. Dec 02, 2024
    • Julien Masson's avatar
      android: use android.hardware.graphics.common-V5-ndk · 38bcb21a
      Julien Masson authored
      
      With the last update applied BX304L01B-SW-99005-r51p0-00eac0, we have
      the following errors:
      ```
      error: vendor/arm/android-gralloc/android/src/idl_common/gralloc_shared/Android.bp:33:1: module "libgralloc_shared" variant "android_vendor_arm64_armv8-a_cortex-a53_static": depends on multiple versions of the same aidl_interface: android.hardware.graphics.common-V4-ndk-source, android.hardware.graphics.common-V5-ndk-source
      error: vendor/arm/android-gralloc/android/src/idl_common/gralloc_shared/Android.bp:33:1: module "libgralloc_shared" variant "android_vendor_arm64_armv8-a_cortex-a53_static": Dependency path:
                 via tag cc.libraryDependencyTag: { Kind:sharedLibraryDependency Order:normalLibraryDependency wholeStatic:false reexportFlags:false explicitlyVersioned:false dataLib:false ndk:false staticUnwinder:false makeSuffix: skipApexAllowedDependenciesCheck:false excludeInApex:false excludeInNonApex:false unexportedSymbols:false}
          -> android.hardware.graphics.common-V4-ndk{os:android,image:vendor,arch:arm64_armv8-a_cortex-a53,sdk:,link:shared,version:}
                 via tag cc.dependencyTag: { name:reuse objects}
          -> android.hardware.graphics.common-V4-ndk{os:android,image:vendor,arch:arm64_armv8-a_cortex-a53,sdk:,link:static}
                 via tag cc.dependencyTag: { name:gen source}
          -> android.hardware.graphics.common-V4-ndk-source{}
      ```
      
      Indeed we must choose between android.hardware.graphics.common V4 or
      V5 NDK.
      We will use the latest version.
      
      Signed-off-by: Julien Masson's avatarJulien Masson <jmasson@baylibre.com>
      38bcb21a
  2. Nov 29, 2024
  3. Jun 19, 2023
  4. Jun 12, 2023
  5. Nov 22, 2021
  6. Oct 28, 2021
  7. Oct 01, 2021
    • Mattijs Korpershoek's avatar
      HACK: r32: core: format: accept all MALI_GRALLOC_PRODUCER_CAM buffers · 77cc9a1f
      Mattijs Korpershoek authored and Guillaume LA ROQUE's avatar Guillaume LA ROQUE committed
      
      Reapply cam buffer fix on gralloc r32.
      
      Original commit message:
      ------------------------
      
      When using a webcam (using UVC), the camera HAL requests graphics
      buffers from gralloc.
      
      These buffers are labeled as MALI_GRALLOC_PRODUCER_CAM producers.
      
      By default, no mali gralloc format accepts the camera producers, so the
      camera HAL can never allocate any buffers:
      
        04-21 12:22:31.906  3026  3101 E BufferQueueProducer: [SurfaceTexture-0-3026-1](id:bd200000001,api:4,p:332,c:3026) dequeueBuffer: createGraphicBuffer failed
        04-21 12:22:31.906   332  3104 E Camera3-OutputStream: getBufferLockedCommon: Stream 1: Can't dequeue next output buffer: Out of memory (-12)
        04-21 12:22:31.907   278   278 E gralloc4: ERROR: Unrecognized and/or unsupported format 0x32315659 and usage 0x20130
        04-21 12:22:31.907   278   278 E gralloc4: allocate, buffer allocation failed with -22
        04-21 12:22:31.907  3026  3046 E GraphicBufferAllocator: Failed to allocate (640 x 480) layerCount 1 format 842094169 usage 20130: 5
        04-21 12:22:31.907  3026  3046 E BufferQueueProducer: [SurfaceTexture-0-3026-1](id:bd200000001,api:4,p:332,c:3026) dequeueBuffer: createGraphicBuffer failed
        04-21 12:22:31.907   332  3104 E Camera3-OutputStream: getBufferLockedCommon: Stream 1: Can't dequeue next output buffer: Out of memory (-12)
        04-21 12:22:31.908   278   278 E gralloc4: ERROR: Unrecognized and/or unsupported format 0x32315659 and usage 0x20130
        04-21 12:22:31.908   278   278 E gralloc4: allocate, buffer allocation failed with -22
      
      Fix it by allow *all* formats to be allocated for the camera producers.
      
      Note: this is new with gralloc4. In gralloc2, the .cam_wr field did not exist.
      
      Bug: RITA-495
      Signed-off-by: default avatarGuillaume La Roque <glaroque@baylibre.com>
      Signed-off-by: default avatarMattijs Korpershoek <mkorpershoek@baylibre.com>
      77cc9a1f
    • Guillaume LA ROQUE's avatar
      initial import from BX304L01B-SW-99005-r32p0-01eac0 · 68f720d2
      Guillaume LA ROQUE authored
      This has been downloaded from:
         https://developer.arm.com/tools-and-software/graphics-and-gaming/mali-drivers/android-gralloc-module
      
      
      
      Filename:
         BX304L01B-SW-99005-r32p0-01eac0.tar
      
      Then, the following has been done to extract this archive:
      
          tar -xvf BX304L01B-SW-99005-r32p0-01eac0.tar
          mv driver/product/android/gralloc/* .
          rm BX304L01B-SW-99005-r32p0-01eac0.tar
          git add *
      
      Use this as a baseline for Android 11
      
      Bug: RITA-771
      Signed-off-by: default avatarGuillaume La Roque <glaroque@baylibre.com>
      68f720d2
  8. Apr 22, 2021
    • Mattijs Korpershoek's avatar
      HACK: core: format: accept all MALI_GRALLOC_PRODUCER_CAM buffers · 0bc6b65c
      Mattijs Korpershoek authored
      
      When using a webcam (using UVC), the camera HAL requests graphics
      buffers from gralloc.
      
      These buffers are labeled as MALI_GRALLOC_PRODUCER_CAM producers.
      
      By default, no mali gralloc format accepts the camera producers, so the
      camera HAL can never allocate any buffers:
      
        04-21 12:22:31.906  3026  3101 E BufferQueueProducer: [SurfaceTexture-0-3026-1](id:bd200000001,api:4,p:332,c:3026) dequeueBuffer: createGraphicBuffer failed
        04-21 12:22:31.906   332  3104 E Camera3-OutputStream: getBufferLockedCommon: Stream 1: Can't dequeue next output buffer: Out of memory (-12)
        04-21 12:22:31.907   278   278 E gralloc4: ERROR: Unrecognized and/or unsupported format 0x32315659 and usage 0x20130
        04-21 12:22:31.907   278   278 E gralloc4: allocate, buffer allocation failed with -22
        04-21 12:22:31.907  3026  3046 E GraphicBufferAllocator: Failed to allocate (640 x 480) layerCount 1 format 842094169 usage 20130: 5
        04-21 12:22:31.907  3026  3046 E BufferQueueProducer: [SurfaceTexture-0-3026-1](id:bd200000001,api:4,p:332,c:3026) dequeueBuffer: createGraphicBuffer failed
        04-21 12:22:31.907   332  3104 E Camera3-OutputStream: getBufferLockedCommon: Stream 1: Can't dequeue next output buffer: Out of memory (-12)
        04-21 12:22:31.908   278   278 E gralloc4: ERROR: Unrecognized and/or unsupported format 0x32315659 and usage 0x20130
        04-21 12:22:31.908   278   278 E gralloc4: allocate, buffer allocation failed with -22
      
      Fix it by allow *all* formats to be allocated for the camera producers.
      
      Note: this is new with gralloc4. In gralloc2, the .cam_wr field did not exist.
      
      Bug: RITA-495
      Signed-off-by: default avatarGuillaume La Roque <glaroque@baylibre.com>
      Signed-off-by: default avatarMattijs Korpershoek <mkorpershoek@baylibre.com>
      0bc6b65c
  9. Apr 12, 2021
    • Mattijs Korpershoek's avatar
      build: add copy of ion/ion_4.12.h · 5712b703
      Mattijs Korpershoek authored
      While building on Android 19 with a 4.19 kernel, we have the following
      build error:
      
      [ 97% 491/505] target  C++: gralloc.mt6771 <= vendor/arm/android-gralloc/src/legacy/buffer_alloc.cpp
      FAILED: out/target/product/quartz/obj/SHARED_LIBRARIES/gralloc.mt6771_intermediates/legacy/buffer_alloc.o
      /bin/bash -c "PWD=/proc/self/cwd  prebuilts/clang/host/linux-x86/clang-r353983c1/bin/clang++    -I vendor/arm/android-gralloc/src -I out/target/product/quartz/obj/SHARED_LIBRARIES/gralloc.mt6771_intermediates -I out/target/product/quartz/gen/SHA
      RED_LIBRARIES/gralloc.mt6771_intermediates \$(cat out/target/product/quartz/obj/SHARED_LIBRARIES/gralloc.mt6771_intermediates/import_includes)   -isystem out/target/product/quartz/obj/include -c  -Werror=implicit-function-declaration -DANDROID -
      fmessage-length=0 -W -Wall -Wno-unused -Winit-self -Wpointer-arith -no-canonical-prefixes -DNDEBUG -UDEBUG -fno-exceptions -Wno-multichar -O2 -g -fno-strict-aliasing -fdebug-prefix-map=/proc/self/cwd= -D__compiler_offsetof=__builtin_offsetof -fa
      ddrsig -Wimplicit-fallthrough -Werror=int-conversion -Wno-reserved-id-macro -Wno-format-pedantic -Wno-unused-command-line-argument -fcolor-diagnostics -Wno-zero-as-null-pointer-constant -Wno-sign-compare -Wno-defaulted-function-deleted -Wno-inco
      nsistent-missing-override -ffunction-sections -fdata-sections -fno-short-enums -funwind-tables -fstack-protector-strong -Wa,--noexecstack -D_FORTIFY_SOURCE=2 -Wstrict-aliasing=2 -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werro
      r=sequence-point -Werror=date-time -Werror=format-security -nostdlibinc -march=armv8-a -mcpu=cortex-a53 -target aarch64-linux-android -Bprebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/aarch64-linux-android/bin  -Wsign-promo -D_LIBCPP_E
      NABLE_THREAD_SAFETY_ANNOTATIONS -Wno-thread-safety-negative -Wno-gnu-include-next -fvisibility-inlines-hidden  -std=gnu++17   -fno-rtti -ldl -Werror -DLOG_TAG=\"\\\"gralloc\\\"\" -DPLATFORM_SDK_VERSION=29 -DMALI_GPU_SUPPORT_AFBC_BASIC=0 -DMALI_G
      PU_SUPPORT_AFBC_SPLITBLK=0 -DMALI_GPU_SUPPORT_AFBC_WIDEBLK=0 -DMALI_GPU_SUPPORT_AFBC_TILED_HEADERS=0 -DMALI_GPU_SUPPORT_AFBC_YUV_WRITE=0 -DMALI_DISPLAY_VERSION=0 -DMALI_VIDEO_VERSION=0 -DMALI_GRALLOC_VPU_LIBRARY_PATH=\"\\\"/system/lib/\\\"\" -DG
      RALLOC_VERSION_MAJOR=1 -DHIDL_ALLOCATOR_VERSION_SCALED= -DHIDL_MAPPER_VERSION_SCALED= -DHIDL_COMMON_VERSION_SCALED= -DHIDL_IALLOCATOR_NAMESPACE= -DHIDL_IMAPPER_NAMESPACE= -DHIDL_COMMON_NAMESPACE= -DGRALLOC_DISP_W=0 -DGRALLOC_DISP_H=0 -DDISABLE_F
      RAMEBUFFER_HAL=0 -DGRALLOC_USE_ION_DMA_HEAP=0 -DGRALLOC_USE_ION_COMPOUND_PAGE_HEAP=0 -DGRALLOC_INIT_AFBC=0 -DGRALLOC_FB_BPP=32 -DGRALLOC_FB_SWAP_RED_BLUE=1 -DGRALLOC_ARM_NO_EXTERNAL_AFBC=0 -DGRALLOC_LIBRARY_BUILD=1 -DGRALLOC_USE_LEGACY_ION_API=0
       -DGRALLOC_USE_LEGACY_CALCS=1 -DGRALLOC_USE_LEGACY_LOCK=1 -DGRALLOC_USE_ION_DMABUF_SYNC=1 -D__ANDROID_API__=29 -D__ANDROID_VNDK__ -fPIC -DMALI_GRALLOC_GPU_LIBRARY_PATH1=\"\\\"/vendor/lib64/egl/\\\"\" -DMALI_GRALLOC_GPU_LIBRARY_PATH2=\"\\\"/syste
      m/lib64/egl/\\\"\" -DMALI_GRALLOC_DPU_LIBRARY_PATH=\"\\\"/vendor/lib64/hw/\\\"\" -DMALI_GRALLOC_DPU_AEU_LIBRARY_PATH=\"\\\"/vendor/lib64/hw/\\\"\" -D_USING_LIBCXX -DANDROID_STRICT   -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast -Werror
      =address-of-temporary -Werror=return-type -Wno-tautological-constant-compare -Wno-tautological-type-limit-compare -Wno-tautological-unsigned-enum-zero-compare -Wno-tautological-unsigned-zero-compare -Wno-c++98-compat-extra-semi -Wno-return-std-m
      ove-in-c++11  -MD -MF out/target/product/quartz/obj/SHARED_LIBRARIES/gralloc.mt6771_intermediates/legacy/buffer_alloc.d -o out/target/product/quartz/obj/SHARED_LIBRARIES/gralloc.mt6771_intermediates/legacy/buffer_alloc.o vendor/arm/android-grall
      oc/src/legacy/buffer_alloc.cpp"
      In file included from vendor/arm/android-gralloc/src/legacy/buffer_alloc.cpp:29:
      vendor/arm/android-gralloc/src/mali_gralloc_module.h:39:10: fatal error: 'ion/ion_4.12.h' file not found
               ^~~~~~~~~~~~~~~~
      
      Fix it by adding a copy of ion_4.12.h, as done in [1]
      
      [1] https://gitlab.com/baylibre/amlogic/atv/arm-mali-gralloc/-/commit/c9fc91fe37f52c392c34db8eb0d27edb3c0822ae
      
      
      Bug: RITA-225
      Signed-off-by: default avatarMattijs Korpershoek <mkorpershoek@baylibre.com>
      5712b703
    • Guillaume LA ROQUE's avatar
      build: call ./configure after lunching · e3a446e0
      Guillaume LA ROQUE authored and Mattijs Korpershoek's avatar Mattijs Korpershoek committed
      
      Done the following steps to configure the gralloc sources:
      
          cd $AOSP_ROOT
          source build/envsetup.sh
          lunch aosp_quartz-userdebug
          cd -
          ./configure
      
      Which generated:
      
          Enabling build files for Gralloc version 4
      
      After that, commit everything with 'git add .'
      
      Signed-off-by: default avatarGuillaume La Roque <glaroque@baylibre.com>
      Signed-off-by: default avatarMattijs Korpershoek <mkorpershoek@baylibre.com>
      e3a446e0
    • Guillaume LA ROQUE's avatar
      initial import from BX304L01B-SW-99005-r29p0-01eac0 · a36e8ca6
      Guillaume LA ROQUE authored and Mattijs Korpershoek's avatar Mattijs Korpershoek committed
      This has been downloaded from:
         https://developer.arm.com/tools-and-software/graphics-and-gaming/mali-drivers/android-gralloc-module
      
      
      
      Filename:
         BX304L01B-SW-99005-r29p0-01eac0.tar
      
      Then, the following has been done to extract this archive:
      
          tar -xvf BX304L01B-SW-99005-r29p0-01eac0.tar
          mv driver/product/android/gralloc/* .
          rm BX304L01B-SW-99005-r29p0-01eac0.tar
          git add *
      
      Use this as a baseline for Android 11
      
      Signed-off-by: default avatarGuillaume La Roque <glaroque@baylibre.com>
      Signed-off-by: default avatarMattijs Korpershoek <mkorpershoek@baylibre.com>
      a36e8ca6
    • Mattijs Korpershoek's avatar
      build: remove *ALL* versioned files to prepare for r29 · 8c273897
      Mattijs Korpershoek authored
      
      Since we are going to import BX304L01B-SW-99005-r29p0-01eac0, it's
      better to start from scratch again.
      
      To avoid resetting the git history, remove all sources files instead.
      
      Signed-off-by: default avatarMattijs Korpershoek <mkorpershoek@baylibre.com>
      8c273897
  10. Feb 25, 2021
  11. Sep 21, 2020
  12. Sep 02, 2020
  13. Aug 31, 2020
    • Mattijs Korpershoek's avatar
      build: add copy of ion/ion_4.12.h · 20cbc5fd
      Mattijs Korpershoek authored
      While building on Android 19 with a 4.19 kernel, we have the following
      build error:
      
      [ 97% 491/505] target  C++: gralloc.mt6771 <= vendor/arm/android-gralloc/src/legacy/buffer_alloc.cpp
      FAILED: out/target/product/quartz/obj/SHARED_LIBRARIES/gralloc.mt6771_intermediates/legacy/buffer_alloc.o
      /bin/bash -c "PWD=/proc/self/cwd  prebuilts/clang/host/linux-x86/clang-r353983c1/bin/clang++    -I vendor/arm/android-gralloc/src -I out/target/product/quartz/obj/SHARED_LIBRARIES/gralloc.mt6771_intermediates -I out/target/product/quartz/gen/SHA
      RED_LIBRARIES/gralloc.mt6771_intermediates \$(cat out/target/product/quartz/obj/SHARED_LIBRARIES/gralloc.mt6771_intermediates/import_includes)   -isystem out/target/product/quartz/obj/include -c  -Werror=implicit-function-declaration -DANDROID -
      fmessage-length=0 -W -Wall -Wno-unused -Winit-self -Wpointer-arith -no-canonical-prefixes -DNDEBUG -UDEBUG -fno-exceptions -Wno-multichar -O2 -g -fno-strict-aliasing -fdebug-prefix-map=/proc/self/cwd= -D__compiler_offsetof=__builtin_offsetof -fa
      ddrsig -Wimplicit-fallthrough -Werror=int-conversion -Wno-reserved-id-macro -Wno-format-pedantic -Wno-unused-command-line-argument -fcolor-diagnostics -Wno-zero-as-null-pointer-constant -Wno-sign-compare -Wno-defaulted-function-deleted -Wno-inco
      nsistent-missing-override -ffunction-sections -fdata-sections -fno-short-enums -funwind-tables -fstack-protector-strong -Wa,--noexecstack -D_FORTIFY_SOURCE=2 -Wstrict-aliasing=2 -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werro
      r=sequence-point -Werror=date-time -Werror=format-security -nostdlibinc -march=armv8-a -mcpu=cortex-a53 -target aarch64-linux-android -Bprebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/aarch64-linux-android/bin  -Wsign-promo -D_LIBCPP_E
      NABLE_THREAD_SAFETY_ANNOTATIONS -Wno-thread-safety-negative -Wno-gnu-include-next -fvisibility-inlines-hidden  -std=gnu++17   -fno-rtti -ldl -Werror -DLOG_TAG=\"\\\"gralloc\\\"\" -DPLATFORM_SDK_VERSION=29 -DMALI_GPU_SUPPORT_AFBC_BASIC=0 -DMALI_G
      PU_SUPPORT_AFBC_SPLITBLK=0 -DMALI_GPU_SUPPORT_AFBC_WIDEBLK=0 -DMALI_GPU_SUPPORT_AFBC_TILED_HEADERS=0 -DMALI_GPU_SUPPORT_AFBC_YUV_WRITE=0 -DMALI_DISPLAY_VERSION=0 -DMALI_VIDEO_VERSION=0 -DMALI_GRALLOC_VPU_LIBRARY_PATH=\"\\\"/system/lib/\\\"\" -DG
      RALLOC_VERSION_MAJOR=1 -DHIDL_ALLOCATOR_VERSION_SCALED= -DHIDL_MAPPER_VERSION_SCALED= -DHIDL_COMMON_VERSION_SCALED= -DHIDL_IALLOCATOR_NAMESPACE= -DHIDL_IMAPPER_NAMESPACE= -DHIDL_COMMON_NAMESPACE= -DGRALLOC_DISP_W=0 -DGRALLOC_DISP_H=0 -DDISABLE_F
      RAMEBUFFER_HAL=0 -DGRALLOC_USE_ION_DMA_HEAP=0 -DGRALLOC_USE_ION_COMPOUND_PAGE_HEAP=0 -DGRALLOC_INIT_AFBC=0 -DGRALLOC_FB_BPP=32 -DGRALLOC_FB_SWAP_RED_BLUE=1 -DGRALLOC_ARM_NO_EXTERNAL_AFBC=0 -DGRALLOC_LIBRARY_BUILD=1 -DGRALLOC_USE_LEGACY_ION_API=0
       -DGRALLOC_USE_LEGACY_CALCS=1 -DGRALLOC_USE_LEGACY_LOCK=1 -DGRALLOC_USE_ION_DMABUF_SYNC=1 -D__ANDROID_API__=29 -D__ANDROID_VNDK__ -fPIC -DMALI_GRALLOC_GPU_LIBRARY_PATH1=\"\\\"/vendor/lib64/egl/\\\"\" -DMALI_GRALLOC_GPU_LIBRARY_PATH2=\"\\\"/syste
      m/lib64/egl/\\\"\" -DMALI_GRALLOC_DPU_LIBRARY_PATH=\"\\\"/vendor/lib64/hw/\\\"\" -DMALI_GRALLOC_DPU_AEU_LIBRARY_PATH=\"\\\"/vendor/lib64/hw/\\\"\" -D_USING_LIBCXX -DANDROID_STRICT   -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast -Werror
      =address-of-temporary -Werror=return-type -Wno-tautological-constant-compare -Wno-tautological-type-limit-compare -Wno-tautological-unsigned-enum-zero-compare -Wno-tautological-unsigned-zero-compare -Wno-c++98-compat-extra-semi -Wno-return-std-m
      ove-in-c++11  -MD -MF out/target/product/quartz/obj/SHARED_LIBRARIES/gralloc.mt6771_intermediates/legacy/buffer_alloc.d -o out/target/product/quartz/obj/SHARED_LIBRARIES/gralloc.mt6771_intermediates/legacy/buffer_alloc.o vendor/arm/android-grall
      oc/src/legacy/buffer_alloc.cpp"
      In file included from vendor/arm/android-gralloc/src/legacy/buffer_alloc.cpp:29:
      vendor/arm/android-gralloc/src/mali_gralloc_module.h:39:10: fatal error: 'ion/ion_4.12.h' file not found
               ^~~~~~~~~~~~~~~~
      
      Fix it by adding a copy of ion_4.12.h, as done in [1]
      
      [1] https://gitlab.com/baylibre/amlogic/atv/arm-mali-gralloc/-/commit/c9fc91fe37f52c392c34db8eb0d27edb3c0822ae
      
      
      Bug: RITA-225
      Signed-off-by: default avatarMattijs Korpershoek <mkorpershoek@baylibre.com>
      20cbc5fd
    • Mattijs Korpershoek's avatar
  14. Aug 27, 2020
Loading