diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Android.mk | 1 | ||||
-rw-r--r-- | src/mesa/Android.mk | 154 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i915/i915_program.c | 1 | ||||
l--------- | src/mesa/drivers/dri/i915/utils.h | 1 | ||||
-rw-r--r-- | src/mesa/drivers/dri/intel/intel_screen.c | 46 |
5 files changed, 203 insertions, 0 deletions
diff --git a/src/Android.mk b/src/Android.mk new file mode 100644 index 0000000000..5053e7d643 --- /dev/null +++ b/src/Android.mk @@ -0,0 +1 @@ +include $(call all-subdir-makefiles) diff --git a/src/mesa/Android.mk b/src/mesa/Android.mk new file mode 100644 index 0000000000..91a0940a54 --- /dev/null +++ b/src/mesa/Android.mk @@ -0,0 +1,154 @@ +LOCAL_PATH := $(call my-dir) + +include $(LOCAL_PATH)/sources + +common_CFLAGS := \ + -DUSE_EXTERNAL_DXTN_LIB=1 -DHAVE_ALIAS -DIN_DRI_DRIVER \ + -DGLX_DIRECT_RENDERING -DGLX_INDIRECT_RENDERING + +common_CFLAGS += -DPTHREADS +# FIXME should we? +#common_CFLAGS += -DGLX_USE_TLS + +ifeq ($(TARGET_ARCH),x86) + MESA_ASM_SOURCES := $(X86_SOURCES) + common_CFLAGS += -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM \ + -DUSE_SSE_ASM +endif + +common_C_INCLUDES := \ + $(LOCAL_PATH)/../../include \ + $(LOCAL_PATH) \ + $(LOCAL_PATH)/main + + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := x86/gen_matypes.c +LOCAL_C_INCLUDES += $(common_C_INCLUDES) +LOCAL_CFLAGS += $(common_CFLAGS) +LOCAL_MODULE := gen_matypes + +# build gen_matypes +ifeq ($(TARGET_ARCH),x86) + include $(BUILD_HOST_EXECUTABLE) +endif + + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := \ + $(MESA_SOURCES) \ + $(MESA_ASM_SOURCES) + +LOCAL_C_INCLUDES += $(common_C_INCLUDES) + +LOCAL_CFLAGS += \ + $(common_CFLAGS) \ + -Wno-sign-compare + +LOCAL_MODULE := libmesa +LOCAL_MODULE_CLASS := STATIC_LIBRARIES + +# generate matypes.h +ifeq ($(TARGET_ARCH),x86) +intermediates := $(local-intermediates-dir) +GEN := $(intermediates)/matypes.h +$(GEN): PRIVATE_CUSTOM_TOOL = $(HOST_OUT_EXECUTABLES)/gen_matypes > $@ +$(GEN): $(HOST_OUT_EXECUTABLES)/gen_matypes + $(transform-generated-source) + +LOCAL_GENERATED_SOURCES += $(GEN) +LOCAL_C_INCLUDES += $(intermediates) +endif + +include $(BUILD_STATIC_LIBRARY) + + +include $(CLEAR_VARS) + +i915_SOURCES = \ + i830_context.c \ + i830_metaops.c \ + i830_state.c \ + i830_texblend.c \ + i830_tex.c \ + i830_texstate.c \ + i830_vtbl.c \ + intel_render.c \ + intel_regions.c \ + intel_buffer_objects.c \ + intel_batchbuffer.c \ + intel_mipmap_tree.c \ + i915_tex_layout.c \ + intel_tex_layout.c \ + intel_tex_image.c \ + intel_tex_subimage.c \ + intel_tex_copy.c \ + intel_tex_validate.c \ + intel_tex_format.c \ + intel_tex.c \ + intel_pixel.c \ + intel_pixel_bitmap.c \ + intel_pixel_copy.c \ + intel_pixel_draw.c \ + intel_pixel_read.c \ + intel_buffers.c \ + intel_blit.c \ + i915_tex.c \ + i915_texstate.c \ + i915_context.c \ + i915_debug.c \ + i915_debug_fp.c \ + i915_fragprog.c \ + i915_metaops.c \ + i915_program.c \ + i915_state.c \ + i915_vtbl.c \ + intel_context.c \ + intel_decode.c \ + intel_screen.c \ + intel_span.c \ + intel_state.c \ + intel_tris.c \ + intel_fbo.c \ + intel_depthstencil.c +i915_SOURCES := $(addprefix drivers/dri/i915/, $(i915_SOURCES)) + +common_SOURCES = \ + utils.c \ + texmem.c \ + vblank.c \ + dri_util.c \ + xmlconfig.c \ + drirenderbuffer.c +common_SOURCES := $(addprefix drivers/dri/common/, $(common_SOURCES)) + +LOCAL_SRC_FILES := \ + $(i915_SOURCES) \ + $(common_SOURCES) + +LOCAL_C_INCLUDES += \ + $(LOCAL_PATH)/drivers/dri/i915 \ + $(LOCAL_PATH)/drivers/dri/common \ + $(LOCAL_PATH)/drivers/dri/intel \ + $(LOCAL_PATH)/drivers/dri/intel/server \ + $(common_C_INCLUDES) \ + external/drm/libdrm \ + external/drm/libdrm/intel \ + external/drm/shared-core \ + external/expat/lib + +LOCAL_CFLAGS += \ + $(common_CFLAGS) \ + -DI915 \ + -DDRM_VBLANK_FLIP=DRM_VBLANK_FLIP \ + -Wno-sign-compare + +LOCAL_SHARED_LIBRARIES := libexpat libdrm libdrm_intel +LOCAL_STATIC_LIBRARIES := libmesa + +LOCAL_MODULE := i915_dri +LOCAL_ALLOW_UNDEFINED_SYMBOLS := true + +include $(BUILD_SHARED_LIBRARY) diff --git a/src/mesa/drivers/dri/i915/i915_program.c b/src/mesa/drivers/dri/i915/i915_program.c index e87700f8e0..defe27f11d 100644 --- a/src/mesa/drivers/dri/i915/i915_program.c +++ b/src/mesa/drivers/dri/i915/i915_program.c @@ -25,6 +25,7 @@ * **************************************************************************/ +#include <stdlib.h> #include <strings.h> #include "main/glheader.h" diff --git a/src/mesa/drivers/dri/i915/utils.h b/src/mesa/drivers/dri/i915/utils.h new file mode 120000 index 0000000000..73c61f880f --- /dev/null +++ b/src/mesa/drivers/dri/i915/utils.h @@ -0,0 +1 @@ +../common/utils.h
\ No newline at end of file diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c index 1b8c56e68d..d547077929 100644 --- a/src/mesa/drivers/dri/intel/intel_screen.c +++ b/src/mesa/drivers/dri/intel/intel_screen.c @@ -25,6 +25,7 @@ * **************************************************************************/ +#include <sys/ioctl.h> #include "main/glheader.h" #include "main/context.h" #include "main/framebuffer.h" @@ -229,6 +230,50 @@ static const __DRItexBufferExtension intelTexBufferExtension = { intelSetTexBuffer2, }; +static int +intelCopyBufferExt(__DRIcontext *context, + __DRIbuffer *dst, + int dst_x, int dst_y, + __DRIdrawable *src, unsigned int src_attachment, + int x, int y, int width, int height) +{ + struct intel_framebuffer *intel_fb = src->driverPrivate; + struct intel_context *intel = context->driverPrivate; + struct intel_region *dst_region; + struct intel_renderbuffer *rb; + + if (src_attachment != __DRI_BUFFER_FRONT_LEFT) + return -1; + + dst_region = intel_region_alloc_for_handle(intel, + dst->cpp, + dst_x + width, + dst_y + height, + dst->pitch / dst->cpp, + dst->name, + "copyBuffer dst temp"); + + intel_update_renderbuffers(context, src); + + rb = intel_fb->color_rb[0]; + intel_region_copy(intel, dst_region, 0, dst_x, dst_y, + rb->region, 0, x, y, width, height); + intel_batchbuffer_flush(intel->batch); + intel_region_release(&dst_region); + + if (ioctl(intel->driFd, DRM_IOCTL_I915_GEM_THROTTLE, NULL) < 0) { + fprintf(stderr, "throttle failed: %m\n"); + return -1; + } + + return 0; +} + +static const __DRIcopyBufferExtension intelCopyBufferExtension = { + { __DRI_COPY_BUFFER, __DRI_COPY_BUFFER_VERSION }, + intelCopyBufferExt, +}; + static const __DRIextension *intelScreenExtensions[] = { &driReadDrawableExtension, &driCopySubBufferExtension.base, @@ -237,6 +282,7 @@ static const __DRIextension *intelScreenExtensions[] = { &driMediaStreamCounterExtension.base, &intelTexOffsetExtension.base, &intelTexBufferExtension.base, + &intelCopyBufferExtension.base, NULL }; |