OSDN Git Service

vmwgfx: assorted fixes
[android-x86/external-drm_gralloc.git] / Android.mk
1 # Copyright (C) 2010 Chia-I Wu <olvaffe@gmail.com>
2 # Copyright (C) 2010-2011 LunarG Inc.
3
4 # Permission is hereby granted, free of charge, to any person obtaining a
5 # copy of this software and associated documentation files (the "Software"),
6 # to deal in the Software without restriction, including without limitation
7 # the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 # and/or sell copies of the Software, and to permit persons to whom the
9 # Software is furnished to do so, subject to the following conditions:
10
11 # The above copyright notice and this permission notice shall be included
12 # in all copies or substantial portions of the Software.
13
14 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
17 # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 # DEALINGS IN THE SOFTWARE.
21
22 # Android.mk for drm_gralloc
23
24 DRM_GPU_DRIVERS := $(BOARD_GPU_DRIVERS)
25
26 # convert board uses to DRM_GPU_DRIVERS
27 ifeq ($(strip $(DRM_GPU_DRIVERS)),)
28 ifeq ($(strip $(BOARD_USES_I915C)),true)
29 DRM_GPU_DRIVERS += i915
30 endif
31 ifeq ($(strip $(BOARD_USES_I965C)),true)
32 DRM_GPU_DRIVERS += i965
33 endif
34 ifeq ($(strip $(BOARD_USES_I915G)),true)
35 DRM_GPU_DRIVERS += i915g
36 endif
37 ifeq ($(strip $(BOARD_USES_R300G)),true)
38 DRM_GPU_DRIVERS += r300g
39 endif
40 ifeq ($(strip $(BOARD_USES_R600G)),true)
41 DRM_GPU_DRIVERS += r600g
42 endif
43 ifeq ($(strip $(BOARD_USES_NOUVEAU)),true)
44 DRM_GPU_DRIVERS += nouveau
45 endif
46 ifeq ($(strip $(BOARD_USES_VMWGFX)),true)
47 DRM_GPU_DRIVERS += vmwgfx
48 endif
49 endif # DRM_GPU_DRIVERS
50
51 intel_drivers := i915 i965 i915g
52 radeon_drivers := r300g r600g
53 nouveau_drivers := nouveau
54 vmwgfx_drivers := vmwgfx
55
56 valid_drivers := \
57         $(intel_drivers) \
58         $(radeon_drivers) \
59         $(nouveau_drivers) \
60         $(vmwgfx_drivers)
61
62 # warn about invalid drivers
63 invalid_drivers := $(filter-out $(valid_drivers), $(DRM_GPU_DRIVERS))
64 ifneq ($(invalid_drivers),)
65 $(warning invalid GPU drivers: $(invalid_drivers))
66 # tidy up
67 DRM_GPU_DRIVERS := $(filter-out $(invalid_drivers), $(DRM_GPU_DRIVERS))
68 endif
69
70 ifneq ($(filter $(vmwgfx_drivers), $(DRM_GPU_DRIVERS)),)
71 DRM_USES_PIPE := true
72 else
73 DRM_USES_PIPE := false
74 endif
75
76 ifneq ($(strip $(DRM_GPU_DRIVERS)),)
77
78 LOCAL_PATH := $(call my-dir)
79
80 include $(CLEAR_VARS)
81
82 LOCAL_SRC_FILES := \
83         gralloc.c \
84         gralloc_drm.c \
85         gralloc_drm_kms.c
86
87 LOCAL_C_INCLUDES := \
88         external/drm \
89         external/drm/include/drm
90
91 LOCAL_SHARED_LIBRARIES := \
92         libdrm \
93         liblog \
94         libcutils \
95
96 # for glFlush/glFinish
97 LOCAL_SHARED_LIBRARIES += \
98         libGLESv1_CM
99
100 ifneq ($(filter $(intel_drivers), $(DRM_GPU_DRIVERS)),)
101 LOCAL_SRC_FILES += gralloc_drm_intel.c
102 LOCAL_C_INCLUDES += external/drm/intel
103 LOCAL_CFLAGS += -DENABLE_INTEL
104 LOCAL_SHARED_LIBRARIES += libdrm_intel
105 endif
106
107 ifneq ($(filter $(radeon_drivers), $(DRM_GPU_DRIVERS)),)
108 LOCAL_SRC_FILES += gralloc_drm_radeon.c
109 LOCAL_C_INCLUDES += external/drm/radeon
110 LOCAL_CFLAGS += -DENABLE_RADEON
111 LOCAL_SHARED_LIBRARIES += libdrm_radeon
112 endif
113
114 ifneq ($(filter $(nouveau_drivers), $(DRM_GPU_DRIVERS)),)
115 LOCAL_SRC_FILES += gralloc_drm_nouveau.c
116 LOCAL_C_INCLUDES += external/drm/nouveau
117 LOCAL_CFLAGS += -DENABLE_NOUVEAU
118 LOCAL_SHARED_LIBRARIES += libdrm_nouveau
119 endif
120
121 ifeq ($(strip $(DRM_USES_PIPE)),true)
122 LOCAL_SRC_FILES += gralloc_drm_pipe.c
123 LOCAL_CFLAGS += -DENABLE_PIPE
124 LOCAL_C_INCLUDES += \
125         external/mesa/src/gallium/include \
126         external/mesa/src/gallium/winsys \
127         external/mesa/src/gallium/drivers \
128         external/mesa/src/gallium/auxiliary
129
130 ifneq ($(filter r600g, $(DRM_GPU_DRIVERS)),)
131 LOCAL_CFLAGS += -DENABLE_PIPE_R600
132 LOCAL_STATIC_LIBRARIES += \
133         libmesa_pipe_r600 \
134         libmesa_winsys_r600
135 endif
136 ifneq ($(filter vmwgfx, $(DRM_GPU_DRIVERS)),)
137 LOCAL_CFLAGS += -DENABLE_PIPE_VMWGFX
138 LOCAL_STATIC_LIBRARIES += \
139         libmesa_pipe_svga \
140         libmesa_winsys_svga
141 LOCAL_C_INCLUDES += \
142         external/mesa/src/gallium/drivers/svga/include
143 endif
144
145 LOCAL_STATIC_LIBRARIES += \
146         libmesa_gallium
147 LOCAL_SHARED_LIBRARIES += libdl
148 endif # DRM_USES_PIPE
149
150 LOCAL_MODULE := gralloc.$(TARGET_PRODUCT)
151 LOCAL_MODULE_TAGS := optional
152 LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw
153
154 include $(BUILD_SHARED_LIBRARY)
155
156 endif # DRM_GPU_DRIVERS