xref: /OK3568_Linux_fs/buildroot/package/freescale-imx/imx-gpu-viv/imx-gpu-viv.mk (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun################################################################################
2*4882a593Smuzhiyun#
3*4882a593Smuzhiyun# imx-gpu-viv
4*4882a593Smuzhiyun#
5*4882a593Smuzhiyun################################################################################
6*4882a593Smuzhiyun
7*4882a593Smuzhiyunifeq ($(BR2_aarch64),y)
8*4882a593SmuzhiyunIMX_GPU_VIV_VERSION = 6.4.3.p2.0-aarch64
9*4882a593Smuzhiyunelse
10*4882a593SmuzhiyunIMX_GPU_VIV_VERSION = 6.4.3.p2.0-aarch32
11*4882a593Smuzhiyunendif
12*4882a593SmuzhiyunIMX_GPU_VIV_SITE = $(FREESCALE_IMX_SITE)
13*4882a593SmuzhiyunIMX_GPU_VIV_SOURCE = imx-gpu-viv-$(IMX_GPU_VIV_VERSION).bin
14*4882a593Smuzhiyun
15*4882a593SmuzhiyunIMX_GPU_VIV_INSTALL_STAGING = YES
16*4882a593Smuzhiyun
17*4882a593SmuzhiyunIMX_GPU_VIV_LICENSE = NXP Semiconductor Software License Agreement
18*4882a593SmuzhiyunIMX_GPU_VIV_LICENSE_FILES = EULA COPYING
19*4882a593SmuzhiyunIMX_GPU_VIV_REDISTRIBUTE = NO
20*4882a593Smuzhiyun
21*4882a593SmuzhiyunIMX_GPU_VIV_PROVIDES = libegl libgles libopencl libopenvg
22*4882a593SmuzhiyunIMX_GPU_VIV_LIB_TARGET = $(call qstrip,$(BR2_PACKAGE_IMX_GPU_VIV_OUTPUT))
23*4882a593Smuzhiyun
24*4882a593Smuzhiyunifeq ($(IMX_GPU_VIV_LIB_TARGET),x11)
25*4882a593Smuzhiyun# The libGAL.so library provided by imx-gpu-viv uses X functions. Packages
26*4882a593Smuzhiyun# may want to link against libGAL.so (QT5 Base with OpenGL and X support
27*4882a593Smuzhiyun# does so). For this to work we need build dependencies to libXdamage,
28*4882a593Smuzhiyun# libXext and libXfixes so that X functions used in libGAL.so are referenced.
29*4882a593SmuzhiyunIMX_GPU_VIV_DEPENDENCIES += xlib_libXdamage xlib_libXext xlib_libXfixes
30*4882a593Smuzhiyunendif
31*4882a593Smuzhiyun
32*4882a593Smuzhiyun# Libraries are linked against libdrm, except framebuffer output on ARM
33*4882a593Smuzhiyunifneq ($(IMX_GPU_VIV_LIB_TARGET)$(BR2_arm),fby)
34*4882a593SmuzhiyunIMX_GPU_VIV_DEPENDENCIES += libdrm
35*4882a593Smuzhiyunendif
36*4882a593Smuzhiyun
37*4882a593Smuzhiyunifeq ($(IMX_GPU_VIV_LIB_TARGET),wayland)
38*4882a593SmuzhiyunIMX_GPU_VIV_DEPENDENCIES += wayland
39*4882a593Smuzhiyunendif
40*4882a593Smuzhiyun
41*4882a593Smuzhiyundefine IMX_GPU_VIV_EXTRACT_CMDS
42*4882a593Smuzhiyun	$(call FREESCALE_IMX_EXTRACT_HELPER,$(IMX_GPU_VIV_DL_DIR)/$(IMX_GPU_VIV_SOURCE))
43*4882a593Smuzhiyunendef
44*4882a593Smuzhiyun
45*4882a593Smuzhiyunifeq ($(IMX_GPU_VIV_LIB_TARGET),fb)
46*4882a593Smuzhiyundefine IMX_GPU_VIV_FIXUP_PKGCONFIG
47*4882a593Smuzhiyun	ln -sf egl_linuxfb.pc $(@D)/gpu-core/usr/lib/pkgconfig/egl.pc
48*4882a593Smuzhiyunendef
49*4882a593Smuzhiyunelse ifeq ($(IMX_GPU_VIV_LIB_TARGET),wayland)
50*4882a593Smuzhiyundefine IMX_GPU_VIV_FIXUP_PKGCONFIG
51*4882a593Smuzhiyun	ln -sf egl_wayland.pc $(@D)/gpu-core/usr/lib/pkgconfig/egl.pc
52*4882a593Smuzhiyunendef
53*4882a593Smuzhiyunelse ifeq ($(IMX_GPU_VIV_LIB_TARGET),x11)
54*4882a593Smuzhiyundefine IMX_GPU_VIV_FIXUP_PKGCONFIG
55*4882a593Smuzhiyun	$(foreach lib,egl gbm glesv1_cm glesv2 vg, \
56*4882a593Smuzhiyun		ln -sf $(lib)_x11.pc $(@D)/gpu-core/usr/lib/pkgconfig/$(lib).pc
57*4882a593Smuzhiyun	)
58*4882a593Smuzhiyunendef
59*4882a593Smuzhiyunendif
60*4882a593Smuzhiyun
61*4882a593Smuzhiyun# Instead of building, we fix up the inconsistencies that exist
62*4882a593Smuzhiyun# in the upstream archive here. We also remove unused backend files.
63*4882a593Smuzhiyun# Make sure these commands are idempotent.
64*4882a593Smuzhiyundefine IMX_GPU_VIV_BUILD_CMDS
65*4882a593Smuzhiyun	cp -dpfr $(@D)/gpu-core/usr/lib/$(IMX_GPU_VIV_LIB_TARGET)/* $(@D)/gpu-core/usr/lib/
66*4882a593Smuzhiyun	$(foreach backend,fb x11 wayland, \
67*4882a593Smuzhiyun		$(RM) -r $(@D)/gpu-core/usr/lib/$(backend)
68*4882a593Smuzhiyun	)
69*4882a593Smuzhiyun	$(IMX_GPU_VIV_FIXUP_PKGCONFIG)
70*4882a593Smuzhiyunendef
71*4882a593Smuzhiyun
72*4882a593Smuzhiyundefine IMX_GPU_VIV_INSTALL_STAGING_CMDS
73*4882a593Smuzhiyun	cp -r $(@D)/gpu-core/usr/* $(STAGING_DIR)/usr
74*4882a593Smuzhiyunendef
75*4882a593Smuzhiyun
76*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_IMX_GPU_VIV_EXAMPLES),y)
77*4882a593Smuzhiyundefine IMX_GPU_VIV_INSTALL_EXAMPLES
78*4882a593Smuzhiyun	mkdir -p $(TARGET_DIR)/usr/share/examples/
79*4882a593Smuzhiyun	cp -r $(@D)/gpu-demos/opt/* $(TARGET_DIR)/usr/share/examples/
80*4882a593Smuzhiyunendef
81*4882a593Smuzhiyunendif
82*4882a593Smuzhiyun
83*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_IMX_GPU_VIV_GMEM_INFO),y)
84*4882a593Smuzhiyundefine IMX_GPU_VIV_INSTALL_GMEM_INFO
85*4882a593Smuzhiyun	cp -dpfr $(@D)/gpu-tools/gmem-info/usr/bin/* $(TARGET_DIR)/usr/bin/
86*4882a593Smuzhiyunendef
87*4882a593Smuzhiyunendif
88*4882a593Smuzhiyun
89*4882a593Smuzhiyundefine IMX_GPU_VIV_INSTALL_TARGET_CMDS
90*4882a593Smuzhiyun	$(IMX_GPU_VIV_INSTALL_EXAMPLES)
91*4882a593Smuzhiyun	$(IMX_GPU_VIV_INSTALL_GMEM_INFO)
92*4882a593Smuzhiyun	cp -a $(@D)/gpu-core/usr/lib $(TARGET_DIR)/usr
93*4882a593Smuzhiyun	$(INSTALL) -D -m 0644 $(@D)/gpu-core/etc/Vivante.icd $(TARGET_DIR)/etc/OpenCL/vendors/Vivante.icd
94*4882a593Smuzhiyunendef
95*4882a593Smuzhiyun
96*4882a593Smuzhiyun$(eval $(generic-package))
97