OSDN Git Service

gralloc: hdmi cloned mode support
[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 := $(strip $(filter-out swrast, $(BOARD_GPU_DRIVERS)))
25
26 intel_drivers := i915 i965 i915g
27 radeon_drivers := r300g r600g
28 nouveau_drivers := nouveau
29 vmwgfx_drivers := vmwgfx
30
31 valid_drivers := \
32         prebuilt \
33         $(intel_drivers) \
34         $(radeon_drivers) \
35         $(nouveau_drivers) \
36         $(vmwgfx_drivers)
37
38 # warn about invalid drivers
39 invalid_drivers := $(filter-out $(valid_drivers), $(DRM_GPU_DRIVERS))
40 ifneq ($(invalid_drivers),)
41 $(warning invalid GPU drivers: $(invalid_drivers))
42 # tidy up
43 DRM_GPU_DRIVERS := $(filter-out $(invalid_drivers), $(DRM_GPU_DRIVERS))
44 endif
45
46 ifneq ($(filter $(vmwgfx_drivers), $(DRM_GPU_DRIVERS)),)
47 DRM_USES_PIPE := true
48 else
49 DRM_USES_PIPE := false
50 endif
51
52 ifneq ($(strip $(DRM_GPU_DRIVERS)),)
53
54 LOCAL_PATH := $(call my-dir)
55
56 include $(CLEAR_VARS)
57 LOCAL_MODULE := gralloc.$(TARGET_PRODUCT)
58 LOCAL_MODULE_TAGS := optional
59
60 ifeq ($(strip $(DRM_GPU_DRIVERS)),prebuilt)
61
62 LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw/
63 LOCAL_SRC_FILES := ../../$(BOARD_GPU_DRIVER_BINARY)
64 LOCAL_MODULE_CLASS := SHARED_LIBRARIES
65 LOCAL_MODULE_SUFFIX := $(TARGET_SHLIB_SUFFIX)
66 include $(BUILD_PREBUILT)
67
68 else
69
70 LOCAL_SRC_FILES := \
71         gralloc.c \
72         gralloc_drm.c \
73         gralloc_drm_kms.c
74
75 LOCAL_C_INCLUDES := \
76         external/drm \
77         external/drm/include/drm
78
79 LOCAL_SHARED_LIBRARIES := \
80         libdrm \
81         liblog \
82         libcutils \
83         libhardware_legacy \
84
85 # for glFlush/glFinish
86 LOCAL_SHARED_LIBRARIES += \
87         libGLESv1_CM
88
89 ifneq ($(filter $(intel_drivers), $(DRM_GPU_DRIVERS)),)
90 LOCAL_SRC_FILES += gralloc_drm_intel.c
91 LOCAL_C_INCLUDES += external/drm/intel
92 LOCAL_CFLAGS += -DENABLE_INTEL
93 LOCAL_SHARED_LIBRARIES += libdrm_intel
94 endif
95
96 ifneq ($(filter $(radeon_drivers), $(DRM_GPU_DRIVERS)),)
97 LOCAL_SRC_FILES += gralloc_drm_radeon.c
98 LOCAL_C_INCLUDES += external/drm/radeon
99 LOCAL_CFLAGS += -DENABLE_RADEON
100 LOCAL_SHARED_LIBRARIES += libdrm_radeon
101 endif
102
103 ifneq ($(filter $(nouveau_drivers), $(DRM_GPU_DRIVERS)),)
104 LOCAL_SRC_FILES += gralloc_drm_nouveau.c
105 LOCAL_C_INCLUDES += external/drm/nouveau
106 LOCAL_CFLAGS += -DENABLE_NOUVEAU
107 LOCAL_SHARED_LIBRARIES += libdrm_nouveau
108 endif
109
110 ifeq ($(strip $(DRM_USES_PIPE)),true)
111 LOCAL_SRC_FILES += gralloc_drm_pipe.c
112 LOCAL_CFLAGS += -DENABLE_PIPE
113 LOCAL_C_INCLUDES += \
114         external/mesa/src/gallium/include \
115         external/mesa/src/gallium/winsys \
116         external/mesa/src/gallium/drivers \
117         external/mesa/src/gallium/auxiliary
118
119 ifneq ($(filter r600g, $(DRM_GPU_DRIVERS)),)
120 LOCAL_CFLAGS += -DENABLE_PIPE_R600
121 LOCAL_STATIC_LIBRARIES += \
122         libmesa_pipe_r600 \
123         libmesa_winsys_r600
124 endif
125 ifneq ($(filter vmwgfx, $(DRM_GPU_DRIVERS)),)
126 LOCAL_CFLAGS += -DENABLE_PIPE_VMWGFX
127 LOCAL_STATIC_LIBRARIES += \
128         libmesa_pipe_svga \
129         libmesa_winsys_svga
130 LOCAL_C_INCLUDES += \
131         external/mesa/src/gallium/drivers/svga/include
132 endif
133
134 LOCAL_STATIC_LIBRARIES += \
135         libmesa_gallium
136 LOCAL_SHARED_LIBRARIES += libdl
137 endif # DRM_USES_PIPE
138
139 LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw
140
141 include $(BUILD_SHARED_LIBRARY)
142
143 endif # DRM_GPU_DRIVERS=prebuilt
144 endif # DRM_GPU_DRIVERS