imx-gpu-viv.mk 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. ################################################################################
  2. #
  3. # imx-gpu-viv
  4. #
  5. ################################################################################
  6. ifeq ($(BR2_aarch64),y)
  7. IMX_GPU_VIV_VERSION = 6.4.11.p1.2-aarch64-1e0c396
  8. else
  9. IMX_GPU_VIV_VERSION = 6.4.11.p1.2-aarch32-1e0c396
  10. endif
  11. IMX_GPU_VIV_SITE = $(FREESCALE_IMX_SITE)
  12. IMX_GPU_VIV_SOURCE = imx-gpu-viv-$(IMX_GPU_VIV_VERSION).bin
  13. IMX_GPU_VIV_INSTALL_STAGING = YES
  14. IMX_GPU_VIV_LICENSE = NXP Semiconductor Software License Agreement
  15. IMX_GPU_VIV_LICENSE_FILES = EULA COPYING
  16. IMX_GPU_VIV_REDISTRIBUTE = NO
  17. IMX_GPU_VIV_PROVIDES = libegl libgles libopencl libopenvg
  18. ifeq ($(BR2_aarch64),y)
  19. IMX_GPU_VIV_PROVIDES += libgbm
  20. endif
  21. IMX_GPU_VIV_LIB_TARGET = $(call qstrip,$(BR2_PACKAGE_IMX_GPU_VIV_OUTPUT))
  22. # Libraries are linked against libdrm, except framebuffer output on ARM
  23. ifneq ($(IMX_GPU_VIV_LIB_TARGET)$(BR2_arm),fby)
  24. IMX_GPU_VIV_DEPENDENCIES += libdrm
  25. endif
  26. ifeq ($(IMX_GPU_VIV_LIB_TARGET),wayland)
  27. IMX_GPU_VIV_DEPENDENCIES += wayland
  28. endif
  29. define IMX_GPU_VIV_EXTRACT_CMDS
  30. $(call NXP_EXTRACT_HELPER,$(IMX_GPU_VIV_DL_DIR)/$(IMX_GPU_VIV_SOURCE))
  31. endef
  32. ifeq ($(IMX_GPU_VIV_LIB_TARGET),fb)
  33. define IMX_GPU_VIV_FIXUP_PKGCONFIG
  34. ln -sf egl_linuxfb.pc $(@D)/gpu-core/usr/lib/pkgconfig/egl.pc
  35. endef
  36. else ifeq ($(IMX_GPU_VIV_LIB_TARGET),wayland)
  37. define IMX_GPU_VIV_FIXUP_PKGCONFIG
  38. ln -sf egl_wayland.pc $(@D)/gpu-core/usr/lib/pkgconfig/egl.pc
  39. endef
  40. endif
  41. IMX_GPU_VIV_PLATFORM_DIR = $(call qstrip,$(BR2_PACKAGE_IMX_GPU_VIV_PLATFORM))
  42. ifneq ($(IMX_GPU_VIV_PLATFORM_DIR),)
  43. define IMX_GPU_VIV_COPY_PLATFORM
  44. cp -dpfr $(@D)/gpu-core/usr/lib/$(IMX_GPU_VIV_PLATFORM_DIR)/* $(@D)/gpu-core/usr/lib/
  45. endef
  46. endif
  47. # Instead of building, we fix up the inconsistencies that exist
  48. # in the upstream archive here. We also remove unused backend files.
  49. # Make sure these commands are idempotent.
  50. define IMX_GPU_VIV_BUILD_CMDS
  51. cp -dpfr $(@D)/gpu-core/usr/lib/$(IMX_GPU_VIV_LIB_TARGET)/* $(@D)/gpu-core/usr/lib/
  52. $(foreach backend,fb wayland, \
  53. $(RM) -r $(@D)/gpu-core/usr/lib/$(backend)
  54. )
  55. $(IMX_GPU_VIV_COPY_PLATFORM)
  56. $(foreach platform,mx8mn mx8mp mx8mq mx8qm mx8qxp mx8ulp, \
  57. $(RM) -r $(@D)/gpu-core/usr/lib/$(platform)
  58. )
  59. $(IMX_GPU_VIV_FIXUP_PKGCONFIG)
  60. endef
  61. define IMX_GPU_VIV_INSTALL_STAGING_CMDS
  62. cp -r $(@D)/gpu-core/usr/* $(STAGING_DIR)/usr
  63. endef
  64. ifeq ($(BR2_PACKAGE_IMX_GPU_VIV_EXAMPLES),y)
  65. define IMX_GPU_VIV_INSTALL_EXAMPLES
  66. mkdir -p $(TARGET_DIR)/usr/share/examples/
  67. cp -r $(@D)/gpu-demos/opt/* $(TARGET_DIR)/usr/share/examples/
  68. endef
  69. endif
  70. ifeq ($(BR2_PACKAGE_IMX_GPU_VIV_GMEM_INFO),y)
  71. define IMX_GPU_VIV_INSTALL_GMEM_INFO
  72. cp -dpfr $(@D)/gpu-tools/gmem-info/usr/bin/* $(TARGET_DIR)/usr/bin/
  73. endef
  74. endif
  75. define IMX_GPU_VIV_INSTALL_TARGET_CMDS
  76. $(IMX_GPU_VIV_INSTALL_EXAMPLES)
  77. $(IMX_GPU_VIV_INSTALL_GMEM_INFO)
  78. cp -a $(@D)/gpu-core/usr/lib $(TARGET_DIR)/usr
  79. $(INSTALL) -D -m 0644 $(@D)/gpu-core/etc/Vivante.icd $(TARGET_DIR)/etc/OpenCL/vendors/Vivante.icd
  80. endef
  81. $(eval $(generic-package))