Compare commits

..

19 Commits

Author SHA1 Message Date
Luca Barbieri
0e50c21e24 glsl: Unroll loops with conditional breaks anywhere (not just the end)
Currently we only unroll loops with conditional breaks at the end, which is
the form that lower_jumps generates.

However, if breaks are not lowered, they tend to appear at the beginning, so
add support for a conditional break anywhere.

Signed-off-by: Luca Barbieri <luca@luca-barbieri.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2010-12-09 16:42:05 -08:00
Kenneth Graunke
13c45c590b glsl: Consider the "else" branch when looking for loop breaks.
Found this bug by code inspection.  Based off the comments just before
this code, the intent is to find whether the break exists in the "then"
branch or the "else" branch.  However, the code actually looked at the
last instruction in the "then" branch twice.
2010-12-09 16:42:05 -08:00
Kenneth Graunke
528fa8ce32 glsl: Clean up code by adding a new is_break() function. 2010-12-09 16:42:05 -08:00
Eric Anholt
b13a2e640f glsl: Correct the marking of InputsRead/OutputsWritten on in/out matrices.
If you used a constant array index to access the matrix, we'd flag a
bunch of wrong inputs/outputs as being used because the index was
multiplied by matrix columns and the actual used index was left out.

Fixes glsl-mat-attribute.
2010-12-09 14:41:50 -08:00
Eric Anholt
3fb18d6775 intel: Set the swizzling for depth textures using the GL_RED depth mode.
Fixes depth-tex-modes-rg.
2010-12-09 14:41:50 -08:00
Eric Anholt
b4e8ec3a57 intel: Use plain R8 and RG8 for COMPRESSED_RED and COMPRESSED_RG.
Fixes texture-rg.
2010-12-09 14:41:50 -08:00
Vinson Lee
c3ca384e71 i965: Silence uninitialized variable warning.
Fixes this GCC warning.
brw_fs.cpp: In function 'brw_reg brw_reg_from_fs_reg(fs_reg*)':
brw_fs.cpp:3255: warning: 'brw_reg' may be used uninitialized in this function
2010-12-09 14:17:17 -08:00
Vinson Lee
af5f7b3260 r600g: Fix SCons build. 2010-12-09 14:03:58 -08:00
Jerome Glisse
121079bd67 r600g: indentation cleanup
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-12-09 16:16:22 -05:00
Jerome Glisse
7055068eea r600g: specialized upload manager
Allow important performance increase by doing hw specific implementation
of the upload manager helper. Drop the range flushing that is not hit with
this code (and wasn't with previous neither). Performance improvement are
mostly visible on slow CPU.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-12-09 16:07:05 -05:00
Jerome Glisse
15753cf54d r600g: avoid using pb* helper we are loosing previous cpu cycle with it
r600g is up to a point where all small CPU cycle matter and pb* turn
high on profile. It's mostly because pb try to be generic and thus
trigger unecessary check for r600g driver. To avoid having too much
abstraction & too much depth in the call embedded everythings into
r600_bo. Make code simpler & faster. The performance win highly depend
on the CPU & application considered being more important on slower CPU
and marginal/unoticeable on faster one.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-12-09 16:07:01 -05:00
Fabian Bieler
ef534f3838 glsl: fix lowering conditional returns in subroutines
this fix applies to the lower_sub_return 'branch' of the lower_jumps pass

Fixes piglit tests glsl-functions-5 and glsl-functions-6.
2010-12-09 11:28:06 -08:00
Eric Anholt
834cc8e501 i965: remove unused variable since brw_wm_glsl.c removal. 2010-12-09 11:11:04 -08:00
Eric Anholt
cfcc2ef587 i965: Set render_cache_read_write surface state bit on gen6 constant surfs.
This is said to be required in the spec, even when you aren't doing writes.
2010-12-09 11:11:04 -08:00
Eric Anholt
30f25a1019 i965: Set up the correct texture border color state struct for Ironlake.
This doesn't actually fix border color on Ironlake, but it appears to
be a requirement, and gen6 needs it too.
2010-12-09 10:51:00 -08:00
Eric Anholt
14a9153a32 i965: Clean up VS constant buffer location setup. 2010-12-09 10:51:00 -08:00
Eric Anholt
8fab1c0e2e i965: Fix VS constants regression pre-gen6.
Last minute change for gen6 with 0 used params dropped the multiply.
2010-12-09 10:50:59 -08:00
José Fonseca
cdd4f04f80 llvmpipe: Plug fence leaks. 2010-12-09 16:48:26 +00:00
Shuang He
9946f15d30 mesa: allow GLfixed arrays for OpenGL ES 2.0
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-12-09 08:23:54 -07:00
133 changed files with 749 additions and 80161 deletions

View File

@@ -1,3 +0,0 @@
ifneq ($(TARGET_SIMULATOR),true)
include $(call all-subdir-makefiles)
endif

View File

@@ -376,28 +376,6 @@ typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSREGIONNOK) (EGLDisplay dpy, EG
#define EGL_Y_INVERTED_NOK 0x307F
#endif /* EGL_NOK_texture_from_pixmap */
#ifndef EGL_ANDROID_image_native_buffer
#define EGL_ANDROID_image_native_buffer 1
struct android_native_buffer_t;
#define EGL_NATIVE_BUFFER_ANDROID 0x3140 /* eglCreateImageKHR target */
#endif
#ifndef EGL_ANDROID_get_render_buffer
#define EGL_ANDROID_get_render_buffer 1
#ifdef EGL_EGLEXT_PROTOTYPES
EGLAPI EGLClientBuffer EGLAPIENTRY eglGetRenderBufferANDROID(EGLDisplay dpy, EGLSurface draw);
#endif
typedef EGLClientBuffer (EGLAPIENTRYP PFNEGLGETRENDERBUFFERANDROIDPROC) (EGLDisplay dpy, EGLSurface draw);
#endif
#ifndef EGL_ANDROID_swap_rectangle
#define EGL_ANDROID_swap_rectangle 1
#ifdef EGL_EGLEXT_PROTOTYPES
EGLAPI EGLBoolean EGLAPIENTRY eglSetSwapRectangleANDROID (EGLDisplay dpy, EGLSurface draw, EGLint left, EGLint top, EGLint width, EGLint height);
#endif /* EGL_EGLEXT_PROTOTYPES */
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSETSWAPRECTANGLEANDROIDPROC) (EGLDisplay dpy, EGLSurface draw, EGLint left, EGLint top, EGLint width, EGLint height);
#endif
#ifdef __cplusplus
}

View File

@@ -78,15 +78,6 @@ typedef int EGLNativeDisplayType;
typedef void *EGLNativeWindowType;
typedef void *EGLNativePixmapType;
#elif defined(ANDROID) /* Android */
struct android_native_window_t;
struct egl_native_pixmap_t;
typedef struct android_native_window_t* EGLNativeWindowType;
typedef struct egl_native_pixmap_t* EGLNativePixmapType;
typedef void* EGLNativeDisplayType;
#elif defined(__unix__) || defined(__unix)
#ifdef MESA_EGL_NO_X11_HEADERS

View File

@@ -788,7 +788,6 @@ struct __DRIdri2ExtensionRec {
#define __DRI_IMAGE_FORMAT_RGB565 0x1001
#define __DRI_IMAGE_FORMAT_XRGB8888 0x1002
#define __DRI_IMAGE_FORMAT_ARGB8888 0x1003
#define __DRI_IMAGE_FORMAT_RGBA8888_REV 0x1004
#define __DRI_IMAGE_USE_SHARE 0x0001
#define __DRI_IMAGE_USE_SCANOUT 0x0002

View File

@@ -1,96 +0,0 @@
LOCAL_PATH := $(call my-dir)
# build classic static libraries
MESA_BUILD_CLASSIC := false
# build gallium static libraries
MESA_BUILD_GALLIUM := false
# build gralloc.i915
MESA_BUILD_I915 := false
# build libGLES_i915c
MESA_BUILD_I915C := false
# build libGLES_swrast
MESA_BUILD_SWRAST := false
# build gralloc.vmwgfx
MESA_BUILD_VMWGFX := false
# build libGLES_i915g
MESA_BUILD_I915G := false
# for testing purpose
#BOARD_USES_I915C := true
#BOARD_USES_I915G := true
#BOARD_USES_I965C := true
#BOARD_USES_VMWGFX := true
MESA_GRALLOC_NAME :=
MESA_GLES_NAME :=
ifeq ($(strip $(BOARD_USES_I915C)),true)
MESA_BUILD_CLASSIC := true
MESA_BUILD_I915 := true
MESA_BUILD_I915C := true
MESA_GRALLOC_NAME := i915
MESA_GLES_NAME := i915c
endif
ifeq ($(strip $(BOARD_USES_I915G)),true)
MESA_BUILD_GALLIUM := true
MESA_BUILD_I915 := true
MESA_BUILD_I915G := true
MESA_GRALLOC_NAME := i915
MESA_GLES_NAME := i915g
endif
ifeq ($(strip $(BOARD_USES_I965C)),true)
MESA_BUILD_CLASSIC := true
MESA_BUILD_I915 := true
MESA_BUILD_I965C := true
MESA_GRALLOC_NAME := i915
MESA_GLES_NAME := i965c
endif
ifeq ($(strip $(BOARD_USES_VMWGFX)),true)
MESA_BUILD_GALLIUM := true
MESA_BUILD_SWRAST := true
MESA_BUILD_VMWGFX := true
MESA_GRALLOC_NAME := vmwgfx
MESA_GLES_NAME := swrast
endif
ifneq ($(strip $(MESA_GRALLOC_NAME) $(MESA_GLES_NAME)),)
# build the real modules
include $(call all-subdir-makefiles)
include $(CLEAR_VARS)
symlink := $(TARGET_OUT_SHARED_LIBRARIES)/hw/gralloc.$(TARGET_PRODUCT)$(TARGET_SHLIB_SUFFIX)
symlink_to := gralloc.$(MESA_GRALLOC_NAME)$(TARGET_SHLIB_SUFFIX)
$(symlink): PRIVATE_TO := $(symlink_to)
$(symlink): $(TARGET_OUT_SHARED_LIBRARIES)/hw/$(symlink_to)
@echo "Symlink: $@ -> $(PRIVATE_TO)"
@mkdir -p $(dir $@)
@rm -rf $@
$(hide) ln -sf $(PRIVATE_TO) $@
ALL_PREBUILT += $(symlink)
symlink := $(TARGET_OUT_SHARED_LIBRARIES)/egl/libGLES_mesa$(TARGET_SHLIB_SUFFIX)
symlink_to := libGLES_$(MESA_GLES_NAME)$(TARGET_SHLIB_SUFFIX)
$(symlink): PRIVATE_TO := $(symlink_to)
$(symlink): $(TARGET_OUT_SHARED_LIBRARIES)/egl/$(symlink_to)
@echo "Symlink: $@ -> $(PRIVATE_TO)"
@mkdir -p $(dir $@)
@rm -rf $@
$(hide) ln -sf $(PRIVATE_TO) $@
ALL_PREBUILT += $(symlink)
endif # MESA_GRALLOC_NAME || MESA_GLES_NAME

View File

@@ -1,68 +0,0 @@
LOCAL_PATH := $(call my-dir)
# from main/Makefile
SOURCES = \
eglapi.c \
eglarray.c \
eglconfig.c \
eglcontext.c \
eglcurrent.c \
egldisplay.c \
egldriver.c \
eglfallbacks.c \
eglglobals.c \
eglimage.c \
egllog.c \
eglmisc.c \
eglmode.c \
eglscreen.c \
eglstring.c \
eglsurface.c \
eglsync.c
include $(CLEAR_VARS)
LOCAL_SRC_FILES := \
$(addprefix main/, $(SOURCES))
LOCAL_CFLAGS := \
-DPTHREADS \
-D_EGL_NATIVE_PLATFORM=_EGL_PLATFORM_ANDROID \
-D_EGL_DRIVER_SEARCH_DIR=\"/system/lib/egl\" \
-fvisibility=hidden \
-Wno-sign-compare
LOCAL_C_INCLUDES := \
external/mesa/include
LOCAL_MODULE := libmesa_egl
include $(BUILD_STATIC_LIBRARY)
ifeq ($(strip $(MESA_BUILD_CLASSIC)),true)
include $(CLEAR_VARS)
LOCAL_SRC_FILES := \
drivers/android/egl_android.c \
drivers/android/droid.c \
drivers/android/droid_core.c \
drivers/android/droid_image.c
LOCAL_CFLAGS := \
-DPTHREADS \
-fvisibility=hidden \
-Wno-sign-compare
LOCAL_C_INCLUDES := \
external/mesa/include \
external/mesa/src/mapi \
external/mesa/src/egl/main \
external/mesa/src/gralloc \
external/drm \
external/drm/include/drm
LOCAL_MODULE := libmesa_classic_egl
include $(BUILD_STATIC_LIBRARY)
endif # MESA_BUILD_CLASSIC

View File

@@ -1,649 +0,0 @@
/*
* Copyright © 2010 Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
* Authors:
* Kristian Høgsberg <krh@bitplanet.net>
*/
#define LOG_TAG "MESA-EGL"
#include <cutils/log.h>
#include "glapi/glapi.h"
#include "droid.h"
static const __DRIuseInvalidateExtension use_invalidate = {
{ __DRI_USE_INVALIDATE, 1 }
};
static __DRIimage *
droid_lookup_egl_image(__DRIscreen *screen, void *image, void *data)
{
_EGLDisplay *disp = data;
struct droid_egl_image *dimg;
_EGLImage *img;
(void) screen;
img = _eglLookupImage(image, disp);
if (img == NULL) {
_eglError(EGL_BAD_PARAMETER, "droid_lookup_egl_image");
return NULL;
}
dimg = droid_egl_image(image);
return dimg->dri_image;
}
static const __DRIimageLookupExtension image_lookup_extension = {
{ __DRI_IMAGE_LOOKUP, 1 },
droid_lookup_egl_image
};
static int
get_format_bpp(int native)
{
int bpp;
/* see libpixelflinger/format.cpp */
switch (native) {
case GGL_PIXEL_FORMAT_RGBA_8888:
case GGL_PIXEL_FORMAT_RGBX_8888:
case GGL_PIXEL_FORMAT_BGRA_8888:
bpp = 4;
break;
case GGL_PIXEL_FORMAT_RGB_888:
bpp = 3;
break;
case GGL_PIXEL_FORMAT_RGB_565:
case GGL_PIXEL_FORMAT_RGBA_5551:
case GGL_PIXEL_FORMAT_RGBA_4444:
case GGL_PIXEL_FORMAT_LA_88:
bpp = 2;
break;
case GGL_PIXEL_FORMAT_RGB_332:
case GGL_PIXEL_FORMAT_A_8:
case GGL_PIXEL_FORMAT_L_8:
bpp = 1;
break;
default:
bpp = 0;
break;
}
return bpp;
}
#include <gralloc_gem.h>
int
get_native_buffer_name(struct android_native_buffer_t *buf)
{
struct drm_bo_t *bo;
bo = drm_gem_get(buf->handle);
return (bo) ? bo->name : 0;
}
EGLBoolean
droid_dequeue_buffer(struct droid_egl_surface *dsurf)
{
__DRIbuffer *buf = &dsurf->dri_buffer;
if (dsurf->window->dequeueBuffer(dsurf->window, &dsurf->buffer))
return EGL_FALSE;
dsurf->buffer->common.incRef(&dsurf->buffer->common);
dsurf->window->lockBuffer(dsurf->window, dsurf->buffer);
buf->attachment = __DRI_BUFFER_FAKE_FRONT_LEFT;
buf->name = get_native_buffer_name(dsurf->buffer);
buf->cpp = get_format_bpp(dsurf->buffer->format);
buf->pitch = dsurf->buffer->stride * buf->cpp;
buf->flags = 0;
return EGL_TRUE;
}
EGLBoolean
droid_enqueue_buffer(struct droid_egl_surface *dsurf)
{
dsurf->window->queueBuffer(dsurf->window, dsurf->buffer);
dsurf->buffer->common.decRef(&dsurf->buffer->common);
dsurf->buffer = NULL;
return EGL_TRUE;
}
static void
droid_flush_front_buffer(__DRIdrawable * driDrawable, void *loaderPrivate)
{
}
static __DRIbuffer *
droid_get_buffers_with_format(__DRIdrawable * driDrawable,
int *width, int *height,
unsigned int *attachments, int count,
int *out_count, void *loaderPrivate)
{
struct droid_egl_surface *dsurf = loaderPrivate;
struct droid_egl_display *ddpy =
droid_egl_display(dsurf->base.Resource.Display);
if (!dsurf->buffer) {
if (!droid_dequeue_buffer(dsurf))
return NULL;
}
if (width)
*width = dsurf->buffer->width;
if (height)
*height = dsurf->buffer->height;
*out_count = 1;
return &dsurf->dri_buffer;
}
static const EGLint droid_to_egl_attribute_map[] = {
0,
EGL_BUFFER_SIZE, /* __DRI_ATTRIB_BUFFER_SIZE */
EGL_LEVEL, /* __DRI_ATTRIB_LEVEL */
EGL_RED_SIZE, /* __DRI_ATTRIB_RED_SIZE */
EGL_GREEN_SIZE, /* __DRI_ATTRIB_GREEN_SIZE */
EGL_BLUE_SIZE, /* __DRI_ATTRIB_BLUE_SIZE */
EGL_LUMINANCE_SIZE, /* __DRI_ATTRIB_LUMINANCE_SIZE */
EGL_ALPHA_SIZE, /* __DRI_ATTRIB_ALPHA_SIZE */
0, /* __DRI_ATTRIB_ALPHA_MASK_SIZE */
EGL_DEPTH_SIZE, /* __DRI_ATTRIB_DEPTH_SIZE */
EGL_STENCIL_SIZE, /* __DRI_ATTRIB_STENCIL_SIZE */
0, /* __DRI_ATTRIB_ACCUM_RED_SIZE */
0, /* __DRI_ATTRIB_ACCUM_GREEN_SIZE */
0, /* __DRI_ATTRIB_ACCUM_BLUE_SIZE */
0, /* __DRI_ATTRIB_ACCUM_ALPHA_SIZE */
EGL_SAMPLE_BUFFERS, /* __DRI_ATTRIB_SAMPLE_BUFFERS */
EGL_SAMPLES, /* __DRI_ATTRIB_SAMPLES */
0, /* __DRI_ATTRIB_RENDER_TYPE, */
0, /* __DRI_ATTRIB_CONFIG_CAVEAT */
0, /* __DRI_ATTRIB_CONFORMANT */
0, /* __DRI_ATTRIB_DOUBLE_BUFFER */
0, /* __DRI_ATTRIB_STEREO */
0, /* __DRI_ATTRIB_AUX_BUFFERS */
0, /* __DRI_ATTRIB_TRANSPARENT_TYPE */
0, /* __DRI_ATTRIB_TRANSPARENT_INDEX_VALUE */
0, /* __DRI_ATTRIB_TRANSPARENT_RED_VALUE */
0, /* __DRI_ATTRIB_TRANSPARENT_GREEN_VALUE */
0, /* __DRI_ATTRIB_TRANSPARENT_BLUE_VALUE */
0, /* __DRI_ATTRIB_TRANSPARENT_ALPHA_VALUE */
0, /* __DRI_ATTRIB_FLOAT_MODE */
0, /* __DRI_ATTRIB_RED_MASK */
0, /* __DRI_ATTRIB_GREEN_MASK */
0, /* __DRI_ATTRIB_BLUE_MASK */
0, /* __DRI_ATTRIB_ALPHA_MASK */
EGL_MAX_PBUFFER_WIDTH, /* __DRI_ATTRIB_MAX_PBUFFER_WIDTH */
EGL_MAX_PBUFFER_HEIGHT, /* __DRI_ATTRIB_MAX_PBUFFER_HEIGHT */
EGL_MAX_PBUFFER_PIXELS, /* __DRI_ATTRIB_MAX_PBUFFER_PIXELS */
0, /* __DRI_ATTRIB_OPTIMAL_PBUFFER_WIDTH */
0, /* __DRI_ATTRIB_OPTIMAL_PBUFFER_HEIGHT */
0, /* __DRI_ATTRIB_VISUAL_SELECT_GROUP */
0, /* __DRI_ATTRIB_SWAP_METHOD */
EGL_MAX_SWAP_INTERVAL, /* __DRI_ATTRIB_MAX_SWAP_INTERVAL */
EGL_MIN_SWAP_INTERVAL, /* __DRI_ATTRIB_MIN_SWAP_INTERVAL */
0, /* __DRI_ATTRIB_BIND_TO_TEXTURE_RGB */
0, /* __DRI_ATTRIB_BIND_TO_TEXTURE_RGBA */
0, /* __DRI_ATTRIB_BIND_TO_MIPMAP_TEXTURE */
0, /* __DRI_ATTRIB_BIND_TO_TEXTURE_TARGETS */
EGL_Y_INVERTED_NOK, /* __DRI_ATTRIB_YINVERTED */
};
static struct droid_egl_config *
droid_add_config(_EGLDisplay *dpy, const __DRIconfig *dri_config, int id,
int depth, EGLint surface_type, int rgba_masks[4])
{
struct droid_egl_config *conf;
struct droid_egl_display *ddpy;
_EGLConfig base;
unsigned int attrib, value, double_buffer;
EGLint key, bind_to_texture_rgb, bind_to_texture_rgba;
int dri_masks[4] = { 0, 0, 0, 0 };
int i;
ddpy = dpy->DriverData;
_eglInitConfig(&base, dpy, id);
i = 0;
double_buffer = 0;
bind_to_texture_rgb = 0;
bind_to_texture_rgba = 0;
while (ddpy->core->indexConfigAttrib(dri_config, i++, &attrib, &value)) {
switch (attrib) {
case __DRI_ATTRIB_RENDER_TYPE:
if (value & __DRI_ATTRIB_RGBA_BIT)
value = EGL_RGB_BUFFER;
else if (value & __DRI_ATTRIB_LUMINANCE_BIT)
value = EGL_LUMINANCE_BUFFER;
else
assert(0);
_eglSetConfigKey(&base, EGL_COLOR_BUFFER_TYPE, value);
break;
case __DRI_ATTRIB_CONFIG_CAVEAT:
if (value & __DRI_ATTRIB_NON_CONFORMANT_CONFIG)
value = EGL_NON_CONFORMANT_CONFIG;
else if (value & __DRI_ATTRIB_SLOW_BIT)
value = EGL_SLOW_CONFIG;
else
value = EGL_NONE;
_eglSetConfigKey(&base, EGL_CONFIG_CAVEAT, value);
break;
case __DRI_ATTRIB_BIND_TO_TEXTURE_RGB:
bind_to_texture_rgb = value;
break;
case __DRI_ATTRIB_BIND_TO_TEXTURE_RGBA:
bind_to_texture_rgba = value;
break;
case __DRI_ATTRIB_DOUBLE_BUFFER:
double_buffer = value;
break;
case __DRI_ATTRIB_RED_MASK:
dri_masks[0] = value;
break;
case __DRI_ATTRIB_GREEN_MASK:
dri_masks[1] = value;
break;
case __DRI_ATTRIB_BLUE_MASK:
dri_masks[2] = value;
break;
case __DRI_ATTRIB_ALPHA_MASK:
dri_masks[3] = value;
break;
default:
key = droid_to_egl_attribute_map[attrib];
if (key != 0)
_eglSetConfigKey(&base, key, value);
break;
}
}
/* In EGL, double buffer or not isn't a config attribute. Pixmaps
* surfaces are always single buffered, pbuffer surfaces are always
* back buffers and windows can be either, selected by passing an
* attribute at window surface construction time. To support this
* we ignore all double buffer configs and manipulate the buffer we
* return in the getBuffer callback to get the behaviour we want. */
if (double_buffer)
return NULL;
if (depth > 0 && depth != _eglGetConfigKey(&base, EGL_BUFFER_SIZE))
return NULL;
if (memcmp(dri_masks, rgba_masks, sizeof(rgba_masks)))
return NULL;
_eglSetConfigKey(&base, EGL_NATIVE_RENDERABLE, EGL_TRUE);
_eglSetConfigKey(&base, EGL_SURFACE_TYPE, surface_type);
if (surface_type & (EGL_PIXMAP_BIT | EGL_PBUFFER_BIT)) {
_eglSetConfigKey(&base, EGL_BIND_TO_TEXTURE_RGB, bind_to_texture_rgb);
if (_eglGetConfigKey(&base, EGL_ALPHA_SIZE) > 0)
_eglSetConfigKey(&base,
EGL_BIND_TO_TEXTURE_RGBA, bind_to_texture_rgba);
}
_eglSetConfigKey(&base, EGL_RENDERABLE_TYPE, dpy->ClientAPIsMask);
_eglSetConfigKey(&base, EGL_CONFORMANT, dpy->ClientAPIsMask);
if (!_eglValidateConfig(&base, EGL_FALSE)) {
_eglLog(_EGL_DEBUG, "DRI2: failed to validate config %d", id);
return NULL;
}
conf = calloc(1, sizeof(*conf));
if (conf != NULL) {
memcpy(&conf->base, &base, sizeof(base));
conf->dri_config = dri_config;
_eglLinkConfig(&conf->base);
}
return conf;
}
static EGLBoolean
droid_add_configs_for_visuals(_EGLDriver *drv, _EGLDisplay *dpy)
{
struct droid_egl_display *ddpy = droid_egl_display(dpy);
const struct {
int format;
int size;
int rgba_masks[4];
} visuals[] = {
{ GGL_PIXEL_FORMAT_RGBA_8888, 32, { 0xff, 0xff00, 0xff0000, 0xff000000 } },
{ GGL_PIXEL_FORMAT_RGBX_8888, 32, { 0xff, 0xff00, 0xff0000, 0x0 } },
{ GGL_PIXEL_FORMAT_RGB_888, 24, { 0xff, 0xff00, 0xff0000, 0x0 } },
{ GGL_PIXEL_FORMAT_RGB_565, 16, { 0xf800, 0x7e0, 0x1f, 0x0 } },
{ GGL_PIXEL_FORMAT_BGRA_8888, 32, { 0xff0000, 0xff00, 0xff, 0xff000000 } },
{ GGL_PIXEL_FORMAT_A_8, 8, { 0xf800, 0x7e0, 0x1f, 0x0 } },
{ 0, 0, { 0, 0, 0, 0 } }
};
int count, i, j;
count = 0;
for (i = 0; visuals[i].format; i++) {
int format_count = 0;
for (j = 0; ddpy->dri_configs[j]; j++) {
struct droid_egl_config *dconf;
dconf = droid_add_config(dpy, ddpy->dri_configs[j], count + 1,
visuals[i].size, EGL_WINDOW_BIT, visuals[i].rgba_masks);
if (dconf) {
_eglSetConfigKey(&dconf->base,
EGL_NATIVE_VISUAL_TYPE, visuals[i].format);
count++;
format_count++;
}
}
if (!format_count) {
_eglLog(_EGL_DEBUG, "No DRI config supports native format 0x%x",
visuals[i].format);
}
}
return (count != 0);
}
struct droid_extension_match {
const char *name;
int version;
int offset;
};
static struct droid_extension_match droid_driver_extensions[] = {
{ __DRI_CORE, 1, offsetof(struct droid_egl_display, core) },
{ __DRI_DRI2, 1, offsetof(struct droid_egl_display, dri2) },
{ NULL, 0, 0 }
};
static struct droid_extension_match droid_core_extensions[] = {
{ __DRI2_FLUSH, 1, offsetof(struct droid_egl_display, flush) },
{ __DRI_IMAGE, 1, offsetof(struct droid_egl_display, image) },
{ NULL, 0, 0 }
};
extern const __DRIextension *__driDriverExtensions[];
static EGLBoolean
droid_bind_extensions(struct droid_egl_display *ddpy,
struct droid_extension_match *matches,
const __DRIextension **extensions)
{
int i, j, ret = EGL_TRUE;
void *field;
for (i = 0; extensions[i]; i++) {
_eglLog(_EGL_DEBUG, "DRI2: found extension `%s'", extensions[i]->name);
for (j = 0; matches[j].name; j++) {
if (strcmp(extensions[i]->name, matches[j].name) == 0 &&
extensions[i]->version >= matches[j].version) {
field = ((char *) ddpy + matches[j].offset);
*(const __DRIextension **) field = extensions[i];
_eglLog(_EGL_INFO, "DRI2: found extension %s version %d",
extensions[i]->name, extensions[i]->version);
}
}
}
for (j = 0; matches[j].name; j++) {
field = ((char *) ddpy + matches[j].offset);
if (*(const __DRIextension **) field == NULL) {
_eglLog(_EGL_FATAL, "DRI2: did not find extension %s version %d",
matches[j].name, matches[j].version);
ret = EGL_FALSE;
}
}
return ret;
}
static EGLBoolean
droid_create_screen(_EGLDisplay *dpy)
{
struct droid_egl_display *ddpy = droid_egl_display(dpy);
const __DRIextension **extensions;
unsigned int api_mask;
ddpy->dri_screen =
ddpy->dri2->createNewScreen(0, ddpy->fd, ddpy->extensions,
&ddpy->dri_configs, dpy);
if (ddpy->dri_screen == NULL) {
_eglLog(_EGL_WARNING, "failed to create dri screen");
return EGL_FALSE;
}
extensions = ddpy->core->getExtensions(ddpy->dri_screen);
if (!droid_bind_extensions(ddpy, droid_core_extensions, extensions)) {
ddpy->core->destroyScreen(ddpy->dri_screen);
return EGL_FALSE;
}
if (ddpy->dri2->base.version >= 2)
api_mask = ddpy->dri2->getAPIMask(ddpy->dri_screen);
else
api_mask = __DRI_API_OPENGL;
dpy->ClientAPIsMask = 0;
if (api_mask & (1 <<__DRI_API_OPENGL))
dpy->ClientAPIsMask |= EGL_OPENGL_BIT;
if (api_mask & (1 <<__DRI_API_GLES))
dpy->ClientAPIsMask |= EGL_OPENGL_ES_BIT;
if (api_mask & (1 << __DRI_API_GLES2))
dpy->ClientAPIsMask |= EGL_OPENGL_ES2_BIT;
if (ddpy->dri2->base.version >= 2) {
dpy->Extensions.KHR_surfaceless_gles1 = EGL_TRUE;
dpy->Extensions.KHR_surfaceless_gles2 = EGL_TRUE;
dpy->Extensions.KHR_surfaceless_opengl = EGL_TRUE;
}
return EGL_TRUE;
}
static EGLBoolean
droid_load_driver(_EGLDisplay *disp)
{
struct droid_egl_display *ddpy = disp->DriverData;
const __DRIextension **extensions;
extensions = __driDriverExtensions;
if (!droid_bind_extensions(ddpy, droid_driver_extensions, extensions))
return EGL_FALSE;
return EGL_TRUE;
}
static EGLBoolean
droid_initialize_android(_EGLDriver *drv, _EGLDisplay *dpy,
EGLint *major, EGLint *minor)
{
struct droid_egl_display *ddpy;
int fd = -1, err, i;
const hw_module_t *mod;
err = hw_get_module(GRALLOC_HARDWARE_MODULE_ID, &mod);
if (!err) {
const gralloc_module_t *gr = (gralloc_module_t *) mod;
err = -EINVAL;
if (gr->perform)
err = gr->perform(gr, GRALLOC_MODULE_PERFORM_GET_DRM_FD, &fd);
}
if (err || fd < 0) {
_eglLog(_EGL_WARNING, "fail to get drm fd");
return EGL_FALSE;
}
ddpy = calloc(1, sizeof(*ddpy));
if (!ddpy)
return _eglError(EGL_BAD_ALLOC, "eglInitialize");
dpy->DriverData = (void *) ddpy;
ddpy->fd = fd;
if (!droid_load_driver(dpy))
return EGL_FALSE;
ddpy->loader_extension.base.name = __DRI_DRI2_LOADER;
ddpy->loader_extension.base.version = 3;
ddpy->loader_extension.getBuffers = NULL;
ddpy->loader_extension.flushFrontBuffer = droid_flush_front_buffer;
ddpy->loader_extension.getBuffersWithFormat =
droid_get_buffers_with_format;
ddpy->extensions[0] = &ddpy->loader_extension.base;
ddpy->extensions[1] = &image_lookup_extension.base;
ddpy->extensions[2] = &use_invalidate.base;
ddpy->extensions[3] = NULL;
if (!droid_create_screen(dpy)) {
free(ddpy);
return EGL_FALSE;
}
if (!droid_add_configs_for_visuals(drv, dpy)) {
ddpy->core->destroyScreen(ddpy->dri_screen);
free(ddpy);
}
dpy->Extensions.ANDROID_image_native_buffer = EGL_TRUE;
dpy->Extensions.KHR_image_base = EGL_TRUE;
/* we're supporting EGL 1.4 */
*major = 1;
*minor = 4;
return EGL_TRUE;
}
static EGLBoolean
droid_terminate(_EGLDriver *drv, _EGLDisplay *dpy)
{
struct droid_egl_display *ddpy = droid_egl_display(dpy);
_eglReleaseDisplayResources(drv, dpy);
_eglCleanupDisplay(dpy);
ddpy->core->destroyScreen(ddpy->dri_screen);
free(ddpy);
dpy->DriverData = NULL;
return EGL_TRUE;
}
static EGLBoolean
droid_initialize(_EGLDriver *drv, _EGLDisplay *dpy,
EGLint *major, EGLint *minor)
{
switch (dpy->Platform) {
case _EGL_PLATFORM_ANDROID:
return droid_initialize_android(drv, dpy, major, minor);
default:
return EGL_FALSE;
}
}
static _EGLProc
droid_get_proc_address(_EGLDriver *drv, const char *procname)
{
return (_EGLProc) _glapi_get_proc_address(procname);
}
static void
droid_unload(_EGLDriver *drv)
{
struct droid_egl_driver *ddrv = droid_egl_driver(drv);
free(ddrv);
}
static void
droid_log(EGLint level, const char *msg)
{
switch (level) {
case _EGL_DEBUG:
LOGD(msg);
break;
case _EGL_INFO:
LOGI(msg);
break;
case _EGL_WARNING:
LOGW(msg);
break;
case _EGL_FATAL:
LOG_FATAL(msg);
break;
default:
break;
}
}
_EGLDriver *
droid_create_driver(void)
{
struct droid_egl_driver *ddrv;
ddrv = calloc(1, sizeof(*ddrv));
if (!ddrv)
return NULL;
_eglSetLogProc(droid_log);
ddrv->base.Name = "Droid";
ddrv->base.Unload = droid_unload;
_eglInitDriverFallbacks(&ddrv->base);
ddrv->base.API.Initialize = droid_initialize;
ddrv->base.API.Terminate = droid_terminate;
ddrv->base.API.GetProcAddress = droid_get_proc_address;
ddrv->glFlush =
(void (*)(void)) droid_get_proc_address(&ddrv->base, "glFlush");
ddrv->glFinish =
(void (*)(void)) droid_get_proc_address(&ddrv->base, "glFinish");
return &ddrv->base;
}

View File

@@ -1,126 +0,0 @@
/*
* Copyright © 2010 Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
* Authors:
* Kristian Høgsberg <krh@bitplanet.net>
*/
#ifndef _DROID_H_
#define _DROID_H_
#include <errno.h>
#include <ui/egl/android_natives.h>
#include <ui/android_native_buffer.h>
#include <pixelflinger/format.h>
#include <GL/gl.h>
#include <GL/internal/dri_interface.h>
#include "egldriver.h"
#include "egldisplay.h"
#include "eglcontext.h"
#include "eglsurface.h"
#include "eglconfig.h"
#include "eglimage.h"
#include "eglcurrent.h"
#include "egllog.h"
struct droid_egl_driver
{
_EGLDriver base;
void (*glFlush)(void);
void (*glFinish)(void);
};
struct droid_egl_display
{
int fd;
__DRIscreen *dri_screen;
const __DRIconfig **dri_configs;
__DRIcoreExtension *core;
__DRIdri2Extension *dri2;
__DRI2flushExtension *flush;
__DRIimageExtension *image;
__DRIdri2LoaderExtension loader_extension;
const __DRIextension *extensions[8];
};
struct droid_egl_context
{
_EGLContext base;
__DRIcontext *dri_context;
};
struct droid_egl_surface
{
_EGLSurface base;
__DRIdrawable *dri_drawable;
__DRIbuffer dri_buffer;
android_native_window_t *window;
android_native_buffer_t *buffer;
};
struct droid_egl_config
{
_EGLConfig base;
const __DRIconfig *dri_config;
};
struct droid_egl_image
{
_EGLImage base;
__DRIimage *dri_image;
};
/* standard typecasts */
_EGL_DRIVER_STANDARD_TYPECASTS(droid_egl)
_EGL_DRIVER_TYPECAST(droid_egl_image, _EGLImage, obj)
_EGLDriver *
droid_create_driver(void);
void
droid_init_core_functions(_EGLDriver *drv);
void
droid_init_image_functions(_EGLDriver *drv);
EGLBoolean
droid_dequeue_buffer(struct droid_egl_surface *dsurf);
EGLBoolean
droid_enqueue_buffer(struct droid_egl_surface *dsurf);
int
get_native_buffer_name(struct android_native_buffer_t *buf);
#endif /* _DROID_H_ */

View File

@@ -1,327 +0,0 @@
/*
* Copyright © 2010 Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
* Authors:
* Kristian Høgsberg <krh@bitplanet.net>
*/
#include "droid.h"
static _EGLContext *
droid_create_context(_EGLDriver *drv, _EGLDisplay *disp, _EGLConfig *conf,
_EGLContext *share_list, const EGLint *attrib_list)
{
struct droid_egl_context *dctx;
struct droid_egl_display *ddpy = droid_egl_display(disp);
struct droid_egl_context *dctx_shared = droid_egl_context(share_list);
struct droid_egl_config *dconf = droid_egl_config(conf);
const __DRIconfig *dri_config;
int api;
(void) drv;
dctx = calloc(1, sizeof *dctx);
if (!dctx) {
_eglError(EGL_BAD_ALLOC, "eglCreateContext");
return NULL;
}
if (!_eglInitContext(&dctx->base, disp, conf, attrib_list))
goto cleanup;
switch (dctx->base.ClientAPI) {
case EGL_OPENGL_ES_API:
switch (dctx->base.ClientVersion) {
case 1:
api = __DRI_API_GLES;
break;
case 2:
api = __DRI_API_GLES2;
break;
default:
_eglError(EGL_BAD_PARAMETER, "eglCreateContext");
return NULL;
}
break;
case EGL_OPENGL_API:
api = __DRI_API_OPENGL;
break;
default:
_eglError(EGL_BAD_PARAMETER, "eglCreateContext");
return NULL;
}
if (conf != NULL)
dri_config = dconf->dri_config;
else
dri_config = NULL;
if (ddpy->dri2->base.version >= 2) {
dctx->dri_context =
ddpy->dri2->createNewContextForAPI(ddpy->dri_screen,
api,
dri_config,
dctx_shared ?
dctx_shared->dri_context : NULL,
dctx);
} else if (api == __DRI_API_OPENGL) {
dctx->dri_context =
ddpy->dri2->createNewContext(ddpy->dri_screen,
dconf->dri_config,
dctx_shared ?
dctx_shared->dri_context : NULL,
dctx);
} else {
/* fail */
}
if (!dctx->dri_context)
goto cleanup;
return &dctx->base;
cleanup:
free(dctx);
return NULL;
}
static _EGLSurface *
droid_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
_EGLConfig *conf, EGLNativeWindowType window,
const EGLint *attrib_list)
{
struct droid_egl_display *ddpy = droid_egl_display(disp);
struct droid_egl_config *dconf = droid_egl_config(conf);
struct droid_egl_surface *dsurf;
int format, vis_type;
(void) drv;
if (!window || window->common.magic != ANDROID_NATIVE_WINDOW_MAGIC) {
_eglError(EGL_BAD_NATIVE_WINDOW, "droid_create_surface");
return NULL;
}
if (window->query(window, NATIVE_WINDOW_FORMAT, &format)) {
_eglError(EGL_BAD_NATIVE_WINDOW, "droid_create_surface");
return NULL;
}
vis_type = _eglGetConfigKey(&dconf->base, EGL_NATIVE_VISUAL_TYPE);
if (format != vis_type) {
_eglLog(_EGL_WARNING, "Native format mismatch: 0x%x != 0x%x",
format, vis_type);
}
dsurf = calloc(1, sizeof *dsurf);
if (!dsurf) {
_eglError(EGL_BAD_ALLOC, "droid_create_surface");
return NULL;
}
if (!_eglInitSurface(&dsurf->base, disp, type, conf, attrib_list))
goto cleanup_surf;
dsurf->dri_drawable =
(*ddpy->dri2->createNewDrawable) (ddpy->dri_screen,
dconf->dri_config, dsurf);
if (dsurf->dri_drawable == NULL) {
_eglError(EGL_BAD_ALLOC, "dri2->createNewDrawable");
goto cleanup_pixmap;
}
window->common.incRef(&window->common);
window->query(window, NATIVE_WINDOW_WIDTH, &dsurf->base.Width);
window->query(window, NATIVE_WINDOW_HEIGHT, &dsurf->base.Height);
dsurf->window = window;
return &dsurf->base;
cleanup_dri_drawable:
ddpy->core->destroyDrawable(dsurf->dri_drawable);
cleanup_pixmap:
cleanup_surf:
free(dsurf);
return NULL;
}
static _EGLSurface *
droid_create_window_surface(_EGLDriver *drv, _EGLDisplay *disp,
_EGLConfig *conf, EGLNativeWindowType window,
const EGLint *attrib_list)
{
return droid_create_surface(drv, disp, EGL_WINDOW_BIT, conf,
window, attrib_list);
}
static _EGLSurface *
droid_create_pixmap_surface(_EGLDriver *drv, _EGLDisplay *disp,
_EGLConfig *conf, EGLNativePixmapType pixmap,
const EGLint *attrib_list)
{
return NULL;
}
static _EGLSurface *
droid_create_pbuffer_surface(_EGLDriver *drv, _EGLDisplay *disp,
_EGLConfig *conf, const EGLint *attrib_list)
{
return NULL;
}
static EGLBoolean
droid_destroy_surface(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf)
{
struct droid_egl_display *ddpy = droid_egl_display(disp);
struct droid_egl_surface *dsurf = droid_egl_surface(surf);
(void) drv;
if (!_eglPutSurface(surf))
return EGL_TRUE;
(*ddpy->core->destroyDrawable)(dsurf->dri_drawable);
droid_enqueue_buffer(dsurf);
dsurf->window->common.decRef(&dsurf->window->common);
free(surf);
return EGL_TRUE;
}
static EGLBoolean
droid_make_current(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *dsurf,
_EGLSurface *rsurf, _EGLContext *ctx)
{
struct droid_egl_driver *ddrv = droid_egl_driver(drv);
struct droid_egl_display *ddpy = droid_egl_display(disp);
struct droid_egl_surface *droid_dsurf = droid_egl_surface(dsurf);
struct droid_egl_surface *droid_rsurf = droid_egl_surface(rsurf);
struct droid_egl_context *dctx = droid_egl_context(ctx);
_EGLContext *old_ctx;
_EGLSurface *old_dsurf, *old_rsurf;
__DRIdrawable *ddraw, *rdraw;
__DRIcontext *cctx;
/* make new bindings */
if (!_eglBindContext(ctx, dsurf, rsurf, &old_ctx, &old_dsurf, &old_rsurf))
return EGL_FALSE;
/* flush before context switch */
if (old_ctx && ddrv->glFlush)
ddrv->glFlush();
ddraw = (droid_dsurf) ? droid_dsurf->dri_drawable : NULL;
rdraw = (droid_rsurf) ? droid_rsurf->dri_drawable : NULL;
cctx = (dctx) ? dctx->dri_context : NULL;
if ((cctx == NULL && ddraw == NULL && rdraw == NULL) ||
ddpy->core->bindContext(cctx, ddraw, rdraw)) {
droid_destroy_surface(drv, disp, old_dsurf);
droid_destroy_surface(drv, disp, old_rsurf);
if (old_ctx) {
/* unbind the old context only when there is no new context bound */
if (!ctx) {
__DRIcontext *old_cctx = droid_egl_context(old_ctx)->dri_context;
ddpy->core->unbindContext(old_cctx);
}
/* no destroy? */
_eglPutContext(old_ctx);
}
return EGL_TRUE;
} else {
/* undo the previous _eglBindContext */
_eglBindContext(old_ctx, old_dsurf, old_rsurf, &ctx, &dsurf, &rsurf);
assert(&dctx->base == ctx &&
&droid_dsurf->base == dsurf &&
&droid_rsurf->base == rsurf);
_eglPutSurface(dsurf);
_eglPutSurface(rsurf);
_eglPutContext(ctx);
_eglPutSurface(old_dsurf);
_eglPutSurface(old_rsurf);
_eglPutContext(old_ctx);
return EGL_FALSE;
}
}
static EGLBoolean
droid_swap_buffers(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw)
{
struct droid_egl_driver *ddrv = droid_egl_driver(drv);
struct droid_egl_display *ddpy = droid_egl_display(disp);
struct droid_egl_surface *dsurf = droid_egl_surface(draw);
_EGLContext *ctx;
if (ddrv->glFlush) {
ctx = _eglGetCurrentContext();
if (ctx && ctx->DrawSurface == &dsurf->base)
ddrv->glFlush();
}
(*ddpy->flush->flush)(dsurf->dri_drawable);
if (dsurf->buffer)
droid_enqueue_buffer(dsurf);
(*ddpy->flush->invalidate)(dsurf->dri_drawable);
return EGL_TRUE;
}
static EGLBoolean
droid_wait_client(_EGLDriver *drv, _EGLDisplay *disp, _EGLContext *ctx)
{
struct droid_egl_driver *ddrv = droid_egl_driver(drv);
struct droid_egl_display *ddpy = droid_egl_display(disp);
struct droid_egl_surface *dsurf = droid_egl_surface(ctx->DrawSurface);
if (ddrv->glFinish)
ddrv->glFinish();
if (dsurf)
(*ddpy->flush->flush)(dsurf->dri_drawable);
return EGL_TRUE;
}
void
droid_init_core_functions(_EGLDriver *drv)
{
struct droid_egl_driver *ddrv = droid_egl_driver(drv);
ddrv->base.API.CreateContext = droid_create_context;
ddrv->base.API.CreateWindowSurface = droid_create_window_surface;
ddrv->base.API.CreatePixmapSurface = droid_create_pixmap_surface;
ddrv->base.API.CreatePbufferSurface = droid_create_pbuffer_surface;
ddrv->base.API.DestroySurface = droid_destroy_surface;
ddrv->base.API.MakeCurrent = droid_make_current;
ddrv->base.API.SwapBuffers = droid_swap_buffers;
ddrv->base.API.WaitClient = droid_wait_client;
}

View File

@@ -1,134 +0,0 @@
/*
* Copyright © 2010 Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
* Authors:
* Kristian Høgsberg <krh@bitplanet.net>
*/
#include "droid.h"
static _EGLImage *
droid_create_image_android_native_buffer(_EGLDisplay *disp,
EGLClientBuffer buffer)
{
struct droid_egl_display *ddpy = droid_egl_display(disp);
struct android_native_buffer_t *buf =
(struct android_native_buffer_t *) buffer;
struct droid_egl_image *dimg;
EGLint format, name;
if (!buf || buf->common.magic != ANDROID_NATIVE_BUFFER_MAGIC ||
buf->common.version != sizeof(*buf)) {
_eglError(EGL_BAD_PARAMETER, "eglCreateEGLImageKHR");
return NULL;
}
name = get_native_buffer_name(buf);
if (!name) {
_eglError(EGL_BAD_PARAMETER, "eglCreateEGLImageKHR");
return NULL;
}
switch (buf->format) {
case HAL_PIXEL_FORMAT_BGRA_8888:
format = __DRI_IMAGE_FORMAT_ARGB8888;
break;
case HAL_PIXEL_FORMAT_RGB_565:
format = __DRI_IMAGE_FORMAT_RGB565;
break;
case HAL_PIXEL_FORMAT_RGBA_8888:
format = __DRI_IMAGE_FORMAT_RGBA8888_REV;
break;
case HAL_PIXEL_FORMAT_RGBX_8888:
case HAL_PIXEL_FORMAT_RGB_888:
case HAL_PIXEL_FORMAT_RGBA_5551:
case HAL_PIXEL_FORMAT_RGBA_4444:
/* unsupported */
default:
_eglLog(_EGL_WARNING, "unsupported native buffer format 0x%x", buf->format);
return NULL;
break;
}
dimg = calloc(1, sizeof(*dimg));
if (!dimg) {
_eglError(EGL_BAD_ALLOC, "droid_create_image_mesa_drm");
return NULL;
}
if (!_eglInitImage(&dimg->base, disp)) {
free(dimg);
return NULL;
}
dimg->dri_image =
ddpy->image->createImageFromName(ddpy->dri_screen,
buf->width,
buf->height,
format,
name,
buf->stride,
dimg);
if (!dimg->dri_image) {
free(dimg);
_eglError(EGL_BAD_ALLOC, "droid_create_image_mesa_drm");
return NULL;
}
return &dimg->base;
}
static _EGLImage *
droid_create_image_khr(_EGLDriver *drv, _EGLDisplay *disp,
_EGLContext *ctx, EGLenum target,
EGLClientBuffer buffer, const EGLint *attr_list)
{
switch (target) {
case EGL_NATIVE_BUFFER_ANDROID:
return droid_create_image_android_native_buffer(disp, buffer);
default:
_eglError(EGL_BAD_PARAMETER, "droid_create_image_khr");
return EGL_NO_IMAGE_KHR;
}
}
static EGLBoolean
droid_destroy_image_khr(_EGLDriver *drv, _EGLDisplay *disp, _EGLImage *image)
{
struct droid_egl_display *ddpy = droid_egl_display(disp);
struct droid_egl_image *dimg = droid_egl_image(image);
ddpy->image->destroyImage(dimg->dri_image);
free(dimg);
return EGL_TRUE;
}
void
droid_init_image_functions(_EGLDriver *drv)
{
struct droid_egl_driver *ddrv = droid_egl_driver(drv);
ddrv->base.API.CreateImageKHR = droid_create_image_khr;
ddrv->base.API.DestroyImageKHR = droid_destroy_image_khr;
}

View File

@@ -1,42 +0,0 @@
/*
* Copyright © 2010 Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
* Authors:
* Kristian Høgsberg <krh@bitplanet.net>
*/
#include "droid.h"
_EGLDriver *
_eglMain(const char *args)
{
_EGLDriver *drv;
drv = droid_create_driver();
if (drv) {
droid_init_core_functions(drv);
droid_init_image_functions(drv);
}
return drv;
}

View File

@@ -916,12 +916,6 @@ eglGetProcAddress(const char *procname)
#ifdef EGL_MESA_drm_image
{ "eglCreateDRMImageMESA", (_EGLProc) eglCreateDRMImageMESA },
{ "eglExportDRMImageMESA", (_EGLProc) eglExportDRMImageMESA },
#endif
#ifdef EGL_ANDROID_swap_rectangle
{ "eglSetSwapRectangleANDROID", (_EGLProc) eglSetSwapRectangleANDROID },
#endif
#ifdef EGL_ANDROID_get_render_buffer
{ "eglGetRenderBufferANDROID", (_EGLProc) eglGetRenderBufferANDROID },
#endif
{ NULL, NULL }
};
@@ -1500,49 +1494,3 @@ eglExportDRMImageMESA(EGLDisplay dpy, EGLImageKHR image,
}
#endif
#ifdef EGL_ANDROID_swap_rectangle
EGLBoolean EGLAPIENTRY
eglSetSwapRectangleANDROID(EGLDisplay dpy, EGLSurface draw,
EGLint left, EGLint top,
EGLint width, EGLint height)
{
_EGLDisplay *disp = _eglLockDisplay(dpy);
_EGLSurface *surf = _eglLookupSurface(draw, disp);
_EGLDriver *drv;
EGLBoolean ret;
_EGL_CHECK_SURFACE(disp, surf, EGL_FALSE, drv);
if (!disp->Extensions.ANDROID_swap_rectangle)
RETURN_EGL_EVAL(disp, EGL_FALSE);
ret = drv->API.SetSwapRectangleANDROID(drv, disp, surf, left, top, width, height);
RETURN_EGL_EVAL(disp, ret);
}
#endif
#ifdef EGL_ANDROID_get_render_buffer
EGLClientBuffer EGLAPIENTRY
eglGetRenderBufferANDROID(EGLDisplay dpy, EGLSurface draw)
{
_EGLDisplay *disp = _eglLockDisplay(dpy);
_EGLSurface *surf = _eglLookupSurface(draw, disp);
_EGLDriver *drv;
EGLClientBuffer ret;
_EGL_CHECK_SURFACE(disp, surf, NULL, drv);
if (!disp->Extensions.ANDROID_get_render_buffer)
RETURN_EGL_EVAL(disp, NULL);
ret = drv->API.GetRenderBufferANDROID(drv, disp, surf);
RETURN_EGL_EVAL(disp, ret);
}
#endif

View File

@@ -95,14 +95,6 @@ typedef _EGLImage *(*CreateDRMImageMESA_t)(_EGLDriver *drv, _EGLDisplay *disp, c
typedef EGLBoolean (*ExportDRMImageMESA_t)(_EGLDriver *drv, _EGLDisplay *disp, _EGLImage *img, EGLint *name, EGLint *handle, EGLint *stride);
#endif
#ifdef EGL_ANDROID_swap_rectangle
typedef EGLBoolean (*SetSwapRectangleANDROID_t)(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw, EGLint left, EGLint top, EGLint width, EGLint height);
#endif
#ifdef EGL_ANDROID_get_render_buffer
typedef EGLClientBuffer (*GetRenderBufferANDROID_t)(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw);
#endif
/**
* The API dispatcher jumps through these functions
*/
@@ -177,13 +169,6 @@ struct _egl_api
CreateDRMImageMESA_t CreateDRMImageMESA;
ExportDRMImageMESA_t ExportDRMImageMESA;
#endif
#ifdef EGL_ANDROID_swap_rectangle
SetSwapRectangleANDROID_t SetSwapRectangleANDROID;
#endif
#ifdef EGL_ANDROID_get_render_buffer
GetRenderBufferANDROID_t GetRenderBufferANDROID;
#endif
};
#endif /* EGLAPI_INCLUDED */

View File

@@ -28,8 +28,7 @@ _eglGetNativePlatformFromEnv(void)
{ _EGL_PLATFORM_WINDOWS, "gdi" },
{ _EGL_PLATFORM_X11, "x11" },
{ _EGL_PLATFORM_DRM, "drm" },
{ _EGL_PLATFORM_FBDEV, "fbdev" },
{ _EGL_PLATFORM_ANDROID, "android" }
{ _EGL_PLATFORM_FBDEV, "fbdev" }
};
_EGLPlatformType plat = _EGL_INVALID_PLATFORM;
const char *plat_name;

View File

@@ -13,7 +13,6 @@ enum _egl_platform_type {
_EGL_PLATFORM_X11,
_EGL_PLATFORM_DRM,
_EGL_PLATFORM_FBDEV,
_EGL_PLATFORM_ANDROID,
_EGL_NUM_PLATFORMS,
_EGL_INVALID_PLATFORM = -1
@@ -76,10 +75,6 @@ struct _egl_extensions
EGLBoolean NOK_swap_region;
EGLBoolean NOK_texture_from_pixmap;
EGLBoolean ANDROID_image_native_buffer;
EGLBoolean ANDROID_swap_rectangle;
EGLBoolean ANDROID_get_render_buffer;
char String[_EGL_MAX_EXTENSIONS_LEN];
};

View File

@@ -86,30 +86,6 @@ library_suffix(void)
}
#else /* _EGL_PLATFORM_NO_OS */
typedef void *lib_handle;
static INLINE void *
open_library(const char *filename)
{
return (void *) filename;
}
static INLINE void
close_library(void *lib)
{
}
static const char *
library_suffix(void)
{
return NULL;
}
#endif
@@ -147,8 +123,6 @@ _eglOpenLibrary(const char *driverPath, lib_handle *handle)
else {
error = dlerror();
}
#else /* _EGL_PLATFORM_NO_OS */
mainFunc = (_EGLMain_t) _eglMain;
#endif
if (!lib) {
@@ -527,10 +501,6 @@ _eglAddDefaultDrivers(void)
"egl_dri2",
"egl_glx"
};
#else /* _EGL_PLATFORM_NO_OS */
const char *DefaultDriverNames[] = {
"<builtin>"
};
#endif
for (i = 0; i < ARRAY_SIZE(DefaultDriverNames); i++) {

View File

@@ -107,10 +107,6 @@ _eglUpdateExtensionsString(_EGLDisplay *dpy)
_EGL_CHECK_EXTENSION(NOK_swap_region);
_EGL_CHECK_EXTENSION(NOK_texture_from_pixmap);
_EGL_CHECK_EXTENSION(ANDROID_image_native_buffer);
_EGL_CHECK_EXTENSION(ANDROID_swap_rectangle);
_EGL_CHECK_EXTENSION(ANDROID_get_render_buffer);
#undef _EGL_CHECK_EXTENSION
}

View File

@@ -1,3 +0,0 @@
ifeq ($(strip $(MESA_BUILD_GALLIUM)),true)
include $(call all-subdir-makefiles)
endif

View File

@@ -1,213 +0,0 @@
LOCAL_PATH := $(call my-dir)
# from Makefile
C_SOURCES = \
cso_cache/cso_cache.c \
cso_cache/cso_context.c \
cso_cache/cso_hash.c \
draw/draw_context.c \
draw/draw_fs.c \
draw/draw_gs.c \
draw/draw_pipe.c \
draw/draw_pipe_aaline.c \
draw/draw_pipe_aapoint.c \
draw/draw_pipe_clip.c \
draw/draw_pipe_cull.c \
draw/draw_pipe_flatshade.c \
draw/draw_pipe_offset.c \
draw/draw_pipe_pstipple.c \
draw/draw_pipe_stipple.c \
draw/draw_pipe_twoside.c \
draw/draw_pipe_unfilled.c \
draw/draw_pipe_util.c \
draw/draw_pipe_validate.c \
draw/draw_pipe_vbuf.c \
draw/draw_pipe_wide_line.c \
draw/draw_pipe_wide_point.c \
draw/draw_pt.c \
draw/draw_pt_emit.c \
draw/draw_pt_fetch.c \
draw/draw_pt_fetch_emit.c \
draw/draw_pt_fetch_shade_emit.c \
draw/draw_pt_fetch_shade_pipeline.c \
draw/draw_pt_post_vs.c \
draw/draw_pt_so_emit.c \
draw/draw_pt_util.c \
draw/draw_pt_vsplit.c \
draw/draw_vertex.c \
draw/draw_vs.c \
draw/draw_vs_aos.c \
draw/draw_vs_aos_io.c \
draw/draw_vs_aos_machine.c \
draw/draw_vs_exec.c \
draw/draw_vs_ppc.c \
draw/draw_vs_sse.c \
draw/draw_vs_varient.c \
indices/u_indices_gen.c \
indices/u_unfilled_gen.c \
os/os_misc.c \
os/os_stream.c \
os/os_stream_log.c \
os/os_stream_null.c \
os/os_stream_stdc.c \
os/os_stream_str.c \
os/os_time.c \
pipebuffer/pb_buffer_fenced.c \
pipebuffer/pb_buffer_malloc.c \
pipebuffer/pb_bufmgr_alt.c \
pipebuffer/pb_bufmgr_cache.c \
pipebuffer/pb_bufmgr_debug.c \
pipebuffer/pb_bufmgr_mm.c \
pipebuffer/pb_bufmgr_ondemand.c \
pipebuffer/pb_bufmgr_pool.c \
pipebuffer/pb_bufmgr_slab.c \
pipebuffer/pb_validate.c \
rbug/rbug_connection.c \
rbug/rbug_context.c \
rbug/rbug_core.c \
rbug/rbug_demarshal.c \
rbug/rbug_texture.c \
rbug/rbug_shader.c \
rtasm/rtasm_cpu.c \
rtasm/rtasm_execmem.c \
rtasm/rtasm_ppc.c \
rtasm/rtasm_ppc_spe.c \
rtasm/rtasm_x86sse.c \
tgsi/tgsi_build.c \
tgsi/tgsi_dump.c \
tgsi/tgsi_exec.c \
tgsi/tgsi_info.c \
tgsi/tgsi_iterate.c \
tgsi/tgsi_parse.c \
tgsi/tgsi_ppc.c \
tgsi/tgsi_sanity.c \
tgsi/tgsi_scan.c \
tgsi/tgsi_sse2.c \
tgsi/tgsi_text.c \
tgsi/tgsi_transform.c \
tgsi/tgsi_ureg.c \
tgsi/tgsi_util.c \
translate/translate.c \
translate/translate_cache.c \
translate/translate_generic.c \
translate/translate_sse.c \
util/u_debug.c \
util/u_debug_describe.c \
util/u_debug_refcnt.c \
util/u_debug_stack.c \
util/u_debug_symbol.c \
util/u_dump_defines.c \
util/u_dump_state.c \
util/u_bitmask.c \
util/u_blit.c \
util/u_blitter.c \
util/u_cache.c \
util/u_caps.c \
util/u_cpu_detect.c \
util/u_dl.c \
util/u_draw_quad.c \
util/u_format.c \
util/u_format_other.c \
util/u_format_s3tc.c \
util/u_format_srgb.c \
util/u_format_table.c \
util/u_format_tests.c \
util/u_format_yuv.c \
util/u_format_zs.c \
util/u_framebuffer.c \
util/u_gen_mipmap.c \
util/u_half.c \
util/u_handle_table.c \
util/u_hash.c \
util/u_hash_table.c \
util/u_index_modify.c \
util/u_keymap.c \
util/u_linear.c \
util/u_linkage.c \
util/u_network.c \
util/u_math.c \
util/u_mm.c \
util/u_rect.c \
util/u_ringbuffer.c \
util/u_sampler.c \
util/u_simple_shaders.c \
util/u_slab.c \
util/u_snprintf.c \
util/u_staging.c \
util/u_surface.c \
util/u_surfaces.c \
util/u_texture.c \
util/u_tile.c \
util/u_transfer.c \
util/u_resource.c \
util/u_upload_mgr.c
GENERATED_SOURCES = \
indices/u_indices_gen.c \
indices/u_unfilled_gen.c \
util/u_format_srgb.c \
util/u_format_table.c \
util/u_half.c
include $(CLEAR_VARS)
LOCAL_SRC_FILES := \
$(filter-out $(GENERATED_SOURCES), $(C_SOURCES))
LOCAL_CFLAGS := \
-fvisibility=hidden \
-Wno-sign-compare
LOCAL_C_INCLUDES := \
external/mesa/include \
external/mesa/src/gallium/include \
external/mesa/src/gallium/auxiliary \
external/mesa/src/gallium/drivers \
external/mesa/src/gallium/auxiliary/util
LOCAL_MODULE := libmesa_gallium
LOCAL_MODULE_CLASS := STATIC_LIBRARIES
intermediates := $(call local-intermediates-dir)
GEN_SCRIPT := $(LOCAL_PATH)/indices/u_indices_gen.py
GEN := $(intermediates)/indices/u_indices_gen.c
$(GEN): PRIVATE_CUSTOM_TOOL = python $< > $@
$(GEN): $(GEN_SCRIPT)
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
GEN_SCRIPT := $(LOCAL_PATH)/indices/u_unfilled_gen.py
GEN := $(intermediates)/indices/u_unfilled_gen.c
$(GEN): PRIVATE_CUSTOM_TOOL = python $< > $@
$(GEN): $(GEN_SCRIPT)
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
GEN_SCRIPT := $(LOCAL_PATH)/util/u_format_srgb.py
GEN := $(intermediates)/util/u_format_srgb.c
$(GEN): PRIVATE_CUSTOM_TOOL = python $< > $@
$(GEN): $(GEN_SCRIPT)
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
GEN_SCRIPT := $(LOCAL_PATH)/util/u_format_table.py
GEN := $(intermediates)/util/u_format_table.c
$(GEN): PRIVATE_CUSTOM_TOOL := python $(GEN_SCRIPT) $(LOCAL_PATH)/util/u_format.csv > $(GEN)
$(GEN): $(GEN_SCRIPT) $(LOCAL_PATH)/util/u_format.csv
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
GEN_SCRIPT := $(LOCAL_PATH)/util/u_half.py
GEN := $(intermediates)/util/u_half.c
$(GEN): PRIVATE_CUSTOM_TOOL = python $< > $@
$(GEN): $(GEN_SCRIPT)
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
include $(BUILD_STATIC_LIBRARY)

View File

@@ -306,7 +306,7 @@ typedef int64_t pipe_condvar;
* pipe_barrier
*/
#if (defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_HAIKU) || defined(PIPE_OS_EMBEDDED)) && !defined(PIPE_OS_ANDROID)
#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_HAIKU) || defined(PIPE_OS_EMBEDDED)
typedef pthread_barrier_t pipe_barrier;

View File

@@ -187,16 +187,6 @@ static INLINE double log2( double x )
#endif /* _MSC_VER */
#ifdef PIPE_OS_ANDROID
static INLINE
double log2(double d)
{
return log(d) / M_LN2;
}
#endif

View File

@@ -1 +0,0 @@
include $(call all-subdir-makefiles)

View File

@@ -1,48 +0,0 @@
ifeq ($(strip $(MESA_BUILD_I915G)),true)
LOCAL_PATH := $(call my-dir)
# from Makefile
C_SOURCES = \
i915_blit.c \
i915_clear.c \
i915_flush.c \
i915_context.c \
i915_debug.c \
i915_debug_fp.c \
i915_state.c \
i915_state_immediate.c \
i915_state_dynamic.c \
i915_state_derived.c \
i915_state_emit.c \
i915_state_fpc.c \
i915_state_sampler.c \
i915_state_static.c \
i915_screen.c \
i915_prim_emit.c \
i915_prim_vbuf.c \
i915_resource.c \
i915_resource_texture.c \
i915_resource_buffer.c \
i915_fpc_emit.c \
i915_fpc_translate.c \
i915_surface.c
include $(CLEAR_VARS)
LOCAL_SRC_FILES := \
$(C_SOURCES)
LOCAL_CFLAGS := \
-fvisibility=hidden \
-Wno-sign-compare
LOCAL_C_INCLUDES := \
external/mesa/src/gallium/include \
external/mesa/src/gallium/auxiliary
LOCAL_MODULE := libmesa_pipe_i915
include $(BUILD_STATIC_LIBRARY)
endif # MESA_BUILD_I915G

View File

@@ -55,7 +55,7 @@ i915_buffer_destroy(struct pipe_screen *screen,
{
struct i915_buffer *buffer = i915_buffer(resource);
if (buffer->free_on_destroy)
FREE(buffer->data);
align_free(buffer->data);
FREE(buffer);
}

View File

@@ -74,6 +74,7 @@ lp_scene_create( struct pipe_context *pipe )
void
lp_scene_destroy(struct lp_scene *scene)
{
lp_fence_reference(&scene->fence, NULL);
pipe_mutex_destroy(scene->mutex);
assert(scene->data.head->next == NULL);
FREE(scene->data.head);

View File

@@ -996,6 +996,8 @@ lp_setup_destroy( struct lp_setup_context *setup )
lp_scene_destroy(scene);
}
lp_fence_reference(&setup->last_fence, NULL);
FREE( setup );
}

View File

@@ -21,6 +21,7 @@ C_SOURCES = \
evergreen_state.c \
eg_asm.c \
r600_translate.c \
r600_state_common.c
r600_state_common.c \
r600_upload.c
include ../../Makefile.template

View File

@@ -28,6 +28,7 @@ r600 = env.ConvenienceLibrary(
'r600_state_common.c',
'r600_texture.c',
'r600_translate.c',
'r600_upload.c',
'r700_asm.c',
'evergreen_state.c',
'eg_asm.c',

View File

@@ -1346,7 +1346,7 @@ void evergreen_vertex_buffer_update(struct r600_pipe_context *rctx)
r600_pipe_state_add_reg(rstate, R_030000_RESOURCE0_WORD0,
offset, 0xFFFFFFFF, rbuffer->bo);
r600_pipe_state_add_reg(rstate, R_030004_RESOURCE0_WORD1,
rbuffer->size - offset - 1, 0xFFFFFFFF, NULL);
rbuffer->bo_size - offset - 1, 0xFFFFFFFF, NULL);
r600_pipe_state_add_reg(rstate, R_030008_RESOURCE0_WORD2,
S_030008_STRIDE(vertex_buffer->stride),
0xFFFFFFFF, NULL);

View File

@@ -29,7 +29,6 @@
#include <util/u_math.h>
#include <util/u_inlines.h>
#include <util/u_memory.h>
#include <util/u_upload_mgr.h>
#include "state_tracker/drm_driver.h"
#include <xf86drm.h>
#include "radeon_drm.h"
@@ -53,12 +52,13 @@ struct pipe_resource *r600_buffer_create(struct pipe_screen *screen,
rbuffer->magic = R600_BUFFER_MAGIC;
rbuffer->user_buffer = NULL;
rbuffer->num_ranges = 0;
rbuffer->r.base.b = *templ;
pipe_reference_init(&rbuffer->r.base.b.reference, 1);
rbuffer->r.base.b.screen = screen;
rbuffer->r.base.vtbl = &r600_buffer_vtbl;
rbuffer->r.size = rbuffer->r.base.b.width0;
rbuffer->r.bo_size = rbuffer->r.size;
rbuffer->uploaded = FALSE;
bo = r600_bo((struct radeon*)screen->winsys, rbuffer->r.base.b.width0, alignment, rbuffer->r.base.b.bind, rbuffer->r.base.b.usage);
if (bo == NULL) {
FREE(rbuffer);
@@ -91,9 +91,10 @@ struct pipe_resource *r600_user_buffer_create(struct pipe_screen *screen,
rbuffer->r.base.b.depth0 = 1;
rbuffer->r.base.b.array_size = 1;
rbuffer->r.base.b.flags = 0;
rbuffer->num_ranges = 0;
rbuffer->r.bo = NULL;
rbuffer->r.bo_size = 0;
rbuffer->user_buffer = ptr;
rbuffer->uploaded = FALSE;
return &rbuffer->r.base.b;
}
@@ -102,9 +103,10 @@ static void r600_buffer_destroy(struct pipe_screen *screen,
{
struct r600_resource_buffer *rbuffer = r600_buffer(buf);
if (rbuffer->r.bo) {
if (!rbuffer->uploaded && rbuffer->r.bo) {
r600_bo_reference((struct radeon*)screen->winsys, &rbuffer->r.bo, NULL);
}
rbuffer->r.bo = NULL;
FREE(rbuffer);
}
@@ -114,29 +116,10 @@ static void *r600_buffer_transfer_map(struct pipe_context *pipe,
struct r600_resource_buffer *rbuffer = r600_buffer(transfer->resource);
int write = 0;
uint8_t *data;
int i;
boolean flush = FALSE;
if (rbuffer->user_buffer)
return (uint8_t*)rbuffer->user_buffer + transfer->box.x;
if (transfer->usage & PIPE_TRANSFER_DISCARD) {
for (i = 0; i < rbuffer->num_ranges; i++) {
if ((transfer->box.x >= rbuffer->ranges[i].start) &&
(transfer->box.x < rbuffer->ranges[i].end))
flush = TRUE;
if (flush) {
r600_bo_reference((struct radeon*)pipe->winsys, &rbuffer->r.bo, NULL);
rbuffer->num_ranges = 0;
rbuffer->r.bo = r600_bo((struct radeon*)pipe->winsys,
rbuffer->r.base.b.width0, 0,
rbuffer->r.base.b.bind,
rbuffer->r.base.b.usage);
break;
}
}
}
if (transfer->usage & PIPE_TRANSFER_DONTBLOCK) {
/* FIXME */
}
@@ -155,36 +138,17 @@ static void r600_buffer_transfer_unmap(struct pipe_context *pipe,
{
struct r600_resource_buffer *rbuffer = r600_buffer(transfer->resource);
if (rbuffer->user_buffer)
return;
if (rbuffer->r.bo)
r600_bo_unmap((struct radeon*)pipe->winsys, rbuffer->r.bo);
}
static void r600_buffer_transfer_flush_region(struct pipe_context *pipe,
struct pipe_transfer *transfer,
const struct pipe_box *box)
struct pipe_transfer *transfer,
const struct pipe_box *box)
{
struct r600_resource_buffer *rbuffer = r600_buffer(transfer->resource);
unsigned i;
unsigned offset = transfer->box.x + box->x;
unsigned length = box->width;
assert(box->x + box->width <= transfer->box.width);
if (rbuffer->user_buffer)
return;
/* mark the range as used */
for(i = 0; i < rbuffer->num_ranges; ++i) {
if(offset <= rbuffer->ranges[i].end && rbuffer->ranges[i].start <= (offset+box->width)) {
rbuffer->ranges[i].start = MIN2(rbuffer->ranges[i].start, offset);
rbuffer->ranges[i].end = MAX2(rbuffer->ranges[i].end, (offset+length));
return;
}
}
rbuffer->ranges[rbuffer->num_ranges].start = offset;
rbuffer->ranges[rbuffer->num_ranges].end = offset+length;
rbuffer->num_ranges++;
}
unsigned r600_buffer_is_referenced_by_cs(struct pipe_context *context,
@@ -236,29 +200,25 @@ struct u_resource_vtbl r600_buffer_vtbl =
int r600_upload_index_buffer(struct r600_pipe_context *rctx, struct r600_drawl *draw)
{
struct pipe_resource *upload_buffer = NULL;
unsigned index_offset = draw->index_buffer_offset;
int ret = 0;
if (r600_buffer_is_user_buffer(draw->index_buffer)) {
ret = u_upload_buffer(rctx->upload_ib,
index_offset,
draw->count * draw->index_size,
draw->index_buffer,
&index_offset,
&upload_buffer);
if (ret) {
goto done;
}
draw->index_buffer_offset = index_offset;
struct r600_resource_buffer *rbuffer = r600_buffer(draw->index_buffer);
unsigned upload_offset;
int ret = 0;
/* Transfer ownership. */
pipe_resource_reference(&draw->index_buffer, upload_buffer);
pipe_resource_reference(&upload_buffer, NULL);
ret = r600_upload_buffer(rctx->rupload_vb,
draw->index_buffer_offset,
draw->count * draw->index_size,
rbuffer,
&upload_offset,
&rbuffer->r.bo_size,
&rbuffer->r.bo);
if (ret)
return ret;
rbuffer->uploaded = TRUE;
draw->index_buffer_offset = upload_offset;
}
done:
return ret;
return 0;
}
int r600_upload_user_buffers(struct r600_pipe_context *rctx)
@@ -270,23 +230,21 @@ int r600_upload_user_buffers(struct r600_pipe_context *rctx)
nr = rctx->nvertex_buffer;
for (i = 0; i < nr; i++) {
// struct pipe_vertex_buffer *vb = &rctx->vertex_buffer[rctx->vertex_elements->elements[i].vertex_buffer_index];
struct pipe_vertex_buffer *vb = &rctx->vertex_buffer[i];
if (r600_buffer_is_user_buffer(vb->buffer)) {
struct pipe_resource *upload_buffer = NULL;
unsigned offset = 0; /*vb->buffer_offset * 4;*/
unsigned size = vb->buffer->width0;
struct r600_resource_buffer *rbuffer = r600_buffer(vb->buffer);
unsigned upload_offset;
ret = u_upload_buffer(rctx->upload_vb,
offset, size,
vb->buffer,
&upload_offset, &upload_buffer);
ret = r600_upload_buffer(rctx->rupload_vb,
0, vb->buffer->width0,
rbuffer,
&upload_offset,
&rbuffer->r.bo_size,
&rbuffer->r.bo);
if (ret)
return ret;
pipe_resource_reference(&vb->buffer, NULL);
vb->buffer = upload_buffer;
rbuffer->uploaded = TRUE;
vb->buffer_offset = upload_offset;
}
}

View File

@@ -35,7 +35,6 @@
#include <util/u_pack_color.h>
#include <util/u_memory.h>
#include <util/u_inlines.h>
#include <util/u_upload_mgr.h>
#include <pipebuffer/pb_buffer.h>
#include "r600.h"
#include "r600d.h"
@@ -59,9 +58,6 @@ static void r600_flush(struct pipe_context *ctx, unsigned flags,
if (!rctx->ctx.pm4_cdwords)
return;
u_upload_flush(rctx->upload_vb);
u_upload_flush(rctx->upload_ib);
#if 0
sprintf(dname, "gallium-%08d.bof", dc);
if (dc < 20) {
@@ -71,6 +67,8 @@ static void r600_flush(struct pipe_context *ctx, unsigned flags,
dc++;
#endif
r600_context_flush(&rctx->ctx);
r600_upload_flush(rctx->rupload_vb);
}
static void r600_destroy_context(struct pipe_context *context)
@@ -89,8 +87,7 @@ static void r600_destroy_context(struct pipe_context *context)
free(rctx->states[i]);
}
u_upload_destroy(rctx->upload_vb);
u_upload_destroy(rctx->upload_ib);
r600_upload_destroy(rctx->rupload_vb);
if (rctx->tran.translate_cache)
translate_cache_destroy(rctx->tran.translate_cache);
@@ -165,16 +162,8 @@ static struct pipe_context *r600_create_context(struct pipe_screen *screen, void
return NULL;
}
rctx->upload_ib = u_upload_create(&rctx->context, 32 * 1024, 16,
PIPE_BIND_INDEX_BUFFER);
if (rctx->upload_ib == NULL) {
r600_destroy_context(&rctx->context);
return NULL;
}
rctx->upload_vb = u_upload_create(&rctx->context, 128 * 1024, 16,
PIPE_BIND_VERTEX_BUFFER);
if (rctx->upload_vb == NULL) {
rctx->rupload_vb = r600_upload_create(rctx, 128 * 1024, 16);
if (rctx->rupload_vb == NULL) {
r600_destroy_context(&rctx->context);
return NULL;
}

View File

@@ -111,7 +111,7 @@ struct r600_pipe_shader {
#define NUM_TEX_UNITS 16
struct r600_textures_info {
struct r600_pipe_sampler_view *views[NUM_TEX_UNITS];
struct r600_pipe_sampler_view *views[NUM_TEX_UNITS];
unsigned n_views;
void *samplers[NUM_TEX_UNITS];
unsigned n_samplers;
@@ -131,6 +131,8 @@ struct r600_translate_context {
#define R600_CONSTANT_ARRAY_SIZE 256
#define R600_RESOURCE_ARRAY_SIZE 160
struct r600_upload;
struct r600_pipe_context {
struct pipe_context context;
struct blitter_context *blitter;
@@ -163,8 +165,7 @@ struct r600_pipe_context {
/* shader information */
unsigned sprite_coord_enable;
bool flatshade;
struct u_upload_mgr *upload_vb;
struct u_upload_mgr *upload_ib;
struct r600_upload *rupload_vb;
unsigned any_user_vbs;
struct r600_textures_info ps_samplers;
unsigned vb_max_index;
@@ -270,13 +271,13 @@ void r600_sampler_view_destroy(struct pipe_context *ctx,
void r600_bind_state(struct pipe_context *ctx, void *state);
void r600_delete_state(struct pipe_context *ctx, void *state);
void r600_bind_vertex_elements(struct pipe_context *ctx, void *state);
void *r600_create_shader_state(struct pipe_context *ctx,
const struct pipe_shader_state *state);
void r600_bind_ps_shader(struct pipe_context *ctx, void *state);
void r600_bind_vs_shader(struct pipe_context *ctx, void *state);
void r600_delete_ps_shader(struct pipe_context *ctx, void *state);
void r600_delete_vs_shader(struct pipe_context *ctx, void *state);
/*
* common helpers
*/

View File

@@ -46,6 +46,7 @@ struct r600_resource {
struct u_resource base;
struct r600_bo *bo;
u32 size;
unsigned bo_size;
};
struct r600_resource_texture {
@@ -61,7 +62,21 @@ struct r600_resource_texture {
unsigned tile_type;
unsigned depth;
unsigned dirty;
struct r600_resource_texture *flushed_depth_texture;
struct r600_resource_texture *flushed_depth_texture;
};
#define R600_BUFFER_MAGIC 0xabcd1600
struct r600_resource_buffer {
struct r600_resource r;
uint32_t magic;
void *user_buffer;
bool uploaded;
};
struct r600_surface {
struct pipe_surface base;
unsigned aligned_height;
};
void r600_init_screen_resource_functions(struct pipe_screen *screen);
@@ -73,41 +88,25 @@ struct pipe_resource *r600_texture_from_handle(struct pipe_screen *screen,
const struct pipe_resource *base,
struct winsys_handle *whandle);
#define R600_BUFFER_MAGIC 0xabcd1600
#define R600_BUFFER_MAX_RANGES 32
struct r600_buffer_range {
uint32_t start;
uint32_t end;
};
struct r600_resource_buffer {
struct r600_resource r;
uint32_t magic;
void *user_buffer;
struct r600_buffer_range ranges[R600_BUFFER_MAX_RANGES];
unsigned num_ranges;
};
/* r600_buffer */
static INLINE struct r600_resource_buffer *r600_buffer(struct pipe_resource *buffer)
{
if (buffer) {
assert(((struct r600_resource_buffer *)buffer)->magic == R600_BUFFER_MAGIC);
return (struct r600_resource_buffer *)buffer;
}
return NULL;
}
return NULL;
}
static INLINE boolean r600_buffer_is_user_buffer(struct pipe_resource *buffer)
{
return r600_buffer(buffer)->user_buffer ? TRUE : FALSE;
if (r600_buffer(buffer)->uploaded)
return FALSE;
return r600_buffer(buffer)->user_buffer ? TRUE : FALSE;
}
int r600_texture_depth_flush(struct pipe_context *ctx,
struct pipe_resource *texture);
extern int (*r600_blit_uncompress_depth_ptr)(struct pipe_context *ctx, struct r600_resource_texture *texture);
int r600_texture_depth_flush(struct pipe_context *ctx, struct pipe_resource *texture);
int (*r600_blit_uncompress_depth_ptr)(struct pipe_context *ctx, struct r600_resource_texture *texture);
/* r600_texture.c texture transfer functions. */
struct pipe_transfer* r600_texture_get_transfer(struct pipe_context *ctx,
@@ -122,9 +121,15 @@ void* r600_texture_transfer_map(struct pipe_context *ctx,
void r600_texture_transfer_unmap(struct pipe_context *ctx,
struct pipe_transfer* transfer);
struct r600_surface {
struct pipe_surface base;
unsigned aligned_height;
};
struct r600_pipe_context;
struct r600_upload *r600_upload_create(struct r600_pipe_context *rctx,
unsigned default_size,
unsigned alignment);
void r600_upload_flush(struct r600_upload *upload);
void r600_upload_destroy(struct r600_upload *upload);
int r600_upload_buffer(struct r600_upload *upload, unsigned offset,
unsigned size, struct r600_resource_buffer *in_buffer,
unsigned *out_offset, unsigned *out_size,
struct r600_bo **out_buffer);
#endif

View File

@@ -36,7 +36,6 @@
#include <util/u_pack_color.h>
#include <util/u_memory.h>
#include <util/u_inlines.h>
#include <util/u_upload_mgr.h>
#include <util/u_framebuffer.h>
#include <pipebuffer/pb_buffer.h>
#include "r600.h"
@@ -187,7 +186,7 @@ void r600_vertex_buffer_update(struct r600_pipe_context *rctx)
r600_pipe_state_add_reg(rstate, R_038000_RESOURCE0_WORD0,
offset, 0xFFFFFFFF, rbuffer->bo);
r600_pipe_state_add_reg(rstate, R_038004_RESOURCE0_WORD1,
rbuffer->size - offset - 1, 0xFFFFFFFF, NULL);
rbuffer->bo_size - offset - 1, 0xFFFFFFFF, NULL);
r600_pipe_state_add_reg(rstate, R_038008_RESOURCE0_WORD2,
S_038008_STRIDE(vertex_buffer->stride),
0xFFFFFFFF, NULL);

View File

@@ -0,0 +1,112 @@
/*
* Copyright 2010 Jerome Glisse <glisse@freedesktop.org>
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* on the rights to use, copy, modify, merge, publish, distribute, sub
* license, and/or sell copies of the Software, and to permit persons to whom
* the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
* THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
* USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
* Jerome Glisse <jglisse@redhat.com>
*/
#include <errno.h>
#include "util/u_inlines.h"
#include "util/u_memory.h"
#include "r600.h"
#include "r600_pipe.h"
#include "r600_resource.h"
struct r600_upload {
struct r600_pipe_context *rctx;
struct r600_bo *buffer;
char *ptr;
unsigned size;
unsigned default_size;
unsigned total_alloc_size;
unsigned offset;
unsigned alignment;
};
struct r600_upload *r600_upload_create(struct r600_pipe_context *rctx,
unsigned default_size,
unsigned alignment)
{
struct r600_upload *upload = CALLOC_STRUCT(r600_upload);
if (upload == NULL)
return NULL;
upload->rctx = rctx;
upload->size = 0;
upload->default_size = default_size;
upload->alignment = alignment;
upload->ptr = NULL;
upload->buffer = NULL;
upload->total_alloc_size = 0;
return upload;
}
void r600_upload_flush(struct r600_upload *upload)
{
if (upload->buffer) {
r600_bo_reference(upload->rctx->radeon, &upload->buffer, NULL);
}
upload->default_size = MAX2(upload->total_alloc_size, upload->default_size);
upload->total_alloc_size = 0;
upload->size = 0;
upload->ptr = NULL;
upload->buffer = NULL;
}
void r600_upload_destroy(struct r600_upload *upload)
{
r600_upload_flush(upload);
FREE(upload);
}
int r600_upload_buffer(struct r600_upload *upload, unsigned offset,
unsigned size, struct r600_resource_buffer *in_buffer,
unsigned *out_offset, unsigned *out_size,
struct r600_bo **out_buffer)
{
unsigned alloc_size = align(size, upload->alignment);
const void *in_ptr = NULL;
if (upload->offset + alloc_size > upload->size) {
if (upload->size) {
r600_bo_reference(upload->rctx->radeon, &upload->buffer, NULL);
}
upload->size = align(MAX2(upload->default_size, alloc_size), 4096);
upload->total_alloc_size += upload->size;
upload->offset = 0;
upload->buffer = r600_bo(upload->rctx->radeon, upload->size, 4096, PIPE_BIND_VERTEX_BUFFER, 0);
if (upload->buffer == NULL) {
return -ENOMEM;
}
upload->ptr = r600_bo_map(upload->rctx->radeon, upload->buffer, 0, NULL);
}
in_ptr = in_buffer->user_buffer;
memcpy(upload->ptr + upload->offset, (uint8_t *) in_ptr + offset, size);
*out_offset = upload->offset;
*out_size = upload->size;
*out_buffer = upload->buffer;
upload->offset += alloc_size;
return 0;
}

View File

@@ -1,52 +0,0 @@
LOCAL_PATH := $(call my-dir)
# from Makefile
C_SOURCES = \
sp_fs_exec.c \
sp_fs_sse.c \
sp_clear.c \
sp_fence.c \
sp_flush.c \
sp_query.c \
sp_context.c \
sp_draw_arrays.c \
sp_prim_vbuf.c \
sp_quad_pipe.c \
sp_quad_stipple.c \
sp_quad_depth_test.c \
sp_quad_fs.c \
sp_quad_blend.c \
sp_screen.c \
sp_setup.c \
sp_state_blend.c \
sp_state_clip.c \
sp_state_derived.c \
sp_state_sampler.c \
sp_state_shader.c \
sp_state_so.c \
sp_state_rasterizer.c \
sp_state_surface.c \
sp_state_vertex.c \
sp_texture.c \
sp_tex_sample.c \
sp_tex_tile_cache.c \
sp_tile_cache.c \
sp_surface.c
include $(CLEAR_VARS)
LOCAL_SRC_FILES := \
$(C_SOURCES)
LOCAL_CFLAGS := \
-fvisibility=hidden \
-Wno-sign-compare
LOCAL_C_INCLUDES := \
external/mesa/include \
external/mesa/src/gallium/include \
external/mesa/src/gallium/auxiliary
LOCAL_MODULE := libmesa_pipe_softpipe
include $(BUILD_STATIC_LIBRARY)

View File

@@ -50,7 +50,7 @@ softpipe_flush( struct pipe_context *pipe,
draw_flush(softpipe->draw);
if (1 || (flags & PIPE_FLUSH_TEXTURE_CACHE)) {
if (flags & PIPE_FLUSH_TEXTURE_CACHE) {
for (i = 0; i < softpipe->num_sampler_views; i++) {
sp_flush_tex_tile_cache(softpipe->tex_cache[i]);
}

View File

@@ -1,73 +0,0 @@
ifeq ($(strip $(MESA_BUILD_VMWGFX)),true)
LOCAL_PATH := $(call my-dir)
# from Makefile
C_SOURCES = \
svgadump/svga_shader_dump.c \
svgadump/svga_shader_op.c \
svgadump/svga_dump.c \
svga_cmd.c \
svga_context.c \
svga_draw.c \
svga_draw_arrays.c \
svga_draw_elements.c \
svga_pipe_blend.c \
svga_pipe_blit.c \
svga_pipe_clear.c \
svga_pipe_constants.c \
svga_pipe_depthstencil.c \
svga_pipe_draw.c \
svga_pipe_flush.c \
svga_pipe_fs.c \
svga_pipe_misc.c \
svga_pipe_query.c \
svga_pipe_rasterizer.c \
svga_pipe_sampler.c \
svga_pipe_vertex.c \
svga_pipe_vs.c \
svga_screen.c \
svga_screen_cache.c \
svga_state.c \
svga_state_need_swtnl.c \
svga_state_constants.c \
svga_state_framebuffer.c \
svga_state_rss.c \
svga_state_tss.c \
svga_state_vdecl.c \
svga_state_fs.c \
svga_state_vs.c \
svga_swtnl_backend.c \
svga_swtnl_draw.c \
svga_swtnl_state.c \
svga_tgsi.c \
svga_tgsi_decl_sm20.c \
svga_tgsi_decl_sm30.c \
svga_tgsi_insn.c \
svga_sampler_view.c \
svga_surface.c \
svga_resource.c \
svga_resource_texture.c \
svga_resource_buffer.c \
svga_resource_buffer_upload.c
include $(CLEAR_VARS)
LOCAL_SRC_FILES := \
$(C_SOURCES)
LOCAL_CFLAGS := \
-fvisibility=hidden \
-Wno-sign-compare
LOCAL_C_INCLUDES := \
external/mesa/include \
external/mesa/src/gallium/include \
external/mesa/src/gallium/auxiliary \
external/mesa/src/gallium/drivers/svga/include
LOCAL_MODULE := libmesa_pipe_svga
include $(BUILD_STATIC_LIBRARY)
endif # MESA_BUILD_VMWGFX

View File

@@ -67,9 +67,7 @@ extern "C" {
#if !defined(__HAIKU__) && !defined(__USE_MISC)
#if !defined(PIPE_OS_ANDROID)
typedef unsigned int uint;
#endif
typedef unsigned short ushort;
#endif
typedef unsigned char ubyte;

View File

@@ -133,14 +133,6 @@
#define PIPE_OS_UNIX
#endif
/*
* Android defines __linux__ so PIPE_OS_LINUX and PIPE_OS_UNIX will also be
* defined.
*/
#if defined(ANDROID)
#define PIPE_OS_ANDROID
#endif
#if defined(__FreeBSD__)
#define PIPE_OS_FREEBSD
#define PIPE_OS_BSD

View File

@@ -1,38 +0,0 @@
LOCAL_PATH := $(call my-dir)
common_SOURCES := \
egl/common/egl_g3d.c \
egl/common/egl_g3d_api.c \
egl/common/egl_g3d_image.c \
egl/common/egl_g3d_st.c \
egl/common/egl_g3d_sync.c \
egl/common/native_helper.c
android_SOURCES := \
egl/android/native_android.cpp
include $(CLEAR_VARS)
LOCAL_SRC_FILES := \
$(common_SOURCES) \
$(android_SOURCES)
LOCAL_CFLAGS := \
-DHAVE_ANDROID_BACKEND \
-fvisibility=hidden \
-Wno-sign-compare
LOCAL_C_INCLUDES := \
external/mesa/include \
external/mesa/src/gallium/include \
external/mesa/src/gallium/auxiliary \
external/mesa/src/egl/main \
external/mesa/src/gallium/state_trackers/egl \
external/mesa/src/gallium/winsys/sw \
external/mesa/src/gralloc \
external/drm \
external/drm/include/drm
LOCAL_MODULE := libmesa_st_egl
include $(BUILD_STATIC_LIBRARY)

View File

@@ -1,679 +0,0 @@
/*
* Mesa 3-D graphics library
* Version: 7.9
*
* Copyright (C) 2010 LunarG Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
* Authors:
* Chia-I Wu <olv@lunarg.com>
*/
#define LOG_TAG "MESA-EGL"
#include <cutils/log.h>
#include <cutils/properties.h>
#include <ui/PixelFormat.h>
#include <ui/android_native_buffer.h>
extern "C" {
#include "egllog.h"
}
#include "util/u_memory.h"
#include "util/u_inlines.h"
#include "util/u_format.h"
#include "common/native.h"
#include "common/native_helper.h"
#include "android/android_sw_winsys.h"
#include "state_tracker/drm_driver.h"
struct android_config;
struct android_display {
struct native_display base;
boolean use_drm;
struct native_event_handler *event_handler;
struct android_config *configs;
int num_configs;
};
struct android_surface {
struct native_surface base;
struct android_display *adpy;
android_native_window_t *win;
uint stamp;
android_native_buffer_t *buf;
struct pipe_resource *res;
/* cache the current front and back resources */
void *cache_handles[2];
struct pipe_resource *cache_resources[2];
};
struct android_config {
struct native_config base;
};
static INLINE struct android_display *
android_display(const struct native_display *ndpy)
{
return (struct android_display *) ndpy;
}
static INLINE struct android_surface *
android_surface(const struct native_surface *nsurf)
{
return (struct android_surface *) nsurf;
}
static INLINE struct android_config *
android_config(const struct native_config *nconf)
{
return (struct android_config *) nconf;
}
namespace android {
static enum pipe_format
get_pipe_format(int native)
{
enum pipe_format fmt;
/* see libpixelflinger/format.cpp */
switch (native) {
case PIXEL_FORMAT_RGBA_8888:
fmt = PIPE_FORMAT_R8G8B8A8_UNORM;
break;
case PIXEL_FORMAT_RGBX_8888:
fmt = PIPE_FORMAT_R8G8B8X8_UNORM;
break;
case PIXEL_FORMAT_RGB_888:
fmt = PIPE_FORMAT_R8G8B8_UNORM;
break;
case PIXEL_FORMAT_RGB_565:
fmt = PIPE_FORMAT_B5G6R5_UNORM;
break;
case PIXEL_FORMAT_BGRA_8888:
fmt = PIPE_FORMAT_B8G8R8A8_UNORM;
break;
case PIXEL_FORMAT_A_8:
fmt = PIPE_FORMAT_A8_UNORM;
break;
case PIXEL_FORMAT_L_8:
fmt = PIPE_FORMAT_L8_UNORM;
break;
case PIXEL_FORMAT_LA_88:
fmt = PIPE_FORMAT_L8A8_UNORM;
break;
case PIXEL_FORMAT_NONE:
case PIXEL_FORMAT_RGBA_5551:
case PIXEL_FORMAT_RGBA_4444:
case PIXEL_FORMAT_RGB_332:
default:
LOGE("unsupported native format 0x%x", native);
fmt = PIPE_FORMAT_NONE;
break;
}
return fmt;
}
#include <gralloc_gem.h>
static int
get_handle_name(buffer_handle_t handle)
{
struct drm_bo_t *bo;
bo = drm_gem_get(handle);
return (bo) ? bo->name : 0;
}
static struct pipe_resource *
import_buffer(struct android_display *adpy, const struct pipe_resource *templ,
struct android_native_buffer_t *abuf)
{
struct pipe_screen *screen = adpy->base.screen;
struct pipe_resource *res;
if (templ->bind & PIPE_BIND_RENDER_TARGET) {
if (!screen->is_format_supported(screen, templ->format,
templ->target, 0, PIPE_BIND_RENDER_TARGET, 0))
LOGW("importing unsupported buffer as render target");
}
if (templ->bind & PIPE_BIND_SAMPLER_VIEW) {
if (!screen->is_format_supported(screen, templ->format,
templ->target, 0, PIPE_BIND_SAMPLER_VIEW, 0))
LOGW("importing unsupported buffer as sampler view");
}
if (adpy->use_drm) {
struct winsys_handle handle;
memset(&handle, 0, sizeof(handle));
handle.type = DRM_API_HANDLE_TYPE_SHARED;
handle.handle = get_handle_name(abuf->handle);
if (!handle.handle) {
LOGE("unable to import invalid buffer %p", abuf);
return NULL;
}
handle.stride =
abuf->stride * util_format_get_blocksize(templ->format);
res = screen->resource_from_handle(screen, templ, &handle);
}
else {
struct android_winsys_handle handle;
memset(&handle, 0, sizeof(handle));
handle.handle = abuf->handle;
handle.stride =
abuf->stride * util_format_get_blocksize(templ->format);
res = screen->resource_from_handle(screen,
templ, (struct winsys_handle *) &handle);
}
if (!res)
LOGE("failed to import buffer %p", abuf);
return res;
}
static boolean
android_surface_dequeue_buffer(struct native_surface *nsurf)
{
struct android_surface *asurf = android_surface(nsurf);
void *handle;
int idx;
if (asurf->win->dequeueBuffer(asurf->win, &asurf->buf) != NO_ERROR) {
LOGE("failed to dequeue window %p", asurf->win);
return FALSE;
}
asurf->buf->common.incRef(&asurf->buf->common);
asurf->win->lockBuffer(asurf->win, asurf->buf);
if (asurf->adpy->use_drm)
handle = (void *) get_handle_name(asurf->buf->handle);
else
handle = (void *) asurf->buf->handle;
/* NULL is invalid */
if (!handle) {
LOGE("window %p returned an invalid buffer", asurf->win);
return TRUE;
}
/* find the slot to use */
for (idx = 0; idx < Elements(asurf->cache_handles); idx++) {
if (asurf->cache_handles[idx] == handle || !asurf->cache_handles[idx])
break;
}
if (idx == Elements(asurf->cache_handles)) {
/* buffer reallocated; clear the cache */
for (idx = 0; idx < Elements(asurf->cache_handles); idx++) {
asurf->cache_handles[idx] = 0;
pipe_resource_reference(&asurf->cache_resources[idx], NULL);
}
idx = 0;
}
/* update the cache */
if (!asurf->cache_handles[idx]) {
struct pipe_resource templ;
assert(!asurf->cache_resources[idx]);
memset(&templ, 0, sizeof(templ));
templ.target = PIPE_TEXTURE_2D;
templ.last_level = 0;
templ.width0 = asurf->buf->width;
templ.height0 = asurf->buf->height;
templ.depth0 = 1;
templ.bind = PIPE_BIND_RENDER_TARGET;
if (!asurf->adpy->use_drm) {
templ.bind |= PIPE_BIND_TRANSFER_WRITE |
PIPE_BIND_TRANSFER_READ;
}
templ.format = get_pipe_format(asurf->buf->format);
if (templ.format != PIPE_FORMAT_NONE) {
asurf->cache_resources[idx] =
import_buffer(asurf->adpy, &templ, asurf->buf);
}
else {
asurf->cache_resources[idx] = NULL;
}
asurf->cache_handles[idx] = handle;
}
pipe_resource_reference(&asurf->res, asurf->cache_resources[idx]);
return TRUE;
}
static boolean
android_surface_enqueue_buffer(struct native_surface *nsurf)
{
struct android_surface *asurf = android_surface(nsurf);
pipe_resource_reference(&asurf->res, NULL);
asurf->win->queueBuffer(asurf->win, asurf->buf);
asurf->buf->common.decRef(&asurf->buf->common);
asurf->buf = NULL;
return TRUE;
}
static boolean
android_surface_swap_buffers(struct native_surface *nsurf)
{
struct android_surface *asurf = android_surface(nsurf);
struct android_display *adpy = asurf->adpy;
if (!asurf->buf)
return FALSE;
android_surface_enqueue_buffer(&asurf->base);
asurf->stamp++;
adpy->event_handler->invalid_surface(&adpy->base,
&asurf->base, asurf->stamp);
return TRUE;
}
static boolean
android_surface_present(struct native_surface *nsurf,
enum native_attachment natt,
boolean preserve,
uint swap_interval)
{
boolean ret;
if (swap_interval || natt != NATIVE_ATTACHMENT_BACK_LEFT)
return FALSE;
return android_surface_swap_buffers(nsurf);
}
static boolean
android_surface_validate(struct native_surface *nsurf, uint attachment_mask,
unsigned int *seq_num, struct pipe_resource **textures,
int *width, int *height)
{
struct android_surface *asurf = android_surface(nsurf);
struct winsys_handle handle;
if (!asurf->buf) {
if (!android_surface_dequeue_buffer(&asurf->base))
return FALSE;
}
if (textures) {
const enum native_attachment att = NATIVE_ATTACHMENT_BACK_LEFT;
if (native_attachment_mask_test(attachment_mask, att)) {
textures[att] = NULL;
pipe_resource_reference(&textures[att], asurf->res);
}
}
if (seq_num)
*seq_num = asurf->stamp;
if (width)
*width = asurf->buf->width;
if (height)
*height = asurf->buf->height;
return TRUE;
}
static void
android_surface_wait(struct native_surface *nsurf)
{
}
static void
android_surface_destroy(struct native_surface *nsurf)
{
struct android_surface *asurf = android_surface(nsurf);
int i;
if (asurf->buf)
android_surface_enqueue_buffer(&asurf->base);
for (i = 0; i < Elements(asurf->cache_handles); i++)
pipe_resource_reference(&asurf->cache_resources[i], NULL);
asurf->win->common.decRef(&asurf->win->common);
FREE(asurf);
}
static struct native_surface *
android_display_create_window_surface(struct native_display *ndpy,
EGLNativeWindowType win,
const struct native_config *nconf)
{
struct android_display *adpy = android_display(ndpy);
struct android_config *aconf = android_config(nconf);
struct android_surface *asurf;
enum pipe_format format;
int val;
if (win->common.magic != ANDROID_NATIVE_WINDOW_MAGIC) {
LOGE("invalid native window with magic 0x%x", win->common.magic);
return NULL;
}
if (win->query(win, NATIVE_WINDOW_FORMAT, &val)) {
LOGE("failed to query native window format");
return NULL;
}
format = get_pipe_format(val);
if (format != nconf->color_format) {
LOGW("native window format 0x%x != config format 0x%x",
format, nconf->color_format);
if (!adpy->base.screen->is_format_supported(adpy->base.screen,
format, PIPE_TEXTURE_2D, 0, PIPE_BIND_RENDER_TARGET, 0)) {
LOGE("and the native window cannot be used as a render target");
return NULL;
}
}
asurf = CALLOC_STRUCT(android_surface);
if (!asurf)
return NULL;
asurf->adpy = adpy;
asurf->win = win;
asurf->win->common.incRef(&asurf->win->common);
if (!adpy->use_drm) {
native_window_set_usage(asurf->win,
GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_SW_WRITE_OFTEN);
}
asurf->base.destroy = android_surface_destroy;
asurf->base.present = android_surface_present;
asurf->base.validate = android_surface_validate;
asurf->base.wait = android_surface_wait;
return &asurf->base;
}
static boolean
android_display_init_configs(struct native_display *ndpy)
{
struct android_display *adpy = android_display(ndpy);
const int native_formats[] = {
PIXEL_FORMAT_RGBA_8888,
PIXEL_FORMAT_RGBX_8888,
PIXEL_FORMAT_RGB_888,
PIXEL_FORMAT_RGB_565,
PIXEL_FORMAT_BGRA_8888,
PIXEL_FORMAT_A_8
};
int i;
adpy->configs = (struct android_config *)
CALLOC(Elements(native_formats), sizeof(*adpy->configs));
if (!adpy->configs)
return FALSE;
for (i = 0; i < Elements(native_formats); i++) {
enum pipe_format color_format;
struct android_config *aconf;
color_format = get_pipe_format(native_formats[i]);
if (color_format == PIPE_FORMAT_NONE ||
!adpy->base.screen->is_format_supported(adpy->base.screen,
color_format, PIPE_TEXTURE_2D, 0, PIPE_BIND_RENDER_TARGET, 0)) {
LOGI("skip unsupported native format 0x%x", native_formats[i]);
continue;
}
aconf = &adpy->configs[adpy->num_configs++];
aconf->base.buffer_mask = 1 << NATIVE_ATTACHMENT_BACK_LEFT;
aconf->base.color_format = color_format;
aconf->base.window_bit = TRUE;
if (!adpy->use_drm)
aconf->base.slow_config = TRUE;
aconf->base.native_visual_type = native_formats[i];
}
return TRUE;
}
static boolean
android_display_init(struct native_display *ndpy)
{
struct android_display *adpy = android_display(ndpy);
const hw_module_t *mod;
int fd, err;
boolean force_sw;
char value[PROPERTY_VALUE_MAX];
if (property_get("debug.mesa.software", value, NULL))
force_sw = (atoi(value) != 0);
else
force_sw = debug_get_bool_option("EGL_SOFTWARE", FALSE);
/* try DRM first */
if (!force_sw) {
err = hw_get_module(GRALLOC_HARDWARE_MODULE_ID, &mod);
if (!err) {
const gralloc_module_t *gr = (gralloc_module_t *) mod;
err = -EINVAL;
if (gr->perform)
err = gr->perform(gr, GRALLOC_MODULE_PERFORM_GET_DRM_FD, &fd);
}
if (!err && fd >= 0) {
adpy->base.screen =
adpy->event_handler->new_drm_screen(&adpy->base, "i915", fd);
if (adpy->base.screen)
adpy->use_drm = TRUE;
}
if (adpy->base.screen)
LOGI("using DRM screen");
else
LOGE("failed to create DRM screen");
}
/* try SW screen */
if (!adpy->base.screen) {
struct sw_winsys *ws = android_create_sw_winsys();
if (ws) {
adpy->base.screen =
adpy->event_handler->new_sw_screen(&adpy->base, ws);
}
if (adpy->base.screen)
LOGI("using SW screen");
else
LOGE("failed to create SW screen");
}
if (adpy->base.screen) {
if (!android_display_init_configs(&adpy->base)) {
adpy->base.screen->destroy(adpy->base.screen);
adpy->base.screen = NULL;
}
}
return (adpy->base.screen != NULL);
}
static void
android_display_destroy(struct native_display *ndpy)
{
struct android_display *adpy = android_display(ndpy);
FREE(adpy->configs);
adpy->base.screen->destroy(adpy->base.screen);
FREE(adpy);
}
static const struct native_config **
android_display_get_configs(struct native_display *ndpy, int *num_configs)
{
struct android_display *adpy = android_display(ndpy);
const struct native_config **configs;
int i;
configs = (const struct native_config **)
MALLOC(adpy->num_configs * sizeof(*configs));
if (configs) {
for (i = 0; i < adpy->num_configs; i++)
configs[i] = (const struct native_config *) &adpy->configs[i];
if (num_configs)
*num_configs = adpy->num_configs;
}
return configs;
}
static int
android_display_get_param(struct native_display *ndpy,
enum native_param_type param)
{
int val;
switch (param) {
default:
val = 0;
break;
}
return val;
}
static struct pipe_resource *
android_display_import_buffer(struct native_display *ndpy,
const struct pipe_resource *templ,
void *buf)
{
struct android_display *adpy = android_display(ndpy);
struct android_native_buffer_t *abuf =
(struct android_native_buffer_t *) buf;
return import_buffer(adpy, templ, abuf);
}
static boolean
android_display_export_buffer(struct native_display *ndpy,
struct pipe_resource *res,
void *buf)
{
return FALSE;
}
static struct native_display_buffer android_display_buffer = {
android_display_import_buffer,
android_display_export_buffer
};
static struct android_display *
android_display_create(struct native_event_handler *event_handler,
void *user_data)
{
struct android_display *adpy;
adpy = CALLOC_STRUCT(android_display);
if (!adpy)
return NULL;
adpy->event_handler = event_handler;
adpy->base.user_data = user_data;
if (!android_display_init(&adpy->base)) {
FREE(adpy);
return NULL;
}
adpy->base.destroy = android_display_destroy;
adpy->base.get_param = android_display_get_param;
adpy->base.get_configs = android_display_get_configs;
adpy->base.create_window_surface = android_display_create_window_surface;
adpy->base.buffer = &android_display_buffer;
return adpy;
}
static struct native_display *
native_create_display(void *dpy, struct native_event_handler *event_handler,
void *user_data)
{
struct android_display *adpy;
adpy = android_display_create(event_handler, user_data);
return (adpy) ? &adpy->base : NULL;
}
static const struct native_platform android_platform = {
"Android", /* name */
native_create_display
};
}; /* namespace android */
using namespace android;
static void
android_log(EGLint level, const char *msg)
{
switch (level) {
case _EGL_DEBUG:
LOGD(msg);
break;
case _EGL_INFO:
LOGI(msg);
break;
case _EGL_WARNING:
LOGW(msg);
break;
case _EGL_FATAL:
LOG_FATAL(msg);
break;
default:
break;
}
}
const struct native_platform *
native_get_android_platform(void)
{
_eglSetLogProc(android_log);
return &android_platform;
}

View File

@@ -73,12 +73,6 @@ egl_g3d_get_platform(_EGLDriver *drv, _EGLPlatformType plat)
plat_name = "FBDEV";
#ifdef HAVE_FBDEV_BACKEND
nplat = native_get_fbdev_platform();
#endif
break;
case _EGL_PLATFORM_ANDROID:
plat_name = "Android";
#ifdef HAVE_ANDROID_BACKEND
nplat = native_get_android_platform();
#endif
break;
default:
@@ -563,11 +557,6 @@ egl_g3d_initialize(_EGLDriver *drv, _EGLDisplay *dpy,
dpy->Extensions.MESA_drm_image = EGL_TRUE;
}
#ifdef EGL_ANDROID_image_native_buffer
if (dpy->Platform == _EGL_PLATFORM_ANDROID && gdpy->native->buffer)
dpy->Extensions.ANDROID_image_native_buffer = EGL_TRUE;
#endif
if (egl_g3d_add_configs(drv, dpy, 1) == 1) {
_eglError(EGL_NOT_INITIALIZED, "eglInitialize(unable to add configs)");
goto fail;

View File

@@ -94,9 +94,6 @@ struct egl_g3d_image {
struct pipe_resource *texture;
unsigned level;
unsigned layer;
EGLenum target;
EGLClientBuffer buffer;
};
/* standard typecasts */

View File

@@ -41,11 +41,6 @@
/* for struct winsys_handle */
#include "state_tracker/drm_driver.h"
#ifdef EGL_ANDROID_image_native_buffer
#include <ui/android_native_buffer.h>
#include "android/android_sw_winsys.h"
#endif
/**
* Reference and return the front left buffer of the native pixmap.
*/
@@ -190,67 +185,6 @@ egl_g3d_reference_drm_buffer(_EGLDisplay *dpy, EGLint name,
#endif /* EGL_MESA_drm_image */
#ifdef EGL_ANDROID_image_native_buffer
static struct pipe_resource *
egl_g3d_reference_android_native_buffer(_EGLDisplay *dpy,
struct android_native_buffer_t *buf)
{
struct egl_g3d_display *gdpy = egl_g3d_display(dpy);
struct pipe_screen *screen = gdpy->native->screen;
enum pipe_format format;
struct pipe_resource templ, *res;
struct android_winsys_handle handle;
if (!buf || buf->common.magic != ANDROID_NATIVE_BUFFER_MAGIC ||
buf->common.version != sizeof(*buf)) {
_eglError(EGL_BAD_PARAMETER, "eglCreateEGLImageKHR");
return NULL;
}
switch (buf->format) {
case HAL_PIXEL_FORMAT_RGBA_8888:
format = PIPE_FORMAT_R8G8B8A8_UNORM;
break;
case HAL_PIXEL_FORMAT_RGBX_8888:
format = PIPE_FORMAT_R8G8B8X8_UNORM;
break;
case HAL_PIXEL_FORMAT_RGB_888:
format = PIPE_FORMAT_R8G8B8_UNORM;
break;
case HAL_PIXEL_FORMAT_RGB_565:
format = PIPE_FORMAT_B5G6R5_UNORM;
break;
case HAL_PIXEL_FORMAT_BGRA_8888:
format = PIPE_FORMAT_B8G8R8A8_UNORM;
break;
case HAL_PIXEL_FORMAT_RGBA_5551:
case HAL_PIXEL_FORMAT_RGBA_4444:
/* unsupported */
default:
_eglLog(_EGL_WARNING, "unsupported native format 0x%x", buf->format);
return NULL;
break;
}
memset(&templ, 0, sizeof(templ));
templ.target = PIPE_TEXTURE_2D;
templ.format = format;
templ.bind = PIPE_BIND_RENDER_TARGET | PIPE_BIND_SAMPLER_VIEW;
templ.width0 = buf->width;
templ.height0 = buf->height;
templ.depth0 = 1;
res = gdpy->native->buffer->import_buffer(gdpy->native,
&templ, (void *) buf);
if (res)
buf->common.incRef(&buf->common);
return res;
}
#endif /* EGL_ANDROID_image_native_buffer */
_EGLImage *
egl_g3d_create_image(_EGLDriver *drv, _EGLDisplay *dpy, _EGLContext *ctx,
EGLenum target, EGLClientBuffer buffer,
@@ -271,8 +205,6 @@ egl_g3d_create_image(_EGLDriver *drv, _EGLDisplay *dpy, _EGLContext *ctx,
return NULL;
}
gimg->target = target;
switch (target) {
case EGL_NATIVE_PIXMAP_KHR:
ptex = egl_g3d_reference_native_pixmap(dpy,
@@ -283,13 +215,6 @@ egl_g3d_create_image(_EGLDriver *drv, _EGLDisplay *dpy, _EGLContext *ctx,
ptex = egl_g3d_reference_drm_buffer(dpy,
(EGLint) buffer, &gimg->base, attribs);
break;
#endif
#ifdef EGL_ANDROID_image_native_buffer
case EGL_NATIVE_BUFFER_ANDROID:
gimg->buffer = buffer;
ptex = egl_g3d_reference_android_native_buffer(dpy,
(struct android_native_buffer_t *) buffer);
break;
#endif
default:
ptex = NULL;
@@ -327,14 +252,6 @@ egl_g3d_destroy_image(_EGLDriver *drv, _EGLDisplay *dpy, _EGLImage *img)
{
struct egl_g3d_image *gimg = egl_g3d_image(img);
#ifdef EGL_ANDROID_image_native_buffer
if (gimg->target == EGL_NATIVE_BUFFER_ANDROID) {
struct android_native_buffer_t * buf =
(struct android_native_buffer_t *) gimg->buffer;
buf->common.decRef(&buf->common);
}
#endif
pipe_resource_reference(&gimg->texture, NULL);
FREE(gimg);

View File

@@ -243,9 +243,6 @@ native_get_drm_platform(void);
const struct native_platform *
native_get_fbdev_platform(void);
const struct native_platform *
native_get_android_platform(void);
#ifdef __cplusplus
}
#endif

View File

@@ -1,157 +0,0 @@
LOCAL_PATH := $(call my-dir)
gles_SRC_FILES := \
egl-gdi/egl-static.c
gles_CFLAGS := \
-DFEATURE_ES1=1 \
-DFEATURE_ES2=1 \
-DGALLIUM_SOFTPIPE \
-fvisibility=hidden \
-Wno-sign-compare
gles_C_INCLUDES := \
external/mesa/include \
external/mesa/src/gallium/include \
external/mesa/src/gallium/auxiliary \
external/mesa/src/gallium/drivers \
external/mesa/src/gallium/winsys \
external/mesa/src/gallium/state_trackers/vega \
external/mesa/src/gallium/state_trackers/egl \
external/mesa/src/egl/main \
external/mesa/src/mesa
gles_STATIC_LIBRARIES := \
libmesa_st_egl \
libmesa_winsys_sw \
libmesa_pipe_softpipe \
libmesa_st_mesa \
libmesa_glsl \
libmesa_st_mesa \
libmesa_talloc \
libmesa_gallium
gles_WHOLE_STATIC_LIBRARIES := \
libmesa_egl \
libmesa_glapi
gles_SHARED_LIBRARIES := \
libdl \
libhardware \
liblog \
libcutils
gralloc_SRC_FILES :=
gralloc_CFLAGS := \
-fvisibility=hidden \
-Wno-sign-compare
gralloc_C_INCLUDES := \
external/mesa/src/gallium/include \
external/mesa/src/gallium/auxiliary \
external/mesa/src/gallium/drivers \
external/mesa/src/gallium/winsys
gralloc_STATIC_LIBRARIES := \
libmesa_gallium
gralloc_WHOLE_STATIC_LIBRARIES := \
libmesa_st_gralloc
gralloc_SHARED_LIBRARIES := \
libdl \
liblog \
libcutils \
libdrm \
libEGL
ifeq ($(strip $(MESA_BUILD_SWRAST)),true)
include $(CLEAR_VARS)
LOCAL_SRC_FILES := \
$(gles_SRC_FILES)
LOCAL_CFLAGS := \
$(gles_CFLAGS)
LOCAL_C_INCLUDES := \
$(gles_C_INCLUDES)
LOCAL_STATIC_LIBRARIES := \
$(gles_STATIC_LIBRARIES)
LOCAL_WHOLE_STATIC_LIBRARIES := \
$(gles_WHOLE_STATIC_LIBRARIES)
LOCAL_SHARED_LIBRARIES := \
$(gles_SHARED_LIBRARIES)
LOCAL_MODULE := libGLES_swrast
LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/egl
include $(BUILD_SHARED_LIBRARY)
endif # MESA_BUILD_SWRAST
ifeq ($(strip $(MESA_BUILD_I915G)),true)
include $(CLEAR_VARS)
LOCAL_SRC_FILES := \
$(gles_SRC_FILES) \
egl/pipe_i915.c
LOCAL_CFLAGS := \
$(gles_CFLAGS) \
-DFEATURE_DRM=1
LOCAL_C_INCLUDES := \
$(gles_C_INCLUDES)
LOCAL_STATIC_LIBRARIES := \
libmesa_winsys_i915 \
libmesa_pipe_i915 \
$(gles_STATIC_LIBRARIES)
LOCAL_WHOLE_STATIC_LIBRARIES := \
$(gles_WHOLE_STATIC_LIBRARIES)
LOCAL_SHARED_LIBRARIES := \
$(gles_SHARED_LIBRARIES) \
libdrm \
libdrm_intel
LOCAL_MODULE := libGLES_i915g
LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/egl
include $(BUILD_SHARED_LIBRARY)
endif # MESA_BUILD_I915G
ifeq ($(strip $(MESA_BUILD_VMWGFX)),true)
include $(CLEAR_VARS)
LOCAL_SRC_FILES := \
egl/pipe_vmwgfx.c \
$(gralloc_SRC_FILES)
LOCAL_CFLAGS := \
$(gralloc_CFLAGS)
LOCAL_C_INCLUDES := \
$(gralloc_C_INCLUDES)
LOCAL_STATIC_LIBRARIES := \
libmesa_pipe_svga \
libmesa_winsys_svga \
$(gralloc_STATIC_LIBRARIES)
LOCAL_WHOLE_STATIC_LIBRARIES := \
$(gralloc_WHOLE_STATIC_LIBRARIES)
LOCAL_SHARED_LIBRARIES := \
$(gralloc_SHARED_LIBRARIES)
LOCAL_MODULE := gralloc.vmwgfx
LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw
include $(BUILD_SHARED_LIBRARY)
endif # MESA_BUILD_VMWGFX

View File

@@ -28,7 +28,6 @@
#include "common/egl_g3d_loader.h"
#include "state_tracker/st_gl_api.h"
#include "state_tracker/drm_driver.h"
#include "vg_api.h"
#include "target-helpers/inline_sw_helper.h"
#include "target-helpers/inline_debug_helper.h"
@@ -74,11 +73,7 @@ guess_gl_api(enum st_profile_type profile)
static struct pipe_screen *
create_drm_screen(const char *name, int fd)
{
#if FEATURE_DRM
return driver_descriptor.create_screen(fd);
#else
return NULL;
#endif
}
static struct pipe_screen *

View File

@@ -1 +0,0 @@
include $(call all-subdir-makefiles)

View File

@@ -1,33 +0,0 @@
ifeq ($(strip $(MESA_BUILD_I915G)),true)
LOCAL_PATH := $(call my-dir)
# from drm/Makefile
C_SOURCES = \
i915_drm_batchbuffer.c \
i915_drm_buffer.c \
i915_drm_fence.c \
i915_drm_winsys.c
include $(CLEAR_VARS)
LOCAL_SRC_FILES := \
$(addprefix drm/, $(C_SOURCES))
LOCAL_CFLAGS := \
-fvisibility=hidden \
-Wno-sign-compare
LOCAL_C_INCLUDES := \
external/mesa/src/gallium/include \
external/mesa/src/gallium/auxiliary \
external/mesa/src/gallium/drivers \
external/drm \
external/drm/include/drm \
external/drm/intel
LOCAL_MODULE := libmesa_winsys_i915
include $(BUILD_STATIC_LIBRARY)
endif # MESA_BUILD_I915G

View File

@@ -8,12 +8,12 @@ C_SOURCES = \
bof.c \
evergreen_hw_context.c \
radeon_bo.c \
radeon_bo_pb.c \
radeon_pciid.c \
r600.c \
r600_bo.c \
r600_drm.c \
r600_hw_context.c
r600_hw_context.c \
r600_bomgr.c
LIBRARY_INCLUDES = -I$(TOP)/src/gallium/drivers/r600 \
$(shell pkg-config libdrm --cflags-only-I)

View File

@@ -6,12 +6,12 @@ r600_sources = [
'bof.c',
'evergreen_hw_context.c',
'radeon_bo.c',
'radeon_bo_pb.c',
'radeon_pciid.c',
'r600.c',
'r600_bo.c',
'r600_drm.c',
'r600_hw_context.c',
'r600_bomgr.c',
]
env.ParseConfig('pkg-config --cflags libdrm_radeon')

View File

@@ -36,7 +36,6 @@
#include "pipe/p_compiler.h"
#include "util/u_inlines.h"
#include "util/u_memory.h"
#include <pipebuffer/pb_bufmgr.h>
#include "r600_priv.h"
#define GROUP_FORCE_NEW_BLOCK 0

View File

@@ -27,7 +27,6 @@
#include "radeon_drm.h"
#include "pipe/p_compiler.h"
#include "util/u_inlines.h"
#include <pipebuffer/pb_bufmgr.h>
#include "r600_priv.h"
enum radeon_family r600_get_family(struct radeon *r600)

View File

@@ -36,142 +36,153 @@ struct r600_bo *r600_bo(struct radeon *radeon,
unsigned size, unsigned alignment,
unsigned binding, unsigned usage)
{
struct r600_bo *ws_bo = calloc(1, sizeof(struct r600_bo));
struct pb_desc desc;
struct pb_manager *man;
struct r600_bo *bo;
struct radeon_bo *rbo;
desc.alignment = alignment;
desc.usage = (PB_USAGE_CPU_READ_WRITE | PB_USAGE_GPU_READ_WRITE);
ws_bo->size = size;
if (binding & (PIPE_BIND_CONSTANT_BUFFER | PIPE_BIND_VERTEX_BUFFER | PIPE_BIND_INDEX_BUFFER)) {
bo = r600_bomgr_bo_create(radeon->bomgr, size, alignment, *radeon->cfence);
if (bo) {
return bo;
}
}
if (binding & (PIPE_BIND_CONSTANT_BUFFER | PIPE_BIND_VERTEX_BUFFER | PIPE_BIND_INDEX_BUFFER))
man = radeon->cman;
else
man = radeon->kman;
rbo = radeon_bo(radeon, 0, size, alignment);
if (rbo == NULL) {
return NULL;
}
bo = calloc(1, sizeof(struct r600_bo));
bo->size = size;
bo->alignment = alignment;
bo->bo = rbo;
if (binding & (PIPE_BIND_CONSTANT_BUFFER | PIPE_BIND_VERTEX_BUFFER | PIPE_BIND_INDEX_BUFFER)) {
r600_bomgr_bo_init(radeon->bomgr, bo);
}
/* Staging resources particpate in transfers and blits only
* and are used for uploads and downloads from regular
* resources. We generate them internally for some transfers.
*/
if (usage == PIPE_USAGE_STAGING)
ws_bo->domains = RADEON_GEM_DOMAIN_CPU | RADEON_GEM_DOMAIN_GTT;
else
ws_bo->domains = (RADEON_GEM_DOMAIN_CPU |
RADEON_GEM_DOMAIN_GTT |
RADEON_GEM_DOMAIN_VRAM);
bo->domains = RADEON_GEM_DOMAIN_CPU | RADEON_GEM_DOMAIN_GTT;
else
bo->domains = (RADEON_GEM_DOMAIN_CPU |
RADEON_GEM_DOMAIN_GTT |
RADEON_GEM_DOMAIN_VRAM);
ws_bo->pb = man->create_buffer(man, size, &desc);
if (ws_bo->pb == NULL) {
free(ws_bo);
return NULL;
}
pipe_reference_init(&ws_bo->reference, 1);
return ws_bo;
pipe_reference_init(&bo->reference, 1);
return bo;
}
struct r600_bo *r600_bo_handle(struct radeon *radeon,
unsigned handle, unsigned *array_mode)
{
struct r600_bo *ws_bo = calloc(1, sizeof(struct r600_bo));
struct radeon_bo *bo;
struct r600_bo *bo = calloc(1, sizeof(struct r600_bo));
struct radeon_bo *rbo;
ws_bo->pb = radeon_bo_pb_create_buffer_from_handle(radeon->kman, handle);
if (!ws_bo->pb) {
free(ws_bo);
rbo = bo->bo = radeon_bo(radeon, handle, 0, 0);
if (rbo == NULL) {
free(bo);
return NULL;
}
bo = radeon_bo_pb_get_bo(ws_bo->pb);
ws_bo->size = bo->size;
ws_bo->domains = (RADEON_GEM_DOMAIN_CPU |
RADEON_GEM_DOMAIN_GTT |
RADEON_GEM_DOMAIN_VRAM);
bo->size = bo->size;
bo->domains = (RADEON_GEM_DOMAIN_CPU |
RADEON_GEM_DOMAIN_GTT |
RADEON_GEM_DOMAIN_VRAM);
pipe_reference_init(&ws_bo->reference, 1);
pipe_reference_init(&bo->reference, 1);
radeon_bo_get_tiling_flags(radeon, bo, &ws_bo->tiling_flags,
&ws_bo->kernel_pitch);
radeon_bo_get_tiling_flags(radeon, rbo, &bo->tiling_flags, &bo->kernel_pitch);
if (array_mode) {
if (ws_bo->tiling_flags) {
if (ws_bo->tiling_flags & RADEON_TILING_MICRO)
if (bo->tiling_flags) {
if (bo->tiling_flags & RADEON_TILING_MICRO)
*array_mode = V_0280A0_ARRAY_1D_TILED_THIN1;
if ((ws_bo->tiling_flags & (RADEON_TILING_MICRO | RADEON_TILING_MACRO)) ==
if ((bo->tiling_flags & (RADEON_TILING_MICRO | RADEON_TILING_MACRO)) ==
(RADEON_TILING_MICRO | RADEON_TILING_MACRO))
*array_mode = V_0280A0_ARRAY_2D_TILED_THIN1;
} else {
*array_mode = 0;
}
}
return ws_bo;
return bo;
}
void *r600_bo_map(struct radeon *radeon, struct r600_bo *bo, unsigned usage, void *ctx)
{
return pb_map(bo->pb, usage, ctx);
struct pipe_context *pctx = ctx;
if (usage & PB_USAGE_UNSYNCHRONIZED) {
radeon_bo_map(radeon, bo->bo);
return (uint8_t *) bo->bo->data + bo->offset;
}
if (p_atomic_read(&bo->bo->reference.count) > 1) {
if (usage & PB_USAGE_DONTBLOCK) {
return NULL;
}
if (ctx) {
pctx->flush(pctx, 0, NULL);
}
}
if (usage & PB_USAGE_DONTBLOCK) {
uint32_t domain;
if (radeon_bo_busy(radeon, bo->bo, &domain))
return NULL;
if (radeon_bo_map(radeon, bo->bo)) {
return NULL;
}
goto out;
}
radeon_bo_map(radeon, bo->bo);
if (radeon_bo_wait(radeon, bo->bo)) {
radeon_bo_unmap(radeon, bo->bo);
return NULL;
}
out:
return (uint8_t *) bo->bo->data + bo->offset;
}
void r600_bo_unmap(struct radeon *radeon, struct r600_bo *bo)
{
pb_unmap(bo->pb);
radeon_bo_unmap(radeon, bo->bo);
}
static void r600_bo_destroy(struct radeon *radeon, struct r600_bo *bo)
void r600_bo_destroy(struct radeon *radeon, struct r600_bo *bo)
{
if (bo->pb)
pb_reference(&bo->pb, NULL);
if (bo->manager_id) {
if (!r600_bomgr_bo_destroy(radeon->bomgr, bo)) {
/* destroy is delayed by buffer manager */
return;
}
}
radeon_bo_reference(radeon, &bo->bo, NULL);
free(bo);
}
void r600_bo_reference(struct radeon *radeon, struct r600_bo **dst,
struct r600_bo *src)
void r600_bo_reference(struct radeon *radeon, struct r600_bo **dst, struct r600_bo *src)
{
struct r600_bo *old = *dst;
if (pipe_reference(&(*dst)->reference, &src->reference)) {
r600_bo_destroy(radeon, old);
}
*dst = src;
}
unsigned r600_bo_get_handle(struct r600_bo *pb_bo)
{
struct radeon_bo *bo;
bo = radeon_bo_pb_get_bo(pb_bo->pb);
if (!bo)
return 0;
return bo->handle;
}
unsigned r600_bo_get_size(struct r600_bo *pb_bo)
{
struct radeon_bo *bo;
bo = radeon_bo_pb_get_bo(pb_bo->pb);
if (!bo)
return 0;
return bo->size;
}
boolean r600_bo_get_winsys_handle(struct radeon *radeon, struct r600_bo *pb_bo,
boolean r600_bo_get_winsys_handle(struct radeon *radeon, struct r600_bo *bo,
unsigned stride, struct winsys_handle *whandle)
{
struct radeon_bo *bo;
bo = radeon_bo_pb_get_bo(pb_bo->pb);
if (!bo)
return FALSE;
whandle->stride = stride;
switch(whandle->type) {
case DRM_API_HANDLE_TYPE_KMS:
whandle->handle = r600_bo_get_handle(pb_bo);
whandle->handle = r600_bo_get_handle(bo);
break;
case DRM_API_HANDLE_TYPE_SHARED:
if (radeon_bo_get_name(radeon, bo, &whandle->handle))
if (radeon_bo_get_name(radeon, bo->bo, &whandle->handle))
return FALSE;
break;
default:

View File

@@ -0,0 +1,161 @@
/*
* Copyright 2010 VMWare.
* Copyright 2010 Red Hat Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* on the rights to use, copy, modify, merge, publish, distribute, sub
* license, and/or sell copies of the Software, and to permit persons to whom
* the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
* THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
* USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
* Jose Fonseca <jrfonseca-at-vmware-dot-com>
* Thomas Hellström <thomas-at-vmware-dot-com>
* Jerome Glisse <jglisse@redhat.com>
*/
#include <util/u_memory.h>
#include <util/u_double_list.h>
#include <util/u_time.h>
#include <pipebuffer/pb_bufmgr.h>
#include "r600_priv.h"
static void r600_bomgr_timeout_flush(struct r600_bomgr *mgr)
{
struct r600_bo *bo, *tmp;
int64_t now;
now = os_time_get();
LIST_FOR_EACH_ENTRY_SAFE(bo, tmp, &mgr->delayed, list) {
if(!os_time_timeout(bo->start, bo->end, now))
break;
mgr->num_delayed--;
bo->manager_id = 0;
LIST_DEL(&bo->list);
r600_bo_destroy(mgr->radeon, bo);
}
}
static INLINE int r600_bo_is_compat(struct r600_bomgr *mgr,
struct r600_bo *bo,
unsigned size,
unsigned alignment,
unsigned cfence)
{
if(bo->size < size) {
return 0;
}
/* be lenient with size */
if(bo->size >= 2*size) {
return 0;
}
if(!pb_check_alignment(alignment, bo->alignment)) {
return 0;
}
if (!fence_is_after(cfence, bo->fence)) {
return 0;
}
return 1;
}
struct r600_bo *r600_bomgr_bo_create(struct r600_bomgr *mgr,
unsigned size,
unsigned alignment,
unsigned cfence)
{
struct r600_bo *bo, *tmp;
int64_t now;
pipe_mutex_lock(mgr->mutex);
now = os_time_get();
LIST_FOR_EACH_ENTRY_SAFE(bo, tmp, &mgr->delayed, list) {
if(r600_bo_is_compat(mgr, bo, size, alignment, cfence)) {
LIST_DEL(&bo->list);
--mgr->num_delayed;
r600_bomgr_timeout_flush(mgr);
pipe_mutex_unlock(mgr->mutex);
LIST_INITHEAD(&bo->list);
pipe_reference_init(&bo->reference, 1);
return bo;
}
if(os_time_timeout(bo->start, bo->end, now)) {
mgr->num_delayed--;
bo->manager_id = 0;
LIST_DEL(&bo->list);
r600_bo_destroy(mgr->radeon, bo);
}
}
pipe_mutex_unlock(mgr->mutex);
return NULL;
}
void r600_bomgr_bo_init(struct r600_bomgr *mgr, struct r600_bo *bo)
{
LIST_INITHEAD(&bo->list);
bo->manager_id = 1;
}
bool r600_bomgr_bo_destroy(struct r600_bomgr *mgr, struct r600_bo *bo)
{
bo->start = os_time_get();
bo->end = bo->start + mgr->usecs;
pipe_mutex_lock(mgr->mutex);
LIST_ADDTAIL(&bo->list, &mgr->delayed);
++mgr->num_delayed;
pipe_mutex_unlock(mgr->mutex);
return FALSE;
}
void r600_bomgr_destroy(struct r600_bomgr *mgr)
{
struct r600_bo *bo, *tmp;
pipe_mutex_lock(mgr->mutex);
LIST_FOR_EACH_ENTRY_SAFE(bo, tmp, &mgr->delayed, list) {
mgr->num_delayed--;
bo->manager_id = 0;
LIST_DEL(&bo->list);
r600_bo_destroy(mgr->radeon, bo);
}
pipe_mutex_unlock(mgr->mutex);
FREE(mgr);
}
struct r600_bomgr *r600_bomgr_create(struct radeon *radeon, unsigned usecs)
{
struct r600_bomgr *mgr;
mgr = CALLOC_STRUCT(r600_bomgr);
if (mgr == NULL)
return NULL;
mgr->radeon = radeon;
mgr->usecs = usecs;
LIST_INITHEAD(&mgr->delayed);
mgr->num_delayed = 0;
pipe_mutex_init(mgr->mutex);
return mgr;
}

View File

@@ -30,7 +30,6 @@
#include <sys/ioctl.h>
#include "util/u_inlines.h"
#include "util/u_debug.h"
#include <pipebuffer/pb_bufmgr.h>
#include "r600.h"
#include "r600_priv.h"
#include "r600_drm_public.h"
@@ -230,12 +229,10 @@ static struct radeon *radeon_new(int fd, unsigned device)
if (radeon_drm_get_tiling(radeon))
return NULL;
}
radeon->kman = radeon_bo_pbmgr_create(radeon);
if (!radeon->kman)
return NULL;
radeon->cman = pb_cache_manager_create(radeon->kman, 1000000);
if (!radeon->cman)
radeon->bomgr = r600_bomgr_create(radeon, 1000000);
if (radeon->bomgr == NULL) {
return NULL;
}
return radeon;
}
@@ -252,11 +249,8 @@ struct radeon *radeon_decref(struct radeon *radeon)
return NULL;
}
if (radeon->cman)
radeon->cman->destroy(radeon->cman);
if (radeon->kman)
radeon->kman->destroy(radeon->kman);
if (radeon->bomgr)
r600_bomgr_destroy(radeon->bomgr);
if (radeon->fd >= 0)
drmClose(radeon->fd);

View File

@@ -28,16 +28,15 @@
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include "xf86drm.h"
#include "r600.h"
#include "r600d.h"
#include "radeon_drm.h"
#include "bof.h"
#include "pipe/p_compiler.h"
#include "util/u_inlines.h"
#include "util/u_memory.h"
#include <pipe/p_compiler.h>
#include <util/u_inlines.h>
#include <util/u_memory.h>
#include <pipebuffer/pb_bufmgr.h>
#include "xf86drm.h"
#include "radeon_drm.h"
#include "r600_priv.h"
#include "bof.h"
#include "r600d.h"
#define GROUP_FORCE_NEW_BLOCK 0
@@ -50,6 +49,7 @@ int r600_context_init_fence(struct r600_context *ctx)
}
ctx->cfence = r600_bo_map(ctx->radeon, ctx->fence_bo, PB_USAGE_UNSYNCHRONIZED, NULL);
*ctx->cfence = 0;
ctx->radeon->cfence = ctx->cfence;
LIST_INITHEAD(&ctx->fenced_bo);
return 0;
}
@@ -814,6 +814,7 @@ void r600_context_bo_reloc(struct r600_context *ctx, u32 *pm4, struct r600_bo *r
ctx->reloc[ctx->creloc].write_domain = rbo->domains & (RADEON_GEM_DOMAIN_GTT | RADEON_GEM_DOMAIN_VRAM);
ctx->reloc[ctx->creloc].flags = 0;
radeon_bo_reference(ctx->radeon, &ctx->bo[ctx->creloc], bo);
rbo->fence = ctx->fence;
ctx->creloc++;
/* set PKT3 to point to proper reloc */
*pm4 = bo->reloc_id;
@@ -836,6 +837,7 @@ void r600_context_pipe_state_set(struct r600_context *ctx, struct r600_pipe_stat
/* find relocation */
id = block->pm4_bo_index[id];
r600_bo_reference(ctx->radeon, &block->reloc[id].bo, state->regs[i].bo);
state->regs[i].bo->fence = ctx->fence;
}
if (!(block->status & R600_BLOCK_STATUS_DIRTY)) {
block->status |= R600_BLOCK_STATUS_ENABLED;
@@ -875,10 +877,13 @@ static inline void r600_context_pipe_state_set_resource(struct r600_context *ctx
*/
r600_bo_reference(ctx->radeon, &block->reloc[1].bo, state->regs[0].bo);
r600_bo_reference(ctx->radeon, &block->reloc[2].bo, state->regs[0].bo);
state->regs[0].bo->fence = ctx->fence;
} else {
/* TEXTURE RESOURCE */
r600_bo_reference(ctx->radeon, &block->reloc[1].bo, state->regs[2].bo);
r600_bo_reference(ctx->radeon, &block->reloc[2].bo, state->regs[3].bo);
state->regs[2].bo->fence = ctx->fence;
state->regs[3].bo->fence = ctx->fence;
}
if (!(block->status & R600_BLOCK_STATUS_DIRTY)) {
block->status |= R600_BLOCK_STATUS_ENABLED;

View File

@@ -30,24 +30,24 @@
#include <stdint.h>
#include <stdlib.h>
#include <assert.h>
#include <pipebuffer/pb_bufmgr.h>
#include "util/u_double_list.h"
#include <util/u_double_list.h>
#include <util/u_inlines.h>
#include <os/os_thread.h>
#include "r600.h"
struct r600_bomgr;
struct radeon {
int fd;
int refcount;
unsigned device;
unsigned family;
enum chip_class chip_class;
struct pb_manager *kman; /* kernel bo manager */
struct pb_manager *cman; /* cached bo manager */
struct r600_tiling_info tiling_info;
struct r600_tiling_info tiling_info;
struct r600_bomgr *bomgr;
unsigned *cfence;
};
struct radeon *r600_new(int fd, unsigned device);
void r600_delete(struct radeon *r600);
struct r600_reg {
unsigned opcode;
unsigned offset_base;
@@ -75,25 +75,49 @@ struct radeon_bo {
struct r600_bo {
struct pipe_reference reference;
struct pb_buffer *pb;
unsigned size;
unsigned tiling_flags;
unsigned kernel_pitch;
unsigned domains;
struct radeon_bo *bo;
unsigned fence;
/* manager data */
struct list_head list;
unsigned manager_id;
unsigned alignment;
unsigned offset;
int64_t start;
int64_t end;
};
struct r600_bomgr {
struct radeon *radeon;
unsigned usecs;
pipe_mutex mutex;
struct list_head delayed;
unsigned num_delayed;
};
/* radeon_pciid.c */
/*
* r600_drm.c
*/
struct radeon *r600_new(int fd, unsigned device);
void r600_delete(struct radeon *r600);
/*
* radeon_pciid.c
*/
unsigned radeon_family_from_device(unsigned device);
/* radeon_bo.c */
/*
* radeon_bo.c
*/
struct radeon_bo *radeon_bo(struct radeon *radeon, unsigned handle,
unsigned size, unsigned alignment);
void radeon_bo_reference(struct radeon *radeon, struct radeon_bo **dst,
struct radeon_bo *src);
int radeon_bo_wait(struct radeon *radeon, struct radeon_bo *bo);
int radeon_bo_busy(struct radeon *radeon, struct radeon_bo *bo, uint32_t *domain);
void radeon_bo_pbmgr_flush_maps(struct pb_manager *_mgr);
int radeon_bo_fencelist(struct radeon *radeon, struct radeon_bo **bolist, uint32_t num_bo);
int radeon_bo_get_tiling_flags(struct radeon *radeon,
struct radeon_bo *bo,
@@ -103,13 +127,9 @@ int radeon_bo_get_name(struct radeon *radeon,
struct radeon_bo *bo,
uint32_t *name);
/* radeon_bo_pb.c */
struct radeon_bo *radeon_bo_pb_get_bo(struct pb_buffer *_buf);
struct pb_manager *radeon_bo_pbmgr_create(struct radeon *radeon);
struct pb_buffer *radeon_bo_pb_create_buffer_from_handle(struct pb_manager *_mgr,
uint32_t handle);
/* r600_hw_context.c */
/*
* r600_hw_context.c
*/
int r600_context_init_fence(struct r600_context *ctx);
void r600_context_bo_reloc(struct r600_context *ctx, u32 *pm4, struct r600_bo *rbo);
void r600_context_bo_flush(struct r600_context *ctx, unsigned flush_flags,
@@ -117,14 +137,27 @@ void r600_context_bo_flush(struct r600_context *ctx, unsigned flush_flags,
struct r600_bo *r600_context_reg_bo(struct r600_context *ctx, unsigned offset);
int r600_context_add_block(struct r600_context *ctx, const struct r600_reg *reg, unsigned nreg);
/* r600_bo.c */
unsigned r600_bo_get_handle(struct r600_bo *bo);
unsigned r600_bo_get_size(struct r600_bo *bo);
static INLINE struct radeon_bo *r600_bo_get_bo(struct r600_bo *bo)
{
return radeon_bo_pb_get_bo(bo->pb);
}
/*
* r600_bo.c
*/
void r600_bo_destroy(struct radeon *radeon, struct r600_bo *bo);
/*
* r600_bomgr.c
*/
struct r600_bomgr *r600_bomgr_create(struct radeon *radeon, unsigned usecs);
void r600_bomgr_destroy(struct r600_bomgr *mgr);
bool r600_bomgr_bo_destroy(struct r600_bomgr *mgr, struct r600_bo *bo);
void r600_bomgr_bo_init(struct r600_bomgr *mgr, struct r600_bo *bo);
struct r600_bo *r600_bomgr_bo_create(struct r600_bomgr *mgr,
unsigned size,
unsigned alignment,
unsigned cfence);
/*
* helpers
*/
#define CTX_RANGE_ID(ctx, offset) (((offset) >> (ctx)->hash_shift) & 255)
#define CTX_BLOCK_ID(ctx, offset) ((offset) & ((1 << (ctx)->hash_shift) - 1))
@@ -172,6 +205,9 @@ static inline void r600_context_block_emit_dirty(struct r600_context *ctx, struc
LIST_DELINIT(&block->list);
}
/*
* radeon_bo.c
*/
static inline int radeon_bo_map(struct radeon *radeon, struct radeon_bo *bo)
{
bo->map_count++;
@@ -184,4 +220,35 @@ static inline void radeon_bo_unmap(struct radeon *radeon, struct radeon_bo *bo)
assert(bo->map_count >= 0);
}
/*
* r600_bo
*/
static inline struct radeon_bo *r600_bo_get_bo(struct r600_bo *bo)
{
return bo->bo;
}
static unsigned inline r600_bo_get_handle(struct r600_bo *bo)
{
return bo->bo->handle;
}
static unsigned inline r600_bo_get_size(struct r600_bo *bo)
{
return bo->size;
}
/*
* fence
*/
static inline bool fence_is_after(unsigned fence, unsigned ofence)
{
/* handle wrap around */
if (fence < 0x80000000 && ofence > 0x80000000)
return TRUE;
if (fence > ofence)
return TRUE;
return FALSE;
}
#endif

View File

@@ -1,260 +0,0 @@
/*
* Copyright 2010 Dave Airlie
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* on the rights to use, copy, modify, merge, publish, distribute, sub
* license, and/or sell copies of the Software, and to permit persons to whom
* the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
* THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
* USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
* Dave Airlie
*/
#include <util/u_inlines.h>
#include <util/u_memory.h>
#include <util/u_double_list.h>
#include <pipebuffer/pb_buffer.h>
#include <pipebuffer/pb_bufmgr.h>
#include "r600_priv.h"
struct radeon_bo_pb {
struct pb_buffer b;
struct radeon_bo *bo;
struct radeon_bo_pbmgr *mgr;
};
extern const struct pb_vtbl radeon_bo_pb_vtbl;
static INLINE struct radeon_bo_pb *radeon_bo_pb(struct pb_buffer *buf)
{
assert(buf);
assert(buf->vtbl == &radeon_bo_pb_vtbl);
return (struct radeon_bo_pb *)buf;
}
struct radeon_bo_pbmgr {
struct pb_manager b;
struct radeon *radeon;
};
static INLINE struct radeon_bo_pbmgr *radeon_bo_pbmgr(struct pb_manager *mgr)
{
assert(mgr);
return (struct radeon_bo_pbmgr *)mgr;
}
static void radeon_bo_pb_destroy(struct pb_buffer *_buf)
{
struct radeon_bo_pb *buf = radeon_bo_pb(_buf);
/* If this buffer is on the list of buffers to unmap,
* do the unmapping now.
*/
radeon_bo_unmap(buf->mgr->radeon, buf->bo);
radeon_bo_reference(buf->mgr->radeon, &buf->bo, NULL);
FREE(buf);
}
static void *
radeon_bo_pb_map_internal(struct pb_buffer *_buf,
unsigned flags, void *ctx)
{
struct radeon_bo_pb *buf = radeon_bo_pb(_buf);
struct pipe_context *pctx = ctx;
if (flags & PB_USAGE_UNSYNCHRONIZED) {
if (radeon_bo_map(buf->mgr->radeon, buf->bo)) {
return NULL;
}
return buf->bo->data;
}
if (p_atomic_read(&buf->bo->reference.count) > 1) {
if (flags & PB_USAGE_DONTBLOCK) {
return NULL;
}
if (ctx) {
pctx->flush(pctx, 0, NULL);
}
}
if (flags & PB_USAGE_DONTBLOCK) {
uint32_t domain;
if (radeon_bo_busy(buf->mgr->radeon, buf->bo, &domain))
return NULL;
if (radeon_bo_map(buf->mgr->radeon, buf->bo)) {
return NULL;
}
goto out;
}
if (radeon_bo_map(buf->mgr->radeon, buf->bo)) {
return NULL;
}
if (radeon_bo_wait(buf->mgr->radeon, buf->bo)) {
radeon_bo_unmap(buf->mgr->radeon, buf->bo);
return NULL;
}
out:
return buf->bo->data;
}
static void radeon_bo_pb_unmap_internal(struct pb_buffer *_buf)
{
}
static void
radeon_bo_pb_get_base_buffer(struct pb_buffer *buf,
struct pb_buffer **base_buf,
unsigned *offset)
{
*base_buf = buf;
*offset = 0;
}
static enum pipe_error
radeon_bo_pb_validate(struct pb_buffer *_buf,
struct pb_validate *vl,
unsigned flags)
{
/* Always pinned */
return PIPE_OK;
}
static void
radeon_bo_pb_fence(struct pb_buffer *buf,
struct pipe_fence_handle *fence)
{
}
const struct pb_vtbl radeon_bo_pb_vtbl = {
radeon_bo_pb_destroy,
radeon_bo_pb_map_internal,
radeon_bo_pb_unmap_internal,
radeon_bo_pb_validate,
radeon_bo_pb_fence,
radeon_bo_pb_get_base_buffer,
};
struct pb_buffer *
radeon_bo_pb_create_buffer_from_handle(struct pb_manager *_mgr,
uint32_t handle)
{
struct radeon_bo_pbmgr *mgr = radeon_bo_pbmgr(_mgr);
struct radeon *radeon = mgr->radeon;
struct radeon_bo_pb *bo;
struct radeon_bo *hw_bo;
hw_bo = radeon_bo(radeon, handle, 0, 0);
if (hw_bo == NULL)
return NULL;
bo = CALLOC_STRUCT(radeon_bo_pb);
if (!bo) {
radeon_bo_reference(radeon, &hw_bo, NULL);
return NULL;
}
pipe_reference_init(&bo->b.base.reference, 1);
bo->b.base.alignment = 0;
bo->b.base.usage = PB_USAGE_GPU_WRITE | PB_USAGE_GPU_READ;
bo->b.base.size = hw_bo->size;
bo->b.vtbl = &radeon_bo_pb_vtbl;
bo->mgr = mgr;
bo->bo = hw_bo;
return &bo->b;
}
static struct pb_buffer *
radeon_bo_pb_create_buffer(struct pb_manager *_mgr,
pb_size size,
const struct pb_desc *desc)
{
struct radeon_bo_pbmgr *mgr = radeon_bo_pbmgr(_mgr);
struct radeon *radeon = mgr->radeon;
struct radeon_bo_pb *bo;
bo = CALLOC_STRUCT(radeon_bo_pb);
if (!bo)
goto error1;
pipe_reference_init(&bo->b.base.reference, 1);
bo->b.base.alignment = desc->alignment;
bo->b.base.usage = desc->usage;
bo->b.base.size = size;
bo->b.vtbl = &radeon_bo_pb_vtbl;
bo->mgr = mgr;
bo->bo = radeon_bo(radeon, 0, size, desc->alignment);
if (bo->bo == NULL)
goto error2;
return &bo->b;
error2:
FREE(bo);
error1:
return NULL;
}
static void
radeon_bo_pbmgr_flush(struct pb_manager *mgr)
{
/* NOP */
}
static void
radeon_bo_pbmgr_destroy(struct pb_manager *_mgr)
{
struct radeon_bo_pbmgr *mgr = radeon_bo_pbmgr(_mgr);
FREE(mgr);
}
struct pb_manager *radeon_bo_pbmgr_create(struct radeon *radeon)
{
struct radeon_bo_pbmgr *mgr;
mgr = CALLOC_STRUCT(radeon_bo_pbmgr);
if (!mgr)
return NULL;
mgr->b.destroy = radeon_bo_pbmgr_destroy;
mgr->b.create_buffer = radeon_bo_pb_create_buffer;
mgr->b.flush = radeon_bo_pbmgr_flush;
mgr->radeon = radeon;
return &mgr->b;
}
struct radeon_bo *radeon_bo_pb_get_bo(struct pb_buffer *_buf)
{
struct radeon_bo_pb *buf;
if (_buf->vtbl == &radeon_bo_pb_vtbl) {
buf = radeon_bo_pb(_buf);
return buf->bo;
} else {
struct pb_buffer *base_buf;
pb_size offset;
pb_get_base_buffer(_buf, &base_buf, &offset);
if (base_buf->vtbl == &radeon_bo_pb_vtbl) {
buf = radeon_bo_pb(base_buf);
return buf->bo;
}
}
return NULL;
}

View File

@@ -1,39 +0,0 @@
ifeq ($(strip $(MESA_BUILD_VMWGFX)),true)
LOCAL_PATH := $(call my-dir)
# from drm/Makefile
C_SOURCES = \
vmw_buffer.c \
vmw_context.c \
vmw_fence.c \
vmw_screen.c \
vmw_screen_dri.c \
vmw_screen_ioctl.c \
vmw_screen_pools.c \
vmw_screen_svga.c \
vmw_surface.c
include $(CLEAR_VARS)
LOCAL_SRC_FILES := \
$(addprefix drm/, $(C_SOURCES))
LOCAL_CFLAGS := \
-fvisibility=hidden \
-Wno-sign-compare
LOCAL_C_INCLUDES := \
external/mesa/include \
external/mesa/src/gallium/include \
external/mesa/src/gallium/auxiliary \
external/mesa/src/gallium/drivers/svga \
external/mesa/src/gallium/drivers/svga/include \
external/drm \
external/drm/include/drm
LOCAL_MODULE := libmesa_winsys_svga
include $(BUILD_STATIC_LIBRARY)
endif # MESA_BUILD_VMWGFX

View File

@@ -46,24 +46,6 @@
#include <errno.h>
#include <unistd.h>
#ifdef PIPE_OS_ANDROID
extern void* __mmap2(void*, size_t, int, int, int, size_t);
#define MMAP2_SHIFT 12
static INLINE void* vmw_mmap(void *addr, size_t size, int prot, int flags, int fd, unsigned long long offset)
{
if ( offset & ((1UL << MMAP2_SHIFT)-1) ) {
errno = EINVAL;
return MAP_FAILED;
}
return __mmap2(addr, size, prot, flags, fd, (size_t)(offset >> MMAP2_SHIFT));
}
#else
#define vmw_mmap(addr, size, prot, flags, fd, offset) mmap(addr, size, prot, flags, fd, offset)
#endif
struct vmw_region
{
SVGAGuestPtr ptr;
@@ -124,7 +106,7 @@ vmw_ioctl_fifo_map(struct vmw_winsys_screen *vws,
VMW_FUNC;
map = vmw_mmap(NULL, getpagesize(), PROT_READ, MAP_SHARED,
map = mmap(NULL, getpagesize(), PROT_READ, MAP_SHARED,
vws->ioctl.drm_fd, fifo_offset);
if (map == MAP_FAILED) {
@@ -406,7 +388,7 @@ vmw_ioctl_region_map(struct vmw_region *region)
region->ptr.gmrId, region->ptr.offset);
if (region->data == NULL) {
map = vmw_mmap(NULL, region->size, PROT_READ | PROT_WRITE, MAP_SHARED,
map = mmap(NULL, region->size, PROT_READ | PROT_WRITE, MAP_SHARED,
region->drm_fd, region->map_handle);
if (map == MAP_FAILED) {
debug_printf("%s: Map failed.\n", __FUNCTION__);

View File

@@ -1,19 +0,0 @@
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_SRC_FILES := \
android/android_sw_winsys.cpp
LOCAL_CFLAGS := \
-fvisibility=hidden \
-Wno-sign-compare
LOCAL_C_INCLUDES := \
external/mesa/include \
external/mesa/src/gallium/include \
external/mesa/src/gallium/auxiliary
LOCAL_MODULE := libmesa_winsys_sw
include $(BUILD_STATIC_LIBRARY)

View File

@@ -1,269 +0,0 @@
/*
* Mesa 3-D graphics library
* Version: 7.9
*
* Copyright (C) 2010 LunarG Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
* Authors:
* Chia-I Wu <olv@lunarg.com>
*/
#include "pipe/p_compiler.h"
#include "pipe/p_state.h"
#include "util/u_memory.h"
#include "util/u_format.h"
#include "state_tracker/sw_winsys.h"
#include <ui/PixelFormat.h>
#include <private/ui/sw_gralloc_handle.h>
#include <hardware/gralloc.h>
#include "android_sw_winsys.h"
struct android_sw_winsys
{
struct sw_winsys base;
const gralloc_module_t *grmod;
};
struct android_sw_displaytarget
{
buffer_handle_t handle;
int stride;
int width, height, usage;
void *mapped;
};
static INLINE struct android_sw_winsys *
android_sw_winsys(struct sw_winsys *ws)
{
return (struct android_sw_winsys *) ws;
}
static INLINE struct android_sw_displaytarget *
android_sw_displaytarget(struct sw_displaytarget *dt)
{
return (struct android_sw_displaytarget *) dt;
}
namespace android {
static void
android_displaytarget_display(struct sw_winsys *ws,
struct sw_displaytarget *dt,
void *context_private)
{
}
static struct sw_displaytarget *
android_displaytarget_create(struct sw_winsys *ws,
unsigned tex_usage,
enum pipe_format format,
unsigned width, unsigned height,
unsigned alignment,
unsigned *stride)
{
return NULL;
}
static void
android_displaytarget_destroy(struct sw_winsys *ws,
struct sw_displaytarget *dt)
{
struct android_sw_displaytarget *adt = android_sw_displaytarget(dt);
assert(!adt->mapped);
FREE(adt);
}
static void
android_displaytarget_unmap(struct sw_winsys *ws,
struct sw_displaytarget *dt)
{
struct android_sw_winsys *droid = android_sw_winsys(ws);
struct android_sw_displaytarget *adt = android_sw_displaytarget(dt);
if (adt->mapped) {
if (sw_gralloc_handle_t::validate(adt->handle) >= 0) {
adt->mapped = NULL;
}
else {
droid->grmod->unlock(droid->grmod, adt->handle);
adt->mapped = NULL;
}
}
}
static void *
android_displaytarget_map(struct sw_winsys *ws,
struct sw_displaytarget *dt,
unsigned flags)
{
struct android_sw_winsys *droid = android_sw_winsys(ws);
struct android_sw_displaytarget *adt = android_sw_displaytarget(dt);
if (!adt->mapped) {
if (sw_gralloc_handle_t::validate(adt->handle) >= 0) {
const sw_gralloc_handle_t *swhandle =
reinterpret_cast<const sw_gralloc_handle_t *>(adt->handle);
adt->mapped = reinterpret_cast<void *>(swhandle->base);
}
else {
droid->grmod->lock(droid->grmod, adt->handle,
adt->usage, 0, 0, adt->width, adt->height, &adt->mapped);
}
}
return adt->mapped;
}
static struct sw_displaytarget *
android_displaytarget_from_handle(struct sw_winsys *ws,
const struct pipe_resource *templ,
struct winsys_handle *whandle,
unsigned *stride)
{
struct android_winsys_handle *ahandle =
(struct android_winsys_handle *) whandle;
struct android_sw_displaytarget *adt;
adt = CALLOC_STRUCT(android_sw_displaytarget);
if (!adt)
return NULL;
adt->handle = ahandle->handle;
adt->stride = ahandle->stride;
adt->width = templ->width0;
adt->height = templ->height0;
if (templ->usage & PIPE_BIND_RENDER_TARGET)
adt->usage |= GRALLOC_USAGE_HW_RENDER;
if (templ->usage & PIPE_BIND_SAMPLER_VIEW)
adt->usage |= GRALLOC_USAGE_HW_TEXTURE;
if (templ->usage & PIPE_BIND_SCANOUT)
adt->usage |= GRALLOC_USAGE_HW_FB;
if (templ->usage & PIPE_BIND_TRANSFER_READ)
adt->usage |= GRALLOC_USAGE_SW_READ_OFTEN;
if (templ->usage & PIPE_BIND_TRANSFER_WRITE)
adt->usage |= GRALLOC_USAGE_SW_WRITE_OFTEN;
if (stride)
*stride = adt->stride;
return reinterpret_cast<struct sw_displaytarget *>(adt);
}
static boolean
android_displaytarget_get_handle(struct sw_winsys *ws,
struct sw_displaytarget *dt,
struct winsys_handle *whandle)
{
return FALSE;
}
static boolean
android_is_displaytarget_format_supported(struct sw_winsys *ws,
unsigned tex_usage,
enum pipe_format format)
{
struct android_sw_winsys *droid = android_sw_winsys(ws);
int fmt;
switch (format) {
case PIPE_FORMAT_R8G8B8A8_UNORM:
fmt = PIXEL_FORMAT_RGBA_8888;
break;
case PIPE_FORMAT_R8G8B8X8_UNORM:
fmt = PIXEL_FORMAT_RGBX_8888;
break;
case PIPE_FORMAT_R8G8B8_UNORM:
fmt = PIXEL_FORMAT_RGB_888;
break;
case PIPE_FORMAT_B5G6R5_UNORM:
fmt = PIXEL_FORMAT_RGB_565;
break;
case PIPE_FORMAT_B8G8R8A8_UNORM:
fmt = PIXEL_FORMAT_BGRA_8888;
break;
case PIPE_FORMAT_A8_UNORM:
fmt = PIXEL_FORMAT_A_8;
break;
case PIPE_FORMAT_L8_UNORM:
fmt = PIXEL_FORMAT_L_8;
break;
case PIPE_FORMAT_L8A8_UNORM:
fmt = PIXEL_FORMAT_LA_88;
break;
default:
fmt = PIXEL_FORMAT_NONE;
break;
}
return (fmt != PIXEL_FORMAT_NONE);
}
static void
android_destroy(struct sw_winsys *ws)
{
struct android_sw_winsys *droid = android_sw_winsys(ws);
FREE(droid);
}
}; /* namespace android */
using namespace android;
struct sw_winsys *
android_create_sw_winsys(void)
{
struct android_sw_winsys *droid;
const hw_module_t *mod;
droid = CALLOC_STRUCT(android_sw_winsys);
if (!droid)
return NULL;
if (hw_get_module(GRALLOC_HARDWARE_MODULE_ID, &mod)) {
FREE(droid);
return NULL;
}
droid->grmod = (const gralloc_module_t *) mod;
droid->base.destroy = android_destroy;
droid->base.is_displaytarget_format_supported =
android_is_displaytarget_format_supported;
droid->base.displaytarget_create = android_displaytarget_create;
droid->base.displaytarget_destroy = android_displaytarget_destroy;
droid->base.displaytarget_from_handle = android_displaytarget_from_handle;
droid->base.displaytarget_get_handle = android_displaytarget_get_handle;
droid->base.displaytarget_map = android_displaytarget_map;
droid->base.displaytarget_unmap = android_displaytarget_unmap;
droid->base.displaytarget_display = android_displaytarget_display;
return &droid->base;
}

View File

@@ -1,49 +0,0 @@
/*
* Mesa 3-D graphics library
* Version: 7.9
*
* Copyright (C) 2010 LunarG Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
* Authors:
* Chia-I Wu <olv@lunarg.com>
*/
#ifndef ANDROID_SW_WINSYS
#define ANDROID_SW_WINSYS
#include <sys/cdefs.h>
#include <hardware/gralloc.h>
__BEGIN_DECLS
struct sw_winsys;
struct android_winsys_handle {
buffer_handle_t handle;
int stride;
};
struct sw_winsys *
android_create_sw_winsys(void);
__END_DECLS
#endif /* ANDROID_SW_WINSYS */

View File

@@ -1,96 +0,0 @@
LOCAL_PATH := $(call my-dir)
# from Makefile
LIBGLCPP_SOURCES = \
glcpp/glcpp-lex.c \
glcpp/glcpp-parse.c \
glcpp/pp.c
C_SOURCES = \
$(LIBGLCPP_SOURCES)
CXX_SOURCES = \
ast_expr.cpp \
ast_function.cpp \
ast_to_hir.cpp \
ast_type.cpp \
builtin_function.cpp \
glsl_lexer.cpp \
glsl_parser.cpp \
glsl_parser_extras.cpp \
glsl_types.cpp \
glsl_symbol_table.cpp \
hir_field_selection.cpp \
ir_basic_block.cpp \
ir_clone.cpp \
ir_constant_expression.cpp \
ir.cpp \
ir_expression_flattening.cpp \
ir_function_can_inline.cpp \
ir_function.cpp \
ir_hierarchical_visitor.cpp \
ir_hv_accept.cpp \
ir_import_prototypes.cpp \
ir_print_visitor.cpp \
ir_reader.cpp \
ir_rvalue_visitor.cpp \
ir_set_program_inouts.cpp \
ir_validate.cpp \
ir_variable.cpp \
ir_variable_refcount.cpp \
linker.cpp \
link_functions.cpp \
loop_analysis.cpp \
loop_controls.cpp \
loop_unroll.cpp \
lower_discard.cpp \
lower_if_to_cond_assign.cpp \
lower_instructions.cpp \
lower_jumps.cpp \
lower_mat_op_to_vec.cpp \
lower_noise.cpp \
lower_texture_projection.cpp \
lower_variable_index_to_cond_assign.cpp \
lower_vec_index_to_cond_assign.cpp \
lower_vec_index_to_swizzle.cpp \
lower_vector.cpp \
opt_algebraic.cpp \
opt_constant_folding.cpp \
opt_constant_propagation.cpp \
opt_constant_variable.cpp \
opt_copy_propagation.cpp \
opt_dead_code.cpp \
opt_dead_code_local.cpp \
opt_dead_functions.cpp \
opt_discard_simplification.cpp \
opt_function_inlining.cpp \
opt_if_simplification.cpp \
opt_noop_swizzle.cpp \
opt_redundant_jumps.cpp \
opt_structure_splitting.cpp \
opt_swizzle_swizzle.cpp \
opt_tree_grafting.cpp \
s_expression.cpp
include $(CLEAR_VARS)
LOCAL_SRC_FILES := \
$(C_SOURCES) \
$(CXX_SOURCES)
LOCAL_CFLAGS := \
-DPTHREADS \
-fvisibility=hidden \
-Wno-sign-compare \
-Wno-error=non-virtual-dtor \
-Wno-non-virtual-dtor
LOCAL_C_INCLUDES := \
external/mesa/include \
external/mesa/src/mapi \
external/mesa/src/talloc \
external/mesa/src/mesa
LOCAL_MODULE := libmesa_glsl
include $(BUILD_STATIC_LIBRARY)

View File

@@ -129,7 +129,6 @@ protected:
* be created.
*/
ast_node(void);
virtual ~ast_node() {}
};

View File

@@ -131,7 +131,6 @@ protected:
ir_type = ir_type_unset;
type = NULL;
}
virtual ~ir_instruction() {}
};

View File

@@ -77,7 +77,6 @@ enum ir_visitor_status {
class ir_hierarchical_visitor {
public:
ir_hierarchical_visitor();
virtual ~ir_hierarchical_visitor() {}
/**
* \name Visit methods for leaf-node classes

View File

@@ -21,9 +21,9 @@
* DEALINGS IN THE SOFTWARE.
*/
#include <cstdarg>
extern "C" {
#include <stdarg.h>
#include <talloc.h>
}

View File

@@ -66,7 +66,7 @@ public:
};
static void
mark(struct gl_program *prog, ir_variable *var, int index)
mark(struct gl_program *prog, ir_variable *var, int offset, int len)
{
/* As of GLSL 1.20, varyings can only be floats, floating-point
* vectors or matrices, or arrays of them. For Mesa programs using
@@ -75,25 +75,12 @@ mark(struct gl_program *prog, ir_variable *var, int index)
* something doing a more clever packing would use something other
* than InputsRead/OutputsWritten.
*/
const glsl_type *element_type;
int element_size;
if (var->type->is_array())
element_type = var->type->fields.array;
else
element_type = var->type;
if (element_type->is_matrix())
element_size = element_type->matrix_columns;
else
element_size = 1;
index *= element_size;
for (int i = 0; i < element_size; i++) {
for (int i = 0; i < len; i++) {
if (var->mode == ir_var_in)
prog->InputsRead |= BITFIELD64_BIT(var->location + index + i);
prog->InputsRead |= BITFIELD64_BIT(var->location + offset + i);
else
prog->OutputsWritten |= BITFIELD64_BIT(var->location + index + i);
prog->OutputsWritten |= BITFIELD64_BIT(var->location + offset + i);
}
}
@@ -106,10 +93,11 @@ ir_set_program_inouts_visitor::visit(ir_dereference_variable *ir)
if (ir->type->is_array()) {
for (unsigned int i = 0; i < ir->type->length; i++) {
mark(this->prog, ir->var, i);
mark(this->prog, ir->var, i,
ir->type->length * ir->type->fields.array->matrix_columns);
}
} else {
mark(this->prog, ir->var, 0);
mark(this->prog, ir->var, 0, ir->type->matrix_columns);
}
return visit_continue;
@@ -128,7 +116,14 @@ ir_set_program_inouts_visitor::visit_enter(ir_dereference_array *ir)
var = (ir_variable *)hash_table_find(this->ht, deref_var->var);
if (index && var) {
mark(this->prog, var, index->value.i[0]);
int width = 1;
if (deref_var->type->is_array() &&
deref_var->type->fields.array->is_matrix()) {
width = deref_var->type->fields.array->matrix_columns;
}
mark(this->prog, var, index->value.i[0] * width, width);
return visit_continue_with_parent;
}

View File

@@ -23,9 +23,9 @@
#include <cstdlib>
#include <cstdio>
#include <cstdarg>
extern "C" {
#include <stdarg.h>
#include <talloc.h>
}

View File

@@ -65,10 +65,10 @@
*/
#include <cstdlib>
#include <cstdio>
#include <cstdarg>
#include <climits>
extern "C" {
#include <stdarg.h>
#include <talloc.h>
}

View File

@@ -43,6 +43,14 @@ public:
};
static bool
is_break(ir_instruction *ir)
{
return ir != NULL && ir->ir_type == ir_type_loop_jump
&& ((ir_loop_jump *) ir)->is_break();
}
ir_visitor_status
loop_unroll_visitor::visit_leave(ir_loop *ir)
{
@@ -73,44 +81,74 @@ loop_unroll_visitor::visit_leave(ir_loop *ir)
if (ls->num_loop_jumps > 1)
return visit_continue;
else if (ls->num_loop_jumps) {
/* recognize loops in the form produced by ir_lower_jumps */
ir_instruction *last_ir =
((ir_instruction*)ir->body_instructions.get_tail());
ir_instruction *last_ir = (ir_instruction *) ir->body_instructions.get_tail();
assert(last_ir != NULL);
ir_if *last_if = last_ir->as_if();
if (last_if) {
bool continue_from_then_branch;
if (is_break(last_ir)) {
/* If the only loop-jump is a break at the end of the loop, the loop
* will execute exactly once. Remove the break, set the iteration
* count, and fall through to the normal unroller.
*/
last_ir->remove();
iterations = 1;
/* Determine which if-statement branch, if any, ends with a break.
* The branch that did *not* have the break will get a temporary
* continue inserted in each iteration of the loop unroll.
*
* Note that since ls->num_loop_jumps is <= 1, it is impossible for
* both branches to end with a break.
*/
ir_instruction *last =
(ir_instruction *) last_if->then_instructions.get_tail();
this->progress = true;
} else {
ir_if *ir_if = NULL;
ir_instruction *break_ir = NULL;
bool continue_from_then_branch = false;
if (last && last->ir_type == ir_type_loop_jump
&& ((ir_loop_jump*) last)->is_break()) {
continue_from_then_branch = false;
} else {
last = (ir_instruction *) last_if->then_instructions.get_tail();
foreach_list(node, &ir->body_instructions) {
/* recognize loops in the form produced by ir_lower_jumps */
ir_instruction *cur_ir = (ir_instruction *) node;
if (last && last->ir_type == ir_type_loop_jump
&& ((ir_loop_jump*) last)->is_break())
continue_from_then_branch = true;
else
/* Bail out if neither if-statement branch ends with a break.
ir_if = cur_ir->as_if();
if (ir_if != NULL) {
/* Determine which if-statement branch, if any, ends with a
* break. The branch that did *not* have the break will get a
* temporary continue inserted in each iteration of the loop
* unroll.
*
* Note that since ls->num_loop_jumps is <= 1, it is impossible
* for both branches to end with a break.
*/
return visit_continue;
}
ir_instruction *ir_if_last =
(ir_instruction *) ir_if->then_instructions.get_tail();
/* Remove the break from the if-statement.
*/
last->remove();
if (is_break(ir_if_last)) {
continue_from_then_branch = false;
break_ir = ir_if_last;
break;
} else {
ir_if_last =
(ir_instruction *) ir_if->else_instructions.get_tail();
if (is_break(ir_if_last)) {
break_ir = ir_if_last;
continue_from_then_branch = true;
break;
}
}
}
}
if (break_ir == NULL)
return visit_continue;
/* move instructions after then if in the continue branch */
while (!ir_if->get_next()->is_tail_sentinel()) {
ir_instruction *move_ir = (ir_instruction *) ir_if->get_next();
move_ir->remove();
if (continue_from_then_branch)
ir_if->then_instructions.push_tail(move_ir);
else
ir_if->else_instructions.push_tail(move_ir);
}
/* Remove the break from the if-statement.
*/
break_ir->remove();
void *const mem_ctx = talloc_parent(ir);
ir_instruction *ir_to_replace = ir;
@@ -121,8 +159,8 @@ loop_unroll_visitor::visit_leave(ir_loop *ir)
copy_list.make_empty();
clone_ir_list(mem_ctx, &copy_list, &ir->body_instructions);
last_if = ((ir_instruction*)copy_list.get_tail())->as_if();
assert(last_if);
ir_if = ((ir_instruction *) copy_list.get_tail())->as_if();
assert(ir_if != NULL);
ir_to_replace->insert_before(&copy_list);
ir_to_replace->remove();
@@ -132,7 +170,7 @@ loop_unroll_visitor::visit_leave(ir_loop *ir)
new(mem_ctx) ir_loop_jump(ir_loop_jump::jump_continue);
exec_list *const list = (continue_from_then_branch)
? &last_if->then_instructions : &last_if->else_instructions;
? &ir_if->then_instructions : &ir_if->else_instructions;
list->push_tail(ir_to_replace);
}
@@ -141,18 +179,7 @@ loop_unroll_visitor::visit_leave(ir_loop *ir)
this->progress = true;
return visit_continue;
} else if (last_ir->ir_type == ir_type_loop_jump
&& ((ir_loop_jump *)last_ir)->is_break()) {
/* If the only loop-jump is a break at the end of the loop, the loop
* will execute exactly once. Remove the break, set the iteration
* count, and fall through to the normal unroller.
*/
last_ir->remove();
iterations = 1;
this->progress = true;
} else
return visit_continue;
}
}
void *const mem_ctx = talloc_parent(ir);

View File

@@ -512,7 +512,11 @@ lower_continue:
if(this->loop.may_set_return_flag) {
assert(this->function.return_flag);
ir_if* return_if = new(ir) ir_if(new(ir) ir_dereference_variable(this->function.return_flag));
return_if->then_instructions.push_tail(new(ir) ir_loop_jump(saved_loop.loop ? ir_loop_jump::jump_break : ir_loop_jump::jump_continue));
saved_loop.may_set_return_flag = true;
if(saved_loop.loop)
return_if->then_instructions.push_tail(new(ir) ir_loop_jump(ir_loop_jump::jump_break));
else
move_outer_block_inside(ir, &return_if->else_instructions);
ir->insert_after(return_if);
}

View File

@@ -1,54 +0,0 @@
LOCAL_PATH := $(call my-dir)
common_SRC_FILES := \
gralloc_gem.c \
gralloc_kms.c \
gralloc_mod.c
common_C_INCLUDES := \
external/drm \
external/drm/include/drm
common_SHARED_LIBRARIES := \
libdrm \
liblog \
libcutils
ifeq ($(strip $(MESA_BUILD_I915)),true)
include $(CLEAR_VARS)
LOCAL_SRC_FILES := \
$(common_SRC_FILES) \
gralloc_gem_i915.c
LOCAL_C_INCLUDES := \
$(common_C_INCLUDES) \
external/drm/intel
LOCAL_SHARED_LIBRARIES := \
$(common_SHARED_LIBRARIES) \
libdrm_intel \
libEGL
LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw
LOCAL_MODULE := gralloc.i915
include $(BUILD_SHARED_LIBRARY)
endif # MESA_BUILD_I915
ifeq ($(strip $(MESA_BUILD_GALLIUM)),true)
include $(CLEAR_VARS)
LOCAL_SRC_FILES := \
$(common_SRC_FILES) \
gralloc_gem_pipe.c
LOCAL_C_INCLUDES := \
$(common_C_INCLUDES) \
external/mesa/src/gallium/include \
external/mesa/src/gallium/auxiliary
LOCAL_MODULE := libmesa_st_gralloc
include $(BUILD_STATIC_LIBRARY)
endif # MESA_BUILD_GALLIUM

View File

@@ -1,119 +0,0 @@
#define LOG_TAG "GRALLOC-GEM"
#include <cutils/log.h>
#include <cutils/atomic.h>
#include <stdlib.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include "gralloc_mod.h"
#include "gralloc_gem.h"
#define unlikely(x) __builtin_expect(!!(x), 0)
#define DRM_PATH "/dev/dri/card0"
static int32_t drm_gem_pid = 0;
static int
drm_gem_get_pid(void)
{
if (unlikely(!drm_gem_pid))
android_atomic_write((int32_t) getpid(), &drm_gem_pid);
return drm_gem_pid;
}
static int
drm_gem_init_locked(struct drm_module_t *drm)
{
int ret;
if (drm->fd >= 0)
return 0;
drm->fd = open(DRM_PATH, O_RDWR);
if (drm->fd < 0) {
LOGE("failed to open %s", DRM_PATH);
return -EINVAL;
}
return 0;
}
int
drm_gem_init(struct drm_module_t *drm)
{
int ret;
pthread_mutex_lock(&drm->mutex);
ret = drm_gem_init_locked(drm);
pthread_mutex_unlock(&drm->mutex);
return ret;
}
int
drm_gem_get_magic(struct drm_module_t *drm, int32_t *magic)
{
int ret;
ret = drm_gem_init(drm);
if (ret)
return ret;
return drmGetMagic(drm->fd, (drm_magic_t *) magic);
}
int
drm_gem_auth_magic(struct drm_module_t *drm, int32_t magic)
{
int ret;
ret = drm_gem_init(drm);
if (ret)
return ret;
return drmAuthMagic(drm->fd, (drm_magic_t) magic);
}
struct drm_bo_t *
drm_gem_create_bo(int width, int height, int format, int usage)
{
struct drm_bo_t *bo;
bo = calloc(1, sizeof(*bo));
if (!bo)
return NULL;
bo->base.version = sizeof(bo->base);
bo->base.numInts = DRM_HANDLE_NUM_INTS;
bo->base.numFds = DRM_HANDLE_NUM_FDS;
bo->magic = DRM_HANDLE_MAGIC;
bo->width = width;
bo->height = height;
bo->format = format;
bo->usage = usage;
bo->pid = drm_gem_get_pid();
return bo;
}
struct drm_bo_t *
drm_gem_validate(buffer_handle_t handle)
{
struct drm_bo_t *bo = drm_gem_get(handle);
if (bo && unlikely(bo->pid != drm_gem_pid)) {
bo->pid = drm_gem_get_pid();
bo->fb_handle = 0;
bo->fb_id = 0;
bo->data = 0;
}
return bo;
}

View File

@@ -1,77 +0,0 @@
#ifndef _GRALLOC_GEM_H_
#define _GRALLOC_GEM_H_
#include <cutils/native_handle.h>
#include "gralloc_mod.h"
struct drm_bo_t {
native_handle_t base;
#define DRM_HANDLE_MAGIC 0x12345678
#define DRM_HANDLE_NUM_INTS 11
#define DRM_HANDLE_NUM_FDS 0
int magic;
int width;
int height;
int format;
int usage;
int name;
int stride;
/* these fields are undefined until validated */
int pid;
int fb_handle;
int fb_id;
int data; /* pointer as int? 32-bit only! */
};
int
drm_gem_init(struct drm_module_t *drm);
int
drm_gem_get_magic(struct drm_module_t *drm, int32_t *magic);
int
drm_gem_auth_magic(struct drm_module_t *drm, int32_t magic);
static inline struct drm_bo_t *
drm_gem_get(buffer_handle_t handle)
{
struct drm_bo_t *bo = (struct drm_bo_t *) handle;
if (bo->base.version != sizeof(bo->base) ||
bo->base.numInts != DRM_HANDLE_NUM_INTS ||
bo->base.numFds != DRM_HANDLE_NUM_FDS ||
bo->magic != DRM_HANDLE_MAGIC)
bo = NULL;
return bo;
}
struct drm_bo_t *
drm_gem_validate(buffer_handle_t handle);
struct drm_bo_t *
drm_gem_create_bo(int width, int height, int format, int usage);
int
drm_gem_drv_init(struct drm_module_t *drm);
struct drm_bo_t *
drm_gem_drv_alloc(struct drm_module_t *drm, int width, int height,
int format, int usage, int *stride);
void
drm_gem_drv_free(struct drm_module_t *drm, struct drm_bo_t *bo);
int
drm_gem_drv_map(struct drm_module_t *drm, struct drm_bo_t *bo,
int x, int y, int w, int h, int enable_write, void **addr);
void
drm_gem_drv_unmap(struct drm_module_t *drm, struct drm_bo_t *bo);
#endif /* _GRALLOC_GEM_H_ */

View File

@@ -1,211 +0,0 @@
#define LOG_TAG "GRALLOC-I915"
#include <cutils/log.h>
#include <stdlib.h>
#include <errno.h>
#include <drm.h>
#include <intel_bufmgr.h>
#include <i915_drm.h>
#include "gralloc_mod.h"
#include "gralloc_gem.h"
static void
drm_gem_drv_init_features_locked(struct drm_module_t *drm)
{
struct drm_i915_getparam gp;
drm_intel_bufmgr *bufmgr = (drm_intel_bufmgr *) drm->gem;
drm->mode_dirty_fb = 0;
memset(&gp, 0, sizeof(gp));
gp.param = I915_PARAM_HAS_PAGEFLIPPING;
gp.value = &drm->mode_page_flip;
if (!drmCommandWriteRead(drm->fd, DRM_I915_GETPARAM, &gp, sizeof(gp)))
drm->mode_page_flip = *gp.value;
else
drm->mode_page_flip = 0;
if (drm->resources) {
int pipe;
pipe = drm_intel_get_pipe_from_crtc_id(bufmgr, drm->crtc_id);
drm->swap_interval = (pipe >= 0) ? 1 : 0;
drm->vblank_secondary = (pipe > 0);
}
else {
drm->swap_interval = 0;
}
/* XXX there is a bug in the kernel module */
drm->mode_page_flip = 0;
}
static int
drm_gem_drv_init_locked(struct drm_module_t *drm)
{
if (drm->gem)
return 0;
drm->gem = (void *) drm_intel_bufmgr_gem_init(drm->fd, 16 * 1024);
if (!drm->gem) {
LOGE("failed to create buffer manager");
return -ENOMEM;
}
drm_gem_drv_init_features_locked(drm);
return 0;
}
int
drm_gem_drv_init(struct drm_module_t *drm)
{
int ret;
pthread_mutex_lock(&drm->mutex);
ret = drm_gem_drv_init_locked(drm);
pthread_mutex_unlock(&drm->mutex);
return ret;
}
static uint32_t
drm_gem_get_tiling(struct drm_bo_t *bo)
{
uint32_t tiling = I915_TILING_NONE;
if (bo->usage & GRALLOC_USAGE_SW_READ_OFTEN)
return tiling;
if (bo->usage & GRALLOC_USAGE_HW_FB ||
bo->usage & GRALLOC_USAGE_HW_TEXTURE) {
if (bo->width >= 64)
tiling = I915_TILING_X;
}
return tiling;
}
struct drm_bo_t *
drm_gem_drv_alloc(struct drm_module_t *drm, int width, int height,
int format, int usage, int *stride)
{
drm_intel_bufmgr *bufmgr = (drm_intel_bufmgr *) drm->gem;
struct drm_bo_t *bo;
drm_intel_bo *ibo;
int aligned_width, aligned_height, cpp;
unsigned long pitch, flags;
uint32_t tiling;
const char *name;
bo = drm_gem_create_bo(width, height, format, usage);
if (!bo)
return NULL;
cpp = drm_mod_get_bpp(format);
if (!cpp) {
LOGE("unrecognized format 0x%x", format);
free(bo);
return NULL;
}
if (usage & GRALLOC_USAGE_HW_FB) {
name = "gralloc-fb";
aligned_width = (width + 63) & ~63;
}
if (usage & GRALLOC_USAGE_HW_TEXTURE) {
name = "gralloc-texture";
aligned_width = (width + 3) & ~3;
aligned_height = (height + 1) & ~1;
}
else {
name = "gralloc-buf";
aligned_width = width;
aligned_height = height;
}
tiling = drm_gem_get_tiling(bo);
flags = 0x0;
if (bo->usage & (GRALLOC_USAGE_HW_RENDER | GRALLOC_USAGE_HW_FB))
flags |= BO_ALLOC_FOR_RENDER;
ibo = drm_intel_bo_alloc_tiled(bufmgr, name,
aligned_width, aligned_height, cpp, &tiling, &pitch, flags);
if (!ibo) {
LOGE("failed to allocate ibo %dx%dx%d", width, height, cpp);
free(bo);
return NULL;
}
if (bo->usage & GRALLOC_USAGE_HW_FB) {
drm_intel_bo_disable_reuse(ibo);
bo->stride = pitch;
bo->fb_handle = ibo->handle;
}
if (drm_intel_bo_flink(ibo, (uint32_t *) &bo->name)) {
LOGE("failed to flink ibo");
drm_intel_bo_unreference(ibo);
free(bo);
return NULL;
}
bo->data = (int) ibo;
*stride = pitch;
return bo;
}
void
drm_gem_drv_free(struct drm_module_t *drm, struct drm_bo_t *bo)
{
drm_intel_bo_unreference((drm_intel_bo *) bo->data);
free(bo);
}
int
drm_gem_drv_map(struct drm_module_t *drm, struct drm_bo_t *bo,
int x, int y, int w, int h, int enable_write, void **addr)
{
drm_intel_bo *ibo = (drm_intel_bo *) bo->data;
int err;
if (!ibo) {
drm_intel_bufmgr *bufmgr = (drm_intel_bufmgr *) drm->gem;
ibo = drm_intel_bo_gem_create_from_name(bufmgr, "gralloc-r", bo->name);
if (!ibo) {
LOGE("failed to create ibo from name %u", bo->name);
return -EINVAL;
}
bo->data = (int) ibo;
}
if ((bo->usage & GRALLOC_USAGE_HW_FB) ||
drm_gem_get_tiling(bo) != I915_TILING_NONE)
err = drm_intel_gem_bo_map_gtt(ibo);
else
err = drm_intel_bo_map(ibo, enable_write);
if (!err)
*addr = ibo->virtual;
return err;
}
void
drm_gem_drv_unmap(struct drm_module_t *drm, struct drm_bo_t *bo)
{
drm_intel_bo *ibo = (drm_intel_bo *) bo->data;
if ((bo->usage & GRALLOC_USAGE_HW_FB) ||
drm_gem_get_tiling(bo) != I915_TILING_NONE)
drm_intel_gem_bo_unmap_gtt(ibo);
else
drm_intel_bo_unmap(ibo);
}

View File

@@ -1,333 +0,0 @@
#define LOG_TAG "GRALLOC-PIPE"
#include <cutils/log.h>
#include <errno.h>
#include "pipe/p_screen.h"
#include "pipe/p_context.h"
#include "state_tracker/drm_driver.h"
#include "util/u_inlines.h"
#include "util/u_memory.h"
#include "gralloc_mod.h"
#include "gralloc_gem.h"
struct drm_pipe_manager {
pthread_mutex_t mutex;
struct pipe_screen *screen;
struct pipe_context *context;
};
struct drm_pipe_buffer {
struct winsys_handle winsys;
uint32_t fb_handle;
struct pipe_resource *resource;
struct pipe_transfer *transfer;
};
static void
drm_gem_drv_init_features_locked(struct drm_module_t *drm)
{
drm->mode_dirty_fb = 0;
drm->mode_page_flip = 0;
if (strcmp(driver_descriptor.driver_name, "vmwgfx") == 0)
drm->mode_dirty_fb = 1;
drm->swap_interval = 0;
}
static int
drm_gem_drv_init_locked(struct drm_module_t *drm)
{
struct drm_pipe_manager *pm;
if (drm->gem)
return 0;
pm = CALLOC(1, sizeof(*pm));
if (!pm)
return -ENOMEM;
pthread_mutex_init(&pm->mutex, NULL);
pm->screen = driver_descriptor.create_screen(drm->fd);
if (!pm->screen) {
LOGE("failed to create pipe screen");
FREE(pm);
return -EINVAL;
}
drm->gem = (void *) pm;
drm_gem_drv_init_features_locked(drm);
return 0;
}
int
drm_gem_drv_init(struct drm_module_t *drm)
{
int ret;
pthread_mutex_lock(&drm->mutex);
ret = drm_gem_drv_init_locked(drm);
pthread_mutex_unlock(&drm->mutex);
return ret;
}
static enum pipe_format
get_pipe_format(int format)
{
enum pipe_format fmt;
switch (format) {
case HAL_PIXEL_FORMAT_RGBA_8888:
fmt = PIPE_FORMAT_R8G8B8A8_UNORM;
break;
case HAL_PIXEL_FORMAT_RGBX_8888:
fmt = PIPE_FORMAT_R8G8B8X8_UNORM;
break;
case HAL_PIXEL_FORMAT_RGB_888:
fmt = PIPE_FORMAT_R8G8B8_UNORM;
break;
case HAL_PIXEL_FORMAT_RGB_565:
fmt = PIPE_FORMAT_B5G6R5_UNORM;
break;
case HAL_PIXEL_FORMAT_BGRA_8888:
fmt = PIPE_FORMAT_B8G8R8A8_UNORM;
break;
case HAL_PIXEL_FORMAT_RGBA_5551:
case HAL_PIXEL_FORMAT_RGBA_4444:
default:
fmt = PIPE_FORMAT_NONE;
break;
}
return fmt;
}
static unsigned
get_pipe_bind(int usage)
{
unsigned bind = PIPE_BIND_SHARED;
if (usage & GRALLOC_USAGE_SW_READ_MASK)
bind |= PIPE_BIND_TRANSFER_READ;
if (usage & GRALLOC_USAGE_SW_WRITE_MASK)
bind |= PIPE_BIND_TRANSFER_WRITE;
if (usage & GRALLOC_USAGE_HW_TEXTURE)
bind |= PIPE_BIND_SAMPLER_VIEW;
if (usage & GRALLOC_USAGE_HW_RENDER)
bind |= PIPE_BIND_RENDER_TARGET;
if (usage & GRALLOC_USAGE_HW_FB) {
bind |= PIPE_BIND_RENDER_TARGET;
bind |= PIPE_BIND_SCANOUT;
}
return bind;
}
static struct drm_pipe_buffer *
get_pipe_buffer(struct drm_pipe_manager *pm, int width, int height,
int format, int usage, struct winsys_handle *winsys)
{
struct drm_pipe_buffer *buf;
struct pipe_resource templ;
memset(&templ, 0, sizeof(templ));
templ.format = get_pipe_format(format);
templ.bind = get_pipe_bind(usage);
templ.target = PIPE_TEXTURE_2D;
if (templ.format == PIPE_FORMAT_NONE ||
!pm->screen->is_format_supported(pm->screen, templ.format,
templ.target, 0, templ.bind, 0)) {
LOGE("unsupported format 0x%x", format);
return NULL;
}
buf = CALLOC(1, sizeof(*buf));
if (!buf)
return NULL;
templ.width0 = width;
templ.height0 = height;
templ.depth0 = 1;
if (winsys) {
buf->resource = pm->screen->resource_from_handle(pm->screen,
&templ, winsys);
if (!buf->resource)
goto fail;
buf->winsys = *winsys;
}
else {
buf->resource = pm->screen->resource_create(pm->screen, &templ);
if (!buf->resource)
goto fail;
buf->winsys.type = DRM_API_HANDLE_TYPE_SHARED;
if (!pm->screen->resource_get_handle(pm->screen, buf->resource, &buf->winsys))
goto fail;
}
/* need the gem handle for fb */
if (usage & GRALLOC_USAGE_HW_FB) {
struct winsys_handle tmp;
memset(&tmp, 0, sizeof(tmp));
tmp.type = DRM_API_HANDLE_TYPE_KMS;
if (!pm->screen->resource_get_handle(pm->screen, buf->resource, &tmp))
goto fail;
buf->fb_handle = tmp.handle;
}
return buf;
fail:
LOGE("failed to allocate pipe buffer");
if (buf->resource)
pipe_resource_reference(&buf->resource, NULL);
FREE(buf);
return NULL;
}
struct drm_bo_t *
drm_gem_drv_alloc(struct drm_module_t *drm, int width, int height,
int format, int usage, int *stride)
{
struct drm_pipe_manager *pm = (struct drm_pipe_manager *) drm->gem;
struct drm_pipe_buffer *buf;
struct drm_bo_t *bo;
struct pipe_resource templ;
bo = drm_gem_create_bo(width, height, format, usage);
if (!bo)
return NULL;
pthread_mutex_lock(&pm->mutex);
buf = get_pipe_buffer(pm, width, height, format, usage, NULL);
pthread_mutex_unlock(&pm->mutex);
if (buf) {
bo->name = (int) buf->winsys.handle;
bo->stride = (int) buf->winsys.stride;
bo->fb_handle = buf->fb_handle;
bo->data = (int) buf;
*stride = bo->stride;
}
else {
free(bo);
bo = NULL;
}
return bo;
}
void
drm_gem_drv_free(struct drm_module_t *drm, struct drm_bo_t *bo)
{
struct drm_pipe_manager *pm = (struct drm_pipe_manager *) drm->gem;
struct drm_pipe_buffer *buf = (struct drm_pipe_buffer *) bo->data;
pthread_mutex_lock(&pm->mutex);
if (buf->transfer)
pipe_transfer_destroy(pm->context, buf->transfer);
pipe_resource_reference(&buf->resource, NULL);
pthread_mutex_unlock(&pm->mutex);
FREE(buf);
free(bo);
}
int
drm_gem_drv_map(struct drm_module_t *drm, struct drm_bo_t *bo,
int x, int y, int w, int h, int enable_write, void **addr)
{
struct drm_pipe_manager *pm = (struct drm_pipe_manager *) drm->gem;
struct drm_pipe_buffer *buf = (struct drm_pipe_buffer *) bo->data;
enum pipe_transfer_usage usage = 0;
int ret = 0;
pthread_mutex_lock(&pm->mutex);
/* need a context to get transfer */
if (!pm->context) {
pm->context = pm->screen->context_create(pm->screen, NULL);
if (!pm->context) {
LOGE("failed to create pipe context");
ret = -ENOMEM;
}
}
/* the bo was allocated by another process */
if (!buf && !ret) {
struct winsys_handle winsys;
memset(&winsys, 0, sizeof(winsys));
winsys.type = DRM_API_HANDLE_TYPE_SHARED;
winsys.handle = bo->name;
winsys.stride = bo->stride;
buf = get_pipe_buffer(pm, bo->width, bo->height,
bo->format, bo->usage, &winsys);
if (!buf) {
LOGE("failed to create pipe buffer from name %u", bo->name);
ret = -ENOMEM;
}
bo->data = (int) buf;
}
if (buf) {
usage = PIPE_TRANSFER_READ;
if (enable_write)
usage |= PIPE_TRANSFER_WRITE;
assert(!buf->transfer);
/*
* ignore x, y, w and h so that returned addr points at the start of the
* buffer
*/
buf->transfer = pipe_get_transfer(pm->context, buf->resource,
0, 0, usage, 0, 0, bo->width, bo->height);
if (buf->transfer)
*addr = pipe_transfer_map(pm->context, buf->transfer);
else
ret = -ENOMEM;
}
pthread_mutex_unlock(&pm->mutex);
return ret;
}
void
drm_gem_drv_unmap(struct drm_module_t *drm, struct drm_bo_t *bo)
{
struct drm_pipe_manager *pm = (struct drm_pipe_manager *) drm->gem;
struct drm_pipe_buffer *buf = (struct drm_pipe_buffer *) bo->data;
pthread_mutex_lock(&pm->mutex);
assert(buf && buf->transfer);
pipe_transfer_unmap(pm->context, buf->transfer);
pipe_transfer_destroy(pm->context, buf->transfer);
buf->transfer = NULL;
pm->context->flush(pm->context, PIPE_FLUSH_RENDER_CACHE, NULL);
pthread_mutex_unlock(&pm->mutex);
}

View File

@@ -1,241 +0,0 @@
#define LOG_TAG "GRALLOC-KMS"
#include <cutils/log.h>
#include <errno.h>
#include <unistd.h>
#include "gralloc_kms.h"
int
drm_kms_add_fb(struct drm_module_t *drm, struct drm_bo_t *bo)
{
uint8_t bpp;
bpp = drm_mod_get_bpp(bo->format) * 8;
return drmModeAddFB(drm->fd, bo->width, bo->height, bpp, bpp,
bo->stride, bo->fb_handle, (uint32_t *) &bo->fb_id);
}
void
drm_kms_rm_fb(struct drm_module_t *drm, struct drm_bo_t *bo)
{
drmModeRmFB(drm->fd, bo->fb_id);
bo->fb_id = 0;
}
static void
drm_kms_wait_vblank(struct drm_module_t *drm, int num)
{
drmVBlank vbl;
int ret;
memset(&vbl, 0, sizeof(vbl));
vbl.request.type = DRM_VBLANK_RELATIVE;
if (drm->vblank_secondary)
vbl.request.type |= DRM_VBLANK_SECONDARY;
vbl.request.sequence = num;
ret = drmWaitVBlank(drm->fd, &vbl);
if (ret)
LOGW("failed to wait vblank");
}
static int
drm_kms_set_crtc(struct drm_module_t *drm, struct drm_bo_t *bo)
{
int ret;
if (drm->swap_interval)
drm_kms_wait_vblank(drm, drm->swap_interval);
ret = drmModeSetCrtc(drm->fd, drm->crtc_id, bo->fb_id,
0, 0, &drm->connector_id, 1, &drm->mode);
if (ret) {
LOGE("failed to set crtc");
return ret;
}
#ifdef DRM_MODE_FEATURE_DIRTYFB
if (drm->mode_dirty_fb)
ret = drmModeDirtyFB(drm->fd, bo->fb_id, &drm->clip, 1);
#endif
return ret;
}
static int
drm_kms_page_flip(struct drm_module_t *drm, struct drm_bo_t *bo)
{
int waits = 3, ret;
if (drm->swap_interval > 1)
drm_kms_wait_vblank(drm, drm->swap_interval - 1);
while (waits) {
ret = drmModePageFlip(drm->fd, drm->crtc_id, bo->fb_id, 0x0, NULL);
if (ret && errno == -EBUSY) {
if (drm->swap_interval)
drm_kms_wait_vblank(drm, 1);
else
usleep(5000);
waits--;
}
else {
break;
}
}
if (ret)
LOGE("failed to perform page flip");
return ret;
}
int
drm_kms_post(struct drm_module_t *drm, struct drm_bo_t *bo)
{
int ret;
if (!bo->fb_id) {
LOGE("unable to post bo %p without fb", bo);
return -EINVAL;
}
/* TODO spawn a thread to avoid waiting */
if (drm->first_post) {
pthread_mutex_lock(&drm->mutex);
if (drm->first_post) {
ret = drm_kms_set_crtc(drm, bo);
if (!ret)
drm->first_post = 0;
pthread_mutex_unlock(&drm->mutex);
return ret;
}
pthread_mutex_unlock(&drm->mutex);
}
if (drm->mode_page_flip && drm->swap_interval)
ret = drm_kms_page_flip(drm, bo);
else
ret = drm_kms_set_crtc(drm, bo);
return ret;
}
static int
drm_kms_init_with_connector_locked(struct drm_module_t *drm,
drmModeConnectorPtr connector)
{
drmModeEncoderPtr encoder;
drmModeModeInfoPtr mode;
int i;
if (!connector->count_modes)
return -EINVAL;
encoder = drmModeGetEncoder(drm->fd, connector->encoders[0]);
if (!encoder)
return -EINVAL;
for (i = 0; i < drm->resources->count_crtcs; i++) {
if (encoder->possible_crtcs & (1 << i))
break;
}
drmModeFreeEncoder(encoder);
if (i == drm->resources->count_crtcs)
return -EINVAL;
drm->crtc_id = drm->resources->crtcs[i];
drm->connector_id = connector->connector_id;
/* find the first preferred mode */
mode = NULL;
for (i = 0; i < connector->count_modes; i++) {
drmModeModeInfoPtr m = &connector->modes[i];
if (m->type & DRM_MODE_TYPE_PREFERRED) {
mode = m;
break;
}
}
/* no preference; use the first */
if (!mode)
mode = &connector->modes[0];
drm->mode = *mode;
if (connector->mmWidth && connector->mmHeight) {
drm->xdpi = (drm->mode.hdisplay * 25.4 / connector->mmWidth);
drm->ydpi = (drm->mode.vdisplay * 25.4 / connector->mmHeight);
}
else {
drm->xdpi = 75;
drm->ydpi = 75;
}
/* select between 32/16 bits */
#if 1
drm->format = HAL_PIXEL_FORMAT_BGRA_8888;
#else
drm->format = HAL_PIXEL_FORMAT_RGB_565;
#endif
#ifdef DRM_MODE_FEATURE_DIRTYFB
drm->clip.x1 = 0;
drm->clip.y1 = 0;
drm->clip.x2 = drm->mode.hdisplay;
drm->clip.y2 = drm->mode.vdisplay;
#endif
drm->first_post = 1;
return 0;
}
static int
drm_kms_init_locked(struct drm_module_t *drm)
{
int i, ret;
if (drm->resources)
return 0;
drm->resources = drmModeGetResources(drm->fd);
if (!drm->resources)
return -EINVAL;
for (i = 0; i < drm->resources->count_connectors; i++) {
drmModeConnectorPtr connector;
connector = drmModeGetConnector(drm->fd, drm->resources->connectors[i]);
if (connector) {
if (connector->connection == DRM_MODE_CONNECTED) {
if (!drm_kms_init_with_connector_locked(drm, connector))
break;
}
drmModeFreeConnector(connector);
}
}
if (i == drm->resources->count_connectors) {
drmModeFreeResources(drm->resources);
drm->resources = NULL;
return -EINVAL;
}
return 0;
}
int
drm_kms_init(struct drm_module_t *drm)
{
int ret;
pthread_mutex_lock(&drm->mutex);
ret = drm_kms_init_locked(drm);
pthread_mutex_unlock(&drm->mutex);
return ret;
}

View File

@@ -1,19 +0,0 @@
#ifndef _DRM_KMS_H_
#define _DRM_KMS_H_
#include "gralloc_mod.h"
#include "gralloc_gem.h"
int
drm_kms_init(struct drm_module_t *drm);
int
drm_kms_add_fb(struct drm_module_t *drm, struct drm_bo_t *bo);
void
drm_kms_rm_fb(struct drm_module_t *drm, struct drm_bo_t *bo);
int
drm_kms_post(struct drm_module_t *drm, struct drm_bo_t *bo);
#endif /* _DRM_KMS_H_ */

View File

@@ -1,328 +0,0 @@
#define LOG_TAG "GRALLOC-MOD"
#include <cutils/log.h>
#include <stdlib.h>
#include <errno.h>
#include <stdarg.h>
#include "gralloc_mod.h"
#include "gralloc_gem.h"
#include "gralloc_kms.h"
static int
drm_mod_perform(const struct gralloc_module_t *mod, int op, ...)
{
struct drm_module_t *drm = (struct drm_module_t *) mod;
va_list args;
int ret;
va_start(args, op);
switch (op) {
case GRALLOC_MODULE_PERFORM_GET_DRM_FD:
{
int *fd = va_arg(args, int *);
ret = drm_gem_init(drm);
if (!ret)
*fd = drm->fd;
}
break;
case GRALLOC_MODULE_PERFORM_GET_DRM_MAGIC:
{
int32_t *magic = va_arg(args, int32_t *);
ret = drm_gem_init(drm);
if (!ret)
ret = drm_gem_get_magic(drm, magic);
}
break;
case GRALLOC_MODULE_PERFORM_AUTH_DRM_MAGIC:
{
int32_t magic = va_arg(args, int32_t);
ret = drm_gem_init(drm);
if (!ret)
ret = drm_gem_auth_magic(drm, magic);
}
break;
default:
ret = -EINVAL;
break;
}
va_end(args);
return ret;
}
static int
drm_mod_register_buffer(const gralloc_module_t *mod, buffer_handle_t handle)
{
return (drm_gem_get(handle)) ? 0 : -EINVAL;
}
static int
drm_mod_unregister_buffer(const gralloc_module_t *mod, buffer_handle_t handle)
{
return (drm_gem_get(handle)) ? 0 : -EINVAL;
}
static int
drm_mod_lock(const gralloc_module_t *mod, buffer_handle_t handle,
int usage, int x, int y, int w, int h, void **ptr)
{
struct drm_module_t *drm = (struct drm_module_t *) mod;
struct drm_bo_t *bo;
int ret;
ret = drm_gem_init(drm);
if (!ret)
ret = drm_gem_drv_init(drm);
if (ret)
return ret;
bo = drm_gem_validate(handle);
if (!bo)
return -EINVAL;
return drm_gem_drv_map(drm, bo, x, y, w, h, 1, ptr);
}
static int
drm_mod_unlock(const gralloc_module_t *mod, buffer_handle_t handle)
{
struct drm_module_t *drm = (struct drm_module_t *) mod;
struct drm_bo_t *bo;
bo = drm_gem_validate(handle);
if (!bo)
return -EINVAL;
drm_gem_drv_unmap(drm, bo);
return 0;
}
static int
drm_mod_close_gpu0(struct hw_device_t *dev)
{
struct alloc_device_t *alloc = (struct alloc_device_t *) dev;
free(alloc);
return 0;
}
static int
drm_mod_free_gpu0(alloc_device_t *dev, buffer_handle_t handle)
{
struct drm_module_t *drm = (struct drm_module_t *) dev->common.module;
struct drm_bo_t *bo;
bo = drm_gem_validate(handle);
if (!bo)
return -EINVAL;
if (bo->usage & GRALLOC_USAGE_HW_FB)
drm_kms_rm_fb(drm, bo);
drm_gem_drv_free(drm, bo);
return 0;
}
static int
drm_mod_alloc_gpu0(alloc_device_t *dev, int w, int h, int format, int usage,
buffer_handle_t *handle, int *stride)
{
struct drm_module_t *drm = (struct drm_module_t *) dev->common.module;
struct drm_bo_t *bo;
int size, bpp, ret;
ret = drm_gem_drv_init(drm);
if (ret)
return ret;
bpp = drm_mod_get_bpp(format);
if (!bpp)
return -EINVAL;
bo = drm_gem_drv_alloc(drm, w, h, format, usage, stride);
if (!bo)
return -EINVAL;
if (bo->usage & GRALLOC_USAGE_HW_FB) {
ret = drm_kms_add_fb(drm, bo);
if (ret) {
LOGE("failed to add fb");
drm_gem_drv_free(drm, bo);
return ret;
}
}
*stride /= bpp;
*handle = &bo->base;
return 0;
}
static int
drm_mod_open_gpu0(struct drm_module_t *drm, hw_device_t **dev)
{
struct alloc_device_t *alloc;
int ret;
ret = drm_gem_init(drm);
if (ret)
return ret;
alloc = calloc(1, sizeof(*alloc));
if (!alloc)
return -EINVAL;
alloc->common.tag = HARDWARE_DEVICE_TAG;
alloc->common.version = 0;
alloc->common.module = (hw_module_t *) drm;
alloc->common.close = drm_mod_close_gpu0;
alloc->alloc = drm_mod_alloc_gpu0;
alloc->free = drm_mod_free_gpu0;
*dev = &alloc->common;
return 0;
}
static int
drm_mod_close_fb0(struct hw_device_t *dev)
{
struct framebuffer_device_t *fb = (struct framebuffer_device_t *) dev;
free(fb);
return 0;
}
static int
drm_mod_set_swap_interval_fb0(struct framebuffer_device_t *fb, int interval)
{
if (interval < fb->minSwapInterval || interval > fb->maxSwapInterval)
return -EINVAL;
return 0;
}
static int
drm_mod_post_fb0(struct framebuffer_device_t *fb, buffer_handle_t handle)
{
struct drm_module_t *drm = (struct drm_module_t *) fb->common.module;
struct drm_bo_t *bo;
bo = drm_gem_validate(handle);
if (!bo)
return -EINVAL;
return drm_kms_post(drm, bo);
}
#include <EGL/egl.h>
static int
drm_mod_composition_complete_fb0(struct framebuffer_device_t *fb)
{
eglWaitClient();
return 0;
}
static int
drm_mod_open_fb0(struct drm_module_t *drm, struct hw_device_t **dev)
{
struct framebuffer_device_t *fb;
int ret;
fb = calloc(1, sizeof(*fb));
if (!fb)
return -ENOMEM;
ret = drm_gem_init(drm);
if (!ret)
ret = drm_kms_init(drm);
if (ret) {
free(fb);
return ret;
}
fb->common.tag = HARDWARE_DEVICE_TAG;
fb->common.version = 0;
fb->common.module = (hw_module_t *) drm;
fb->common.close = drm_mod_close_fb0;
fb->setSwapInterval = drm_mod_set_swap_interval_fb0;
fb->post = drm_mod_post_fb0;
fb->compositionComplete = drm_mod_composition_complete_fb0;
*((uint32_t *) &fb->flags) = 0x0;
*((uint32_t *) &fb->width) = drm->mode.hdisplay;
*((uint32_t *) &fb->height) = drm->mode.vdisplay;
*((int *) &fb->stride) = drm->mode.hdisplay;
*((float *) &fb->fps) = drm->mode.vrefresh;
*((int *) &fb->format) = drm->format;
*((float *) &fb->xdpi) = drm->xdpi;
*((float *) &fb->ydpi) = drm->ydpi;
*((int *) &fb->minSwapInterval) = drm->swap_interval;
*((int *) &fb->maxSwapInterval) = drm->swap_interval;
*dev = &fb->common;
LOGI("mode.hdisplay %d\n"
"mode.vdisplay %d\n"
"mode.vrefresh %d\n"
"format 0x%x\n"
"xdpi %d\n"
"ydpi %d\n",
drm->mode.hdisplay,
drm->mode.vdisplay,
drm->mode.vrefresh,
drm->format,
drm->xdpi, drm->ydpi);
return 0;
}
static int
drm_mod_open(const struct hw_module_t *mod, const char *name, struct hw_device_t **dev)
{
struct drm_module_t *drm = (struct drm_module_t *) mod;
int ret;
if (strcmp(name, GRALLOC_HARDWARE_GPU0) == 0)
ret = drm_mod_open_gpu0(drm, dev);
else if (strcmp(name, GRALLOC_HARDWARE_FB0) == 0)
ret = drm_mod_open_fb0(drm, dev);
else
ret = -EINVAL;
return ret;
}
static struct hw_module_methods_t drm_mod_methods = {
.open = drm_mod_open
};
struct drm_module_t HAL_MODULE_INFO_SYM = {
.base = {
.common = {
.tag = HARDWARE_MODULE_TAG,
.version_major = 1,
.version_minor = 0,
.id = GRALLOC_HARDWARE_MODULE_ID,
.name = "DRM Memory Allocator",
.author = "Chia-I Wu",
.methods = &drm_mod_methods
},
.registerBuffer = drm_mod_register_buffer,
.unregisterBuffer = drm_mod_unregister_buffer,
.lock = drm_mod_lock,
.unlock = drm_mod_unlock,
.perform = drm_mod_perform
},
.mutex = PTHREAD_MUTEX_INITIALIZER,
.fd = -1
};

View File

@@ -1,65 +0,0 @@
#ifndef _GRALLOC_DRM_H
#define _GRALLOC_DRM_H
#include <hardware/gralloc.h>
#include <xf86drm.h>
#include <xf86drmMode.h>
#include <pthread.h>
struct drm_module_t {
gralloc_module_t base;
pthread_mutex_t mutex;
/* initialized by drm_gem_init */
int fd;
/* initialized by drm_kms_init */
drmModeResPtr resources;
uint32_t crtc_id;
uint32_t connector_id;
drmModeModeInfo mode;
int xdpi, ydpi;
int format;
#ifdef DRM_MODE_FEATURE_DIRTYFB
drmModeClip clip;
#endif
/* initialized by drm_gem_drv_init */
void *gem;
int mode_dirty_fb;
int mode_page_flip;
int swap_interval;
int vblank_secondary;
int first_post;
};
static inline int
drm_mod_get_bpp(int format)
{
int bpp;
switch (format) {
case HAL_PIXEL_FORMAT_RGBA_8888:
case HAL_PIXEL_FORMAT_RGBX_8888:
case HAL_PIXEL_FORMAT_BGRA_8888:
bpp = 4;
break;
case HAL_PIXEL_FORMAT_RGB_888:
bpp = 3;
break;
case HAL_PIXEL_FORMAT_RGB_565:
case HAL_PIXEL_FORMAT_RGBA_5551:
case HAL_PIXEL_FORMAT_RGBA_4444:
bpp = 2;
break;
default:
bpp = 0;
break;
}
return bpp;
}
#endif /* _GRALLOC_DRM_H */

View File

@@ -1,46 +0,0 @@
LOCAL_PATH := $(call my-dir)
include $(LOCAL_PATH)/glapi/sources.mak
include $(LOCAL_PATH)/mapi/sources.mak
glapi_SOURCES := \
$(addprefix glapi/, $(GLAPI_SOURCES)) \
$(addprefix mapi/, $(MAPI_GLAPI_SOURCES))
glapi_CFLAGS := \
-DPTHREADS \
-DMAPI_GLAPI_CURRENT \
-fvisibility=hidden \
-Wno-sign-compare
glapi_C_INCLUDES := \
external/mesa/include \
external/mesa/src/mapi
# use x86 assembly to generate ES2 entries on the fly
glapi_SOURCES += \
$(addprefix es1api/glapi/, $(X86_API))
glapi_CFLAGS += \
-DUSE_X86_ASM
glapi_C_INCLUDES += \
external/mesa/src/mesa
include $(CLEAR_VARS)
LOCAL_MODULE := libmesa_glapi
LOCAL_SRC_FILES := $(glapi_SOURCES)
LOCAL_CFLAGS := $(glapi_CFLAGS)
## generate glapi headers
#intermediates := $(call local-intermediates-dir)
#glapi_OUT := $(intermediates)/es1api
#glapi_XML := $(LOCAL_PATH)/glapi/gen-es/es1_API.xml
#include $(LOCAL_PATH)/generate_glapi.mk
#
## depend on the generated headers
#$(intermediates)/%.o: $(LOCAL_GENERATED_SOURCES)
glapi_OUT := external/mesa/src/mapi/es1api
LOCAL_C_INCLUDES := $(glapi_OUT) $(glapi_C_INCLUDES)
include $(BUILD_STATIC_LIBRARY)

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,551 +0,0 @@
/* DO NOT EDIT - This file generated automatically by gl_table.py (from Mesa) script */
/*
* Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
* (C) Copyright IBM Corporation 2004
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sub license,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
* BRIAN PAUL, IBM,
* AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#if !defined( _GLAPI_TABLE_H_ )
# define _GLAPI_TABLE_H_
#ifndef GLAPIENTRYP
# ifndef GLAPIENTRY
# define GLAPIENTRY
# endif
# define GLAPIENTRYP GLAPIENTRY *
#endif
struct _glapi_table
{
void (GLAPIENTRYP NewList)(GLuint list, GLenum mode); /* 0 */
void (GLAPIENTRYP EndList)(void); /* 1 */
void (GLAPIENTRYP CallList)(GLuint list); /* 2 */
void (GLAPIENTRYP CallLists)(GLsizei n, GLenum type, const GLvoid * lists); /* 3 */
void (GLAPIENTRYP DeleteLists)(GLuint list, GLsizei range); /* 4 */
GLuint (GLAPIENTRYP GenLists)(GLsizei range); /* 5 */
void (GLAPIENTRYP ListBase)(GLuint base); /* 6 */
void (GLAPIENTRYP Begin)(GLenum mode); /* 7 */
void (GLAPIENTRYP Bitmap)(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte * bitmap); /* 8 */
void (GLAPIENTRYP Color3b)(GLbyte red, GLbyte green, GLbyte blue); /* 9 */
void (GLAPIENTRYP Color3bv)(const GLbyte * v); /* 10 */
void (GLAPIENTRYP Color3d)(GLdouble red, GLdouble green, GLdouble blue); /* 11 */
void (GLAPIENTRYP Color3dv)(const GLdouble * v); /* 12 */
void (GLAPIENTRYP Color3f)(GLfloat red, GLfloat green, GLfloat blue); /* 13 */
void (GLAPIENTRYP Color3fv)(const GLfloat * v); /* 14 */
void (GLAPIENTRYP Color3i)(GLint red, GLint green, GLint blue); /* 15 */
void (GLAPIENTRYP Color3iv)(const GLint * v); /* 16 */
void (GLAPIENTRYP Color3s)(GLshort red, GLshort green, GLshort blue); /* 17 */
void (GLAPIENTRYP Color3sv)(const GLshort * v); /* 18 */
void (GLAPIENTRYP Color3ub)(GLubyte red, GLubyte green, GLubyte blue); /* 19 */
void (GLAPIENTRYP Color3ubv)(const GLubyte * v); /* 20 */
void (GLAPIENTRYP Color3ui)(GLuint red, GLuint green, GLuint blue); /* 21 */
void (GLAPIENTRYP Color3uiv)(const GLuint * v); /* 22 */
void (GLAPIENTRYP Color3us)(GLushort red, GLushort green, GLushort blue); /* 23 */
void (GLAPIENTRYP Color3usv)(const GLushort * v); /* 24 */
void (GLAPIENTRYP Color4b)(GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha); /* 25 */
void (GLAPIENTRYP Color4bv)(const GLbyte * v); /* 26 */
void (GLAPIENTRYP Color4d)(GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha); /* 27 */
void (GLAPIENTRYP Color4dv)(const GLdouble * v); /* 28 */
void (GLAPIENTRYP Color4f)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); /* 29 */
void (GLAPIENTRYP Color4fv)(const GLfloat * v); /* 30 */
void (GLAPIENTRYP Color4i)(GLint red, GLint green, GLint blue, GLint alpha); /* 31 */
void (GLAPIENTRYP Color4iv)(const GLint * v); /* 32 */
void (GLAPIENTRYP Color4s)(GLshort red, GLshort green, GLshort blue, GLshort alpha); /* 33 */
void (GLAPIENTRYP Color4sv)(const GLshort * v); /* 34 */
void (GLAPIENTRYP Color4ub)(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha); /* 35 */
void (GLAPIENTRYP Color4ubv)(const GLubyte * v); /* 36 */
void (GLAPIENTRYP Color4ui)(GLuint red, GLuint green, GLuint blue, GLuint alpha); /* 37 */
void (GLAPIENTRYP Color4uiv)(const GLuint * v); /* 38 */
void (GLAPIENTRYP Color4us)(GLushort red, GLushort green, GLushort blue, GLushort alpha); /* 39 */
void (GLAPIENTRYP Color4usv)(const GLushort * v); /* 40 */
void (GLAPIENTRYP EdgeFlag)(GLboolean flag); /* 41 */
void (GLAPIENTRYP EdgeFlagv)(const GLboolean * flag); /* 42 */
void (GLAPIENTRYP End)(void); /* 43 */
void (GLAPIENTRYP Indexd)(GLdouble c); /* 44 */
void (GLAPIENTRYP Indexdv)(const GLdouble * c); /* 45 */
void (GLAPIENTRYP Indexf)(GLfloat c); /* 46 */
void (GLAPIENTRYP Indexfv)(const GLfloat * c); /* 47 */
void (GLAPIENTRYP Indexi)(GLint c); /* 48 */
void (GLAPIENTRYP Indexiv)(const GLint * c); /* 49 */
void (GLAPIENTRYP Indexs)(GLshort c); /* 50 */
void (GLAPIENTRYP Indexsv)(const GLshort * c); /* 51 */
void (GLAPIENTRYP Normal3b)(GLbyte nx, GLbyte ny, GLbyte nz); /* 52 */
void (GLAPIENTRYP Normal3bv)(const GLbyte * v); /* 53 */
void (GLAPIENTRYP Normal3d)(GLdouble nx, GLdouble ny, GLdouble nz); /* 54 */
void (GLAPIENTRYP Normal3dv)(const GLdouble * v); /* 55 */
void (GLAPIENTRYP Normal3f)(GLfloat nx, GLfloat ny, GLfloat nz); /* 56 */
void (GLAPIENTRYP Normal3fv)(const GLfloat * v); /* 57 */
void (GLAPIENTRYP Normal3i)(GLint nx, GLint ny, GLint nz); /* 58 */
void (GLAPIENTRYP Normal3iv)(const GLint * v); /* 59 */
void (GLAPIENTRYP Normal3s)(GLshort nx, GLshort ny, GLshort nz); /* 60 */
void (GLAPIENTRYP Normal3sv)(const GLshort * v); /* 61 */
void (GLAPIENTRYP RasterPos2d)(GLdouble x, GLdouble y); /* 62 */
void (GLAPIENTRYP RasterPos2dv)(const GLdouble * v); /* 63 */
void (GLAPIENTRYP RasterPos2f)(GLfloat x, GLfloat y); /* 64 */
void (GLAPIENTRYP RasterPos2fv)(const GLfloat * v); /* 65 */
void (GLAPIENTRYP RasterPos2i)(GLint x, GLint y); /* 66 */
void (GLAPIENTRYP RasterPos2iv)(const GLint * v); /* 67 */
void (GLAPIENTRYP RasterPos2s)(GLshort x, GLshort y); /* 68 */
void (GLAPIENTRYP RasterPos2sv)(const GLshort * v); /* 69 */
void (GLAPIENTRYP RasterPos3d)(GLdouble x, GLdouble y, GLdouble z); /* 70 */
void (GLAPIENTRYP RasterPos3dv)(const GLdouble * v); /* 71 */
void (GLAPIENTRYP RasterPos3f)(GLfloat x, GLfloat y, GLfloat z); /* 72 */
void (GLAPIENTRYP RasterPos3fv)(const GLfloat * v); /* 73 */
void (GLAPIENTRYP RasterPos3i)(GLint x, GLint y, GLint z); /* 74 */
void (GLAPIENTRYP RasterPos3iv)(const GLint * v); /* 75 */
void (GLAPIENTRYP RasterPos3s)(GLshort x, GLshort y, GLshort z); /* 76 */
void (GLAPIENTRYP RasterPos3sv)(const GLshort * v); /* 77 */
void (GLAPIENTRYP RasterPos4d)(GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 78 */
void (GLAPIENTRYP RasterPos4dv)(const GLdouble * v); /* 79 */
void (GLAPIENTRYP RasterPos4f)(GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 80 */
void (GLAPIENTRYP RasterPos4fv)(const GLfloat * v); /* 81 */
void (GLAPIENTRYP RasterPos4i)(GLint x, GLint y, GLint z, GLint w); /* 82 */
void (GLAPIENTRYP RasterPos4iv)(const GLint * v); /* 83 */
void (GLAPIENTRYP RasterPos4s)(GLshort x, GLshort y, GLshort z, GLshort w); /* 84 */
void (GLAPIENTRYP RasterPos4sv)(const GLshort * v); /* 85 */
void (GLAPIENTRYP Rectd)(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2); /* 86 */
void (GLAPIENTRYP Rectdv)(const GLdouble * v1, const GLdouble * v2); /* 87 */
void (GLAPIENTRYP Rectf)(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2); /* 88 */
void (GLAPIENTRYP Rectfv)(const GLfloat * v1, const GLfloat * v2); /* 89 */
void (GLAPIENTRYP Recti)(GLint x1, GLint y1, GLint x2, GLint y2); /* 90 */
void (GLAPIENTRYP Rectiv)(const GLint * v1, const GLint * v2); /* 91 */
void (GLAPIENTRYP Rects)(GLshort x1, GLshort y1, GLshort x2, GLshort y2); /* 92 */
void (GLAPIENTRYP Rectsv)(const GLshort * v1, const GLshort * v2); /* 93 */
void (GLAPIENTRYP TexCoord1d)(GLdouble s); /* 94 */
void (GLAPIENTRYP TexCoord1dv)(const GLdouble * v); /* 95 */
void (GLAPIENTRYP TexCoord1f)(GLfloat s); /* 96 */
void (GLAPIENTRYP TexCoord1fv)(const GLfloat * v); /* 97 */
void (GLAPIENTRYP TexCoord1i)(GLint s); /* 98 */
void (GLAPIENTRYP TexCoord1iv)(const GLint * v); /* 99 */
void (GLAPIENTRYP TexCoord1s)(GLshort s); /* 100 */
void (GLAPIENTRYP TexCoord1sv)(const GLshort * v); /* 101 */
void (GLAPIENTRYP TexCoord2d)(GLdouble s, GLdouble t); /* 102 */
void (GLAPIENTRYP TexCoord2dv)(const GLdouble * v); /* 103 */
void (GLAPIENTRYP TexCoord2f)(GLfloat s, GLfloat t); /* 104 */
void (GLAPIENTRYP TexCoord2fv)(const GLfloat * v); /* 105 */
void (GLAPIENTRYP TexCoord2i)(GLint s, GLint t); /* 106 */
void (GLAPIENTRYP TexCoord2iv)(const GLint * v); /* 107 */
void (GLAPIENTRYP TexCoord2s)(GLshort s, GLshort t); /* 108 */
void (GLAPIENTRYP TexCoord2sv)(const GLshort * v); /* 109 */
void (GLAPIENTRYP TexCoord3d)(GLdouble s, GLdouble t, GLdouble r); /* 110 */
void (GLAPIENTRYP TexCoord3dv)(const GLdouble * v); /* 111 */
void (GLAPIENTRYP TexCoord3f)(GLfloat s, GLfloat t, GLfloat r); /* 112 */
void (GLAPIENTRYP TexCoord3fv)(const GLfloat * v); /* 113 */
void (GLAPIENTRYP TexCoord3i)(GLint s, GLint t, GLint r); /* 114 */
void (GLAPIENTRYP TexCoord3iv)(const GLint * v); /* 115 */
void (GLAPIENTRYP TexCoord3s)(GLshort s, GLshort t, GLshort r); /* 116 */
void (GLAPIENTRYP TexCoord3sv)(const GLshort * v); /* 117 */
void (GLAPIENTRYP TexCoord4d)(GLdouble s, GLdouble t, GLdouble r, GLdouble q); /* 118 */
void (GLAPIENTRYP TexCoord4dv)(const GLdouble * v); /* 119 */
void (GLAPIENTRYP TexCoord4f)(GLfloat s, GLfloat t, GLfloat r, GLfloat q); /* 120 */
void (GLAPIENTRYP TexCoord4fv)(const GLfloat * v); /* 121 */
void (GLAPIENTRYP TexCoord4i)(GLint s, GLint t, GLint r, GLint q); /* 122 */
void (GLAPIENTRYP TexCoord4iv)(const GLint * v); /* 123 */
void (GLAPIENTRYP TexCoord4s)(GLshort s, GLshort t, GLshort r, GLshort q); /* 124 */
void (GLAPIENTRYP TexCoord4sv)(const GLshort * v); /* 125 */
void (GLAPIENTRYP Vertex2d)(GLdouble x, GLdouble y); /* 126 */
void (GLAPIENTRYP Vertex2dv)(const GLdouble * v); /* 127 */
void (GLAPIENTRYP Vertex2f)(GLfloat x, GLfloat y); /* 128 */
void (GLAPIENTRYP Vertex2fv)(const GLfloat * v); /* 129 */
void (GLAPIENTRYP Vertex2i)(GLint x, GLint y); /* 130 */
void (GLAPIENTRYP Vertex2iv)(const GLint * v); /* 131 */
void (GLAPIENTRYP Vertex2s)(GLshort x, GLshort y); /* 132 */
void (GLAPIENTRYP Vertex2sv)(const GLshort * v); /* 133 */
void (GLAPIENTRYP Vertex3d)(GLdouble x, GLdouble y, GLdouble z); /* 134 */
void (GLAPIENTRYP Vertex3dv)(const GLdouble * v); /* 135 */
void (GLAPIENTRYP Vertex3f)(GLfloat x, GLfloat y, GLfloat z); /* 136 */
void (GLAPIENTRYP Vertex3fv)(const GLfloat * v); /* 137 */
void (GLAPIENTRYP Vertex3i)(GLint x, GLint y, GLint z); /* 138 */
void (GLAPIENTRYP Vertex3iv)(const GLint * v); /* 139 */
void (GLAPIENTRYP Vertex3s)(GLshort x, GLshort y, GLshort z); /* 140 */
void (GLAPIENTRYP Vertex3sv)(const GLshort * v); /* 141 */
void (GLAPIENTRYP Vertex4d)(GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 142 */
void (GLAPIENTRYP Vertex4dv)(const GLdouble * v); /* 143 */
void (GLAPIENTRYP Vertex4f)(GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 144 */
void (GLAPIENTRYP Vertex4fv)(const GLfloat * v); /* 145 */
void (GLAPIENTRYP Vertex4i)(GLint x, GLint y, GLint z, GLint w); /* 146 */
void (GLAPIENTRYP Vertex4iv)(const GLint * v); /* 147 */
void (GLAPIENTRYP Vertex4s)(GLshort x, GLshort y, GLshort z, GLshort w); /* 148 */
void (GLAPIENTRYP Vertex4sv)(const GLshort * v); /* 149 */
void (GLAPIENTRYP ClipPlane)(GLenum plane, const GLdouble * equation); /* 150 */
void (GLAPIENTRYP ColorMaterial)(GLenum face, GLenum mode); /* 151 */
void (GLAPIENTRYP CullFace)(GLenum mode); /* 152 */
void (GLAPIENTRYP Fogf)(GLenum pname, GLfloat param); /* 153 */
void (GLAPIENTRYP Fogfv)(GLenum pname, const GLfloat * params); /* 154 */
void (GLAPIENTRYP Fogi)(GLenum pname, GLint param); /* 155 */
void (GLAPIENTRYP Fogiv)(GLenum pname, const GLint * params); /* 156 */
void (GLAPIENTRYP FrontFace)(GLenum mode); /* 157 */
void (GLAPIENTRYP Hint)(GLenum target, GLenum mode); /* 158 */
void (GLAPIENTRYP Lightf)(GLenum light, GLenum pname, GLfloat param); /* 159 */
void (GLAPIENTRYP Lightfv)(GLenum light, GLenum pname, const GLfloat * params); /* 160 */
void (GLAPIENTRYP Lighti)(GLenum light, GLenum pname, GLint param); /* 161 */
void (GLAPIENTRYP Lightiv)(GLenum light, GLenum pname, const GLint * params); /* 162 */
void (GLAPIENTRYP LightModelf)(GLenum pname, GLfloat param); /* 163 */
void (GLAPIENTRYP LightModelfv)(GLenum pname, const GLfloat * params); /* 164 */
void (GLAPIENTRYP LightModeli)(GLenum pname, GLint param); /* 165 */
void (GLAPIENTRYP LightModeliv)(GLenum pname, const GLint * params); /* 166 */
void (GLAPIENTRYP LineStipple)(GLint factor, GLushort pattern); /* 167 */
void (GLAPIENTRYP LineWidth)(GLfloat width); /* 168 */
void (GLAPIENTRYP Materialf)(GLenum face, GLenum pname, GLfloat param); /* 169 */
void (GLAPIENTRYP Materialfv)(GLenum face, GLenum pname, const GLfloat * params); /* 170 */
void (GLAPIENTRYP Materiali)(GLenum face, GLenum pname, GLint param); /* 171 */
void (GLAPIENTRYP Materialiv)(GLenum face, GLenum pname, const GLint * params); /* 172 */
void (GLAPIENTRYP PointSize)(GLfloat size); /* 173 */
void (GLAPIENTRYP PolygonMode)(GLenum face, GLenum mode); /* 174 */
void (GLAPIENTRYP PolygonStipple)(const GLubyte * mask); /* 175 */
void (GLAPIENTRYP Scissor)(GLint x, GLint y, GLsizei width, GLsizei height); /* 176 */
void (GLAPIENTRYP ShadeModel)(GLenum mode); /* 177 */
void (GLAPIENTRYP TexParameterf)(GLenum target, GLenum pname, GLfloat param); /* 178 */
void (GLAPIENTRYP TexParameterfv)(GLenum target, GLenum pname, const GLfloat * params); /* 179 */
void (GLAPIENTRYP TexParameteri)(GLenum target, GLenum pname, GLint param); /* 180 */
void (GLAPIENTRYP TexParameteriv)(GLenum target, GLenum pname, const GLint * params); /* 181 */
void (GLAPIENTRYP TexImage1D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid * pixels); /* 182 */
void (GLAPIENTRYP TexImage2D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid * pixels); /* 183 */
void (GLAPIENTRYP TexEnvf)(GLenum target, GLenum pname, GLfloat param); /* 184 */
void (GLAPIENTRYP TexEnvfv)(GLenum target, GLenum pname, const GLfloat * params); /* 185 */
void (GLAPIENTRYP TexEnvi)(GLenum target, GLenum pname, GLint param); /* 186 */
void (GLAPIENTRYP TexEnviv)(GLenum target, GLenum pname, const GLint * params); /* 187 */
void (GLAPIENTRYP TexGend)(GLenum coord, GLenum pname, GLdouble param); /* 188 */
void (GLAPIENTRYP TexGendv)(GLenum coord, GLenum pname, const GLdouble * params); /* 189 */
void (GLAPIENTRYP TexGenfOES)(GLenum coord, GLenum pname, GLfloat param); /* 190 */
void (GLAPIENTRYP TexGenfvOES)(GLenum coord, GLenum pname, const GLfloat * params); /* 191 */
void (GLAPIENTRYP TexGeniOES)(GLenum coord, GLenum pname, GLint param); /* 192 */
void (GLAPIENTRYP TexGenivOES)(GLenum coord, GLenum pname, const GLint * params); /* 193 */
void (GLAPIENTRYP FeedbackBuffer)(GLsizei size, GLenum type, GLfloat * buffer); /* 194 */
void (GLAPIENTRYP SelectBuffer)(GLsizei size, GLuint * buffer); /* 195 */
GLint (GLAPIENTRYP RenderMode)(GLenum mode); /* 196 */
void (GLAPIENTRYP InitNames)(void); /* 197 */
void (GLAPIENTRYP LoadName)(GLuint name); /* 198 */
void (GLAPIENTRYP PassThrough)(GLfloat token); /* 199 */
void (GLAPIENTRYP PopName)(void); /* 200 */
void (GLAPIENTRYP PushName)(GLuint name); /* 201 */
void (GLAPIENTRYP DrawBuffer)(GLenum mode); /* 202 */
void (GLAPIENTRYP Clear)(GLbitfield mask); /* 203 */
void (GLAPIENTRYP ClearAccum)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); /* 204 */
void (GLAPIENTRYP ClearIndex)(GLfloat c); /* 205 */
void (GLAPIENTRYP ClearColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); /* 206 */
void (GLAPIENTRYP ClearStencil)(GLint s); /* 207 */
void (GLAPIENTRYP ClearDepth)(GLclampd depth); /* 208 */
void (GLAPIENTRYP StencilMask)(GLuint mask); /* 209 */
void (GLAPIENTRYP ColorMask)(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); /* 210 */
void (GLAPIENTRYP DepthMask)(GLboolean flag); /* 211 */
void (GLAPIENTRYP IndexMask)(GLuint mask); /* 212 */
void (GLAPIENTRYP Accum)(GLenum op, GLfloat value); /* 213 */
void (GLAPIENTRYP Disable)(GLenum cap); /* 214 */
void (GLAPIENTRYP Enable)(GLenum cap); /* 215 */
void (GLAPIENTRYP Finish)(void); /* 216 */
void (GLAPIENTRYP Flush)(void); /* 217 */
void (GLAPIENTRYP PopAttrib)(void); /* 218 */
void (GLAPIENTRYP PushAttrib)(GLbitfield mask); /* 219 */
void (GLAPIENTRYP Map1d)(GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble * points); /* 220 */
void (GLAPIENTRYP Map1f)(GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat * points); /* 221 */
void (GLAPIENTRYP Map2d)(GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble * points); /* 222 */
void (GLAPIENTRYP Map2f)(GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat * points); /* 223 */
void (GLAPIENTRYP MapGrid1d)(GLint un, GLdouble u1, GLdouble u2); /* 224 */
void (GLAPIENTRYP MapGrid1f)(GLint un, GLfloat u1, GLfloat u2); /* 225 */
void (GLAPIENTRYP MapGrid2d)(GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2); /* 226 */
void (GLAPIENTRYP MapGrid2f)(GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2); /* 227 */
void (GLAPIENTRYP EvalCoord1d)(GLdouble u); /* 228 */
void (GLAPIENTRYP EvalCoord1dv)(const GLdouble * u); /* 229 */
void (GLAPIENTRYP EvalCoord1f)(GLfloat u); /* 230 */
void (GLAPIENTRYP EvalCoord1fv)(const GLfloat * u); /* 231 */
void (GLAPIENTRYP EvalCoord2d)(GLdouble u, GLdouble v); /* 232 */
void (GLAPIENTRYP EvalCoord2dv)(const GLdouble * u); /* 233 */
void (GLAPIENTRYP EvalCoord2f)(GLfloat u, GLfloat v); /* 234 */
void (GLAPIENTRYP EvalCoord2fv)(const GLfloat * u); /* 235 */
void (GLAPIENTRYP EvalMesh1)(GLenum mode, GLint i1, GLint i2); /* 236 */
void (GLAPIENTRYP EvalPoint1)(GLint i); /* 237 */
void (GLAPIENTRYP EvalMesh2)(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2); /* 238 */
void (GLAPIENTRYP EvalPoint2)(GLint i, GLint j); /* 239 */
void (GLAPIENTRYP AlphaFunc)(GLenum func, GLclampf ref); /* 240 */
void (GLAPIENTRYP BlendFunc)(GLenum sfactor, GLenum dfactor); /* 241 */
void (GLAPIENTRYP LogicOp)(GLenum opcode); /* 242 */
void (GLAPIENTRYP StencilFunc)(GLenum func, GLint ref, GLuint mask); /* 243 */
void (GLAPIENTRYP StencilOp)(GLenum fail, GLenum zfail, GLenum zpass); /* 244 */
void (GLAPIENTRYP DepthFunc)(GLenum func); /* 245 */
void (GLAPIENTRYP PixelZoom)(GLfloat xfactor, GLfloat yfactor); /* 246 */
void (GLAPIENTRYP PixelTransferf)(GLenum pname, GLfloat param); /* 247 */
void (GLAPIENTRYP PixelTransferi)(GLenum pname, GLint param); /* 248 */
void (GLAPIENTRYP PixelStoref)(GLenum pname, GLfloat param); /* 249 */
void (GLAPIENTRYP PixelStorei)(GLenum pname, GLint param); /* 250 */
void (GLAPIENTRYP PixelMapfv)(GLenum map, GLsizei mapsize, const GLfloat * values); /* 251 */
void (GLAPIENTRYP PixelMapuiv)(GLenum map, GLsizei mapsize, const GLuint * values); /* 252 */
void (GLAPIENTRYP PixelMapusv)(GLenum map, GLsizei mapsize, const GLushort * values); /* 253 */
void (GLAPIENTRYP ReadBuffer)(GLenum mode); /* 254 */
void (GLAPIENTRYP CopyPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type); /* 255 */
void (GLAPIENTRYP ReadPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid * pixels); /* 256 */
void (GLAPIENTRYP DrawPixels)(GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels); /* 257 */
void (GLAPIENTRYP GetBooleanv)(GLenum pname, GLboolean * params); /* 258 */
void (GLAPIENTRYP GetClipPlane)(GLenum plane, GLdouble * equation); /* 259 */
void (GLAPIENTRYP GetDoublev)(GLenum pname, GLdouble * params); /* 260 */
GLenum (GLAPIENTRYP GetError)(void); /* 261 */
void (GLAPIENTRYP GetFloatv)(GLenum pname, GLfloat * params); /* 262 */
void (GLAPIENTRYP GetIntegerv)(GLenum pname, GLint * params); /* 263 */
void (GLAPIENTRYP GetLightfv)(GLenum light, GLenum pname, GLfloat * params); /* 264 */
void (GLAPIENTRYP GetLightiv)(GLenum light, GLenum pname, GLint * params); /* 265 */
void (GLAPIENTRYP GetMapdv)(GLenum target, GLenum query, GLdouble * v); /* 266 */
void (GLAPIENTRYP GetMapfv)(GLenum target, GLenum query, GLfloat * v); /* 267 */
void (GLAPIENTRYP GetMapiv)(GLenum target, GLenum query, GLint * v); /* 268 */
void (GLAPIENTRYP GetMaterialfv)(GLenum face, GLenum pname, GLfloat * params); /* 269 */
void (GLAPIENTRYP GetMaterialiv)(GLenum face, GLenum pname, GLint * params); /* 270 */
void (GLAPIENTRYP GetPixelMapfv)(GLenum map, GLfloat * values); /* 271 */
void (GLAPIENTRYP GetPixelMapuiv)(GLenum map, GLuint * values); /* 272 */
void (GLAPIENTRYP GetPixelMapusv)(GLenum map, GLushort * values); /* 273 */
void (GLAPIENTRYP GetPolygonStipple)(GLubyte * mask); /* 274 */
const GLubyte * (GLAPIENTRYP GetString)(GLenum name); /* 275 */
void (GLAPIENTRYP GetTexEnvfv)(GLenum target, GLenum pname, GLfloat * params); /* 276 */
void (GLAPIENTRYP GetTexEnviv)(GLenum target, GLenum pname, GLint * params); /* 277 */
void (GLAPIENTRYP GetTexGendv)(GLenum coord, GLenum pname, GLdouble * params); /* 278 */
void (GLAPIENTRYP GetTexGenfvOES)(GLenum coord, GLenum pname, GLfloat * params); /* 279 */
void (GLAPIENTRYP GetTexGenivOES)(GLenum coord, GLenum pname, GLint * params); /* 280 */
void (GLAPIENTRYP GetTexImage)(GLenum target, GLint level, GLenum format, GLenum type, GLvoid * pixels); /* 281 */
void (GLAPIENTRYP GetTexParameterfv)(GLenum target, GLenum pname, GLfloat * params); /* 282 */
void (GLAPIENTRYP GetTexParameteriv)(GLenum target, GLenum pname, GLint * params); /* 283 */
void (GLAPIENTRYP GetTexLevelParameterfv)(GLenum target, GLint level, GLenum pname, GLfloat * params); /* 284 */
void (GLAPIENTRYP GetTexLevelParameteriv)(GLenum target, GLint level, GLenum pname, GLint * params); /* 285 */
GLboolean (GLAPIENTRYP IsEnabled)(GLenum cap); /* 286 */
GLboolean (GLAPIENTRYP IsList)(GLuint list); /* 287 */
void (GLAPIENTRYP DepthRange)(GLclampd zNear, GLclampd zFar); /* 288 */
void (GLAPIENTRYP Frustum)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); /* 289 */
void (GLAPIENTRYP LoadIdentity)(void); /* 290 */
void (GLAPIENTRYP LoadMatrixf)(const GLfloat * m); /* 291 */
void (GLAPIENTRYP LoadMatrixd)(const GLdouble * m); /* 292 */
void (GLAPIENTRYP MatrixMode)(GLenum mode); /* 293 */
void (GLAPIENTRYP MultMatrixf)(const GLfloat * m); /* 294 */
void (GLAPIENTRYP MultMatrixd)(const GLdouble * m); /* 295 */
void (GLAPIENTRYP Ortho)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); /* 296 */
void (GLAPIENTRYP PopMatrix)(void); /* 297 */
void (GLAPIENTRYP PushMatrix)(void); /* 298 */
void (GLAPIENTRYP Rotated)(GLdouble angle, GLdouble x, GLdouble y, GLdouble z); /* 299 */
void (GLAPIENTRYP Rotatef)(GLfloat angle, GLfloat x, GLfloat y, GLfloat z); /* 300 */
void (GLAPIENTRYP Scaled)(GLdouble x, GLdouble y, GLdouble z); /* 301 */
void (GLAPIENTRYP Scalef)(GLfloat x, GLfloat y, GLfloat z); /* 302 */
void (GLAPIENTRYP Translated)(GLdouble x, GLdouble y, GLdouble z); /* 303 */
void (GLAPIENTRYP Translatef)(GLfloat x, GLfloat y, GLfloat z); /* 304 */
void (GLAPIENTRYP Viewport)(GLint x, GLint y, GLsizei width, GLsizei height); /* 305 */
void (GLAPIENTRYP ArrayElement)(GLint i); /* 306 */
void (GLAPIENTRYP BindTexture)(GLenum target, GLuint texture); /* 307 */
void (GLAPIENTRYP ColorPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); /* 308 */
void (GLAPIENTRYP DisableClientState)(GLenum array); /* 309 */
void (GLAPIENTRYP DrawArrays)(GLenum mode, GLint first, GLsizei count); /* 310 */
void (GLAPIENTRYP DrawElements)(GLenum mode, GLsizei count, GLenum type, const GLvoid * indices); /* 311 */
void (GLAPIENTRYP EdgeFlagPointer)(GLsizei stride, const GLvoid * pointer); /* 312 */
void (GLAPIENTRYP EnableClientState)(GLenum array); /* 313 */
void (GLAPIENTRYP IndexPointer)(GLenum type, GLsizei stride, const GLvoid * pointer); /* 314 */
void (GLAPIENTRYP Indexub)(GLubyte c); /* 315 */
void (GLAPIENTRYP Indexubv)(const GLubyte * c); /* 316 */
void (GLAPIENTRYP InterleavedArrays)(GLenum format, GLsizei stride, const GLvoid * pointer); /* 317 */
void (GLAPIENTRYP NormalPointer)(GLenum type, GLsizei stride, const GLvoid * pointer); /* 318 */
void (GLAPIENTRYP PolygonOffset)(GLfloat factor, GLfloat units); /* 319 */
void (GLAPIENTRYP TexCoordPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); /* 320 */
void (GLAPIENTRYP VertexPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); /* 321 */
GLboolean (GLAPIENTRYP AreTexturesResident)(GLsizei n, const GLuint * textures, GLboolean * residences); /* 322 */
void (GLAPIENTRYP CopyTexImage1D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); /* 323 */
void (GLAPIENTRYP CopyTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); /* 324 */
void (GLAPIENTRYP CopyTexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); /* 325 */
void (GLAPIENTRYP CopyTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); /* 326 */
void (GLAPIENTRYP DeleteTextures)(GLsizei n, const GLuint * textures); /* 327 */
void (GLAPIENTRYP GenTextures)(GLsizei n, GLuint * textures); /* 328 */
void (GLAPIENTRYP GetPointerv)(GLenum pname, GLvoid ** params); /* 329 */
GLboolean (GLAPIENTRYP IsTexture)(GLuint texture); /* 330 */
void (GLAPIENTRYP PrioritizeTextures)(GLsizei n, const GLuint * textures, const GLclampf * priorities); /* 331 */
void (GLAPIENTRYP TexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid * pixels); /* 332 */
void (GLAPIENTRYP TexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels); /* 333 */
void (GLAPIENTRYP PopClientAttrib)(void); /* 334 */
void (GLAPIENTRYP PushClientAttrib)(GLbitfield mask); /* 335 */
void (GLAPIENTRYP BlendColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); /* 336 */
void (GLAPIENTRYP BlendEquationOES)(GLenum mode); /* 337 */
void (GLAPIENTRYP DrawRangeElements)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid * indices); /* 338 */
void (GLAPIENTRYP ColorTable)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * table); /* 339 */
void (GLAPIENTRYP ColorTableParameterfv)(GLenum target, GLenum pname, const GLfloat * params); /* 340 */
void (GLAPIENTRYP ColorTableParameteriv)(GLenum target, GLenum pname, const GLint * params); /* 341 */
void (GLAPIENTRYP CopyColorTable)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); /* 342 */
void (GLAPIENTRYP GetColorTable)(GLenum target, GLenum format, GLenum type, GLvoid * table); /* 343 */
void (GLAPIENTRYP GetColorTableParameterfv)(GLenum target, GLenum pname, GLfloat * params); /* 344 */
void (GLAPIENTRYP GetColorTableParameteriv)(GLenum target, GLenum pname, GLint * params); /* 345 */
void (GLAPIENTRYP ColorSubTable)(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid * data); /* 346 */
void (GLAPIENTRYP CopyColorSubTable)(GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); /* 347 */
void (GLAPIENTRYP ConvolutionFilter1D)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * image); /* 348 */
void (GLAPIENTRYP ConvolutionFilter2D)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * image); /* 349 */
void (GLAPIENTRYP ConvolutionParameterf)(GLenum target, GLenum pname, GLfloat params); /* 350 */
void (GLAPIENTRYP ConvolutionParameterfv)(GLenum target, GLenum pname, const GLfloat * params); /* 351 */
void (GLAPIENTRYP ConvolutionParameteri)(GLenum target, GLenum pname, GLint params); /* 352 */
void (GLAPIENTRYP ConvolutionParameteriv)(GLenum target, GLenum pname, const GLint * params); /* 353 */
void (GLAPIENTRYP CopyConvolutionFilter1D)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); /* 354 */
void (GLAPIENTRYP CopyConvolutionFilter2D)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); /* 355 */
void (GLAPIENTRYP GetConvolutionFilter)(GLenum target, GLenum format, GLenum type, GLvoid * image); /* 356 */
void (GLAPIENTRYP GetConvolutionParameterfv)(GLenum target, GLenum pname, GLfloat * params); /* 357 */
void (GLAPIENTRYP GetConvolutionParameteriv)(GLenum target, GLenum pname, GLint * params); /* 358 */
void (GLAPIENTRYP GetSeparableFilter)(GLenum target, GLenum format, GLenum type, GLvoid * row, GLvoid * column, GLvoid * span); /* 359 */
void (GLAPIENTRYP SeparableFilter2D)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * row, const GLvoid * column); /* 360 */
void (GLAPIENTRYP GetHistogram)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values); /* 361 */
void (GLAPIENTRYP GetHistogramParameterfv)(GLenum target, GLenum pname, GLfloat * params); /* 362 */
void (GLAPIENTRYP GetHistogramParameteriv)(GLenum target, GLenum pname, GLint * params); /* 363 */
void (GLAPIENTRYP GetMinmax)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values); /* 364 */
void (GLAPIENTRYP GetMinmaxParameterfv)(GLenum target, GLenum pname, GLfloat * params); /* 365 */
void (GLAPIENTRYP GetMinmaxParameteriv)(GLenum target, GLenum pname, GLint * params); /* 366 */
void (GLAPIENTRYP Histogram)(GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); /* 367 */
void (GLAPIENTRYP Minmax)(GLenum target, GLenum internalformat, GLboolean sink); /* 368 */
void (GLAPIENTRYP ResetHistogram)(GLenum target); /* 369 */
void (GLAPIENTRYP ResetMinmax)(GLenum target); /* 370 */
void (GLAPIENTRYP TexImage3D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid * pixels); /* 371 */
void (GLAPIENTRYP TexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid * pixels); /* 372 */
void (GLAPIENTRYP CopyTexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); /* 373 */
void (GLAPIENTRYP ActiveTexture)(GLenum texture); /* 374 */
void (GLAPIENTRYP ClientActiveTexture)(GLenum texture); /* 375 */
void (GLAPIENTRYP MultiTexCoord1dARB)(GLenum target, GLdouble s); /* 376 */
void (GLAPIENTRYP MultiTexCoord1dvARB)(GLenum target, const GLdouble * v); /* 377 */
void (GLAPIENTRYP MultiTexCoord1fARB)(GLenum target, GLfloat s); /* 378 */
void (GLAPIENTRYP MultiTexCoord1fvARB)(GLenum target, const GLfloat * v); /* 379 */
void (GLAPIENTRYP MultiTexCoord1iARB)(GLenum target, GLint s); /* 380 */
void (GLAPIENTRYP MultiTexCoord1ivARB)(GLenum target, const GLint * v); /* 381 */
void (GLAPIENTRYP MultiTexCoord1sARB)(GLenum target, GLshort s); /* 382 */
void (GLAPIENTRYP MultiTexCoord1svARB)(GLenum target, const GLshort * v); /* 383 */
void (GLAPIENTRYP MultiTexCoord2dARB)(GLenum target, GLdouble s, GLdouble t); /* 384 */
void (GLAPIENTRYP MultiTexCoord2dvARB)(GLenum target, const GLdouble * v); /* 385 */
void (GLAPIENTRYP MultiTexCoord2fARB)(GLenum target, GLfloat s, GLfloat t); /* 386 */
void (GLAPIENTRYP MultiTexCoord2fvARB)(GLenum target, const GLfloat * v); /* 387 */
void (GLAPIENTRYP MultiTexCoord2iARB)(GLenum target, GLint s, GLint t); /* 388 */
void (GLAPIENTRYP MultiTexCoord2ivARB)(GLenum target, const GLint * v); /* 389 */
void (GLAPIENTRYP MultiTexCoord2sARB)(GLenum target, GLshort s, GLshort t); /* 390 */
void (GLAPIENTRYP MultiTexCoord2svARB)(GLenum target, const GLshort * v); /* 391 */
void (GLAPIENTRYP MultiTexCoord3dARB)(GLenum target, GLdouble s, GLdouble t, GLdouble r); /* 392 */
void (GLAPIENTRYP MultiTexCoord3dvARB)(GLenum target, const GLdouble * v); /* 393 */
void (GLAPIENTRYP MultiTexCoord3fARB)(GLenum target, GLfloat s, GLfloat t, GLfloat r); /* 394 */
void (GLAPIENTRYP MultiTexCoord3fvARB)(GLenum target, const GLfloat * v); /* 395 */
void (GLAPIENTRYP MultiTexCoord3iARB)(GLenum target, GLint s, GLint t, GLint r); /* 396 */
void (GLAPIENTRYP MultiTexCoord3ivARB)(GLenum target, const GLint * v); /* 397 */
void (GLAPIENTRYP MultiTexCoord3sARB)(GLenum target, GLshort s, GLshort t, GLshort r); /* 398 */
void (GLAPIENTRYP MultiTexCoord3svARB)(GLenum target, const GLshort * v); /* 399 */
void (GLAPIENTRYP MultiTexCoord4dARB)(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); /* 400 */
void (GLAPIENTRYP MultiTexCoord4dvARB)(GLenum target, const GLdouble * v); /* 401 */
void (GLAPIENTRYP MultiTexCoord4f)(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); /* 402 */
void (GLAPIENTRYP MultiTexCoord4fvARB)(GLenum target, const GLfloat * v); /* 403 */
void (GLAPIENTRYP MultiTexCoord4iARB)(GLenum target, GLint s, GLint t, GLint r, GLint q); /* 404 */
void (GLAPIENTRYP MultiTexCoord4ivARB)(GLenum target, const GLint * v); /* 405 */
void (GLAPIENTRYP MultiTexCoord4sARB)(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); /* 406 */
void (GLAPIENTRYP MultiTexCoord4svARB)(GLenum target, const GLshort * v); /* 407 */
void (GLAPIENTRYP BlendEquationSeparateOES)(GLenum modeRGB, GLenum modeA); /* 408 */
void (GLAPIENTRYP BlendFuncSeparateOES)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); /* 409 */
void (GLAPIENTRYP DrawTexfOES)(GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height); /* 410 */
void (GLAPIENTRYP DrawTexfvOES)(const GLfloat * coords); /* 411 */
void (GLAPIENTRYP DrawTexiOES)(GLint x, GLint y, GLint z, GLint width, GLint height); /* 412 */
void (GLAPIENTRYP DrawTexivOES)(const GLint * coords); /* 413 */
void (GLAPIENTRYP DrawTexsOES)(GLshort x, GLshort y, GLshort z, GLshort width, GLshort height); /* 414 */
void (GLAPIENTRYP DrawTexsvOES)(const GLshort * coords); /* 415 */
void (GLAPIENTRYP DrawTexxOES)(GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height); /* 416 */
void (GLAPIENTRYP DrawTexxvOES)(const GLfixed * coords); /* 417 */
void (GLAPIENTRYP BindFramebufferOES)(GLenum target, GLuint framebuffer); /* 418 */
void (GLAPIENTRYP BindRenderbufferOES)(GLenum target, GLuint renderbuffer); /* 419 */
GLenum (GLAPIENTRYP CheckFramebufferStatusOES)(GLenum target); /* 420 */
void (GLAPIENTRYP DeleteFramebuffersOES)(GLsizei n, const GLuint * framebuffers); /* 421 */
void (GLAPIENTRYP DeleteRenderbuffersOES)(GLsizei n, const GLuint * renderbuffers); /* 422 */
void (GLAPIENTRYP FramebufferRenderbufferOES)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); /* 423 */
void (GLAPIENTRYP FramebufferTexture2DOES)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); /* 424 */
void (GLAPIENTRYP GenFramebuffersOES)(GLsizei n, GLuint * framebuffers); /* 425 */
void (GLAPIENTRYP GenRenderbuffersOES)(GLsizei n, GLuint * renderbuffers); /* 426 */
void (GLAPIENTRYP GenerateMipmapOES)(GLenum target); /* 427 */
void (GLAPIENTRYP GetFramebufferAttachmentParameterivOES)(GLenum target, GLenum attachment, GLenum pname, GLint * params); /* 428 */
void (GLAPIENTRYP GetRenderbufferParameterivOES)(GLenum target, GLenum pname, GLint * params); /* 429 */
GLboolean (GLAPIENTRYP IsFramebufferOES)(GLuint framebuffer); /* 430 */
GLboolean (GLAPIENTRYP IsRenderbufferOES)(GLuint renderbuffer); /* 431 */
void (GLAPIENTRYP RenderbufferStorageOES)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height); /* 432 */
void (GLAPIENTRYP PointSizePointerOES)(GLenum type, GLsizei stride, const GLvoid * pointer); /* 433 */
GLbitfield (GLAPIENTRYP QueryMatrixxOES)(GLfixed * mantissa, GLint * exponent); /* 434 */
void (GLAPIENTRYP GetTexGenxvOES)(GLenum coord, GLenum pname, GLfixed * params); /* 435 */
void (GLAPIENTRYP TexGenxOES)(GLenum coord, GLenum pname, GLint param); /* 436 */
void (GLAPIENTRYP TexGenxvOES)(GLenum coord, GLenum pname, const GLfixed * params); /* 437 */
void (GLAPIENTRYP GetBufferPointervOES)(GLenum target, GLenum pname, GLvoid ** params); /* 438 */
GLvoid * (GLAPIENTRYP MapBufferOES)(GLenum target, GLenum access); /* 439 */
GLboolean (GLAPIENTRYP UnmapBufferOES)(GLenum target); /* 440 */
void (GLAPIENTRYP MultiDrawArraysEXT)(GLenum mode, const GLint * first, const GLsizei * count, GLsizei primcount); /* 441 */
void (GLAPIENTRYP MultiDrawElementsEXT)(GLenum mode, const GLsizei * count, GLenum type, const GLvoid ** indices, GLsizei primcount); /* 442 */
void (GLAPIENTRYP BindVertexArrayAPPLE)(GLuint array); /* 443 */
void (GLAPIENTRYP DeleteVertexArraysAPPLE)(GLsizei n, const GLuint * arrays); /* 444 */
void (GLAPIENTRYP GenVertexArraysAPPLE)(GLsizei n, GLuint * arrays); /* 445 */
GLboolean (GLAPIENTRYP IsVertexArrayAPPLE)(GLuint array); /* 446 */
void (GLAPIENTRYP EGLImageTargetRenderbufferStorageOES)(GLenum target, GLvoid * writeOffset); /* 447 */
void (GLAPIENTRYP EGLImageTargetTexture2DOES)(GLenum target, GLvoid * writeOffset); /* 448 */
void (GLAPIENTRYP CompressedTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid * data); /* 449 */
void (GLAPIENTRYP CompressedTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid * data); /* 450 */
void (GLAPIENTRYP SampleCoverage)(GLclampf value, GLboolean invert); /* 451 */
void (GLAPIENTRYP BindBuffer)(GLenum target, GLuint buffer); /* 452 */
void (GLAPIENTRYP BufferData)(GLenum target, GLsizeiptr size, const GLvoid * data, GLenum usage); /* 453 */
void (GLAPIENTRYP BufferSubData)(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid * data); /* 454 */
void (GLAPIENTRYP DeleteBuffers)(GLsizei n, const GLuint * buffer); /* 455 */
void (GLAPIENTRYP GenBuffers)(GLsizei n, GLuint * buffer); /* 456 */
void (GLAPIENTRYP GetBufferParameteriv)(GLenum target, GLenum pname, GLint * params); /* 457 */
GLboolean (GLAPIENTRYP IsBuffer)(GLuint buffer); /* 458 */
void (GLAPIENTRYP PointParameterf)(GLenum pname, GLfloat param); /* 459 */
void (GLAPIENTRYP PointParameterfv)(GLenum pname, const GLfloat * params); /* 460 */
void (GLAPIENTRYP AlphaFuncx)(GLenum func, GLclampx ref); /* 461 */
void (GLAPIENTRYP ClearColorx)(GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha); /* 462 */
void (GLAPIENTRYP ClearDepthf)(GLclampf depth); /* 463 */
void (GLAPIENTRYP ClearDepthx)(GLclampx depth); /* 464 */
void (GLAPIENTRYP Color4x)(GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); /* 465 */
void (GLAPIENTRYP DepthRangef)(GLclampf zNear, GLclampf zFar); /* 466 */
void (GLAPIENTRYP DepthRangex)(GLclampx zNear, GLclampx zFar); /* 467 */
void (GLAPIENTRYP Fogx)(GLenum pname, GLfixed param); /* 468 */
void (GLAPIENTRYP Fogxv)(GLenum pname, const GLfixed * params); /* 469 */
void (GLAPIENTRYP Frustumf)(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar); /* 470 */
void (GLAPIENTRYP Frustumx)(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar); /* 471 */
void (GLAPIENTRYP LightModelx)(GLenum pname, GLfixed param); /* 472 */
void (GLAPIENTRYP LightModelxv)(GLenum pname, const GLfixed * params); /* 473 */
void (GLAPIENTRYP Lightx)(GLenum light, GLenum pname, GLfixed param); /* 474 */
void (GLAPIENTRYP Lightxv)(GLenum light, GLenum pname, const GLfixed * params); /* 475 */
void (GLAPIENTRYP LineWidthx)(GLfixed width); /* 476 */
void (GLAPIENTRYP LoadMatrixx)(const GLfixed * m); /* 477 */
void (GLAPIENTRYP Materialx)(GLenum face, GLenum pname, GLfixed param); /* 478 */
void (GLAPIENTRYP Materialxv)(GLenum face, GLenum pname, const GLfixed * params); /* 479 */
void (GLAPIENTRYP MultMatrixx)(const GLfixed * m); /* 480 */
void (GLAPIENTRYP MultiTexCoord4x)(GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q); /* 481 */
void (GLAPIENTRYP Normal3x)(GLfixed nx, GLfixed ny, GLfixed nz); /* 482 */
void (GLAPIENTRYP Orthof)(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar); /* 483 */
void (GLAPIENTRYP Orthox)(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar); /* 484 */
void (GLAPIENTRYP PointSizex)(GLfixed size); /* 485 */
void (GLAPIENTRYP PolygonOffsetx)(GLfixed factor, GLfixed units); /* 486 */
void (GLAPIENTRYP Rotatex)(GLfixed angle, GLfixed x, GLfixed y, GLfixed z); /* 487 */
void (GLAPIENTRYP SampleCoveragex)(GLclampx value, GLboolean invert); /* 488 */
void (GLAPIENTRYP Scalex)(GLfixed x, GLfixed y, GLfixed z); /* 489 */
void (GLAPIENTRYP TexEnvx)(GLenum target, GLenum pname, GLfixed param); /* 490 */
void (GLAPIENTRYP TexEnvxv)(GLenum target, GLenum pname, const GLfixed * params); /* 491 */
void (GLAPIENTRYP TexParameterx)(GLenum target, GLenum pname, GLfixed param); /* 492 */
void (GLAPIENTRYP Translatex)(GLfixed x, GLfixed y, GLfixed z); /* 493 */
void (GLAPIENTRYP ClipPlanef)(GLenum plane, const GLfloat * equation); /* 494 */
void (GLAPIENTRYP ClipPlanex)(GLenum plane, const GLfixed * equation); /* 495 */
void (GLAPIENTRYP GetClipPlanef)(GLenum plane, GLfloat * equation); /* 496 */
void (GLAPIENTRYP GetClipPlanex)(GLenum plane, GLfixed * equation); /* 497 */
void (GLAPIENTRYP GetFixedv)(GLenum pname, GLfixed * params); /* 498 */
void (GLAPIENTRYP GetLightxv)(GLenum light, GLenum pname, GLfixed * params); /* 499 */
void (GLAPIENTRYP GetMaterialxv)(GLenum face, GLenum pname, GLfixed * params); /* 500 */
void (GLAPIENTRYP GetTexEnvxv)(GLenum target, GLenum pname, GLfixed * params); /* 501 */
void (GLAPIENTRYP GetTexParameterxv)(GLenum target, GLenum pname, GLfixed * params); /* 502 */
void (GLAPIENTRYP PointParameterx)(GLenum pname, GLfixed param); /* 503 */
void (GLAPIENTRYP PointParameterxv)(GLenum pname, const GLfixed * params); /* 504 */
void (GLAPIENTRYP TexParameterxv)(GLenum target, GLenum pname, const GLfixed * params); /* 505 */
};
#endif /* !defined( _GLAPI_TABLE_H_ ) */

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,563 +0,0 @@
/* DO NOT EDIT - This file generated automatically by gl_table.py (from Mesa) script */
/*
* Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
* (C) Copyright IBM Corporation 2004
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sub license,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
* BRIAN PAUL, IBM,
* AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#if !defined( _GLAPI_TABLE_H_ )
# define _GLAPI_TABLE_H_
#ifndef GLAPIENTRYP
# ifndef GLAPIENTRY
# define GLAPIENTRY
# endif
# define GLAPIENTRYP GLAPIENTRY *
#endif
struct _glapi_table
{
void (GLAPIENTRYP NewList)(GLuint list, GLenum mode); /* 0 */
void (GLAPIENTRYP EndList)(void); /* 1 */
void (GLAPIENTRYP CallList)(GLuint list); /* 2 */
void (GLAPIENTRYP CallLists)(GLsizei n, GLenum type, const GLvoid * lists); /* 3 */
void (GLAPIENTRYP DeleteLists)(GLuint list, GLsizei range); /* 4 */
GLuint (GLAPIENTRYP GenLists)(GLsizei range); /* 5 */
void (GLAPIENTRYP ListBase)(GLuint base); /* 6 */
void (GLAPIENTRYP Begin)(GLenum mode); /* 7 */
void (GLAPIENTRYP Bitmap)(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte * bitmap); /* 8 */
void (GLAPIENTRYP Color3b)(GLbyte red, GLbyte green, GLbyte blue); /* 9 */
void (GLAPIENTRYP Color3bv)(const GLbyte * v); /* 10 */
void (GLAPIENTRYP Color3d)(GLdouble red, GLdouble green, GLdouble blue); /* 11 */
void (GLAPIENTRYP Color3dv)(const GLdouble * v); /* 12 */
void (GLAPIENTRYP Color3f)(GLfloat red, GLfloat green, GLfloat blue); /* 13 */
void (GLAPIENTRYP Color3fv)(const GLfloat * v); /* 14 */
void (GLAPIENTRYP Color3i)(GLint red, GLint green, GLint blue); /* 15 */
void (GLAPIENTRYP Color3iv)(const GLint * v); /* 16 */
void (GLAPIENTRYP Color3s)(GLshort red, GLshort green, GLshort blue); /* 17 */
void (GLAPIENTRYP Color3sv)(const GLshort * v); /* 18 */
void (GLAPIENTRYP Color3ub)(GLubyte red, GLubyte green, GLubyte blue); /* 19 */
void (GLAPIENTRYP Color3ubv)(const GLubyte * v); /* 20 */
void (GLAPIENTRYP Color3ui)(GLuint red, GLuint green, GLuint blue); /* 21 */
void (GLAPIENTRYP Color3uiv)(const GLuint * v); /* 22 */
void (GLAPIENTRYP Color3us)(GLushort red, GLushort green, GLushort blue); /* 23 */
void (GLAPIENTRYP Color3usv)(const GLushort * v); /* 24 */
void (GLAPIENTRYP Color4b)(GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha); /* 25 */
void (GLAPIENTRYP Color4bv)(const GLbyte * v); /* 26 */
void (GLAPIENTRYP Color4d)(GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha); /* 27 */
void (GLAPIENTRYP Color4dv)(const GLdouble * v); /* 28 */
void (GLAPIENTRYP Color4f)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); /* 29 */
void (GLAPIENTRYP Color4fv)(const GLfloat * v); /* 30 */
void (GLAPIENTRYP Color4i)(GLint red, GLint green, GLint blue, GLint alpha); /* 31 */
void (GLAPIENTRYP Color4iv)(const GLint * v); /* 32 */
void (GLAPIENTRYP Color4s)(GLshort red, GLshort green, GLshort blue, GLshort alpha); /* 33 */
void (GLAPIENTRYP Color4sv)(const GLshort * v); /* 34 */
void (GLAPIENTRYP Color4ub)(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha); /* 35 */
void (GLAPIENTRYP Color4ubv)(const GLubyte * v); /* 36 */
void (GLAPIENTRYP Color4ui)(GLuint red, GLuint green, GLuint blue, GLuint alpha); /* 37 */
void (GLAPIENTRYP Color4uiv)(const GLuint * v); /* 38 */
void (GLAPIENTRYP Color4us)(GLushort red, GLushort green, GLushort blue, GLushort alpha); /* 39 */
void (GLAPIENTRYP Color4usv)(const GLushort * v); /* 40 */
void (GLAPIENTRYP EdgeFlag)(GLboolean flag); /* 41 */
void (GLAPIENTRYP EdgeFlagv)(const GLboolean * flag); /* 42 */
void (GLAPIENTRYP End)(void); /* 43 */
void (GLAPIENTRYP Indexd)(GLdouble c); /* 44 */
void (GLAPIENTRYP Indexdv)(const GLdouble * c); /* 45 */
void (GLAPIENTRYP Indexf)(GLfloat c); /* 46 */
void (GLAPIENTRYP Indexfv)(const GLfloat * c); /* 47 */
void (GLAPIENTRYP Indexi)(GLint c); /* 48 */
void (GLAPIENTRYP Indexiv)(const GLint * c); /* 49 */
void (GLAPIENTRYP Indexs)(GLshort c); /* 50 */
void (GLAPIENTRYP Indexsv)(const GLshort * c); /* 51 */
void (GLAPIENTRYP Normal3b)(GLbyte nx, GLbyte ny, GLbyte nz); /* 52 */
void (GLAPIENTRYP Normal3bv)(const GLbyte * v); /* 53 */
void (GLAPIENTRYP Normal3d)(GLdouble nx, GLdouble ny, GLdouble nz); /* 54 */
void (GLAPIENTRYP Normal3dv)(const GLdouble * v); /* 55 */
void (GLAPIENTRYP Normal3f)(GLfloat nx, GLfloat ny, GLfloat nz); /* 56 */
void (GLAPIENTRYP Normal3fv)(const GLfloat * v); /* 57 */
void (GLAPIENTRYP Normal3i)(GLint nx, GLint ny, GLint nz); /* 58 */
void (GLAPIENTRYP Normal3iv)(const GLint * v); /* 59 */
void (GLAPIENTRYP Normal3s)(GLshort nx, GLshort ny, GLshort nz); /* 60 */
void (GLAPIENTRYP Normal3sv)(const GLshort * v); /* 61 */
void (GLAPIENTRYP RasterPos2d)(GLdouble x, GLdouble y); /* 62 */
void (GLAPIENTRYP RasterPos2dv)(const GLdouble * v); /* 63 */
void (GLAPIENTRYP RasterPos2f)(GLfloat x, GLfloat y); /* 64 */
void (GLAPIENTRYP RasterPos2fv)(const GLfloat * v); /* 65 */
void (GLAPIENTRYP RasterPos2i)(GLint x, GLint y); /* 66 */
void (GLAPIENTRYP RasterPos2iv)(const GLint * v); /* 67 */
void (GLAPIENTRYP RasterPos2s)(GLshort x, GLshort y); /* 68 */
void (GLAPIENTRYP RasterPos2sv)(const GLshort * v); /* 69 */
void (GLAPIENTRYP RasterPos3d)(GLdouble x, GLdouble y, GLdouble z); /* 70 */
void (GLAPIENTRYP RasterPos3dv)(const GLdouble * v); /* 71 */
void (GLAPIENTRYP RasterPos3f)(GLfloat x, GLfloat y, GLfloat z); /* 72 */
void (GLAPIENTRYP RasterPos3fv)(const GLfloat * v); /* 73 */
void (GLAPIENTRYP RasterPos3i)(GLint x, GLint y, GLint z); /* 74 */
void (GLAPIENTRYP RasterPos3iv)(const GLint * v); /* 75 */
void (GLAPIENTRYP RasterPos3s)(GLshort x, GLshort y, GLshort z); /* 76 */
void (GLAPIENTRYP RasterPos3sv)(const GLshort * v); /* 77 */
void (GLAPIENTRYP RasterPos4d)(GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 78 */
void (GLAPIENTRYP RasterPos4dv)(const GLdouble * v); /* 79 */
void (GLAPIENTRYP RasterPos4f)(GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 80 */
void (GLAPIENTRYP RasterPos4fv)(const GLfloat * v); /* 81 */
void (GLAPIENTRYP RasterPos4i)(GLint x, GLint y, GLint z, GLint w); /* 82 */
void (GLAPIENTRYP RasterPos4iv)(const GLint * v); /* 83 */
void (GLAPIENTRYP RasterPos4s)(GLshort x, GLshort y, GLshort z, GLshort w); /* 84 */
void (GLAPIENTRYP RasterPos4sv)(const GLshort * v); /* 85 */
void (GLAPIENTRYP Rectd)(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2); /* 86 */
void (GLAPIENTRYP Rectdv)(const GLdouble * v1, const GLdouble * v2); /* 87 */
void (GLAPIENTRYP Rectf)(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2); /* 88 */
void (GLAPIENTRYP Rectfv)(const GLfloat * v1, const GLfloat * v2); /* 89 */
void (GLAPIENTRYP Recti)(GLint x1, GLint y1, GLint x2, GLint y2); /* 90 */
void (GLAPIENTRYP Rectiv)(const GLint * v1, const GLint * v2); /* 91 */
void (GLAPIENTRYP Rects)(GLshort x1, GLshort y1, GLshort x2, GLshort y2); /* 92 */
void (GLAPIENTRYP Rectsv)(const GLshort * v1, const GLshort * v2); /* 93 */
void (GLAPIENTRYP TexCoord1d)(GLdouble s); /* 94 */
void (GLAPIENTRYP TexCoord1dv)(const GLdouble * v); /* 95 */
void (GLAPIENTRYP TexCoord1f)(GLfloat s); /* 96 */
void (GLAPIENTRYP TexCoord1fv)(const GLfloat * v); /* 97 */
void (GLAPIENTRYP TexCoord1i)(GLint s); /* 98 */
void (GLAPIENTRYP TexCoord1iv)(const GLint * v); /* 99 */
void (GLAPIENTRYP TexCoord1s)(GLshort s); /* 100 */
void (GLAPIENTRYP TexCoord1sv)(const GLshort * v); /* 101 */
void (GLAPIENTRYP TexCoord2d)(GLdouble s, GLdouble t); /* 102 */
void (GLAPIENTRYP TexCoord2dv)(const GLdouble * v); /* 103 */
void (GLAPIENTRYP TexCoord2f)(GLfloat s, GLfloat t); /* 104 */
void (GLAPIENTRYP TexCoord2fv)(const GLfloat * v); /* 105 */
void (GLAPIENTRYP TexCoord2i)(GLint s, GLint t); /* 106 */
void (GLAPIENTRYP TexCoord2iv)(const GLint * v); /* 107 */
void (GLAPIENTRYP TexCoord2s)(GLshort s, GLshort t); /* 108 */
void (GLAPIENTRYP TexCoord2sv)(const GLshort * v); /* 109 */
void (GLAPIENTRYP TexCoord3d)(GLdouble s, GLdouble t, GLdouble r); /* 110 */
void (GLAPIENTRYP TexCoord3dv)(const GLdouble * v); /* 111 */
void (GLAPIENTRYP TexCoord3f)(GLfloat s, GLfloat t, GLfloat r); /* 112 */
void (GLAPIENTRYP TexCoord3fv)(const GLfloat * v); /* 113 */
void (GLAPIENTRYP TexCoord3i)(GLint s, GLint t, GLint r); /* 114 */
void (GLAPIENTRYP TexCoord3iv)(const GLint * v); /* 115 */
void (GLAPIENTRYP TexCoord3s)(GLshort s, GLshort t, GLshort r); /* 116 */
void (GLAPIENTRYP TexCoord3sv)(const GLshort * v); /* 117 */
void (GLAPIENTRYP TexCoord4d)(GLdouble s, GLdouble t, GLdouble r, GLdouble q); /* 118 */
void (GLAPIENTRYP TexCoord4dv)(const GLdouble * v); /* 119 */
void (GLAPIENTRYP TexCoord4f)(GLfloat s, GLfloat t, GLfloat r, GLfloat q); /* 120 */
void (GLAPIENTRYP TexCoord4fv)(const GLfloat * v); /* 121 */
void (GLAPIENTRYP TexCoord4i)(GLint s, GLint t, GLint r, GLint q); /* 122 */
void (GLAPIENTRYP TexCoord4iv)(const GLint * v); /* 123 */
void (GLAPIENTRYP TexCoord4s)(GLshort s, GLshort t, GLshort r, GLshort q); /* 124 */
void (GLAPIENTRYP TexCoord4sv)(const GLshort * v); /* 125 */
void (GLAPIENTRYP Vertex2d)(GLdouble x, GLdouble y); /* 126 */
void (GLAPIENTRYP Vertex2dv)(const GLdouble * v); /* 127 */
void (GLAPIENTRYP Vertex2f)(GLfloat x, GLfloat y); /* 128 */
void (GLAPIENTRYP Vertex2fv)(const GLfloat * v); /* 129 */
void (GLAPIENTRYP Vertex2i)(GLint x, GLint y); /* 130 */
void (GLAPIENTRYP Vertex2iv)(const GLint * v); /* 131 */
void (GLAPIENTRYP Vertex2s)(GLshort x, GLshort y); /* 132 */
void (GLAPIENTRYP Vertex2sv)(const GLshort * v); /* 133 */
void (GLAPIENTRYP Vertex3d)(GLdouble x, GLdouble y, GLdouble z); /* 134 */
void (GLAPIENTRYP Vertex3dv)(const GLdouble * v); /* 135 */
void (GLAPIENTRYP Vertex3f)(GLfloat x, GLfloat y, GLfloat z); /* 136 */
void (GLAPIENTRYP Vertex3fv)(const GLfloat * v); /* 137 */
void (GLAPIENTRYP Vertex3i)(GLint x, GLint y, GLint z); /* 138 */
void (GLAPIENTRYP Vertex3iv)(const GLint * v); /* 139 */
void (GLAPIENTRYP Vertex3s)(GLshort x, GLshort y, GLshort z); /* 140 */
void (GLAPIENTRYP Vertex3sv)(const GLshort * v); /* 141 */
void (GLAPIENTRYP Vertex4d)(GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 142 */
void (GLAPIENTRYP Vertex4dv)(const GLdouble * v); /* 143 */
void (GLAPIENTRYP Vertex4f)(GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 144 */
void (GLAPIENTRYP Vertex4fv)(const GLfloat * v); /* 145 */
void (GLAPIENTRYP Vertex4i)(GLint x, GLint y, GLint z, GLint w); /* 146 */
void (GLAPIENTRYP Vertex4iv)(const GLint * v); /* 147 */
void (GLAPIENTRYP Vertex4s)(GLshort x, GLshort y, GLshort z, GLshort w); /* 148 */
void (GLAPIENTRYP Vertex4sv)(const GLshort * v); /* 149 */
void (GLAPIENTRYP ClipPlane)(GLenum plane, const GLdouble * equation); /* 150 */
void (GLAPIENTRYP ColorMaterial)(GLenum face, GLenum mode); /* 151 */
void (GLAPIENTRYP CullFace)(GLenum mode); /* 152 */
void (GLAPIENTRYP Fogf)(GLenum pname, GLfloat param); /* 153 */
void (GLAPIENTRYP Fogfv)(GLenum pname, const GLfloat * params); /* 154 */
void (GLAPIENTRYP Fogi)(GLenum pname, GLint param); /* 155 */
void (GLAPIENTRYP Fogiv)(GLenum pname, const GLint * params); /* 156 */
void (GLAPIENTRYP FrontFace)(GLenum mode); /* 157 */
void (GLAPIENTRYP Hint)(GLenum target, GLenum mode); /* 158 */
void (GLAPIENTRYP Lightf)(GLenum light, GLenum pname, GLfloat param); /* 159 */
void (GLAPIENTRYP Lightfv)(GLenum light, GLenum pname, const GLfloat * params); /* 160 */
void (GLAPIENTRYP Lighti)(GLenum light, GLenum pname, GLint param); /* 161 */
void (GLAPIENTRYP Lightiv)(GLenum light, GLenum pname, const GLint * params); /* 162 */
void (GLAPIENTRYP LightModelf)(GLenum pname, GLfloat param); /* 163 */
void (GLAPIENTRYP LightModelfv)(GLenum pname, const GLfloat * params); /* 164 */
void (GLAPIENTRYP LightModeli)(GLenum pname, GLint param); /* 165 */
void (GLAPIENTRYP LightModeliv)(GLenum pname, const GLint * params); /* 166 */
void (GLAPIENTRYP LineStipple)(GLint factor, GLushort pattern); /* 167 */
void (GLAPIENTRYP LineWidth)(GLfloat width); /* 168 */
void (GLAPIENTRYP Materialf)(GLenum face, GLenum pname, GLfloat param); /* 169 */
void (GLAPIENTRYP Materialfv)(GLenum face, GLenum pname, const GLfloat * params); /* 170 */
void (GLAPIENTRYP Materiali)(GLenum face, GLenum pname, GLint param); /* 171 */
void (GLAPIENTRYP Materialiv)(GLenum face, GLenum pname, const GLint * params); /* 172 */
void (GLAPIENTRYP PointSize)(GLfloat size); /* 173 */
void (GLAPIENTRYP PolygonMode)(GLenum face, GLenum mode); /* 174 */
void (GLAPIENTRYP PolygonStipple)(const GLubyte * mask); /* 175 */
void (GLAPIENTRYP Scissor)(GLint x, GLint y, GLsizei width, GLsizei height); /* 176 */
void (GLAPIENTRYP ShadeModel)(GLenum mode); /* 177 */
void (GLAPIENTRYP TexParameterf)(GLenum target, GLenum pname, GLfloat param); /* 178 */
void (GLAPIENTRYP TexParameterfv)(GLenum target, GLenum pname, const GLfloat * params); /* 179 */
void (GLAPIENTRYP TexParameteri)(GLenum target, GLenum pname, GLint param); /* 180 */
void (GLAPIENTRYP TexParameteriv)(GLenum target, GLenum pname, const GLint * params); /* 181 */
void (GLAPIENTRYP TexImage1D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid * pixels); /* 182 */
void (GLAPIENTRYP TexImage2D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid * pixels); /* 183 */
void (GLAPIENTRYP TexEnvf)(GLenum target, GLenum pname, GLfloat param); /* 184 */
void (GLAPIENTRYP TexEnvfv)(GLenum target, GLenum pname, const GLfloat * params); /* 185 */
void (GLAPIENTRYP TexEnvi)(GLenum target, GLenum pname, GLint param); /* 186 */
void (GLAPIENTRYP TexEnviv)(GLenum target, GLenum pname, const GLint * params); /* 187 */
void (GLAPIENTRYP TexGend)(GLenum coord, GLenum pname, GLdouble param); /* 188 */
void (GLAPIENTRYP TexGendv)(GLenum coord, GLenum pname, const GLdouble * params); /* 189 */
void (GLAPIENTRYP TexGenf)(GLenum coord, GLenum pname, GLfloat param); /* 190 */
void (GLAPIENTRYP TexGenfv)(GLenum coord, GLenum pname, const GLfloat * params); /* 191 */
void (GLAPIENTRYP TexGeni)(GLenum coord, GLenum pname, GLint param); /* 192 */
void (GLAPIENTRYP TexGeniv)(GLenum coord, GLenum pname, const GLint * params); /* 193 */
void (GLAPIENTRYP FeedbackBuffer)(GLsizei size, GLenum type, GLfloat * buffer); /* 194 */
void (GLAPIENTRYP SelectBuffer)(GLsizei size, GLuint * buffer); /* 195 */
GLint (GLAPIENTRYP RenderMode)(GLenum mode); /* 196 */
void (GLAPIENTRYP InitNames)(void); /* 197 */
void (GLAPIENTRYP LoadName)(GLuint name); /* 198 */
void (GLAPIENTRYP PassThrough)(GLfloat token); /* 199 */
void (GLAPIENTRYP PopName)(void); /* 200 */
void (GLAPIENTRYP PushName)(GLuint name); /* 201 */
void (GLAPIENTRYP DrawBuffer)(GLenum mode); /* 202 */
void (GLAPIENTRYP Clear)(GLbitfield mask); /* 203 */
void (GLAPIENTRYP ClearAccum)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); /* 204 */
void (GLAPIENTRYP ClearIndex)(GLfloat c); /* 205 */
void (GLAPIENTRYP ClearColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); /* 206 */
void (GLAPIENTRYP ClearStencil)(GLint s); /* 207 */
void (GLAPIENTRYP ClearDepth)(GLclampd depth); /* 208 */
void (GLAPIENTRYP StencilMask)(GLuint mask); /* 209 */
void (GLAPIENTRYP ColorMask)(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); /* 210 */
void (GLAPIENTRYP DepthMask)(GLboolean flag); /* 211 */
void (GLAPIENTRYP IndexMask)(GLuint mask); /* 212 */
void (GLAPIENTRYP Accum)(GLenum op, GLfloat value); /* 213 */
void (GLAPIENTRYP Disable)(GLenum cap); /* 214 */
void (GLAPIENTRYP Enable)(GLenum cap); /* 215 */
void (GLAPIENTRYP Finish)(void); /* 216 */
void (GLAPIENTRYP Flush)(void); /* 217 */
void (GLAPIENTRYP PopAttrib)(void); /* 218 */
void (GLAPIENTRYP PushAttrib)(GLbitfield mask); /* 219 */
void (GLAPIENTRYP Map1d)(GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble * points); /* 220 */
void (GLAPIENTRYP Map1f)(GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat * points); /* 221 */
void (GLAPIENTRYP Map2d)(GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble * points); /* 222 */
void (GLAPIENTRYP Map2f)(GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat * points); /* 223 */
void (GLAPIENTRYP MapGrid1d)(GLint un, GLdouble u1, GLdouble u2); /* 224 */
void (GLAPIENTRYP MapGrid1f)(GLint un, GLfloat u1, GLfloat u2); /* 225 */
void (GLAPIENTRYP MapGrid2d)(GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2); /* 226 */
void (GLAPIENTRYP MapGrid2f)(GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2); /* 227 */
void (GLAPIENTRYP EvalCoord1d)(GLdouble u); /* 228 */
void (GLAPIENTRYP EvalCoord1dv)(const GLdouble * u); /* 229 */
void (GLAPIENTRYP EvalCoord1f)(GLfloat u); /* 230 */
void (GLAPIENTRYP EvalCoord1fv)(const GLfloat * u); /* 231 */
void (GLAPIENTRYP EvalCoord2d)(GLdouble u, GLdouble v); /* 232 */
void (GLAPIENTRYP EvalCoord2dv)(const GLdouble * u); /* 233 */
void (GLAPIENTRYP EvalCoord2f)(GLfloat u, GLfloat v); /* 234 */
void (GLAPIENTRYP EvalCoord2fv)(const GLfloat * u); /* 235 */
void (GLAPIENTRYP EvalMesh1)(GLenum mode, GLint i1, GLint i2); /* 236 */
void (GLAPIENTRYP EvalPoint1)(GLint i); /* 237 */
void (GLAPIENTRYP EvalMesh2)(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2); /* 238 */
void (GLAPIENTRYP EvalPoint2)(GLint i, GLint j); /* 239 */
void (GLAPIENTRYP AlphaFunc)(GLenum func, GLclampf ref); /* 240 */
void (GLAPIENTRYP BlendFunc)(GLenum sfactor, GLenum dfactor); /* 241 */
void (GLAPIENTRYP LogicOp)(GLenum opcode); /* 242 */
void (GLAPIENTRYP StencilFunc)(GLenum func, GLint ref, GLuint mask); /* 243 */
void (GLAPIENTRYP StencilOp)(GLenum fail, GLenum zfail, GLenum zpass); /* 244 */
void (GLAPIENTRYP DepthFunc)(GLenum func); /* 245 */
void (GLAPIENTRYP PixelZoom)(GLfloat xfactor, GLfloat yfactor); /* 246 */
void (GLAPIENTRYP PixelTransferf)(GLenum pname, GLfloat param); /* 247 */
void (GLAPIENTRYP PixelTransferi)(GLenum pname, GLint param); /* 248 */
void (GLAPIENTRYP PixelStoref)(GLenum pname, GLfloat param); /* 249 */
void (GLAPIENTRYP PixelStorei)(GLenum pname, GLint param); /* 250 */
void (GLAPIENTRYP PixelMapfv)(GLenum map, GLsizei mapsize, const GLfloat * values); /* 251 */
void (GLAPIENTRYP PixelMapuiv)(GLenum map, GLsizei mapsize, const GLuint * values); /* 252 */
void (GLAPIENTRYP PixelMapusv)(GLenum map, GLsizei mapsize, const GLushort * values); /* 253 */
void (GLAPIENTRYP ReadBuffer)(GLenum mode); /* 254 */
void (GLAPIENTRYP CopyPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type); /* 255 */
void (GLAPIENTRYP ReadPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid * pixels); /* 256 */
void (GLAPIENTRYP DrawPixels)(GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels); /* 257 */
void (GLAPIENTRYP GetBooleanv)(GLenum pname, GLboolean * params); /* 258 */
void (GLAPIENTRYP GetClipPlane)(GLenum plane, GLdouble * equation); /* 259 */
void (GLAPIENTRYP GetDoublev)(GLenum pname, GLdouble * params); /* 260 */
GLenum (GLAPIENTRYP GetError)(void); /* 261 */
void (GLAPIENTRYP GetFloatv)(GLenum pname, GLfloat * params); /* 262 */
void (GLAPIENTRYP GetIntegerv)(GLenum pname, GLint * params); /* 263 */
void (GLAPIENTRYP GetLightfv)(GLenum light, GLenum pname, GLfloat * params); /* 264 */
void (GLAPIENTRYP GetLightiv)(GLenum light, GLenum pname, GLint * params); /* 265 */
void (GLAPIENTRYP GetMapdv)(GLenum target, GLenum query, GLdouble * v); /* 266 */
void (GLAPIENTRYP GetMapfv)(GLenum target, GLenum query, GLfloat * v); /* 267 */
void (GLAPIENTRYP GetMapiv)(GLenum target, GLenum query, GLint * v); /* 268 */
void (GLAPIENTRYP GetMaterialfv)(GLenum face, GLenum pname, GLfloat * params); /* 269 */
void (GLAPIENTRYP GetMaterialiv)(GLenum face, GLenum pname, GLint * params); /* 270 */
void (GLAPIENTRYP GetPixelMapfv)(GLenum map, GLfloat * values); /* 271 */
void (GLAPIENTRYP GetPixelMapuiv)(GLenum map, GLuint * values); /* 272 */
void (GLAPIENTRYP GetPixelMapusv)(GLenum map, GLushort * values); /* 273 */
void (GLAPIENTRYP GetPolygonStipple)(GLubyte * mask); /* 274 */
const GLubyte * (GLAPIENTRYP GetString)(GLenum name); /* 275 */
void (GLAPIENTRYP GetTexEnvfv)(GLenum target, GLenum pname, GLfloat * params); /* 276 */
void (GLAPIENTRYP GetTexEnviv)(GLenum target, GLenum pname, GLint * params); /* 277 */
void (GLAPIENTRYP GetTexGendv)(GLenum coord, GLenum pname, GLdouble * params); /* 278 */
void (GLAPIENTRYP GetTexGenfv)(GLenum coord, GLenum pname, GLfloat * params); /* 279 */
void (GLAPIENTRYP GetTexGeniv)(GLenum coord, GLenum pname, GLint * params); /* 280 */
void (GLAPIENTRYP GetTexImage)(GLenum target, GLint level, GLenum format, GLenum type, GLvoid * pixels); /* 281 */
void (GLAPIENTRYP GetTexParameterfv)(GLenum target, GLenum pname, GLfloat * params); /* 282 */
void (GLAPIENTRYP GetTexParameteriv)(GLenum target, GLenum pname, GLint * params); /* 283 */
void (GLAPIENTRYP GetTexLevelParameterfv)(GLenum target, GLint level, GLenum pname, GLfloat * params); /* 284 */
void (GLAPIENTRYP GetTexLevelParameteriv)(GLenum target, GLint level, GLenum pname, GLint * params); /* 285 */
GLboolean (GLAPIENTRYP IsEnabled)(GLenum cap); /* 286 */
GLboolean (GLAPIENTRYP IsList)(GLuint list); /* 287 */
void (GLAPIENTRYP DepthRange)(GLclampd zNear, GLclampd zFar); /* 288 */
void (GLAPIENTRYP Frustum)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); /* 289 */
void (GLAPIENTRYP LoadIdentity)(void); /* 290 */
void (GLAPIENTRYP LoadMatrixf)(const GLfloat * m); /* 291 */
void (GLAPIENTRYP LoadMatrixd)(const GLdouble * m); /* 292 */
void (GLAPIENTRYP MatrixMode)(GLenum mode); /* 293 */
void (GLAPIENTRYP MultMatrixf)(const GLfloat * m); /* 294 */
void (GLAPIENTRYP MultMatrixd)(const GLdouble * m); /* 295 */
void (GLAPIENTRYP Ortho)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); /* 296 */
void (GLAPIENTRYP PopMatrix)(void); /* 297 */
void (GLAPIENTRYP PushMatrix)(void); /* 298 */
void (GLAPIENTRYP Rotated)(GLdouble angle, GLdouble x, GLdouble y, GLdouble z); /* 299 */
void (GLAPIENTRYP Rotatef)(GLfloat angle, GLfloat x, GLfloat y, GLfloat z); /* 300 */
void (GLAPIENTRYP Scaled)(GLdouble x, GLdouble y, GLdouble z); /* 301 */
void (GLAPIENTRYP Scalef)(GLfloat x, GLfloat y, GLfloat z); /* 302 */
void (GLAPIENTRYP Translated)(GLdouble x, GLdouble y, GLdouble z); /* 303 */
void (GLAPIENTRYP Translatef)(GLfloat x, GLfloat y, GLfloat z); /* 304 */
void (GLAPIENTRYP Viewport)(GLint x, GLint y, GLsizei width, GLsizei height); /* 305 */
void (GLAPIENTRYP ArrayElement)(GLint i); /* 306 */
void (GLAPIENTRYP BindTexture)(GLenum target, GLuint texture); /* 307 */
void (GLAPIENTRYP ColorPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); /* 308 */
void (GLAPIENTRYP DisableClientState)(GLenum array); /* 309 */
void (GLAPIENTRYP DrawArrays)(GLenum mode, GLint first, GLsizei count); /* 310 */
void (GLAPIENTRYP DrawElements)(GLenum mode, GLsizei count, GLenum type, const GLvoid * indices); /* 311 */
void (GLAPIENTRYP EdgeFlagPointer)(GLsizei stride, const GLvoid * pointer); /* 312 */
void (GLAPIENTRYP EnableClientState)(GLenum array); /* 313 */
void (GLAPIENTRYP IndexPointer)(GLenum type, GLsizei stride, const GLvoid * pointer); /* 314 */
void (GLAPIENTRYP Indexub)(GLubyte c); /* 315 */
void (GLAPIENTRYP Indexubv)(const GLubyte * c); /* 316 */
void (GLAPIENTRYP InterleavedArrays)(GLenum format, GLsizei stride, const GLvoid * pointer); /* 317 */
void (GLAPIENTRYP NormalPointer)(GLenum type, GLsizei stride, const GLvoid * pointer); /* 318 */
void (GLAPIENTRYP PolygonOffset)(GLfloat factor, GLfloat units); /* 319 */
void (GLAPIENTRYP TexCoordPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); /* 320 */
void (GLAPIENTRYP VertexPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); /* 321 */
GLboolean (GLAPIENTRYP AreTexturesResident)(GLsizei n, const GLuint * textures, GLboolean * residences); /* 322 */
void (GLAPIENTRYP CopyTexImage1D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); /* 323 */
void (GLAPIENTRYP CopyTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); /* 324 */
void (GLAPIENTRYP CopyTexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); /* 325 */
void (GLAPIENTRYP CopyTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); /* 326 */
void (GLAPIENTRYP DeleteTextures)(GLsizei n, const GLuint * textures); /* 327 */
void (GLAPIENTRYP GenTextures)(GLsizei n, GLuint * textures); /* 328 */
void (GLAPIENTRYP GetPointerv)(GLenum pname, GLvoid ** params); /* 329 */
GLboolean (GLAPIENTRYP IsTexture)(GLuint texture); /* 330 */
void (GLAPIENTRYP PrioritizeTextures)(GLsizei n, const GLuint * textures, const GLclampf * priorities); /* 331 */
void (GLAPIENTRYP TexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid * pixels); /* 332 */
void (GLAPIENTRYP TexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels); /* 333 */
void (GLAPIENTRYP PopClientAttrib)(void); /* 334 */
void (GLAPIENTRYP PushClientAttrib)(GLbitfield mask); /* 335 */
void (GLAPIENTRYP BlendColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); /* 336 */
void (GLAPIENTRYP BlendEquation)(GLenum mode); /* 337 */
void (GLAPIENTRYP DrawRangeElements)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid * indices); /* 338 */
void (GLAPIENTRYP ColorTable)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * table); /* 339 */
void (GLAPIENTRYP ColorTableParameterfv)(GLenum target, GLenum pname, const GLfloat * params); /* 340 */
void (GLAPIENTRYP ColorTableParameteriv)(GLenum target, GLenum pname, const GLint * params); /* 341 */
void (GLAPIENTRYP CopyColorTable)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); /* 342 */
void (GLAPIENTRYP GetColorTable)(GLenum target, GLenum format, GLenum type, GLvoid * table); /* 343 */
void (GLAPIENTRYP GetColorTableParameterfv)(GLenum target, GLenum pname, GLfloat * params); /* 344 */
void (GLAPIENTRYP GetColorTableParameteriv)(GLenum target, GLenum pname, GLint * params); /* 345 */
void (GLAPIENTRYP ColorSubTable)(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid * data); /* 346 */
void (GLAPIENTRYP CopyColorSubTable)(GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); /* 347 */
void (GLAPIENTRYP ConvolutionFilter1D)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * image); /* 348 */
void (GLAPIENTRYP ConvolutionFilter2D)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * image); /* 349 */
void (GLAPIENTRYP ConvolutionParameterf)(GLenum target, GLenum pname, GLfloat params); /* 350 */
void (GLAPIENTRYP ConvolutionParameterfv)(GLenum target, GLenum pname, const GLfloat * params); /* 351 */
void (GLAPIENTRYP ConvolutionParameteri)(GLenum target, GLenum pname, GLint params); /* 352 */
void (GLAPIENTRYP ConvolutionParameteriv)(GLenum target, GLenum pname, const GLint * params); /* 353 */
void (GLAPIENTRYP CopyConvolutionFilter1D)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); /* 354 */
void (GLAPIENTRYP CopyConvolutionFilter2D)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); /* 355 */
void (GLAPIENTRYP GetConvolutionFilter)(GLenum target, GLenum format, GLenum type, GLvoid * image); /* 356 */
void (GLAPIENTRYP GetConvolutionParameterfv)(GLenum target, GLenum pname, GLfloat * params); /* 357 */
void (GLAPIENTRYP GetConvolutionParameteriv)(GLenum target, GLenum pname, GLint * params); /* 358 */
void (GLAPIENTRYP GetSeparableFilter)(GLenum target, GLenum format, GLenum type, GLvoid * row, GLvoid * column, GLvoid * span); /* 359 */
void (GLAPIENTRYP SeparableFilter2D)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * row, const GLvoid * column); /* 360 */
void (GLAPIENTRYP GetHistogram)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values); /* 361 */
void (GLAPIENTRYP GetHistogramParameterfv)(GLenum target, GLenum pname, GLfloat * params); /* 362 */
void (GLAPIENTRYP GetHistogramParameteriv)(GLenum target, GLenum pname, GLint * params); /* 363 */
void (GLAPIENTRYP GetMinmax)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values); /* 364 */
void (GLAPIENTRYP GetMinmaxParameterfv)(GLenum target, GLenum pname, GLfloat * params); /* 365 */
void (GLAPIENTRYP GetMinmaxParameteriv)(GLenum target, GLenum pname, GLint * params); /* 366 */
void (GLAPIENTRYP Histogram)(GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); /* 367 */
void (GLAPIENTRYP Minmax)(GLenum target, GLenum internalformat, GLboolean sink); /* 368 */
void (GLAPIENTRYP ResetHistogram)(GLenum target); /* 369 */
void (GLAPIENTRYP ResetMinmax)(GLenum target); /* 370 */
void (GLAPIENTRYP TexImage3DOES)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid * pixels); /* 371 */
void (GLAPIENTRYP TexSubImage3DOES)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid * pixels); /* 372 */
void (GLAPIENTRYP CopyTexSubImage3DOES)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); /* 373 */
void (GLAPIENTRYP ActiveTexture)(GLenum texture); /* 374 */
void (GLAPIENTRYP ClientActiveTextureARB)(GLenum texture); /* 375 */
void (GLAPIENTRYP MultiTexCoord1dARB)(GLenum target, GLdouble s); /* 376 */
void (GLAPIENTRYP MultiTexCoord1dvARB)(GLenum target, const GLdouble * v); /* 377 */
void (GLAPIENTRYP MultiTexCoord1fARB)(GLenum target, GLfloat s); /* 378 */
void (GLAPIENTRYP MultiTexCoord1fvARB)(GLenum target, const GLfloat * v); /* 379 */
void (GLAPIENTRYP MultiTexCoord1iARB)(GLenum target, GLint s); /* 380 */
void (GLAPIENTRYP MultiTexCoord1ivARB)(GLenum target, const GLint * v); /* 381 */
void (GLAPIENTRYP MultiTexCoord1sARB)(GLenum target, GLshort s); /* 382 */
void (GLAPIENTRYP MultiTexCoord1svARB)(GLenum target, const GLshort * v); /* 383 */
void (GLAPIENTRYP MultiTexCoord2dARB)(GLenum target, GLdouble s, GLdouble t); /* 384 */
void (GLAPIENTRYP MultiTexCoord2dvARB)(GLenum target, const GLdouble * v); /* 385 */
void (GLAPIENTRYP MultiTexCoord2fARB)(GLenum target, GLfloat s, GLfloat t); /* 386 */
void (GLAPIENTRYP MultiTexCoord2fvARB)(GLenum target, const GLfloat * v); /* 387 */
void (GLAPIENTRYP MultiTexCoord2iARB)(GLenum target, GLint s, GLint t); /* 388 */
void (GLAPIENTRYP MultiTexCoord2ivARB)(GLenum target, const GLint * v); /* 389 */
void (GLAPIENTRYP MultiTexCoord2sARB)(GLenum target, GLshort s, GLshort t); /* 390 */
void (GLAPIENTRYP MultiTexCoord2svARB)(GLenum target, const GLshort * v); /* 391 */
void (GLAPIENTRYP MultiTexCoord3dARB)(GLenum target, GLdouble s, GLdouble t, GLdouble r); /* 392 */
void (GLAPIENTRYP MultiTexCoord3dvARB)(GLenum target, const GLdouble * v); /* 393 */
void (GLAPIENTRYP MultiTexCoord3fARB)(GLenum target, GLfloat s, GLfloat t, GLfloat r); /* 394 */
void (GLAPIENTRYP MultiTexCoord3fvARB)(GLenum target, const GLfloat * v); /* 395 */
void (GLAPIENTRYP MultiTexCoord3iARB)(GLenum target, GLint s, GLint t, GLint r); /* 396 */
void (GLAPIENTRYP MultiTexCoord3ivARB)(GLenum target, const GLint * v); /* 397 */
void (GLAPIENTRYP MultiTexCoord3sARB)(GLenum target, GLshort s, GLshort t, GLshort r); /* 398 */
void (GLAPIENTRYP MultiTexCoord3svARB)(GLenum target, const GLshort * v); /* 399 */
void (GLAPIENTRYP MultiTexCoord4dARB)(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); /* 400 */
void (GLAPIENTRYP MultiTexCoord4dvARB)(GLenum target, const GLdouble * v); /* 401 */
void (GLAPIENTRYP MultiTexCoord4fARB)(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); /* 402 */
void (GLAPIENTRYP MultiTexCoord4fvARB)(GLenum target, const GLfloat * v); /* 403 */
void (GLAPIENTRYP MultiTexCoord4iARB)(GLenum target, GLint s, GLint t, GLint r, GLint q); /* 404 */
void (GLAPIENTRYP MultiTexCoord4ivARB)(GLenum target, const GLint * v); /* 405 */
void (GLAPIENTRYP MultiTexCoord4sARB)(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); /* 406 */
void (GLAPIENTRYP MultiTexCoord4svARB)(GLenum target, const GLshort * v); /* 407 */
void (GLAPIENTRYP GetBufferPointervOES)(GLenum target, GLenum pname, GLvoid ** params); /* 408 */
GLvoid * (GLAPIENTRYP MapBufferOES)(GLenum target, GLenum access); /* 409 */
GLboolean (GLAPIENTRYP UnmapBufferOES)(GLenum target); /* 410 */
void (GLAPIENTRYP CompressedTexImage3DOES)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid * data); /* 411 */
void (GLAPIENTRYP CompressedTexSubImage3DOES)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid * data); /* 412 */
void (GLAPIENTRYP FramebufferTexture3DOES)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); /* 413 */
void (GLAPIENTRYP GetProgramBinaryOES)(GLuint program, GLsizei bufSize, GLsizei * length, GLenum * binaryFormat, GLvoid * binary); /* 414 */
void (GLAPIENTRYP ProgramBinaryOES)(GLuint program, GLenum binaryFormat, const GLvoid * binary, GLint length); /* 415 */
void (GLAPIENTRYP MultiDrawArraysEXT)(GLenum mode, const GLint * first, const GLsizei * count, GLsizei primcount); /* 416 */
void (GLAPIENTRYP MultiDrawElementsEXT)(GLenum mode, const GLsizei * count, GLenum type, const GLvoid ** indices, GLsizei primcount); /* 417 */
void (GLAPIENTRYP BindVertexArrayAPPLE)(GLuint array); /* 418 */
void (GLAPIENTRYP DeleteVertexArraysAPPLE)(GLsizei n, const GLuint * arrays); /* 419 */
void (GLAPIENTRYP GenVertexArraysAPPLE)(GLsizei n, GLuint * arrays); /* 420 */
GLboolean (GLAPIENTRYP IsVertexArrayAPPLE)(GLuint array); /* 421 */
void (GLAPIENTRYP EGLImageTargetRenderbufferStorageOES)(GLenum target, GLvoid * writeOffset); /* 422 */
void (GLAPIENTRYP EGLImageTargetTexture2DOES)(GLenum target, GLvoid * writeOffset); /* 423 */
void (GLAPIENTRYP CompressedTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid * data); /* 424 */
void (GLAPIENTRYP CompressedTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid * data); /* 425 */
void (GLAPIENTRYP SampleCoverage)(GLclampf value, GLboolean invert); /* 426 */
void (GLAPIENTRYP BindBuffer)(GLenum target, GLuint buffer); /* 427 */
void (GLAPIENTRYP BufferData)(GLenum target, GLsizeiptr size, const GLvoid * data, GLenum usage); /* 428 */
void (GLAPIENTRYP BufferSubData)(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid * data); /* 429 */
void (GLAPIENTRYP DeleteBuffers)(GLsizei n, const GLuint * buffer); /* 430 */
void (GLAPIENTRYP GenBuffers)(GLsizei n, GLuint * buffer); /* 431 */
void (GLAPIENTRYP GetBufferParameteriv)(GLenum target, GLenum pname, GLint * params); /* 432 */
GLboolean (GLAPIENTRYP IsBuffer)(GLuint buffer); /* 433 */
void (GLAPIENTRYP AttachShader)(GLuint program, GLuint shader); /* 434 */
void (GLAPIENTRYP BindAttribLocation)(GLuint program, GLuint index, const GLchar * name); /* 435 */
void (GLAPIENTRYP BlendEquationSeparate)(GLenum modeRGB, GLenum modeA); /* 436 */
void (GLAPIENTRYP CompileShader)(GLuint shader); /* 437 */
GLuint (GLAPIENTRYP CreateProgram)(void); /* 438 */
GLuint (GLAPIENTRYP CreateShader)(GLenum type); /* 439 */
void (GLAPIENTRYP DeleteProgram)(GLuint program); /* 440 */
void (GLAPIENTRYP DeleteShader)(GLuint program); /* 441 */
void (GLAPIENTRYP DetachShader)(GLuint program, GLuint shader); /* 442 */
void (GLAPIENTRYP DisableVertexAttribArray)(GLuint index); /* 443 */
void (GLAPIENTRYP EnableVertexAttribArray)(GLuint index); /* 444 */
void (GLAPIENTRYP GetActiveAttrib)(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLchar * name); /* 445 */
void (GLAPIENTRYP GetActiveUniform)(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLchar * name); /* 446 */
void (GLAPIENTRYP GetAttachedShaders)(GLuint program, GLsizei maxCount, GLsizei * count, GLuint * obj); /* 447 */
GLint (GLAPIENTRYP GetAttribLocation)(GLuint program, const GLchar * name); /* 448 */
void (GLAPIENTRYP GetProgramInfoLog)(GLuint program, GLsizei bufSize, GLsizei * length, GLchar * infoLog); /* 449 */
void (GLAPIENTRYP GetProgramiv)(GLuint program, GLenum pname, GLint * params); /* 450 */
void (GLAPIENTRYP GetShaderInfoLog)(GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * infoLog); /* 451 */
void (GLAPIENTRYP GetShaderSource)(GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * source); /* 452 */
void (GLAPIENTRYP GetShaderiv)(GLuint shader, GLenum pname, GLint * params); /* 453 */
GLint (GLAPIENTRYP GetUniformLocation)(GLuint program, const GLchar * name); /* 454 */
void (GLAPIENTRYP GetUniformfv)(GLuint program, GLint location, GLfloat * params); /* 455 */
void (GLAPIENTRYP GetUniformiv)(GLuint program, GLint location, GLint * params); /* 456 */
void (GLAPIENTRYP GetVertexAttribPointerv)(GLuint index, GLenum pname, GLvoid ** pointer); /* 457 */
void (GLAPIENTRYP GetVertexAttribfv)(GLuint index, GLenum pname, GLfloat * params); /* 458 */
void (GLAPIENTRYP GetVertexAttribiv)(GLuint index, GLenum pname, GLint * params); /* 459 */
GLboolean (GLAPIENTRYP IsProgram)(GLuint program); /* 460 */
GLboolean (GLAPIENTRYP IsShader)(GLuint shader); /* 461 */
void (GLAPIENTRYP LinkProgram)(GLuint program); /* 462 */
void (GLAPIENTRYP ShaderSource)(GLuint shader, GLsizei count, const GLchar ** string, const GLint * length); /* 463 */
void (GLAPIENTRYP StencilFuncSeparate)(GLenum face, GLenum func, GLint ref, GLuint mask); /* 464 */
void (GLAPIENTRYP StencilMaskSeparate)(GLenum face, GLuint mask); /* 465 */
void (GLAPIENTRYP StencilOpSeparate)(GLenum face, GLenum sfail, GLenum zfail, GLenum zpass); /* 466 */
void (GLAPIENTRYP Uniform1f)(GLint location, GLfloat v0); /* 467 */
void (GLAPIENTRYP Uniform1fv)(GLint location, GLsizei count, const GLfloat * value); /* 468 */
void (GLAPIENTRYP Uniform1i)(GLint location, GLint v0); /* 469 */
void (GLAPIENTRYP Uniform1iv)(GLint location, GLsizei count, const GLint * value); /* 470 */
void (GLAPIENTRYP Uniform2f)(GLint location, GLfloat v0, GLfloat v1); /* 471 */
void (GLAPIENTRYP Uniform2fv)(GLint location, GLsizei count, const GLfloat * value); /* 472 */
void (GLAPIENTRYP Uniform2i)(GLint location, GLint v0, GLint v1); /* 473 */
void (GLAPIENTRYP Uniform2iv)(GLint location, GLsizei count, const GLint * value); /* 474 */
void (GLAPIENTRYP Uniform3f)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2); /* 475 */
void (GLAPIENTRYP Uniform3fv)(GLint location, GLsizei count, const GLfloat * value); /* 476 */
void (GLAPIENTRYP Uniform3i)(GLint location, GLint v0, GLint v1, GLint v2); /* 477 */
void (GLAPIENTRYP Uniform3iv)(GLint location, GLsizei count, const GLint * value); /* 478 */
void (GLAPIENTRYP Uniform4f)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); /* 479 */
void (GLAPIENTRYP Uniform4fv)(GLint location, GLsizei count, const GLfloat * value); /* 480 */
void (GLAPIENTRYP Uniform4i)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3); /* 481 */
void (GLAPIENTRYP Uniform4iv)(GLint location, GLsizei count, const GLint * value); /* 482 */
void (GLAPIENTRYP UniformMatrix2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 483 */
void (GLAPIENTRYP UniformMatrix3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 484 */
void (GLAPIENTRYP UniformMatrix4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 485 */
void (GLAPIENTRYP UseProgram)(GLuint program); /* 486 */
void (GLAPIENTRYP ValidateProgram)(GLuint program); /* 487 */
void (GLAPIENTRYP VertexAttrib1f)(GLuint index, GLfloat x); /* 488 */
void (GLAPIENTRYP VertexAttrib1fv)(GLuint index, const GLfloat * v); /* 489 */
void (GLAPIENTRYP VertexAttrib2f)(GLuint index, GLfloat x, GLfloat y); /* 490 */
void (GLAPIENTRYP VertexAttrib2fv)(GLuint index, const GLfloat * v); /* 491 */
void (GLAPIENTRYP VertexAttrib3f)(GLuint index, GLfloat x, GLfloat y, GLfloat z); /* 492 */
void (GLAPIENTRYP VertexAttrib3fv)(GLuint index, const GLfloat * v); /* 493 */
void (GLAPIENTRYP VertexAttrib4f)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 494 */
void (GLAPIENTRYP VertexAttrib4fv)(GLuint index, const GLfloat * v); /* 495 */
void (GLAPIENTRYP VertexAttribPointer)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid * pointer); /* 496 */
void (GLAPIENTRYP BlendFuncSeparate)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); /* 497 */
void (GLAPIENTRYP BindFramebuffer)(GLenum target, GLuint framebuffer); /* 498 */
void (GLAPIENTRYP BindRenderbuffer)(GLenum target, GLuint renderbuffer); /* 499 */
GLenum (GLAPIENTRYP CheckFramebufferStatus)(GLenum target); /* 500 */
void (GLAPIENTRYP ClearDepthf)(GLclampf depth); /* 501 */
void (GLAPIENTRYP DeleteFramebuffers)(GLsizei n, const GLuint * framebuffers); /* 502 */
void (GLAPIENTRYP DeleteRenderbuffers)(GLsizei n, const GLuint * renderbuffers); /* 503 */
void (GLAPIENTRYP DepthRangef)(GLclampf zNear, GLclampf zFar); /* 504 */
void (GLAPIENTRYP FramebufferRenderbuffer)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); /* 505 */
void (GLAPIENTRYP FramebufferTexture2D)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); /* 506 */
void (GLAPIENTRYP GenFramebuffers)(GLsizei n, GLuint * framebuffers); /* 507 */
void (GLAPIENTRYP GenRenderbuffers)(GLsizei n, GLuint * renderbuffers); /* 508 */
void (GLAPIENTRYP GenerateMipmap)(GLenum target); /* 509 */
void (GLAPIENTRYP GetFramebufferAttachmentParameteriv)(GLenum target, GLenum attachment, GLenum pname, GLint * params); /* 510 */
void (GLAPIENTRYP GetRenderbufferParameteriv)(GLenum target, GLenum pname, GLint * params); /* 511 */
void (GLAPIENTRYP GetShaderPrecisionFormat)(GLenum shadertype, GLenum precisiontype, GLint * range, GLint * precision); /* 512 */
GLboolean (GLAPIENTRYP IsFramebuffer)(GLuint framebuffer); /* 513 */
GLboolean (GLAPIENTRYP IsRenderbuffer)(GLuint renderbuffer); /* 514 */
void (GLAPIENTRYP ReleaseShaderCompiler)(void); /* 515 */
void (GLAPIENTRYP RenderbufferStorage)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height); /* 516 */
void (GLAPIENTRYP ShaderBinary)(GLsizei n, const GLuint * shaders, GLenum binaryformat, const GLvoid * binary, GLsizei length); /* 517 */
};
#endif /* !defined( _GLAPI_TABLE_H_ ) */

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More