Compare commits
144 Commits
submit/mes
...
mesa-7.11-
Author | SHA1 | Date | |
---|---|---|---|
|
fad610fec9 | ||
|
69720cb0c4 | ||
|
8589ca000a | ||
|
dcbd00e73c | ||
|
bba1600531 | ||
|
f4c55ea016 | ||
|
aa05fbe14d | ||
|
0a7574f62c | ||
|
1098f9228d | ||
|
5238303790 | ||
|
a03974ffb9 | ||
|
2d64d34cb9 | ||
|
66b41af391 | ||
|
67aa20d9d5 | ||
|
7d6c37b0c2 | ||
|
32c7224edb | ||
|
788acd552e | ||
|
a2b8802ed5 | ||
|
8b41ae0b2a | ||
|
b00b5fe267 | ||
|
3a5a7cfd2a | ||
|
aad12d15bb | ||
|
977db7cc65 | ||
|
d31c1c33ed | ||
|
3481a5a1e6 | ||
|
a26b6cc001 | ||
|
7d992b8471 | ||
|
0bfa310049 | ||
|
7555eb7478 | ||
|
fd461c5888 | ||
|
208bae4251 | ||
|
13d12b35e9 | ||
|
337102684b | ||
|
b305c956be | ||
|
7c98381ed4 | ||
|
0ce6506d6e | ||
|
7fc66f0bed | ||
|
e24c3575e4 | ||
|
2e50a93cf3 | ||
|
2c29c24543 | ||
|
4cbaa2283c | ||
|
e29d44eacd | ||
|
f29208aa9b | ||
|
7af4e18dcd | ||
|
344db29ede | ||
|
680c468f61 | ||
|
7ee4cb453b | ||
|
a152ab6df1 | ||
|
a99914509e | ||
|
891073fea3 | ||
|
dcaec739ea | ||
|
ea241750f7 | ||
|
9efd6dc677 | ||
|
c6ddeeed7a | ||
|
108e807b7b | ||
|
421bca32fb | ||
|
0f0ab15a46 | ||
|
b3c2438d4e | ||
|
25287008b6 | ||
|
62b282e749 | ||
|
9aa8c02ae2 | ||
|
b0ecde7f39 | ||
|
fe70a40e47 | ||
|
73b68316f4 | ||
|
7ba7531929 | ||
|
2826e3a000 | ||
|
f80ae99cbd | ||
|
ae11fb02dd | ||
|
a90b88f354 | ||
|
0e699cc0e8 | ||
|
e6e7c456de | ||
|
31f4ab790f | ||
|
9f978104d8 | ||
|
9d78935100 | ||
|
d469ebaa0a | ||
|
f5fa4606ea | ||
|
89ed95ad3d | ||
|
3b605cb0d6 | ||
|
9bfb79923f | ||
|
7d8a04643f | ||
|
3065bae508 | ||
|
443ff6024d | ||
|
a20a950829 | ||
|
9279c1e556 | ||
|
b8f722a82e | ||
|
9304645a07 | ||
|
c3b3719096 | ||
|
55a75856fb | ||
|
e3e99be131 | ||
|
5a7d1c9710 | ||
|
6ac5554298 | ||
|
9eace71048 | ||
|
8d9202c162 | ||
|
ef9f16f632 | ||
|
d739434af8 | ||
|
72f2bd2a41 | ||
|
b0549fab5c | ||
|
ac88916978 | ||
|
336b2c7fbd | ||
|
a8907c6005 | ||
|
89af428aea | ||
|
8a77029f4c | ||
|
928bf189ff | ||
|
a9e34ada26 | ||
|
804995807d | ||
|
b033f050fd | ||
|
c66982f7dc | ||
|
530c68d616 | ||
|
576f489dad | ||
|
270de51f1d | ||
|
57fe695a17 | ||
|
189303fb30 | ||
|
c4da12e74f | ||
|
8428b48673 | ||
|
b0a4f34ea8 | ||
|
efd0ffd1b0 | ||
|
dc062db95d | ||
|
b292ef8f88 | ||
|
d3bfa9bb4a | ||
|
98af042079 | ||
|
127bd9d5b6 | ||
|
b8972db223 | ||
|
f28cf18609 | ||
|
42cd6192a2 | ||
|
1ae00c5960 | ||
|
65d0d69c91 | ||
|
433afb7352 | ||
|
f70c2f8521 | ||
|
e4cef07b87 | ||
|
2196feb47f | ||
|
b90c710c6c | ||
|
bd1ceb5c5b | ||
|
567778e49a | ||
|
0fafcc6919 | ||
|
29574af377 | ||
|
0eb780262c | ||
|
e43a096f0c | ||
|
52aa06a2cd | ||
|
5d1561b4ab | ||
|
a8d7f36d65 | ||
|
82ebfa6387 | ||
|
ee416c6ffe | ||
|
ebc884d3dd | ||
|
9383cfb4ba |
36
Makefile
36
Makefile
@@ -183,7 +183,7 @@ ultrix-gcc:
|
||||
|
||||
# Rules for making release tarballs
|
||||
|
||||
VERSION=7.11-devel
|
||||
VERSION=7.11-rc4
|
||||
DIRECTORY = Mesa-$(VERSION)
|
||||
LIB_NAME = MesaLib-$(VERSION)
|
||||
GLUT_NAME = MesaGLUT-$(VERSION)
|
||||
@@ -253,7 +253,6 @@ MAIN_FILES = \
|
||||
$(DIRECTORY)/src/mesa/descrip.mms \
|
||||
$(DIRECTORY)/src/mesa/gl.pc.in \
|
||||
$(DIRECTORY)/src/mesa/osmesa.pc.in \
|
||||
$(DIRECTORY)/src/mesa/depend \
|
||||
$(MAIN_ES_FILES) \
|
||||
$(DIRECTORY)/src/mesa/main/*.[chS] \
|
||||
$(DIRECTORY)/src/mesa/main/*.cpp \
|
||||
@@ -286,9 +285,6 @@ MAIN_FILES = \
|
||||
$(DIRECTORY)/src/mesa/drivers/osmesa/descrip.mms \
|
||||
$(DIRECTORY)/src/mesa/drivers/osmesa/osmesa.def \
|
||||
$(DIRECTORY)/src/mesa/drivers/osmesa/*.[ch] \
|
||||
$(DIRECTORY)/src/mesa/drivers/dri/r300/compiler/*.[ch] \
|
||||
$(DIRECTORY)/src/mesa/drivers/dri/r300/compiler/Makefile \
|
||||
$(DIRECTORY)/src/mesa/drivers/dri/r300/compiler/SConscript \
|
||||
$(DIRECTORY)/src/mesa/drivers/windows/*/*.[ch] \
|
||||
$(DIRECTORY)/src/mesa/drivers/windows/*/*.def \
|
||||
$(DIRECTORY)/src/mesa/drivers/x11/Makefile \
|
||||
@@ -394,6 +390,7 @@ DRI_FILES = \
|
||||
$(DIRECTORY)/src/mesa/drivers/dri/*/*/*.[chS] \
|
||||
$(DIRECTORY)/src/mesa/drivers/dri/*/Makefile \
|
||||
$(DIRECTORY)/src/mesa/drivers/dri/*/*/Makefile \
|
||||
$(DIRECTORY)/src/mesa/drivers/dri/*/*/SConscript \
|
||||
$(DIRECTORY)/src/mesa/drivers/dri/*/Doxyfile
|
||||
|
||||
SGI_GLU_FILES = \
|
||||
@@ -423,15 +420,13 @@ GLW_FILES = \
|
||||
$(DIRECTORY)/src/glw/*.[ch] \
|
||||
$(DIRECTORY)/src/glw/Makefile* \
|
||||
$(DIRECTORY)/src/glw/README \
|
||||
$(DIRECTORY)/src/glw/glw.pc.in \
|
||||
$(DIRECTORY)/src/glw/depend
|
||||
$(DIRECTORY)/src/glw/glw.pc.in
|
||||
|
||||
GLUT_FILES = \
|
||||
$(DIRECTORY)/include/GL/glut.h \
|
||||
$(DIRECTORY)/include/GL/glutf90.h \
|
||||
$(DIRECTORY)/src/glut/glx/Makefile* \
|
||||
$(DIRECTORY)/src/glut/glx/SConscript \
|
||||
$(DIRECTORY)/src/glut/glx/depend \
|
||||
$(DIRECTORY)/src/glut/glx/glut.pc.in \
|
||||
$(DIRECTORY)/src/glut/glx/*def \
|
||||
$(DIRECTORY)/src/glut/glx/*.[ch] \
|
||||
@@ -439,13 +434,6 @@ GLUT_FILES = \
|
||||
$(DIRECTORY)/src/glut/beos/*.cpp \
|
||||
$(DIRECTORY)/src/glut/beos/Makefile
|
||||
|
||||
DEPEND_FILES = \
|
||||
$(TOP)/src/mesa/depend \
|
||||
$(TOP)/src/glx/depend \
|
||||
$(TOP)/src/glw/depend \
|
||||
$(TOP)/src/glut/glx/depend \
|
||||
$(TOP)/src/glu/sgi/depend
|
||||
|
||||
|
||||
LIB_FILES = \
|
||||
$(MAIN_FILES) \
|
||||
@@ -463,7 +451,7 @@ parsers: configure
|
||||
-@touch $(TOP)/configs/current
|
||||
$(MAKE) -C src/glsl glsl_parser.cpp glsl_parser.h glsl_lexer.cpp
|
||||
$(MAKE) -C src/glsl/glcpp glcpp-lex.c glcpp-parse.c glcpp-parse.h
|
||||
$(MAKE) -C src/mesa/program lex.yy.c program_parse.tab.c program_parse.tab.h
|
||||
$(MAKE) -C src/mesa program/lex.yy.c program/program_parse.tab.c program/program_parse.tab.h
|
||||
|
||||
# Everything for new a Mesa release:
|
||||
ARCHIVES = $(LIB_NAME).tar.gz \
|
||||
@@ -483,27 +471,21 @@ AUTOCONF = autoconf
|
||||
AC_FLAGS =
|
||||
aclocal.m4: configure.ac acinclude.m4
|
||||
$(ACLOCAL) $(ACLOCAL_FLAGS)
|
||||
configure: rm_depend configure.ac aclocal.m4 acinclude.m4
|
||||
configure: configure.ac aclocal.m4 acinclude.m4
|
||||
$(AUTOCONF) $(AC_FLAGS)
|
||||
|
||||
rm_depend:
|
||||
@for dep in $(DEPEND_FILES) ; do \
|
||||
rm -f $$dep ; \
|
||||
touch $$dep ; \
|
||||
done
|
||||
|
||||
rm_config: parsers
|
||||
rm -f configs/current
|
||||
rm -f configs/autoconf
|
||||
|
||||
$(LIB_NAME).tar: rm_config
|
||||
cd .. ; tar -cf $(DIRECTORY)/$(LIB_NAME).tar $(LIB_FILES)
|
||||
cd .. ; tar --dereference -cf $(DIRECTORY)/$(LIB_NAME).tar $(LIB_FILES)
|
||||
|
||||
$(LIB_NAME).tar.gz: $(LIB_NAME).tar
|
||||
gzip --stdout --best $(LIB_NAME).tar > $(LIB_NAME).tar.gz
|
||||
|
||||
$(GLUT_NAME).tar: rm_depend
|
||||
cd .. ; tar -cf $(DIRECTORY)/$(GLUT_NAME).tar $(GLUT_FILES)
|
||||
$(GLUT_NAME).tar:
|
||||
cd .. ; tar --dereference -cf $(DIRECTORY)/$(GLUT_NAME).tar $(GLUT_FILES)
|
||||
|
||||
$(GLUT_NAME).tar.gz: $(GLUT_NAME).tar
|
||||
gzip --stdout --best $(GLUT_NAME).tar > $(GLUT_NAME).tar.gz
|
||||
@@ -534,4 +516,4 @@ md5: $(ARCHIVES)
|
||||
@-md5sum $(GLUT_NAME).tar.bz2
|
||||
@-md5sum $(GLUT_NAME).zip
|
||||
|
||||
.PHONY: tarballs rm_depend rm_config md5
|
||||
.PHONY: tarballs rm_config md5
|
||||
|
115
configure.ac
115
configure.ac
@@ -563,9 +563,9 @@ AC_ARG_ENABLE([gallium_gbm],
|
||||
[AS_HELP_STRING([--enable-gallium-gbm],
|
||||
[enable optional gbm state tracker (not required for
|
||||
gbm support in Gallium)
|
||||
@<:@default=disable@:>@])],
|
||||
@<:@default=auto@:>@])],
|
||||
[enable_gallium_gbm="$enableval"],
|
||||
[enable_gallium_gbm=no])
|
||||
[enable_gallium_gbm=auto])
|
||||
|
||||
# Option for Gallium drivers
|
||||
GALLIUM_DRIVERS_DEFAULT="r300,r600,swrast"
|
||||
@@ -578,6 +578,13 @@ AC_ARG_WITH([gallium-drivers],
|
||||
[with_gallium_drivers="$withval"],
|
||||
[with_gallium_drivers="$GALLIUM_DRIVERS_DEFAULT"])
|
||||
|
||||
# Doing '--without-gallium-drivers' will set this variable to 'no'. Clear it
|
||||
# here so that the script doesn't choke on an unknown driver name later.
|
||||
case "$with_gallium_drivers" in
|
||||
yes) with_gallium_drivers="$GALLIUM_DRIVERS_DEFAULT" ;;
|
||||
no) with_gallium_drivers='' ;;
|
||||
esac
|
||||
|
||||
if test "x$enable_opengl" = xno -a \
|
||||
"x$enable_gles1" = xno -a \
|
||||
"x$enable_gles2" = xno -a \
|
||||
@@ -822,7 +829,7 @@ xlib)
|
||||
GL_PC_LIB_PRIV="$GL_LIB_DEPS"
|
||||
GL_PC_CFLAGS="$X11_INCLUDES"
|
||||
fi
|
||||
GL_LIB_DEPS="$GL_LIB_DEPS $SELINUX_LIBS -lm -lpthread"
|
||||
GL_LIB_DEPS="$GL_LIB_DEPS $SELINUX_LIBS -lm -lpthread $DLOPEN_LIBS"
|
||||
GL_PC_LIB_PRIV="$GL_PC_LIB_PRIV $SELINUX_LIBS -lm -lpthread"
|
||||
|
||||
# if static, move the external libraries to the programs
|
||||
@@ -948,11 +955,6 @@ AC_SUBST([MESA_MODULES])
|
||||
|
||||
AC_SUBST([HAVE_XF86VIDMODE])
|
||||
|
||||
PKG_CHECK_MODULES([LIBDRM_RADEON],
|
||||
[libdrm_radeon >= $LIBDRM_RADEON_REQUIRED],
|
||||
HAVE_LIBDRM_RADEON=yes,
|
||||
HAVE_LIBDRM_RADEON=no)
|
||||
|
||||
dnl
|
||||
dnl More X11 setup
|
||||
dnl
|
||||
@@ -1139,6 +1141,11 @@ esac
|
||||
|
||||
case $DRI_DIRS in
|
||||
*radeon*|*r200*|*r300*|*r600*)
|
||||
PKG_CHECK_MODULES([LIBDRM_RADEON],
|
||||
[libdrm_radeon >= $LIBDRM_RADEON_REQUIRED],
|
||||
HAVE_LIBDRM_RADEON=yes,
|
||||
HAVE_LIBDRM_RADEON=no)
|
||||
|
||||
if test "x$HAVE_LIBDRM_RADEON" = xyes; then
|
||||
RADEON_CFLAGS="-DHAVE_LIBDRM_RADEON=1 $LIBDRM_RADEON_CFLAGS"
|
||||
RADEON_LDFLAGS=$LIBDRM_RADEON_LIBS
|
||||
@@ -1214,6 +1221,41 @@ AC_SUBST([OSMESA_MESA_DEPS])
|
||||
AC_SUBST([OSMESA_PC_REQ])
|
||||
AC_SUBST([OSMESA_PC_LIB_PRIV])
|
||||
|
||||
dnl
|
||||
dnl gbm configuration
|
||||
dnl
|
||||
if test "x$enable_gbm" = xauto; then
|
||||
case "$with_egl_platforms" in
|
||||
*drm*)
|
||||
enable_gbm=yes ;;
|
||||
*)
|
||||
enable_gbm=no ;;
|
||||
esac
|
||||
fi
|
||||
if test "x$enable_gbm" = xyes; then
|
||||
SRC_DIRS="$SRC_DIRS gbm"
|
||||
GBM_BACKEND_DIRS=""
|
||||
|
||||
PKG_CHECK_MODULES([LIBUDEV], [libudev], [],
|
||||
AC_MSG_ERROR([gbm needs udev]))
|
||||
GBM_LIB_DEPS="$DLOPEN_LIBS $LIBUDEV_LIBS"
|
||||
|
||||
if test "$mesa_driver" = dri; then
|
||||
GBM_BACKEND_DIRS="$GBM_BACKEND_DIRS dri"
|
||||
if test "$SHARED_GLAPI" -eq 0; then
|
||||
AC_MSG_ERROR([gbm_dri requires --enable-shared-glapi])
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
AC_SUBST([GBM_LIB_DEPS])
|
||||
AC_SUBST([GBM_BACKEND_DIRS])
|
||||
GBM_PC_REQ_PRIV="libudev"
|
||||
GBM_PC_LIB_PRIV="$DLOPEN_LIBS"
|
||||
GBM_PC_CFLAGS=
|
||||
AC_SUBST([GBM_PC_REQ_PRIV])
|
||||
AC_SUBST([GBM_PC_LIB_PRIV])
|
||||
AC_SUBST([GBM_PC_CFLAGS])
|
||||
|
||||
dnl
|
||||
dnl EGL configuration
|
||||
dnl
|
||||
@@ -1260,41 +1302,6 @@ fi
|
||||
AC_SUBST([EGL_LIB_DEPS])
|
||||
AC_SUBST([EGL_DRIVERS_DIRS])
|
||||
|
||||
dnl
|
||||
dnl gbm configuration
|
||||
dnl
|
||||
if test "x$enable_gbm" = xauto; then
|
||||
case "$with_egl_platforms" in
|
||||
*drm*)
|
||||
enable_gbm=yes ;;
|
||||
*)
|
||||
enable_gbm=no ;;
|
||||
esac
|
||||
fi
|
||||
if test "x$enable_gbm" = xyes; then
|
||||
SRC_DIRS="$SRC_DIRS gbm"
|
||||
GBM_BACKEND_DIRS=""
|
||||
|
||||
PKG_CHECK_MODULES([LIBUDEV], [libudev], [],
|
||||
AC_MSG_ERROR([gbm needs udev]))
|
||||
GBM_LIB_DEPS="$DLOPEN_LIBS $LIBUDEV_LIBS"
|
||||
|
||||
if test "$mesa_driver" = dri; then
|
||||
GBM_BACKEND_DIRS="$GBM_BACKEND_DIRS dri"
|
||||
if test "$SHARED_GLAPI" -eq 0; then
|
||||
AC_MSG_ERROR([gbm_dri requires --enable-shared-glapi])
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
AC_SUBST([GBM_LIB_DEPS])
|
||||
AC_SUBST([GBM_BACKEND_DIRS])
|
||||
GBM_PC_REQ_PRIV="libudev"
|
||||
GBM_PC_LIB_PRIV="$DLOPEN_LIBS"
|
||||
GBM_PC_CFLAGS=
|
||||
AC_SUBST([GBM_PC_REQ_PRIV])
|
||||
AC_SUBST([GBM_PC_LIB_PRIV])
|
||||
AC_SUBST([GBM_PC_CFLAGS])
|
||||
|
||||
dnl
|
||||
dnl EGL Gallium configuration
|
||||
dnl
|
||||
@@ -1314,6 +1321,14 @@ fi
|
||||
dnl
|
||||
dnl gbm Gallium configuration
|
||||
dnl
|
||||
if test "x$enable_gallium_gbm" = xauto; then
|
||||
case "$enable_gbm$HAVE_ST_EGL$with_egl_platforms" in
|
||||
yesyes*drm*)
|
||||
enable_gallium_gbm=yes ;;
|
||||
*)
|
||||
enable_gallium_gbm=no ;;
|
||||
esac
|
||||
fi
|
||||
if test "x$enable_gallium_gbm" = xyes; then
|
||||
if test "x$with_gallium_drivers" = x; then
|
||||
AC_MSG_ERROR([cannot enable gbm_gallium without Gallium])
|
||||
@@ -1595,9 +1610,6 @@ dnl Gallium configuration
|
||||
dnl
|
||||
if test "x$with_gallium_drivers" != x; then
|
||||
SRC_DIRS="$SRC_DIRS gallium gallium/winsys gallium/targets"
|
||||
AC_PATH_PROG([LLVM_CONFIG], [llvm-config], [no])
|
||||
else
|
||||
LLVM_CONFIG=no
|
||||
fi
|
||||
|
||||
AC_SUBST([LLVM_CFLAGS])
|
||||
@@ -1650,9 +1662,13 @@ yes)
|
||||
WAYLAND_EGL_LIB_DEPS="$WAYLAND_LIBS $LIBDRM_LIBS"
|
||||
GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/wayland"
|
||||
fi
|
||||
if test "$plat" = "drm" && test "x$enable_gbm" = no; then
|
||||
if test "$plat" = "drm" && test "x$enable_gbm" = "xno"; then
|
||||
AC_MSG_ERROR([EGL platform drm needs gbm])
|
||||
fi
|
||||
case "$plat$have_libudev" in
|
||||
waylandno|drmno)
|
||||
AC_MSG_ERROR([cannot build $plat platfrom without udev]) ;;
|
||||
esac
|
||||
done
|
||||
EGL_PLATFORMS="$egl_platforms"
|
||||
;;
|
||||
@@ -1715,6 +1731,8 @@ if test "x$enable_gallium_llvm" = xauto; then
|
||||
esac
|
||||
fi
|
||||
if test "x$enable_gallium_llvm" = xyes; then
|
||||
AC_PATH_PROG([LLVM_CONFIG], [llvm-config], [no])
|
||||
|
||||
if test "x$LLVM_CONFIG" != xno; then
|
||||
LLVM_VERSION=`$LLVM_CONFIG --version`
|
||||
LLVM_CFLAGS=`$LLVM_CONFIG --cppflags`
|
||||
@@ -1767,9 +1785,11 @@ if test "x$with_gallium_drivers" != x; then
|
||||
gallium_check_st "svga/drm" "dri-vmwgfx" "xorg-vmwgfx"
|
||||
;;
|
||||
xi915)
|
||||
PKG_CHECK_MODULES([INTEL], [libdrm_intel >= $LIBDRM_INTEL_REQUIRED])
|
||||
gallium_check_st "i915/drm" "dri-i915" "xorg-i915"
|
||||
;;
|
||||
xi965)
|
||||
PKG_CHECK_MODULES([INTEL], [libdrm_intel >= $LIBDRM_INTEL_REQUIRED])
|
||||
gallium_check_st "i965/drm" "dri-i965" "xorg-i965"
|
||||
;;
|
||||
xr300)
|
||||
@@ -1781,6 +1801,7 @@ if test "x$with_gallium_drivers" != x; then
|
||||
gallium_check_st "r600/drm" "dri-r600"
|
||||
;;
|
||||
xnouveau)
|
||||
PKG_CHECK_MODULES([NOUVEAU], [libdrm_nouveau >= $LIBDRM_NOUVEAU_REQUIRED])
|
||||
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS nouveau nvfx nv50 nvc0"
|
||||
gallium_check_st "nouveau/drm" "dri-nouveau" "xorg-nouveau"
|
||||
;;
|
||||
|
@@ -6,7 +6,7 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Copyright (c) 2007-2010 The Khronos Group Inc.
|
||||
** Copyright (c) 2007-2011 The Khronos Group Inc.
|
||||
**
|
||||
** Permission is hereby granted, free of charge, to any person obtaining a
|
||||
** copy of this software and/or associated documentation files (the
|
||||
@@ -29,9 +29,9 @@ extern "C" {
|
||||
*/
|
||||
|
||||
/* Header file version number, required by OpenGL ABI for Linux */
|
||||
/* glext.h last updated $Date: 2010-12-09 02:15:08 -0800 (Thu, 09 Dec 2010) $ */
|
||||
/* glext.h last updated $Date: 2011-07-06 02:49:14 -0700 (Wed, 06 Jul 2011) $ */
|
||||
/* Current version at http://www.opengl.org/registry/ */
|
||||
#define GL_GLEXT_VERSION 67
|
||||
#define GL_GLEXT_VERSION 71
|
||||
/* Function declaration macros - to move into glplatform.h */
|
||||
|
||||
#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__)
|
||||
@@ -5032,6 +5032,32 @@ extern "C" {
|
||||
#define GL_SKIP_DECODE_EXT 0x8A4A
|
||||
#endif
|
||||
|
||||
#ifndef GL_NV_texture_multisample
|
||||
#define GL_TEXTURE_COVERAGE_SAMPLES_NV 0x9045
|
||||
#define GL_TEXTURE_COLOR_SAMPLES_NV 0x9046
|
||||
#endif
|
||||
|
||||
#ifndef GL_AMD_blend_minmax_factor
|
||||
#define GL_FACTOR_MIN_AMD 0x901C
|
||||
#define GL_FACTOR_MAX_AMD 0x901D
|
||||
#endif
|
||||
|
||||
#ifndef GL_AMD_sample_positions
|
||||
#define GL_SUBSAMPLE_DISTANCE_AMD 0x883F
|
||||
#endif
|
||||
|
||||
#ifndef GL_EXT_x11_sync_object
|
||||
#define GL_SYNC_X11_FENCE_EXT 0x90E1
|
||||
#endif
|
||||
|
||||
#ifndef GL_AMD_multi_draw_indirect
|
||||
#endif
|
||||
|
||||
#ifndef GL_EXT_framebuffer_multisample_blit_scaled
|
||||
#define GL_SCALED_RESOLVE_FASTEST_EXT 0x90BA
|
||||
#define GL_SCALED_RESOLVE_NICEST_EXT 0x90BB
|
||||
#endif
|
||||
|
||||
|
||||
/*************************************************************/
|
||||
|
||||
@@ -11041,6 +11067,58 @@ typedef void (APIENTRYP PFNGLVDPAUUNMAPSURFACESNVPROC) (GLsizei numSurface, cons
|
||||
#define GL_EXT_texture_sRGB_decode 1
|
||||
#endif
|
||||
|
||||
#ifndef GL_NV_texture_multisample
|
||||
#define GL_NV_texture_multisample 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GLAPI void APIENTRY glTexImage2DMultisampleCoverageNV (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations);
|
||||
GLAPI void APIENTRY glTexImage3DMultisampleCoverageNV (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations);
|
||||
GLAPI void APIENTRY glTextureImage2DMultisampleNV (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations);
|
||||
GLAPI void APIENTRY glTextureImage3DMultisampleNV (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations);
|
||||
GLAPI void APIENTRY glTextureImage2DMultisampleCoverageNV (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations);
|
||||
GLAPI void APIENTRY glTextureImage3DMultisampleCoverageNV (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations);
|
||||
#endif /* GL_GLEXT_PROTOTYPES */
|
||||
typedef void (APIENTRYP PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations);
|
||||
typedef void (APIENTRYP PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations);
|
||||
typedef void (APIENTRYP PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC) (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations);
|
||||
typedef void (APIENTRYP PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC) (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations);
|
||||
typedef void (APIENTRYP PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC) (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations);
|
||||
typedef void (APIENTRYP PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC) (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations);
|
||||
#endif
|
||||
|
||||
#ifndef GL_AMD_blend_minmax_factor
|
||||
#define GL_AMD_blend_minmax_factor 1
|
||||
#endif
|
||||
|
||||
#ifndef GL_AMD_sample_positions
|
||||
#define GL_AMD_sample_positions 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GLAPI void APIENTRY glSetMultisamplefvAMD (GLenum pname, GLuint index, const GLfloat *val);
|
||||
#endif /* GL_GLEXT_PROTOTYPES */
|
||||
typedef void (APIENTRYP PFNGLSETMULTISAMPLEFVAMDPROC) (GLenum pname, GLuint index, const GLfloat *val);
|
||||
#endif
|
||||
|
||||
#ifndef GL_EXT_x11_sync_object
|
||||
#define GL_EXT_x11_sync_object 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GLAPI GLsync APIENTRY glImportSyncEXT (GLenum external_sync_type, GLintptr external_sync, GLbitfield flags);
|
||||
#endif /* GL_GLEXT_PROTOTYPES */
|
||||
typedef GLsync (APIENTRYP PFNGLIMPORTSYNCEXTPROC) (GLenum external_sync_type, GLintptr external_sync, GLbitfield flags);
|
||||
#endif
|
||||
|
||||
#ifndef GL_AMD_multi_draw_indirect
|
||||
#define GL_AMD_multi_draw_indirect 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GLAPI void APIENTRY glMultiDrawArraysIndirectAMD (GLenum mode, const GLvoid *indirect, GLsizei primcount, GLsizei stride);
|
||||
GLAPI void APIENTRY glMultiDrawElementsIndirectAMD (GLenum mode, GLenum type, const GLvoid *indirect, GLsizei primcount, GLsizei stride);
|
||||
#endif /* GL_GLEXT_PROTOTYPES */
|
||||
typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC) (GLenum mode, const GLvoid *indirect, GLsizei primcount, GLsizei stride);
|
||||
typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC) (GLenum mode, GLenum type, const GLvoid *indirect, GLsizei primcount, GLsizei stride);
|
||||
#endif
|
||||
|
||||
#ifndef GL_EXT_framebuffer_multisample_blit_scaled
|
||||
#define GL_EXT_framebuffer_multisample_blit_scaled 1
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@@ -249,6 +249,7 @@ CHIPSET(0x6749, TURKS_6749, TURKS)
|
||||
CHIPSET(0x6750, TURKS_6750, TURKS)
|
||||
CHIPSET(0x6758, TURKS_6758, TURKS)
|
||||
CHIPSET(0x6759, TURKS_6759, TURKS)
|
||||
CHIPSET(0x675F, TURKS_675F, TURKS)
|
||||
|
||||
CHIPSET(0x6760, CAICOS_6760, CAICOS)
|
||||
CHIPSET(0x6761, CAICOS_6761, CAICOS)
|
||||
@@ -260,4 +261,5 @@ CHIPSET(0x6766, CAICOS_6766, CAICOS)
|
||||
CHIPSET(0x6767, CAICOS_6767, CAICOS)
|
||||
CHIPSET(0x6768, CAICOS_6768, CAICOS)
|
||||
CHIPSET(0x6770, CAICOS_6770, CAICOS)
|
||||
CHIPSET(0x6778, CAICOS_6778, CAICOS)
|
||||
CHIPSET(0x6779, CAICOS_6779, CAICOS)
|
||||
|
@@ -506,6 +506,8 @@ dri2_create_screen(_EGLDisplay *disp)
|
||||
return EGL_FALSE;
|
||||
}
|
||||
|
||||
dri2_dpy->own_dri_screen = 1;
|
||||
|
||||
extensions = dri2_dpy->core->getExtensions(dri2_dpy->dri_screen);
|
||||
|
||||
if (dri2_dpy->dri2) {
|
||||
@@ -576,10 +578,12 @@ dri2_terminate(_EGLDriver *drv, _EGLDisplay *disp)
|
||||
_eglReleaseDisplayResources(drv, disp);
|
||||
_eglCleanupDisplay(disp);
|
||||
|
||||
dri2_dpy->core->destroyScreen(dri2_dpy->dri_screen);
|
||||
if (dri2_dpy->own_dri_screen)
|
||||
dri2_dpy->core->destroyScreen(dri2_dpy->dri_screen);
|
||||
if (dri2_dpy->fd)
|
||||
close(dri2_dpy->fd);
|
||||
dlclose(dri2_dpy->driver);
|
||||
if (dri2_dpy->driver)
|
||||
dlclose(dri2_dpy->driver);
|
||||
|
||||
if (disp->PlatformDisplay == NULL) {
|
||||
switch (disp->Platform) {
|
||||
|
@@ -44,7 +44,9 @@
|
||||
#include <GL/gl.h>
|
||||
#include <GL/internal/dri_interface.h>
|
||||
|
||||
#ifdef HAVE_DRM_PLATFORM
|
||||
#include <gbm_driint.h>
|
||||
#endif
|
||||
|
||||
#include "eglconfig.h"
|
||||
#include "eglcontext.h"
|
||||
@@ -71,6 +73,7 @@ struct dri2_egl_display
|
||||
int dri2_major;
|
||||
int dri2_minor;
|
||||
__DRIscreen *dri_screen;
|
||||
int own_dri_screen;
|
||||
const __DRIconfig **driver_configs;
|
||||
void *driver;
|
||||
__DRIcoreExtension *core;
|
||||
@@ -81,7 +84,9 @@ struct dri2_egl_display
|
||||
__DRIimageExtension *image;
|
||||
int fd;
|
||||
|
||||
#ifdef HAVE_DRM_PLATFORM
|
||||
struct gbm_dri_device *gbm_dri;
|
||||
#endif
|
||||
|
||||
char *device_name;
|
||||
char *driver_name;
|
||||
|
@@ -1,8 +1,10 @@
|
||||
/**************************************************************************
|
||||
*
|
||||
*
|
||||
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
|
||||
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
|
||||
* Copyright 2010-2011 LunarG, Inc.
|
||||
* 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
|
||||
@@ -10,19 +12,19 @@
|
||||
* 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 TUNGSTEN GRAPHICS AND/OR ITS 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.
|
||||
*
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
|
@@ -1,3 +1,33 @@
|
||||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
|
||||
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
|
||||
* Copyright 2010-2011 LunarG, Inc.
|
||||
* 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 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.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
/**
|
||||
* Public EGL API entrypoints
|
||||
*
|
||||
|
@@ -1,3 +1,33 @@
|
||||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
|
||||
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
|
||||
* Copyright 2010-2011 LunarG, Inc.
|
||||
* 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 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.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
#ifndef EGLAPI_INCLUDED
|
||||
#define EGLAPI_INCLUDED
|
||||
|
||||
|
@@ -1,3 +1,31 @@
|
||||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2010 LunarG, Inc.
|
||||
* 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 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.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
|
@@ -1,3 +1,31 @@
|
||||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2010 LunarG, Inc.
|
||||
* 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 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.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
#ifndef EGLARRAY_INCLUDED
|
||||
#define EGLARRAY_INCLUDED
|
||||
|
||||
|
@@ -1,3 +1,32 @@
|
||||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
|
||||
* Copyright 2010 LunarG, Inc.
|
||||
* 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 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.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
#ifndef EGLCOMPILER_INCLUDED
|
||||
#define EGLCOMPILER_INCLUDED
|
||||
|
||||
|
@@ -1,3 +1,33 @@
|
||||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
|
||||
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
|
||||
* Copyright 2010-2011 LunarG, Inc.
|
||||
* 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 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.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
/**
|
||||
* EGL Configuration (pixel format) functions.
|
||||
*/
|
||||
@@ -456,8 +486,6 @@ _eglIsConfigAttribValid(_EGLConfig *conf, EGLint attr)
|
||||
return EGL_FALSE;
|
||||
|
||||
switch (attr) {
|
||||
case EGL_MATCH_NATIVE_PIXMAP:
|
||||
return EGL_FALSE;
|
||||
case EGL_Y_INVERTED_NOK:
|
||||
return conf->Display->Extensions.NOK_texture_from_pixmap;
|
||||
default:
|
||||
@@ -739,6 +767,16 @@ _eglGetConfigAttrib(_EGLDriver *drv, _EGLDisplay *dpy, _EGLConfig *conf,
|
||||
{
|
||||
if (!_eglIsConfigAttribValid(conf, attribute))
|
||||
return _eglError(EGL_BAD_ATTRIBUTE, "eglGetConfigAttrib");
|
||||
|
||||
/* nonqueryable attributes */
|
||||
switch (attribute) {
|
||||
case EGL_MATCH_NATIVE_PIXMAP:
|
||||
return _eglError(EGL_BAD_ATTRIBUTE, "eglGetConfigAttrib");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (!value)
|
||||
return _eglError(EGL_BAD_PARAMETER, "eglGetConfigAttrib");
|
||||
|
||||
|
@@ -1,3 +1,33 @@
|
||||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
|
||||
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
|
||||
* Copyright 2010-2011 LunarG, Inc.
|
||||
* 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 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.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
#ifndef EGLCONFIG_INCLUDED
|
||||
#define EGLCONFIG_INCLUDED
|
||||
|
||||
|
@@ -1,3 +1,33 @@
|
||||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
|
||||
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
|
||||
* Copyright 2010-2011 LunarG, Inc.
|
||||
* 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 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.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
@@ -1,3 +1,33 @@
|
||||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
|
||||
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
|
||||
* Copyright 2010-2011 LunarG, Inc.
|
||||
* 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 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.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
#ifndef EGLCONTEXT_INCLUDED
|
||||
#define EGLCONTEXT_INCLUDED
|
||||
|
||||
|
@@ -1,3 +1,31 @@
|
||||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
|
||||
* 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 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.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "egllog.h"
|
||||
|
@@ -1,3 +1,31 @@
|
||||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
|
||||
* 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 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.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
#ifndef EGLCURRENT_INCLUDED
|
||||
#define EGLCURRENT_INCLUDED
|
||||
|
||||
|
@@ -1,8 +1,8 @@
|
||||
/**************************************************************************
|
||||
*
|
||||
*
|
||||
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
|
||||
* 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
|
||||
@@ -10,23 +10,22 @@
|
||||
* 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 TUNGSTEN GRAPHICS AND/OR ITS 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.
|
||||
*
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Internal EGL defines
|
||||
*/
|
||||
|
@@ -1,3 +1,33 @@
|
||||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
|
||||
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
|
||||
* Copyright 2010-2011 LunarG, Inc.
|
||||
* 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 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.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
/**
|
||||
* Functions related to EGLDisplay.
|
||||
*/
|
||||
|
@@ -1,3 +1,33 @@
|
||||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
|
||||
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
|
||||
* Copyright 2010-2011 LunarG, Inc.
|
||||
* 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 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.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
#ifndef EGLDISPLAY_INCLUDED
|
||||
#define EGLDISPLAY_INCLUDED
|
||||
|
||||
|
@@ -1,3 +1,33 @@
|
||||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
|
||||
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
|
||||
* Copyright 2010-2011 LunarG, Inc.
|
||||
* 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 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.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
/**
|
||||
* Functions for choosing and opening/loading device drivers.
|
||||
*/
|
||||
|
@@ -1,3 +1,33 @@
|
||||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
|
||||
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
|
||||
* Copyright 2010-2011 LunarG, Inc.
|
||||
* 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 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.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
#ifndef EGLDRIVER_INCLUDED
|
||||
#define EGLDRIVER_INCLUDED
|
||||
|
||||
|
@@ -1,3 +1,31 @@
|
||||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2010 LunarG, Inc.
|
||||
* 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 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.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
#include <string.h>
|
||||
#include "egltypedefs.h"
|
||||
#include "egldriver.h"
|
||||
|
@@ -1,3 +1,33 @@
|
||||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
|
||||
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
|
||||
* Copyright 2010-2011 LunarG, Inc.
|
||||
* 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 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.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <assert.h>
|
||||
#include "eglglobals.h"
|
||||
|
@@ -1,3 +1,33 @@
|
||||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
|
||||
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
|
||||
* Copyright 2010-2011 LunarG, Inc.
|
||||
* 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 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.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
#ifndef EGLGLOBALS_INCLUDED
|
||||
#define EGLGLOBALS_INCLUDED
|
||||
|
||||
|
@@ -1,3 +1,32 @@
|
||||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
|
||||
* Copyright 2010-2011 LunarG, Inc.
|
||||
* 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 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.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
|
||||
|
@@ -1,3 +1,32 @@
|
||||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
|
||||
* Copyright 2010-2011 LunarG, Inc.
|
||||
* 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 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.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
#ifndef EGLIMAGE_INCLUDED
|
||||
#define EGLIMAGE_INCLUDED
|
||||
|
||||
|
@@ -1,3 +1,33 @@
|
||||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
|
||||
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
|
||||
* Copyright 2010 LunarG, Inc.
|
||||
* 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 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.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
/**
|
||||
* Logging facility for debug/info messages.
|
||||
* _EGL_FATAL messages are printed to stderr
|
||||
|
@@ -1,3 +1,32 @@
|
||||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
|
||||
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
|
||||
* 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 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.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
#ifndef EGLLOG_INCLUDED
|
||||
#define EGLLOG_INCLUDED
|
||||
|
||||
|
@@ -1,8 +1,10 @@
|
||||
/**************************************************************************
|
||||
*
|
||||
*
|
||||
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
|
||||
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
|
||||
* Copyright 2010-2011 LunarG, Inc.
|
||||
* 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
|
||||
@@ -10,19 +12,19 @@
|
||||
* 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 TUNGSTEN GRAPHICS AND/OR ITS 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.
|
||||
*
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
|
@@ -1,8 +1,10 @@
|
||||
/**************************************************************************
|
||||
*
|
||||
*
|
||||
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
|
||||
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
|
||||
* Copyright 2010-2011 LunarG, Inc.
|
||||
* 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
|
||||
@@ -10,19 +12,19 @@
|
||||
* 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 TUNGSTEN GRAPHICS AND/OR ITS 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.
|
||||
*
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
|
@@ -1,3 +1,33 @@
|
||||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
|
||||
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
|
||||
* Copyright 2010 LunarG, Inc.
|
||||
* 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 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.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
@@ -1,3 +1,33 @@
|
||||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
|
||||
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
|
||||
* Copyright 2010 LunarG, Inc.
|
||||
* 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 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.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
#ifndef EGLMODE_INCLUDED
|
||||
#define EGLMODE_INCLUDED
|
||||
|
||||
|
@@ -1,3 +1,31 @@
|
||||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2009 Chia-I Wu <olvaffe@gmail.com>
|
||||
* 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 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.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
#ifndef EGLMUTEX_INCLUDED
|
||||
#define EGLMUTEX_INCLUDED
|
||||
|
||||
|
@@ -1,3 +1,33 @@
|
||||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
|
||||
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
|
||||
* Copyright 2010 LunarG, Inc.
|
||||
* 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 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.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
/*
|
||||
* Ideas for screen management extension to EGL.
|
||||
*
|
||||
|
@@ -1,3 +1,33 @@
|
||||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
|
||||
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
|
||||
* Copyright 2010 LunarG, Inc.
|
||||
* 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 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.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
#ifndef EGLSCREEN_INCLUDED
|
||||
#define EGLSCREEN_INCLUDED
|
||||
|
||||
|
@@ -1,3 +1,33 @@
|
||||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
|
||||
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
|
||||
* Copyright 2010-2011 LunarG, Inc.
|
||||
* 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 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.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
/**
|
||||
* String utils.
|
||||
*/
|
||||
|
@@ -1,3 +1,33 @@
|
||||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
|
||||
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
|
||||
* Copyright 2010-2011 LunarG, Inc.
|
||||
* 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 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.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
#ifndef EGLSTRING_INCLUDED
|
||||
#define EGLSTRING_INCLUDED
|
||||
|
||||
|
@@ -1,3 +1,33 @@
|
||||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
|
||||
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
|
||||
* Copyright 2010 LunarG, Inc.
|
||||
* 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 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.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
/**
|
||||
* Surface-related functions.
|
||||
*/
|
||||
|
@@ -1,3 +1,33 @@
|
||||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
|
||||
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
|
||||
* Copyright 2010 LunarG, Inc.
|
||||
* 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 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.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
#ifndef EGLSURFACE_INCLUDED
|
||||
#define EGLSURFACE_INCLUDED
|
||||
|
||||
|
@@ -1,3 +1,31 @@
|
||||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2010 LunarG, Inc.
|
||||
* 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 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.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "eglsync.h"
|
||||
|
@@ -1,3 +1,31 @@
|
||||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2010 LunarG, Inc.
|
||||
* 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 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.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
#ifndef EGLSYNC_INCLUDED
|
||||
#define EGLSYNC_INCLUDED
|
||||
|
||||
|
@@ -1,3 +1,33 @@
|
||||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
|
||||
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
|
||||
* Copyright 2010 LunarG, Inc.
|
||||
* 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 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.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
#ifndef EGLTYPEDEFS_INCLUDED
|
||||
#define EGLTYPEDEFS_INCLUDED
|
||||
|
||||
|
@@ -1,5 +1,32 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<protocol name="drm">
|
||||
|
||||
<copyright>
|
||||
Copyright © 2008-2011 Kristian Høgsberg
|
||||
Copyright © 2010-2011 Intel Corporation
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this
|
||||
software and its documentation for any purpose is hereby granted
|
||||
without fee, provided that\n the above copyright notice appear in
|
||||
all copies and that both that copyright notice and this permission
|
||||
notice appear in supporting documentation, and that the name of
|
||||
the copyright holders not be used in advertising or publicity
|
||||
pertaining to distribution of the software without specific,
|
||||
written prior permission. The copyright holders make no
|
||||
representations about the suitability of this software for any
|
||||
purpose. It is provided "as is" without express or implied
|
||||
warranty.
|
||||
|
||||
THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
|
||||
SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
|
||||
AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
|
||||
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
|
||||
THIS SOFTWARE.
|
||||
</copyright>
|
||||
|
||||
<!-- drm support. This object is created by the server and published
|
||||
using the display's global event. -->
|
||||
<interface name="wl_drm" version="1">
|
||||
|
@@ -207,17 +207,13 @@ lp_disassemble(const void* func)
|
||||
}
|
||||
|
||||
raw_debug_ostream Out;
|
||||
TargetMachine *TM = T->createTargetMachine(Triple, "");
|
||||
|
||||
#if HAVE_LLVM >= 0x0300
|
||||
unsigned int AsmPrinterVariant = AsmInfo->getAssemblerDialect();
|
||||
#else
|
||||
int AsmPrinterVariant = AsmInfo->getAssemblerDialect();
|
||||
#endif
|
||||
#if HAVE_LLVM >= 0x0300
|
||||
OwningPtr<MCInstPrinter> Printer(
|
||||
T->createMCInstPrinter(*TM, AsmPrinterVariant, *AsmInfo));
|
||||
#elif HAVE_LLVM >= 0x0208
|
||||
#if HAVE_LLVM >= 0x0208
|
||||
OwningPtr<MCInstPrinter> Printer(
|
||||
T->createMCInstPrinter(AsmPrinterVariant, *AsmInfo));
|
||||
#else
|
||||
@@ -229,6 +225,12 @@ lp_disassemble(const void* func)
|
||||
return;
|
||||
}
|
||||
|
||||
#if HAVE_LLVM >= 0x0300
|
||||
TargetMachine *TM = T->createTargetMachine(Triple, sys::getHostCPUName(), "");
|
||||
#else
|
||||
TargetMachine *TM = T->createTargetMachine(Triple, "");
|
||||
#endif
|
||||
|
||||
const TargetInstrInfo *TII = TM->getInstrInfo();
|
||||
|
||||
/*
|
||||
|
@@ -119,8 +119,15 @@ util_format_s3tc_init(void)
|
||||
|
||||
library = util_dl_open(DXTN_LIBNAME);
|
||||
if (!library) {
|
||||
debug_printf("couldn't open " DXTN_LIBNAME ", software DXTn "
|
||||
"compression/decompression unavailable\n");
|
||||
if (getenv("force_s3tc_enable") &&
|
||||
!strcmp(getenv("force_s3tc_enable"), "true")) {
|
||||
debug_printf("couldn't open " DXTN_LIBNAME ", enabling DXTn due to "
|
||||
"force_s3tc_enable=true environment variable\n");
|
||||
util_format_s3tc_enabled = TRUE;
|
||||
} else {
|
||||
debug_printf("couldn't open " DXTN_LIBNAME ", software DXTn "
|
||||
"compression/decompression unavailable\n");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -79,6 +79,8 @@ struct u_vbuf_mgr_priv {
|
||||
void *saved_ve, *fallback_ve;
|
||||
boolean ve_binding_lock;
|
||||
|
||||
unsigned saved_buffer_offset[PIPE_MAX_ATTRIBS];
|
||||
|
||||
boolean any_user_vbs;
|
||||
boolean incompatible_vb_layout;
|
||||
};
|
||||
@@ -488,6 +490,7 @@ void u_vbuf_mgr_set_vertex_buffers(struct u_vbuf_mgr *mgrb,
|
||||
|
||||
pipe_resource_reference(&mgr->b.vertex_buffer[i].buffer, vb->buffer);
|
||||
pipe_resource_reference(&mgr->b.real_vertex_buffer[i], NULL);
|
||||
mgr->saved_buffer_offset[i] = vb->buffer_offset;
|
||||
|
||||
if (!vb->buffer) {
|
||||
continue;
|
||||
@@ -647,6 +650,13 @@ u_vbuf_mgr_draw_begin(struct u_vbuf_mgr *mgrb,
|
||||
void u_vbuf_mgr_draw_end(struct u_vbuf_mgr *mgrb)
|
||||
{
|
||||
struct u_vbuf_mgr_priv *mgr = (struct u_vbuf_mgr_priv*)mgrb;
|
||||
unsigned i;
|
||||
|
||||
/* buffer offsets were modified in u_vbuf_upload_buffers */
|
||||
if (mgr->any_user_vbs) {
|
||||
for (i = 0; i < mgr->b.nr_vertex_buffers; i++)
|
||||
mgr->b.vertex_buffer[i].buffer_offset = mgr->saved_buffer_offset[i];
|
||||
}
|
||||
|
||||
if (mgr->fallback_ve) {
|
||||
u_vbuf_translate_end(mgr);
|
||||
|
@@ -29,6 +29,7 @@
|
||||
#define I915_BATCH_H
|
||||
|
||||
#include "i915_batchbuffer.h"
|
||||
#include "i915_context.h"
|
||||
|
||||
|
||||
#define BEGIN_BATCH(dwords) \
|
||||
@@ -49,11 +50,26 @@
|
||||
#define FLUSH_BATCH(fence) \
|
||||
i915_flush(i915, fence)
|
||||
|
||||
|
||||
/************************************************************************
|
||||
* i915_flush.c
|
||||
*/
|
||||
void i915_flush(struct i915_context *i915, struct pipe_fence_handle **fence);
|
||||
|
||||
/*
|
||||
* Flush if the current color buf is idle and we have more than 256 vertices
|
||||
* queued, or if the current color buf is busy and we have more than 4096
|
||||
* vertices queued.
|
||||
*/
|
||||
static INLINE void i915_flush_heuristically(struct i915_context* i915,
|
||||
int num_vertex)
|
||||
{
|
||||
struct i915_winsys *iws = i915->iws;
|
||||
i915->vertices_since_last_flush += num_vertex;
|
||||
if ( i915->vertices_since_last_flush > 4096
|
||||
|| ( i915->vertices_since_last_flush > 256 &&
|
||||
!iws->buffer_is_busy(iws, i915->current.cbuf_bo)) )
|
||||
FLUSH_BATCH(NULL);
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
@@ -120,6 +120,11 @@ i915_clear_emit(struct pipe_context *pipe, unsigned buffers, const float *rgba,
|
||||
OUT_BATCH_F(desty + height);
|
||||
OUT_BATCH_F(destx);
|
||||
OUT_BATCH_F(desty);
|
||||
|
||||
/* Flush after clear, its expected to be a costly operation.
|
||||
* This is not required, just a heuristic
|
||||
*/
|
||||
FLUSH_BATCH(NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -264,6 +264,8 @@ struct i915_context {
|
||||
struct util_slab_mempool transfer_pool;
|
||||
struct util_slab_mempool texture_transfer_pool;
|
||||
|
||||
int vertices_since_last_flush;
|
||||
|
||||
/** blitter/hw-clear */
|
||||
struct blitter_context* blitter;
|
||||
|
||||
|
@@ -77,4 +77,5 @@ void i915_flush(struct i915_context *i915, struct pipe_fence_handle **fence)
|
||||
i915->static_dirty = ~0;
|
||||
/* kernel emits flushes in between batchbuffers */
|
||||
i915->flush_dirty = 0;
|
||||
i915->vertices_since_last_flush = 0;
|
||||
}
|
||||
|
@@ -166,6 +166,8 @@ emit_prim( struct draw_stage *stage,
|
||||
|
||||
for (i = 0; i < nr; i++)
|
||||
emit_hw_vertex(i915, prim->v[i]);
|
||||
|
||||
i915_flush_heuristically(i915, nr);
|
||||
}
|
||||
|
||||
|
||||
|
@@ -487,6 +487,7 @@ draw_arrays_fallback(struct vbuf_render *render,
|
||||
|
||||
draw_arrays_generate_indices(render, start, nr, i915_render->fallback);
|
||||
|
||||
i915_flush_heuristically(i915, nr_indices);
|
||||
out:
|
||||
return;
|
||||
}
|
||||
@@ -534,6 +535,7 @@ i915_vbuf_render_draw_arrays(struct vbuf_render *render,
|
||||
nr);
|
||||
OUT_BATCH(start); /* Beginning vertex index */
|
||||
|
||||
i915_flush_heuristically(i915, nr);
|
||||
out:
|
||||
return;
|
||||
}
|
||||
@@ -657,6 +659,7 @@ i915_vbuf_render_draw_elements(struct vbuf_render *render,
|
||||
save_nr_indices,
|
||||
i915_render->fallback);
|
||||
|
||||
i915_flush_heuristically(i915, nr_indices);
|
||||
out:
|
||||
return;
|
||||
}
|
||||
|
@@ -243,7 +243,7 @@ i915_create_sampler_state(struct pipe_context *pipe,
|
||||
|
||||
/* Shadow:
|
||||
*/
|
||||
if (sampler->compare_mode == PIPE_TEX_COMPARE_R_TO_TEXTURE)
|
||||
if (sampler->compare_mode == PIPE_TEX_COMPARE_R_TO_TEXTURE)
|
||||
{
|
||||
cso->state[0] |= (SS2_SHADOW_ENABLE |
|
||||
i915_translate_compare_func(sampler->compare_func));
|
||||
|
@@ -349,25 +349,25 @@ static const struct
|
||||
uint hw_swizzle;
|
||||
} fixup_formats[] = {
|
||||
{ PIPE_FORMAT_R8G8B8A8_UNORM, 0x21030000 /* BGRA */},
|
||||
{ PIPE_FORMAT_L8_UNORM, 0x00000000 /* RRRR */},
|
||||
{ PIPE_FORMAT_I8_UNORM, 0x00000000 /* RRRR */},
|
||||
{ PIPE_FORMAT_L8_UNORM, 0x00030000 /* RRRA */},
|
||||
{ PIPE_FORMAT_I8_UNORM, 0x00030000 /* RRRA */},
|
||||
{ PIPE_FORMAT_A8_UNORM, 0x33330000 /* AAAA */},
|
||||
{ PIPE_FORMAT_NONE, 0x00000000},
|
||||
};
|
||||
|
||||
static boolean need_fixup(struct pipe_surface* p)
|
||||
static uint need_target_fixup(struct pipe_surface* p)
|
||||
{
|
||||
enum pipe_format f;
|
||||
/* if we don't have a surface bound yet, we don't need to fixup the shader */
|
||||
if (!p)
|
||||
return FALSE;
|
||||
return 0;
|
||||
|
||||
f = p->format;
|
||||
for(int i=0; fixup_formats[i].format != PIPE_FORMAT_NONE; i++)
|
||||
if (fixup_formats[i].format == f)
|
||||
return TRUE;
|
||||
return 1;
|
||||
|
||||
return FALSE;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static uint fixup_swizzle(enum pipe_format f)
|
||||
@@ -383,29 +383,35 @@ static void
|
||||
validate_program(struct i915_context *i915, unsigned *batch_space)
|
||||
{
|
||||
struct pipe_surface *cbuf_surface = i915->framebuffer.cbufs[0];
|
||||
uint additional_size = need_target_fixup(cbuf_surface);
|
||||
|
||||
/* we need more batch space if we want to emulate rgba framebuffers */
|
||||
*batch_space = i915->fs->program_len + (need_fixup(cbuf_surface) ? 3 : 0);
|
||||
*batch_space = i915->fs->program_len + 3 * additional_size;
|
||||
}
|
||||
|
||||
static void
|
||||
emit_program(struct i915_context *i915)
|
||||
{
|
||||
struct pipe_surface *cbuf_surface = i915->framebuffer.cbufs[0];
|
||||
boolean need_format_fixup = need_fixup(cbuf_surface);
|
||||
uint target_fixup = need_target_fixup(cbuf_surface);
|
||||
uint i;
|
||||
|
||||
/* we should always have, at least, a pass-through program */
|
||||
assert(i915->fs->program_len > 0);
|
||||
for (i = 0; i < i915->fs->program_len; i++) {
|
||||
if ((i == 0) && need_format_fixup)
|
||||
OUT_BATCH(i915->fs->program[i] + 3);
|
||||
else
|
||||
OUT_BATCH(i915->fs->program[i]);
|
||||
|
||||
{
|
||||
/* first word has the size, we have to adjust that */
|
||||
uint size = (i915->fs->program[0]);
|
||||
size += target_fixup * 3;
|
||||
OUT_BATCH(size);
|
||||
}
|
||||
|
||||
/* output the declarations of the program */
|
||||
for (i=1 ; i < i915->fs->program_len; i++)
|
||||
OUT_BATCH(i915->fs->program[i]);
|
||||
|
||||
/* we emit an additional mov with swizzle to fake RGBA framebuffers */
|
||||
if (need_format_fixup) {
|
||||
if (target_fixup) {
|
||||
/* mov out_color, out_color.zyxw */
|
||||
OUT_BATCH(A0_MOV |
|
||||
(REG_TYPE_OC << A0_DEST_TYPE_SHIFT) |
|
||||
|
@@ -207,6 +207,12 @@ struct i915_winsys {
|
||||
|
||||
void (*buffer_destroy)(struct i915_winsys *iws,
|
||||
struct i915_winsys_buffer *buffer);
|
||||
|
||||
/**
|
||||
* Check if a buffer is busy.
|
||||
*/
|
||||
boolean (*buffer_is_busy)(struct i915_winsys *iws,
|
||||
struct i915_winsys_buffer *buffer);
|
||||
/*@}*/
|
||||
|
||||
|
||||
|
@@ -284,7 +284,7 @@ const struct nv50_format nv50_format_table[PIPE_FORMAT_COUNT] =
|
||||
|
||||
[PIPE_FORMAT_R16G16B16_FLOAT] = { NV50_SURFACE_FORMAT_R16G16B16X16_FLOAT,
|
||||
A_(C0, C1, C2, ONE_FLOAT, FLOAT, FLOAT, FLOAT, FLOAT, 16_16_16, 0),
|
||||
VERTEX_BUFFER | SAMPLER_VIEW | RENDER_TARGET },
|
||||
VERTEX_BUFFER },
|
||||
|
||||
[PIPE_FORMAT_R16G16_FLOAT] = { NV50_SURFACE_FORMAT_R16G16_FLOAT,
|
||||
A_(C0, C1, ZERO, ONE_FLOAT, FLOAT, FLOAT, FLOAT, FLOAT, 16_16, 0),
|
||||
@@ -302,7 +302,7 @@ const struct nv50_format nv50_format_table[PIPE_FORMAT_COUNT] =
|
||||
|
||||
[PIPE_FORMAT_R32G32B32_FLOAT] = { NV50_SURFACE_FORMAT_R32G32B32X32_FLOAT,
|
||||
A_(C0, C1, C2, ONE_FLOAT, FLOAT, FLOAT, FLOAT, FLOAT, 32_32_32, 0),
|
||||
VERTEX_BUFFER | SAMPLER_VIEW | RENDER_TARGET },
|
||||
VERTEX_BUFFER },
|
||||
|
||||
[PIPE_FORMAT_R32G32_FLOAT] = { NV50_SURFACE_FORMAT_R32G32_FLOAT,
|
||||
A_(C0, C1, ZERO, ONE_FLOAT, FLOAT, FLOAT, FLOAT, FLOAT, 32_32, 0),
|
||||
@@ -330,7 +330,7 @@ const struct nv50_format nv50_format_table[PIPE_FORMAT_COUNT] =
|
||||
|
||||
[PIPE_FORMAT_R32G32B32_SNORM] = { 0,
|
||||
A_(C0, C1, C2, ONE_FLOAT, SNORM, SNORM, SNORM, SNORM, 32_32_32, 0),
|
||||
VERTEX_BUFFER | SAMPLER_VIEW },
|
||||
VERTEX_BUFFER },
|
||||
|
||||
[PIPE_FORMAT_R32G32_SNORM] = { 0,
|
||||
A_(C0, C1, ZERO, ONE_FLOAT, SNORM, SNORM, SNORM, SNORM, 32_32, 0),
|
||||
@@ -348,7 +348,7 @@ const struct nv50_format nv50_format_table[PIPE_FORMAT_COUNT] =
|
||||
|
||||
[PIPE_FORMAT_R32G32B32_UNORM] = { 0,
|
||||
A_(C0, C1, C2, ONE_FLOAT, UNORM, UNORM, UNORM, UNORM, 32_32_32, 0),
|
||||
VERTEX_BUFFER | SAMPLER_VIEW },
|
||||
VERTEX_BUFFER },
|
||||
|
||||
[PIPE_FORMAT_R32G32_UNORM] = { 0,
|
||||
A_(C0, C1, ZERO, ONE_FLOAT, UNORM, UNORM, UNORM, UNORM, 32_32, 0),
|
||||
@@ -366,7 +366,7 @@ const struct nv50_format nv50_format_table[PIPE_FORMAT_COUNT] =
|
||||
|
||||
[PIPE_FORMAT_R16G16B16_SNORM] = { 0,
|
||||
A_(C0, C1, C2, ONE_FLOAT, SNORM, SNORM, SNORM, SNORM, 16_16_16, 0),
|
||||
VERTEX_BUFFER | SAMPLER_VIEW },
|
||||
VERTEX_BUFFER },
|
||||
|
||||
[PIPE_FORMAT_R16G16_SNORM] = { NV50_SURFACE_FORMAT_R16G16_SNORM,
|
||||
A_(C0, C1, ZERO, ONE_FLOAT, SNORM, SNORM, SNORM, SNORM, 16_16, 0),
|
||||
@@ -384,7 +384,7 @@ const struct nv50_format nv50_format_table[PIPE_FORMAT_COUNT] =
|
||||
|
||||
[PIPE_FORMAT_R16G16B16_UNORM] = { 0,
|
||||
A_(C0, C1, C2, ONE_FLOAT, UNORM, UNORM, UNORM, UNORM, 16_16_16, 0),
|
||||
VERTEX_BUFFER | SAMPLER_VIEW },
|
||||
VERTEX_BUFFER },
|
||||
|
||||
[PIPE_FORMAT_R16G16_UNORM] = { NV50_SURFACE_FORMAT_R16G16_UNORM,
|
||||
A_(C0, C1, ZERO, ONE_FLOAT, UNORM, UNORM, UNORM, UNORM, 16_16, 0),
|
||||
@@ -402,7 +402,7 @@ const struct nv50_format nv50_format_table[PIPE_FORMAT_COUNT] =
|
||||
|
||||
[PIPE_FORMAT_R8G8B8_SNORM] = { 0,
|
||||
A_(C0, C1, C2, ONE_FLOAT, SNORM, SNORM, SNORM, SNORM, 8_8_8, 0),
|
||||
VERTEX_BUFFER | SAMPLER_VIEW },
|
||||
VERTEX_BUFFER },
|
||||
|
||||
[PIPE_FORMAT_R8G8_SNORM] = { NV50_SURFACE_FORMAT_R8G8_SNORM,
|
||||
A_(C0, C1, ZERO, ONE_FLOAT, SNORM, SNORM, SNORM, SNORM, 8_8, 0),
|
||||
@@ -422,13 +422,13 @@ const struct nv50_format nv50_format_table[PIPE_FORMAT_COUNT] =
|
||||
A_(C0, C1, C2, C3, UNORM, UNORM, UNORM, UNORM, 8_8_8_8, 0),
|
||||
SAMPLER_VIEW | RENDER_TARGET },
|
||||
|
||||
[PIPE_FORMAT_R8G8B8X8_UNORM] = { NV50_SURFACE_FORMAT_X8B8G8R8_UNORM,
|
||||
B_(C0, C1, C2, ONE_FLOAT, UNORM, UNORM, UNORM, UNORM, 8_8_8_8, 0),
|
||||
SAMPLER_VIEW | RENDER_TARGET },
|
||||
|
||||
[PIPE_FORMAT_R8G8B8_UNORM] = { NV50_SURFACE_FORMAT_X8B8G8R8_UNORM,
|
||||
A_(C0, C1, C2, ONE_FLOAT, UNORM, UNORM, UNORM, UNORM, 8_8_8, 0),
|
||||
VERTEX_BUFFER | SAMPLER_VIEW | RENDER_TARGET },
|
||||
|
||||
[PIPE_FORMAT_R8G8B8_SRGB] = { NV50_SURFACE_FORMAT_X8B8G8R8_SRGB,
|
||||
A_(C0, C1, C2, ONE_FLOAT, UNORM, UNORM, UNORM, UNORM, 8_8_8, 0),
|
||||
SAMPLER_VIEW | RENDER_TARGET },
|
||||
VERTEX_BUFFER },
|
||||
|
||||
[PIPE_FORMAT_R8G8_UNORM] = { NV50_SURFACE_FORMAT_R8G8_UNORM,
|
||||
A_(C0, C1, ZERO, ONE_FLOAT, UNORM, UNORM, UNORM, UNORM, 8_8, 0),
|
||||
|
@@ -154,6 +154,9 @@ nv50_miptree_create(struct pipe_screen *pscreen,
|
||||
case PIPE_FORMAT_R32G32B32_FLOAT:
|
||||
tile_flags = 0x7400;
|
||||
break;
|
||||
case PIPE_FORMAT_Z32_FLOAT:
|
||||
tile_flags = 0x4000;
|
||||
break;
|
||||
case PIPE_FORMAT_Z32_FLOAT_S8X24_USCALED:
|
||||
tile_flags = 0x6000;
|
||||
break;
|
||||
|
@@ -289,7 +289,7 @@ const struct nvc0_format nvc0_format_table[PIPE_FORMAT_COUNT] =
|
||||
|
||||
[PIPE_FORMAT_R16G16B16_FLOAT] = { NV50_SURFACE_FORMAT_R16G16B16X16_FLOAT,
|
||||
A_(C0, C1, C2, ONE_FLOAT, FLOAT, FLOAT, FLOAT, FLOAT, 16_16_16, 0),
|
||||
VERTEX_BUFFER | SAMPLER_VIEW | RENDER_TARGET },
|
||||
VERTEX_BUFFER },
|
||||
|
||||
[PIPE_FORMAT_R16G16_FLOAT] = { NV50_SURFACE_FORMAT_R16G16_FLOAT,
|
||||
A_(C0, C1, ZERO, ONE_FLOAT, FLOAT, FLOAT, FLOAT, FLOAT, 16_16, 0),
|
||||
@@ -307,7 +307,7 @@ const struct nvc0_format nvc0_format_table[PIPE_FORMAT_COUNT] =
|
||||
|
||||
[PIPE_FORMAT_R32G32B32_FLOAT] = { NV50_SURFACE_FORMAT_R32G32B32X32_FLOAT,
|
||||
A_(C0, C1, C2, ONE_FLOAT, FLOAT, FLOAT, FLOAT, FLOAT, 32_32_32, 0),
|
||||
VERTEX_BUFFER | SAMPLER_VIEW | RENDER_TARGET },
|
||||
VERTEX_BUFFER },
|
||||
|
||||
[PIPE_FORMAT_R32G32_FLOAT] = { NV50_SURFACE_FORMAT_R32G32_FLOAT,
|
||||
A_(C0, C1, ZERO, ONE_FLOAT, FLOAT, FLOAT, FLOAT, FLOAT, 32_32, 0),
|
||||
@@ -335,7 +335,7 @@ const struct nvc0_format nvc0_format_table[PIPE_FORMAT_COUNT] =
|
||||
|
||||
[PIPE_FORMAT_R32G32B32_SNORM] = { 0,
|
||||
A_(C0, C1, C2, ONE_FLOAT, SNORM, SNORM, SNORM, SNORM, 32_32_32, 0),
|
||||
VERTEX_BUFFER | SAMPLER_VIEW },
|
||||
VERTEX_BUFFER },
|
||||
|
||||
[PIPE_FORMAT_R32G32_SNORM] = { 0,
|
||||
A_(C0, C1, ZERO, ONE_FLOAT, SNORM, SNORM, SNORM, SNORM, 32_32, 0),
|
||||
@@ -353,7 +353,7 @@ const struct nvc0_format nvc0_format_table[PIPE_FORMAT_COUNT] =
|
||||
|
||||
[PIPE_FORMAT_R32G32B32_UNORM] = { 0,
|
||||
A_(C0, C1, C2, ONE_FLOAT, UNORM, UNORM, UNORM, UNORM, 32_32_32, 0),
|
||||
VERTEX_BUFFER | SAMPLER_VIEW },
|
||||
VERTEX_BUFFER },
|
||||
|
||||
[PIPE_FORMAT_R32G32_UNORM] = { 0,
|
||||
A_(C0, C1, ZERO, ONE_FLOAT, UNORM, UNORM, UNORM, UNORM, 32_32, 0),
|
||||
@@ -371,7 +371,7 @@ const struct nvc0_format nvc0_format_table[PIPE_FORMAT_COUNT] =
|
||||
|
||||
[PIPE_FORMAT_R16G16B16_SNORM] = { 0,
|
||||
A_(C0, C1, C2, ONE_FLOAT, SNORM, SNORM, SNORM, SNORM, 16_16_16, 0),
|
||||
VERTEX_BUFFER | SAMPLER_VIEW },
|
||||
VERTEX_BUFFER },
|
||||
|
||||
[PIPE_FORMAT_R16G16_SNORM] = { NV50_SURFACE_FORMAT_R16G16_SNORM,
|
||||
A_(C0, C1, ZERO, ONE_FLOAT, SNORM, SNORM, SNORM, SNORM, 16_16, 0),
|
||||
@@ -389,7 +389,7 @@ const struct nvc0_format nvc0_format_table[PIPE_FORMAT_COUNT] =
|
||||
|
||||
[PIPE_FORMAT_R16G16B16_UNORM] = { 0,
|
||||
A_(C0, C1, C2, ONE_FLOAT, UNORM, UNORM, UNORM, UNORM, 16_16_16, 0),
|
||||
VERTEX_BUFFER | SAMPLER_VIEW },
|
||||
VERTEX_BUFFER },
|
||||
|
||||
[PIPE_FORMAT_R16G16_UNORM] = { NV50_SURFACE_FORMAT_R16G16_UNORM,
|
||||
A_(C0, C1, ZERO, ONE_FLOAT, UNORM, UNORM, UNORM, UNORM, 16_16, 0),
|
||||
@@ -407,7 +407,7 @@ const struct nvc0_format nvc0_format_table[PIPE_FORMAT_COUNT] =
|
||||
|
||||
[PIPE_FORMAT_R8G8B8_SNORM] = { 0,
|
||||
A_(C0, C1, C2, ONE_FLOAT, SNORM, SNORM, SNORM, SNORM, 8_8_8, 0),
|
||||
VERTEX_BUFFER | SAMPLER_VIEW },
|
||||
VERTEX_BUFFER },
|
||||
|
||||
[PIPE_FORMAT_R8G8_SNORM] = { NV50_SURFACE_FORMAT_R8G8_SNORM,
|
||||
A_(C0, C1, ZERO, ONE_FLOAT, SNORM, SNORM, SNORM, SNORM, 8_8, 0),
|
||||
@@ -427,13 +427,13 @@ const struct nvc0_format nvc0_format_table[PIPE_FORMAT_COUNT] =
|
||||
A_(C0, C1, C2, C3, UNORM, UNORM, UNORM, UNORM, 8_8_8_8, 0),
|
||||
SAMPLER_VIEW | RENDER_TARGET },
|
||||
|
||||
[PIPE_FORMAT_R8G8B8X8_UNORM] = { NV50_SURFACE_FORMAT_X8B8G8R8_UNORM,
|
||||
B_(C0, C1, C2, ONE_FLOAT, UNORM, UNORM, UNORM, UNORM, 8_8_8_8, 0),
|
||||
SAMPLER_VIEW | RENDER_TARGET },
|
||||
|
||||
[PIPE_FORMAT_R8G8B8_UNORM] = { NV50_SURFACE_FORMAT_X8B8G8R8_UNORM,
|
||||
A_(C0, C1, C2, ONE_FLOAT, UNORM, UNORM, UNORM, UNORM, 8_8_8, 0),
|
||||
VERTEX_BUFFER | SAMPLER_VIEW | RENDER_TARGET },
|
||||
|
||||
[PIPE_FORMAT_R8G8B8_SRGB] = { NV50_SURFACE_FORMAT_X8B8G8R8_SRGB,
|
||||
A_(C0, C1, C2, ONE_FLOAT, UNORM, UNORM, UNORM, UNORM, 8_8_8, 0),
|
||||
SAMPLER_VIEW | RENDER_TARGET },
|
||||
VERTEX_BUFFER },
|
||||
|
||||
[PIPE_FORMAT_R8G8_UNORM] = { NV50_SURFACE_FORMAT_R8G8_UNORM,
|
||||
A_(C0, C1, ZERO, ONE_FLOAT, UNORM, UNORM, UNORM, UNORM, 8_8, 0),
|
||||
|
@@ -168,6 +168,9 @@ nvc0_miptree_create(struct pipe_screen *pscreen,
|
||||
tile_flags = 0xf900; /* MSAA 4 */
|
||||
tile_flags = 0xfe00; /* NORMAL */
|
||||
break;
|
||||
case PIPE_FORMAT_Z32_FLOAT:
|
||||
tile_flags = 0x7b00;
|
||||
break;
|
||||
case PIPE_FORMAT_Z32_FLOAT_S8X24_USCALED:
|
||||
tile_flags = 0xce00; /* COMPRESSED */
|
||||
tile_flags = 0xcf00; /* MSAA 2, COMPRESSED */
|
||||
|
@@ -33,6 +33,9 @@ nvfx_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
|
||||
return 1;
|
||||
case PIPE_CAP_GLSL:
|
||||
return 1;
|
||||
case PIPE_CAP_SM3:
|
||||
/* TODO: >= nv4x support Shader Model 3.0 */
|
||||
return 0;
|
||||
case PIPE_CAP_ANISOTROPIC_FILTER:
|
||||
return 1;
|
||||
case PIPE_CAP_POINT_SPRITE:
|
||||
|
@@ -447,16 +447,8 @@ static uint32_t r300_translate_colorformat(enum pipe_format format)
|
||||
/*case PIPE_FORMAT_B8G8R8A8_SNORM:*/
|
||||
case PIPE_FORMAT_B8G8R8X8_UNORM:
|
||||
/*case PIPE_FORMAT_B8G8R8X8_SNORM:*/
|
||||
case PIPE_FORMAT_A8R8G8B8_UNORM:
|
||||
/*case PIPE_FORMAT_A8R8G8B8_SNORM:*/
|
||||
case PIPE_FORMAT_X8R8G8B8_UNORM:
|
||||
/*case PIPE_FORMAT_X8R8G8B8_SNORM:*/
|
||||
case PIPE_FORMAT_A8B8G8R8_UNORM:
|
||||
/*case PIPE_FORMAT_A8B8G8R8_SNORM:*/
|
||||
case PIPE_FORMAT_R8G8B8A8_UNORM:
|
||||
case PIPE_FORMAT_R8G8B8A8_SNORM:
|
||||
case PIPE_FORMAT_X8B8G8R8_UNORM:
|
||||
/*case PIPE_FORMAT_X8B8G8R8_SNORM:*/
|
||||
case PIPE_FORMAT_R8G8B8X8_UNORM:
|
||||
/*case PIPE_FORMAT_R8G8B8X8_SNORM:*/
|
||||
/* These formats work fine with ARGB8888 if US_OUT_FMT is set
|
||||
@@ -662,10 +654,6 @@ static uint32_t r300_translate_out_fmt(enum pipe_format format)
|
||||
R300_C2_SEL_R | R300_C3_SEL_A;
|
||||
|
||||
/* ARGB outputs. */
|
||||
case PIPE_FORMAT_A8R8G8B8_UNORM:
|
||||
/*case PIPE_FORMAT_A8R8G8B8_SNORM:*/
|
||||
case PIPE_FORMAT_X8R8G8B8_UNORM:
|
||||
/*case PIPE_FORMAT_X8R8G8B8_SNORM:*/
|
||||
case PIPE_FORMAT_A16_UNORM:
|
||||
case PIPE_FORMAT_A16_SNORM:
|
||||
case PIPE_FORMAT_A16_FLOAT:
|
||||
@@ -674,15 +662,6 @@ static uint32_t r300_translate_out_fmt(enum pipe_format format)
|
||||
R300_C0_SEL_A | R300_C1_SEL_R |
|
||||
R300_C2_SEL_G | R300_C3_SEL_B;
|
||||
|
||||
/* ABGR outputs. */
|
||||
case PIPE_FORMAT_A8B8G8R8_UNORM:
|
||||
/*case PIPE_FORMAT_A8B8G8R8_SNORM:*/
|
||||
case PIPE_FORMAT_X8B8G8R8_UNORM:
|
||||
/*case PIPE_FORMAT_X8B8G8R8_SNORM:*/
|
||||
return modifier |
|
||||
R300_C0_SEL_A | R300_C1_SEL_B |
|
||||
R300_C2_SEL_G | R300_C3_SEL_R;
|
||||
|
||||
/* RGBA outputs. */
|
||||
case PIPE_FORMAT_R8G8B8X8_UNORM:
|
||||
/*case PIPE_FORMAT_R8G8B8X8_SNORM:*/
|
||||
|
@@ -1454,6 +1454,11 @@ void evergreen_init_config(struct r600_pipe_context *rctx)
|
||||
tmp |= S_008C28_NUM_LS_STACK_ENTRIES(num_ls_stack_entries);
|
||||
r600_pipe_state_add_reg(rstate, R_008C28_SQ_STACK_RESOURCE_MGMT_3, tmp, 0xFFFFFFFF, NULL);
|
||||
|
||||
tmp = 0;
|
||||
tmp |= S_008E2C_NUM_PS_LDS(0x1000);
|
||||
tmp |= S_008E2C_NUM_LS_LDS(0x1000);
|
||||
r600_pipe_state_add_reg(rstate, R_008E2C_SQ_LDS_RESOURCE_MGMT, tmp, 0xFFFFFFFF, NULL);
|
||||
|
||||
r600_pipe_state_add_reg(rstate, R_009100_SPI_CONFIG_CNTL, 0x0, 0xFFFFFFFF, NULL);
|
||||
r600_pipe_state_add_reg(rstate, R_00913C_SPI_CONFIG_CNTL_1, S_00913C_VTX_DONE_DELAY(4), 0xFFFFFFFF, NULL);
|
||||
|
||||
|
@@ -216,6 +216,13 @@
|
||||
#define S_008C28_NUM_LS_STACK_ENTRIES(x) (((x) & 0xFFF) << 16)
|
||||
#define G_008C28_NUM_LS_STACK_ENTRIES(x) (((x) >> 16) & 0xFFF)
|
||||
#define C_008C28_NUM_LS_STACK_ENTRIES(x) 0xF000FFFF
|
||||
#define R_008E2C_SQ_LDS_RESOURCE_MGMT 0x00008E2C
|
||||
#define S_008E2C_NUM_PS_LDS(x) (((x) & 0xFFFF) << 0)
|
||||
#define G_008E2C_NUM_PS_LDS(x) (((x) >> 0) & 0xFFFF)
|
||||
#define C_008E2C_NUM_PS_LDS(x) 0x0000FFFF
|
||||
#define S_008E2C_NUM_LS_LDS(x) (((x) & 0xFFFF) << 16)
|
||||
#define G_008E2C_NUM_LS_LDS(x) (((x) >> 16) & 0xFFFF)
|
||||
#define C_008E2C_NUM_LS_LDS(x) 0xFFFF0000
|
||||
|
||||
#define R_008CF0_SQ_MS_FIFO_SIZES 0x00008CF0
|
||||
#define S_008CF0_CACHE_FIFO_SIZE(x) (((x) & 0xFF) << 0)
|
||||
|
@@ -211,14 +211,21 @@ struct r600_reloc {
|
||||
*/
|
||||
struct r600_query {
|
||||
u64 result;
|
||||
/* The kind of query. Currently only OQ is supported. */
|
||||
/* The kind of query */
|
||||
unsigned type;
|
||||
/* How many results have been written, in dwords. It's incremented
|
||||
* after end_query and flush. */
|
||||
unsigned num_results;
|
||||
/* if we've flushed the query */
|
||||
/* Offset of the first result for current query */
|
||||
unsigned results_start;
|
||||
/* Offset of the next free result after current query data */
|
||||
unsigned results_end;
|
||||
/* Size of the result */
|
||||
unsigned result_size;
|
||||
/* Count of new queries started in one stream without flushing */
|
||||
unsigned queries_emitted;
|
||||
/* State flags */
|
||||
unsigned state;
|
||||
/* The buffer where query results are stored. */
|
||||
/* The buffer where query results are stored. It's used as a ring,
|
||||
* data blocks for current query are stored sequentially from
|
||||
* results_start to results_end, with wrapping on the buffer end */
|
||||
struct r600_bo *buffer;
|
||||
unsigned buffer_size;
|
||||
/* linked list of queries */
|
||||
@@ -228,6 +235,7 @@ struct r600_query {
|
||||
#define R600_QUERY_STATE_STARTED (1 << 0)
|
||||
#define R600_QUERY_STATE_ENDED (1 << 1)
|
||||
#define R600_QUERY_STATE_SUSPENDED (1 << 2)
|
||||
#define R600_QUERY_STATE_FLUSHED (1 << 3)
|
||||
|
||||
#define R600_CONTEXT_DRAW_PENDING (1 << 0)
|
||||
#define R600_CONTEXT_DST_CACHES_DIRTY (1 << 1)
|
||||
@@ -245,6 +253,7 @@ struct r600_context {
|
||||
unsigned pm4_cdwords;
|
||||
unsigned pm4_dirty_cdwords;
|
||||
unsigned ctx_pm4_ndwords;
|
||||
unsigned init_dwords;
|
||||
unsigned nreloc;
|
||||
unsigned creloc;
|
||||
struct r600_reloc *reloc;
|
||||
@@ -293,7 +302,7 @@ boolean r600_context_query_result(struct r600_context *ctx,
|
||||
void r600_query_begin(struct r600_context *ctx, struct r600_query *query);
|
||||
void r600_query_end(struct r600_context *ctx, struct r600_query *query);
|
||||
void r600_context_queries_suspend(struct r600_context *ctx);
|
||||
void r600_context_queries_resume(struct r600_context *ctx);
|
||||
void r600_context_queries_resume(struct r600_context *ctx, boolean flushed);
|
||||
void r600_query_predication(struct r600_context *ctx, struct r600_query *query, int operation,
|
||||
int flag_wait);
|
||||
void r600_context_emit_fence(struct r600_context *ctx, struct r600_bo *fence,
|
||||
|
@@ -97,7 +97,7 @@ static void r600_blitter_end(struct pipe_context *ctx)
|
||||
rctx->saved_render_cond_mode);
|
||||
rctx->saved_render_cond = NULL;
|
||||
}
|
||||
r600_context_queries_resume(&rctx->ctx);
|
||||
r600_context_queries_resume(&rctx->ctx, FALSE);
|
||||
rctx->blit = false;
|
||||
}
|
||||
|
||||
|
@@ -126,9 +126,6 @@ static void r600_flush(struct pipe_context *ctx,
|
||||
if (rfence)
|
||||
*rfence = r600_create_fence(rctx);
|
||||
|
||||
if (!rctx->ctx.pm4_cdwords)
|
||||
return;
|
||||
|
||||
#if 0
|
||||
sprintf(dname, "gallium-%08d.bof", dc);
|
||||
if (dc < 20) {
|
||||
|
@@ -43,7 +43,7 @@ static void r600_begin_query(struct pipe_context *ctx, struct pipe_query *query)
|
||||
struct r600_query *rquery = (struct r600_query *)query;
|
||||
|
||||
rquery->result = 0;
|
||||
rquery->num_results = 0;
|
||||
rquery->results_start = rquery->results_end;
|
||||
r600_query_begin(&rctx->ctx, (struct r600_query *)query);
|
||||
}
|
||||
|
||||
@@ -61,10 +61,7 @@ static boolean r600_get_query_result(struct pipe_context *ctx,
|
||||
struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
|
||||
struct r600_query *rquery = (struct r600_query *)query;
|
||||
|
||||
if (rquery->num_results) {
|
||||
ctx->flush(ctx, NULL);
|
||||
}
|
||||
return r600_context_query_result(&rctx->ctx, (struct r600_query *)query, wait, vresult);
|
||||
return r600_context_query_result(&rctx->ctx, rquery, wait, vresult);
|
||||
}
|
||||
|
||||
static void r600_render_condition(struct pipe_context *ctx,
|
||||
@@ -75,12 +72,18 @@ static void r600_render_condition(struct pipe_context *ctx,
|
||||
struct r600_query *rquery = (struct r600_query *)query;
|
||||
int wait_flag = 0;
|
||||
|
||||
/* If we already have nonzero result, render unconditionally */
|
||||
if (query != NULL && rquery->result != 0)
|
||||
return;
|
||||
|
||||
rctx->current_render_cond = query;
|
||||
rctx->current_render_cond_mode = mode;
|
||||
|
||||
if (!query) {
|
||||
rctx->ctx.predicate_drawing = false;
|
||||
r600_query_predication(&rctx->ctx, NULL, PREDICATION_OP_CLEAR, 1);
|
||||
if (query == NULL) {
|
||||
if (rctx->ctx.predicate_drawing) {
|
||||
rctx->ctx.predicate_drawing = false;
|
||||
r600_query_predication(&rctx->ctx, NULL, PREDICATION_OP_CLEAR, 1);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -91,7 +94,6 @@ static void r600_render_condition(struct pipe_context *ctx,
|
||||
|
||||
rctx->ctx.predicate_drawing = true;
|
||||
r600_query_predication(&rctx->ctx, rquery, PREDICATION_OP_ZPASS, wait_flag);
|
||||
|
||||
}
|
||||
|
||||
void r600_init_query_functions(struct r600_pipe_context *rctx)
|
||||
|
@@ -939,6 +939,17 @@ static void r600_bc_src(struct r600_bc_alu_src *bc_src,
|
||||
bc_src->value = shader_src->value[bc_src->chan];
|
||||
}
|
||||
|
||||
static void r600_bc_src_set_abs(struct r600_bc_alu_src *bc_src)
|
||||
{
|
||||
bc_src->abs = 1;
|
||||
bc_src->neg = 0;
|
||||
}
|
||||
|
||||
static void r600_bc_src_toggle_neg(struct r600_bc_alu_src *bc_src)
|
||||
{
|
||||
bc_src->neg = !bc_src->neg;
|
||||
}
|
||||
|
||||
static void tgsi_dst(struct r600_shader_ctx *ctx,
|
||||
const struct tgsi_full_dst_register *tgsi_dst,
|
||||
unsigned swizzle,
|
||||
@@ -995,12 +1006,10 @@ static int tgsi_op2_s(struct r600_shader_ctx *ctx, int swap)
|
||||
/* handle some special cases */
|
||||
switch (ctx->inst_info->tgsi_opcode) {
|
||||
case TGSI_OPCODE_SUB:
|
||||
alu.src[1].neg = 1;
|
||||
r600_bc_src_toggle_neg(&alu.src[1]);
|
||||
break;
|
||||
case TGSI_OPCODE_ABS:
|
||||
alu.src[0].abs = 1;
|
||||
if (alu.src[0].neg)
|
||||
alu.src[0].neg = 0;
|
||||
r600_bc_src_set_abs(&alu.src[0]);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -1364,6 +1373,22 @@ static int tgsi_lit(struct r600_shader_ctx *ctx)
|
||||
struct r600_bc_alu alu;
|
||||
int r;
|
||||
|
||||
/* tmp.x = max(src.y, 0.0) */
|
||||
memset(&alu, 0, sizeof(struct r600_bc_alu));
|
||||
alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MAX);
|
||||
r600_bc_src(&alu.src[0], &ctx->src[0], 1);
|
||||
alu.src[1].sel = V_SQ_ALU_SRC_0; /*0.0*/
|
||||
alu.src[1].chan = 1;
|
||||
|
||||
alu.dst.sel = ctx->temp_reg;
|
||||
alu.dst.chan = 0;
|
||||
alu.dst.write = 1;
|
||||
|
||||
alu.last = 1;
|
||||
r = r600_bc_add_alu(ctx->bc, &alu);
|
||||
if (r)
|
||||
return r;
|
||||
|
||||
if (inst->Dst[0].Register.WriteMask & (1 << 2))
|
||||
{
|
||||
int chan;
|
||||
@@ -1372,11 +1397,13 @@ static int tgsi_lit(struct r600_shader_ctx *ctx)
|
||||
|
||||
if (ctx->bc->chiprev == CHIPREV_CAYMAN) {
|
||||
for (i = 0; i < 3; i++) {
|
||||
/* dst.z = log(src.y) */
|
||||
/* tmp.z = log(tmp.x) */
|
||||
memset(&alu, 0, sizeof(struct r600_bc_alu));
|
||||
alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_LOG_CLAMPED);
|
||||
r600_bc_src(&alu.src[0], &ctx->src[0], 1);
|
||||
tgsi_dst(ctx, &inst->Dst[0], i, &alu.dst);
|
||||
alu.src[0].sel = ctx->temp_reg;
|
||||
alu.src[0].chan = 0;
|
||||
alu.dst.sel = ctx->temp_reg;
|
||||
alu.dst.chan = i;
|
||||
if (i == 2) {
|
||||
alu.dst.write = 1;
|
||||
alu.last = 1;
|
||||
@@ -1388,10 +1415,11 @@ static int tgsi_lit(struct r600_shader_ctx *ctx)
|
||||
return r;
|
||||
}
|
||||
} else {
|
||||
/* dst.z = log(src.y) */
|
||||
/* tmp.z = log(tmp.x) */
|
||||
memset(&alu, 0, sizeof(struct r600_bc_alu));
|
||||
alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_LOG_CLAMPED);
|
||||
r600_bc_src(&alu.src[0], &ctx->src[0], 1);
|
||||
alu.src[0].sel = ctx->temp_reg;
|
||||
alu.src[0].chan = 0;
|
||||
alu.dst.sel = ctx->temp_reg;
|
||||
alu.dst.chan = 2;
|
||||
alu.dst.write = 1;
|
||||
@@ -1404,13 +1432,12 @@ static int tgsi_lit(struct r600_shader_ctx *ctx)
|
||||
chan = alu.dst.chan;
|
||||
sel = alu.dst.sel;
|
||||
|
||||
/* tmp.x = amd MUL_LIT(src.w, dst.z, src.x ) */
|
||||
/* tmp.x = amd MUL_LIT(tmp.z, src.w, src.x ) */
|
||||
memset(&alu, 0, sizeof(struct r600_bc_alu));
|
||||
alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP3_SQ_OP3_INST_MUL_LIT);
|
||||
r600_bc_src(&alu.src[0], &ctx->src[0], 3);
|
||||
alu.src[1].sel = sel;
|
||||
alu.src[1].chan = chan;
|
||||
|
||||
alu.src[0].sel = sel;
|
||||
alu.src[0].chan = chan;
|
||||
r600_bc_src(&alu.src[1], &ctx->src[0], 3);
|
||||
r600_bc_src(&alu.src[2], &ctx->src[0], 0);
|
||||
alu.dst.sel = ctx->temp_reg;
|
||||
alu.dst.chan = 0;
|
||||
@@ -1506,7 +1533,7 @@ static int tgsi_rsq(struct r600_shader_ctx *ctx)
|
||||
|
||||
for (i = 0; i < inst->Instruction.NumSrcRegs; i++) {
|
||||
r600_bc_src(&alu.src[i], &ctx->src[i], 0);
|
||||
alu.src[i].abs = 1;
|
||||
r600_bc_src_set_abs(&alu.src[i]);
|
||||
}
|
||||
alu.dst.sel = ctx->temp_reg;
|
||||
alu.dst.write = 1;
|
||||
@@ -2192,7 +2219,7 @@ static int tgsi_lrp(struct r600_shader_ctx *ctx)
|
||||
alu.src[0].sel = V_SQ_ALU_SRC_1;
|
||||
alu.src[0].chan = 0;
|
||||
r600_bc_src(&alu.src[1], &ctx->src[0], i);
|
||||
alu.src[1].neg = 1;
|
||||
r600_bc_src_toggle_neg(&alu.src[1]);
|
||||
alu.dst.sel = ctx->temp_reg;
|
||||
alu.dst.chan = i;
|
||||
if (i == lasti) {
|
||||
@@ -2489,7 +2516,7 @@ static int tgsi_log(struct r600_shader_ctx *ctx)
|
||||
int r;
|
||||
int i;
|
||||
|
||||
/* result.x = floor(log2(src)); */
|
||||
/* result.x = floor(log2(|src|)); */
|
||||
if (inst->Dst[0].Register.WriteMask & 1) {
|
||||
if (ctx->bc->chiprev == CHIPREV_CAYMAN) {
|
||||
for (i = 0; i < 3; i++) {
|
||||
@@ -2497,6 +2524,7 @@ static int tgsi_log(struct r600_shader_ctx *ctx)
|
||||
|
||||
alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_LOG_IEEE);
|
||||
r600_bc_src(&alu.src[0], &ctx->src[0], 0);
|
||||
r600_bc_src_set_abs(&alu.src[0]);
|
||||
|
||||
alu.dst.sel = ctx->temp_reg;
|
||||
alu.dst.chan = i;
|
||||
@@ -2514,6 +2542,7 @@ static int tgsi_log(struct r600_shader_ctx *ctx)
|
||||
|
||||
alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_LOG_IEEE);
|
||||
r600_bc_src(&alu.src[0], &ctx->src[0], 0);
|
||||
r600_bc_src_set_abs(&alu.src[0]);
|
||||
|
||||
alu.dst.sel = ctx->temp_reg;
|
||||
alu.dst.chan = 0;
|
||||
@@ -2538,7 +2567,7 @@ static int tgsi_log(struct r600_shader_ctx *ctx)
|
||||
return r;
|
||||
}
|
||||
|
||||
/* result.y = src.x / (2 ^ floor(log2(src.x))); */
|
||||
/* result.y = |src.x| / (2 ^ floor(log2(|src.x|))); */
|
||||
if ((inst->Dst[0].Register.WriteMask >> 1) & 1) {
|
||||
|
||||
if (ctx->bc->chiprev == CHIPREV_CAYMAN) {
|
||||
@@ -2547,6 +2576,7 @@ static int tgsi_log(struct r600_shader_ctx *ctx)
|
||||
|
||||
alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_LOG_IEEE);
|
||||
r600_bc_src(&alu.src[0], &ctx->src[0], 0);
|
||||
r600_bc_src_set_abs(&alu.src[0]);
|
||||
|
||||
alu.dst.sel = ctx->temp_reg;
|
||||
alu.dst.chan = i;
|
||||
@@ -2564,6 +2594,7 @@ static int tgsi_log(struct r600_shader_ctx *ctx)
|
||||
|
||||
alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_LOG_IEEE);
|
||||
r600_bc_src(&alu.src[0], &ctx->src[0], 0);
|
||||
r600_bc_src_set_abs(&alu.src[0]);
|
||||
|
||||
alu.dst.sel = ctx->temp_reg;
|
||||
alu.dst.chan = 1;
|
||||
@@ -2663,6 +2694,7 @@ static int tgsi_log(struct r600_shader_ctx *ctx)
|
||||
alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MUL);
|
||||
|
||||
r600_bc_src(&alu.src[0], &ctx->src[0], 0);
|
||||
r600_bc_src_set_abs(&alu.src[0]);
|
||||
|
||||
alu.src[1].sel = ctx->temp_reg;
|
||||
alu.src[1].chan = 1;
|
||||
@@ -2677,7 +2709,7 @@ static int tgsi_log(struct r600_shader_ctx *ctx)
|
||||
return r;
|
||||
}
|
||||
|
||||
/* result.z = log2(src);*/
|
||||
/* result.z = log2(|src|);*/
|
||||
if ((inst->Dst[0].Register.WriteMask >> 2) & 1) {
|
||||
if (ctx->bc->chiprev == CHIPREV_CAYMAN) {
|
||||
for (i = 0; i < 3; i++) {
|
||||
@@ -2685,6 +2717,7 @@ static int tgsi_log(struct r600_shader_ctx *ctx)
|
||||
|
||||
alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_LOG_IEEE);
|
||||
r600_bc_src(&alu.src[0], &ctx->src[0], 0);
|
||||
r600_bc_src_set_abs(&alu.src[0]);
|
||||
|
||||
alu.dst.sel = ctx->temp_reg;
|
||||
if (i == 2)
|
||||
@@ -2702,6 +2735,7 @@ static int tgsi_log(struct r600_shader_ctx *ctx)
|
||||
|
||||
alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_LOG_IEEE);
|
||||
r600_bc_src(&alu.src[0], &ctx->src[0], 0);
|
||||
r600_bc_src_set_abs(&alu.src[0]);
|
||||
|
||||
alu.dst.sel = ctx->temp_reg;
|
||||
alu.dst.write = 1;
|
||||
|
@@ -250,21 +250,21 @@ struct GalliumDXGIAdapter
|
||||
DXGI_ADAPTER_DESC1 desc;
|
||||
std::vector<ComPtr<IDXGIOutput> > outputs;
|
||||
int num_outputs;
|
||||
struct native_event_handler handler;
|
||||
|
||||
GalliumDXGIAdapter(GalliumDXGIFactory* factory, const struct native_platform* platform, void* dpy)
|
||||
{
|
||||
this->parent = factory;
|
||||
|
||||
/* FIXME handler should be static */
|
||||
handler.invalid_surface = handle_invalid_surface;
|
||||
handler.new_drm_screen = dxgi_loader_create_drm_screen;
|
||||
handler.new_sw_screen = dxgi_loader_create_sw_screen;
|
||||
platform->set_event_handler(&handler);
|
||||
|
||||
display = platform->create_display(dpy, FALSE, this);
|
||||
display = platform->create_display(dpy, FALSE);
|
||||
if(!display)
|
||||
display = platform->create_display(dpy, TRUE, this);
|
||||
display = platform->create_display(dpy, TRUE);
|
||||
if (display) {
|
||||
display->user_data = this;
|
||||
if (!display->init_screen(display)) {
|
||||
display->destroy(display);
|
||||
display = NULL;
|
||||
}
|
||||
}
|
||||
if(!display)
|
||||
throw E_FAIL;
|
||||
memset(&desc, 0, sizeof(desc));
|
||||
@@ -1413,6 +1413,11 @@ struct dxgi_binding
|
||||
|
||||
static dxgi_binding dxgi_default_binding;
|
||||
static __thread dxgi_binding dxgi_thread_binding;
|
||||
static const struct native_event_handler dxgi_event_handler = {
|
||||
GalliumDXGIAdapter::handle_invalid_surface,
|
||||
dxgi_loader_create_drm_screen,
|
||||
dxgi_loader_create_sw_screen
|
||||
};
|
||||
|
||||
void STDMETHODCALLTYPE GalliumDXGIUseNothing()
|
||||
{
|
||||
@@ -1427,7 +1432,7 @@ void STDMETHODCALLTYPE GalliumDXGIUseNothing()
|
||||
void STDMETHODCALLTYPE GalliumDXGIUseX11Display(Display* dpy, IGalliumDXGIBackend* backend)
|
||||
{
|
||||
GalliumDXGIUseNothing();
|
||||
dxgi_thread_binding.platform = native_get_x11_platform();
|
||||
dxgi_thread_binding.platform = native_get_x11_platform(&dxgi_event_handler);
|
||||
dxgi_thread_binding.display = dpy;
|
||||
|
||||
if(backend)
|
||||
@@ -1443,7 +1448,7 @@ void STDMETHODCALLTYPE GalliumDXGIUseX11Display(Display* dpy, IGalliumDXGIBacken
|
||||
void STDMETHODCALLTYPE GalliumDXGIUseDRMCard(int fd)
|
||||
{
|
||||
GalliumDXGIUseNothing();
|
||||
dxgi_thread_binding.platform = native_get_drm_platform();
|
||||
dxgi_thread_binding.platform = native_get_drm_platform(&dxgi_event_handler);
|
||||
dxgi_thread_binding.display = (void*)fd;
|
||||
dxgi_thread_binding.backend = 0;
|
||||
}
|
||||
@@ -1453,7 +1458,7 @@ void STDMETHODCALLTYPE GalliumDXGIUseDRMCard(int fd)
|
||||
void STDMETHODCALLTYPE GalliumDXGIUseFBDev(int fd)
|
||||
{
|
||||
GalliumDXGIUseNothing();
|
||||
dxgi_thread_binding.platform = native_get_fbdev_platform();
|
||||
dxgi_thread_binding.platform = native_get_fbdev_platform(&dxgi_event_handler);
|
||||
dxgi_thread_binding.display = (void*)fd;
|
||||
dxgi_thread_binding.backend = 0;
|
||||
}
|
||||
@@ -1463,7 +1468,7 @@ void STDMETHODCALLTYPE GalliumDXGIUseFBDev(int fd)
|
||||
void STDMETHODCALLTYPE GalliumDXGIUseHDC(HDC hdc, PFNHWNDRESOLVER resolver, void* resolver_cookie)
|
||||
{
|
||||
GalliumDXGIUseNothing();
|
||||
dxgi_thread_binding.platform = native_get_gdi_platform();
|
||||
dxgi_thread_binding.platform = native_get_gdi_platform(&dxgi_event_handler);
|
||||
dxgi_thread_binding.display = (void*)hdc;
|
||||
dxgi_thread_binding.backend = 0;
|
||||
}
|
||||
@@ -1493,7 +1498,7 @@ void STDMETHODCALLTYPE GalliumDXGIMakeDefault()
|
||||
else if(dxgi_default_binding.platform)
|
||||
factory = new GalliumDXGIFactory(dxgi_default_binding.platform, dxgi_default_binding.display, dxgi_default_binding.backend);
|
||||
else
|
||||
factory = new GalliumDXGIFactory(native_get_x11_platform(), NULL, NULL);
|
||||
factory = new GalliumDXGIFactory(native_get_x11_platform(&dxgi_event_handler), NULL, NULL);
|
||||
HRESULT hres = factory->QueryInterface(riid, out_factory);
|
||||
factory->Release();
|
||||
return hres;
|
||||
|
@@ -87,7 +87,7 @@ egl_g3d_lookup_egl_image(struct native_display *ndpy, void *egl_image)
|
||||
return resource;
|
||||
}
|
||||
|
||||
static struct native_event_handler egl_g3d_native_event_handler = {
|
||||
static const struct native_event_handler egl_g3d_native_event_handler = {
|
||||
egl_g3d_invalid_surface,
|
||||
egl_g3d_new_drm_screen,
|
||||
egl_g3d_new_sw_screen,
|
||||
@@ -110,40 +110,38 @@ egl_g3d_get_platform(_EGLDriver *drv, _EGLPlatformType plat)
|
||||
case _EGL_PLATFORM_WINDOWS:
|
||||
plat_name = "Windows";
|
||||
#ifdef HAVE_GDI_BACKEND
|
||||
nplat = native_get_gdi_platform();
|
||||
nplat = native_get_gdi_platform(&egl_g3d_native_event_handler);
|
||||
#endif
|
||||
break;
|
||||
case _EGL_PLATFORM_X11:
|
||||
plat_name = "X11";
|
||||
#ifdef HAVE_X11_BACKEND
|
||||
nplat = native_get_x11_platform();
|
||||
nplat = native_get_x11_platform(&egl_g3d_native_event_handler);
|
||||
#endif
|
||||
break;
|
||||
case _EGL_PLATFORM_WAYLAND:
|
||||
plat_name = "wayland";
|
||||
#ifdef HAVE_WAYLAND_BACKEND
|
||||
nplat = native_get_wayland_platform();
|
||||
nplat = native_get_wayland_platform(&egl_g3d_native_event_handler);
|
||||
#endif
|
||||
break;
|
||||
case _EGL_PLATFORM_DRM:
|
||||
plat_name = "DRM";
|
||||
#ifdef HAVE_DRM_BACKEND
|
||||
nplat = native_get_drm_platform();
|
||||
nplat = native_get_drm_platform(&egl_g3d_native_event_handler);
|
||||
#endif
|
||||
break;
|
||||
case _EGL_PLATFORM_FBDEV:
|
||||
plat_name = "FBDEV";
|
||||
#ifdef HAVE_FBDEV_BACKEND
|
||||
nplat = native_get_fbdev_platform();
|
||||
nplat = native_get_fbdev_platform(&egl_g3d_native_event_handler);
|
||||
#endif
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (nplat)
|
||||
nplat->set_event_handler(&egl_g3d_native_event_handler);
|
||||
else
|
||||
if (!nplat)
|
||||
_eglLog(_EGL_WARNING, "unsupported platform %s", plat_name);
|
||||
|
||||
gdrv->platforms[plat] = nplat;
|
||||
@@ -520,13 +518,20 @@ egl_g3d_initialize(_EGLDriver *drv, _EGLDisplay *dpy)
|
||||
gdpy->loader = gdrv->loader;
|
||||
dpy->DriverData = gdpy;
|
||||
|
||||
_eglLog(_EGL_INFO, "use %s for display %p", nplat->name, dpy->PlatformDisplay);
|
||||
gdpy->native = nplat->create_display(dpy->PlatformDisplay,
|
||||
dpy->Options.UseFallback, (void *) dpy);
|
||||
_eglLog(_EGL_INFO, "use %s for display %p",
|
||||
nplat->name, dpy->PlatformDisplay);
|
||||
gdpy->native =
|
||||
nplat->create_display(dpy->PlatformDisplay, dpy->Options.UseFallback);
|
||||
if (!gdpy->native) {
|
||||
_eglError(EGL_NOT_INITIALIZED, "eglInitialize(no usable display)");
|
||||
goto fail;
|
||||
}
|
||||
gdpy->native->user_data = (void *) dpy;
|
||||
if (!gdpy->native->init_screen(gdpy->native)) {
|
||||
_eglError(EGL_NOT_INITIALIZED,
|
||||
"eglInitialize(failed to initialize screen)");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (gdpy->loader->profile_masks[ST_API_OPENGL] & ST_PROFILE_DEFAULT_MASK)
|
||||
dpy->ClientAPIs |= EGL_OPENGL_BIT;
|
||||
|
@@ -152,6 +152,11 @@ struct native_display {
|
||||
*/
|
||||
void *user_data;
|
||||
|
||||
/**
|
||||
* Initialize and create the pipe screen.
|
||||
*/
|
||||
boolean (*init_screen)(struct native_display *ndpy);
|
||||
|
||||
void (*destroy)(struct native_display *ndpy);
|
||||
|
||||
/**
|
||||
@@ -259,26 +264,29 @@ ndpy_uninit(struct native_display *ndpy)
|
||||
struct native_platform {
|
||||
const char *name;
|
||||
|
||||
void (*set_event_handler)(struct native_event_handler *handler);
|
||||
struct native_display *(*create_display)(void *dpy,
|
||||
boolean use_sw,
|
||||
void *user_data);
|
||||
/**
|
||||
* Create the native display and usually establish a connection to the
|
||||
* display server.
|
||||
*
|
||||
* No event should be generated at this stage.
|
||||
*/
|
||||
struct native_display *(*create_display)(void *dpy, boolean use_sw);
|
||||
};
|
||||
|
||||
const struct native_platform *
|
||||
native_get_gdi_platform(void);
|
||||
native_get_gdi_platform(const struct native_event_handler *event_handler);
|
||||
|
||||
const struct native_platform *
|
||||
native_get_x11_platform(void);
|
||||
native_get_x11_platform(const struct native_event_handler *event_handler);
|
||||
|
||||
const struct native_platform *
|
||||
native_get_wayland_platform(void);
|
||||
native_get_wayland_platform(const struct native_event_handler *event_handler);
|
||||
|
||||
const struct native_platform *
|
||||
native_get_drm_platform(void);
|
||||
native_get_drm_platform(const struct native_event_handler *event_handler);
|
||||
|
||||
const struct native_platform *
|
||||
native_get_fbdev_platform(void);
|
||||
native_get_fbdev_platform(const struct native_event_handler *event_handler);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@@ -127,6 +127,8 @@ drm_display_destroy(struct native_display *ndpy)
|
||||
|
||||
drm_display_fini_modeset(&drmdpy->base);
|
||||
|
||||
/* gbm owns screen */
|
||||
ndpy->screen = NULL;
|
||||
ndpy_uninit(ndpy);
|
||||
|
||||
if (drmdpy->device_name)
|
||||
@@ -249,9 +251,15 @@ drm_create_pixmap_surface(struct native_display *ndpy,
|
||||
return drm_display_create_surface_from_resource(ndpy, bo->resource);
|
||||
}
|
||||
|
||||
static boolean
|
||||
drm_display_init_screen(struct native_display *ndpy)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static struct native_display *
|
||||
drm_create_display(struct gbm_gallium_drm_device *gbmdrm,
|
||||
struct native_event_handler *event_handler, void *user_data)
|
||||
const struct native_event_handler *event_handler)
|
||||
{
|
||||
struct drm_display *drmdpy;
|
||||
|
||||
@@ -267,10 +275,10 @@ drm_create_display(struct gbm_gallium_drm_device *gbmdrm,
|
||||
gbmdrm->lookup_egl_image_data = &drmdpy->base;
|
||||
|
||||
drmdpy->event_handler = event_handler;
|
||||
drmdpy->base.user_data = user_data;
|
||||
|
||||
drmdpy->base.screen = gbmdrm->screen;
|
||||
|
||||
drmdpy->base.init_screen = drm_display_init_screen;
|
||||
drmdpy->base.destroy = drm_display_destroy;
|
||||
drmdpy->base.get_param = drm_display_get_param;
|
||||
drmdpy->base.get_configs = drm_display_get_configs;
|
||||
@@ -287,16 +295,10 @@ drm_create_display(struct gbm_gallium_drm_device *gbmdrm,
|
||||
return &drmdpy->base;
|
||||
}
|
||||
|
||||
static struct native_event_handler *drm_event_handler;
|
||||
|
||||
static void
|
||||
native_set_event_handler(struct native_event_handler *event_handler)
|
||||
{
|
||||
drm_event_handler = event_handler;
|
||||
}
|
||||
static const struct native_event_handler *drm_event_handler;
|
||||
|
||||
static struct native_display *
|
||||
native_create_display(void *dpy, boolean use_sw, void *user_data)
|
||||
native_create_display(void *dpy, boolean use_sw)
|
||||
{
|
||||
struct gbm_gallium_drm_device *gbm;
|
||||
int fd;
|
||||
@@ -315,17 +317,17 @@ native_create_display(void *dpy, boolean use_sw, void *user_data)
|
||||
gbm->base.type != GBM_DRM_DRIVER_TYPE_GALLIUM)
|
||||
return NULL;
|
||||
|
||||
return drm_create_display(gbm, drm_event_handler, user_data);
|
||||
return drm_create_display(gbm, drm_event_handler);
|
||||
}
|
||||
|
||||
static const struct native_platform drm_platform = {
|
||||
"DRM", /* name */
|
||||
native_set_event_handler,
|
||||
native_create_display
|
||||
};
|
||||
|
||||
const struct native_platform *
|
||||
native_get_drm_platform(void)
|
||||
native_get_drm_platform(const struct native_event_handler *event_handler)
|
||||
{
|
||||
drm_event_handler = event_handler;
|
||||
return &drm_platform;
|
||||
}
|
||||
|
@@ -50,7 +50,7 @@ struct drm_surface;
|
||||
struct drm_display {
|
||||
struct native_display base;
|
||||
|
||||
struct native_event_handler *event_handler;
|
||||
const struct native_event_handler *event_handler;
|
||||
|
||||
int fd;
|
||||
char *device_name;
|
||||
|
@@ -26,6 +26,21 @@
|
||||
* Chia-I Wu <olv@lunarg.com>
|
||||
*/
|
||||
|
||||
/**
|
||||
* Considering fbdev as an in-kernel window system,
|
||||
*
|
||||
* - opening a device opens a connection
|
||||
* - there is only one window: the framebuffer
|
||||
* - fb_var_screeninfo decides window position, size, and even color format
|
||||
* - there is no pixmap
|
||||
*
|
||||
* Now EGL is built on top of this window system. So we should have
|
||||
*
|
||||
* - the fd as the handle of the native display
|
||||
* - reject all but one native window: NULL
|
||||
* - no pixmap support
|
||||
*/
|
||||
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
@@ -45,16 +60,13 @@ struct fbdev_display {
|
||||
struct native_display base;
|
||||
|
||||
int fd;
|
||||
struct native_event_handler *event_handler;
|
||||
const struct native_event_handler *event_handler;
|
||||
|
||||
struct fb_fix_screeninfo finfo;
|
||||
struct fb_var_screeninfo vinfo;
|
||||
|
||||
struct fb_var_screeninfo config_vinfo;
|
||||
struct native_config config;
|
||||
struct native_connector connector;
|
||||
struct native_mode mode;
|
||||
|
||||
struct fbdev_surface *current_surface;
|
||||
boolean assume_fixed_vinfo;
|
||||
};
|
||||
|
||||
struct fbdev_surface {
|
||||
@@ -66,7 +78,7 @@ struct fbdev_surface {
|
||||
|
||||
unsigned int sequence_number;
|
||||
|
||||
boolean is_current;
|
||||
struct fbdev_sw_drawable drawable;
|
||||
};
|
||||
|
||||
static INLINE struct fbdev_display *
|
||||
@@ -103,38 +115,70 @@ fbdev_surface_validate(struct native_surface *nsurf, uint attachment_mask,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
fbdev_surface_flush_frontbuffer(struct native_surface *nsurf)
|
||||
static enum pipe_format
|
||||
vinfo_to_format(const struct fb_var_screeninfo *vinfo)
|
||||
{
|
||||
struct fbdev_surface *fbsurf = fbdev_surface(nsurf);
|
||||
enum pipe_format format = PIPE_FORMAT_NONE;
|
||||
|
||||
if (!fbsurf->is_current)
|
||||
return TRUE;
|
||||
/* should also check channel offsets... */
|
||||
switch (vinfo->bits_per_pixel) {
|
||||
case 32:
|
||||
if (vinfo->red.length == 8 &&
|
||||
vinfo->green.length == 8 &&
|
||||
vinfo->blue.length == 8) {
|
||||
format = (vinfo->transp.length == 8) ?
|
||||
PIPE_FORMAT_B8G8R8A8_UNORM : PIPE_FORMAT_B8G8R8X8_UNORM;
|
||||
}
|
||||
break;
|
||||
case 16:
|
||||
if (vinfo->red.length == 5 &&
|
||||
vinfo->green.length == 6 &&
|
||||
vinfo->blue.length == 5 &&
|
||||
vinfo->transp.length == 0)
|
||||
format = PIPE_FORMAT_B5G6R5_UNORM;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return resource_surface_present(fbsurf->rsurf,
|
||||
NATIVE_ATTACHMENT_FRONT_LEFT, NULL);
|
||||
return format;
|
||||
}
|
||||
|
||||
static boolean
|
||||
fbdev_surface_swap_buffers(struct native_surface *nsurf)
|
||||
fbdev_surface_update_drawable(struct native_surface *nsurf,
|
||||
const struct fb_var_screeninfo *vinfo)
|
||||
{
|
||||
struct fbdev_surface *fbsurf = fbdev_surface(nsurf);
|
||||
struct fbdev_display *fbdpy = fbsurf->fbdpy;
|
||||
boolean ret = TRUE;
|
||||
unsigned x, y, width, height;
|
||||
|
||||
if (fbsurf->is_current) {
|
||||
ret = resource_surface_present(fbsurf->rsurf,
|
||||
NATIVE_ATTACHMENT_BACK_LEFT, NULL);
|
||||
x = vinfo->xoffset;
|
||||
y = vinfo->yoffset;
|
||||
width = MIN2(vinfo->xres, fbsurf->width);
|
||||
height = MIN2(vinfo->yres, fbsurf->height);
|
||||
|
||||
/* sanitize the values */
|
||||
if (x + width > vinfo->xres_virtual) {
|
||||
if (x > vinfo->xres_virtual)
|
||||
width = 0;
|
||||
else
|
||||
width = vinfo->xres_virtual - x;
|
||||
}
|
||||
if (y + height > vinfo->yres_virtual) {
|
||||
if (y > vinfo->yres_virtual)
|
||||
height = 0;
|
||||
else
|
||||
height = vinfo->yres_virtual - y;
|
||||
}
|
||||
|
||||
resource_surface_swap_buffers(fbsurf->rsurf,
|
||||
NATIVE_ATTACHMENT_FRONT_LEFT, NATIVE_ATTACHMENT_BACK_LEFT, TRUE);
|
||||
/* the front/back textures are swapped */
|
||||
fbsurf->sequence_number++;
|
||||
fbdpy->event_handler->invalid_surface(&fbdpy->base,
|
||||
&fbsurf->base, fbsurf->sequence_number);
|
||||
fbsurf->drawable.format = vinfo_to_format(vinfo);
|
||||
fbsurf->drawable.x = vinfo->xoffset;
|
||||
fbsurf->drawable.y = vinfo->yoffset;
|
||||
fbsurf->drawable.width = vinfo->xres;
|
||||
fbsurf->drawable.height = vinfo->yres;
|
||||
|
||||
return ret;
|
||||
return (fbsurf->drawable.format != PIPE_FORMAT_NONE &&
|
||||
fbsurf->drawable.width &&
|
||||
fbsurf->drawable.height);
|
||||
}
|
||||
|
||||
static boolean
|
||||
@@ -143,21 +187,43 @@ fbdev_surface_present(struct native_surface *nsurf,
|
||||
boolean preserve,
|
||||
uint swap_interval)
|
||||
{
|
||||
boolean ret;
|
||||
struct fbdev_surface *fbsurf = fbdev_surface(nsurf);
|
||||
struct fbdev_display *fbdpy = fbsurf->fbdpy;
|
||||
boolean ret = FALSE;
|
||||
|
||||
if (preserve || swap_interval)
|
||||
if (swap_interval)
|
||||
return FALSE;
|
||||
if (natt != NATIVE_ATTACHMENT_BACK_LEFT)
|
||||
return FALSE;
|
||||
|
||||
switch (natt) {
|
||||
case NATIVE_ATTACHMENT_FRONT_LEFT:
|
||||
ret = fbdev_surface_flush_frontbuffer(nsurf);
|
||||
break;
|
||||
case NATIVE_ATTACHMENT_BACK_LEFT:
|
||||
ret = fbdev_surface_swap_buffers(nsurf);
|
||||
break;
|
||||
default:
|
||||
ret = FALSE;
|
||||
break;
|
||||
if (!fbdpy->assume_fixed_vinfo) {
|
||||
struct fb_var_screeninfo vinfo;
|
||||
|
||||
memset(&vinfo, 0, sizeof(vinfo));
|
||||
if (ioctl(fbdpy->fd, FBIOGET_VSCREENINFO, &vinfo))
|
||||
return FALSE;
|
||||
|
||||
/* present the surface */
|
||||
if (fbdev_surface_update_drawable(&fbsurf->base, &vinfo)) {
|
||||
ret = resource_surface_present(fbsurf->rsurf,
|
||||
natt, (void *) &fbsurf->drawable);
|
||||
}
|
||||
|
||||
fbsurf->width = vinfo.xres;
|
||||
fbsurf->height = vinfo.yres;
|
||||
|
||||
if (resource_surface_set_size(fbsurf->rsurf,
|
||||
fbsurf->width, fbsurf->height)) {
|
||||
/* surface resized */
|
||||
fbsurf->sequence_number++;
|
||||
fbdpy->event_handler->invalid_surface(&fbdpy->base,
|
||||
&fbsurf->base, fbsurf->sequence_number);
|
||||
}
|
||||
}
|
||||
else {
|
||||
/* the drawable never changes */
|
||||
ret = resource_surface_present(fbsurf->rsurf,
|
||||
natt, (void *) &fbsurf->drawable);
|
||||
}
|
||||
|
||||
return ret;
|
||||
@@ -179,26 +245,48 @@ fbdev_surface_destroy(struct native_surface *nsurf)
|
||||
}
|
||||
|
||||
static struct native_surface *
|
||||
fbdev_display_create_scanout_surface(struct native_display *ndpy,
|
||||
const struct native_config *nconf,
|
||||
uint width, uint height)
|
||||
fbdev_display_create_window_surface(struct native_display *ndpy,
|
||||
EGLNativeWindowType win,
|
||||
const struct native_config *nconf)
|
||||
{
|
||||
struct fbdev_display *fbdpy = fbdev_display(ndpy);
|
||||
struct fbdev_surface *fbsurf;
|
||||
struct fb_var_screeninfo vinfo;
|
||||
|
||||
/* there is only one native window: NULL */
|
||||
if (win)
|
||||
return NULL;
|
||||
|
||||
fbsurf = CALLOC_STRUCT(fbdev_surface);
|
||||
if (!fbsurf)
|
||||
return NULL;
|
||||
|
||||
fbsurf->fbdpy = fbdpy;
|
||||
fbsurf->width = width;
|
||||
fbsurf->height = height;
|
||||
|
||||
/* get current vinfo */
|
||||
if (fbdpy->assume_fixed_vinfo) {
|
||||
vinfo = fbdpy->config_vinfo;
|
||||
}
|
||||
else {
|
||||
memset(&vinfo, 0, sizeof(vinfo));
|
||||
if (ioctl(fbdpy->fd, FBIOGET_VSCREENINFO, &vinfo)) {
|
||||
FREE(fbsurf);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
fbsurf->width = vinfo.xres;
|
||||
fbsurf->height = vinfo.yres;
|
||||
|
||||
if (!fbdev_surface_update_drawable(&fbsurf->base, &vinfo)) {
|
||||
FREE(fbsurf);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
fbsurf->rsurf = resource_surface_create(fbdpy->base.screen,
|
||||
nconf->color_format,
|
||||
PIPE_BIND_RENDER_TARGET |
|
||||
PIPE_BIND_DISPLAY_TARGET |
|
||||
PIPE_BIND_SCANOUT);
|
||||
PIPE_BIND_DISPLAY_TARGET);
|
||||
if (!fbsurf->rsurf) {
|
||||
FREE(fbsurf);
|
||||
return NULL;
|
||||
@@ -214,42 +302,43 @@ fbdev_display_create_scanout_surface(struct native_display *ndpy,
|
||||
return &fbsurf->base;
|
||||
}
|
||||
|
||||
static struct native_surface *
|
||||
fbdev_display_create_scanout_surface(struct native_display *ndpy,
|
||||
const struct native_config *nconf,
|
||||
uint width, uint height)
|
||||
{
|
||||
return fbdev_display_create_window_surface(ndpy,
|
||||
(EGLNativeWindowType) NULL, nconf);
|
||||
}
|
||||
|
||||
static boolean
|
||||
fbdev_display_program(struct native_display *ndpy, int crtc_idx,
|
||||
struct native_surface *nsurf, uint x, uint y,
|
||||
const struct native_connector **nconns, int num_nconns,
|
||||
const struct native_mode *nmode)
|
||||
{
|
||||
struct fbdev_display *fbdpy = fbdev_display(ndpy);
|
||||
struct fbdev_surface *fbsurf = fbdev_surface(nsurf);
|
||||
|
||||
if (x || y)
|
||||
return FALSE;
|
||||
|
||||
if (fbdpy->current_surface) {
|
||||
if (fbdpy->current_surface == fbsurf)
|
||||
return TRUE;
|
||||
fbdpy->current_surface->is_current = FALSE;
|
||||
}
|
||||
|
||||
if (fbsurf)
|
||||
fbsurf->is_current = TRUE;
|
||||
fbdpy->current_surface = fbsurf;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static const struct native_mode **
|
||||
fbdev_display_get_modes(struct native_display *ndpy,
|
||||
const struct native_connector *nconn,
|
||||
int *num_modes)
|
||||
const struct native_connector *nconn,
|
||||
int *num_modes)
|
||||
{
|
||||
struct fbdev_display *fbdpy = fbdev_display(ndpy);
|
||||
static struct native_mode mode;
|
||||
const struct native_mode **modes;
|
||||
|
||||
if (!mode.desc) {
|
||||
struct fbdev_display *fbdpy = fbdev_display(ndpy);
|
||||
mode.desc = "Current Mode";
|
||||
mode.width = fbdpy->config_vinfo.xres;
|
||||
mode.height = fbdpy->config_vinfo.yres;
|
||||
mode.refresh_rate = 60 * 1000; /* dummy */
|
||||
}
|
||||
|
||||
modes = MALLOC(sizeof(*modes));
|
||||
if (modes) {
|
||||
modes[0] = &fbdpy->mode;
|
||||
modes[0] = &mode;
|
||||
if (num_modes)
|
||||
*num_modes = 1;
|
||||
}
|
||||
@@ -261,12 +350,12 @@ static const struct native_connector **
|
||||
fbdev_display_get_connectors(struct native_display *ndpy, int *num_connectors,
|
||||
int *num_crtc)
|
||||
{
|
||||
struct fbdev_display *fbdpy = fbdev_display(ndpy);
|
||||
static struct native_connector connector;
|
||||
const struct native_connector **connectors;
|
||||
|
||||
connectors = MALLOC(sizeof(*connectors));
|
||||
if (connectors) {
|
||||
connectors[0] = &fbdpy->connector;
|
||||
connectors[0] = &connector;
|
||||
if (num_connectors)
|
||||
*num_connectors = 1;
|
||||
}
|
||||
@@ -274,7 +363,8 @@ fbdev_display_get_connectors(struct native_display *ndpy, int *num_connectors,
|
||||
return connectors;
|
||||
}
|
||||
|
||||
static struct native_display_modeset fbdev_display_modeset = {
|
||||
/* remove modeset support one day! */
|
||||
static const struct native_display_modeset fbdev_display_modeset = {
|
||||
.get_connectors = fbdev_display_get_connectors,
|
||||
.get_modes = fbdev_display_get_modes,
|
||||
.create_scanout_surface = fbdev_display_create_scanout_surface,
|
||||
@@ -304,8 +394,10 @@ fbdev_display_get_param(struct native_display *ndpy,
|
||||
int val;
|
||||
|
||||
switch (param) {
|
||||
case NATIVE_PARAM_USE_NATIVE_BUFFER:
|
||||
case NATIVE_PARAM_PRESERVE_BUFFER:
|
||||
val = 1;
|
||||
break;
|
||||
case NATIVE_PARAM_USE_NATIVE_BUFFER:
|
||||
case NATIVE_PARAM_MAX_SWAP_INTERVAL:
|
||||
default:
|
||||
val = 0;
|
||||
@@ -326,114 +418,55 @@ fbdev_display_destroy(struct native_display *ndpy)
|
||||
}
|
||||
|
||||
static boolean
|
||||
fbdev_display_init_modes(struct native_display *ndpy)
|
||||
{
|
||||
struct fbdev_display *fbdpy = fbdev_display(ndpy);
|
||||
struct native_mode *nmode = &fbdpy->mode;
|
||||
|
||||
nmode->desc = "Current Mode";
|
||||
nmode->width = fbdpy->vinfo.xres;
|
||||
nmode->height = fbdpy->vinfo.yres;
|
||||
nmode->refresh_rate = 60 * 1000; /* dummy */
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
fbdev_display_init_connectors(struct native_display *ndpy)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static enum pipe_format
|
||||
vinfo_to_format(const struct fb_var_screeninfo *vinfo)
|
||||
{
|
||||
enum pipe_format format = PIPE_FORMAT_NONE;
|
||||
|
||||
switch (vinfo->bits_per_pixel) {
|
||||
case 32:
|
||||
if (vinfo->red.length == 8 &&
|
||||
vinfo->green.length == 8 &&
|
||||
vinfo->blue.length == 8) {
|
||||
format = (vinfo->transp.length == 8) ?
|
||||
PIPE_FORMAT_B8G8R8A8_UNORM : PIPE_FORMAT_B8G8R8X8_UNORM;
|
||||
}
|
||||
break;
|
||||
case 16:
|
||||
if (vinfo->red.length == 5 &&
|
||||
vinfo->green.length == 6 &&
|
||||
vinfo->blue.length == 5 &&
|
||||
vinfo->transp.length == 0)
|
||||
format = PIPE_FORMAT_B5G6R5_UNORM;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return format;
|
||||
}
|
||||
|
||||
static boolean
|
||||
fbdev_display_init_configs(struct native_display *ndpy)
|
||||
{
|
||||
struct fbdev_display *fbdpy = fbdev_display(ndpy);
|
||||
struct native_config *nconf = &fbdpy->config;
|
||||
|
||||
nconf->color_format = vinfo_to_format(&fbdpy->vinfo);
|
||||
if (nconf->color_format == PIPE_FORMAT_NONE)
|
||||
return FALSE;
|
||||
|
||||
nconf->buffer_mask =
|
||||
(1 << NATIVE_ATTACHMENT_FRONT_LEFT) |
|
||||
(1 << NATIVE_ATTACHMENT_BACK_LEFT);
|
||||
|
||||
nconf->scanout_bit = TRUE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
fbdev_display_init(struct native_display *ndpy)
|
||||
fbdev_display_init_screen(struct native_display *ndpy)
|
||||
{
|
||||
struct fbdev_display *fbdpy = fbdev_display(ndpy);
|
||||
struct sw_winsys *ws;
|
||||
|
||||
if (ioctl(fbdpy->fd, FBIOGET_FSCREENINFO, &fbdpy->finfo))
|
||||
ws = fbdev_create_sw_winsys(fbdpy->fd);
|
||||
if (!ws)
|
||||
return FALSE;
|
||||
|
||||
if (ioctl(fbdpy->fd, FBIOGET_VSCREENINFO, &fbdpy->vinfo))
|
||||
fbdpy->base.screen = fbdpy->event_handler->new_sw_screen(&fbdpy->base, ws);
|
||||
if (!fbdpy->base.screen) {
|
||||
if (ws->destroy)
|
||||
ws->destroy(ws);
|
||||
return FALSE;
|
||||
|
||||
if (fbdpy->finfo.visual != FB_VISUAL_TRUECOLOR ||
|
||||
fbdpy->finfo.type != FB_TYPE_PACKED_PIXELS)
|
||||
return FALSE;
|
||||
|
||||
if (!fbdev_display_init_configs(&fbdpy->base) ||
|
||||
!fbdev_display_init_connectors(&fbdpy->base) ||
|
||||
!fbdev_display_init_modes(&fbdpy->base))
|
||||
return FALSE;
|
||||
|
||||
ws = fbdev_create_sw_winsys(fbdpy->fd, fbdpy->config.color_format);
|
||||
if (ws) {
|
||||
fbdpy->base.screen =
|
||||
fbdpy->event_handler->new_sw_screen(&fbdpy->base, ws);
|
||||
}
|
||||
|
||||
if (fbdpy->base.screen) {
|
||||
if (!fbdpy->base.screen->is_format_supported(fbdpy->base.screen,
|
||||
fbdpy->config.color_format, PIPE_TEXTURE_2D, 0,
|
||||
PIPE_BIND_RENDER_TARGET)) {
|
||||
fbdpy->base.screen->destroy(fbdpy->base.screen);
|
||||
fbdpy->base.screen = NULL;
|
||||
}
|
||||
if (!fbdpy->base.screen->is_format_supported(fbdpy->base.screen,
|
||||
fbdpy->config.color_format, PIPE_TEXTURE_2D, 0,
|
||||
PIPE_BIND_RENDER_TARGET)) {
|
||||
fbdpy->base.screen->destroy(fbdpy->base.screen);
|
||||
fbdpy->base.screen = NULL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return (fbdpy->base.screen != NULL);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
fbdev_display_init_config(struct native_display *ndpy)
|
||||
{
|
||||
struct fbdev_display *fbdpy = fbdev_display(ndpy);
|
||||
struct native_config *nconf = &fbdpy->config;
|
||||
|
||||
if (ioctl(fbdpy->fd, FBIOGET_VSCREENINFO, &fbdpy->config_vinfo))
|
||||
return FALSE;
|
||||
|
||||
nconf->color_format = vinfo_to_format(&fbdpy->config_vinfo);
|
||||
if (nconf->color_format == PIPE_FORMAT_NONE)
|
||||
return FALSE;
|
||||
|
||||
nconf->buffer_mask = (1 << NATIVE_ATTACHMENT_BACK_LEFT);
|
||||
|
||||
nconf->window_bit = TRUE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static struct native_display *
|
||||
fbdev_display_create(int fd, struct native_event_handler *event_handler,
|
||||
void *user_data)
|
||||
fbdev_display_create(int fd, const struct native_event_handler *event_handler)
|
||||
{
|
||||
struct fbdev_display *fbdpy;
|
||||
|
||||
@@ -443,32 +476,41 @@ fbdev_display_create(int fd, struct native_event_handler *event_handler,
|
||||
|
||||
fbdpy->fd = fd;
|
||||
fbdpy->event_handler = event_handler;
|
||||
fbdpy->base.user_data = user_data;
|
||||
|
||||
if (!fbdev_display_init(&fbdpy->base)) {
|
||||
FREE(fbdpy);
|
||||
return NULL;
|
||||
}
|
||||
if (ioctl(fbdpy->fd, FBIOGET_FSCREENINFO, &fbdpy->finfo))
|
||||
goto fail;
|
||||
|
||||
if (fbdpy->finfo.visual != FB_VISUAL_TRUECOLOR ||
|
||||
fbdpy->finfo.type != FB_TYPE_PACKED_PIXELS)
|
||||
goto fail;
|
||||
|
||||
if (!fbdev_display_init_config(&fbdpy->base))
|
||||
goto fail;
|
||||
|
||||
fbdpy->assume_fixed_vinfo = TRUE;
|
||||
|
||||
fbdpy->base.init_screen = fbdev_display_init_screen;
|
||||
fbdpy->base.destroy = fbdev_display_destroy;
|
||||
fbdpy->base.get_param = fbdev_display_get_param;
|
||||
fbdpy->base.get_configs = fbdev_display_get_configs;
|
||||
|
||||
fbdpy->base.create_window_surface = fbdev_display_create_window_surface;
|
||||
|
||||
/* we'd like to remove modeset support one day */
|
||||
fbdpy->config.scanout_bit = TRUE;
|
||||
fbdpy->base.modeset = &fbdev_display_modeset;
|
||||
|
||||
return &fbdpy->base;
|
||||
|
||||
fail:
|
||||
FREE(fbdpy);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static struct native_event_handler *fbdev_event_handler;
|
||||
|
||||
static void
|
||||
native_set_event_handler(struct native_event_handler *event_handler)
|
||||
{
|
||||
fbdev_event_handler = event_handler;
|
||||
}
|
||||
static const struct native_event_handler *fbdev_event_handler;
|
||||
|
||||
static struct native_display *
|
||||
native_create_display(void *dpy, boolean use_sw, void *user_data)
|
||||
native_create_display(void *dpy, boolean use_sw)
|
||||
{
|
||||
struct native_display *ndpy;
|
||||
int fd;
|
||||
@@ -483,7 +525,7 @@ native_create_display(void *dpy, boolean use_sw, void *user_data)
|
||||
if (fd < 0)
|
||||
return NULL;
|
||||
|
||||
ndpy = fbdev_display_create(fd, fbdev_event_handler, user_data);
|
||||
ndpy = fbdev_display_create(fd, fbdev_event_handler);
|
||||
if (!ndpy)
|
||||
close(fd);
|
||||
|
||||
@@ -492,12 +534,12 @@ native_create_display(void *dpy, boolean use_sw, void *user_data)
|
||||
|
||||
static const struct native_platform fbdev_platform = {
|
||||
"FBDEV", /* name */
|
||||
native_set_event_handler,
|
||||
native_create_display
|
||||
};
|
||||
|
||||
const struct native_platform *
|
||||
native_get_fbdev_platform(void)
|
||||
native_get_fbdev_platform(const struct native_event_handler *event_handler)
|
||||
{
|
||||
fbdev_event_handler = event_handler;
|
||||
return &fbdev_platform;
|
||||
}
|
||||
|
@@ -41,7 +41,7 @@ struct gdi_display {
|
||||
struct native_display base;
|
||||
|
||||
HDC hDC;
|
||||
struct native_event_handler *event_handler;
|
||||
const struct native_event_handler *event_handler;
|
||||
|
||||
struct native_config *configs;
|
||||
int num_configs;
|
||||
@@ -368,12 +368,30 @@ gdi_display_destroy(struct native_display *ndpy)
|
||||
FREE(gdpy);
|
||||
}
|
||||
|
||||
static boolean
|
||||
gdi_display_init_screen(struct native_display *ndpy)
|
||||
{
|
||||
struct gdi_display *gdpy = gdi_display(ndpy);
|
||||
struct sw_winsys *winsys;
|
||||
|
||||
winsys = gdi_create_sw_winsys();
|
||||
if (!winsys)
|
||||
return FALSE;
|
||||
|
||||
gdpy->base.screen = gdpy->event_handler->new_sw_screen(&gdpy->base, winsys);
|
||||
if (!gdpy->base.screen) {
|
||||
if (winsys->destroy)
|
||||
winsys->destroy(winsys);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static struct native_display *
|
||||
gdi_create_display(HDC hDC, struct native_event_handler *event_handler,
|
||||
void *user_data)
|
||||
gdi_create_display(HDC hDC, const struct native_event_handler *event_handler)
|
||||
{
|
||||
struct gdi_display *gdpy;
|
||||
struct sw_winsys *winsys;
|
||||
|
||||
gdpy = CALLOC_STRUCT(gdi_display);
|
||||
if (!gdpy)
|
||||
@@ -381,22 +399,8 @@ gdi_create_display(HDC hDC, struct native_event_handler *event_handler,
|
||||
|
||||
gdpy->hDC = hDC;
|
||||
gdpy->event_handler = event_handler;
|
||||
gdpy->base.user_data = user_data;
|
||||
|
||||
winsys = gdi_create_sw_winsys();
|
||||
if (!winsys) {
|
||||
FREE(gdpy);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
gdpy->base.screen = gdpy->event_handler->new_sw_screen(&gdpy->base, winsys);
|
||||
if (!gdpy->base.screen) {
|
||||
if (winsys->destroy)
|
||||
winsys->destroy(winsys);
|
||||
FREE(gdpy);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
gdpy->base.init_screen = gdi_display_init_screen;
|
||||
gdpy->base.destroy = gdi_display_destroy;
|
||||
gdpy->base.get_param = gdi_display_get_param;
|
||||
|
||||
@@ -406,28 +410,22 @@ gdi_create_display(HDC hDC, struct native_event_handler *event_handler,
|
||||
return &gdpy->base;
|
||||
}
|
||||
|
||||
static struct native_event_handler *gdi_event_handler;
|
||||
|
||||
static void
|
||||
native_set_event_handler(struct native_event_handler *event_handler)
|
||||
{
|
||||
gdi_event_handler = event_handler;
|
||||
}
|
||||
static const struct native_event_handler *gdi_event_handler;
|
||||
|
||||
static struct native_display *
|
||||
native_create_display(void *dpy, boolean use_sw, void *user_data)
|
||||
native_create_display(void *dpy, boolean use_sw)
|
||||
{
|
||||
return gdi_create_display((HDC) dpy, gdi_event_handler, user_data);
|
||||
return gdi_create_display((HDC) dpy, gdi_event_handler);
|
||||
}
|
||||
|
||||
static const struct native_platform gdi_platform = {
|
||||
"GDI", /* name */
|
||||
native_set_event_handler,
|
||||
native_create_display
|
||||
};
|
||||
|
||||
const struct native_platform *
|
||||
native_get_gdi_platform(void)
|
||||
native_get_gdi_platform(const struct native_event_handler *event_handler)
|
||||
{
|
||||
gdi_event_handler = event_handler;
|
||||
return &gdi_platform;
|
||||
}
|
||||
|
@@ -51,7 +51,7 @@
|
||||
struct wayland_drm_display {
|
||||
struct wayland_display base;
|
||||
|
||||
struct native_event_handler *event_handler;
|
||||
const struct native_event_handler *event_handler;
|
||||
|
||||
struct wl_drm *wl_drm;
|
||||
struct wl_drm *wl_server_drm; /* for EGL_WL_bind_wayland_display */
|
||||
@@ -285,8 +285,7 @@ static struct native_display_wayland_bufmgr wayland_drm_display_wayland_bufmgr =
|
||||
|
||||
struct wayland_display *
|
||||
wayland_create_drm_display(struct wl_display *dpy,
|
||||
struct native_event_handler *event_handler,
|
||||
void *user_data)
|
||||
const struct native_event_handler *event_handler)
|
||||
{
|
||||
struct wayland_drm_display *drmdpy;
|
||||
|
||||
@@ -295,7 +294,6 @@ wayland_create_drm_display(struct wl_display *dpy,
|
||||
return NULL;
|
||||
|
||||
drmdpy->event_handler = event_handler;
|
||||
drmdpy->base.base.user_data = user_data;
|
||||
|
||||
drmdpy->base.dpy = dpy;
|
||||
if (!drmdpy->base.dpy) {
|
||||
@@ -303,10 +301,7 @@ wayland_create_drm_display(struct wl_display *dpy,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!wayland_drm_display_init_screen(&drmdpy->base.base)) {
|
||||
wayland_drm_display_destroy(&drmdpy->base.base);
|
||||
return NULL;
|
||||
}
|
||||
drmdpy->base.base.init_screen = wayland_drm_display_init_screen;
|
||||
drmdpy->base.base.destroy = wayland_drm_display_destroy;
|
||||
drmdpy->base.base.buffer = &wayland_drm_display_buffer;
|
||||
drmdpy->base.base.wayland_bufmgr = &wayland_drm_display_wayland_bufmgr;
|
||||
|
@@ -47,7 +47,7 @@
|
||||
struct wayland_shm_display {
|
||||
struct wayland_display base;
|
||||
|
||||
struct native_event_handler *event_handler;
|
||||
const struct native_event_handler *event_handler;
|
||||
struct wl_shm *wl_shm;
|
||||
};
|
||||
|
||||
@@ -144,8 +144,7 @@ wayland_shm_display_init_screen(struct native_display *ndpy)
|
||||
|
||||
struct wayland_display *
|
||||
wayland_create_shm_display(struct wl_display *dpy,
|
||||
struct native_event_handler *event_handler,
|
||||
void *user_data)
|
||||
const struct native_event_handler *event_handler)
|
||||
{
|
||||
struct wayland_shm_display *shmdpy;
|
||||
|
||||
@@ -154,7 +153,6 @@ wayland_create_shm_display(struct wl_display *dpy,
|
||||
return NULL;
|
||||
|
||||
shmdpy->event_handler = event_handler;
|
||||
shmdpy->base.base.user_data = user_data;
|
||||
|
||||
shmdpy->base.dpy = dpy;
|
||||
if (!shmdpy->base.dpy) {
|
||||
@@ -162,11 +160,7 @@ wayland_create_shm_display(struct wl_display *dpy,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!wayland_shm_display_init_screen(&shmdpy->base.base)) {
|
||||
wayland_shm_display_destroy(&shmdpy->base.base);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
shmdpy->base.base.init_screen = wayland_shm_display_init_screen;
|
||||
shmdpy->base.base.destroy = wayland_shm_display_destroy;
|
||||
shmdpy->base.create_buffer = wayland_create_shm_buffer;
|
||||
|
||||
|
@@ -35,7 +35,7 @@
|
||||
|
||||
#include "native_wayland.h"
|
||||
|
||||
static struct native_event_handler *wayland_event_handler;
|
||||
static const struct native_event_handler *wayland_event_handler;
|
||||
|
||||
static void
|
||||
sync_callback(void *data)
|
||||
@@ -447,14 +447,8 @@ wayland_create_window_surface(struct native_display *ndpy,
|
||||
return &surface->base;
|
||||
}
|
||||
|
||||
static void
|
||||
native_set_event_handler(struct native_event_handler *event_handler)
|
||||
{
|
||||
wayland_event_handler = event_handler;
|
||||
}
|
||||
|
||||
static struct native_display *
|
||||
native_create_display(void *dpy, boolean use_sw, void *user_data)
|
||||
native_create_display(void *dpy, boolean use_sw)
|
||||
{
|
||||
struct wayland_display *display = NULL;
|
||||
boolean own_dpy = FALSE;
|
||||
@@ -471,12 +465,10 @@ native_create_display(void *dpy, boolean use_sw, void *user_data)
|
||||
if (use_sw) {
|
||||
_eglLog(_EGL_INFO, "use software fallback");
|
||||
display = wayland_create_shm_display((struct wl_display *) dpy,
|
||||
wayland_event_handler,
|
||||
user_data);
|
||||
wayland_event_handler);
|
||||
} else {
|
||||
display = wayland_create_drm_display((struct wl_display *) dpy,
|
||||
wayland_event_handler,
|
||||
user_data);
|
||||
wayland_event_handler);
|
||||
}
|
||||
|
||||
if (!display)
|
||||
@@ -495,13 +487,13 @@ native_create_display(void *dpy, boolean use_sw, void *user_data)
|
||||
|
||||
static const struct native_platform wayland_platform = {
|
||||
"wayland", /* name */
|
||||
native_set_event_handler,
|
||||
native_create_display
|
||||
};
|
||||
|
||||
const struct native_platform *
|
||||
native_get_wayland_platform(void)
|
||||
native_get_wayland_platform(const struct native_event_handler *event_handler)
|
||||
{
|
||||
wayland_event_handler = event_handler;
|
||||
return &wayland_platform;
|
||||
}
|
||||
|
||||
|
@@ -103,11 +103,10 @@ wayland_config(const struct native_config *nconf)
|
||||
|
||||
struct wayland_display *
|
||||
wayland_create_shm_display(struct wl_display *display,
|
||||
struct native_event_handler *event_handler,
|
||||
void *user_data);
|
||||
const struct native_event_handler *event_handler);
|
||||
|
||||
struct wayland_display *
|
||||
wayland_create_drm_display(struct wl_display *display,
|
||||
struct native_event_handler *event_handler,
|
||||
void *user_data);
|
||||
const struct native_event_handler *event_handler);
|
||||
|
||||
#endif /* _NATIVE_WAYLAND_H_ */
|
||||
|
@@ -49,7 +49,7 @@ struct dri2_display {
|
||||
Display *dpy;
|
||||
boolean own_dpy;
|
||||
|
||||
struct native_event_handler *event_handler;
|
||||
const struct native_event_handler *event_handler;
|
||||
|
||||
struct x11_screen *xscr;
|
||||
int xscr_number;
|
||||
@@ -870,8 +870,7 @@ static struct native_display_wayland_bufmgr dri2_display_wayland_bufmgr = {
|
||||
|
||||
struct native_display *
|
||||
x11_create_dri2_display(Display *dpy,
|
||||
struct native_event_handler *event_handler,
|
||||
void *user_data)
|
||||
const struct native_event_handler *event_handler)
|
||||
{
|
||||
struct dri2_display *dri2dpy;
|
||||
|
||||
@@ -880,7 +879,6 @@ x11_create_dri2_display(Display *dpy,
|
||||
return NULL;
|
||||
|
||||
dri2dpy->event_handler = event_handler;
|
||||
dri2dpy->base.user_data = user_data;
|
||||
|
||||
dri2dpy->dpy = dpy;
|
||||
if (!dri2dpy->dpy) {
|
||||
@@ -899,11 +897,6 @@ x11_create_dri2_display(Display *dpy,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!dri2_display_init_screen(&dri2dpy->base)) {
|
||||
dri2_display_destroy(&dri2dpy->base);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
dri2dpy->surfaces = util_hash_table_create(dri2_display_hash_table_hash,
|
||||
dri2_display_hash_table_compare);
|
||||
if (!dri2dpy->surfaces) {
|
||||
@@ -911,6 +904,7 @@ x11_create_dri2_display(Display *dpy,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
dri2dpy->base.init_screen = dri2_display_init_screen;
|
||||
dri2dpy->base.destroy = dri2_display_destroy;
|
||||
dri2dpy->base.get_param = dri2_display_get_param;
|
||||
dri2dpy->base.get_configs = dri2_display_get_configs;
|
||||
@@ -928,8 +922,7 @@ x11_create_dri2_display(Display *dpy,
|
||||
|
||||
struct native_display *
|
||||
x11_create_dri2_display(Display *dpy,
|
||||
struct native_event_handler *event_handler,
|
||||
void *user_data)
|
||||
const struct native_event_handler *event_handler)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
@@ -30,16 +30,10 @@
|
||||
|
||||
#include "native_x11.h"
|
||||
|
||||
static struct native_event_handler *x11_event_handler;
|
||||
|
||||
static void
|
||||
native_set_event_handler(struct native_event_handler *event_handler)
|
||||
{
|
||||
x11_event_handler = event_handler;
|
||||
}
|
||||
static const struct native_event_handler *x11_event_handler;
|
||||
|
||||
static struct native_display *
|
||||
native_create_display(void *dpy, boolean use_sw, void *user_data)
|
||||
native_create_display(void *dpy, boolean use_sw)
|
||||
{
|
||||
struct native_display *ndpy = NULL;
|
||||
boolean force_sw;
|
||||
@@ -48,12 +42,10 @@ native_create_display(void *dpy, boolean use_sw, void *user_data)
|
||||
|
||||
if (force_sw || use_sw) {
|
||||
_eglLog(_EGL_INFO, "use software fallback");
|
||||
ndpy = x11_create_ximage_display((Display *) dpy,
|
||||
x11_event_handler, user_data);
|
||||
ndpy = x11_create_ximage_display((Display *) dpy, x11_event_handler);
|
||||
}
|
||||
else {
|
||||
ndpy = x11_create_dri2_display((Display *) dpy,
|
||||
x11_event_handler, user_data);
|
||||
ndpy = x11_create_dri2_display((Display *) dpy, x11_event_handler);
|
||||
}
|
||||
|
||||
return ndpy;
|
||||
@@ -61,12 +53,12 @@ native_create_display(void *dpy, boolean use_sw, void *user_data)
|
||||
|
||||
static const struct native_platform x11_platform = {
|
||||
"X11", /* name */
|
||||
native_set_event_handler,
|
||||
native_create_display
|
||||
};
|
||||
|
||||
const struct native_platform *
|
||||
native_get_x11_platform(void)
|
||||
native_get_x11_platform(const struct native_event_handler *event_handler)
|
||||
{
|
||||
x11_event_handler = event_handler;
|
||||
return &x11_platform;
|
||||
}
|
||||
|
@@ -31,12 +31,10 @@
|
||||
|
||||
struct native_display *
|
||||
x11_create_ximage_display(Display *dpy,
|
||||
struct native_event_handler *event_handler,
|
||||
void *user_data);
|
||||
const struct native_event_handler *event_handler);
|
||||
|
||||
struct native_display *
|
||||
x11_create_dri2_display(Display *dpy,
|
||||
struct native_event_handler *event_handler,
|
||||
void *user_data);
|
||||
const struct native_event_handler *event_handler);
|
||||
|
||||
#endif /* _NATIVE_X11_H_ */
|
||||
|
@@ -43,7 +43,7 @@ struct ximage_display {
|
||||
Display *dpy;
|
||||
boolean own_dpy;
|
||||
|
||||
struct native_event_handler *event_handler;
|
||||
const struct native_event_handler *event_handler;
|
||||
|
||||
struct x11_screen *xscr;
|
||||
int xscr_number;
|
||||
@@ -484,13 +484,32 @@ ximage_display_destroy(struct native_display *ndpy)
|
||||
FREE(xdpy);
|
||||
}
|
||||
|
||||
static boolean
|
||||
ximage_display_init_screen(struct native_display *ndpy)
|
||||
{
|
||||
struct ximage_display *xdpy = ximage_display(ndpy);
|
||||
struct sw_winsys *winsys;
|
||||
|
||||
winsys = xlib_create_sw_winsys(xdpy->dpy);
|
||||
if (!winsys)
|
||||
return FALSE;
|
||||
|
||||
xdpy->base.screen =
|
||||
xdpy->event_handler->new_sw_screen(&xdpy->base, winsys);
|
||||
if (!xdpy->base.screen) {
|
||||
if (winsys->destroy)
|
||||
winsys->destroy(winsys);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
struct native_display *
|
||||
x11_create_ximage_display(Display *dpy,
|
||||
struct native_event_handler *event_handler,
|
||||
void *user_data)
|
||||
const struct native_event_handler *event_handler)
|
||||
{
|
||||
struct ximage_display *xdpy;
|
||||
struct sw_winsys *winsys = NULL;
|
||||
|
||||
xdpy = CALLOC_STRUCT(ximage_display);
|
||||
if (!xdpy)
|
||||
@@ -507,22 +526,17 @@ x11_create_ximage_display(Display *dpy,
|
||||
}
|
||||
|
||||
xdpy->event_handler = event_handler;
|
||||
xdpy->base.user_data = user_data;
|
||||
|
||||
xdpy->xscr_number = DefaultScreen(xdpy->dpy);
|
||||
xdpy->xscr = x11_screen_create(xdpy->dpy, xdpy->xscr_number);
|
||||
if (!xdpy->xscr)
|
||||
goto fail;
|
||||
|
||||
winsys = xlib_create_sw_winsys(xdpy->dpy);
|
||||
if (!winsys)
|
||||
goto fail;
|
||||
|
||||
xdpy->base.screen =
|
||||
xdpy->event_handler->new_sw_screen(&xdpy->base, winsys);
|
||||
if (!xdpy->base.screen)
|
||||
goto fail;
|
||||
if (!xdpy->xscr) {
|
||||
if (xdpy->own_dpy)
|
||||
XCloseDisplay(xdpy->dpy);
|
||||
FREE(xdpy);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
xdpy->base.init_screen = ximage_display_init_screen;
|
||||
xdpy->base.destroy = ximage_display_destroy;
|
||||
xdpy->base.get_param = ximage_display_get_param;
|
||||
|
||||
@@ -532,14 +546,4 @@ x11_create_ximage_display(Display *dpy,
|
||||
xdpy->base.create_pixmap_surface = ximage_display_create_pixmap_surface;
|
||||
|
||||
return &xdpy->base;
|
||||
|
||||
fail:
|
||||
if (winsys && winsys->destroy)
|
||||
winsys->destroy(winsys);
|
||||
if (xdpy->xscr)
|
||||
x11_screen_destroy(xdpy->xscr);
|
||||
if (xdpy->dpy && xdpy->own_dpy)
|
||||
XCloseDisplay(xdpy->dpy);
|
||||
FREE(xdpy);
|
||||
return NULL;
|
||||
}
|
||||
|
@@ -864,16 +864,19 @@ choose_visual( Display *dpy, int screen, const int *list, GLboolean fbConfig )
|
||||
parselist++;
|
||||
break;
|
||||
case GLX_FBCONFIG_ID:
|
||||
case GLX_VISUAL_ID:
|
||||
if (!fbConfig)
|
||||
return NULL;
|
||||
parselist++;
|
||||
desiredVisualID = *parselist++;
|
||||
break;
|
||||
case GLX_X_RENDERABLE:
|
||||
case GLX_MAX_PBUFFER_WIDTH:
|
||||
case GLX_MAX_PBUFFER_HEIGHT:
|
||||
case GLX_MAX_PBUFFER_PIXELS:
|
||||
if (!fbConfig)
|
||||
return NULL;
|
||||
parselist += 2;
|
||||
/* ignore */
|
||||
return NULL; /* invalid config option */
|
||||
parselist += 2; /* ignore the parameter */
|
||||
break;
|
||||
|
||||
#ifdef GLX_EXT_texture_from_pixmap
|
||||
|
@@ -42,7 +42,7 @@ egl_CPPFLAGS += \
|
||||
-I$(TOP)/src/egl/main \
|
||||
-D_EGL_MAIN=_eglMain
|
||||
egl_LIBS += $(TOP)/src/gallium/state_trackers/egl/libegl.a
|
||||
egl_SYS += $(LIBUDEV_LIBS) -lEGL -lm
|
||||
egl_SYS += $(LIBUDEV_LIBS) $(DLOPEN_LIBS) -lEGL -lm -lpthread
|
||||
|
||||
# EGL platforms
|
||||
ifneq ($(findstring x11, $(EGL_PLATFORMS)),)
|
||||
@@ -70,7 +70,7 @@ egl_CPPFLAGS += -I$(TOP)/src/mesa $(API_DEFINES)
|
||||
# make st/mesa built-in when there is a single glapi provider
|
||||
ifeq ($(SHARED_GLAPI),1)
|
||||
egl_LIBS += $(TOP)/src/mesa/libmesagallium.a
|
||||
egl_SYS += $(DRI_LIB_DEPS) -l$(GLAPI_LIB)
|
||||
egl_SYS += -lm -lpthread $(DLOPEN_LIBS) -l$(GLAPI_LIB)
|
||||
else
|
||||
egl_CPPFLAGS += -D_EGL_EXTERNAL_GL=1
|
||||
OUTPUTS += st_GL
|
||||
@@ -141,10 +141,18 @@ egl_LIBS += \
|
||||
$(TOP)/src/gallium/drivers/svga/libsvga.a
|
||||
endif
|
||||
|
||||
# swrast
|
||||
# softpipe
|
||||
ifneq ($(findstring softpipe,$(GALLIUM_DRIVERS_DIRS)),)
|
||||
egl_CPPFLAGS += -DGALLIUM_SOFTPIPE -DGALLIUM_RBUG -DGALLIUM_TRACE
|
||||
egl_LIBS += $(TOP)/src/gallium/drivers/softpipe/libsoftpipe.a
|
||||
egl_SYS += -lm
|
||||
endif
|
||||
|
||||
# llvmpipe
|
||||
ifneq ($(findstring llvmpipe,$(GALLIUM_DRIVERS_DIRS)),)
|
||||
egl_CPPFLAGS += -DGALLIUM_LLVMPIPE
|
||||
egl_LIBS += $(TOP)/src/gallium/drivers/llvmpipe/libllvmpipe.a
|
||||
endif
|
||||
|
||||
# sort to remove duplicates
|
||||
egl_CPPFLAGS := $(sort $(egl_CPPFLAGS))
|
||||
@@ -154,12 +162,10 @@ egl_SYS := $(sort $(egl_SYS))
|
||||
# st_GL, built only when shared glapi is not enabled
|
||||
st_GL_CPPFLAGS := -I $(TOP)/src/mesa -I$(TOP)/src/gallium/include
|
||||
st_GL_LIBS := $(TOP)/src/mesa/libmesagallium.a $(GALLIUM_AUXILIARIES)
|
||||
st_GL_SYS := $(DRI_LIB_DEPS)
|
||||
st_GL_SYS := -lm -lpthread $(DLOPEN_LIBS)
|
||||
|
||||
# LLVM
|
||||
ifeq ($(MESA_LLVM),1)
|
||||
egl_CPPFLAGS += -DGALLIUM_LLVMPIPE
|
||||
egl_LIBS += $(TOP)/src/gallium/drivers/llvmpipe/libllvmpipe.a
|
||||
egl_SYS += $(LLVM_LIBS)
|
||||
LDFLAGS += $(LLVM_LDFLAGS)
|
||||
|
||||
@@ -173,14 +179,14 @@ default: $(OUTPUTS)
|
||||
|
||||
$(OUTPUT_PATH)/egl_gallium.so: $(egl_OBJECTS) $(egl_LIBS)
|
||||
$(MKLIB) -o $(notdir $@) -noprefix -linker '$(CXX)' \
|
||||
-L$(TOP)/$(LIB_DIR) -ldflags '-Wl,--no-undefined $(LDFLAGS)' \
|
||||
-ldflags '-L$(TOP)/$(LIB_DIR) -Wl,--no-undefined $(LDFLAGS)' \
|
||||
-cplusplus -install $(OUTPUT_PATH) $(MKLIB_OPTIONS) \
|
||||
$(egl_OBJECTS) -Wl,--start-group $(egl_LIBS) -Wl,--end-group \
|
||||
$(egl_SYS)
|
||||
|
||||
$(OUTPUT_PATH)/st_GL.so: st_GL.o $(st_GL_LIBS)
|
||||
$(MKLIB) -o $(notdir $@) -noprefix -linker '$(CXX)' \
|
||||
-L$(TOP)/$(LIB_DIR) -ldflags '$(LDFLAGS)' \
|
||||
-ldflags '-L$(TOP)/$(LIB_DIR) $(LDFLAGS)' \
|
||||
-cplusplus -install $(OUTPUT_PATH) $(MKLIB_OPTIONS) \
|
||||
$< -Wl,--start-group $(st_GL_LIBS) -Wl,--end-group \
|
||||
$(st_GL_SYS)
|
||||
|
@@ -29,6 +29,9 @@
|
||||
#include "pipe/p_compiler.h"
|
||||
|
||||
PUBLIC struct st_api *
|
||||
st_api_create_OpenGL(void);
|
||||
|
||||
struct st_api *
|
||||
st_api_create_OpenGL(void)
|
||||
{
|
||||
return st_gl_api_create();
|
||||
|
@@ -18,6 +18,7 @@ GBM_INCLUDES = \
|
||||
GBM_LIBS = $(LIBUDEV_LIBS) $(LIBDRM_LIB) \
|
||||
$(TOP)/src/gallium/state_trackers/gbm/libgbm.a \
|
||||
$(TOP)/src/gallium/drivers/identity/libidentity.a \
|
||||
$(TOP)/src/gallium/drivers/galahad/libgalahad.a \
|
||||
$(TOP)/src/gallium/drivers/trace/libtrace.a \
|
||||
$(TOP)/src/gallium/drivers/rbug/librbug.a \
|
||||
$(GALLIUM_AUXILIARIES)
|
||||
@@ -37,44 +38,54 @@ pipe_INCLUDES = \
|
||||
-I$(TOP)/src/gallium/include \
|
||||
-I$(TOP)/src/gallium/winsys
|
||||
|
||||
pipe_LIBS = $(LIBDRM_LIB) \
|
||||
pipe_LIBS = \
|
||||
$(TOP)/src/gallium/drivers/identity/libidentity.a \
|
||||
$(TOP)/src/gallium/drivers/trace/libtrace.a \
|
||||
$(TOP)/src/gallium/drivers/rbug/librbug.a \
|
||||
$(GALLIUM_AUXILIARIES)
|
||||
|
||||
pipe_CLFLAGS = $(LIBDRM_CFLAGS)
|
||||
# as if we are DRI modules
|
||||
pipe_SYS = $(DRI_LIB_DEPS)
|
||||
|
||||
pipe_CLFLAGS = \
|
||||
-DGALLIUM_RBUG -DGALLIUM_TRACE -DGALLIUM_GALAHAD \
|
||||
$(LIBDRM_CFLAGS)
|
||||
|
||||
pipe_LDFLAGS = -Wl,--no-undefined
|
||||
|
||||
# i915 pipe driver
|
||||
i915_LIBS = -ldrm_intel \
|
||||
i915_LIBS = \
|
||||
$(TOP)/src/gallium/winsys/i915/drm/libi915drm.a \
|
||||
$(TOP)/src/gallium/drivers/i915/libi915.a
|
||||
i915_SYS = -ldrm_intel
|
||||
|
||||
# i965 pipe driver
|
||||
i965_LIBS = -ldrm_intel \
|
||||
i965_LIBS = \
|
||||
$(TOP)/src/gallium/winsys/i965/drm/libi965drm.a \
|
||||
$(TOP)/src/gallium/drivers/i965/libi965.a \
|
||||
$(TOP)/src/gallium/winsys/sw/wrapper/libwsw.a
|
||||
i965_SYS = -ldrm_intel
|
||||
|
||||
# nouveau pipe driver
|
||||
nouveau_LIBS = -ldrm_nouveau \
|
||||
nouveau_LIBS = \
|
||||
$(TOP)/src/gallium/winsys/nouveau/drm/libnouveaudrm.a \
|
||||
$(TOP)/src/gallium/drivers/nvfx/libnvfx.a \
|
||||
$(TOP)/src/gallium/drivers/nv50/libnv50.a \
|
||||
$(TOP)/src/gallium/drivers/nvc0/libnvc0.a \
|
||||
$(TOP)/src/gallium/drivers/nouveau/libnouveau.a
|
||||
nouveau_SYS = -ldrm_nouveau
|
||||
|
||||
# r300 pipe driver
|
||||
r300_LIBS = -ldrm \
|
||||
r300_LIBS = \
|
||||
$(TOP)/src/gallium/winsys/radeon/drm/libradeonwinsys.a \
|
||||
$(TOP)/src/gallium/drivers/r300/libr300.a
|
||||
r300_SYS = -ldrm_radeon
|
||||
|
||||
# r600 pipe driver
|
||||
r600_LIBS = -ldrm -ldrm_radeon \
|
||||
r600_LIBS = \
|
||||
$(TOP)/src/gallium/winsys/r600/drm/libr600winsys.a \
|
||||
$(TOP)/src/gallium/drivers/r600/libr600.a
|
||||
r600_SYS = -ldrm_radeon
|
||||
|
||||
# vmwgfx pipe driver
|
||||
vmwgfx_LIBS = \
|
||||
@@ -83,7 +94,8 @@ vmwgfx_LIBS = \
|
||||
|
||||
# LLVM
|
||||
ifeq ($(MESA_LLVM),1)
|
||||
pipe_LIBS += $(LLVM_LIBS)
|
||||
pipe_LIBS += $(TOP)/src/gallium/drivers/llvmpipe/libllvmpipe.a
|
||||
pipe_SYS += $(LLVM_LIBS)
|
||||
pipe_LDFLAGS += $(LLVM_LDFLAGS)
|
||||
endif
|
||||
|
||||
@@ -140,7 +152,8 @@ $(pipe_TARGETS): $(PIPE_PREFIX)%.so: pipe_%.o
|
||||
$(MKLIB) -o $@ -noprefix -linker '$(CC)' \
|
||||
-ldflags '-L$(TOP)/$(LIB_DIR) $(pipe_LDFLAGS) $(LDFLAGS)' \
|
||||
$(MKLIB_OPTIONS) $< \
|
||||
-Wl,--start-group $($*_LIBS) $(pipe_LIBS) -Wl,--end-group
|
||||
-Wl,--start-group $(pipe_LIBS) $($*_LIBS) -Wl,--end-group \
|
||||
$(pipe_SYS) $($*_SYS)
|
||||
|
||||
$(pipe_OBJECTS): %.o: %.c
|
||||
$(CC) -c -o $@ $< $(pipe_INCLUDES) $(pipe_CFLAGS) $(CFLAGS)
|
||||
|
@@ -213,6 +213,17 @@ i915_drm_buffer_destroy(struct i915_winsys *iws,
|
||||
FREE(buffer);
|
||||
}
|
||||
|
||||
static boolean
|
||||
i915_drm_buffer_is_busy(struct i915_winsys *iws,
|
||||
struct i915_winsys_buffer *buffer)
|
||||
{
|
||||
struct i915_drm_buffer* i915_buffer = i915_drm_buffer(buffer);
|
||||
if (!i915_buffer)
|
||||
return FALSE;
|
||||
return drm_intel_bo_busy(i915_buffer->bo);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
i915_drm_winsys_init_buffer_functions(struct i915_drm_winsys *idws)
|
||||
{
|
||||
@@ -224,4 +235,5 @@ i915_drm_winsys_init_buffer_functions(struct i915_drm_winsys *idws)
|
||||
idws->base.buffer_unmap = i915_drm_buffer_unmap;
|
||||
idws->base.buffer_write = i915_drm_buffer_write;
|
||||
idws->base.buffer_destroy = i915_drm_buffer_destroy;
|
||||
idws->base.buffer_is_busy = i915_drm_buffer_is_busy;
|
||||
}
|
||||
|
@@ -55,6 +55,7 @@ static const struct r600_reg evergreen_config_reg_list[] = {
|
||||
{R_008C24_SQ_STACK_RESOURCE_MGMT_2, REG_FLAG_ENABLE_ALWAYS | REG_FLAG_FLUSH_CHANGE, 0, 0},
|
||||
{R_008C28_SQ_STACK_RESOURCE_MGMT_3, REG_FLAG_ENABLE_ALWAYS | REG_FLAG_FLUSH_CHANGE, 0, 0},
|
||||
{R_008D8C_SQ_DYN_GPR_CNTL_PS_FLUSH_REQ, REG_FLAG_ENABLE_ALWAYS | REG_FLAG_FLUSH_CHANGE, 0, 0},
|
||||
{R_008E2C_SQ_LDS_RESOURCE_MGMT, REG_FLAG_ENABLE_ALWAYS | REG_FLAG_FLUSH_CHANGE, 0, 0},
|
||||
{R_009100_SPI_CONFIG_CNTL, REG_FLAG_ENABLE_ALWAYS | REG_FLAG_FLUSH_CHANGE, 0, 0},
|
||||
{R_00913C_SPI_CONFIG_CNTL_1, REG_FLAG_ENABLE_ALWAYS | REG_FLAG_FLUSH_CHANGE, 0, 0},
|
||||
};
|
||||
|
@@ -186,7 +186,7 @@ static int eg_interpret_tiling(struct radeon *radeon, uint32_t tiling_config)
|
||||
|
||||
static int radeon_drm_get_tiling(struct radeon *radeon)
|
||||
{
|
||||
struct drm_radeon_info info;
|
||||
struct drm_radeon_info info = {};
|
||||
int r;
|
||||
uint32_t tiling_config = 0;
|
||||
|
||||
@@ -208,8 +208,8 @@ static int radeon_drm_get_tiling(struct radeon *radeon)
|
||||
|
||||
static int radeon_get_clock_crystal_freq(struct radeon *radeon)
|
||||
{
|
||||
struct drm_radeon_info info;
|
||||
uint32_t clock_crystal_freq;
|
||||
struct drm_radeon_info info = {};
|
||||
uint32_t clock_crystal_freq = 0;
|
||||
int r;
|
||||
|
||||
info.request = RADEON_INFO_CLOCK_CRYSTAL_FREQ;
|
||||
@@ -226,8 +226,8 @@ static int radeon_get_clock_crystal_freq(struct radeon *radeon)
|
||||
|
||||
static int radeon_get_num_backends(struct radeon *radeon)
|
||||
{
|
||||
struct drm_radeon_info info;
|
||||
uint32_t num_backends;
|
||||
struct drm_radeon_info info = {};
|
||||
uint32_t num_backends = 0;
|
||||
int r;
|
||||
|
||||
info.request = RADEON_INFO_NUM_BACKENDS;
|
||||
|
@@ -62,6 +62,8 @@ void r600_init_cs(struct r600_context *ctx)
|
||||
ctx->pm4[ctx->pm4_cdwords++] = PKT3(PKT3_CONTEXT_CONTROL, 1, 0);
|
||||
ctx->pm4[ctx->pm4_cdwords++] = 0x80000000;
|
||||
ctx->pm4[ctx->pm4_cdwords++] = 0x80000000;
|
||||
|
||||
ctx->init_dwords = ctx->pm4_cdwords;
|
||||
}
|
||||
|
||||
static void INLINE r600_context_update_fenced_list(struct r600_context *ctx)
|
||||
@@ -1496,7 +1498,7 @@ void r600_context_flush(struct r600_context *ctx)
|
||||
int r;
|
||||
struct r600_block *enable_block = NULL;
|
||||
|
||||
if (!ctx->pm4_cdwords)
|
||||
if (ctx->pm4_cdwords == ctx->init_dwords)
|
||||
return;
|
||||
|
||||
/* suspend queries */
|
||||
@@ -1563,7 +1565,7 @@ void r600_context_flush(struct r600_context *ctx)
|
||||
r600_init_cs(ctx);
|
||||
|
||||
/* resume queries */
|
||||
r600_context_queries_resume(ctx);
|
||||
r600_context_queries_resume(ctx, TRUE);
|
||||
|
||||
/* set all valid group as dirty so they get reemited on
|
||||
* next draw command
|
||||
@@ -1693,10 +1695,9 @@ out_err:
|
||||
|
||||
static boolean r600_query_result(struct r600_context *ctx, struct r600_query *query, boolean wait)
|
||||
{
|
||||
unsigned results_base = query->results_start;
|
||||
u64 start, end;
|
||||
u32 *results;
|
||||
int i;
|
||||
int size;
|
||||
u32 *results, *current_result;
|
||||
|
||||
if (wait)
|
||||
results = r600_bo_map(ctx->radeon, query->buffer, PB_USAGE_CPU_READ, NULL);
|
||||
@@ -1705,25 +1706,31 @@ static boolean r600_query_result(struct r600_context *ctx, struct r600_query *qu
|
||||
if (!results)
|
||||
return FALSE;
|
||||
|
||||
/* query->num_results contains how many dwords were used for the query */
|
||||
size = query->num_results;
|
||||
for (i = 0; i < size; i += 4) {
|
||||
start = (u64)results[i] | (u64)results[i + 1] << 32;
|
||||
end = (u64)results[i + 2] | (u64)results[i + 3] << 32;
|
||||
|
||||
/* count all results across all data blocks */
|
||||
while (results_base != query->results_end) {
|
||||
current_result = (u32*)((char*)results + results_base);
|
||||
|
||||
start = (u64)current_result[0] | (u64)current_result[1] << 32;
|
||||
end = (u64)current_result[2] | (u64)current_result[3] << 32;
|
||||
if (((start & 0x8000000000000000UL) && (end & 0x8000000000000000UL))
|
||||
|| query->type == PIPE_QUERY_TIME_ELAPSED) {
|
||||
query->result += end - start;
|
||||
}
|
||||
}
|
||||
r600_bo_unmap(ctx->radeon, query->buffer);
|
||||
query->num_results = 0;
|
||||
|
||||
results_base += 4 * 4;
|
||||
if (results_base >= query->buffer_size)
|
||||
results_base = 0;
|
||||
}
|
||||
|
||||
query->results_start = query->results_end;
|
||||
r600_bo_unmap(ctx->radeon, query->buffer);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void r600_query_begin(struct r600_context *ctx, struct r600_query *query)
|
||||
{
|
||||
unsigned required_space;
|
||||
unsigned required_space, new_results_end;
|
||||
int num_backends = r600_get_num_backends(ctx->radeon);
|
||||
|
||||
/* query request needs 6/8 dwords for begin + 6/8 dwords for end */
|
||||
@@ -1737,22 +1744,39 @@ void r600_query_begin(struct r600_context *ctx, struct r600_query *query)
|
||||
r600_context_flush(ctx);
|
||||
}
|
||||
|
||||
/* if query buffer is full force a flush */
|
||||
if (query->num_results*4 >= query->buffer_size - 16) {
|
||||
r600_context_flush(ctx);
|
||||
if (query->type == PIPE_QUERY_OCCLUSION_COUNTER) {
|
||||
/* Count queries emitted without flushes, and flush if more than
|
||||
* half of buffer used, to avoid overwriting results which may be
|
||||
* still in use. */
|
||||
if (query->state & R600_QUERY_STATE_FLUSHED) {
|
||||
query->queries_emitted = 1;
|
||||
} else {
|
||||
if (++query->queries_emitted > query->buffer_size / query->result_size / 2)
|
||||
r600_context_flush(ctx);
|
||||
}
|
||||
}
|
||||
|
||||
new_results_end = query->results_end + query->result_size;
|
||||
if (new_results_end >= query->buffer_size)
|
||||
new_results_end = 0;
|
||||
|
||||
/* collect current results if query buffer is full */
|
||||
if (new_results_end == query->results_start) {
|
||||
if (!(query->state & R600_QUERY_STATE_FLUSHED))
|
||||
r600_context_flush(ctx);
|
||||
r600_query_result(ctx, query, TRUE);
|
||||
}
|
||||
|
||||
if (query->type == PIPE_QUERY_OCCLUSION_COUNTER &&
|
||||
num_backends > 0) {
|
||||
/* as per info on ZPASS the driver must set the unusued DB top bits */
|
||||
if (query->type == PIPE_QUERY_OCCLUSION_COUNTER) {
|
||||
u32 *results;
|
||||
int i;
|
||||
|
||||
results = r600_bo_map(ctx->radeon, query->buffer, PB_USAGE_DONTBLOCK | PB_USAGE_CPU_WRITE, NULL);
|
||||
results = r600_bo_map(ctx->radeon, query->buffer, PB_USAGE_CPU_WRITE, NULL);
|
||||
if (results) {
|
||||
memset(results + (query->num_results * 4), 0, ctx->max_db * 4 * 4);
|
||||
results = (u32*)((char*)results + query->results_end);
|
||||
memset(results, 0, query->result_size);
|
||||
|
||||
/* Set top bits for unused backends */
|
||||
for (i = num_backends; i < ctx->max_db; i++) {
|
||||
results[(i * 4)+1] = 0x80000000;
|
||||
results[(i * 4)+3] = 0x80000000;
|
||||
@@ -1765,14 +1789,14 @@ void r600_query_begin(struct r600_context *ctx, struct r600_query *query)
|
||||
if (query->type == PIPE_QUERY_TIME_ELAPSED) {
|
||||
ctx->pm4[ctx->pm4_cdwords++] = PKT3(PKT3_EVENT_WRITE_EOP, 4, 0);
|
||||
ctx->pm4[ctx->pm4_cdwords++] = EVENT_TYPE(EVENT_TYPE_CACHE_FLUSH_AND_INV_TS_EVENT) | EVENT_INDEX(5);
|
||||
ctx->pm4[ctx->pm4_cdwords++] = query->num_results*4 + r600_bo_offset(query->buffer);
|
||||
ctx->pm4[ctx->pm4_cdwords++] = query->results_end + r600_bo_offset(query->buffer);
|
||||
ctx->pm4[ctx->pm4_cdwords++] = (3 << 29);
|
||||
ctx->pm4[ctx->pm4_cdwords++] = 0;
|
||||
ctx->pm4[ctx->pm4_cdwords++] = 0;
|
||||
} else {
|
||||
ctx->pm4[ctx->pm4_cdwords++] = PKT3(PKT3_EVENT_WRITE, 2, 0);
|
||||
ctx->pm4[ctx->pm4_cdwords++] = EVENT_TYPE(EVENT_TYPE_ZPASS_DONE) | EVENT_INDEX(1);
|
||||
ctx->pm4[ctx->pm4_cdwords++] = query->num_results*4 + r600_bo_offset(query->buffer);
|
||||
ctx->pm4[ctx->pm4_cdwords++] = query->results_end + r600_bo_offset(query->buffer);
|
||||
ctx->pm4[ctx->pm4_cdwords++] = 0;
|
||||
}
|
||||
ctx->pm4[ctx->pm4_cdwords++] = PKT3(PKT3_NOP, 0, 0);
|
||||
@@ -1786,49 +1810,75 @@ void r600_query_begin(struct r600_context *ctx, struct r600_query *query)
|
||||
|
||||
void r600_query_end(struct r600_context *ctx, struct r600_query *query)
|
||||
{
|
||||
/* emit begin query */
|
||||
/* emit end query */
|
||||
if (query->type == PIPE_QUERY_TIME_ELAPSED) {
|
||||
ctx->pm4[ctx->pm4_cdwords++] = PKT3(PKT3_EVENT_WRITE_EOP, 4, 0);
|
||||
ctx->pm4[ctx->pm4_cdwords++] = EVENT_TYPE(EVENT_TYPE_CACHE_FLUSH_AND_INV_TS_EVENT) | EVENT_INDEX(5);
|
||||
ctx->pm4[ctx->pm4_cdwords++] = query->num_results*4 + 8 + r600_bo_offset(query->buffer);
|
||||
ctx->pm4[ctx->pm4_cdwords++] = query->results_end + 8 + r600_bo_offset(query->buffer);
|
||||
ctx->pm4[ctx->pm4_cdwords++] = (3 << 29);
|
||||
ctx->pm4[ctx->pm4_cdwords++] = 0;
|
||||
ctx->pm4[ctx->pm4_cdwords++] = 0;
|
||||
} else {
|
||||
ctx->pm4[ctx->pm4_cdwords++] = PKT3(PKT3_EVENT_WRITE, 2, 0);
|
||||
ctx->pm4[ctx->pm4_cdwords++] = EVENT_TYPE(EVENT_TYPE_ZPASS_DONE) | EVENT_INDEX(1);
|
||||
ctx->pm4[ctx->pm4_cdwords++] = query->num_results*4 + 8 + r600_bo_offset(query->buffer);
|
||||
ctx->pm4[ctx->pm4_cdwords++] = query->results_end + 8 + r600_bo_offset(query->buffer);
|
||||
ctx->pm4[ctx->pm4_cdwords++] = 0;
|
||||
}
|
||||
ctx->pm4[ctx->pm4_cdwords++] = PKT3(PKT3_NOP, 0, 0);
|
||||
ctx->pm4[ctx->pm4_cdwords++] = 0;
|
||||
r600_context_bo_reloc(ctx, &ctx->pm4[ctx->pm4_cdwords - 1], query->buffer);
|
||||
|
||||
query->num_results += 4 * (query->type == PIPE_QUERY_OCCLUSION_COUNTER ? ctx->max_db : 1);
|
||||
query->results_end += query->result_size;
|
||||
if (query->results_end >= query->buffer_size)
|
||||
query->results_end = 0;
|
||||
|
||||
query->state ^= R600_QUERY_STATE_STARTED;
|
||||
query->state |= R600_QUERY_STATE_ENDED;
|
||||
query->state &= ~R600_QUERY_STATE_FLUSHED;
|
||||
|
||||
ctx->num_query_running--;
|
||||
}
|
||||
|
||||
void r600_query_predication(struct r600_context *ctx, struct r600_query *query, int operation,
|
||||
int flag_wait)
|
||||
{
|
||||
ctx->pm4[ctx->pm4_cdwords++] = PKT3(PKT3_SET_PREDICATION, 1, 0);
|
||||
|
||||
if (operation == PREDICATION_OP_CLEAR) {
|
||||
if (ctx->pm4_cdwords + 3 > ctx->pm4_ndwords)
|
||||
r600_context_flush(ctx);
|
||||
|
||||
ctx->pm4[ctx->pm4_cdwords++] = PKT3(PKT3_SET_PREDICATION, 1, 0);
|
||||
ctx->pm4[ctx->pm4_cdwords++] = 0;
|
||||
ctx->pm4[ctx->pm4_cdwords++] = PRED_OP(PREDICATION_OP_CLEAR);
|
||||
} else {
|
||||
int results_base = query->num_results - (4 * ctx->max_db);
|
||||
unsigned results_base = query->results_start;
|
||||
unsigned count;
|
||||
u32 op;
|
||||
|
||||
if (results_base < 0)
|
||||
results_base = 0;
|
||||
/* find count of the query data blocks */
|
||||
count = query->buffer_size + query->results_end - query->results_start;
|
||||
if (count >= query->buffer_size) count-=query->buffer_size;
|
||||
count /= query->result_size;
|
||||
|
||||
ctx->pm4[ctx->pm4_cdwords++] = results_base*4 + r600_bo_offset(query->buffer);
|
||||
ctx->pm4[ctx->pm4_cdwords++] = PRED_OP(operation) | (flag_wait ? PREDICATION_HINT_WAIT : PREDICATION_HINT_NOWAIT_DRAW) | PREDICATION_DRAW_VISIBLE;
|
||||
ctx->pm4[ctx->pm4_cdwords++] = PKT3(PKT3_NOP, 0, 0);
|
||||
ctx->pm4[ctx->pm4_cdwords++] = 0;
|
||||
r600_context_bo_reloc(ctx, &ctx->pm4[ctx->pm4_cdwords - 1], query->buffer);
|
||||
if (ctx->pm4_cdwords + 5 * count > ctx->pm4_ndwords)
|
||||
r600_context_flush(ctx);
|
||||
|
||||
op = PRED_OP(operation) | PREDICATION_DRAW_VISIBLE |
|
||||
(flag_wait ? PREDICATION_HINT_WAIT : PREDICATION_HINT_NOWAIT_DRAW);
|
||||
|
||||
/* emit predicate packets for all data blocks */
|
||||
while (results_base != query->results_end) {
|
||||
ctx->pm4[ctx->pm4_cdwords++] = PKT3(PKT3_SET_PREDICATION, 1, 0);
|
||||
ctx->pm4[ctx->pm4_cdwords++] = results_base + r600_bo_offset(query->buffer);
|
||||
ctx->pm4[ctx->pm4_cdwords++] = op;
|
||||
ctx->pm4[ctx->pm4_cdwords++] = PKT3(PKT3_NOP, 0, 0);
|
||||
ctx->pm4[ctx->pm4_cdwords++] = 0;
|
||||
r600_context_bo_reloc(ctx, &ctx->pm4[ctx->pm4_cdwords - 1], query->buffer);
|
||||
results_base += query->result_size;
|
||||
if (results_base >= query->buffer_size)
|
||||
results_base = 0;
|
||||
/* set CONTINUE bit for all packets except the first */
|
||||
op |= PREDICATION_CONTINUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1846,6 +1896,14 @@ struct r600_query *r600_context_query_create(struct r600_context *ctx, unsigned
|
||||
query->type = query_type;
|
||||
query->buffer_size = 4096;
|
||||
|
||||
if (query_type == PIPE_QUERY_OCCLUSION_COUNTER)
|
||||
query->result_size = 4 * 4 * ctx->max_db;
|
||||
else
|
||||
query->result_size = 4 * 4;
|
||||
|
||||
/* adjust buffer size to simplify offsets wrapping math */
|
||||
query->buffer_size -= query->buffer_size % query->result_size;
|
||||
|
||||
/* As of GL4, query buffers are normally read by the CPU after
|
||||
* being written by the gpu, hence staging is probably a good
|
||||
* usage pattern.
|
||||
@@ -1875,7 +1933,7 @@ boolean r600_context_query_result(struct r600_context *ctx,
|
||||
{
|
||||
uint64_t *result = (uint64_t*)vresult;
|
||||
|
||||
if (query->num_results) {
|
||||
if (!(query->state & R600_QUERY_STATE_FLUSHED)) {
|
||||
r600_context_flush(ctx);
|
||||
}
|
||||
if (!r600_query_result(ctx, query, wait))
|
||||
@@ -1900,11 +1958,14 @@ void r600_context_queries_suspend(struct r600_context *ctx)
|
||||
}
|
||||
}
|
||||
|
||||
void r600_context_queries_resume(struct r600_context *ctx)
|
||||
void r600_context_queries_resume(struct r600_context *ctx, boolean flushed)
|
||||
{
|
||||
struct r600_query *query;
|
||||
|
||||
LIST_FOR_EACH_ENTRY(query, &ctx->query_list, list) {
|
||||
if (flushed)
|
||||
query->state |= R600_QUERY_STATE_FLUSHED;
|
||||
|
||||
if (query->state & R600_QUERY_STATE_SUSPENDED) {
|
||||
r600_query_begin(ctx, query);
|
||||
query->state ^= R600_QUERY_STATE_SUSPENDED;
|
||||
|
@@ -114,6 +114,8 @@
|
||||
|
||||
#define PRED_OP(x) ((x) << 16)
|
||||
|
||||
#define PREDICATION_CONTINUE (1 << 31)
|
||||
|
||||
#define PREDICATION_HINT_WAIT (0 << 12)
|
||||
#define PREDICATION_HINT_NOWAIT_DRAW (1 << 12)
|
||||
|
||||
|
@@ -54,10 +54,8 @@ struct fbdev_sw_winsys
|
||||
struct sw_winsys base;
|
||||
|
||||
int fd;
|
||||
enum pipe_format format;
|
||||
|
||||
struct fb_fix_screeninfo finfo;
|
||||
void *fbmem;
|
||||
unsigned rows;
|
||||
unsigned stride;
|
||||
};
|
||||
@@ -77,22 +75,53 @@ fbdev_sw_winsys(struct sw_winsys *ws)
|
||||
static void
|
||||
fbdev_displaytarget_display(struct sw_winsys *ws,
|
||||
struct sw_displaytarget *dt,
|
||||
void *context_private)
|
||||
void *winsys_private)
|
||||
{
|
||||
struct fbdev_sw_winsys *fbdev = fbdev_sw_winsys(ws);
|
||||
struct fbdev_sw_displaytarget *fbdt = fbdev_sw_displaytarget(dt);
|
||||
unsigned rows, len, i;
|
||||
struct fbdev_sw_displaytarget *src = fbdev_sw_displaytarget(dt);
|
||||
const struct fbdev_sw_drawable *dst =
|
||||
(const struct fbdev_sw_drawable *) winsys_private;
|
||||
unsigned height, row_offset, row_len, i;
|
||||
void *fbmem;
|
||||
|
||||
rows = MIN2(fbdt->height, fbdev->rows);
|
||||
len = util_format_get_stride(fbdt->format, fbdt->width);
|
||||
len = MIN2(len, fbdev->stride);
|
||||
|
||||
for (i = 0; i < rows; i++) {
|
||||
void *dst = fbdev->fbmem + fbdev->stride * i;
|
||||
void *src = fbdt->data + fbdt->stride * i;
|
||||
|
||||
memcpy(dst, src, len);
|
||||
/* FIXME format conversion */
|
||||
if (dst->format != src->format) {
|
||||
assert(0);
|
||||
return;
|
||||
}
|
||||
|
||||
height = dst->height;
|
||||
if (dst->y + dst->height > fbdev->rows) {
|
||||
/* nothing to copy */
|
||||
if (dst->y >= fbdev->rows)
|
||||
return;
|
||||
|
||||
height = fbdev->rows - dst->y;
|
||||
}
|
||||
|
||||
row_offset = util_format_get_stride(dst->format, dst->x);
|
||||
row_len = util_format_get_stride(dst->format, dst->width);
|
||||
if (row_offset + row_len > fbdev->stride) {
|
||||
/* nothing to copy */
|
||||
if (row_offset >= fbdev->stride)
|
||||
return;
|
||||
|
||||
row_len = fbdev->stride - row_offset;
|
||||
}
|
||||
|
||||
fbmem = mmap(0, fbdev->finfo.smem_len,
|
||||
PROT_WRITE, MAP_SHARED, fbdev->fd, 0);
|
||||
if (fbmem == MAP_FAILED)
|
||||
return;
|
||||
|
||||
for (i = 0; i < height; i++) {
|
||||
char *from = (char *) src->data + src->stride * i;
|
||||
char *to = (char *) fbmem + fbdev->stride * (dst->y + i) + row_offset;
|
||||
|
||||
memcpy(to, from, row_len);
|
||||
}
|
||||
|
||||
munmap(fbmem, fbdev->finfo.smem_len);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -133,13 +162,9 @@ fbdev_displaytarget_create(struct sw_winsys *ws,
|
||||
unsigned alignment,
|
||||
unsigned *stride)
|
||||
{
|
||||
struct fbdev_sw_winsys *fbdev = fbdev_sw_winsys(ws);
|
||||
struct fbdev_sw_displaytarget *fbdt;
|
||||
unsigned nblocksy, size, format_stride;
|
||||
|
||||
if (fbdev->format != format)
|
||||
return NULL;
|
||||
|
||||
fbdt = CALLOC_STRUCT(fbdev_sw_displaytarget);
|
||||
if (!fbdt)
|
||||
return NULL;
|
||||
@@ -170,8 +195,7 @@ fbdev_is_displaytarget_format_supported(struct sw_winsys *ws,
|
||||
unsigned tex_usage,
|
||||
enum pipe_format format)
|
||||
{
|
||||
struct fbdev_sw_winsys *fbdev = fbdev_sw_winsys(ws);
|
||||
return (fbdev->format == format);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -179,12 +203,11 @@ fbdev_destroy(struct sw_winsys *ws)
|
||||
{
|
||||
struct fbdev_sw_winsys *fbdev = fbdev_sw_winsys(ws);
|
||||
|
||||
munmap(fbdev->fbmem, fbdev->finfo.smem_len);
|
||||
FREE(fbdev);
|
||||
}
|
||||
|
||||
struct sw_winsys *
|
||||
fbdev_create_sw_winsys(int fd, enum pipe_format format)
|
||||
fbdev_create_sw_winsys(int fd)
|
||||
{
|
||||
struct fbdev_sw_winsys *fbdev;
|
||||
|
||||
@@ -193,19 +216,11 @@ fbdev_create_sw_winsys(int fd, enum pipe_format format)
|
||||
return NULL;
|
||||
|
||||
fbdev->fd = fd;
|
||||
fbdev->format = format;
|
||||
if (ioctl(fbdev->fd, FBIOGET_FSCREENINFO, &fbdev->finfo)) {
|
||||
FREE(fbdev);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
fbdev->fbmem = mmap(0, fbdev->finfo.smem_len,
|
||||
PROT_WRITE, MAP_SHARED, fbdev->fd, 0);
|
||||
if (fbdev->fbmem == MAP_FAILED) {
|
||||
FREE(fbdev);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
fbdev->rows = fbdev->finfo.smem_len / fbdev->finfo.line_length;
|
||||
fbdev->stride = fbdev->finfo.line_length;
|
||||
|
||||
|
@@ -32,7 +32,14 @@
|
||||
struct sw_winsys;
|
||||
enum pipe_format;
|
||||
|
||||
/* for pipe_screen::flush_frontbuffer */
|
||||
struct fbdev_sw_drawable {
|
||||
enum pipe_format format;
|
||||
unsigned x, y;
|
||||
unsigned width, height;
|
||||
};
|
||||
|
||||
struct sw_winsys *
|
||||
fbdev_create_sw_winsys(int fd, enum pipe_format format);
|
||||
fbdev_create_sw_winsys(int fd);
|
||||
|
||||
#endif /* FBDEV_SW_WINSYS */
|
||||
|
@@ -28,6 +28,11 @@
|
||||
#ifndef _GBM_H_
|
||||
#define _GBM_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
#define __GBM__ 1
|
||||
|
||||
#include <stdint.h>
|
||||
@@ -97,4 +102,8 @@ gbm_bo_get_handle(struct gbm_bo *bo);
|
||||
void
|
||||
gbm_bo_destroy(struct gbm_bo *bo);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@@ -39,6 +39,7 @@ CXX_SOURCES = \
|
||||
ir.cpp \
|
||||
ir_expression_flattening.cpp \
|
||||
ir_function_can_inline.cpp \
|
||||
ir_function_detect_recursion.cpp \
|
||||
ir_function.cpp \
|
||||
ir_hierarchical_visitor.cpp \
|
||||
ir_hv_accept.cpp \
|
||||
@@ -154,7 +155,7 @@ clean: clean-dricore
|
||||
-rm -f $(APPS)
|
||||
|
||||
clean-dricore:
|
||||
-rm -f $(DRICORE_OBJ_DIR) $(TOP)/$(LIB_DIR)/libglsl.so libglsl.so
|
||||
-rm -f $(OBJECTS_DRICORE) $(TOP)/$(LIB_DIR)/libglsl.so libglsl.so
|
||||
|
||||
ifneq (,$(DRICORE_GLSL_LIBS))
|
||||
DRICORE_INSTALL_TARGET = install-dricore
|
||||
|
@@ -50,6 +50,7 @@ glsl_sources = [
|
||||
'ir.cpp',
|
||||
'ir_expression_flattening.cpp',
|
||||
'ir_function_can_inline.cpp',
|
||||
'ir_function_detect_recursion.cpp',
|
||||
'ir_function.cpp',
|
||||
'ir_hierarchical_visitor.cpp',
|
||||
'ir_hv_accept.cpp',
|
||||
|
@@ -62,8 +62,10 @@ process_parameters(exec_list *instructions, exec_list *actual_parameters,
|
||||
*
|
||||
* \param return_type Return type of the function. May be \c NULL.
|
||||
* \param name Name of the function.
|
||||
* \param parameters Parameter list for the function. This may be either a
|
||||
* formal or actual parameter list. Only the type is used.
|
||||
* \param parameters List of \c ir_instruction nodes representing the
|
||||
* parameter list for the function. This may be either a
|
||||
* formal (\c ir_variable) or actual (\c ir_rvalue)
|
||||
* parameter list. Only the type is used.
|
||||
*
|
||||
* \return
|
||||
* A ralloced string representing the prototype of the function.
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user