Compare commits

..

117 Commits

Author SHA1 Message Date
Ian Romanick
ba167f812c mesa: set version string to 7.7-rc1
Also modify the Makefile to use the correct version for the tarballs.
2009-12-07 17:18:56 -08:00
Ian Romanick
8fc433fa0f Merge branch 'mesa_7_6_branch' into mesa_7_7_branch
Conflicts:
	progs/demos/projtex.c
	progs/xdemos/glxinfo.c
	src/mesa/main/version.h

To fix the confilicts in projtex.c and glxinfo.c I just took the code from
mesa_7_6_branch.  The conflicts seem to have occured from cherry-picks from
mesa_7_7_branch to mesa_7_6_branch followed by commmits just to
mesa_7_6_branch.
2009-12-07 17:16:10 -08:00
Ian Romanick
bb64c9bcdf Revert "intel: Make RGB renderbuffers use XRGB8888 like we do for RGB system buffers."
This reverts commit 4598942b1b.

XRGB8888 doesn't work as intended.  Revert this for now, and we'll revisit it
for 7.8 or something.
2009-12-07 17:06:07 -08:00
Ian Romanick
9dbd47fc6b mesa: set version string to 7.6.1-rc3 2009-12-07 16:59:59 -08:00
Maciej Cencora
9921b3048e radeon: fix cases when only first image where put directly into miptree.
Make sure that minimal width, height and depth of texture image is 1.
2009-12-07 22:33:11 +01:00
Maciej Cencora
013cf1d63d radeon: fix image migration for small compressed textures
memcpy would give incorrect results if src rowstride != dst rowstride
2009-12-07 22:29:11 +01:00
Vinson Lee
7d84169865 progs/demos: Fix memory leak in projtex.c. 2009-12-07 12:31:08 -08:00
Vinson Lee
7005f7cd1a st/egl: Fix memory leak in egl_tracker.c.
(cherry picked from commit 052b127842)
2009-12-06 01:15:24 -08:00
Vinson Lee
c994f08eb1 dri: Fix potential null pointer dereference in driBindContext.
(cherry picked from commit 919898e92f)
2009-12-06 01:01:55 -08:00
Vinson Lee
f622b649fb dri: Fix potential null pointer deference in dri_put_drawable.
(cherry picked from commit 364070b1f2)
2009-12-06 01:00:20 -08:00
Vinson Lee
76b3523d75 glx: Prevent potential null pointer deference in driCreateContext.
(cherry picked from commit 4b0b250aae)
2009-12-06 00:56:20 -08:00
Vinson Lee
978b80c8e3 progs/tests: Add tests to Makefile.
(cherry picked from commit 76d2ec3a0a)
2009-12-05 21:20:54 -08:00
Vinson Lee
3cd745515e draw: Initialize variable in draw_pt.c.
(cherry picked from commit ea98e9820d)
2009-12-05 15:11:41 -08:00
Vinson Lee
b2953ee1a6 mesa: Fix array out-of-bounds access by _mesa_TexGenf.
_mesa_TexGenf calls _mesa_TexGenfv, which uses the params argument
as an array.
(cherry picked from commit ca5a7aadb4)
2009-12-05 13:00:35 -08:00
Vinson Lee
d74cd04e61 mesa: Fix array out-of-bounds access by _mesa_TexGeni.
_mesa_TexGeni calls _mesa_TexGeniv, which uses the params argument
as an array.
(cherry picked from commit d55fb7c835)
2009-12-05 12:59:34 -08:00
Vinson Lee
ca8a2150c7 mesa: Fix array out-of-bounds access by _mesa_TexParameterf.
_mesa_TexParameterf calls set_tex_parameterf, which uses the params
argument as an array.
(cherry picked from commit 270d36da14)
2009-12-05 12:50:56 -08:00
Vinson Lee
4071d065c2 mesa: Fix array out-of-bounds access by _mesa_TexParameterf.
_mesa_TexParameterf calls set_tex_parameteri, which uses the params
argument as an array.
(cherry picked from commit a201dfb6bf)
2009-12-05 12:47:40 -08:00
Vinson Lee
1446f30875 progs/samples: Fix memory leak if malloc fails in rgbtoppm.c. 2009-12-05 01:43:29 -08:00
Vinson Lee
412aeeed1c progs/samples: Fix memory leak if fopen fails in rgbtoppm.c. 2009-12-05 01:38:14 -08:00
Vinson Lee
6212c8103a progs/samples: Add rgbtoppm to Makefile. 2009-12-05 01:28:47 -08:00
Vinson Lee
2cd2341ce8 progs/tests: Removed unused variable from texdown.c. 2009-12-05 01:23:05 -08:00
Vinson Lee
d642edd2d1 progs/vpglsl: Assign glGetUniformLocationARB return value to GLint.
The return type of glGetUniformLocationARB is GLint, not GLuint.
2009-12-05 01:11:26 -08:00
Vinson Lee
8d2f3434c5 progs/fp: Redraw upon keypress. 2009-12-04 23:31:39 -08:00
Vinson Lee
fe8e18bcd4 mesa: Fix array out-of-bounds access in _mesa_TexEnvf.
_mesa_TexEnvf calls _mesa_TexEnvfv, which uses the param argument
as an array.
(cherry picked from commit a11d60d14c)
2009-12-04 17:48:30 -08:00
Vinson Lee
4fb5ae7233 progs/util: Fix memory leak if fread returns 0 in CompileShaderFile.
(cherry picked from commit 11905da883)
2009-12-04 17:35:00 -08:00
Vinson Lee
5683d7d43f progs/util: Fix memory leak if fail to load/compile shader
Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit c475079ef2)
2009-12-04 17:32:48 -08:00
Vinson Lee
e5bc2a19bd progs/fp: Add tri-inv.c to Makefile. 2009-12-04 17:29:53 -08:00
Coleman Kane
225bc70b77 r300g: use $(MAKE) variable
Fixes bug 24501
2009-12-04 08:45:04 -07:00
Brian Paul
ca7cd3ade0 progs/xdemos: fix some visual/fbconfig logic in glxinfo.c
The fbAttribSingle/Double arrays had wrong GLX_DOUBLEBUFFER values.
We only need to use the glXChooseFBConfig() code when glXChooseVisual()
fails (but I don't know when that would happen).
Other recent commits errantly removed some code in this area too.
2009-12-04 08:09:57 -07:00
Brian Paul
fb83fa26c4 docs: a few more fixes for 7.6.1 2009-12-04 08:09:07 -07:00
Alex Deucher
8d8fd9776e radeon: fix polygon stipple
fixes fdo bug 25354

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2009-12-04 09:52:37 -05:00
Jakob Bornecrantz
1ef8c493b2 vmware/xorg: Use Write instead of WriteRead for cursor bypass 2009-12-04 10:33:34 +01:00
Jakob Bornecrantz
cd4d806a47 vmware/xorg: Give kernel infromation about cursor bypass 2009-12-04 09:54:51 +01:00
Jakob Bornecrantz
12fdef20b0 vmware/xorg: Handle no init of video in vmw_video_close 2009-12-04 09:54:50 +01:00
Jakob Bornecrantz
47e128331a vmware/core: Update vmwgfx_drm.h to include cursor bypass 2009-12-04 09:54:50 +01:00
Jakob Bornecrantz
bc0532b0ed gallium: DRI drivers enabled by default, Xorg drivers auto by default.
This change enabled gallium dri drivers by default under the
configure build system. Xorg drivers are built automaticaly
if a Xorg dev enviroment is installed and the Xorg version
is higher then 1.6.0.
2009-12-04 19:02:41 +00:00
Jakob Bornecrantz
8ac2503397 i915g: Do not build winsys and binaries by default
Using a hack in the configure script the gallium intel
drivers have 3 options. Off, nothing is built. On, the
driver and binaries are built. Auto, only the driver but
not the binaries and winsys is built.

Since the i915g driver builds everywhere its can enable
the driver per default, so we can get build coverage.
But building the binaries per default is a pain for
distributions and testers since they conflict on the
install target with the old mesa drivers. Which are more
stable/faster/better.

So this change gives us the best of both worlds.
2009-12-04 16:01:41 +00:00
Vinson Lee
c74afe0c46 glu/sgi: Fix memory leak in gluBuild2DMipmapLevelsCore.
(cherry picked from commit 808f037660)
2009-12-04 00:14:31 -08:00
Vinson Lee
8df551c46b glu/sgi: Fix memory leak in gluBuild1DMipmapLevelsCore.
(cherry picked from commit 94bcb9f1a4)
2009-12-04 00:14:05 -08:00
Vinson Lee
ea487c6d0b glu/sgi: Fix memory leak in gluBuild2DMipmapLevelsCore.
(cherry picked from commit 0d89f3dc7f)
2009-12-04 00:13:25 -08:00
Vinson Lee
7b5eba453e glu/sgi: Fix memory leak in gluBuild3DMipmapLevelsCore.
(cherry picked from commit f895abbd97)
2009-12-04 00:12:49 -08:00
Vinson Lee
7ed749c062 glu/sgi: Fix memory leak in gluBuild3DMipmapLevelsCore.
(cherry picked from commit 326b66d724)
2009-12-04 00:11:58 -08:00
Vinson Lee
80a3944a4d glu/sgi: Fix memory leak in bitmapBuild2DMipmaps.
(cherry picked from commit 5b925b7daa)
2009-12-04 00:11:02 -08:00
Vinson Lee
6c1fc2b2a5 glu/sgi: Fix memory leak in gluScaleImage3D.
(cherry picked from commit b611f639b4)
2009-12-04 00:10:22 -08:00
Vinson Lee
fe38c16021 glu/sgi: Fix memory leak in gluScaleImage.
(cherry picked from commit a9c540f5de)
2009-12-04 00:09:22 -08:00
Vinson Lee
d23bb22f62 glu: Fix memory leak in __gl_meshMakeEdge.
(cherry picked from commit d3b4c99c70)
2009-12-04 00:07:51 -08:00
Vinson Lee
12a440abfb progs/xdemos: Silence unused value warnings in sharedtex_mt.c.
(cherry picked from commit 8556fad751)
2009-12-04 00:04:38 -08:00
Vinson Lee
4bf96ebdae progs/xdemos: Fix memory leak in pbdemo.c.
(cherry picked from commit e0857962b9)
2009-12-04 00:03:14 -08:00
Vinson Lee
ba3fedf246 progs/xdemos: Add missing break statement in offset.c.
(cherry picked from commit 4ab8dbe593)
2009-12-04 00:01:20 -08:00
Vinson Lee
8350648401 progs/xdemos: Remove duplicate code in glxinfo.c.
(cherry picked from commit a4720a1a32)
2009-12-03 23:59:47 -08:00
Vinson Lee
7324c22024 progs/xdemos: Fix memory leak in glxinfo.c.
(cherry picked from commit f080567f4c)
2009-12-03 23:59:11 -08:00
Vinson Lee
68d206fafa progs/xdemos: Add assert in corender.c.
(cherry picked from commit 66a4ec14c3)
2009-12-03 23:22:47 -08:00
Vinson Lee
69ed1147a8 progs/vp: Fix memory leak in vp-tris.c.
(cherry picked from commit 760cf71572)
2009-12-03 23:20:18 -08:00
Vinson Lee
efb582fde7 progs/tests: Fix memory leak in texdown.c if malloc fails.
(cherry picked from commit e3cfd78969)
2009-12-03 23:17:26 -08:00
Vinson Lee
b210739aad progs/redbook: Fix memory leak in quadric.c.
(cherry picked from commit 47b5f584a6)
2009-12-03 23:12:59 -08:00
Vinson Lee
b1a87a3e0b progs/glsl: Fix memory leak in deriv.c.
(cherry picked from commit 0e783c7d03)
2009-12-03 22:54:35 -08:00
Vinson Lee
25fd168f03 progs/glsl: Change tangentAttrib from GLuint to GLint in bump.c.
tangentAtrrib is assigned the result of glGetAttribLocation.
The assertion 'assert(tangentAtrrib >= 0)' would be a no-op if
tangentAttrib is a GLuint.
(cherry picked from commit b8dcb79c53)
2009-12-03 22:51:43 -08:00
Vinson Lee
b803abbaad progs/demos: Fix memory leak in ray.c.
(cherry picked from commit 6b480dc21d)
2009-12-03 22:49:18 -08:00
Vinson Lee
5820dae4ec progs/demos: Fix memory leak in projtex.c.
(cherry picked from commit ee555e3d69)
2009-12-03 22:44:55 -08:00
Vinson Lee
fc5f07de1a progs/demos: Fix memory leak in ipers.c.
(cherry picked from commit a1afe303de)
2009-12-03 22:38:44 -08:00
Vinson Lee
d245a951f3 progs/demos: Fix memory leak in fslight.c.
(cherry picked from commit aef3218f0b)
2009-12-03 22:36:37 -08:00
Vinson Lee
905e12f3cc gallium/util: Initialize variables in u_pack_color.h.
(cherry picked from commit 36e2074b63)
2009-12-03 17:55:59 -08:00
Vinson Lee
56de7e222e progs/trivial: Redraw upon keypress.
(cherry picked from commit 9553a42f63)
2009-12-03 17:27:24 -08:00
Vinson Lee
34a0b22a74 progs/trivial: Redraw upon keypress.
(cherry picked from commit 3790c6a13b)
2009-12-03 17:25:00 -08:00
Vinson Lee
9e29242331 progs/glsl: Redraw upon keypress.
(cherry picked from commit 881f55236a)
2009-12-03 17:17:24 -08:00
Vinson Lee
a0ac8fc7d8 progs/util: Exit RawImageGetData early if malloc fails.
Prevents a null pointer deference later on.
(cherry picked from commit e26135a744)
2009-12-03 17:14:08 -08:00
Vinson Lee
0a6acecb35 progs/util: Fix memory leak if malloc fails in RawImageOpen.
(cherry picked from commit d36cb2396c)
2009-12-03 17:08:48 -08:00
Vinson Lee
305d4f147e progs/util: Fix memory leak if fopen fails in RawImageOpen.
(cherry picked from commit d9508e8df9)
2009-12-03 17:03:26 -08:00
Vinson Lee
772e004781 progs/util: Fix memory leak if malloc fails in tkRGBImageLoad.
(cherry picked from commit 786d539511)
2009-12-03 16:57:17 -08:00
Vinson Lee
f1172c4030 progs/util: Fix memory leak if LoadRGBImage fails.
(cherry picked from commit 041cd0e110)
2009-12-03 16:24:03 -08:00
Vinson Lee
84de1672d3 progs/util: Fix memory if LoadRGBMipmaps2 fails.
(cherry picked from commit 28b8e4bcd7)
2009-12-03 16:15:22 -08:00
Vinson Lee
4ca8e1680e progs/util: Fix memory leak if LoadYUVImage fails.
(cherry picked from commit 0e790ac353)
2009-12-03 16:03:22 -08:00
Vinson Lee
d6a993135f progs/fp: Redraw upon keypress.
(cherry picked from commit cde6643724)
2009-12-03 15:59:56 -08:00
Vinson Lee
005242f166 prog/tests: Fix MSVC build.
Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 9c3197ef0a)
2009-12-03 15:53:13 -08:00
Vinson Lee
d3208678c2 progs/tests: fix MSVC build.
Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit a8ed066858)
2009-12-03 15:50:36 -08:00
Vinson Lee
97cbf4943a progs/tests: Fix MSVC build.
(cherry picked from commit 50e113e375)
2009-12-03 15:45:18 -08:00
Vinson Lee
a99bf51bc8 progs/tests: Fix MSVC build.
(cherry picked from commit 952bf63e2c)
2009-12-03 15:35:10 -08:00
José Fonseca
28474e1225 progs/tests: Use rand() instead of random().
Forgot these on previous commit.
(cherry picked from commit 166957abeb)
2009-12-03 15:34:38 -08:00
José Fonseca
bb6e3af939 progs/tests: Use rand() instead of random().
More portable. Same implementation on Linux.
(cherry picked from commit 699260b195)
2009-12-03 15:32:45 -08:00
Vinson Lee
a38776419b progs/tests: Fix MSVC build.
(cherry picked from commit f7455ad7af)
2009-12-03 15:29:01 -08:00
Vinson Lee
791b754687 prog/tests: Fix MSVC build.
(cherry picked from commit 60b6c74583)
2009-12-03 15:24:43 -08:00
Vinson Lee
89e747920f prog/tests: Fix MSVC build.
(cherry picked from commit 96fd13c1a0)
2009-12-03 15:15:12 -08:00
Vinson Lee
5a25adb646 progs/tests: fix MSVC build.
(cherry picked from commit 9c778a90ea)
2009-12-03 15:11:25 -08:00
Vinson Lee
3910e88ebf prog/tests: Fix MSVC build.
(cherry picked from commit ea862ec8ff)
2009-12-03 15:05:44 -08:00
Maciej Cencora
6c41bb25a2 radeon: workaround an FBO issue
Fixes #21501
2009-12-03 20:23:22 +01:00
Maciej Cencora
8cde43eb19 radeon: properly check if image should be placed in the miptree
Fixes #25355
2009-12-03 20:23:22 +01:00
Alex Deucher
2b5618fc5b r200: fix polygon stipple
fixes fdo bug 25354

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2009-12-03 11:20:40 -05:00
Vinson Lee
c3b7f93e02 scons: Add Mac OS to target platform list.
(cherry picked from commit 2c307c7750)
2009-12-02 20:33:32 -08:00
Vinson Lee
235c0c8134 progs/vpglsl: Fix psiz-mul.glsl compilation error on Mac OS.
(cherry picked from commit b98db7bf69)
2009-12-02 20:28:54 -08:00
Vinson Lee
0a107d36c2 progs/glsl: Fix trirast GLSL compilation errors on Mac OS.
(cherry picked from commit 4b3ec2acf2)
2009-12-02 20:20:12 -08:00
Vinson Lee
b094683e7c progs/glsl: Fix noise GLSL compilation error on Mac OS.
(cherry picked from commit 0d31990b47)
2009-12-02 20:16:51 -08:00
Vinson Lee
592c8522a2 demos/glsl: Add missing break statement to noise test.
(cherry picked from commit 7dfea5c072)
2009-12-02 20:16:41 -08:00
Vinson Lee
8f4d3613da progs/glsl: Fix multinoise GLSL compilation errors on Mac OS.
(cherry picked from commit d4dc2e30da)
2009-12-02 20:06:20 -08:00
Vinson Lee
9ed77d12b1 progs/glsl: Add missing break statement in multinoise.c.
(cherry picked from commit 43080e40aa)
2009-12-02 20:06:11 -08:00
Vinson Lee
832593772d progs/glsl: Fix mandelbrot GLSL compilation error on Mac OS.
(cherry picked from commit 04442841fb)
2009-12-02 19:55:48 -08:00
Vinson Lee
2a5cd95e24 progs/glsl: Include local headers before installed headers during compilation.
Fixes compilation errors on platforms with insufficient older installed
GL headers.
(cherry picked from commit d17af7d1e1)
2009-12-02 19:39:25 -08:00
Brian Paul
ccea09cd3a progs/glsl: minor Makefile clean-ups
(cherry picked from commit 4df2f7af5e)
2009-12-02 19:39:11 -08:00
Vinson Lee
67a0628ab2 progs: Ignore Mac OS dSYM directories.
(cherry picked from commit a420056750)
2009-12-02 15:22:34 -08:00
Brian Paul
908a3e56cc cell: added tex_usage param to xm_surface_buffer_create() 2009-12-02 09:31:26 -07:00
Jakob Bornecrantz
0c75854cc1 Merge commit 'mesa_7_6_branch' into mesa_7_7_branch
Conflicts:
	src/mesa/main/version.h
2009-12-02 14:52:51 +01:00
Eric Anholt
4598942b1b intel: Make RGB renderbuffers use XRGB8888 like we do for RGB system buffers. 2009-12-02 16:19:37 -08:00
Eric Anholt
db352f58fa mesa: Fix bad conversion in AL1616_REV texstore. 2009-12-02 16:19:36 -08:00
Eric Anholt
b47f7316da mesa: Fix copy'n'paste problem in al1616 texel fetch. 2009-12-02 16:19:36 -08:00
Brian Paul
ba97b98842 progs/demos: remove unused glFogCoordPointer_ext var 2009-12-01 12:23:07 -07:00
Tom Fogal
b9f4a0bd2b Simplify hackery added to fix AIX build.
Borrow an idiom from the GNU build system which can handle `for'
loops over empty lists.
2009-12-01 10:27:27 -08:00
Ian Romanick
d8da270a2b intel: Remove GL_NV_point_sprite from extension list
i830 does not (and cannot!) support the any of the non-default
GL_POINT_SPRITE_R_MODE_NV settings.  i915 and i965 could, but
currently do not.  In both cases it would require mucking about with
the fragment shader.
2009-12-01 10:25:44 -08:00
Jakob Bornecrantz
77ff3a5619 vmware/xorg: Add video support
By using the hooks st/xorg provides us we can create a driver
specific implementation that uses the svga overlay engines.
2009-12-01 17:29:42 +01:00
Jakob Bornecrantz
64102a5625 vmware/xorg: Create a small driver that sits ontop of st/xorg 2009-12-01 17:29:42 +01:00
Jakob Bornecrantz
bb80a93c9e st/xorg: Create winsys hooks that we call into 2009-12-01 17:29:41 +01:00
Jakob Bornecrantz
232e59ca6f vmware/core: Update vmwgfx_drm.h to latest version 2009-12-01 17:29:41 +01:00
Jakob Bornecrantz
9077ddaa25 svga: Add header files for overlay support 2009-12-01 17:29:40 +01:00
Eric Anholt
a7e4a311e9 intel: Fix more front-buffer rendering after Brian's less flushing patch.
bcbfda71b0 left out many blit paths.
This fixes up more of them to get Blender to work again.

Bug #25030.
2009-12-02 11:58:57 -08:00
José Fonseca
b2581dcab4 wgl: Call st_swapbuffers instead of st_notify_swapbuffers.
This will get single buffer, double buffer, and
joint single/double buffer (typical in CAD applications) done right,
at least as far as the frambuffer is concerned.

There are still problems with multiple contexts using the same
framebuffer because st_framebuffer_* calls assume the framebuffer
is bound to a single context.
2009-12-02 17:05:20 +00:00
Dave Airlie
e84dddde9b Revert "radeon/r300: no need to flush the cmdbuf when changing scissors state in KMM mode"
This reverts commit 286bf89e5a.

This doesn't appear to be correct, regression so revert it.
http://bugs.freedesktop.org/show_bug.cgi?id=25193
2009-12-02 11:03:22 +10:00
Brian Paul
c8cdce6657 vbo: make flush recursion check code per-context
This fixes invalid failed assertions when running multi-threaded apps.
2009-12-01 13:27:32 -07:00
Brian Paul
8c26cefec7 st/mesa: updated emit_swz() comment 2009-12-01 12:23:28 -07:00
Ian Romanick
910aaed4da mesa: set version string to 7.6.1-rc2 2009-11-30 17:55:21 -08:00
51 changed files with 2036 additions and 161 deletions

View File

@@ -182,7 +182,7 @@ ultrix-gcc:
# Rules for making release tarballs
VERSION=7.7-devel
VERSION=7.7-rc2
DIRECTORY = Mesa-$(VERSION)
LIB_NAME = MesaLib-$(VERSION)
DEMO_NAME = MesaDemos-$(VERSION)

View File

@@ -1143,7 +1143,14 @@ yes)
GALLIUM_STATE_TRACKERS_DIRS=glx
;;
dri)
test "x$enable_egl" = xyes && GALLIUM_STATE_TRACKERS_DIRS=egl
GALLIUM_STATE_TRACKERS_DIRS="dri"
if test "x$enable_egl" = xyes; then
GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS egl"
fi
# Have only tested st/xorg on 1.6.0 servers
PKG_CHECK_MODULES(XORG, [xorg-server >= 1.6.0],
HAVE_XORG="yes"; GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS xorg",
HAVE_XORG="no")
;;
esac
;;
@@ -1206,13 +1213,15 @@ dnl
dnl Gallium Intel configuration
dnl
AC_ARG_ENABLE([gallium-intel],
[AS_HELP_STRING([--disable-gallium-intel],
[build gallium intel @<:@default=enabled@:>@])],
[AS_HELP_STRING([--enable-gallium-intel],
[build gallium intel @<:@default=disabled@:>@])],
[enable_gallium_intel="$enableval"],
[enable_gallium_intel=yes])
[enable_gallium_intel=auto])
if test "x$enable_gallium_intel" = xyes; then
GALLIUM_WINSYS_DRM_DIRS="$GALLIUM_WINSYS_DRM_DIRS intel"
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS i915"
elif test "x$enable_gallium_intel" = xauto; then
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS i915"
fi
dnl

View File

@@ -56,6 +56,8 @@ tbd
<li>Fixed clipping / provoking vertex bugs in i965 driver.
<li>Assorted build fixes for AIX.
<li>Endianness fixes for the DRI swrast driver (bug 22767).</li>
<li>Point sprite fixes for i915/945 driver.
<li>Fixed assorted memory leaks (usually on error paths)
</ul>
<h2>Changes</h2>

View File

@@ -4,7 +4,7 @@ TOP = ..
include $(TOP)/configs/current
SUBDIRS = "$(strip "$(PROGRAM_DIRS)")"
SUBDIRS = $(PROGRAM_DIRS)
default: message subdirs
@@ -15,22 +15,18 @@ message:
subdirs:
@if test -n "$(SUBDIRS)" ; then \
for dir in $(SUBDIRS) ; do \
if [ -d $$dir ] ; then \
(cd $$dir && $(MAKE)) || exit 1 ; \
fi \
done \
fi
@list='$(SUBDIRS)'; for dir in $$list ; do \
if [ -d $$dir ] ; then \
(cd $$dir && $(MAKE)) || exit 1 ; \
fi \
done
# Dummy install target
install:
clean:
-@if test -n "$(SUBDIRS)" ; then \
for dir in $(SUBDIRS) tests ; do \
if [ -d $$dir ] ; then \
(cd $$dir && $(MAKE) clean) ; \
fi \
done \
fi
@list='$(SUBDIRS)'; for dir in $$list tests ; do \
if [ -d $$dir ] ; then \
(cd $$dir && $(MAKE) clean) ; \
fi \
done

View File

@@ -15,8 +15,6 @@
#define DEPTH 5.0f
static PFNGLFOGCOORDPOINTEREXTPROC glFogCoordPointer_ext;
static GLfloat camz;
static GLint fogMode;

View File

@@ -248,6 +248,7 @@ loadImageTextures(void)
free(texData3);
free(texData4);
free(image);
}
}

View File

@@ -17,6 +17,7 @@ SOURCES = \
tri-depth2.c \
tri-depthwrite.c \
tri-depthwrite2.c \
tri-inv.c \
tri-param.c \
fp-tri.c

View File

@@ -56,7 +56,7 @@ static void Key(unsigned char key, int x, int y)
case 27:
exit(1);
default:
return;
break;
}
glutPostRedisplay();

View File

@@ -10,7 +10,7 @@ LIB_DEP = $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) $(TOP)/$(LIB_DIR)/$(GLU_LIB_NAME) $(T
LIBS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLEW_LIB) -l$(GLU_LIB) -l$(GL_LIB) $(APP_LIB_DEPS)
PROGS = accum bitmap1 bitmap2 blendeq blendxor copy cursor depth eval fog \
font line logo nurb olympic overlay point prim quad select \
font line logo nurb olympic overlay point prim rgbtoppm quad select \
shape sphere star stencil stretch texture tri wave

View File

@@ -86,7 +86,8 @@ static ImageRec *ImageOpen(char *fileName)
exit(1);
}
if ((image->file = fopen(fileName, "rb")) == NULL) {
return NULL;
free(image);
return NULL;
}
fread(image, 1, 12, image->file);
@@ -224,6 +225,7 @@ read_rgb_texture(char *name, int *width, int *height)
if (gbuf) free(gbuf);
if (bbuf) free(bbuf);
if (abuf) free(abuf);
ImageClose(image);
return NULL;
}
ptr = base;

View File

@@ -162,7 +162,7 @@ MeasureDownloadRate(void)
const int image_bytes = align(w * h * BytesPerTexel(Format), ALIGN);
const int bytes = image_bytes * NR_TEXOBJ;
GLubyte *orig_texImage, *orig_getImage;
GLubyte *texImage, *getImage;
GLubyte *texImage;
GLdouble t0, t1, time;
int count;
int i;
@@ -184,7 +184,6 @@ MeasureDownloadRate(void)
printf("alloc %p %p\n", orig_texImage, orig_getImage);
texImage = (GLubyte *)align((unsigned long)orig_texImage, ALIGN);
getImage = (GLubyte *)align((unsigned long)orig_getImage, ALIGN);
for (i = 1; !(((unsigned long)texImage) & i); i<<=1)
;

View File

@@ -84,9 +84,9 @@ static void check_link(GLuint prog)
static void setup_uniforms()
{
{
GLuint loc1f = glGetUniformLocationARB(program, "Offset1f");
GLuint loc2f = glGetUniformLocationARB(program, "Offset2f");
GLuint loc4f = glGetUniformLocationARB(program, "Offset4f");
GLint loc1f = glGetUniformLocationARB(program, "Offset1f");
GLint loc2f = glGetUniformLocationARB(program, "Offset2f");
GLint loc4f = glGetUniformLocationARB(program, "Offset4f");
GLfloat vecKer[] =
{ 1.0, 0.0, 0.0, 1.0,
0.0, 1.0, 0.0, 1.0,
@@ -105,9 +105,9 @@ static void setup_uniforms()
}
{
GLuint loc1f = glGetUniformLocationARB(program, "KernelValue1f");
GLuint loc2f = glGetUniformLocationARB(program, "KernelValue2f");
GLuint loc4f = glGetUniformLocationARB(program, "KernelValue4f");
GLint loc1f = glGetUniformLocationARB(program, "KernelValue1f");
GLint loc2f = glGetUniformLocationARB(program, "KernelValue2f");
GLint loc4f = glGetUniformLocationARB(program, "KernelValue4f");
GLfloat vecKer[] =
{ 1.0, 0.0, 0.0, 0.25,
0.0, 1.0, 0.0, 0.25,

View File

@@ -401,6 +401,10 @@ print_screen_info(Display *dpy, int scrnum, Bool allowDirect, GLboolean limits)
root = RootWindow(dpy, scrnum);
/*
* Find a basic GLX visual. We'll then create a rendering context and
* query various info strings.
*/
visinfo = glXChooseVisual(dpy, scrnum, attribSingle);
if (!visinfo)
visinfo = glXChooseVisual(dpy, scrnum, attribDouble);
@@ -409,24 +413,29 @@ print_screen_info(Display *dpy, int scrnum, Bool allowDirect, GLboolean limits)
ctx = glXCreateContext( dpy, visinfo, NULL, allowDirect );
#ifdef GLX_VERSION_1_3
{
/* Try glXChooseFBConfig() if glXChooseVisual didn't work.
* XXX when would that happen?
*/
if (!visinfo) {
int fbAttribSingle[] = {
GLX_RENDER_TYPE, GLX_RGBA_BIT,
GLX_RED_SIZE, 1,
GLX_GREEN_SIZE, 1,
GLX_BLUE_SIZE, 1,
GLX_DOUBLEBUFFER, GL_TRUE,
GLX_DOUBLEBUFFER, GL_FALSE,
None };
int fbAttribDouble[] = {
GLX_RENDER_TYPE, GLX_RGBA_BIT,
GLX_RED_SIZE, 1,
GLX_GREEN_SIZE, 1,
GLX_BLUE_SIZE, 1,
GLX_DOUBLEBUFFER, GL_TRUE,
None };
GLXFBConfig *configs = NULL;
int nConfigs;
if (!visinfo)
configs = glXChooseFBConfig(dpy, scrnum, fbAttribSingle, &nConfigs);
if (!configs)
configs = glXChooseFBConfig(dpy, scrnum, fbAttribDouble, &nConfigs);
if (configs) {

View File

@@ -35,4 +35,4 @@ include ../../Makefile.template
.PHONY : $(COMPILER_ARCHIVE)
$(COMPILER_ARCHIVE):
cd $(TOP)/src/mesa/drivers/dri/r300/compiler; make
$(MAKE) -C $(TOP)/src/mesa/drivers/dri/r300/compiler

View File

@@ -0,0 +1,89 @@
/**********************************************************
* Copyright 2007-2009 VMware, 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, sublicense, and/or sell copies
* of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
**********************************************************/
/*
* svga_escape.h --
*
* Definitions for our own (vendor-specific) SVGA Escape commands.
*/
#ifndef _SVGA_ESCAPE_H_
#define _SVGA_ESCAPE_H_
/*
* Namespace IDs for the escape command
*/
#define SVGA_ESCAPE_NSID_VMWARE 0x00000000
#define SVGA_ESCAPE_NSID_DEVEL 0xFFFFFFFF
/*
* Within SVGA_ESCAPE_NSID_VMWARE, we multiplex commands according to
* the first DWORD of escape data (after the nsID and size). As a
* guideline we're using the high word and low word as a major and
* minor command number, respectively.
*
* Major command number allocation:
*
* 0000: Reserved
* 0001: SVGA_ESCAPE_VMWARE_LOG (svga_binary_logger.h)
* 0002: SVGA_ESCAPE_VMWARE_VIDEO (svga_overlay.h)
* 0003: SVGA_ESCAPE_VMWARE_HINT (svga_escape.h)
*/
#define SVGA_ESCAPE_VMWARE_MAJOR_MASK 0xFFFF0000
/*
* SVGA Hint commands.
*
* These escapes let the SVGA driver provide optional information to
* he host about the state of the guest or guest applications. The
* host can use these hints to make user interface or performance
* decisions.
*
* Notes:
*
* - SVGA_ESCAPE_VMWARE_HINT_FULLSCREEN is deprecated for guests
* that use the SVGA Screen Object extension. Instead of sending
* this escape, use the SVGA_SCREEN_FULLSCREEN_HINT flag on your
* Screen Object.
*/
#define SVGA_ESCAPE_VMWARE_HINT 0x00030000
#define SVGA_ESCAPE_VMWARE_HINT_FULLSCREEN 0x00030001 // Deprecated
typedef
struct {
uint32 command;
uint32 fullscreen;
struct {
int32 x, y;
} monitorPosition;
} SVGAEscapeHintFullscreen;
#endif /* _SVGA_ESCAPE_H_ */

View File

@@ -0,0 +1,201 @@
/**********************************************************
* Copyright 2007-2009 VMware, 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, sublicense, and/or sell copies
* of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
**********************************************************/
/*
* svga_overlay.h --
*
* Definitions for video-overlay support.
*/
#ifndef _SVGA_OVERLAY_H_
#define _SVGA_OVERLAY_H_
#include "svga_reg.h"
/*
* Video formats we support
*/
#define VMWARE_FOURCC_YV12 0x32315659 // 'Y' 'V' '1' '2'
#define VMWARE_FOURCC_YUY2 0x32595559 // 'Y' 'U' 'Y' '2'
#define VMWARE_FOURCC_UYVY 0x59565955 // 'U' 'Y' 'V' 'Y'
typedef enum {
SVGA_OVERLAY_FORMAT_INVALID = 0,
SVGA_OVERLAY_FORMAT_YV12 = VMWARE_FOURCC_YV12,
SVGA_OVERLAY_FORMAT_YUY2 = VMWARE_FOURCC_YUY2,
SVGA_OVERLAY_FORMAT_UYVY = VMWARE_FOURCC_UYVY,
} SVGAOverlayFormat;
#define SVGA_VIDEO_COLORKEY_MASK 0x00ffffff
#define SVGA_ESCAPE_VMWARE_VIDEO 0x00020000
#define SVGA_ESCAPE_VMWARE_VIDEO_SET_REGS 0x00020001
/* FIFO escape layout:
* Type, Stream Id, (Register Id, Value) pairs */
#define SVGA_ESCAPE_VMWARE_VIDEO_FLUSH 0x00020002
/* FIFO escape layout:
* Type, Stream Id */
typedef
struct SVGAEscapeVideoSetRegs {
struct {
uint32 cmdType;
uint32 streamId;
} header;
// May include zero or more items.
struct {
uint32 registerId;
uint32 value;
} items[1];
} SVGAEscapeVideoSetRegs;
typedef
struct SVGAEscapeVideoFlush {
uint32 cmdType;
uint32 streamId;
} SVGAEscapeVideoFlush;
/*
* Struct definitions for the video overlay commands built on
* SVGAFifoCmdEscape.
*/
typedef
struct {
uint32 command;
uint32 overlay;
} SVGAFifoEscapeCmdVideoBase;
typedef
struct {
SVGAFifoEscapeCmdVideoBase videoCmd;
} SVGAFifoEscapeCmdVideoFlush;
typedef
struct {
SVGAFifoEscapeCmdVideoBase videoCmd;
struct {
uint32 regId;
uint32 value;
} items[1];
} SVGAFifoEscapeCmdVideoSetRegs;
typedef
struct {
SVGAFifoEscapeCmdVideoBase videoCmd;
struct {
uint32 regId;
uint32 value;
} items[SVGA_VIDEO_NUM_REGS];
} SVGAFifoEscapeCmdVideoSetAllRegs;
/*
*----------------------------------------------------------------------
*
* VMwareVideoGetAttributes --
*
* Computes the size, pitches and offsets for YUV frames.
*
* Results:
* TRUE on success; otherwise FALSE on failure.
*
* Side effects:
* Pitches and offsets for the given YUV frame are put in 'pitches'
* and 'offsets' respectively. They are both optional though.
*
*----------------------------------------------------------------------
*/
static INLINE Bool
VMwareVideoGetAttributes(const SVGAOverlayFormat format, // IN
uint32 *width, // IN / OUT
uint32 *height, // IN / OUT
uint32 *size, // OUT
uint32 *pitches, // OUT (optional)
uint32 *offsets) // OUT (optional)
{
int tmp;
*width = (*width + 1) & ~1;
if (offsets) {
offsets[0] = 0;
}
switch (format) {
case VMWARE_FOURCC_YV12:
*height = (*height + 1) & ~1;
*size = (*width + 3) & ~3;
if (pitches) {
pitches[0] = *size;
}
*size *= *height;
if (offsets) {
offsets[1] = *size;
}
tmp = ((*width >> 1) + 3) & ~3;
if (pitches) {
pitches[1] = pitches[2] = tmp;
}
tmp *= (*height >> 1);
*size += tmp;
if (offsets) {
offsets[2] = *size;
}
*size += tmp;
break;
case VMWARE_FOURCC_YUY2:
case VMWARE_FOURCC_UYVY:
*size = *width * 2;
if (pitches) {
pitches[0] = *size;
}
*size *= *height;
break;
default:
return FALSE;
}
return TRUE;
}
#endif // _SVGA_OVERLAY_H_

View File

@@ -72,19 +72,7 @@ stw_flush_frontbuffer(struct pipe_screen *screen,
return;
}
#if DEBUG
{
/* ensure that a random surface was not passed to us */
struct pipe_surface *surface2;
if(!st_get_framebuffer_surface( fb->stfb, ST_SURFACE_FRONT_LEFT, &surface2 ))
assert(0);
else
assert(surface2 == surface);
}
#endif
stw_framebuffer_present_locked(hdc, fb, ST_SURFACE_FRONT_LEFT);
stw_framebuffer_present_locked(hdc, fb, surface);
}

View File

@@ -475,8 +475,6 @@ DrvPresentBuffers(HDC hdc, PGLPRESENTBUFFERSDATA data)
struct stw_framebuffer *fb;
struct pipe_screen *screen;
struct pipe_surface *surface;
unsigned surface_index;
BOOL ret = FALSE;
fb = stw_framebuffer_from_hdc( hdc );
if (fb == NULL)
@@ -484,9 +482,7 @@ DrvPresentBuffers(HDC hdc, PGLPRESENTBUFFERSDATA data)
screen = stw_dev->screen;
surface_index = (unsigned)(uintptr_t)data->pPrivateData;
if(!st_get_framebuffer_surface( fb->stfb, surface_index, &surface ))
goto fail;
surface = (struct pipe_surface *)data->pPrivateData;
#ifdef DEBUG
if(stw_dev->trace_running) {
@@ -520,15 +516,11 @@ DrvPresentBuffers(HDC hdc, PGLPRESENTBUFFERSDATA data)
stw_dev->stw_winsys->present( screen, surface, hdc );
}
ret = TRUE;
fail:
stw_framebuffer_update(fb);
stw_framebuffer_release(fb);
return ret;
return TRUE;
}
@@ -540,7 +532,7 @@ fail:
BOOL
stw_framebuffer_present_locked(HDC hdc,
struct stw_framebuffer *fb,
unsigned surface_index)
struct pipe_surface *surface)
{
if(stw_dev->callbacks.wglCbPresentBuffers &&
stw_dev->stw_winsys->compose) {
@@ -551,7 +543,7 @@ stw_framebuffer_present_locked(HDC hdc,
data.magic2 = 0;
data.AdapterLuid = stw_dev->AdapterLuid;
data.rect = fb->client_rect;
data.pPrivateData = (void *)(uintptr_t)surface_index;
data.pPrivateData = (void *)surface;
stw_framebuffer_release(fb);
@@ -559,13 +551,6 @@ stw_framebuffer_present_locked(HDC hdc,
}
else {
struct pipe_screen *screen = stw_dev->screen;
struct pipe_surface *surface;
if(!st_get_framebuffer_surface( fb->stfb, surface_index, &surface )) {
/* FIXME: this shouldn't happen, but does on glean */
stw_framebuffer_release(fb);
return FALSE;
}
#ifdef DEBUG
if(stw_dev->trace_running) {
@@ -590,6 +575,7 @@ DrvSwapBuffers(
HDC hdc )
{
struct stw_framebuffer *fb;
struct pipe_surface *surface = NULL;
fb = stw_framebuffer_from_hdc( hdc );
if (fb == NULL)
@@ -600,12 +586,9 @@ DrvSwapBuffers(
return TRUE;
}
/* If we're swapping the buffer associated with the current context
* we have to flush any pending rendering commands first.
*/
st_notify_swapbuffers( fb->stfb );
st_swapbuffers(fb->stfb, &surface, NULL);
return stw_framebuffer_present_locked(hdc, fb, ST_SURFACE_BACK_LEFT);
return stw_framebuffer_present_locked(hdc, fb, surface);
}

View File

@@ -34,6 +34,7 @@
#include "pipe/p_thread.h"
struct pipe_surface;
struct stw_pixelformat_info;
/**
@@ -140,7 +141,7 @@ stw_framebuffer_allocate(
BOOL
stw_framebuffer_present_locked(HDC hdc,
struct stw_framebuffer *fb,
unsigned surface_index);
struct pipe_surface *surface);
void
stw_framebuffer_update(

View File

@@ -652,6 +652,9 @@ drv_screen_init(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
if (serverGeneration == 1)
xf86ShowUnusedOptions(pScrn->scrnIndex, pScrn->options);
if (ms->winsys_screen_init)
ms->winsys_screen_init(pScrn);
return drv_enter_vt(scrnIndex, 1);
}
@@ -768,6 +771,9 @@ drv_close_screen(int scrnIndex, ScreenPtr pScreen)
drv_leave_vt(scrnIndex, 0);
}
if (ms->winsys_screen_close)
ms->winsys_screen_close(pScrn);
#ifdef DRI2
if (ms->screen)
xorg_dri2_close(pScreen);

View File

@@ -114,6 +114,11 @@ typedef struct _modesettingRec
Bool noEvict;
Bool debug_fallback;
/* winsys hocks */
Bool (*winsys_screen_init)(ScrnInfoPtr pScr);
Bool (*winsys_screen_close)(ScrnInfoPtr pScr);
void *winsys_priv;
#ifdef DRM_MODE_FEATURE_DIRTYFB
DamagePtr damage;
#endif

View File

@@ -45,7 +45,8 @@
#define DRM_VMW_UNREF_DMABUF 10
#define DRM_VMW_FIFO_DEBUG 11
#define DRM_VMW_FENCE_WAIT 12
#define DRM_VMW_OVERLAY 13
#define DRM_VMW_CURSOR_BYPASS 14
/*************************************************************************/
/**
@@ -439,4 +440,99 @@ struct drm_vmw_fence_wait_arg {
int32_t pad64;
};
/*************************************************************************/
/**
* DRM_VMW_OVERLAY - Control overlays.
*
* This IOCTL controls the overlay units of the svga device.
* The SVGA overlay units does not work like regular hardware units in
* that they do not automaticaly read back the contents of the given dma
* buffer. But instead only read back for each call to this ioctl, and
* at any point between this call being made and a following call that
* either changes the buffer or disables the stream.
*/
/**
* struct drm_vmw_rect
*
* Defines a rectangle. Used in the overlay ioctl to define
* source and destination rectangle.
*/
struct drm_vmw_rect {
int32_t x;
int32_t y;
uint32_t w;
uint32_t h;
};
/**
* struct drm_vmw_overlay_arg
*
* @stream_id: Stearm to control
* @enabled: If false all following arguments are ignored.
* @handle: Handle to buffer for getting data from.
* @format: Format of the overlay as understood by the host.
* @width: Width of the overlay.
* @height: Height of the overlay.
* @size: Size of the overlay in bytes.
* @pitch: Array of pitches, the two last are only used for YUV12 formats.
* @offset: Offset from start of dma buffer to overlay.
* @src: Source rect, must be within the defined area above.
* @dst: Destination rect, x and y may be negative.
*
* Argument to the DRM_VMW_OVERLAY Ioctl.
*/
struct drm_vmw_overlay_arg {
uint32_t stream_id;
uint32_t enabled;
uint32_t flags;
uint32_t color_key;
uint32_t handle;
uint32_t offset;
int32_t format;
uint32_t size;
uint32_t width;
uint32_t height;
uint32_t pitch[3];
uint32_t pad64;
struct drm_vmw_rect src;
struct drm_vmw_rect dst;
};
/*************************************************************************/
/**
* DRM_VMW_CURSOR_BYPASS - Give extra information about cursor bypass.
*
*/
#define DRM_VMW_CURSOR_BYPASS_ALL (1 << 0)
#define DRM_VMW_CURSOR_BYPASS_FLAGS (1)
/**
* struct drm_vmw_cursor_bypass_arg
*
* @flags: Flags.
* @crtc_id: Crtc id, only used if DMR_CURSOR_BYPASS_ALL isn't passed.
* @xpos: X position of cursor.
* @ypos: Y position of cursor.
* @xhot: X hotspot.
* @yhot: Y hotspot.
*
* Argument to the DRM_VMW_CURSOR_BYPASS Ioctl.
*/
struct drm_vmw_cursor_bypass_arg {
uint32_t flags;
uint32_t crtc_id;
int32_t xpos;
int32_t ypos;
int32_t xhot;
int32_t yhot;
};
#endif

View File

@@ -1,10 +1,17 @@
TARGET = vmwgfx_drv.so
CFILES = $(wildcard ./*.c)
OBJECTS = $(patsubst ./%.c,./%.o,$(CFILES))
TOP = ../../../../../..
include $(TOP)/configs/current
TARGET = vmwgfx_drv.so
CFILES = \
vmw_xorg.c \
vmw_video.c \
vmw_ioctl.c \
vmw_screen.c
OBJECTS = $(patsubst %.c,%.o,$(CFILES))
INCLUDES = \
$(shell pkg-config --cflags-only-I pixman-1 xorg-server libdrm xproto) \
-I$(TOP)/src/gallium/include \
@@ -24,6 +31,7 @@ LINKS = \
$(shell pkg-config --libs libdrm)
DRIVER_DEFINES = \
-std=gnu99 \
-DHAVE_CONFIG_H
TARGET_STAGING = $(TOP)/$(LIB_DIR)/gallium/$(TARGET)

View File

@@ -0,0 +1,90 @@
/**********************************************************
* Copyright 2009 VMware, 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, sublicense, and/or sell copies
* of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
**********************************************************/
/**
* @file
* Contains the shared resources for VMware Xorg driver
* that sits ontop of the Xorg State Traker.
*
* It is initialized in vmw_screen.c.
*
* @author Jakob Bornecrantz <jakob@vmware.com>
*/
#ifndef VMW_DRIVER_H_
#define VMW_DRIVER_H_
#include "state_trackers/xorg/xorg_tracker.h"
struct vmw_dma_buffer;
struct vmw_driver
{
int fd;
void *cursor_priv;
/* vmw_video.c */
void *video_priv;
};
static INLINE struct vmw_driver *
vmw_driver(ScrnInfoPtr pScrn)
{
modesettingPtr ms = modesettingPTR(pScrn);
return ms ? (struct vmw_driver *)ms->winsys_priv : NULL;
}
/***********************************************************************
* vmw_video.c
*/
Bool vmw_video_init(ScrnInfoPtr pScrn, struct vmw_driver *vmw);
Bool vmw_video_close(ScrnInfoPtr pScrn, struct vmw_driver *vmw);
/***********************************************************************
* vmw_ioctl.c
*/
int vmw_ioctl_cursor_bypass(struct vmw_driver *vmw, int xhot, int yhot);
struct vmw_dma_buffer * vmw_ioctl_buffer_create(struct vmw_driver *vmw,
uint32_t size,
unsigned *handle);
void * vmw_ioctl_buffer_map(struct vmw_driver *vmw,
struct vmw_dma_buffer *buf);
void vmw_ioctl_buffer_unmap(struct vmw_driver *vmw,
struct vmw_dma_buffer *buf);
void vmw_ioctl_buffer_destroy(struct vmw_driver *vmw,
struct vmw_dma_buffer *buf);
#endif

View File

@@ -0,0 +1,39 @@
/**********************************************************
* Copyright 2009 VMware, 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, sublicense, and/or sell copies
* of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
**********************************************************/
#ifndef VMW_HOOK_H_
#define VMW_HOOK_H_
#include "state_trackers/xorg/xorg_winsys.h"
/***********************************************************************
* vmw_screen.c
*/
void vmw_screen_set_functions(ScrnInfoPtr pScrn);
#endif

View File

@@ -0,0 +1,157 @@
/**********************************************************
* Copyright 2009 VMware, 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, sublicense, and/or sell copies
* of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
**********************************************************/
/**
* @file
* Contains the functions for creating dma buffers by calling
* the kernel via driver specific ioctls.
*
* @author Jakob Bornecrantz <jakob@vmware.com>
*/
#define HAVE_STDINT_H
#define _FILE_OFFSET_BITS 64
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <sys/mman.h>
#include "xf86drm.h"
#include "../core/vmwgfx_drm.h"
#include "vmw_driver.h"
#include "util/u_debug.h"
struct vmw_dma_buffer
{
void *data;
unsigned handle;
uint64_t map_handle;
unsigned map_count;
uint32_t size;
};
int
vmw_ioctl_cursor_bypass(struct vmw_driver *vmw, int xhot, int yhot)
{
struct drm_vmw_cursor_bypass_arg arg;
int ret;
memset(&arg, 0, sizeof(arg));
arg.flags = DRM_VMW_CURSOR_BYPASS_ALL;
arg.xhot = xhot;
arg.yhot = yhot;
ret = drmCommandWrite(vmw->fd, DRM_VMW_CURSOR_BYPASS,
&arg, sizeof(arg));
return ret;
}
struct vmw_dma_buffer *
vmw_ioctl_buffer_create(struct vmw_driver *vmw, uint32_t size, unsigned *handle)
{
struct vmw_dma_buffer *buf;
union drm_vmw_alloc_dmabuf_arg arg;
struct drm_vmw_alloc_dmabuf_req *req = &arg.req;
struct drm_vmw_dmabuf_rep *rep = &arg.rep;
int ret;
buf = xcalloc(1, sizeof(*buf));
if (!buf)
goto err;
memset(&arg, 0, sizeof(arg));
req->size = size;
do {
ret = drmCommandWriteRead(vmw->fd, DRM_VMW_ALLOC_DMABUF, &arg, sizeof(arg));
} while (ret == -ERESTART);
if (ret) {
debug_printf("IOCTL failed %d: %s\n", ret, strerror(-ret));
goto err_free;
}
buf->data = NULL;
buf->handle = rep->handle;
buf->map_handle = rep->map_handle;
buf->map_count = 0;
buf->size = size;
*handle = rep->handle;
return buf;
err_free:
xfree(buf);
err:
return NULL;
}
void
vmw_ioctl_buffer_destroy(struct vmw_driver *vmw, struct vmw_dma_buffer *buf)
{
struct drm_vmw_unref_dmabuf_arg arg;
if (buf->data) {
munmap(buf->data, buf->size);
buf->data = NULL;
}
memset(&arg, 0, sizeof(arg));
arg.handle = buf->handle;
drmCommandWrite(vmw->fd, DRM_VMW_UNREF_DMABUF, &arg, sizeof(arg));
xfree(buf);
}
void *
vmw_ioctl_buffer_map(struct vmw_driver *vmw, struct vmw_dma_buffer *buf)
{
void *map;
if (buf->data == NULL) {
map = mmap(NULL, buf->size, PROT_READ | PROT_WRITE, MAP_SHARED,
vmw->fd, buf->map_handle);
if (map == MAP_FAILED) {
debug_printf("%s: Map failed.\n", __FUNCTION__);
return NULL;
}
buf->data = map;
}
++buf->map_count;
return buf->data;
}
void
vmw_ioctl_buffer_unmap(struct vmw_driver *vmw, struct vmw_dma_buffer *buf)
{
--buf->map_count;
}

View File

@@ -0,0 +1,154 @@
/**********************************************************
* Copyright 2009 VMware, 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, sublicense, and/or sell copies
* of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
**********************************************************/
/**
* @file
* Contains the init code for the VMware Xorg driver.
*
* @author Jakob Bornecrantz <jakob@vmware.com>
*/
#include "vmw_hook.h"
#include "vmw_driver.h"
/* modified version of crtc functions */
xf86CrtcFuncsRec vmw_screen_crtc_funcs;
static void
vmw_screen_cursor_load_argb(xf86CrtcPtr crtc, CARD32 *image)
{
struct vmw_driver *vmw = modesettingPTR(crtc->scrn)->winsys_priv;
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(crtc->scrn);
xf86CrtcFuncsPtr funcs = vmw->cursor_priv;
CursorPtr c = config->cursor;
/* Run the ioctl before uploading the image */
vmw_ioctl_cursor_bypass(vmw, c->bits->xhot, c->bits->yhot);
funcs->load_cursor_argb(crtc, image);
}
static void
vmw_screen_cursor_init(ScrnInfoPtr pScrn, struct vmw_driver *vmw)
{
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
int i;
/* XXX assume that all crtc's have the same function struct */
/* Save old struct need to call the old functions as well */
vmw->cursor_priv = (void*)(config->crtc[0]->funcs);
memcpy(&vmw_screen_crtc_funcs, vmw->cursor_priv, sizeof(xf86CrtcFuncsRec));
vmw_screen_crtc_funcs.load_cursor_argb = vmw_screen_cursor_load_argb;
for (i = 0; i < config->num_crtc; i++)
config->crtc[i]->funcs = &vmw_screen_crtc_funcs;
}
static void
vmw_screen_cursor_close(ScrnInfoPtr pScrn, struct vmw_driver *vmw)
{
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
int i;
vmw_ioctl_cursor_bypass(vmw, 0, 0);
for (i = 0; i < config->num_crtc; i++)
config->crtc[i]->funcs = vmw->cursor_priv;
}
static Bool
vmw_screen_init(ScrnInfoPtr pScrn)
{
modesettingPtr ms = modesettingPTR(pScrn);
struct vmw_driver *vmw;
vmw = xnfcalloc(sizeof(*vmw), 1);
if (!vmw)
return FALSE;
vmw->fd = ms->fd;
ms->winsys_priv = vmw;
vmw_screen_cursor_init(pScrn, vmw);
/* if gallium is used then we don't need to do anything more. */
if (ms->screen)
return TRUE;
vmw_video_init(pScrn, vmw);
return TRUE;
}
static Bool
vmw_screen_close(ScrnInfoPtr pScrn)
{
modesettingPtr ms = modesettingPTR(pScrn);
struct vmw_driver *vmw = vmw_driver(pScrn);
if (!vmw)
return TRUE;
vmw_screen_cursor_close(pScrn, vmw);
vmw_video_close(pScrn, vmw);
ms->winsys_priv = NULL;
xfree(vmw);
return TRUE;
}
/*
* Functions for setting up hooks into the xorg state tracker
*/
static Bool (*vmw_screen_pre_init_saved)(ScrnInfoPtr pScrn, int flags) = NULL;
static Bool
vmw_screen_pre_init(ScrnInfoPtr pScrn, int flags)
{
modesettingPtr ms;
pScrn->PreInit = vmw_screen_pre_init_saved;
if (!pScrn->PreInit(pScrn, flags))
return FALSE;
ms = modesettingPTR(pScrn);
ms->winsys_screen_init = vmw_screen_init;
ms->winsys_screen_close = vmw_screen_close;
return TRUE;
}
void
vmw_screen_set_functions(ScrnInfoPtr pScrn)
{
assert(!vmw_screen_pre_init_saved);
vmw_screen_pre_init_saved = pScrn->PreInit;
pScrn->PreInit = vmw_screen_pre_init;
}

File diff suppressed because it is too large Load Diff

View File

@@ -31,7 +31,7 @@
* @author Jakob Bornecrantz <wallbraker@gmail.com>
*/
#include "state_trackers/xorg/xorg_winsys.h"
#include "vmw_hook.h"
static void vmw_xorg_identify(int flags);
static Bool vmw_xorg_pci_probe(DriverPtr driver,
@@ -145,6 +145,8 @@ vmw_xorg_pci_probe(DriverPtr driver,
/* Use all the functions from the xorg tracker */
xorg_tracker_set_functions(scrn);
vmw_screen_set_functions(scrn);
}
return scrn != NULL;
}

View File

@@ -291,6 +291,7 @@ xm_surface_buffer_create(struct pipe_winsys *winsys,
unsigned width, unsigned height,
enum pipe_format format,
unsigned usage,
unsigned tex_usage,
unsigned *stride)
{
const unsigned alignment = 64;

View File

@@ -121,7 +121,6 @@ static const struct dri_extension card_extensions[] = {
{ "GL_MESA_pack_invert", NULL },
{ "GL_MESA_ycbcr_texture", NULL },
{ "GL_NV_blend_square", NULL },
{ "GL_NV_point_sprite", GL_NV_point_sprite_functions },
{ "GL_NV_vertex_program", GL_NV_vertex_program_functions },
{ "GL_NV_vertex_program1_1", NULL },
{ "GL_SGIS_generate_mipmap", NULL },

View File

@@ -336,6 +336,8 @@ out:
unpack->BufferObj);
}
intel_check_front_buffer_rendering(intel);
return GL_TRUE;
}

View File

@@ -222,6 +222,8 @@ do_blit_copypixels(GLcontext * ctx,
out:
UNLOCK_HARDWARE(intel);
intel_check_front_buffer_rendering(intel);
DBG("%s: success\n", __FUNCTION__);
return GL_TRUE;
}

View File

@@ -325,9 +325,9 @@ GLboolean r200CreateContext( const __GLcontextModes *glVisual,
_mesa_init_driver_functions(&functions);
r200InitDriverFuncs(&functions);
r200InitIoctlFuncs(&functions);
r200InitStateFuncs(&functions, screen->kernel_mm);
r200InitStateFuncs(&functions);
r200InitTextureFuncs(&functions);
r200InitShaderFuncs(&functions);
r200InitShaderFuncs(&functions);
radeonInitQueryObjFunctions(&functions);
if (!radeonInitContext(&rmesa->radeon, &functions,

View File

@@ -2476,7 +2476,7 @@ static void r200PolygonStipple( GLcontext *ctx, const GLubyte *mask )
}
/* Initialize the driver's state functions.
*/
void r200InitStateFuncs( struct dd_function_table *functions, GLboolean dri2 )
void r200InitStateFuncs( struct dd_function_table *functions )
{
functions->UpdateState = r200InvalidateState;
functions->LightingSpaceChange = r200LightingSpaceChange;
@@ -2510,10 +2510,7 @@ void r200InitStateFuncs( struct dd_function_table *functions, GLboolean dri2 )
functions->LogicOpcode = r200LogicOpCode;
functions->PolygonMode = r200PolygonMode;
functions->PolygonOffset = r200PolygonOffset;
if (dri2)
functions->PolygonStipple = r200PolygonStipple;
else
functions->PolygonStipple = radeonPolygonStipplePreKMS;
functions->PolygonStipple = r200PolygonStipple;
functions->PointParameterfv = r200PointParameter;
functions->PointSize = r200PointSize;
functions->RenderMode = r200RenderMode;

View File

@@ -38,7 +38,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "r200_context.h"
extern void r200InitState( r200ContextPtr rmesa );
extern void r200InitStateFuncs( struct dd_function_table *functions, GLboolean dri2 );
extern void r200InitStateFuncs( struct dd_function_table *functions );
extern void r200InitTnlFuncs( GLcontext *ctx );
extern void r200UpdateMaterial( GLcontext *ctx );

View File

@@ -887,10 +887,8 @@ void r200InitState( r200ContextPtr rmesa )
}
}
}
/* polygon stipple is done with irq for non-kms */
if (rmesa->radeon.radeonScreen->kernel_mm) {
ALLOC_STATE( stp, always, STP_STATE_SIZE, "STP/stp", 0 );
}
ALLOC_STATE( stp, always, STP_STATE_SIZE, "STP/stp", 0 );
for (i = 0; i < 6; i++)
if (rmesa->radeon.radeonScreen->kernel_mm)
@@ -1122,12 +1120,11 @@ void r200InitState( r200ContextPtr rmesa )
rmesa->hw.sci.cmd[SCI_CMD_1] = CP_PACKET0(R200_RE_TOP_LEFT, 0);
rmesa->hw.sci.cmd[SCI_CMD_2] = CP_PACKET0(R200_RE_WIDTH_HEIGHT, 0);
rmesa->hw.stp.cmd[STP_CMD_0] = CP_PACKET0(RADEON_RE_STIPPLE_ADDR, 0);
rmesa->hw.stp.cmd[STP_DATA_0] = 0;
rmesa->hw.stp.cmd[STP_CMD_1] = CP_PACKET0_ONE(RADEON_RE_STIPPLE_DATA, 31);
if (rmesa->radeon.radeonScreen->kernel_mm) {
rmesa->hw.stp.cmd[STP_CMD_0] = CP_PACKET0(RADEON_RE_STIPPLE_ADDR, 0);
rmesa->hw.stp.cmd[STP_DATA_0] = 0;
rmesa->hw.stp.cmd[STP_CMD_1] = CP_PACKET0_ONE(RADEON_RE_STIPPLE_DATA, 31);
rmesa->hw.mtl[0].emit = mtl_emit;
rmesa->hw.mtl[1].emit = mtl_emit;

View File

@@ -1741,8 +1741,7 @@ static void r300Enable(GLcontext * ctx, GLenum cap, GLboolean state)
r300SetPolygonOffsetState(ctx, state);
break;
case GL_SCISSOR_TEST:
if (!rmesa->radeon.radeonScreen->kernel_mm)
radeon_firevertices(&rmesa->radeon);
radeon_firevertices(&rmesa->radeon);
rmesa->radeon.state.scissor.enabled = state;
radeonUpdateScissor( ctx );
break;

View File

@@ -257,36 +257,11 @@ void radeonScissor(GLcontext* ctx, GLint x, GLint y, GLsizei w, GLsizei h)
radeonContextPtr radeon = RADEON_CONTEXT(ctx);
if (ctx->Scissor.Enabled) {
/* We don't pipeline cliprect changes */
if (!radeon->radeonScreen->kernel_mm) {
radeon_firevertices(radeon);
}
radeon_firevertices(radeon);
radeonUpdateScissor(ctx);
}
}
void radeonPolygonStipplePreKMS( GLcontext *ctx, const GLubyte *mask )
{
radeonContextPtr radeon = RADEON_CONTEXT(ctx);
GLuint i;
drm_radeon_stipple_t stipple;
/* Must flip pattern upside down.
*/
for ( i = 0 ; i < 32 ; i++ ) {
stipple.mask[31 - i] = ((GLuint *) mask)[i];
}
/* TODO: push this into cmd mechanism
*/
radeon_firevertices(radeon);
LOCK_HARDWARE( radeon );
drmCommandWrite( radeon->dri.fd, DRM_RADEON_STIPPLE,
&stipple, sizeof(stipple) );
UNLOCK_HARDWARE( radeon );
}
/* ================================================================
* SwapBuffers with client-side throttling
*/

View File

@@ -10,7 +10,6 @@ void radeonRecalcScissorRects(radeonContextPtr radeon);
void radeonSetCliprects(radeonContextPtr radeon);
void radeonUpdateScissor( GLcontext *ctx );
void radeonScissor(GLcontext* ctx, GLint x, GLint y, GLsizei w, GLsizei h);
void radeonPolygonStipplePreKMS( GLcontext *ctx, const GLubyte *mask );
void radeonWaitForIdleLocked(radeonContextPtr radeon);
extern uint32_t radeonGetAge(radeonContextPtr radeon);

View File

@@ -331,8 +331,12 @@ struct r100_hw_state {
struct radeon_state_atom stp;
};
struct radeon_stipple_state {
GLuint mask[32];
};
struct r100_state {
struct radeon_stipple_state stipple;
struct radeon_texture_state texture;
};

View File

@@ -369,6 +369,12 @@ radeon_framebuffer_renderbuffer(GLcontext * ctx,
}
/* TODO: According to EXT_fbo spec internal format of texture image
* once set during glTexImage call, should be preserved when
* attaching image to renderbuffer. When HW doesn't support
* rendering to format of attached image, set framebuffer
* completeness accordingly in radeon_validate_framebuffer (issue #79).
*/
static GLboolean
radeon_update_wrapper(GLcontext *ctx, struct radeon_renderbuffer *rrb,
struct gl_texture_image *texImage)

View File

@@ -421,9 +421,12 @@ static void migrate_image_to_miptree(radeon_mipmap_tree *mt,
radeon_mipmap_level *srclvl = &image->mt->levels[image->mtlevel];
/* TODO: bring back these assertions once the FBOs are fixed */
#if 0
assert(image->mtlevel == level);
assert(srclvl->size == dstlvl->size);
assert(srclvl->rowstride == dstlvl->rowstride);
#endif
radeon_bo_map(image->mt->bo, GL_FALSE);
@@ -434,23 +437,18 @@ static void migrate_image_to_miptree(radeon_mipmap_tree *mt,
radeon_miptree_unreference(&image->mt);
} else {
/* need to confirm this value is correct */
if (_mesa_is_format_compressed(image->base.TexFormat)) {
unsigned size = _mesa_format_image_size(image->base.TexFormat,
image->base.Width,
image->base.Height,
image->base.Depth);
memcpy(dest, image->base.Data, size);
} else {
uint32_t srcrowstride;
uint32_t height;
const uint32_t srcrowstride = _mesa_format_row_stride(image->base.TexFormat, image->base.Width);
uint32_t rows = image->base.Height * image->base.Depth;
height = image->base.Height * image->base.Depth;
srcrowstride = image->base.Width * _mesa_get_format_bytes(image->base.TexFormat);
copy_rows(dest, dstlvl->rowstride, image->base.Data, srcrowstride,
height, srcrowstride);
if (_mesa_is_format_compressed(image->base.TexFormat)) {
uint32_t blockWidth, blockHeight;
_mesa_get_format_block_size(image->base.TexFormat, &blockWidth, &blockHeight);
rows = (rows + blockHeight - 1) / blockHeight;
}
copy_rows(dest, dstlvl->rowstride, image->base.Data, srcrowstride,
rows, srcrowstride);
_mesa_free_texmemory(image->base.Data);
image->base.Data = 0;
}

View File

@@ -550,6 +550,31 @@ static void radeonPolygonOffset( GLcontext *ctx,
rmesa->hw.zbs.cmd[ZBS_SE_ZBIAS_CONSTANT] = constant.ui32;
}
static void radeonPolygonStipplePreKMS( GLcontext *ctx, const GLubyte *mask )
{
r100ContextPtr rmesa = R100_CONTEXT(ctx);
GLuint i;
drm_radeon_stipple_t stipple;
/* Must flip pattern upside down.
*/
for ( i = 0 ; i < 32 ; i++ ) {
rmesa->state.stipple.mask[31 - i] = ((GLuint *) mask)[i];
}
/* TODO: push this into cmd mechanism
*/
radeon_firevertices(&rmesa->radeon);
LOCK_HARDWARE( &rmesa->radeon );
/* FIXME: Use window x,y offsets into stipple RAM.
*/
stipple.mask = rmesa->state.stipple.mask;
drmCommandWrite( rmesa->radeon.dri.fd, DRM_RADEON_STIPPLE,
&stipple, sizeof(drm_radeon_stipple_t) );
UNLOCK_HARDWARE( &rmesa->radeon );
}
static void radeonPolygonMode( GLcontext *ctx, GLenum face, GLenum mode )
{
r100ContextPtr rmesa = R100_CONTEXT(ctx);

View File

@@ -515,15 +515,18 @@ static int image_matches_texture_obj(struct gl_texture_object *texObj,
struct gl_texture_image *texImage,
unsigned level)
{
const struct gl_texture_image *baseImage = texObj->Image[0][level];
const struct gl_texture_image *baseImage = texObj->Image[0][texObj->BaseLevel];
if (!baseImage)
return 0;
if (level < texObj->BaseLevel || level > texObj->MaxLevel)
return 0;
const unsigned levelDiff = level - texObj->BaseLevel;
const unsigned refWidth = baseImage->Width >> levelDiff;
const unsigned refHeight = baseImage->Height >> levelDiff;
const unsigned refDepth = baseImage->Depth >> levelDiff;
const unsigned refWidth = MAX2(baseImage->Width >> levelDiff, 1);
const unsigned refHeight = MAX2(baseImage->Height >> levelDiff, 1);
const unsigned refDepth = MAX2(baseImage->Depth >> levelDiff, 1);
return (texImage->Width == refWidth &&
texImage->Height == refHeight &&

View File

@@ -864,7 +864,7 @@ static void store_texel_al88_rev(struct gl_texture_image *texImage,
static void FETCH(f_al1616)( const struct gl_texture_image *texImage,
GLint i, GLint j, GLint k, GLfloat *texel )
{
const GLuint s = *TEXEL_ADDR(GLushort, texImage, i, j, k, 1);
const GLuint s = *TEXEL_ADDR(GLuint, texImage, i, j, k, 1);
texel[RCOMP] =
texel[GCOMP] =
texel[BCOMP] = USHORT_TO_FLOAT( s & 0xffff );

View File

@@ -2197,18 +2197,22 @@ _mesa_texstore_al1616(TEXSTORE_PARAMS)
GLuint *dstUI = (GLuint *) dstRow;
if (dstFormat == MESA_FORMAT_AL1616) {
for (col = 0; col < srcWidth; col++) {
/* src[0] is luminance, src[1] is alpha */
dstUI[col] = PACK_COLOR_1616( FLOAT_TO_USHORT(src[1]),
FLOAT_TO_USHORT(src[0]) );
src += 2;
GLushort l, a;
UNCLAMPED_FLOAT_TO_USHORT(l, src[0]);
UNCLAMPED_FLOAT_TO_USHORT(a, src[1]);
dstUI[col] = PACK_COLOR_1616(a, l);
src += 2;
}
}
else {
for (col = 0; col < srcWidth; col++) {
/* src[0] is luminance, src[1] is alpha */
dstUI[col] = PACK_COLOR_1616_REV( FLOAT_TO_UBYTE(src[1]),
FLOAT_TO_UBYTE(src[0]) );
src += 2;
GLushort l, a;
UNCLAMPED_FLOAT_TO_USHORT(l, src[0]);
UNCLAMPED_FLOAT_TO_USHORT(a, src[1]);
dstUI[col] = PACK_COLOR_1616_REV(a, l);
src += 2;
}
}
dstRow += dstRowStride;

View File

@@ -32,7 +32,7 @@
#define MESA_MAJOR 7
#define MESA_MINOR 7
#define MESA_PATCH 0
#define MESA_VERSION_STRING "7.7-rc1"
#define MESA_VERSION_STRING "7.7-rc2"
/* To make version comparison easy */
#define MESA_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))

View File

@@ -278,7 +278,7 @@ static struct ureg_src swizzle_4v( struct ureg_src src,
/**
* Translate SWZ instructions into a single MAD. EG:
* Translate a SWZ instruction into a MOV, MUL or MAD instruction. EG:
*
* SWZ dst, src.x-y10
*

View File

@@ -138,6 +138,10 @@ struct vbo_exec_context
*/
const struct gl_client_array *inputs[VERT_ATTRIB_MAX];
} array;
#ifdef DEBUG
GLint flush_call_depth;
#endif
};

View File

@@ -876,9 +876,8 @@ void vbo_exec_FlushVertices( GLcontext *ctx, GLuint flags )
#ifdef DEBUG
/* debug check: make sure we don't get called recursively */
static GLuint callDepth = 0;
callDepth++;
assert(callDepth == 1);
exec->flush_call_depth++;
assert(exec->flush_call_depth == 1);
#endif
if (0) _mesa_printf("%s\n", __FUNCTION__);
@@ -886,7 +885,8 @@ void vbo_exec_FlushVertices( GLcontext *ctx, GLuint flags )
if (exec->ctx->Driver.CurrentExecPrimitive != PRIM_OUTSIDE_BEGIN_END) {
if (0) _mesa_printf("%s - inside begin/end\n", __FUNCTION__);
#ifdef DEBUG
callDepth--;
exec->flush_call_depth--;
assert(exec->flush_call_depth == 0);
#endif
return;
}
@@ -903,7 +903,8 @@ void vbo_exec_FlushVertices( GLcontext *ctx, GLuint flags )
exec->ctx->Driver.NeedFlush &= ~flags;
#ifdef DEBUG
callDepth--;
exec->flush_call_depth--;
assert(exec->flush_call_depth == 0);
#endif
}