Compare commits

..

130 Commits

Author SHA1 Message Date
Julien Cristau
d89cf0649e Add bug closer for #408679. 2008-02-24 10:23:17 +01:00
Julien Cristau
31e9d9d4f8 Prepare changelog for upload. 2008-02-23 18:18:42 +01:00
Julien Cristau
ea9c6d3d9e 03_optional-progs-and-install.patch: partly applied upstream, fixed up 2008-02-23 16:08:53 +01:00
Julien Cristau
eaac94c35a Update changelog. 2008-02-22 12:16:27 +01:00
Julien Cristau
9291506af0 Merge branch 'mesa_7_0_branch' of git.freedesktop.org:/git/mesa/mesa into debian-unstable
Conflicts:

	src/glx/mini/Makefile
2008-02-22 12:09:35 +01:00
Brian
4716670de9 prep for 7.0.3 rc-2 2008-02-21 16:59:20 -07:00
Brian
33c5b38034 latest bug fixes 2008-02-20 09:39:59 -07:00
Brian
5737d6c565 Fix point rasterization regression caused by commit 95a2eb9767
Even-sized, non-AA points need 0.5 bias in position to hit the right pixels.
Test program from bug report 11016 retested and is OK.
2008-02-20 09:38:16 -07:00
Brian
08a7f56c6a raise GL_INVALID_OPERATION if glProgramString compilation fails
cherry picked from master.
2008-02-20 09:00:49 -07:00
Brian
7916f2b4aa Fix glBegin-time test for invalid programs/shaders.
Cherry picked from master.
2008-02-20 08:56:20 -07:00
Brian
193d303ac7 Added <size name="Get" mode="get"/> lines for point parameter tokens.
Cherry picked from master
2008-02-19 08:46:39 -07:00
Jeremy Huddleston
e70609b7b8 Apple: Pulled in changes from Apple's patchset to allow mesa to build on darwin again 2008-02-19 00:54:35 -08:00
Xiang, Haihao
da476ff02d i965: new integrated graphics chipset support 2008-02-19 15:59:50 +08:00
Brian
77e3b5d28b Fix potential glDrawPixels(GL_DEPTH_COMPONENT) crashes (bug 13915)
Also, general clean-up of the Xlib-optimized glDraw/CopyPixels code.
2008-02-16 09:56:26 -07:00
Brian
bf97ca448c Fix glBindTexture crash (bug 14514) 2008-02-15 13:42:19 -07:00
Roland Scheidegger
c5f8ff8b32 fix bug with generated fragment programs if vertex shader is active
When generating a fragment program from fixed function, checking
texUnit->_ReallyEnabled is not sufficient, need texUnit->Enabled too
since the former also represents texture enables from an active vertex
shader.
2008-02-15 17:26:58 +01:00
caner
50465766d1 miniglx doc updates 2008-02-14 09:34:08 -07:00
Xiang, Haihao
7d8df58a63 _mesa_swizzle_ubyt_image: Don't use single swizzle_copy call
if components don't match. fix #13508
2008-02-13 07:07:47 -07:00
Andy Skinner
762c074012 added -altopts to allow overriding all other opts 2008-02-07 13:19:55 -07:00
Brian
51f2ee3bfb fix bug 9871 2008-02-06 07:55:26 -07:00
Brian
b5cd34aa21 Fix bug 9871: enable user-defined clip planes for R300
Patch provided by Erkin Bahceci <erkinbah@gmail.com>
2008-02-06 07:54:24 -07:00
Tony DeFeo
ae5c6dcd42 [965] Fix memory leak when deleting buffers with backing store. 2008-02-05 10:49:44 -08:00
Roland Scheidegger
97196d0c8c regenerate glsl library functions 2008-01-31 01:36:23 +01:00
Roland Scheidegger
f6de56b88a fix w component of glsl vec4 asin 2008-01-31 01:35:52 +01:00
Brian
d64ea43b76 fix bugs 13507, 14293 2008-01-30 08:12:06 -07:00
Brian
2deaf93d24 check if fb->Delete is null (bugs 13507,14293) 2008-01-30 08:12:06 -07:00
Alex Deucher
a107ec8300 Add new RV380 pci id
bug 14289
(cherry picked from commit 80efe27560)
2008-01-29 10:15:32 -05:00
Alex Deucher
120a1f9508 Merge branch 'mesa_7_0_branch' of git+ssh://agd5f@git.freedesktop.org/git/mesa/mesa into mesa_7_0_branch 2008-01-29 09:50:26 -05:00
Alex Deucher
bb84007a57 R300: RV410 SE chips have half the pipes of regular RV410
This fixes 3D rendering on x700 SE chips.  Reported
by Kano.
(cherry picked from commit 0b7e0f8159)
2008-01-29 09:46:48 -05:00
Alan Hourihane
86234e55a6 pull some more fixes for pbo access from trunk 2008-01-28 11:23:53 +00:00
Alan Hourihane
61972077cd fix some pbo path problems 2008-01-28 11:15:53 +00:00
Xiang, Haihao
5a7feb8ea2 i965: valid message length includes message header. 2008-01-25 17:23:55 +08:00
Xiang, Haihao
4b4c131cd0 i965: re-define the type of reg.loopcount.
avoid some issues such that 1 + (-2) gets a big
positive value.
2008-01-25 17:23:15 +08:00
Julien Cristau
67617c8f89 Drop -O0 workaround on hppa.
Stop building with -O0 on hppa. Bug #451047 should be fixed in recent gcc
versions.
2008-01-24 22:52:48 +01:00
Brian
0fd23f01c6 Assorted patches for miniglx/linux-solo (Gavin Li <codeview@gmail.com>) 2008-01-23 16:04:02 -07:00
Adam Jackson
557b0d9df7 glxinfo: Fix multisample visual reporting.
strstr() == 0 tests for the string _not_ being present.  Originally
Red Hat bug #351871.
2008-01-22 14:04:39 -07:00
Brian
888f4380cf fix GLX vertex array bug 14197 2008-01-22 08:41:22 -07:00
Brian
3266c5e95a fix pc vs. gc->ps usage (bug 14197) 2008-01-22 08:38:48 -07:00
Brian
834decdaae Don't build yuvrect_client by default
Added 'extra' rule to build optional yuvrect_client, shape, xdemo programs
2008-01-22 07:56:31 -07:00
Brian
18b2d83173 remove unused var 2008-01-22 07:54:37 -07:00
Alexey Sokolov
30c65c3c62 define M_PI if needed 2008-01-22 07:42:40 -07:00
Brian
04fcc4cf1e prep for 7.0.3 release 2008-01-21 16:21:39 -07:00
Julien Cristau
09504dde1f Update changelog; add Vcs-* and Homepage fields in debian/control. 2008-01-17 22:26:48 +01:00
Julien Cristau
c04885f072 Merge branch 'mesa_7_0_branch' of git://anongit.freedesktop.org/git/mesa/mesa into debian-unstable
Conflicts:

	progs/tests/.gitignore
	progs/tests/Makefile
2008-01-14 22:30:03 +01:00
Michel Dänzer
48ae5cf09d i965: Fix byte vs. pixel unit mixup for aligned texture pitch.
I sincerely hope I don't manage to mess this up yet again...

Thanks again to Todd Merrill for pointing out the problem and testing the fix
on IRC.
2008-01-14 16:30:58 +01:00
Michel Dänzer
45cdb6eb45 i965: Fix unresolved symbol intel_miptree_pitch_align.
For some reason, I thought that function was shared with i915tex... The good
news is that i965 gets to keep the lower pitch alignment requirements.

Thanks to Todd Merrill for pointing out the problem on IRC.
2008-01-11 16:32:39 +01:00
Keith Packard
b9f3f732aa i915tex: Centralize mipmap pitch computations.
mipmap pitches must account for the device alignment requirements, which
used to be fairly simple; just align to a 4-byte boundary. However, to allow
textures to be drawn to under TTM, they now need to be aligned to a 64-byte
boundary. Placing all of the alignment constraints in a single function
allows this new constraint to be applied uniformly.

There was some pitch constraining code in intel_miptree_create, but that was
modifying the pitch long after the miptree had been layed out, so it only
served to wreck the mipmap and cause rendering errors.

(cherry picked from commit a183efc132 with manual
changes for mesa_7_0_branch by Michel Dänzer. One side effect of this is that
i965 also aligns the pitch of 2D textures to multiples of 64 bytes, hopefully
that won't cause any issues)
2008-01-08 16:48:13 +01:00
Brian
17006ddd6b fix 3d proxy texture depth bug 2008-01-05 15:44:51 -07:00
Brian
b77a354df3 fix depth/1 typo in glTexImage3D proxy code 2008-01-05 15:44:51 -07:00
Brian
71d46beebf additional stub functions 2008-01-02 07:23:41 -07:00
Brian
454e296eb1 additional GL_COLOR_ATTACHMENTx_EXT cases (bug 13767) 2008-01-02 07:20:08 -07:00
Brian
f9b696be2b fix vbo display list memleak upon context destruction 2008-01-01 10:23:56 -07:00
Brian
c923edbc71 additional GL_COLOR_ATTACHMENTx_EXT cases (bug 13767) 2008-01-01 10:10:18 -07:00
Brian
e20c1d987f fix GLSL uniform/attrib bugs (13753) 2008-01-01 09:59:51 -07:00
Bruce Merry
cd354eb10f Convert to 0/1 when setting boolean uniforms
Also add some extra tests to the shader_api regression tests
2008-01-01 09:59:51 -07:00
Bruce Merry
e9ac27ee23 Make use of count in _mesa_uniform_matrix 2008-01-01 09:59:50 -07:00
Bruce Merry
3f9dc9f5b6 Add a test program to test for assorted bugs in shader_api.c 2008-01-01 09:59:50 -07:00
Bruce Merry
ba709875ae More fixes to shader_api
- return GL_INVALID_OPERATION instead of GL_INVALID_VALUE if location is bad
- correct the type-checking of uniforms from my previous commit
- accept location of -1 in _mesa_uniform_matrix
2008-01-01 09:59:50 -07:00
Bruce Merry
80f8397b35 Fix several bugs relating to uniforms and attributes in GLSL API
- fix sizes for GL_FLOAT_MAT2x3 and GL_FLOAT_MAT4x3 in sizeof_glsl_type
- fix size returns in _mesa_get_active_attrib
- fix out-of-bounds array access to vec_types in _mesa_get_active_attrib
- fix queries of matrix uniforms in _mesa_get_uniformfv
- fix _mesa_get_uniformfv to only return one base, even from an array
- allow location == -1 in _mesa_uniform
- validate types in _mesa_uniform
- allow array overruns in _mesa_uniform
2008-01-01 09:59:50 -07:00
Brian
b45fa27fa1 added 'get' info for framebuffer object tokens 2008-01-01 09:26:30 -07:00
Brian
b59480645d add 'Get' info for MAX_3D_TEXTURE_SIZE (for bug 13811) 2008-01-01 09:04:13 -07:00
Brian
148cb36979 add missing double quote (bug 13878) 2008-01-01 07:59:58 -07:00
Roland Scheidegger
c1eb78f7ff fix GL_LINE_LOOP with drivers using own render pipeline stage (#12410, #13527)
primitive needs to include the begin/end flags (broken since vbo-0.2). Should
fix missing first/last line segment on gamma, i810, i915, mga, r200, radeon,
s3v, savage, unichrome (r300 already correct). Tested on r200, fixes #13527.
2007-12-22 18:49:42 +01:00
Brian
8aa0fd6b20 glGetActiveUniform fix 2007-12-20 09:08:12 -07:00
Brian
a1b3a908f5 return correct size from glGetActiveUniform (bug 13751) 2007-12-20 09:08:12 -07:00
Xiang, Haihao
f9e70d951a i965: allocate GRF registers before building subroutines,
it ensures there are sufficient registers for all subroutines.
2007-12-19 10:44:00 +08:00
Xiang, Haihao
41ed6be1da i965: restore the flag after building the subroutine of the
GS thread. fix #13240
2007-12-19 10:36:56 +08:00
Brian
27de28fc3e Remove -I$(TOP)/src/mesa/transform 2007-12-18 17:07:11 -07:00
Brian
dd2f01c229 simplify update two-side lighting test (follow-on to previous front/back-face changes) 2007-12-18 16:28:36 -07:00
Brian
deb5c56c77 fix NEED_SECONDARY_COLOR for vert/frag progs 2007-12-18 16:28:36 -07:00
Julien Cristau
9fd22f0e3f Prepare changelog for upload. 2007-12-18 19:13:27 +01:00
Julien Cristau
942372dcdf debian/control fixups
* Bump Standards-Version to 3.7.3.
* Move libgl1-mesa-swx11-dbg, mesa-common-dev and libosmesa6-dev to section
  libdevel.
* libgl1-mesa-swx11 conflicts with libgl1-mesa-glx.  Move it and
  libgl1-mesa-swx11-dev to priority extra.
* Fix typo in mesa-common-dev's long description.
2007-12-18 13:57:06 +01:00
Julien Cristau
b7f901088b Update changelog. 2007-12-18 13:32:01 +01:00
Julien Cristau
c02990525c Merge branch 'mesa_7_0_branch' of git.freedesktop.org:/git/mesa/mesa into debian-unstable
Conflicts:

	progs/trivial/quad-clip-nearplane.c
2007-12-18 12:28:29 +01:00
Michel Dänzer
0107acded0 i915tex: Fix issues with glDrawBuffer(GL_NONE).
Don't dereference NULL renderbuffer pointer, and make sure the software
fallback sticks.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=13694 .
2007-12-17 12:32:26 +01:00
Brian
2ac5e08d1d fix polygon cull regression 2007-12-14 14:36:23 -07:00
Dan Nicholson
1837b8c214 configs: Fix linking with static libGL and --as-needed
Linking of the programs breaks when using a static libGL and the GNU ld
option --as-needed. This is because libXext is needed for the XShm
functions.
(cherry picked from commit 6aaf9bdd41)
2007-12-07 11:51:18 -08:00
Brian
03d2bc1774 fix gl_FrontFacing 2007-12-04 14:07:15 -07:00
Brian
385bddbde0 fix span->facing computation and gl_FrontFacing initialization 2007-12-04 14:07:15 -07:00
Brian
c135426267 Fix gl_FrontFacing compilation problem 2007-12-04 14:07:15 -07:00
Michel Dänzer
4be0c98120 Use -Bsymbolic for linking all shared objects.
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=10132 .

Also remove comment about SONAME, as SONAME only applies to shared libraries.
(cherry picked from commit fc7ddea853)
2007-12-04 18:33:07 +01:00
Brian
e760aebd5a fix two-side lighting bug/crash 2007-12-03 14:13:08 -07:00
Brian
1f6e7d9c29 fix DD_TRI_LIGHT_TWOSIDE bug (#13368) 2007-12-03 14:12:34 -07:00
Dan Nicholson
c6d421af05 Fix the library name in glw.pc
Fix a copy and paste error s/GLU/GLw/ in glw.pc.
(cherry picked from commit 2dc85e8078)
2007-12-03 12:08:03 -08:00
Brian
952df5e493 fix two-sided stencil 2007-12-03 12:00:21 -07:00
Brian
45acb8b058 added missing quote char 2007-12-03 12:00:21 -07:00
Michel Dänzer
e8997c0183 i915tex: Fix up state changes for i8xx.
(cherry picked from commit 2af613e0b8)
2007-12-03 09:38:13 +01:00
Brian
169e62f563 fix-build: remove ctx->_Facing assignment 2007-11-30 15:52:41 -07:00
Brian
1b43babfb1 fix broken two-sided stencil 2007-11-30 13:01:42 -07:00
Brian
43e902f774 better front-plane clip test 2007-11-30 09:09:12 -07:00
Xiang, Haihao
b0a800e249 i965: use uncompressed instruction to ensure only
Pixel Mask Copy is modified as the pixel shader thread
turns off pixels based on kill instructions.
2007-11-30 12:36:07 +08:00
Brian
73d5f232ad New ctx->Driver.Map/UnmapTexture() functions for accessing textures from t_vb_program.c 2007-11-29 08:18:11 -07:00
Brian
f7209541e4 cleanups, comments
Conflicts:

	src/mesa/tnl/t_vb_program.c
2007-11-29 08:18:11 -07:00
Brian
397a32dca7 Move _mesa_load_tracked_matrices() from TNL module to prog_statevars.c 2007-11-29 08:18:11 -07:00
Roland Scheidegger
e0719d7122 make sure state token values are fully initialized 2007-11-29 03:08:48 +01:00
Michel Dänzer
3f18c0a9f2 r200: Fix texture format regression on big endian systems.
See https://bugs.freedesktop.org/show_bug.cgi?id=13324 .

Also use tx_table_be for VALID_FORMAT, in case r200SetTexImages ever gets
called for MESA_FORMAT_RGB888.
(cherry picked from commit dc88a96631)
2007-11-28 10:25:01 +01:00
Delle
b14be61938 use DEFAULT_SOFTWARE_DEPTH_BITS 2007-11-27 18:18:48 -07:00
Brian
440d620308 minor additions to avoid FAQs 2007-11-27 10:32:39 -07:00
Brian
8dd9df0f3e document GLSL float f/F suffix bug 2007-11-27 10:32:39 -07:00
Brian
6b9534eaf5 set fp->UsesKill when emitting OPCODE_KIL 2007-11-27 10:32:39 -07:00
Brian
c91d374ad7 improve 24-bit Z to 32-bit Z conversion 2007-11-27 10:32:39 -07:00
Keith Whitwell
1cab4160bc i915tex: Fix some minor batchbuffer errors. 2007-11-26 17:12:15 +01:00
Keith Whitwell
718d2dfbbd i915tex: Catch cases where not all state is emitted for a new batchbuffer.
This could lead to incorrect rendering or even lockups.
2007-11-26 17:10:26 +01:00
Michel Dänzer
0967e1270d i915tex: Some additional blit fixes and assertions. 2007-11-26 16:59:41 +01:00
Michel Dänzer
a08c02f1a8 i915tex: Actually wait for previous commands to complete for glFinish(). 2007-11-26 16:59:00 +01:00
Brian
bdfd9afead Consolidate texture fetch code and use partial derivatives when possible. 2007-11-23 12:01:39 -07:00
Brian
1c91a590d6 fix a few GLSL bugs 2007-11-23 10:28:33 -07:00
Brian
65bd7968bf Fix parsing of gl_FrontLightModelProduct.sceneColor, don't segfault on variable
array indexes.
2007-11-23 10:26:02 -07:00
Brian
6ccd23b87b need to check border width in sample_linear_2d() - fixes failed assertion in texwrap.c test 2007-11-23 09:14:27 -07:00
Brian
823409b7d0 Bump version numbers to 7.0.3 for next release 2007-11-22 09:36:35 -07:00
Brian
c85d31f4a0 Recompute ctx->Point._Size if GL_POINT_SIZE_MIN/MAX changes.
Note that all the point size clamping stuff has been redone in Mesa/master.
2007-11-22 09:36:35 -07:00
Roland Scheidegger
24af5c44da fix z buffer read/write issue with rv100-like chips and old ddx 2007-11-22 02:55:25 +01:00
Brian
75efacf8eb Initial 7.0.3 relnotes 2007-11-20 08:16:25 -07:00
Brian
825e810247 bring over Fortran fixes from master 2007-11-20 08:15:19 -07:00
Brian
e20723cfc1 Obsolete 2007-11-20 08:13:14 -07:00
Brian
9f39a67c1d Rename glut_fbc.c -> glut_fcb.c (cb=callback) 2007-11-20 08:13:03 -07:00
Brian
2044f3f791 clamp lambda to Min/MaxLod 2007-11-19 13:05:10 -07:00
Brian
30d4e8c422 fix some texture format assertions, etc 2007-11-19 10:37:41 -07:00
Brian
92d552f6a2 fix out-of-bounds array index (ix=-1) 2007-11-19 09:54:41 -07:00
Brian
5adfcbbc4f added gl_dispatch_stub_772() 2007-11-16 10:03:57 -07:00
Roland Scheidegger
69969b3819 fix position invariant vertex programs for sw-tnl
do the same math as for fixed function pipe, including
user clip planes.
(mostly resurrected from the dead t_vb_arbprogram.c code)
2007-11-15 02:06:15 +01:00
Roland Scheidegger
edfee04fcb fix bogus assumption if ddx has set up surface reg for z buffer
this is wrong since even if ddx has not set up a surface reg to cover the z
buffer we should pretend it has on those rv100 chips since they presumably do
not do z buffer tiling if not using hyperz, so we can use linear addressing
just the same. Doesn't seem to fix #13080, but it's wrong anyway and the bug
almost certainly broke newer non-tcl chips.
2007-11-15 01:16:27 +01:00
Brice Goglin
ae0bf74db9 Prepare changelog for upload 2007-11-13 21:44:00 +01:00
Julien Cristau
1bf7ce97c0 * Add build-dep on libxext-dev. Thanks, Timo Aaltonen! 2007-11-13 21:40:49 +01:00
Julien Cristau
4971a009e0 * Workaround gcc ICE on hppa: build libOSMesa with -O0 (see bug#451047). 2007-11-13 20:59:08 +01:00
Julien Cristau
e1613ab80d Don't set -fno-strict-aliasing in configs/debian-default.
Upstream uses that since 7.0.2.
2007-11-13 20:57:58 +01:00
Brian
28c9930888 add pointer to Gallium3D info 2007-11-13 09:51:14 -07:00
Brian
e3a35a123e DRI memory manager info (fixes dangling link) 2007-11-13 09:50:42 -07:00
Brian
412168f2e8 remove dependency on libGLU 2007-11-12 08:21:21 -07:00
Brian
fc0fa0d636 add glw.pc.in to tarball list, remove from DEPEND_FILES 2007-11-12 07:52:20 -07:00
151 changed files with 2173 additions and 944 deletions

View File

@@ -166,10 +166,10 @@ ultrix-gcc:
# Rules for making release tarballs
DIRECTORY = Mesa-7.0.2
LIB_NAME = MesaLib-7.0.2
DEMO_NAME = MesaDemos-7.0.2
GLUT_NAME = MesaGLUT-7.0.2
DIRECTORY = Mesa-7.0.3-rc2
LIB_NAME = MesaLib-7.0.3-rc2
DEMO_NAME = MesaDemos-7.0.3-rc2
GLUT_NAME = MesaGLUT-7.0.3-rc2
MAIN_FILES = \
$(DIRECTORY)/Makefile* \
@@ -355,6 +355,7 @@ GLW_FILES = \
$(DIRECTORY)/src/glw/*.[ch] \
$(DIRECTORY)/src/glw/Makefile* \
$(DIRECTORY)/src/glw/README \
$(DIRECTORY)/src/glw/glw.pc.in \
$(DIRECTORY)/src/glw/depend
DEMO_FILES = \
@@ -414,6 +415,7 @@ GLUT_FILES = \
$(DIRECTORY)/src/glut/fbdev/Makefile \
$(DIRECTORY)/src/glut/fbdev/*[ch] \
$(DIRECTORY)/src/glut/mini/*[ch] \
$(DIRECTORY)/src/glut/mini/glut.pc.in \
$(DIRECTORY)/src/glut/directfb/Makefile \
$(DIRECTORY)/src/glut/directfb/NOTES \
$(DIRECTORY)/src/glut/directfb/*[ch] \
@@ -424,7 +426,6 @@ DEPEND_FILES = \
$(TOP)/src/mesa/depend \
$(TOP)/src/glx/x11/depend \
$(TOP)/src/glw/depend \
$(TOP)/src/glw/glw.pc.in \
$(TOP)/src/glut/glx/depend \
$(TOP)/src/glu/sgi/depend

100
bin/mklib
View File

@@ -71,6 +71,7 @@ do
echo ' -install DIR put resulting library file(s) in DIR'
echo ' -arch ARCH override using `uname` to determine host system'
echo ' -archopt OPT specify an extra achitecture-specific option OPT'
echo ' -altopts OPTS alternate options to override all others'
echo " -noprefix don't prefix library name with 'lib' nor add any suffix"
echo ' -exports FILE only export the symbols listed in FILE'
echo ' -h, --help display this information and exit'
@@ -111,7 +112,6 @@ do
DEPS="$DEPS $1"
;;
'-pthread')
# for FreeBSD
DEPS="$DEPS -pthread"
;;
'-cplusplus')
@@ -135,6 +135,10 @@ do
shift 1;
ARCHOPT=$1
;;
'-altopts')
shift 1;
ALTOPTS=$1
;;
'-noprefix')
NOPREFIX=1
;;
@@ -209,8 +213,13 @@ case $ARCH in
if [ $NOPREFIX = 1 ] ; then
# No "lib" or ".so" part
echo "mklib: Making" $ARCH "shared library: " ${LIBNAME}
#OPTS="-shared -Wl,-soname,${LIBNAME}" # soname???
OPTS="-shared"
case $ARCH in 'Linux' | 'GNU' | GNU/*)
OPTS="-Xlinker -Bsymbolic -shared"
;;
*)
OPTS="-shared"
;;
esac
# Check if objects are 32-bit and we're running in 64-bit
# environment. If so, pass -m32 flag to linker.
@@ -220,6 +229,10 @@ case $ARCH in
OPTS="-m32 ${OPTS}"
fi
if [ "${ALTOPTS}" ] ; then
OPTS=${ALTOPTS}
fi
rm -f ${LIBNAME}
# make lib
${LINK} ${OPTS} ${LDFLAGS} -o ${LIBNAME} ${OBJECTS} ${DEPS}
@@ -230,6 +243,9 @@ case $ARCH in
echo "mklib: Making" $ARCH "static library: " ${LIBNAME}
LINK="ar"
OPTS="-ru"
if [ "${ALTOPTS}" ] ; then
OPTS=${ALTOPTS}
fi
rm -f ${LIBNAME}
# make lib
${LINK} ${OPTS} ${LIBNAME} ${OBJECTS}
@@ -265,6 +281,9 @@ case $ARCH in
if [ "${ABI32}" -a `uname -m` = "x86_64" ] ; then
OPTS="-m32 ${OPTS}"
fi
if [ "${ALTOPTS}" ] ; then
OPTS=${ALTOPTS}
fi
if [ x${PATCH} = "x" ] ; then
VERSION="${MAJOR}.${MINOR}"
@@ -347,7 +366,9 @@ case $ARCH in
if [ "${SPARCV9}" ] ; then
OPTS="${OPTS} -xarch=v9"
fi
if [ "${ALTOPTS}" ] ; then
OPTS=${ALTOPTS}
fi
# for debug:
#echo "mklib: linker is" ${LINK} ${OPTS}
if [ $NOPREFIX = 1 ] ; then
@@ -378,6 +399,9 @@ case $ARCH in
# No "lib" or ".so" part
echo "mklib: Making FreeBSD shared library: " ${LIBNAME}
OPTS="-shared"
if [ "${ALTOPTS}" ] ; then
OPTS=${ALTOPTS}
fi
rm -f ${LIBNAME}
${LINK} ${OPTS} ${LDFLAGS} -o ${LIBNAME} ${OBJECTS} ${DEPS}
FINAL_LIBS=${LIBNAME}
@@ -391,6 +415,9 @@ case $ARCH in
else
SHLIB="lib${LIBNAME}.so.${MAJOR}"
OPTS="-shared -Wl,-soname,${SHLIB}"
if [ "${ALTOPTS}" ] ; then
OPTS=${ALTOPTS}
fi
echo "mklib: Making FreeBSD shared library: " ${SHLIB}
rm -f ${SHLIB}
${LINK} ${OPTS} ${LDFLAGS} -o ${SHLIB} ${OBJECTS} ${DEPS}
@@ -444,6 +471,10 @@ case $ARCH in
exit 1
fi
if [ "${ALTOPTS}" ] ; then
OPTS=${ALTOPTS}
fi
if [ $CPLUSPLUS = 1 ] ; then
LINK="CC"
else
@@ -524,6 +555,10 @@ case $ARCH in
}
}' | sort -u >> ${EXPFILE}
if [ "${ALTOPTS}" ] ; then
OPTS=${ALTOPTS}
fi
# On AIX a shared library is linked differently when
# you want to dlopen the file
if [ $DLOPEN = "1" ] ; then
@@ -575,6 +610,9 @@ case $ARCH in
echo "mklib: Making Darwin static library: " ${LIBNAME}
LINK="ar"
OPTS="-ruvs"
if [ "${ALTOPTS}" ] ; then
OPTS=${ALTOPTS}
fi
${LINK} ${OPTS} ${LIBNAME} ${OBJECTS}
FINAL_LIBS=${LIBNAME}
else
@@ -586,19 +624,37 @@ case $ARCH in
LIBSUFFIX="dylib"
OPTS="${ARCHOPT} -dynamiclib -multiply_defined suppress -current_version ${MAJOR}.${MINOR}.0 -compatibility_version ${MAJOR}.${MINOR}.0 -install_name lib${LIBNAME}.${MAJOR}.${LIBSUFFIX}"
fi
LINKNAME="lib${LIBNAME}.${LIBSUFFIX}"
LIBNAME="lib${LIBNAME}.${MAJOR}.${LIBSUFFIX}"
if [ ${EXPORTS} ] ; then
OPTS="${OPTS} -exported_symbols_list ${EXPORTS}"
fi
LINKNAME="lib${LIBNAME}.${MAJOR}.${LIBSUFFIX}"
LINKNAME2="lib${LIBNAME}.${LIBSUFFIX}"
LIBNAME="lib${LIBNAME}.${MAJOR}.${MINOR}.${LIBSUFFIX}"
# examine first object to determine ABI
set ${OBJECTS}
ABI_PPC=`file $1 | grep 'object ppc'`
ABI_I386=`file $1 | grep 'object i386'`
if [ "${ABI_PPC}" ] ; then
OPTS="${OPTS} -arch ppc"
fi
if [ "${ABI_I386}" ] ; then
OPTS="${OPTS} -arch i386"
fi
ABI_PPC=`file $1 | grep ' ppc'`
ABI_I386=`file $1 | grep ' i386'`
ABI_PPC64=`file $1 | grep ' ppc64'`
ABI_X86_64=`file $1 | grep ' x86_64'`
if [ "${ABI_PPC}" ] ; then
OPTS="${OPTS} -arch ppc"
fi
if [ "${ABI_I386}" ] ; then
OPTS="${OPTS} -arch i386"
fi
if [ "${ABI_PPC64}" ] ; then
OPTS="${OPTS} -arch ppc64"
fi
if [ "${ABI_X86_64}" ] ; then
OPTS="${OPTS} -arch x86_64"
fi
if [ "${ALTOPTS}" ] ; then
OPTS=${ALTOPTS}
fi
# XXX can we always add -isysroot /Developer/SDKs/MacOSX10.4u.sdk
# to OPTS here?
@@ -611,9 +667,11 @@ case $ARCH in
fi
echo "mklib: Making Darwin shared library: " ${LIBNAME}
${LINK} ${OPTS} ${LDFLAGS} -o ${LIBNAME} ${OBJECTS} ${DEPS}
ln -s ${LIBNAME} ${LINKNAME}
FINAL_LIBS="${LIBNAME} ${LINKNAME}"
ln -s ${LIBNAME} ${LINKNAME2}
FINAL_LIBS="${LIBNAME} ${LINKNAME} ${LINKNAME2}"
fi
;;
@@ -665,6 +723,9 @@ case $ARCH in
echo "mklib: Making Intel ICC static library: " ${LIBNAME}.a
LINK="ar"
OPTS="-ruv"
if [ "${ALTOPTS}" ] ; then
OPTS=${ALTOPTS}
fi
# make lib
${LINK} ${OPTS} ${LIBNAME}.a ${OBJECTS}
# finish up
@@ -675,6 +736,9 @@ case $ARCH in
else
OPTS="-shared"
fi
if [ "${ALTOPTS}" ] ; then
OPTS=${ALTOPTS}
fi
VERSION="${MAJOR}.${MINOR}.${PATCH}"
echo "mklib: Making Intel ICC shared library: " ${LIBNAME}.so.${VERSION}
@@ -739,6 +803,9 @@ case $ARCH in
echo "mklib: Making" $ARCH "static library: " ${LIBNAME}.a
LINK="ar"
OPTS="-ru"
if [ "${ALTOPTS}" ] ; then
OPTS=${ALTOPTS}
fi
# make lib
${LINK} ${OPTS} ${LIBNAME}.a ${OBJECTS}
ranlib ${LIBNAME}.a
@@ -746,6 +813,9 @@ case $ARCH in
FINAL_LIBS=${LIBNAME}.a
else
OPTS="-shared -Wl,-export-all -Wl,--out-implib=${LIBNAME}-${MAJOR}.dll.a"
if [ "${ALTOPTS}" ] ; then
OPTS=${ALTOPTS}
fi
echo "mklib: Making" $ARCH "shared library: " ${LIBNAME}-${MAJOR}.dll
if [ $CPLUSPLUS = 1 ] ; then

View File

@@ -4,11 +4,19 @@ include $(TOP)/configs/default
CONFIG_NAME = darwin
DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \
-D_BSD_SOURCE -D_GNU_SOURCE \
-DGLX_INDIRECT_RENDERING \
-DPTHREADS -DGLX_ALIAS_UNSUPPORTED -DHAVE_POSIX_MEMALIGN
# Compiler and flags
CC = cc
CXX = cc
CFLAGS = -I/usr/X11R6/include -O3 -fPIC -fno-common -ffast-math -funroll-loops -fexpensive-optimizations -no-cpp-precomp -dynamic -Ddarwin
CXXFLAGS = -I/usr/X11R6/include -O3 -fPIC -fno-common -ffast-math -funroll-loops -fexpensive-optimizations -no-cpp-precomp -dynamic -Ddarwin
CC = gcc
CXX = gcc
CFLAGS = -I/usr/X11/include -O3 -fPIC -fno-common -ffast-math -funroll-loops -fexpensive-optimizations -no-cpp-precomp -dynamic -Ddarwin $(DEFINES)
CXXFLAGS = -I/usr/X11/include -O3 -fPIC -fno-common -ffast-math -funroll-loops -fexpensive-optimizations -no-cpp-precomp -dynamic -Ddarwin $(DEFINES)
CFLAGS += $(RC_CFLAGS)
CXXFLAGS += $(RC_CFLAGS)
# Work around aliasing bugs - developers should comment this out
CFLAGS += -fno-strict-aliasing
@@ -21,13 +29,12 @@ GLUT_LIB_NAME = libglut.dylib
GLW_LIB_NAME = libGLw.dylib
OSMESA_LIB_NAME = libOSMesa.dylib
GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread
GL_LIB_DEPS = -L/usr/X11/lib -lX11 -lXext -lm -lpthread
OSMESA_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -lGL
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -lGL
GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -lGL -lGLU -L/usr/X11R6/lib -lX11 -lXmu -lXi -lXext
GLW_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXt $(TOP)/lib/GL.dylib
APP_LIB_DEPS = -L$(TOP)/lib -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm
APP_LIB_DEPS = -L$(TOP)/lib -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11/lib -lX11 -lXmu -lXt -lXi -lm
# omit glw lib for now:
SRC_DIRS = mesa glu glut/glx
SRC_DIRS = glx/x11 glu glut/glx

View File

@@ -3,7 +3,6 @@
CONFIG_NAME = debian-default
OPT_FLAGS = -O2 -g
CFLAGS += -fno-strict-aliasing
# override settings in configs/linux-x86-64
LIB_DIR = lib

View File

@@ -22,4 +22,5 @@ GLUT_LIB_DEPS =
GLW_LIB_DEPS =
# Need to specify all libraries we may need
APP_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXmu -lXt -lXi -lpthread -lstdc++ -lm
APP_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXmu -lXt -lXi -lpthread \
-lstdc++ -lm

View File

@@ -20,4 +20,5 @@ OSMESA_LIB_DEPS =
GLU_LIB_DEPS =
GLUT_LIB_DEPS =
GLW_LIB_DEPS =
APP_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXmu -lXt -lXi -lpthread -lstdc++ -lm
APP_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXmu -lXt -lXi -lpthread \
-lstdc++ -lm

View File

@@ -20,4 +20,5 @@ OSMESA_LIB_DEPS =
GLU_LIB_DEPS =
GLUT_LIB_DEPS =
GLW_LIB_DEPS =
APP_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXmu -lXt -lXi -lpthread -lstdc++ -lm
APP_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXmu -lXt -lXi -lpthread \
-lstdc++ -lm

39
debian/changelog vendored
View File

@@ -1,3 +1,42 @@
mesa (7.0.3~rc2-1) unstable; urgency=low
* New upstream release candidate.
+ enable user-defined clip planes for R300 (closes: #408679)
+ 03_optional-progs-and-install.patch: partly applied upstream, fixed up
* Stop building with -O0 on hppa. Bug #451047 should be fixed in recent gcc
versions.
-- Julien Cristau <jcristau@debian.org> Sun, 24 Feb 2008 10:22:54 +0100
mesa (7.0.2-4) unstable; urgency=low
* Update to mesa_7_0_branch head (commit 48ae5cf0).
* Add Vcs-Git, Vcs-Browser and Homepage fields in debian/control.
-- Julien Cristau <jcristau@debian.org> Thu, 17 Jan 2008 22:23:06 +0100
mesa (7.0.2-3) unstable; urgency=low
* Update to mesa_7_0_branch head (commit 0107acde).
* Bump Standards-Version to 3.7.3.
* Move libgl1-mesa-swx11-dbg, mesa-common-dev and libosmesa6-dev to section
libdevel.
* libgl1-mesa-swx11 conflicts with libgl1-mesa-glx. Move it and
libgl1-mesa-swx11-dev to priority extra.
* Fix typo in mesa-common-dev's long description.
-- Julien Cristau <jcristau@debian.org> Tue, 18 Dec 2007 19:13:18 +0100
mesa (7.0.2-2) unstable; urgency=low
[ Julien Cristau ]
* Don't set -fno-strict-aliasing in configs/debian-default. It is set
upstream now.
* Workaround gcc ICE on hppa: build libOSMesa with -O0 (see bug#451047).
* Add build-dep on libxext-dev. Thanks, Timo Aaltonen!
-- Brice Goglin <bgoglin@debian.org> Tue, 13 Nov 2007 21:43:40 +0100
mesa (7.0.2-1) unstable; urgency=low
* New upstream release.

19
debian/control vendored
View File

@@ -3,11 +3,15 @@ Section: graphics
Priority: optional
Maintainer: Debian X Strike Force <debian-x@lists.debian.org>
Uploaders: Thierry Reding <thierry@gilfi.de>, Julien Cristau <jcristau@debian.org>, David Nusinow <dnusinow@debian.org>, Brice Goglin <bgoglin@debian.org>
Standards-Version: 3.7.2
Build-Depends: debhelper (>= 5), quilt (>= 0.40), pkg-config, libdrm-dev (>= 2.2.0) [!hurd-i386], libx11-dev, xutils-dev, x11proto-gl-dev (>= 1.4.8), libxxf86vm-dev, libexpat1-dev, lesstif2-dev, dpkg-dev (>= 1.13.19), libxfixes-dev, libxdamage-dev
Standards-Version: 3.7.3
Build-Depends: debhelper (>= 5), quilt (>= 0.40), pkg-config, libdrm-dev (>= 2.2.0) [!hurd-i386], libx11-dev, xutils-dev, x11proto-gl-dev (>= 1.4.8), libxxf86vm-dev, libexpat1-dev, lesstif2-dev, dpkg-dev (>= 1.13.19), libxfixes-dev, libxdamage-dev, libxext-dev
Vcs-Git: git://git.debian.org/git/pkg-xorg/lib/mesa
Vcs-Browser: http://git.debian.org/?p=pkg-xorg/lib/mesa.git
Homepage: http://mesa3d.sourceforge.net/
Package: libgl1-mesa-swx11
Section: libs
Priority: extra
Architecture: any
Depends: ${shlibs:Depends}, libosmesa6 (>= 6.5.2-1)
Conflicts: mesag3-glide, mesag3-glide2, mesag3+ggi, libgl1, nvidia-glx, mesag3, libgl1-mesa-swrast
@@ -28,7 +32,7 @@ Description: A free implementation of the OpenGL API -- runtime
On Linux, this library is also known as libGL or libGL.so.1.
Package: libgl1-mesa-swx11-dbg
Section: libs
Section: libdevel
Priority: extra
Architecture: any
Depends: libgl1-mesa-swx11 (= ${binary:Version})
@@ -78,6 +82,7 @@ Description: Mesa OpenGL runtime [i686 optimized]
Package: libgl1-mesa-swx11-dev
Section: libdevel
Priority: extra
Architecture: any
Depends: libgl1-mesa-swx11 (= ${binary:Version}), libc6-dev, libx11-dev, libxext6, mesa-common-dev (= ${source:Version})
Provides: libgl-dev, mesag-dev, libgl1-mesa-swrast-dev
@@ -229,14 +234,14 @@ Description: A free implementation of the OpenGL API -- GLX development files
package.
Package: mesa-common-dev
Section: devel
Section: libdevel
Architecture: all
Replaces: xlibmesa-gl-dev (<< 1:7), xlibosmesa-dev, libgl1-mesa-swx11-dev (<< 6.5.2), libgl1-mesa-dev (<< 6.5.2)
Depends: libx11-dev
Description: Developer documentation for Mesa
This package includes the specifications for the Mesa-specific OpenGL
extensions, the complete set of release release notes and the
development header files common to all Mesa packages.
extensions, the complete set of release notes and the development header
files common to all Mesa packages.
Package: libosmesa6
Section: libs
@@ -252,7 +257,7 @@ Description: Mesa Off-screen rendering extension
renderer which do not require external libraries to work.
Package: libosmesa6-dev
Section: devel
Section: libdevel
Architecture: any
Depends: libosmesa6 (= ${binary:Version}), mesa-common-dev (= ${source:Version}) | libgl-dev
Conflicts: xlibosmesa-dev, libosmesa4-dev, libosmesa-dev

View File

@@ -10,39 +10,31 @@ Also remove references to GLU library since it is not required
and we don't actually build it at this point.
Index: mesa/progs/xdemos/Makefile
===================================================================
--- mesa.orig/progs/xdemos/Makefile 2007-11-11 00:34:12.000000000 +0100
+++ mesa/progs/xdemos/Makefile 2007-11-11 02:07:52.000000000 +0100
@@ -6,11 +6,11 @@
--- mesa.orig/progs/xdemos/Makefile
+++ mesa/progs/xdemos/Makefile
@@ -10,7 +10,7 @@
INCDIR = $(TOP)/include
LIBS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) $(APP_LIB_DEPS)
-LIB_DEP = $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) $(TOP)/$(LIB_DIR)/$(GLU_LIB_NAME)
+LIB_DEP = $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME)
-LIBS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) $(APP_LIB_DEPS)
+LIBS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) $(APP_LIB_DEPS)
-PROGS = glthreads \
+PROGS ?= glthreads \
-PROGS = \
+PROGS ?= \
glthreads \
glxdemo \
glxgears \
glxgears_fbconfig \
@@ -46,6 +46,9 @@
@@ -55,6 +55,11 @@
extra: $(EXTRA_PROGS)
default: $(PROGS)
+install: $(PROGS)
+ $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/bin
+ $(INSTALL) -m 755 $(PROGS) $(DESTDIR)$(INSTALL_DIR)/bin
+
+
clean:
-rm -f $(PROGS)
Index: mesa/progs/Makefile
===================================================================
--- mesa.orig/progs/Makefile 2007-11-11 00:34:12.000000000 +0100
+++ mesa/progs/Makefile 2007-11-11 02:06:48.000000000 +0100
-rm -f $(PROGS) $(EXTRA_PROGS)
-rm -f *.o *~
--- mesa.orig/progs/Makefile
+++ mesa/progs/Makefile
@@ -21,8 +21,12 @@
fi \
done

View File

@@ -342,7 +342,7 @@ will fix the problem.
<h2>4.1 How can I contribute?</a></h2>
<p>
First, join the <a href="http://www.mesa3d.org/lists.html>Mesa3d-dev
First, join the <a href="http://www.mesa3d.org/lists.html">Mesa3d-dev
mailing list</a>.
That's where Mesa development is discussed.
</a></p>

View File

@@ -1,15 +1,15 @@
<html>
<html><head><title>Mesa fbdev/DRI Environment</title>
<TITLE>Mesa fbdev/DRI Environment</TITLE>
<link rel="stylesheet" type="text/css" href="mesa.css"></head>
<BODY>
<body>
<center><H1>Mesa fbdev/DRI Drivers</H1></center>
<center><h1>Mesa fbdev/DRI Drivers</h1></center>
<br>
<H1>1. Introduction</H1>
<h1>1. Introduction</h1>
<p>
The fbdev/DRI environment supports hardware-accelerated 3D rendering without
@@ -22,54 +22,131 @@ Contributors to this project include Jon Smirl, Keith Whitwell and Dave Airlie.
<p>
Applications in the fbdev/DRI environment use
the <a href="MiniGXL.html"> MiniGLX</a> interface to choose pixel
the <a href="http://www.nabble.com/file/p15480666/MiniGXL.html"> MiniGLX</a> interface to choose pixel
formats, create rendering contexts, etc. It's a subset of the GLX and
Xlib interfaces allowing some degree of application portability between
the X and X-less environments.
</p>
<p>
Some of the files needed for building this configuration are not included
in the normal Mesa releases so you'll need to get the latest sources
sources from the <a href="repository.html">git repository</a>.
Note that this environment is not well-supported and these instructions
may not be completely up to date.
</p>
<br>
<h1>2. Compilation</h1>
<p>
You'll need the DRM and pciaccess libraries. Check with:
<h2>2.1 glxproto</h2>
Get <a href="http://cvsweb.xfree86.org/cvsweb/*checkout*/xc/include/GL/glxproto.h?rev=1.9">glxproto.h</a>. Copy it to the /mesa/include/GL/ directory.
</p>
<pre>
pkg-config --modversion libdrm
pkg-config --modversion pciaccess
<h2>2.2 libpciaccess</h2>
<p>
Check if you have libpciaccess installed:
</p>
<pre>pkg-config --modversion pciaccess
</pre>
<p>
If not you can download the latest code from:
</p>
<pre> git clone git://anongit.freedesktop.org/git/xorg/lib/libpciaccess
</pre>
<p>
Run autogen.sh to generate a configure file. autogen.sh uses autoconf
utility. This utility may not be installed with your linux distro,
check if it is available. if not you can use your package manager or
type:
</p>
<pre>sudo apt-get install autoconf
</pre>
The next step is to install the libpciaccess library.
<pre>make
make install
</pre>
<p> Now your libpciaccess.a file is saved into /usr/local/lib
directory. If you have a libpciaccess.a in /usr/lib you may simply copy
and overwrite these files. Don't forget to copy libpciaccess.pc file to
/usr/lib/pkgconfig, which is also located in /usr/local/lib/pkgconfig/.
Or you may use the following system variables:
</p>
<pre>export LD_LIBRARY_PATH=/usr/local/lib
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
</pre>
<p>
You can get them from the git repository with:
<h2>2.3 drm</h2>
<p>The next step is to compile the drm. DRM consists of two seperate parts,
the DRM client library(lindrm.so) and kernel device module(such as
radeon.ko). We need to make a small change in kernel device module. So
you need to download the kernel source. You may choose the nearest
mirror from www.kernel.org, or you are using Fedora Core 5, for
example, you may need to install RPMs such as:
kernel-smp-devel-2.16.15-1.2054_FC5.i686.rpm
kernel-devel-2.6.15-1.2054_FC5.i686.rpm
etc. You can find a detailed information <a href="http://www.howtoforge.com/kernel_compilation_fedora">here.</a>
</p>
<p>You will find drm_drv.c at /usr/src/LINUX-VERSION/drivers/char/drm/. Edit this code and comment out the following part:
</p>
<pre>
git clone git://anongit.freedesktop.org/git/mesa/drm
git clone git://anongit.freedesktop.org/git/xorg/lib/libpciaccess
/* ||
((ioctl-&gt;flags &amp; DRM_MASTER) &amp;&amp; !priv-&gt;master)*/
</pre>
<p>
See the README files in those projects for build/install instructions.
</p>
<p>
Now you are ready to compile your kernel. If your kernel version is
identical to the version you have compiled, you can simply over write
your new "ko" files over older ones. If you have compiled a different
kernel, you must configure your grub or lilo to be able to boot your
new kernel. <p>
You'll need fbdev header files. Check with:
</p>
<pre>
ls -l /usr/include/linux/fb.h
ls -l /usr/include/linux/fb.
</pre>
<p>This file may be missing if you have not installed linux header files.
<p>
Compile Mesa with the 'linux-solo' configuration:
<h2>2.4 Mesa</h2>
</p><p>Get latest development Mesa sources from git repository
(currently 7.1-prerelease)
</p>
<pre>
make linux-solo
git clone git://anongit.freedesktop.org/git/mesa/mesa
</pre>
<p>You will need the makedepend utility which is a part of mesa project
to build your linux-solo. You probably wont have this utility. You can
download its source from following git repulsitory:
</p>
<pre>
git clone git://anongit.freedesktop.org/git/xorg/util/makedepend
</pre>
<p>Get the latest stable mesa version from SourceForge (currently 7.0.3)
<a href="http://sourceforge.net/project/showfiles.php?group_id=3">http://sourceforge.net/project/showfiles.php?group_id=3</a>
</p>
<p>Copy the miniglx folder from 7.1-prerelease to 7.0.3.
You may also extract GLUT to 7.0.3 version at this step.
</p>
<p>Edit linux-solo.conf at /conf directory, just only compile the
graphics driver you need, delete the unwanted drivers names from the
list(some drivers are causing problems...)
</p>
<pre>
while(build==0)
{
make linux-solo
There will be some missing header files, copy them from 7.1-prerelease
}
</pre>
<p>
@@ -77,22 +154,40 @@ When complete you should have the following:
</p>
<ul>
<li>lib/libGL.so - the GL library which applications link with
<li>lib/*_dri_so - DRI drivers
<li>lib/miniglx.conf - sample MiniGLX config file
<li>progs/miniglx/* - several MiniGLX sample programs
</ul>
</li><li>lib/*_dri_so - DRI drivers
</li><li>lib/miniglx.conf - sample MiniGLX config file
</li><li>progs/miniglx/* - several MiniGLX sample programs
</li></ul>
To install these files into appropriate locations in system:
<pre>
make install
</pre>
Now your openGL libraries are copied to /usr/local/lib and
miniglx.conf is copied to /etc. You may copy them to /usr/lib and
overwrite your old GL libraries. Or you may export following variable:
<pre>
export LIBGL_DRIVERS_PATH=/usr/local/lib
</pre>
<br>
<h1>3. Using fbdev/DRI</h1>
<p>
If an X server currently running, exit/stop it so you're working from
the console.
the console. Following command shuts down the x window and also the multi user support.
</p>
<pre>
init 1
</pre>
<h2>3.1 Load Kernel Modules</h2>
<p>Also you may define the runlevel as 1 in "/etc/inittab". Your system
will always start in single user mode and without x-window with this
option set.
</p><h2>3.1 Load Kernel Modules</h2>
<p>
You'll need to load the kernel modules specific to your graphics hardware.
@@ -106,8 +201,7 @@ As root, the kernel modules can be loaded as follows:
<p>
If you have Intel i915/i945 hardware:
</p>
<pre>
modprobe agpgart # the AGP GART module
<pre> modprobe agpgart # the AGP GART module
modprobe intelfb # the Intel fbdev driver
modprobe i915 # the i915/945 DRI kernel module
</pre>
@@ -115,8 +209,7 @@ If you have Intel i915/i945 hardware:
<p>
If you have ATI Radeon/R200 hardware:
</p>
<pre>
modprobe agpgart # the AGP GART module
<pre> modprobe agpgart # the AGP GART module
modprobe radeonfb # the Radeon fbdev driver
modprobe radeon # the Radeon DRI kernel module
</pre>
@@ -124,8 +217,7 @@ If you have ATI Radeon/R200 hardware:
<p>
If you have ATI Rage 128 hardware:
</p>
<pre>
modprobe agpgart # the AGP GART module
<pre> modprobe agpgart # the AGP GART module
modprobe aty128fb # the Rage 128 fbdev driver
modprobe r128 # the Rage 128 DRI kernel module
</pre>
@@ -133,8 +225,7 @@ If you have ATI Rage 128 hardware:
<p>
If you have Matrox G200/G400 hardware:
</p>
<pre>
modprobe agpgart # the AGP GART module
<pre> modprobe agpgart # the AGP GART module
modprobe mgafb # the Matrox fbdev driver
modprobe mga # the Matrox DRI kernel module
</pre>
@@ -142,8 +233,7 @@ If you have Matrox G200/G400 hardware:
<p>
To verify that the agpgart, fbdev and drm modules are loaded:
</p>
<pre>
ls -l /dev/agpgart /dev/fb* /dev/dri
<pre> ls -l /dev/agpgart /dev/fb* /dev/dri
</pre>
<p>
Alternately, use lsmod to inspect the currently installed modules.
@@ -154,16 +244,15 @@ If you have problems, look at the output of dmesg.
<h2>3.2 Configuration File</h2>
<p>
Copy the sample miniglx.conf to /etc/miniglx.conf and review/edit its contents.
review/edit /etc/miniglx.conf.
Alternately, the MINIGLX_CONF environment variable can be used to
indicate the location of miniglx.conf
</p>
To determine the pciBusID value, run lspci and examine the output.
For example:
</p>
<pre>
/sbin/lspci:
<p></p>
<pre> /sbin/lspci:
00:02.0 VGA compatible controller: Intel Corporation 82915G/GV/910GL Express Chipset Family Graphics Controller (rev 04)
</pre>
<p>
@@ -186,15 +275,13 @@ for example.
Change to the <code>Mesa/progs/miniglx/</code> directory and
start the sample_server program in the background:
</p>
<pre>
./sample_server &amp;
<pre> ./sample_server &amp;
</pre>
<p>
Then try running the <code>miniglxtest</code> program:
</p>
<pre>
./miniglxtest
<pre> ./miniglxtest
</pre>
<p>
You should see a rotating quadrilateral which changes color as it rotates.
@@ -205,7 +292,7 @@ It will exit automatically after a bit.
If you run other tests in the miniglx/ directory, you may want to run
them from a remote shell so that you can stop them with ctrl-C.
</p>
<br>
<h1>4.0 Troubleshooting</h1>
@@ -214,8 +301,7 @@ them from a remote shell so that you can stop them with ctrl-C.
<li>
If you try to run miniglxtest and get the following:
<br>
<pre>
[miniglx] failed to probe chipset
<pre> [miniglx] failed to probe chipset
connect: Connection refused
server connection lost
</pre>
@@ -229,7 +315,7 @@ It means that the sample_server process is not running.
<h1>5.0 Programming Information</h1>
<p>
OpenGL/Mesa is interfaced to fbdev via the <a href="MiniGLX.html">MiniGLX</a>
OpenGL/Mesa is interfaced to fbdev via the <a href="http://www.nabble.com/file/p15480666/MiniGLX.html">MiniGLX</a>
interface.
MiniGLX is a subset of Xlib and GLX API functions which provides just
enough functionality to setup OpenGL rendering and respond to simple
@@ -250,5 +336,6 @@ See the <code>GL/miniglx.h</code> header file for details.
</p>
</body>
</html>

21
docs/memory.html Normal file
View File

@@ -0,0 +1,21 @@
<HTML>
<TITLE>Mesa News</TITLE>
<head><link rel="stylesheet" type="text/css" href="mesa.css"></head>
<BODY>
<body bgcolor="#eeeeee">
<H1>DRI Memory Management</H1>
<p>
Thomas Hellstr&ouml;m's
<a href="http://www.tungstengraphics.com/mm.pdf">Memory Management
whitepaper</a> describes the goals, design and implementation of the
new DRI memory management system.
</p>
</body>
</html>

View File

@@ -11,6 +11,23 @@
<H1>News</H1>
<h2>November 13, 2007</h2>
<p>
Gallium3D is the codename for the new Mesa device driver architecture
which is currently under development.
A <a href="http://www.tungstengraphics.com/wiki/index.php/Gallium3D"
target="_parent"> summary</a> of the architecture can be found on the
Tungsten Graphics website.
</p>
<p>
Gallium3D development is taking place on the <em>gallium-0.1</em> branch
of the git repository.
Currently, there's only a software-only driver and an Intel i915/945 driver
but other drivers will be coming...
</p>
<h2>November 10, 2007</h2>
<p>
<a href="relnotes-7.0.2.html">Mesa 7.0.2</a> is released.

65
docs/relnotes-7.0.3.html Normal file
View File

@@ -0,0 +1,65 @@
<HTML>
<TITLE>Mesa Release Notes</TITLE>
<head><link rel="stylesheet" type="text/css" href="mesa.css"></head>
<BODY>
<body bgcolor="#eeeeee">
<H1>Mesa 7.0.3 Release Notes / February TBD, 2008</H1>
<p>
Mesa 7.0.3 is a stable release with bug fixes since version 7.0.2.
</p>
<h2>MD5 checksums</h2>
<pre>
</pre>
<h2>Bug fixes</h2>
<ul>
<li>Added missing glw.pc.in file to release tarball
<li>Fix GLUT/Fortran issues
<li>GLSL gl_FrontLightModelProduct.sceneColor variable wasn't defined
<li>Fix crash upon GLSL variable array indexes (not yet supported)
<li>Two-sided stencil test didn't work in software rendering
<li>Fix two-sided lighting bugs/crashes (bug 13368)
<li>GLSL gl_FrontFacing didn't work properly
<li>glGetActiveUniform returned incorrect sizes (bug 13751)
<li>Fix several bugs relating to uniforms and attributes in GLSL API (Bruce Merry, bug 13753)
<li>glTexImage3D(GL_PROXY_TEXTURE_3D) mis-set teximage depth field
<li>Fixed GLX indirect vertex array rendering bug (14197)
<li>Fixed crash when deleting framebuffer objects (bugs 13507, 14293)
<li>User-defined clip planes enabled for R300 (bug 9871)
<li>Fixed glBindTexture() crash upon bad target (bug 14514)
<li>Fixed potential crash in glDrawPixels(GL_DEPTH_COMPONENT) (bug 13915)
<li>Bad strings given to glProgramStringARB() didn't generate GL_INVALID_OPERATION
<li>Fixed minor point rasterization regression (bug 11016)
</ul>
<h2>Driver Status</h2>
<pre>
Driver Status
---------------------- ----------------------
DRI drivers varies with the driver
XMesa/GLX (on Xlib) implements OpenGL 2.1
OSMesa (off-screen) implements OpenGL 2.1
Windows/Win32 implements OpenGL 2.1
Glide (3dfx Voodoo1/2) implements OpenGL 1.3
SVGA unsupported
Wind River UGL unsupported
DJGPP unsupported
GGI unsupported
BeOS unsupported
Allegro unsupported
D3D unsupported
</pre>
</body>
</html>

View File

@@ -20,6 +20,7 @@ The release notes summarize what's new or changed in each Mesa release.
</p>
<UL>
<LI><A HREF="relnotes-7.0.3.html">7.0.3 release notes</A>
<LI><A HREF="relnotes-7.0.2.html">7.0.2 release notes</A>
<LI><A HREF="relnotes-7.0.1.html">7.0.1 release notes</A>
<LI><A HREF="relnotes-7.0.html">7.0 release notes</A>

View File

@@ -48,6 +48,7 @@ in Mesa:
<li>The inverse trig functions asin(), acos(), and atan() are not implemented
<li>The gl_Color and gl_SecondaryColor varying vars are interpolated
without perspective correction
<li>Floating point literal suffixes 'f' and 'F' aren't allowed.
</ul>
<p>

View File

@@ -75,7 +75,7 @@ typedef void (GLUTCALLBACK *GLUTmenuStatusFCB) (int *, int *, int *);
typedef void (GLUTCALLBACK *GLUTidleFCB) (void);
/* Functions that set and return Fortran callback functions. */
GLUTAPI void* APIENTRY __glutGetFCB(int which);
GLUTAPI void APIENTRY __glutSetFCB(int which, void *func);
GLUTAPI GLUTproc APIENTRY __glutGetFCB(int which);
GLUTAPI void APIENTRY __glutSetFCB(int which, GLUTproc func);
#endif /* __glutf90_h__ */

View File

@@ -16,6 +16,10 @@
#include "trackball.h"
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
#define DEG_TO_RAD(DEG) ((DEG) * M_PI / 180.0)
#define TEXTURE_FILE "../images/reflect.rgb"

View File

@@ -1,65 +0,0 @@
clear
dlist-dangling
dlist-edgeflag
dlist-edgeflag-dangling
drawarrays
drawelements
drawrange
line
line-clip
line-cull
line-userclip
line-userclip-clip
line-userclip-nop
line-userclip-nop-clip
lineloop
lineloop-clip
point
point-clip
point-param
point-wide
poly
poly-flat
poly-unfilled
quad
quad-clip
quad-clip-all-vertices
quad-clip-nearplane
quad-degenerate
quad-flat
quad-offset-factor
quad-offset-unfilled
quad-offset-units
quad-tex-2d
quad-tex-3d
quad-tex-pbo
quad-unfilled
quads
quadstrip
quadstrip-flat
readtex.c
readtex.h
tri
tri-blend
tri-clip
tri-cull
tri-dlist
tri-edgeflag
tri-flat
tri-flat-clip
tri-tex-3d
tri-unfilled
tri-unfilled-clip
tri-unfilled-smooth
tri-unfilled-userclip
tri-userclip
tristrip
tristrip-clip
vbo-drawarrays
vbo-drawelements
vbo-drawrange
vp-array
vp-clip
vp-line-clip
vp-tri
vp-unfilled

View File

@@ -6,11 +6,12 @@ include $(TOP)/configs/current
INCDIR = $(TOP)/include
LIB_DEP = $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) $(TOP)/$(LIB_DIR)/$(GLU_LIB_NAME)
LIB_DEP = $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME)
LIBS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) $(APP_LIB_DEPS)
LIBS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) $(APP_LIB_DEPS)
PROGS = glthreads \
PROGS = \
glthreads \
glxdemo \
glxgears \
glxgears_fbconfig \
@@ -27,10 +28,14 @@ PROGS = glthreads \
pbdemo \
wincopy \
xfont \
xrotfontdemo \
yuvrect_client
xrotfontdemo
# Don't build these by default because of extra library dependencies
EXTRA_PROGS = \
shape \
yuvrect_client \
xdemo
# omit this XMesa API demo: xdemo
##### RULES #####
@@ -47,8 +52,11 @@ PROGS = glthreads \
default: $(PROGS)
extra: $(EXTRA_PROGS)
clean:
-rm -f $(PROGS)
-rm -f $(PROGS) $(EXTRA_PROGS)
-rm -f *.o *~
@@ -83,3 +91,6 @@ xuserotfont.o: xuserotfont.c xuserotfont.h
xrotfontdemo.o: xrotfontdemo.c xuserotfont.h
$(CC) -c -I. -I$(INCDIR) $(X11_INCLUDES) $(CFLAGS) xrotfontdemo.c
yuvrect_client: yuvrect_client.c
$(CC) -I$(INCDIR) $(X11_INCLUDES) $(CFLAGS) $< $(LDFLAGS) $(LIBS) -l$(GLU_LIB) -o $@

View File

@@ -596,7 +596,7 @@ get_visual_attribs(Display *dpy, XVisualInfo *vInfo,
/* multisample attribs */
#ifdef GLX_ARB_multisample
if (ext && strstr(ext, "GLX_ARB_multisample") == 0) {
if (ext && strstr(ext, "GLX_ARB_multisample")) {
glXGetConfig(dpy, vInfo, GLX_SAMPLE_BUFFERS_ARB, &attribs->numMultisample);
glXGetConfig(dpy, vInfo, GLX_SAMPLES_ARB, &attribs->numSamples);
}

View File

@@ -47,7 +47,6 @@ PERFORMANCE OF THIS SOFTWARE.
#include <GL/glx.h>
#include <GL/glu.h>
#include <X11/keysym.h>
#include <stdlib.h>
#include <stdio.h>
@@ -134,7 +133,7 @@ int main(int argc, char** argv) {
/* set up viewing parameters */
glMatrixMode(GL_PROJECTION);
gluPerspective(20, 1, 0.1, 20);
glFrustum(-1, 1, -1, 1, 6, 20);
glMatrixMode(GL_MODELVIEW);
glTranslatef(0, 0, -15);

View File

@@ -34,7 +34,6 @@
static int Width=500, Height=500;
static float Xangle = 0.0, Yangle = 0.0;
static int Redraw = 0;
static int Sides = 5;
static int MinSides = 3;
static int MaxSides = 20;

View File

@@ -36,6 +36,7 @@ SOURCES = \
glut_dstr.c \
glut_event.c \
glut_ext.c \
glut_fcb.c \
glut_fullscrn.c \
glut_gamemode.c \
glut_get.c \

View File

@@ -172,10 +172,14 @@ handleTimeouts(void)
GETTIMEOFDAY(&now);
while (IS_AT_OR_AFTER(__glutTimerList->timeout, now)) {
timer = __glutTimerList;
__glutTimerList = timer->next;
/* call the timer function */
timer->func(timer->value);
/* remove from the linked list */
__glutTimerList = timer->next;
/* put this timer on the "free" list */
timer->next = freeTimerList;
freeTimerList = timer;
if (!__glutTimerList)
break;
}

View File

@@ -19,7 +19,7 @@
/* Set a Fortran callback function. */
void APIENTRY
__glutSetFCB(int which, void *func)
__glutSetFCB(int which, GLUTproc func)
{
#ifdef SUPPORT_FORTRAN
switch (which) {
@@ -100,61 +100,61 @@ __glutSetFCB(int which, void *func)
/* Get a Fortran callback function. */
void* APIENTRY
GLUTproc APIENTRY
__glutGetFCB(int which)
{
#ifdef SUPPORT_FORTRAN
switch (which) {
case GLUT_FCB_DISPLAY:
return (void *) __glutCurrentWindow->fdisplay;
return __glutCurrentWindow->fdisplay;
case GLUT_FCB_RESHAPE:
return (void *) __glutCurrentWindow->freshape;
return __glutCurrentWindow->freshape;
case GLUT_FCB_MOUSE:
return (void *) __glutCurrentWindow->fmouse;
return __glutCurrentWindow->fmouse;
case GLUT_FCB_MOTION:
return (void *) __glutCurrentWindow->fmotion;
return __glutCurrentWindow->fmotion;
case GLUT_FCB_PASSIVE:
return (void *) __glutCurrentWindow->fpassive;
return __glutCurrentWindow->fpassive;
case GLUT_FCB_ENTRY:
return (void *) __glutCurrentWindow->fentry;
return __glutCurrentWindow->fentry;
case GLUT_FCB_KEYBOARD:
return (void *) __glutCurrentWindow->fkeyboard;
return __glutCurrentWindow->fkeyboard;
case GLUT_FCB_KEYBOARD_UP:
return (void *) __glutCurrentWindow->fkeyboardUp;
return __glutCurrentWindow->fkeyboardUp;
case GLUT_FCB_WINDOW_STATUS:
return (void *) __glutCurrentWindow->fwindowStatus;
return __glutCurrentWindow->fwindowStatus;
case GLUT_FCB_VISIBILITY:
return (void *) __glutCurrentWindow->fvisibility;
return __glutCurrentWindow->fvisibility;
case GLUT_FCB_SPECIAL:
return (void *) __glutCurrentWindow->fspecial;
return __glutCurrentWindow->fspecial;
case GLUT_FCB_SPECIAL_UP:
return (void *) __glutCurrentWindow->fspecialUp;
return __glutCurrentWindow->fspecialUp;
case GLUT_FCB_BUTTON_BOX:
return (void *) __glutCurrentWindow->fbuttonBox;
return __glutCurrentWindow->fbuttonBox;
case GLUT_FCB_DIALS:
return (void *) __glutCurrentWindow->fdials;
return __glutCurrentWindow->fdials;
case GLUT_FCB_SPACE_MOTION:
return (void *) __glutCurrentWindow->fspaceMotion;
return __glutCurrentWindow->fspaceMotion;
case GLUT_FCB_SPACE_ROTATE:
return (void *) __glutCurrentWindow->fspaceRotate;
return __glutCurrentWindow->fspaceRotate;
case GLUT_FCB_SPACE_BUTTON:
return (void *) __glutCurrentWindow->fspaceButton;
return __glutCurrentWindow->fspaceButton;
case GLUT_FCB_TABLET_MOTION:
return (void *) __glutCurrentWindow->ftabletMotion;
return __glutCurrentWindow->ftabletMotion;
case GLUT_FCB_TABLET_BUTTON:
return (void *) __glutCurrentWindow->ftabletButton;
return __glutCurrentWindow->ftabletButton;
case GLUT_FCB_JOYSTICK:
#ifdef _WIN32
return (void *) __glutCurrentWindow->fjoystick;
return __glutCurrentWindow->fjoystick;
#else
return NULL;
#endif
case GLUT_FCB_OVERLAY_DISPLAY:
return (void *) __glutCurrentWindow->overlay->fdisplay;
return __glutCurrentWindow->overlay->fdisplay;
case GLUT_FCB_SELECT:
return (void *) __glutCurrentMenu->fselect;
return __glutCurrentMenu->fselect;
case GLUT_FCB_TIMER:
return (void *) __glutTimerList->ffunc;
return __glutTimerList ? __glutTimerList->ffunc : NULL;
default:
return NULL;
}

View File

@@ -72,6 +72,23 @@ tags:
etags `find . -name \*.[ch]` `find ../include`
# glut pkgconfig file
pcedit = sed \
-e 's,@INSTALL_DIR@,$(INSTALL_DIR),' \
-e 's,@LIB_DIR@,$(LIB_DIR),' \
-e 's,@VERSION@,$(GLUT_MAJOR).$(GLUT_MINOR).$(GLUT_TINY),'
glut.pc: glut.pc.in
$(pcedit) $< > $@
install: glut.pc
$(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/include/GL
$(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)
$(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)/pkgconfig
$(INSTALL) -m 644 $(TOP)/include/GL/glut.h $(DESTDIR)$(INSTALL_DIR)/include/GL
$(INSTALL) $(TOP)/$(LIB_DIR)/libglut* $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)
$(INSTALL) -m 644 glut.pc $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)/pkgconfig
# Remove .o and backup files
clean: depend
-rm -f depend

11
src/glut/mini/glut.pc.in Normal file
View File

@@ -0,0 +1,11 @@
prefix=@INSTALL_DIR@
exec_prefix=${prefix}
libdir=${exec_prefix}/@LIB_DIR@
includedir=${prefix}/include
Name: glut
Description: Mesa OpenGL Utility Toolkit library
Requires: gl glu
Version: @VERSION@
Libs: -L${libdir} -lglut
Cflags: -I${includedir}

View File

@@ -7,5 +7,5 @@ Name: glw
Description: Mesa OpenGL widget library
Requires: gl
Version: @VERSION@
Libs: -L${libdir} -lGLU
Libs: -L${libdir} -lGLw
Cflags: -I${includedir}

View File

@@ -485,14 +485,14 @@ emit_DrawArrays_none( GLenum mode, GLint first, GLsizei count )
for ( i = 0 ; i < count ; i++ ) {
if ( (pc + single_vertex_size) >= gc->bufEnd ) {
pc = __glXFlushRenderBuffer(gc, gc->pc);
pc = __glXFlushRenderBuffer(gc, pc);
}
pc = emit_element_none( pc, arrays, first + i );
}
if ( (pc + 4) >= gc->bufEnd ) {
pc = __glXFlushRenderBuffer(gc, gc->pc);
pc = __glXFlushRenderBuffer(gc, pc);
}
(void) memcpy( pc, end_cmd, 4 );
@@ -726,7 +726,7 @@ emit_DrawElements_none( GLenum mode, GLsizei count, GLenum type,
unsigned index = 0;
if ( (pc + single_vertex_size) >= gc->bufEnd ) {
pc = __glXFlushRenderBuffer(gc, gc->pc);
pc = __glXFlushRenderBuffer(gc, pc);
}
switch( type ) {
@@ -744,7 +744,7 @@ emit_DrawElements_none( GLenum mode, GLsizei count, GLenum type,
}
if ( (pc + 4) >= gc->bufEnd ) {
pc = __glXFlushRenderBuffer(gc, gc->pc);
pc = __glXFlushRenderBuffer(gc, pc);
}
(void) memcpy( pc, end_cmd, 4 );

View File

@@ -65,7 +65,7 @@ linux-solo: depend subdirs libmesa.a
# Stand-alone Mesa libGL, no built-in drivers (DirectFB)
libgl-core: $(CORE_OBJECTS)
@ $(TOP)/bin/mklib -o $(GL_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS) \
@ $(TOP)/bin/mklib -o $(GL_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
-major $(MESA_MAJOR) -minor $(MESA_MINOR) -patch $(MESA_TINY) \
-install $(TOP)/$(LIB_DIR) $(MKLIB_OPTIONS) $(CORE_OBJECTS) \
$(GL_LIB_DEPS)

View File

@@ -112,6 +112,8 @@ _mesa_init_driver_functions(struct dd_function_table *driver)
driver->DeleteTexture = _mesa_delete_texture_object;
driver->NewTextureImage = _mesa_new_texture_image;
driver->FreeTexImageData = _mesa_free_texture_image_data;
driver->MapTexture = NULL;
driver->UnmapTexture = NULL;
driver->TextureMemCpy = _mesa_memcpy;
driver->IsTextureResident = NULL;
driver->PrioritizeTexture = NULL;

View File

@@ -50,7 +50,6 @@ SHARED_INCLUDES = \
-I$(TOP)/src/mesa/main \
-I$(TOP)/src/mesa/glapi \
-I$(TOP)/src/mesa/math \
-I$(TOP)/src/mesa/transform \
-I$(TOP)/src/mesa/shader \
-I$(TOP)/src/mesa/swrast \
-I$(TOP)/src/mesa/swrast_setup \

View File

@@ -193,7 +193,7 @@ static GLboolean gamma_run_render( GLcontext *ctx,
for (i = 0 ; i < VB->PrimitiveCount ; i++)
{
GLuint prim = VB->Primitive[i].mode;
GLuint prim = _tnl_translate_prim(&VB->Primitive[i]);
GLuint start = VB->Primitive[i].start;
GLuint length = VB->Primitive[i].count;

View File

@@ -144,7 +144,7 @@ static GLboolean i810_run_render( GLcontext *ctx,
for (i = 0 ; i < VB->PrimitiveCount ; i++)
{
GLuint prim = VB->Primitive[i].mode;
GLuint prim = _tnl_translate_prim(&VB->Primitive[i]);
GLuint start = VB->Primitive[i].start;
GLuint length = VB->Primitive[i].count;

View File

@@ -213,7 +213,7 @@ static GLboolean intel_run_render( GLcontext *ctx,
for (i = 0 ; i < VB->PrimitiveCount ; i++)
{
GLuint prim = VB->Primitive[i].mode;
GLuint prim = _tnl_translate_prim(&VB->Primitive[i]);
GLuint start = VB->Primitive[i].start;
GLuint length = VB->Primitive[i].count;

View File

@@ -377,10 +377,16 @@ do { \
ADVANCE_BATCH(); \
} while (0)
static GLuint
get_dirty(struct i830_hw_state *state)
{
return state->active & ~state->emitted;
}
static GLuint
get_state_size(struct i830_hw_state *state)
{
GLuint dirty = state->active & ~state->emitted;
GLuint dirty = get_dirty(state);
GLuint sz = 0;
GLuint i;
@@ -411,7 +417,7 @@ get_state_size(struct i830_hw_state *state)
/* Push the state into the sarea and/or texture memory.
*/
static void
i830_emit_state(struct intel_context *intel)
i830_do_emit_state(struct intel_context *intel)
{
struct i830_context *i830 = i830_context(&intel->ctx);
struct i830_hw_state *state = i830->current;
@@ -428,10 +434,32 @@ i830_emit_state(struct intel_context *intel)
*/
intel_batchbuffer_require_space(intel->batch, get_state_size(state), 0);
/* Workaround. There are cases I haven't been able to track down
* where we aren't emitting a full state at the start of a new
* batchbuffer. This code spots that we are on a new batchbuffer
* and forces a full state emit no matter what.
*
* In the normal case state->emitted is already zero, this code is
* another set of checks to make sure it really is.
*/
if (intel->batch->id != intel->last_state_batch_id ||
intel->batch->map == intel->batch->ptr)
{
state->emitted = 0;
intel_batchbuffer_require_space(intel->batch, get_state_size(state), 0);
}
/* Do this here as we may have flushed the batchbuffer above,
* causing more state to be dirty!
*/
dirty = state->active & ~state->emitted;
dirty = get_dirty(state);
state->emitted |= dirty;
assert(get_dirty(state) == 0);
if (intel->batch->id != intel->last_state_batch_id) {
assert(dirty & I830_UPLOAD_CTX);
intel->last_state_batch_id = intel->batch->id;
}
if (dirty & I830_UPLOAD_INVARIENT) {
DBG("I830_UPLOAD_INVARIENT:\n");
@@ -513,7 +541,30 @@ i830_emit_state(struct intel_context *intel)
}
}
state->emitted |= dirty;
intel->batch->dirty_state &= ~dirty;
assert(get_dirty(state) == 0);
}
static void
i830_emit_state(struct intel_context *intel)
{
struct i830_context *i830 = i830_context(&intel->ctx);
i830_do_emit_state( intel );
/* Second chance - catch batchbuffer wrap in the middle of state
* emit. This shouldn't happen but it has been observed in
* testing.
*/
if (get_dirty( i830->current )) {
/* Force a full re-emit if this happens.
*/
i830->current->emitted = 0;
i830_do_emit_state( intel );
}
assert(get_dirty(i830->current) == 0);
assert((intel->batch->dirty_state & (1<<1)) == 0);
}
static void
@@ -650,8 +701,7 @@ i830_assert_not_dirty( struct intel_context *intel )
{
struct i830_context *i830 = i830_context(&intel->ctx);
struct i830_hw_state *state = i830->current;
GLuint dirty = state->active & ~state->emitted;
assert(!dirty);
assert(!get_dirty(state));
}

View File

@@ -54,7 +54,7 @@ static GLint step_offsets[6][2] = { {0, 2},
};
GLboolean
i915_miptree_layout(struct intel_mipmap_tree * mt)
i915_miptree_layout(struct intel_context *intel, struct intel_mipmap_tree * mt)
{
GLint level;
@@ -67,7 +67,7 @@ i915_miptree_layout(struct intel_mipmap_tree * mt)
assert(lvlWidth == lvlHeight); /* cubemap images are square */
/* double pitch for cube layouts */
mt->pitch = ((dim * mt->cpp * 2 + 3) & ~3) / mt->cpp;
mt->pitch = intel_miptree_pitch_align (intel, mt, dim * 2);
mt->total_height = dim * 4;
for (level = mt->first_level; level <= mt->last_level; level++) {
@@ -107,7 +107,7 @@ i915_miptree_layout(struct intel_mipmap_tree * mt)
/* Calculate the size of a single slice.
*/
mt->pitch = ((mt->width0 * mt->cpp + 3) & ~3) / mt->cpp;
mt->pitch = intel_miptree_pitch_align (intel, mt, mt->width0);
/* XXX: hardware expects/requires 9 levels at minimum.
*/
@@ -150,7 +150,7 @@ i915_miptree_layout(struct intel_mipmap_tree * mt)
GLuint height = mt->height0;
GLuint img_height;
mt->pitch = ((mt->width0 * mt->cpp + 3) & ~3) / mt->cpp;
mt->pitch = intel_miptree_pitch_align (intel, mt, mt->width0);
mt->total_height = 0;
for (level = mt->first_level; level <= mt->last_level; level++) {
@@ -180,7 +180,7 @@ i915_miptree_layout(struct intel_mipmap_tree * mt)
GLboolean
i945_miptree_layout(struct intel_mipmap_tree * mt)
i945_miptree_layout(struct intel_context *intel, struct intel_mipmap_tree * mt)
{
GLint level;
@@ -197,7 +197,7 @@ i945_miptree_layout(struct intel_mipmap_tree * mt)
* or the final row of 4x4, 2x2 and 1x1 faces below this.
*/
if (dim > 32)
mt->pitch = ((dim * mt->cpp * 2 + 3) & ~3) / mt->cpp;
mt->pitch = intel_miptree_pitch_align (intel, mt, dim);
else
mt->pitch = 14 * 8;
@@ -279,7 +279,7 @@ i945_miptree_layout(struct intel_mipmap_tree * mt)
GLuint pack_y_pitch;
GLuint level;
mt->pitch = ((mt->width0 * mt->cpp + 3) & ~3) / mt->cpp;
mt->pitch = intel_miptree_pitch_align (intel, mt, mt->width0);
mt->total_height = 0;
pack_y_pitch = MAX2(mt->height0, 2);
@@ -329,7 +329,7 @@ i945_miptree_layout(struct intel_mipmap_tree * mt)
case GL_TEXTURE_1D:
case GL_TEXTURE_2D:
case GL_TEXTURE_RECTANGLE_ARB:
i945_miptree_layout_2d(mt);
i945_miptree_layout_2d(intel, mt);
break;
default:
_mesa_problem(NULL, "Unexpected tex target in i945_miptree_layout()");

View File

@@ -198,7 +198,7 @@ i915_emit_invarient_state(struct intel_context *intel)
/* Need to initialize this to zero.
*/
OUT_BATCH(_3DSTATE_LOAD_STATE_IMMEDIATE_1 | I1_LOAD_S(3) | (1));
OUT_BATCH(_3DSTATE_LOAD_STATE_IMMEDIATE_1 | I1_LOAD_S(3) | (0));
OUT_BATCH(0);
/* XXX: Use this */
@@ -216,6 +216,7 @@ i915_emit_invarient_state(struct intel_context *intel)
/* Don't support twosided stencil yet */
OUT_BATCH(_3DSTATE_BACKFACE_STENCIL_OPS | BFO_ENABLE_STENCIL_TWO_SIDE | 0);
OUT_BATCH(0);
ADVANCE_BATCH();
}
@@ -247,6 +248,9 @@ get_state_size(struct i915_hw_state *state)
GLuint i;
GLuint sz = 0;
if (dirty & I915_UPLOAD_INVARIENT)
sz += 30 * 4;
if (dirty & I915_UPLOAD_CTX)
sz += sizeof(state->Ctx);
@@ -281,7 +285,7 @@ get_state_size(struct i915_hw_state *state)
/* Push the state into the sarea and/or texture memory.
*/
static void
i915_emit_state(struct intel_context *intel)
i915_do_emit_state(struct intel_context *intel)
{
struct i915_context *i915 = i915_context(&intel->ctx);
struct i915_hw_state *state = i915->current;
@@ -298,10 +302,33 @@ i915_emit_state(struct intel_context *intel)
*/
intel_batchbuffer_require_space(intel->batch, get_state_size(state), 0);
/* Workaround. There are cases I haven't been able to track down
* where we aren't emitting a full state at the start of a new
* batchbuffer. This code spots that we are on a new batchbuffer
* and forces a full state emit no matter what.
*
* In the normal case state->emitted is already zero, this code is
* another set of checks to make sure it really is.
*/
if (intel->batch->id != intel->last_state_batch_id ||
intel->batch->map == intel->batch->ptr)
{
state->emitted = 0;
intel_batchbuffer_require_space(intel->batch, get_state_size(state), 0);
}
/* Do this here as we may have flushed the batchbuffer above,
* causing more state to be dirty!
*/
dirty = get_dirty(state);
state->emitted |= dirty;
assert(get_dirty(state) == 0);
if (intel->batch->id != intel->last_state_batch_id) {
assert(dirty & I915_UPLOAD_CTX);
intel->last_state_batch_id = intel->batch->id;
}
if (INTEL_DEBUG & DEBUG_STATE)
fprintf(stderr, "%s dirty: %x\n", __FUNCTION__, dirty);
@@ -424,7 +451,29 @@ i915_emit_state(struct intel_context *intel)
i915_disassemble_program(state->Program, state->ProgramSize);
}
state->emitted |= dirty;
intel->batch->dirty_state &= ~dirty;
}
static void
i915_emit_state(struct intel_context *intel)
{
struct i915_context *i915 = i915_context(&intel->ctx);
i915_do_emit_state( intel );
/* Second chance - catch batchbuffer wrap in the middle of state
* emit. This shouldn't happen but it has been observed in
* testing.
*/
if (get_dirty( i915->current )) {
/* Force a full re-emit if this happens.
*/
i915->current->emitted = 0;
i915_do_emit_state( intel );
}
assert(get_dirty(i915->current) == 0);
assert((intel->batch->dirty_state & (1<<1)) == 0);
}
static void

View File

@@ -118,6 +118,8 @@ intel_batchbuffer_reset(struct intel_batchbuffer *batch)
batch->map = driBOMap(batch->buffer, DRM_BO_FLAG_WRITE, 0);
batch->ptr = batch->map;
batch->dirty_state = ~0;
batch->id = batch->intel->intelScreen->batch_id++;
}
/*======================================================================

View File

@@ -38,6 +38,9 @@ struct intel_batchbuffer
struct buffer_reloc reloc[MAX_RELOCS];
GLuint nr_relocs;
GLuint size;
GLuint dirty_state;
GLuint id;
};
struct intel_batchbuffer *intel_batchbuffer_alloc(struct intel_context

View File

@@ -112,8 +112,8 @@ intelCopyBuffer(const __DRIdrawablePrivate * dPriv,
for (i = 0; i < nbox; i++, pbox++) {
drm_clip_rect_t box;
if (pbox->x1 > pbox->x2 ||
pbox->y1 > pbox->y2 ||
if (pbox->x1 >= pbox->x2 ||
pbox->y1 >= pbox->y2 ||
pbox->x2 > intelScreen->width || pbox->y2 > intelScreen->height)
continue;
@@ -129,19 +129,22 @@ intelCopyBuffer(const __DRIdrawablePrivate * dPriv,
if (rect->y2 < box.y2)
box.y2 = rect->y2;
if (box.x1 > box.x2 || box.y1 > box.y2)
if (box.x1 >= box.x2 || box.y1 >= box.y2)
continue;
}
assert(box.x1 < box.x2);
assert(box.y1 < box.y2);
BEGIN_BATCH(8, INTEL_BATCH_NO_CLIPRECTS);
OUT_BATCH(CMD);
OUT_BATCH(BR13);
OUT_BATCH((pbox->y1 << 16) | pbox->x1);
OUT_BATCH((pbox->y2 << 16) | pbox->x2);
OUT_BATCH((box.y1 << 16) | box.x1);
OUT_BATCH((box.y2 << 16) | box.x2);
OUT_RELOC(frontRegion->buffer, DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_WRITE,
DRM_BO_MASK_MEM | DRM_BO_FLAG_WRITE, 0);
OUT_BATCH((pbox->y1 << 16) | pbox->x1);
OUT_BATCH((box.y1 << 16) | box.x1);
OUT_BATCH(BR13 & 0xffff);
OUT_RELOC(backRegion->buffer, DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_READ,
DRM_BO_MASK_MEM | DRM_BO_FLAG_READ, 0);
@@ -152,7 +155,8 @@ intelCopyBuffer(const __DRIdrawablePrivate * dPriv,
if (intel->first_swap_fence)
driFenceUnReference(intel->first_swap_fence);
intel->first_swap_fence = intel_batchbuffer_flush(intel->batch);
driFenceReference(intel->first_swap_fence);
if (intel->first_swap_fence)
driFenceReference(intel->first_swap_fence);
}
UNLOCK_HARDWARE(intel);
@@ -193,6 +197,8 @@ intelEmitFillBlit(struct intel_context *intel,
DBG("%s dst:buf(%p)/%d+%d %d,%d sz:%dx%d\n",
__FUNCTION__, dst_buffer, dst_pitch, dst_offset, x, y, w, h);
assert(w > 0);
assert(h > 0);
BEGIN_BATCH(6, INTEL_BATCH_NO_CLIPRECTS);
OUT_BATCH(CMD);
@@ -280,10 +286,11 @@ intelEmitCopyBlit(struct intel_context *intel,
return;
}
if (dst_y2 < dst_y || dst_x2 < dst_x) {
if (dst_y2 <= dst_y || dst_x2 <= dst_x) {
return;
}
/* Initial y values don't seem to work with negative pitches. If
* we adjust the offsets manually (below), it seems to work fine.
*
@@ -292,6 +299,9 @@ intelEmitCopyBlit(struct intel_context *intel,
* the wrong result.
*/
if (dst_pitch > 0 && src_pitch > 0) {
assert(dst_x < dst_x2);
assert(dst_y < dst_y2);
BEGIN_BATCH(8, INTEL_BATCH_NO_CLIPRECTS);
OUT_BATCH(CMD);
OUT_BATCH(BR13);
@@ -306,6 +316,9 @@ intelEmitCopyBlit(struct intel_context *intel,
ADVANCE_BATCH();
}
else {
assert(dst_x < dst_x2);
assert(h > 0);
BEGIN_BATCH(8, INTEL_BATCH_NO_CLIPRECTS);
OUT_BATCH(CMD);
OUT_BATCH(BR13);
@@ -480,6 +493,9 @@ intelClearWithBlit(GLcontext * ctx, GLbitfield mask)
*/
intel_wait_flips(intel, INTEL_BATCH_NO_CLIPRECTS);
assert(b.x1 < b.x2);
assert(b.y1 < b.y2);
BEGIN_BATCH(6, INTEL_BATCH_NO_CLIPRECTS);
OUT_BATCH(CMD);
OUT_BATCH(BR13);

View File

@@ -714,7 +714,8 @@ intel_wait_flips(struct intel_context *intel, GLuint batch_flags)
BUFFER_BIT_FRONT_LEFT ? BUFFER_FRONT_LEFT :
BUFFER_BACK_LEFT);
if (intel_fb->Base.Name == 0 && intel_rb->pf_pending == intel_fb->pf_seq) {
if (intel_fb->Base.Name == 0 && intel_rb &&
intel_rb->pf_pending == intel_fb->pf_seq) {
GLint pf_pipes = intel_fb->pf_pipes;
BATCH_LOCALS;
@@ -1019,16 +1020,11 @@ intel_draw_buffer(GLcontext * ctx, struct gl_framebuffer *fb)
/*
* How many color buffers are we drawing into?
*/
if (fb->_NumColorDrawBuffers[0] != 1
#if 0
/* XXX FBO temporary - always use software rendering */
|| 1
#endif
) {
if (fb->_NumColorDrawBuffers[0] != 1) {
/* writing to 0 or 2 or 4 color buffers */
/*_mesa_debug(ctx, "Software rendering\n");*/
FALLBACK(intel, INTEL_FALLBACK_DRAW_BUFFER, GL_TRUE);
front = 1; /* might not have back color buffer */
colorRegion = NULL;
}
else {
/* draw to exactly one color buffer */
@@ -1037,30 +1033,30 @@ intel_draw_buffer(GLcontext * ctx, struct gl_framebuffer *fb)
if (fb->_ColorDrawBufferMask[0] == BUFFER_BIT_FRONT_LEFT) {
front = 1;
}
}
/*
* Get the intel_renderbuffer for the colorbuffer we're drawing into.
* And set up cliprects.
*/
if (fb->Name == 0) {
/* drawing to window system buffer */
if (front) {
intelSetFrontClipRects(intel);
colorRegion = intel_get_rb_region(fb, BUFFER_FRONT_LEFT);
/*
* Get the intel_renderbuffer for the colorbuffer we're drawing into.
* And set up cliprects.
*/
if (fb->Name == 0) {
/* drawing to window system buffer */
if (front) {
intelSetFrontClipRects(intel);
colorRegion = intel_get_rb_region(fb, BUFFER_FRONT_LEFT);
}
else {
intelSetBackClipRects(intel);
colorRegion = intel_get_rb_region(fb, BUFFER_BACK_LEFT);
}
}
else {
intelSetBackClipRects(intel);
colorRegion = intel_get_rb_region(fb, BUFFER_BACK_LEFT);
/* drawing to user-created FBO */
struct intel_renderbuffer *irb;
intelSetRenderbufferClipRects(intel);
irb = intel_renderbuffer(fb->_ColorDrawBuffers[0][0]);
colorRegion = (irb && irb->region) ? irb->region : NULL;
}
}
else {
/* drawing to user-created FBO */
struct intel_renderbuffer *irb;
intelSetRenderbufferClipRects(intel);
irb = intel_renderbuffer(fb->_ColorDrawBuffers[0][0]);
colorRegion = (irb && irb->region) ? irb->region : NULL;
}
/* Update culling direction which changes depending on the
* orientation of the buffer:

View File

@@ -315,7 +315,7 @@ intelFinish(GLcontext * ctx)
intelFlush(ctx);
if (intel->batch->last_fence) {
driFenceFinish(intel->batch->last_fence,
0, GL_FALSE);
DRM_FENCE_TYPE_EXE | DRM_I915_FENCE_TYPE_RW, GL_FALSE);
driFenceUnReference(intel->batch->last_fence);
intel->batch->last_fence = NULL;
}

View File

@@ -189,6 +189,7 @@ struct intel_context
struct _DriFenceObject *first_swap_fence;
struct intel_batchbuffer *batch;
GLuint last_state_batch_id;
struct
{

View File

@@ -75,6 +75,7 @@ intel_miptree_create(struct intel_context *intel,
mt->cpp = compress_byte ? compress_byte : cpp;
mt->compressed = compress_byte ? 1 : 0;
mt->refcount = 1;
mt->pitch = 0;
switch (intel->intelScreen->deviceID) {
case PCI_CHIP_I945_G:
@@ -83,7 +84,7 @@ intel_miptree_create(struct intel_context *intel,
case PCI_CHIP_G33_G:
case PCI_CHIP_Q33_G:
case PCI_CHIP_Q35_G:
ok = i945_miptree_layout(mt);
ok = i945_miptree_layout(intel, mt);
break;
case PCI_CHIP_I915_G:
case PCI_CHIP_I915_GM:
@@ -93,28 +94,12 @@ intel_miptree_create(struct intel_context *intel,
default:
/* All the i830 chips and the i915 use this layout:
*/
ok = i915_miptree_layout(mt);
ok = i915_miptree_layout(intel, mt);
break;
}
if (ok) {
if (!mt->compressed) {
/* XXX: Align pitch to multiple of 64 bytes for now to allow
* render-to-texture to work in all cases. This should probably be
* replaced at some point by some scheme to only do this when really
* necessary.
*/
mt->pitch = (mt->pitch * cpp + 63) & ~63;
/* XXX: At least the i915 seems very upset when the pitch is a multiple
* of 1024 and sometimes 512 bytes - performance can drop by several
* times. Go to the next multiple of 64 for now.
*/
if (!(mt->pitch & 511))
mt->pitch += 64;
mt->pitch /= cpp;
}
assert (mt->pitch);
mt->region = intel_region_alloc(intel->intelScreen,
mt->cpp, mt->pitch, mt->total_height);
@@ -128,6 +113,42 @@ intel_miptree_create(struct intel_context *intel,
return mt;
}
/**
* intel_miptree_pitch_align:
*
* @intel: intel context pointer
*
* @mt: the miptree to compute pitch alignment for
*
* @pitch: the natural pitch value
*
* Given @pitch, compute a larger value which accounts for
* any necessary alignment required by the device
*/
int intel_miptree_pitch_align (struct intel_context *intel,
struct intel_mipmap_tree *mt,
int pitch)
{
if (!mt->compressed) {
/* XXX: Align pitch to multiple of 64 bytes for now to allow
* render-to-texture to work in all cases. This should probably be
* replaced at some point by some scheme to only do this when really
* necessary.
*/
pitch = (pitch * mt->cpp + 63) & ~63;
/* XXX: At least the i915 seems very upset when the pitch is a multiple
* of 1024 and sometimes 512 bytes - performance can drop by several
* times. Go to the next multiple of the required alignment for now.
*/
if (!(pitch & 511))
pitch += 64;
pitch /= mt->cpp;
}
return pitch;
}
void
intel_miptree_reference(struct intel_mipmap_tree **dst,

View File

@@ -123,6 +123,10 @@ struct intel_mipmap_tree *intel_miptree_create(struct intel_context *intel,
GLuint cpp,
GLuint compress_byte);
int intel_miptree_pitch_align (struct intel_context *intel,
struct intel_mipmap_tree *mt,
int pitch);
void intel_miptree_reference(struct intel_mipmap_tree **dst,
struct intel_mipmap_tree *src);
@@ -190,8 +194,10 @@ void intel_miptree_image_copy(struct intel_context *intel,
/* i915_mipmap_tree.c:
*/
GLboolean i915_miptree_layout(struct intel_mipmap_tree *mt);
GLboolean i945_miptree_layout(struct intel_mipmap_tree *mt);
GLboolean i915_miptree_layout(struct intel_context *intel,
struct intel_mipmap_tree *mt);
GLboolean i945_miptree_layout(struct intel_context *intel,
struct intel_mipmap_tree *mt);

View File

@@ -214,7 +214,7 @@ intel_run_render(GLcontext * ctx, struct tnl_pipeline_stage *stage)
tnl->Driver.Render.Start(ctx);
for (i = 0; i < VB->PrimitiveCount; i++) {
GLuint prim = VB->Primitive[i].mode;
GLuint prim = _tnl_translate_prim(&VB->Primitive[i]);
GLuint start = VB->Primitive[i].start;
GLuint length = VB->Primitive[i].count;

View File

@@ -95,6 +95,7 @@ typedef struct
struct _DriBufferPool *regionPool;
struct _DriBufferPool *staticPool;
unsigned int maxBatchSize;
unsigned batch_id;
GLboolean havePools;
} intelScreenPrivate;

View File

@@ -111,6 +111,9 @@ intelStartInlinePrimitive(struct intel_context *intel,
BEGIN_BATCH(2, batch_flags);
OUT_BATCH(0);
assert(intel->batch->id == intel->last_state_batch_id);
assert((intel->batch->dirty_state & (1<<1)) == 0);
intel->prim.start_ptr = intel->batch->ptr;
intel->prim.primitive = prim;
intel->prim.flush = intel_flush_inline_primitive;

View File

@@ -143,13 +143,15 @@ static struct {
{ CMD_CONST_BUFFER, "CONST_BUFFER", 1 },
{ CMD_STATE_BASE_ADDRESS, "STATE_BASE_ADDRESS", 1 },
{ CMD_STATE_INSN_POINTER, "STATE_INSN_POINTER", 1 },
{ CMD_PIPELINE_SELECT, "PIPELINE_SELECT", 0, },
{ CMD_PIPELINE_SELECT_965, "PIPELINE_SELECT", 0, },
{ CMD_PIPELINE_SELECT_IGD, "PIPELINE_SELECT", 0,},
{ CMD_PIPELINED_STATE_POINTERS, "PIPELINED_STATE_POINTERS", 1 },
{ CMD_BINDING_TABLE_PTRS, "BINDING_TABLE_PTRS", 1 },
{ CMD_VERTEX_BUFFER, "VERTEX_BUFFER", 1 },
{ CMD_VERTEX_ELEMENT, "VERTEX_ELEMENT", 1 },
{ CMD_INDEX_BUFFER, "INDEX_BUFFER", 1 },
{ CMD_VF_STATISTICS, "VF_STATISTICS", 0 },
{ CMD_VF_STATISTICS_965, "VF_STATISTICS", 0 },
{ CMD_VF_STATISTICS_IGD, "VF_STATISTICS", 0 },
{ CMD_DRAW_RECT, "DRAW_RECT", 1 },
{ CMD_BLEND_CONSTANT_COLOR, "BLEND_CONSTANT_COLOR", 1 },
{ CMD_CHROMA_KEY, "CHROMA_KEY", 1 },
@@ -157,6 +159,7 @@ static struct {
{ CMD_POLY_STIPPLE_OFFSET, "POLY_STIPPLE_OFFSET", 1 },
{ CMD_POLY_STIPPLE_PATTERN, "POLY_STIPPLE_PATTERN", 1 },
{ CMD_LINE_STIPPLE_PATTERN, "LINE_STIPPLE_PATTERN", 1 },
{ CMD_AA_LINE_PARAMETERS, "AA_LINE_PARAMETERS", 1},
{ CMD_GLOBAL_DEPTH_OFFSET_CLAMP, "GLOBAL_DEPTH_OFFSET_CLAMP", 1 },
{ CMD_PIPE_CONTROL, "PIPE_CONTROL", 1 },
{ CMD_MI_FLUSH, "MI_FLUSH", 0 },

View File

@@ -60,7 +60,7 @@ static void compile_clip_prog( struct brw_context *brw,
/* Begin the compilation:
*/
brw_init_compile(&c.func);
brw_init_compile(brw, &c.func);
c.func.single_program_flow = 1;

View File

@@ -72,6 +72,10 @@ static void upload_clip_unit( struct brw_context *brw )
clip.clip5.viewport_xy_clip_enable = 1;
clip.clip5.vertex_position_space = BRW_CLIP_NDCSPACE;
clip.clip5.api_mode = BRW_CLIP_API_OGL;
if (BRW_IS_IGD(brw))
clip.clip5.negative_w_clip_test = 1;
clip.clip6.clipper_viewport_state_ptr = 0;
clip.viewport_xmin = -1;
clip.viewport_xmax = 1;

View File

@@ -78,7 +78,7 @@ void brw_clip_tri_alloc_regs( struct brw_clip_compile *c,
}
c->reg.t = brw_vec1_grf(i, 0);
c->reg.loopcount = retype(brw_vec1_grf(i, 1), BRW_REGISTER_TYPE_UD);
c->reg.loopcount = retype(brw_vec1_grf(i, 1), BRW_REGISTER_TYPE_D);
c->reg.nr_verts = retype(brw_vec1_grf(i, 2), BRW_REGISTER_TYPE_UD);
c->reg.planemask = retype(brw_vec1_grf(i, 3), BRW_REGISTER_TYPE_UD);
c->reg.plane_equation = brw_vec4_grf(i, 4);

View File

@@ -262,7 +262,7 @@ void brw_clip_kill_thread(struct brw_clip_compile *c)
c->reg.R0,
0, /* allocate */
0, /* used */
0, /* msg len */
1, /* msg len */
0, /* response len */
1, /* eot */
1, /* writes complete */
@@ -343,12 +343,14 @@ void brw_clip_init_clipmask( struct brw_clip_compile *c )
release_tmp(c, tmp);
}
/* Test for -ve rhw workaround
*/
brw_set_conditionalmod(p, BRW_CONDITIONAL_NZ);
brw_AND(p, vec1(brw_null_reg()), incoming, brw_imm_ud(1<<20));
brw_OR(p, c->reg.planemask, c->reg.planemask, brw_imm_ud(0x3f));
brw_set_predicate_control(p, BRW_PREDICATE_NONE);
if (BRW_IS_IGD(p->brw)) {
/* Test for -ve rhw workaround
*/
brw_set_conditionalmod(p, BRW_CONDITIONAL_NZ);
brw_AND(p, vec1(brw_null_reg()), incoming, brw_imm_ud(1<<20));
brw_OR(p, c->reg.planemask, c->reg.planemask, brw_imm_ud(0x3f));
}
brw_set_predicate_control(p, BRW_PREDICATE_NONE);
}

View File

@@ -815,14 +815,16 @@
#define CMD_STATE_BASE_ADDRESS 0x6101
#define CMD_STATE_INSN_POINTER 0x6102
#define CMD_PIPELINE_SELECT 0x6104
#define CMD_PIPELINE_SELECT_965 0x6104
#define CMD_PIPELINE_SELECT_IGD 0x6904
#define CMD_PIPELINED_STATE_POINTERS 0x7800
#define CMD_BINDING_TABLE_PTRS 0x7801
#define CMD_VERTEX_BUFFER 0x7808
#define CMD_VERTEX_ELEMENT 0x7809
#define CMD_INDEX_BUFFER 0x780a
#define CMD_VF_STATISTICS 0x780b
#define CMD_VF_STATISTICS_965 0x780b
#define CMD_VF_STATISTICS_IGD 0x680b
#define CMD_DRAW_RECT 0x7900
#define CMD_BLEND_CONSTANT_COLOR 0x7901
@@ -832,6 +834,7 @@
#define CMD_POLY_STIPPLE_PATTERN 0x7907
#define CMD_LINE_STIPPLE_PATTERN 0x7908
#define CMD_GLOBAL_DEPTH_OFFSET_CLAMP 0x7909
#define CMD_AA_LINE_PARAMETERS 0x790a
#define CMD_PIPE_CONTROL 0x7a00
@@ -845,6 +848,9 @@
#define R02_PRIM_END 0x1
#define R02_PRIM_START 0x2
#define BRW_IS_IGD(brw) ((brw)->intel.intelScreen->deviceID == PCI_CHIP_IGD_GM)
#define CMD_PIPELINE_SELECT(brw) ((BRW_IS_IGD(brw)) ? CMD_PIPELINE_SELECT_IGD : CMD_PIPELINE_SELECT_965)
#define CMD_VF_STATISTICS(brw) ((BRW_IS_IGD(brw)) ? CMD_VF_STATISTICS_IGD : CMD_VF_STATISTICS_965)
#define URB_SIZES(brw) ((BRW_IS_IGD(brw)) ? 384 : 256) /* 512 bit unit */
#endif

View File

@@ -101,8 +101,9 @@ void brw_pop_insn_state( struct brw_compile *p )
/***********************************************************************
*/
void brw_init_compile( struct brw_compile *p )
void brw_init_compile( struct brw_context *brw, struct brw_compile *p )
{
p->brw = brw;
p->nr_insn = 0;
p->current = p->stack;
memset(p->current, 0, sizeof(p->current[0]));

View File

@@ -105,6 +105,7 @@ struct brw_compile {
GLuint flag_value;
GLboolean single_program_flow;
struct brw_context *brw;
};
@@ -680,7 +681,7 @@ void brw_set_predicate_control_flag_value( struct brw_compile *p, GLuint value )
void brw_set_predicate_control( struct brw_compile *p, GLuint pc );
void brw_set_conditionalmod( struct brw_compile *p, GLuint conditional );
void brw_init_compile( struct brw_compile *p );
void brw_init_compile( struct brw_context *, struct brw_compile *p );
const GLuint *brw_get_program( struct brw_compile *p, GLuint *sz );

View File

@@ -318,7 +318,8 @@ static void brw_set_dp_read_message( struct brw_instruction *insn,
insn->bits3.dp_read.end_of_thread = end_of_thread;
}
static void brw_set_sampler_message( struct brw_instruction *insn,
static void brw_set_sampler_message(struct brw_context *brw,
struct brw_instruction *insn,
GLuint binding_table_index,
GLuint sampler,
GLuint msg_type,
@@ -328,14 +329,24 @@ static void brw_set_sampler_message( struct brw_instruction *insn,
{
brw_set_src1(insn, brw_imm_d(0));
insn->bits3.sampler.binding_table_index = binding_table_index;
insn->bits3.sampler.sampler = sampler;
insn->bits3.sampler.msg_type = msg_type;
insn->bits3.sampler.return_format = BRW_SAMPLER_RETURN_FORMAT_FLOAT32;
insn->bits3.sampler.response_length = response_length;
insn->bits3.sampler.msg_length = msg_length;
insn->bits3.sampler.end_of_thread = eot;
insn->bits3.sampler.msg_target = BRW_MESSAGE_TARGET_SAMPLER;
if (BRW_IS_IGD(brw)) {
insn->bits3.sampler_igd.binding_table_index = binding_table_index;
insn->bits3.sampler_igd.sampler = sampler;
insn->bits3.sampler_igd.msg_type = msg_type;
insn->bits3.sampler_igd.response_length = response_length;
insn->bits3.sampler_igd.msg_length = msg_length;
insn->bits3.sampler_igd.end_of_thread = eot;
insn->bits3.sampler_igd.msg_target = BRW_MESSAGE_TARGET_SAMPLER;
} else {
insn->bits3.sampler.binding_table_index = binding_table_index;
insn->bits3.sampler.sampler = sampler;
insn->bits3.sampler.msg_type = msg_type;
insn->bits3.sampler.return_format = BRW_SAMPLER_RETURN_FORMAT_FLOAT32;
insn->bits3.sampler.response_length = response_length;
insn->bits3.sampler.msg_length = msg_length;
insn->bits3.sampler.end_of_thread = eot;
insn->bits3.sampler.msg_target = BRW_MESSAGE_TARGET_SAMPLER;
}
}
@@ -985,7 +996,7 @@ void brw_SAMPLE(struct brw_compile *p,
brw_set_dest(insn, dest);
brw_set_src0(insn, src0);
brw_set_sampler_message(insn,
brw_set_sampler_message(p->brw, insn,
binding_table_index,
sampler,
msg_type,

View File

@@ -65,7 +65,7 @@ static void compile_gs_prog( struct brw_context *brw,
/* Begin the compilation:
*/
brw_init_compile(&c.func);
brw_init_compile(brw, &c.func);
c.func.single_program_flow = 1;

View File

@@ -249,7 +249,7 @@ static void upload_depthbuffer(struct brw_context *brw)
memset(&bd, 0, sizeof(bd));
bd.header.bits.opcode = CMD_DEPTH_BUFFER;
bd.header.bits.length = sizeof(bd)/4-2;
bd.header.bits.length = BRW_IS_IGD(brw) ? (sizeof(bd)/4-2) : (sizeof(bd)/4-3);
bd.dword1.bits.pitch = (region->pitch * region->cpp) - 1;
switch (region->cpp) {
@@ -359,6 +359,33 @@ const struct brw_tracked_state brw_polygon_stipple_offset = {
.update = upload_polygon_stipple_offset
};
/**********************************************************************
* AA Line parameters
*/
static void upload_aa_line_parameters(struct brw_context *brw)
{
struct brw_aa_line_parameters balp;
if (!BRW_IS_IGD(brw))
return;
/* use legacy aa line coverage computation */
memset(&balp, 0, sizeof(balp));
balp.header.opcode = CMD_AA_LINE_PARAMETERS;
balp.header.length = sizeof(balp) / 4 - 2;
BRW_CACHED_BATCH_STRUCT(brw, &balp);
}
const struct brw_tracked_state brw_aa_line_parameters = {
.dirty = {
.mesa = 0,
.brw = BRW_NEW_CONTEXT,
.cache = 0
},
.update = upload_aa_line_parameters
};
/***********************************************************************
* Line stipple packet
*/
@@ -441,7 +468,7 @@ static void upload_invarient_state( struct brw_context *brw )
struct brw_pipeline_select ps;
memset(&ps, 0, sizeof(ps));
ps.header.opcode = CMD_PIPELINE_SELECT;
ps.header.opcode = CMD_PIPELINE_SELECT(brw);
ps.header.pipeline_select = 0;
BRW_BATCH_STRUCT(brw, &ps);
}
@@ -477,7 +504,7 @@ static void upload_invarient_state( struct brw_context *brw )
struct brw_vf_statistics vfs;
memset(&vfs, 0, sizeof(vfs));
vfs.opcode = CMD_VF_STATISTICS;
vfs.opcode = CMD_VF_STATISTICS(brw);
if (INTEL_DEBUG & DEBUG_STATS)
vfs.statistics_enable = 1;

View File

@@ -57,7 +57,7 @@ static void compile_sf_prog( struct brw_context *brw,
/* Begin the compilation:
*/
brw_init_compile(&c.func);
brw_init_compile(brw, &c.func);
c.key = *key;
c.nr_attrs = brw_count_bits(c.key.attrs);
@@ -82,15 +82,15 @@ static void compile_sf_prog( struct brw_context *brw,
switch (key->primitive) {
case SF_TRIANGLES:
c.nr_verts = 3;
brw_emit_tri_setup( &c );
brw_emit_tri_setup( &c, GL_TRUE );
break;
case SF_LINES:
c.nr_verts = 2;
brw_emit_line_setup( &c );
brw_emit_line_setup( &c, GL_TRUE );
break;
case SF_POINTS:
c.nr_verts = 1;
brw_emit_point_setup( &c );
brw_emit_point_setup( &c, GL_TRUE );
break;
case SF_UNFILLED_TRIS:
c.nr_verts = 3;

View File

@@ -97,9 +97,9 @@ struct brw_sf_compile {
};
void brw_emit_tri_setup( struct brw_sf_compile *c );
void brw_emit_line_setup( struct brw_sf_compile *c );
void brw_emit_point_setup( struct brw_sf_compile *c );
void brw_emit_tri_setup( struct brw_sf_compile *c, GLboolean allocate );
void brw_emit_line_setup( struct brw_sf_compile *c, GLboolean allocate );
void brw_emit_point_setup( struct brw_sf_compile *c, GLboolean allocate );
void brw_emit_anyprim_setup( struct brw_sf_compile *c );
#endif

View File

@@ -343,13 +343,16 @@ static GLboolean calculate_masks( struct brw_sf_compile *c,
void brw_emit_tri_setup( struct brw_sf_compile *c )
void brw_emit_tri_setup( struct brw_sf_compile *c, GLboolean allocate)
{
struct brw_compile *p = &c->func;
GLuint i;
c->nr_verts = 3;
alloc_regs(c);
if (allocate)
alloc_regs(c);
invert_det(c);
copy_z_inv_w(c);
@@ -428,14 +431,17 @@ void brw_emit_tri_setup( struct brw_sf_compile *c )
void brw_emit_line_setup( struct brw_sf_compile *c )
void brw_emit_line_setup( struct brw_sf_compile *c, GLboolean allocate)
{
struct brw_compile *p = &c->func;
GLuint i;
c->nr_verts = 2;
alloc_regs(c);
if (allocate)
alloc_regs(c);
invert_det(c);
copy_z_inv_w(c);
@@ -497,17 +503,19 @@ void brw_emit_line_setup( struct brw_sf_compile *c )
}
}
/* Points setup - several simplifications as all attributes are
* constant across the face of the point (point sprites excluded!)
*/
void brw_emit_point_setup( struct brw_sf_compile *c )
void brw_emit_point_setup( struct brw_sf_compile *c, GLboolean allocate)
{
struct brw_compile *p = &c->func;
GLuint i;
c->nr_verts = 1;
alloc_regs(c);
if (allocate)
alloc_regs(c);
copy_z_inv_w(c);
brw_MOV(p, c->m1Cx, brw_imm_ud(0)); /* zero - move out of loop */
@@ -564,7 +572,10 @@ void brw_emit_anyprim_setup( struct brw_sf_compile *c )
struct brw_reg primmask;
struct brw_instruction *jmp;
struct brw_reg v1_null_ud = vec1(retype(brw_null_reg(), BRW_REGISTER_TYPE_UD));
GLuint saveflag;
c->nr_verts = 3;
alloc_regs(c);
primmask = retype(get_element(c->tmp, 0), BRW_REGISTER_TYPE_UD);
@@ -582,10 +593,15 @@ void brw_emit_anyprim_setup( struct brw_sf_compile *c )
(1<<_3DPRIM_TRIFAN_NOSTIPPLE)));
jmp = brw_JMPI(p, ip, ip, brw_imm_w(0));
{
brw_push_insn_state(p);
brw_emit_tri_setup( c );
saveflag = p->flag_value;
brw_push_insn_state(p);
brw_emit_tri_setup( c, GL_FALSE );
brw_pop_insn_state(p);
/* note - thread killed in subroutine */
p->flag_value = saveflag;
/* note - thread killed in subroutine, so must
* restore the flag which is changed when building
* the subroutine. fix #13240
*/
}
brw_land_fwd_jump(p, jmp);
@@ -598,14 +614,16 @@ void brw_emit_anyprim_setup( struct brw_sf_compile *c )
(1<<_3DPRIM_LINESTRIP_CONT_BF)));
jmp = brw_JMPI(p, ip, ip, brw_imm_w(0));
{
saveflag = p->flag_value;
brw_push_insn_state(p);
brw_emit_line_setup( c );
brw_emit_line_setup( c, GL_FALSE );
brw_pop_insn_state(p);
p->flag_value = saveflag;
/* note - thread killed in subroutine */
}
brw_land_fwd_jump(p, jmp);
brw_emit_point_setup( c );
brw_emit_point_setup( c, GL_FALSE );
}

View File

@@ -185,7 +185,8 @@ static void upload_sf_unit( struct brw_context *brw )
sf.sf6.point_rast_rule = 1; /* opengl conventions */
sf.sf7.point_size = brw->attribs.Point->_Size * (1<<3);
sf.sf7.use_point_size_state = !brw->attribs.Point->_Attenuated;
sf.sf7.aa_line_distance_mode = 0;
/* might be BRW_NEW_PRIMITIVE if we have to adjust pv for polygons:
*/
sf.sf7.trifan_pv = 2;

View File

@@ -50,6 +50,7 @@ const struct brw_tracked_state brw_gs_prog;
const struct brw_tracked_state brw_gs_unit;
const struct brw_tracked_state brw_drawing_rect;
const struct brw_tracked_state brw_line_stipple;
const struct brw_tracked_state brw_aa_line_parameters;
const struct brw_tracked_state brw_pipelined_state_pointers;
const struct brw_tracked_state brw_binding_table_pointers;
const struct brw_tracked_state brw_depthbuffer;

View File

@@ -103,6 +103,7 @@ static void clear_batch_cache( struct brw_context *brw )
void brw_clear_batch_cache_flush( struct brw_context *brw )
{
bmFinishFenceLock(&(brw->intel), bmSetFenceLock(&(brw->intel)));
clear_batch_cache(brw);
brw->wrap = 0;

View File

@@ -92,7 +92,7 @@ const struct brw_tracked_state *atoms[] =
&brw_polygon_stipple_offset,
&brw_line_stipple,
&brw_aa_line_parameters,
/* Ordering of the commands below is documented as fixed.
*/
#if 0

View File

@@ -141,7 +141,8 @@ struct brw_depthbuffer
struct {
GLuint pitch:18;
GLuint format:3;
GLuint pad:4;
GLuint pad:2;
GLuint software_tiled_rendering_mode:2;
GLuint depth_offset_disable:1;
GLuint tile_walk:1;
GLuint tiled_surface:1;
@@ -166,12 +167,20 @@ struct brw_depthbuffer
union {
struct {
GLuint pad:12;
GLuint min_array_element:9;
GLuint pad:10;
GLuint min_array_element:11;
GLuint depth:11;
} bits;
GLuint dword;
} dword4;
union {
struct {
GLuint xoffset:16;
GLuint yoffset:16;
} bits;
GLuint dword;
} dword5; /* NEW in Integrated Graphics Device */
};
struct brw_drawrect
@@ -213,6 +222,25 @@ struct brw_indexbuffer
GLuint buffer_end;
};
/* NEW in Integrated Graphics Device */
struct brw_aa_line_parameters
{
struct header header;
struct {
GLuint aa_coverage_scope:8;
GLuint pad0:8;
GLuint aa_coverage_bias:8;
GLuint pad1:8;
} bits0;
struct {
GLuint aa_coverage_endcap_slope:8;
GLuint pad0:8;
GLuint aa_coverage_endcap_bias:8;
GLuint pad1:8;
} bits1;
};
struct brw_line_stipple
{
@@ -315,7 +343,8 @@ struct brw_pipe_control
{
GLuint length:8;
GLuint notify_enable:1;
GLuint pad:2;
GLuint texture_cache_flush_enable:1;
GLuint indirect_state_pointers_disable:1;
GLuint instruction_state_cache_flush_enable:1;
GLuint write_cache_flush_enable:1;
GLuint depth_stall_enable:1;
@@ -547,8 +576,8 @@ struct brw_clip_unit_state
GLuint pad1:1;
GLuint urb_entry_allocation_size:5;
GLuint pad2:1;
GLuint max_threads:1; /* may be less */
GLuint pad3:6;
GLuint max_threads:5; /* may be less */
GLuint pad3:2;
} thread4;
struct
@@ -557,7 +586,7 @@ struct brw_clip_unit_state
GLuint clip_mode:3;
GLuint userclip_enable_flags:8;
GLuint userclip_must_clip:1;
GLuint pad1:1;
GLuint negative_w_clip_test:1;
GLuint guard_band_enable:1;
GLuint viewport_z_clip_enable:1;
GLuint viewport_xy_clip_enable:1;
@@ -724,7 +753,8 @@ struct brw_sf_unit_state
GLuint use_point_size_state:1;
GLuint subpixel_precision:1;
GLuint sprite_point:1;
GLuint pad0:11;
GLuint pad0:10;
GLuint aa_line_distance_mode:1;
GLuint trifan_pv:2;
GLuint linestrip_pv:2;
GLuint tristrip_pv:2;
@@ -749,8 +779,8 @@ struct brw_gs_unit_state
GLuint pad1:1;
GLuint urb_entry_allocation_size:5;
GLuint pad2:1;
GLuint max_threads:1;
GLuint pad3:6;
GLuint max_threads:5;
GLuint pad3:2;
} thread4;
struct
@@ -764,9 +794,14 @@ struct brw_gs_unit_state
struct
{
GLuint max_vp_index:4;
GLuint pad0:26;
GLuint reorder_enable:1;
GLuint pad0:12;
GLuint svbi_post_inc_value:10;
GLuint pad1:1;
GLuint svbi_post_inc_enable:1;
GLuint svbi_payload:1;
GLuint discard_adjaceny:1;
GLuint reorder_enable:1;
GLuint pad2:1;
} gs6;
};
@@ -786,8 +821,8 @@ struct brw_vs_unit_state
GLuint pad1:1;
GLuint urb_entry_allocation_size:5;
GLuint pad2:1;
GLuint max_threads:4;
GLuint pad3:3;
GLuint max_threads:6;
GLuint pad3:1;
} thread4;
struct
@@ -815,7 +850,7 @@ struct brw_wm_unit_state
struct {
GLuint stats_enable:1;
GLuint pad0:1;
GLuint depth_buffer_clear:1;
GLuint sampler_count:3;
GLuint sampler_state_pointer:27;
} wm4;
@@ -825,7 +860,9 @@ struct brw_wm_unit_state
GLuint enable_8_pix:1;
GLuint enable_16_pix:1;
GLuint enable_32_pix:1;
GLuint pad0:7;
GLuint enable_con_32_pix:1;
GLuint enable_con_64_pix:1;
GLuint pad0:5;
GLuint legacy_global_depth_bias:1;
GLuint line_stipple:1;
GLuint depth_offset:1;
@@ -838,9 +875,8 @@ struct brw_wm_unit_state
GLuint program_computes_depth:1;
GLuint program_uses_killpixel:1;
GLuint legacy_line_rast: 1;
GLuint pad1:1;
GLuint max_threads:6;
GLuint pad2:1;
GLuint transposed_urb_read_enable:1;
GLuint max_threads:7;
} wm5;
GLfloat global_depth_offset_constant;
@@ -978,10 +1014,26 @@ struct brw_surface_state
} ss3;
struct {
GLuint pad:19;
GLuint min_array_elt:9;
GLuint multisample_position_palette_index:3;
GLuint pad1:1;
GLuint num_multisamples:3;
GLuint pad0:1;
GLuint render_target_view_extent:9;
GLuint min_array_elt:11;
GLuint min_lod:4;
} ss4;
struct {
GLuint pad1:16;
GLuint llc_mapping:1;
GLuint mlc_mapping:1;
GLuint gfdt:1;
GLuint gfdt_src:1;
GLuint y_offset:4;
GLuint pad0:1;
GLuint x_offset:7;
} ss5; /* NEW in Integrated Graphics Device */
};
@@ -1301,6 +1353,17 @@ struct brw_instruction
GLuint end_of_thread:1;
} sampler;
struct {
GLuint binding_table_index:8;
GLuint sampler:4;
GLuint msg_type:4;
GLuint response_length:4;
GLuint msg_length:4;
GLuint msg_target:4;
GLuint pad1:3;
GLuint end_of_thread:1;
} sampler_igd;
struct brw_urb_immediate urb;
struct {

View File

@@ -38,7 +38,7 @@
#include "macros.h"
GLboolean brw_miptree_layout( struct intel_mipmap_tree *mt )
GLboolean brw_miptree_layout( struct intel_context *intel, struct intel_mipmap_tree *mt )
{
/* XXX: these vary depending on image format:
*/
@@ -102,7 +102,7 @@ GLboolean brw_miptree_layout( struct intel_mipmap_tree *mt )
}
default:
i945_miptree_layout_2d(mt);
i945_miptree_layout_2d(intel, mt);
break;
}
DBG("%s: %dx%dx%d - sz 0x%x\n", __FUNCTION__,

View File

@@ -69,7 +69,7 @@ static GLboolean check_urb_layout( struct brw_context *brw )
brw->urb.sf_start = brw->urb.clip_start + brw->urb.nr_clip_entries * brw->urb.vsize;
brw->urb.cs_start = brw->urb.sf_start + brw->urb.nr_sf_entries * brw->urb.sfsize;
return brw->urb.cs_start + brw->urb.nr_cs_entries * brw->urb.csize <= 256;
return brw->urb.cs_start + brw->urb.nr_cs_entries * brw->urb.csize <= URB_SIZES(brw);
}
/* Most minimal update, forces re-emit of URB fence packet after GS
@@ -153,7 +153,7 @@ static void recalculate_urb_fence( struct brw_context *brw )
brw->urb.clip_start,
brw->urb.sf_start,
brw->urb.cs_start,
256);
URB_SIZES(brw));
brw->state.dirty.brw |= BRW_NEW_URB_FENCE;
}
@@ -191,13 +191,13 @@ void brw_upload_urb_fence(struct brw_context *brw)
/* The ordering below is correct, not the layout in the
* instruction.
*
* There are 256 urb reg pairs in total.
* There are 256/384 urb reg pairs in total.
*/
uf.bits0.vs_fence = brw->urb.gs_start;
uf.bits0.gs_fence = brw->urb.clip_start;
uf.bits0.clp_fence = brw->urb.sf_start;
uf.bits1.sf_fence = brw->urb.cs_start;
uf.bits1.cs_fence = 256;
uf.bits1.cs_fence = URB_SIZES(brw);
BRW_BATCH_STRUCT(brw, &uf);
}

View File

@@ -49,7 +49,7 @@ static void do_vs_prog( struct brw_context *brw,
memset(&c, 0, sizeof(c));
memcpy(&c.key, key, sizeof(*key));
brw_init_compile(&c.func);
brw_init_compile(brw, &c.func);
c.vp = vp;
c.prog_data.outputs_written = vp->program.Base.OutputsWritten;

View File

@@ -845,7 +845,7 @@ static void emit_vertex_write( struct brw_vs_compile *c)
* Later, clipping will detect ucp[6] and ensure the primitive is
* clipped against all fixed planes.
*/
if (!c->key.know_w_is_one) {
if (!BRW_IS_IGD(p->brw) && !c->key.know_w_is_one) {
brw_CMP(p,
vec8(brw_null_reg()),
BRW_CONDITIONAL_L,

View File

@@ -150,7 +150,6 @@ static void do_wm_prog( struct brw_context *brw,
c->fp = fp;
c->env_param = brw->intel.ctx.FragmentProgram.Parameters;
/* Augment fragment program. Add instructions for pre- and
* post-fragment-program tasks such as interpolation and fogging.
*/
@@ -175,7 +174,7 @@ static void do_wm_prog( struct brw_context *brw,
/* This is where we start emitting gen4 code:
*/
brw_init_compile(&c->func);
brw_init_compile(brw, &c->func);
brw_wm_pass2(c);

View File

@@ -777,6 +777,7 @@ static void emit_kil( struct brw_wm_compile *c,
brw_push_insn_state(p);
brw_CMP(p, brw_null_reg(), BRW_CONDITIONAL_GE, arg0[i], brw_imm_f(0));
brw_set_predicate_control_flag_value(p, 0xff);
brw_set_compression_control(p, BRW_COMPRESSION_NONE);
brw_AND(p, r0uw, brw_flag_reg(), r0uw);
brw_pop_insn_state(p);
}

View File

@@ -704,6 +704,9 @@ void bmDeleteBuffers(struct intel_context *intel, unsigned n, struct buffer **bu
if (buf && buf->block)
free_block(intel, buf->block);
if (buf && buf->backing_store)
free_backing_store(intel, buf);
if (buf)
free(buf);
}

View File

@@ -118,6 +118,9 @@ static const GLubyte *intelGetString( GLcontext *ctx, GLenum name )
case PCI_CHIP_I965_GM:
chipset = "Intel(R) 965GM"; break;
break;
case PCI_CHIP_IGD_GM:
chipset = "Intel(R) Integrated Graphics Device";
break;
default:
chipset = "Unknown Intel Chipset"; break;
}

View File

@@ -387,6 +387,8 @@ extern int INTEL_DEBUG;
#define PCI_CHIP_I946_GZ 0x2972
#define PCI_CHIP_I965_GM 0x2A02
#define PCI_CHIP_IGD_GM 0x2A42
/* ================================================================
* intel_context.c:

View File

@@ -91,7 +91,7 @@ struct intel_mipmap_tree *intel_miptree_create( struct intel_context *intel,
default:
if (INTEL_DEBUG & DEBUG_TEXTURE)
_mesa_printf("assuming BRW texture layouts\n");
ok = brw_miptree_layout( mt );
ok = brw_miptree_layout( intel, mt );
break;
}
@@ -110,6 +110,29 @@ struct intel_mipmap_tree *intel_miptree_create( struct intel_context *intel,
}
/**
* intel_miptree_pitch_align:
*
* @intel: intel context pointer
*
* @mt: the miptree to compute pitch alignment for
*
* @pitch: the natural pitch value
*
* Given @pitch, compute a larger value which accounts for
* any necessary alignment required by the device
*/
int intel_miptree_pitch_align (struct intel_context *intel,
struct intel_mipmap_tree *mt,
int pitch)
{
if (!mt->compressed)
pitch = ((pitch * mt->cpp + 3) & ~3) / mt->cpp;
return pitch;
}
void intel_miptree_destroy( struct intel_context *intel,
struct intel_mipmap_tree *mt )

View File

@@ -115,6 +115,10 @@ struct intel_mipmap_tree *intel_miptree_create( struct intel_context *intel,
GLuint cpp,
GLboolean compressed);
int intel_miptree_pitch_align (struct intel_context *intel,
struct intel_mipmap_tree *mt,
int pitch);
void intel_miptree_destroy( struct intel_context *intel,
struct intel_mipmap_tree *mt );
@@ -159,7 +163,8 @@ GLboolean intel_miptree_image_data(struct intel_context *intel,
*/
GLboolean i915_miptree_layout( struct intel_mipmap_tree *mt );
GLboolean i945_miptree_layout( struct intel_mipmap_tree *mt );
GLboolean brw_miptree_layout( struct intel_mipmap_tree *mt );
GLboolean brw_miptree_layout( struct intel_context *intel,
struct intel_mipmap_tree *mt );

View File

@@ -40,7 +40,7 @@ static int align(int value, int alignment)
return (value + alignment - 1) & ~(alignment - 1);
}
void i945_miptree_layout_2d( struct intel_mipmap_tree *mt )
void i945_miptree_layout_2d( struct intel_context *intel, struct intel_mipmap_tree *mt )
{
GLint align_h = 2, align_w = 4;
GLuint level;
@@ -67,7 +67,7 @@ void i945_miptree_layout_2d( struct intel_mipmap_tree *mt )
/* Pitch must be a whole number of dwords, even though we
* express it in texels.
*/
mt->pitch = align(mt->pitch * mt->cpp, 4) / mt->cpp;
mt->pitch = intel_miptree_pitch_align (intel, mt, mt->pitch);
mt->total_height = 0;
for ( level = mt->first_level ; level <= mt->last_level ; level++ ) {

View File

@@ -38,4 +38,4 @@ static GLuint minify( GLuint d )
return MAX2(1, d>>1);
}
extern void i945_miptree_layout_2d( struct intel_mipmap_tree *mt );
extern void i945_miptree_layout_2d( struct intel_context *intel, struct intel_mipmap_tree *mt );

View File

@@ -144,7 +144,7 @@ static GLboolean mga_run_render( GLcontext *ctx,
for (i = 0 ; i < VB->PrimitiveCount ; i++)
{
GLuint prim = VB->Primitive[i].mode;
GLuint prim = _tnl_translate_prim(&VB->Primitive[i]);
GLuint start = VB->Primitive[i].start;
GLuint length = VB->Primitive[i].count;

View File

@@ -489,7 +489,7 @@ static GLboolean r200_run_tcl_render( GLcontext *ctx,
for (i = 0 ; i < VB->PrimitiveCount ; i++)
{
GLuint prim = VB->Primitive[i].mode;
GLuint prim = _tnl_translate_prim(&VB->Primitive[i]);
GLuint start = VB->Primitive[i].start;
GLuint length = VB->Primitive[i].count;

View File

@@ -72,7 +72,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define _INVALID(f) \
[ MESA_FORMAT_ ## f ] = { 0xffffffff, 0 }
#define VALID_FORMAT(f) ( ((f) <= MESA_FORMAT_RGBA_DXT5) \
&& (tx_table_le[f].format != 0xffffffff) )
&& (tx_table_be[f].format != 0xffffffff) )
struct tx_table {
GLuint format, filter;
@@ -165,12 +165,15 @@ static void r200SetTexImages( r200ContextPtr rmesa,
*/
if ( !t->image_override ) {
if ( VALID_FORMAT( baseImage->TexFormat->MesaFormat ) ) {
const struct tx_table *table = _mesa_little_endian() ? tx_table_le :
tx_table_be;
t->pp_txformat &= ~(R200_TXFORMAT_FORMAT_MASK |
R200_TXFORMAT_ALPHA_IN_MAP);
t->pp_txfilter &= ~R200_YUV_TO_RGB;
t->pp_txformat |= tx_table_le[ baseImage->TexFormat->MesaFormat ].format;
t->pp_txfilter |= tx_table_le[ baseImage->TexFormat->MesaFormat ].filter;
t->pp_txformat |= table[ baseImage->TexFormat->MesaFormat ].format;
t->pp_txfilter |= table[ baseImage->TexFormat->MesaFormat ].filter;
}
else {
_mesa_problem(NULL, "unexpected texture format in %s", __FUNCTION__);

View File

@@ -316,8 +316,8 @@ void r300InitCmdBuf(r300ContextPtr r300)
r300->hw.vic.cmd[R300_VIC_CMD_0] = cmdpacket0(R300_VAP_INPUT_CNTL_0, 2);
ALLOC_STATE(unk21DC, always, 2, 0);
r300->hw.unk21DC.cmd[0] = cmdpacket0(0x21DC, 1);
ALLOC_STATE(unk221C, always, 2, 0);
r300->hw.unk221C.cmd[0] = cmdpacket0(R300_VAP_UNKNOWN_221C, 1);
ALLOC_STATE(vap_clip_cntl, always, 2, 0);
r300->hw.vap_clip_cntl.cmd[0] = cmdpacket0(R300_VAP_CLIP_CNTL, 1);
ALLOC_STATE(unk2220, always, 5, 0);
r300->hw.unk2220.cmd[0] = cmdpacket0(0x2220, 4);
ALLOC_STATE(unk2288, always, 2, 0);
@@ -438,15 +438,24 @@ void r300InitCmdBuf(r300ContextPtr r300)
/* VPU only on TCL */
if (has_tcl) {
int i;
ALLOC_STATE(vpi, vpu, R300_VPI_CMDSIZE, 0);
r300->hw.vpi.cmd[R300_VPI_CMD_0] =
cmdvpu(R300_PVS_UPLOAD_PROGRAM, 0);
ALLOC_STATE(vpp, vpu, R300_VPP_CMDSIZE, 0);
r300->hw.vpp.cmd[R300_VPP_CMD_0] =
cmdvpu(R300_PVS_UPLOAD_PARAMETERS, 0);
ALLOC_STATE(vps, vpu, R300_VPS_CMDSIZE, 0);
r300->hw.vps.cmd[R300_VPS_CMD_0] =
cmdvpu(R300_PVS_UPLOAD_POINTSIZE, 1);
for (i = 0; i < 6; i++) {
ALLOC_STATE(vpucp[i], vpu, R300_VPUCP_CMDSIZE, 0);
r300->hw.vpucp[i].cmd[R300_VPUCP_CMD_0] =
cmdvpu(R300_PVS_UPLOAD_CLIP_PLANE0+i, 1);
}
}
/* Textures */

View File

@@ -421,6 +421,13 @@ struct r300_state_atom {
#define R300_VPP_PARAM_0 1
#define R300_VPP_CMDSIZE 1025 /* 256 4-component parameters */
#define R300_VPUCP_CMD_0 0
#define R300_VPUCP_X 1
#define R300_VPUCP_Y 2
#define R300_VPUCP_Z 3
#define R300_VPUCP_W 4
#define R300_VPUCP_CMDSIZE 5 /* 256 4-component parameters */
#define R300_VPS_CMD_0 0
#define R300_VPS_ZERO_0 1
#define R300_VPS_ZERO_1 2
@@ -454,7 +461,7 @@ struct r300_hw_state {
struct r300_state_atom vir[2]; /* vap input route (2150/21E0) */
struct r300_state_atom vic; /* vap input control (2180) */
struct r300_state_atom unk21DC; /* (21DC) */
struct r300_state_atom unk221C; /* (221C) */
struct r300_state_atom vap_clip_cntl;
struct r300_state_atom unk2220; /* (2220) */
struct r300_state_atom unk2288; /* (2288) */
struct r300_state_atom pvs; /* pvs_cntl (22D0) */
@@ -508,6 +515,7 @@ struct r300_hw_state {
struct r300_state_atom vpi; /* vp instructions */
struct r300_state_atom vpp; /* vp parameters */
struct r300_state_atom vps; /* vertex point size (?) */
struct r300_state_atom vpucp[6]; /* vp user clip plane - 6 */
/* 8 texture units */
/* the state is grouped by function and not by
texture unit. This makes single unit updates

View File

@@ -266,8 +266,8 @@ static void r300EmitClearState(GLcontext * ctx)
e32(0x0);
e32(0x0);
R300_STATECHANGE(r300, unk221C);
reg_start(R300_VAP_UNKNOWN_221C, 0);
R300_STATECHANGE(r300, vap_clip_cntl);
reg_start(R300_VAP_CLIP_CNTL, 0);
e32(R300_221C_CLEAR);
R300_STATECHANGE(r300, ps);

View File

@@ -281,8 +281,21 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#define R300_VAP_PVS_UPLOAD_ADDRESS 0x2200
# define R300_PVS_UPLOAD_PROGRAM 0x00000000
# define R300_PVS_UPLOAD_PARAMETERS 0x00000200
# define R300_PVS_UPLOAD_CLIP_PLANE0 0x00000400
# define R300_PVS_UPLOAD_CLIP_PLANE1 0x00000401
# define R300_PVS_UPLOAD_CLIP_PLANE2 0x00000402
# define R300_PVS_UPLOAD_CLIP_PLANE3 0x00000403
# define R300_PVS_UPLOAD_CLIP_PLANE4 0x00000404
# define R300_PVS_UPLOAD_CLIP_PLANE5 0x00000405
# define R300_PVS_UPLOAD_POINTSIZE 0x00000406
# define R500_PVS_UPLOAD_CLIP_PLANE0 0x00000600
# define R500_PVS_UPLOAD_CLIP_PLANE1 0x00000601
# define R500_PVS_UPLOAD_CLIP_PLANE2 0x00000602
# define R500_PVS_UPLOAD_CLIP_PLANE3 0x00000603
# define R500_PVS_UPLOAD_CLIP_PLANE4 0x00000604
# define R500_PVS_UPLOAD_CLIP_PLANE5 0x00000605
/* gap */
#define R300_VAP_PVS_UPLOAD_DATA 0x2208
@@ -294,10 +307,16 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
/* I do not know the purpose of this register. However, I do know that
* it is set to 221C_CLEAR for clear operations and to 221C_NORMAL
* for normal rendering.
*
* 2007-11-05: This register is the user clip plane control register, but there
* also seems to be a rendering mode control; the NORMAL/CLEAR defines.
*
* See bug #9871. http://bugs.freedesktop.org/attachment.cgi?id=10672&action=view
*/
#define R300_VAP_UNKNOWN_221C 0x221C
#define R300_VAP_CLIP_CNTL 0x221C
# define R300_221C_NORMAL 0x00000000
# define R300_221C_CLEAR 0x0001C000
#define R300_VAP_UCP_ENABLE_0 (1 << 0)
/* gap */

View File

@@ -462,6 +462,8 @@ static void r300SetDepthState(GLcontext * ctx)
r300SetEarlyZState(ctx);
}
static void r300ClipPlane( GLcontext *ctx, GLenum plane, const GLfloat *eq );
/**
* Handle glEnable()/glDisable().
*
@@ -470,7 +472,7 @@ static void r300SetDepthState(GLcontext * ctx)
static void r300Enable(GLcontext * ctx, GLenum cap, GLboolean state)
{
r300ContextPtr r300 = R300_CONTEXT(ctx);
GLuint p;
if (RADEON_DEBUG & DEBUG_STATE)
fprintf(stderr, "%s( %s = %s )\n", __FUNCTION__,
_mesa_lookup_enum_by_nr(cap),
@@ -510,6 +512,27 @@ static void r300Enable(GLcontext * ctx, GLenum cap, GLboolean state)
r300SetBlendState(ctx);
break;
case GL_CLIP_PLANE0:
case GL_CLIP_PLANE1:
case GL_CLIP_PLANE2:
case GL_CLIP_PLANE3:
case GL_CLIP_PLANE4:
case GL_CLIP_PLANE5:
/* no VAP UCP on non-TCL chipsets */
if (!(r300->radeon.radeonScreen->chip_flags & RADEON_CHIPSET_TCL))
return;
p = cap-GL_CLIP_PLANE0;
R300_STATECHANGE( r300, vap_clip_cntl );
if (state) {
r300->hw.vap_clip_cntl.cmd[1] |= (R300_VAP_UCP_ENABLE_0<<p);
r300ClipPlane( ctx, cap, NULL );
}
else {
r300->hw.vap_clip_cntl.cmd[1] &= ~(R300_VAP_UCP_ENABLE_0<<p);
}
break;
case GL_DEPTH_TEST:
r300SetDepthState(ctx);
break;
@@ -1888,7 +1911,7 @@ static void r300ResetHwState(r300ContextPtr r300)
r300->hw.unk21DC.cmd[1] = 0xAAAAAAAA;
r300->hw.unk221C.cmd[1] = R300_221C_NORMAL;
r300->hw.vap_clip_cntl.cmd[1] = R300_221C_NORMAL;
r300->hw.unk2220.cmd[1] = r300PackFloat32(1.0);
r300->hw.unk2220.cmd[2] = r300PackFloat32(1.0);
@@ -2254,6 +2277,8 @@ void r300InitState(r300ContextPtr r300)
depth_fmt = R300_DEPTH_FORMAT_24BIT_INT_Z;
r300->state.stencil.clear = 0x00ff0000;
break;
default:
fprintf(stderr, "Error: Unsupported depth %d... exiting\n",
ctx->Visual.depthBits);
@@ -2276,6 +2301,38 @@ static void r300RenderMode(GLcontext * ctx, GLenum mode)
(void)mode;
}
static void r300ClipPlane( GLcontext *ctx, GLenum plane, const GLfloat *eq )
{
r300ContextPtr rmesa = R300_CONTEXT(ctx);
GLint p = (GLint) plane - (GLint) GL_CLIP_PLANE0;
GLint *ip = (GLint *)ctx->Transform._ClipUserPlane[p];
R300_STATECHANGE( rmesa, vpucp[p] );
rmesa->hw.vpucp[p].cmd[R300_VPUCP_X] = ip[0];
rmesa->hw.vpucp[p].cmd[R300_VPUCP_Y] = ip[1];
rmesa->hw.vpucp[p].cmd[R300_VPUCP_Z] = ip[2];
rmesa->hw.vpucp[p].cmd[R300_VPUCP_W] = ip[3];
}
void r300UpdateClipPlanes( GLcontext *ctx )
{
r300ContextPtr rmesa = R300_CONTEXT(ctx);
GLuint p;
for (p = 0; p < ctx->Const.MaxClipPlanes; p++) {
if (ctx->Transform.ClipPlanesEnabled & (1 << p)) {
GLint *ip = (GLint *)ctx->Transform._ClipUserPlane[p];
R300_STATECHANGE( rmesa, vpucp[p] );
rmesa->hw.vpucp[p].cmd[R300_VPUCP_X] = ip[0];
rmesa->hw.vpucp[p].cmd[R300_VPUCP_Y] = ip[1];
rmesa->hw.vpucp[p].cmd[R300_VPUCP_Z] = ip[2];
rmesa->hw.vpucp[p].cmd[R300_VPUCP_W] = ip[3];
}
}
}
/**
* Initialize driver's state callback functions
*/
@@ -2313,4 +2370,6 @@ void r300InitStateFuncs(struct dd_function_table *functions)
functions->PolygonMode = r300PolygonMode;
functions->RenderMode = r300RenderMode;
functions->ClipPlane = r300ClipPlane;
}

View File

@@ -127,6 +127,7 @@
#define PCI_CHIP_RV370_5B63 0x5B63
#define PCI_CHIP_RV370_5B64 0x5B64
#define PCI_CHIP_RV370_5B65 0x5B65
#define PCI_CHIP_RV370_5657 0x5657
#define PCI_CHIP_RV280_5C61 0x5C61
#define PCI_CHIP_RV280_5C63 0x5C63
#define PCI_CHIP_R430_5D48 0x5D48

View File

@@ -585,6 +585,7 @@ radeonCreateScreen( __DRIscreenPrivate *sPriv )
case PCI_CHIP_RV370_5B63:
case PCI_CHIP_RV370_5B64:
case PCI_CHIP_RV370_5B65:
case PCI_CHIP_RV370_5657:
case PCI_CHIP_RV380_3150:
case PCI_CHIP_RV380_3152:
case PCI_CHIP_RV380_3154:
@@ -634,6 +635,13 @@ radeonCreateScreen( __DRIscreenPrivate *sPriv )
screen->chip_flags = RADEON_CHIPSET_TCL;
break;
/* RV410 SE chips have half the pipes of regular RV410 */
case PCI_CHIP_RV410_5E4C:
case PCI_CHIP_RV410_5E4F:
screen->chip_family = CHIP_FAMILY_RV380;
screen->chip_flags = RADEON_CHIPSET_TCL;
break;
case PCI_CHIP_RV410_564A:
case PCI_CHIP_RV410_564B:
case PCI_CHIP_RV410_564F:
@@ -642,9 +650,7 @@ radeonCreateScreen( __DRIscreenPrivate *sPriv )
case PCI_CHIP_RV410_5E48:
case PCI_CHIP_RV410_5E4A:
case PCI_CHIP_RV410_5E4B:
case PCI_CHIP_RV410_5E4C:
case PCI_CHIP_RV410_5E4D:
case PCI_CHIP_RV410_5E4F:
screen->chip_family = CHIP_FAMILY_RV410;
screen->chip_flags = RADEON_CHIPSET_TCL;
break;
@@ -702,8 +708,11 @@ radeonCreateScreen( __DRIscreenPrivate *sPriv )
screen->depthPitch = dri_priv->depthPitch;
/* Check if ddx has set up a surface reg to cover depth buffer */
screen->depthHasSurface = ((sPriv->ddxMajor > 4) &&
(screen->chip_flags & RADEON_CHIPSET_TCL));
screen->depthHasSurface = (sPriv->ddxMajor > 4) ||
/* these chips don't use tiled z without hyperz. So always pretend
we have set up a surface which will cause linear reads/writes */
((screen->chip_family & RADEON_CLASS_R100) &&
!(screen->chip_flags & RADEON_CHIPSET_TCL));
if ( dri_priv->textureSize == 0 ) {
screen->texOffset[RADEON_LOCAL_TEX_HEAP] = screen->gart_texture_offset;

View File

@@ -418,7 +418,7 @@ static GLboolean radeon_run_tcl_render( GLcontext *ctx,
for (i = 0 ; i < VB->PrimitiveCount ; i++)
{
GLuint prim = VB->Primitive[i].mode;
GLuint prim = _tnl_translate_prim(&VB->Primitive[i]);
GLuint start = VB->Primitive[i].start;
GLuint length = VB->Primitive[i].count;

View File

@@ -170,7 +170,7 @@ static GLboolean s3v_run_render( GLcontext *ctx,
for (i = 0 ; i < VB->PrimitiveCount ; i++ )
{
GLuint prim = VB->Primitive[i].mode;
GLuint prim = _tnl_translate_prim(&VB->Primitive[i]);
GLuint start = VB->Primitive[i].start;
GLuint length = VB->Primitive[i].count;

View File

@@ -198,7 +198,7 @@ static GLboolean savage_run_render( GLcontext *ctx,
for (i = 0 ; i < VB->PrimitiveCount ; i++)
{
GLuint prim = VB->Primitive[i].mode;
GLuint prim = _tnl_translate_prim(&VB->Primitive[i]);
GLuint start = VB->Primitive[i].start;
GLuint length = VB->Primitive[i].count;

View File

@@ -106,7 +106,7 @@ static GLboolean via_run_fastrender(GLcontext *ctx,
tnl->clipspace.new_inputs |= VERT_BIT_POS;
for (i = 0; i < VB->PrimitiveCount; ++i) {
GLuint mode = VB->Primitive[i].mode;
GLuint mode = _tnl_translate_prim(&VB->Primitive[i]);
GLuint start = VB->Primitive[i].start;
GLuint length = VB->Primitive[i].count;
if (length)

View File

@@ -55,7 +55,7 @@
#include <windows.h>
#endif
#include "config.h"
#include "glapi.h"
#include "GL/wmesa.h" /* protos for wmesa* functions */
@@ -70,10 +70,12 @@ struct __pixelformat__
GLboolean doubleBuffered;
};
/* These are the PFD's supported by this driver. */
struct __pixelformat__ pfd[] =
{
#if 0
#if 0
/* Double Buffer, alpha */
{
{
@@ -87,7 +89,7 @@ struct __pixelformat__ pfd[] =
8, 16,
8, 24,
0, 0, 0, 0, 0,
16, 8,
DEFAULT_SOFTWARE_DEPTH_BITS, 8,
0, 0, 0,
0, 0, 0
},
@@ -106,13 +108,13 @@ struct __pixelformat__ pfd[] =
8, 16,
8, 24,
0, 0, 0, 0, 0,
16, 8,
DEFAULT_SOFTWARE_DEPTH_BITS, 8,
0, 0, 0,
0, 0, 0
},
GL_FALSE
},
#endif
#endif
/* Double Buffer, no alpha */
{
{
@@ -126,7 +128,7 @@ struct __pixelformat__ pfd[] =
8, 16,
0, 0,
0, 0, 0, 0, 0,
16, 8,
DEFAULT_SOFTWARE_DEPTH_BITS, 8,
0, 0, 0,
0, 0, 0
},
@@ -145,7 +147,7 @@ struct __pixelformat__ pfd[] =
8, 16,
0, 0,
0, 0, 0, 0, 0,
16, 8,
DEFAULT_SOFTWARE_DEPTH_BITS, 8,
0, 0, 0,
0, 0, 0
},

View File

@@ -1500,15 +1500,19 @@ void gl_dispatch_stub_650(void){}
void gl_dispatch_stub_651(void){}
void gl_dispatch_stub_652(void){}
void gl_dispatch_stub_653(void){}
void gl_dispatch_stub_733(void){}
void gl_dispatch_stub_734(void){}
void gl_dispatch_stub_735(void){}
void gl_dispatch_stub_736(void){}
void gl_dispatch_stub_737(void){}
void gl_dispatch_stub_738(void){}
void gl_dispatch_stub_744(void){}
void gl_dispatch_stub_745(void){}
void gl_dispatch_stub_746(void){}
void gl_dispatch_stub_760(void){}
void gl_dispatch_stub_761(void){}
void gl_dispatch_stub_763(void){}
void gl_dispatch_stub_765(void){}
void gl_dispatch_stub_766(void){}
void gl_dispatch_stub_767(void){}
void gl_dispatch_stub_768(void){}
@@ -1533,5 +1537,6 @@ void gl_dispatch_stub_749(void){}
void gl_dispatch_stub_769(void){}
void gl_dispatch_stub_770(void){}
void gl_dispatch_stub_771(void){}
void gl_dispatch_stub_772(void){}
#endif

View File

@@ -420,7 +420,42 @@ clear_buffers(GLcontext *ctx, GLbitfield buffers)
#ifndef XFree86Server
/* XXX this was never tested in the Xserver environment */
/* XXX these functions haven't been tested in the Xserver environment */
/**
* Check if we can do an optimized glDrawPixels into an 8R8G8B visual.
*/
static GLboolean
can_do_DrawPixels_8R8G8B(GLcontext *ctx, GLenum format, GLenum type)
{
if (format == GL_BGRA &&
type == GL_UNSIGNED_BYTE &&
ctx->DrawBuffer &&
ctx->DrawBuffer->Name == 0 &&
ctx->Pixel.ZoomX == 1.0 && /* no zooming */
ctx->Pixel.ZoomY == 1.0 &&
ctx->_ImageTransferState == 0 /* no color tables, scale/bias, etc */) {
const SWcontext *swrast = SWRAST_CONTEXT(ctx);
if (swrast->NewState)
_swrast_validate_derived( ctx );
if ((swrast->_RasterMask & ~CLIP_BIT) == 0) /* no blend, z-test, etc */ {
struct gl_renderbuffer *rb = ctx->DrawBuffer->_ColorDrawBuffers[0][0];
if (rb) {
struct xmesa_renderbuffer *xrb = xmesa_renderbuffer(rb->Wrapped);
if (xrb &&
xrb->pixmap && /* drawing to pixmap or window */
xrb->Base.AlphaBits == 0) {
return GL_TRUE;
}
}
}
}
return GL_FALSE;
}
/**
* This function implements glDrawPixels() with an XPutImage call when
@@ -434,37 +469,16 @@ xmesa_DrawPixels_8R8G8B( GLcontext *ctx,
const struct gl_pixelstore_attrib *unpack,
const GLvoid *pixels )
{
const SWcontext *swrast = SWRAST_CONTEXT( ctx );
struct gl_renderbuffer *rb = ctx->DrawBuffer->_ColorDrawBuffers[0][0];
struct xmesa_renderbuffer *xrb = xmesa_renderbuffer(rb->Wrapped);
if (swrast->NewState)
_swrast_validate_derived( ctx );
if (ctx->DrawBuffer->Name == 0 &&
format == GL_BGRA &&
type == GL_UNSIGNED_BYTE &&
(swrast->_RasterMask & ~CLIP_BIT) == 0 && /* no blend, z-test, etc */
ctx->_ImageTransferState == 0 && /* no color tables, scale/bias, etc */
ctx->Pixel.ZoomX == 1.0 && /* no zooming */
ctx->Pixel.ZoomY == 1.0 &&
xrb->pixmap && /* drawing to pixmap or window */
xrb->Base.AlphaBits == 0)
{
const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaBuffer xmbuf = XMESA_BUFFER(ctx->DrawBuffer);
XMesaDisplay *dpy = xmesa->xm_visual->display;
const XMesaGC gc = xmbuf->cleargc; /* effected by glColorMask */
if (can_do_DrawPixels_8R8G8B(ctx, format, type)) {
const SWcontext *swrast = SWRAST_CONTEXT( ctx );
struct gl_pixelstore_attrib clippedUnpack = *unpack;
int dstX = x;
int dstY = y;
int w = width;
int h = height;
struct gl_pixelstore_attrib clippedUnpack = *unpack;
ASSERT(xmesa->xm_visual->dithered_pf == PF_8R8G8B);
ASSERT(xmesa->xm_visual->undithered_pf == PF_8R8G8B);
ASSERT(dpy);
ASSERT(gc);
if (swrast->NewState)
_swrast_validate_derived( ctx );
if (unpack->BufferObj->Name) {
/* unpack from PBO */
@@ -489,14 +503,26 @@ xmesa_DrawPixels_8R8G8B( GLcontext *ctx,
}
if (_mesa_clip_drawpixels(ctx, &dstX, &dstY, &w, &h, &clippedUnpack)) {
const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaDisplay *dpy = xmesa->xm_visual->display;
XMesaBuffer xmbuf = XMESA_BUFFER(ctx->DrawBuffer);
const XMesaGC gc = xmbuf->cleargc; /* effected by glColorMask */
struct xmesa_renderbuffer *xrb
= xmesa_renderbuffer(ctx->DrawBuffer->_ColorDrawBuffers[0][0]->Wrapped);
const int srcX = clippedUnpack.SkipPixels;
const int srcY = clippedUnpack.SkipRows;
const int rowLength = clippedUnpack.RowLength;
XMesaImage ximage;
ASSERT(xmesa->xm_visual->dithered_pf == PF_8R8G8B);
ASSERT(xmesa->xm_visual->undithered_pf == PF_8R8G8B);
ASSERT(dpy);
ASSERT(gc);
/* This is a little tricky since all coordinates up to now have
* been in the OpenGL bottom-to-top orientation. X is top-to-bottom
* so we have to carefully compute the Y coordinates/addresses here.
*/
int srcX = clippedUnpack.SkipPixels;
int srcY = clippedUnpack.SkipRows;
int rowLength = clippedUnpack.RowLength;
XMesaImage ximage;
MEMSET(&ximage, 0, sizeof(XMesaImage));
ximage.width = width;
ximage.height = height;
@@ -507,9 +533,9 @@ xmesa_DrawPixels_8R8G8B( GLcontext *ctx,
ximage.bitmap_unit = 32;
ximage.bitmap_bit_order = LSBFirst;
ximage.bitmap_pad = 32;
ximage.depth = 24;
ximage.bytes_per_line = -rowLength * 4; /* negative to flip image */
ximage.depth = 32;
ximage.bits_per_pixel = 32;
ximage.bytes_per_line = -rowLength * 4; /* negative to flip image */
/* it seems we don't need to set the ximage.red/green/blue_mask fields */
/* flip Y axis for dest position */
dstY = YFLIP(xrb, dstY) - h + 1;
@@ -530,6 +556,41 @@ xmesa_DrawPixels_8R8G8B( GLcontext *ctx,
/**
* Check if we can do an optimized glDrawPixels into an 5R6G5B visual.
*/
static GLboolean
can_do_DrawPixels_5R6G5B(GLcontext *ctx, GLenum format, GLenum type)
{
if (format == GL_RGB &&
type == GL_UNSIGNED_SHORT_5_6_5 &&
!ctx->Color.DitherFlag && /* no dithering */
ctx->DrawBuffer &&
ctx->DrawBuffer->Name == 0 &&
ctx->Pixel.ZoomX == 1.0 && /* no zooming */
ctx->Pixel.ZoomY == 1.0 &&
ctx->_ImageTransferState == 0 /* no color tables, scale/bias, etc */) {
const SWcontext *swrast = SWRAST_CONTEXT(ctx);
if (swrast->NewState)
_swrast_validate_derived( ctx );
if ((swrast->_RasterMask & ~CLIP_BIT) == 0) /* no blend, z-test, etc */ {
struct gl_renderbuffer *rb = ctx->DrawBuffer->_ColorDrawBuffers[0][0];
if (rb) {
struct xmesa_renderbuffer *xrb = xmesa_renderbuffer(rb->Wrapped);
if (xrb &&
xrb->pixmap && /* drawing to pixmap or window */
xrb->Base.AlphaBits == 0) {
return GL_TRUE;
}
}
}
}
return GL_FALSE;
}
/**
* This function implements glDrawPixels() with an XPutImage call when
* drawing to the front buffer (X Window drawable). The image format
@@ -543,35 +604,17 @@ xmesa_DrawPixels_5R6G5B( GLcontext *ctx,
const struct gl_pixelstore_attrib *unpack,
const GLvoid *pixels )
{
struct xmesa_renderbuffer *xrb
= xmesa_renderbuffer(ctx->DrawBuffer->_ColorDrawBuffers[0][0]->Wrapped);
const XMesaContext xmesa = XMESA_CONTEXT(ctx);
const SWcontext *swrast = SWRAST_CONTEXT( ctx );
XMesaDisplay *dpy = xmesa->xm_visual->display;
XMesaBuffer xmbuf = XMESA_BUFFER(ctx->DrawBuffer);
const XMesaGC gc = xmbuf->cleargc; /* effected by glColorMask */
ASSERT(dpy);
ASSERT(gc);
ASSERT(xmesa->xm_visual->undithered_pf == PF_5R6G5B);
if (swrast->NewState)
_swrast_validate_derived( ctx );
if (xrb->pixmap && /* drawing to pixmap or window */
format == GL_RGB &&
type == GL_UNSIGNED_SHORT_5_6_5 &&
!ctx->Color.DitherFlag && /* no dithering */
(swrast->_RasterMask & ~CLIP_BIT) == 0 && /* no blend, z-test, etc */
ctx->_ImageTransferState == 0 && /* no color tables, scale/bias, etc */
ctx->Pixel.ZoomX == 1.0 && /* no zooming */
ctx->Pixel.ZoomY == 1.0) {
if (can_do_DrawPixels_5R6G5B(ctx, format, type)) {
const SWcontext *swrast = SWRAST_CONTEXT( ctx );
struct gl_pixelstore_attrib clippedUnpack = *unpack;
int dstX = x;
int dstY = y;
int w = width;
int h = height;
struct gl_pixelstore_attrib clippedUnpack = *unpack;
if (swrast->NewState)
_swrast_validate_derived( ctx );
if (unpack->BufferObj->Name) {
/* unpack from PBO */
GLubyte *buf;
@@ -595,14 +638,25 @@ xmesa_DrawPixels_5R6G5B( GLcontext *ctx,
}
if (_mesa_clip_drawpixels(ctx, &dstX, &dstY, &w, &h, &clippedUnpack)) {
const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaDisplay *dpy = xmesa->xm_visual->display;
XMesaBuffer xmbuf = XMESA_BUFFER(ctx->DrawBuffer);
const XMesaGC gc = xmbuf->cleargc; /* effected by glColorMask */
struct xmesa_renderbuffer *xrb
= xmesa_renderbuffer(ctx->DrawBuffer->_ColorDrawBuffers[0][0]->Wrapped);
const int srcX = clippedUnpack.SkipPixels;
const int srcY = clippedUnpack.SkipRows;
const int rowLength = clippedUnpack.RowLength;
XMesaImage ximage;
ASSERT(xmesa->xm_visual->undithered_pf == PF_5R6G5B);
ASSERT(dpy);
ASSERT(gc);
/* This is a little tricky since all coordinates up to now have
* been in the OpenGL bottom-to-top orientation. X is top-to-bottom
* so we have to carefully compute the Y coordinates/addresses here.
*/
int srcX = clippedUnpack.SkipPixels;
int srcY = clippedUnpack.SkipRows;
int rowLength = clippedUnpack.RowLength;
XMesaImage ximage;
MEMSET(&ximage, 0, sizeof(XMesaImage));
ximage.width = width;
ximage.height = height;
@@ -614,8 +668,8 @@ xmesa_DrawPixels_5R6G5B( GLcontext *ctx,
ximage.bitmap_bit_order = LSBFirst;
ximage.bitmap_pad = 16;
ximage.depth = 16;
ximage.bytes_per_line = -rowLength * 2; /* negative to flip image */
ximage.bits_per_pixel = 16;
ximage.bytes_per_line = -rowLength * 2; /* negative to flip image */
/* it seems we don't need to set the ximage.red/green/blue_mask fields */
/* flip Y axis for dest position */
dstY = YFLIP(xrb, dstY) - h + 1;
@@ -635,6 +689,42 @@ xmesa_DrawPixels_5R6G5B( GLcontext *ctx,
}
/**
* Determine if we can do an optimized glCopyPixels.
*/
static GLboolean
can_do_CopyPixels(GLcontext *ctx, GLenum type)
{
if (type == GL_COLOR &&
ctx->_ImageTransferState == 0 && /* no color tables, scale/bias, etc */
ctx->Pixel.ZoomX == 1.0 && /* no zooming */
ctx->Pixel.ZoomY == 1.0 &&
ctx->Color.DrawBuffer[0] == GL_FRONT && /* copy to front buf */
ctx->Pixel.ReadBuffer == GL_FRONT && /* copy from front buf */
ctx->ReadBuffer->_ColorReadBuffer &&
ctx->DrawBuffer->_ColorDrawBuffers[0][0]) {
const SWcontext *swrast = SWRAST_CONTEXT( ctx );
if (swrast->NewState)
_swrast_validate_derived( ctx );
if ((swrast->_RasterMask & ~CLIP_BIT) == 0x0 &&
ctx->ReadBuffer &&
ctx->ReadBuffer->_ColorReadBuffer &&
ctx->DrawBuffer &&
ctx->DrawBuffer->_ColorDrawBuffers[0]) {
struct xmesa_renderbuffer *srcXrb
= xmesa_renderbuffer(ctx->ReadBuffer->_ColorReadBuffer->Wrapped);
struct xmesa_renderbuffer *dstXrb
= xmesa_renderbuffer(ctx->DrawBuffer->_ColorDrawBuffers[0][0]->Wrapped);
if (srcXrb->pixmap && dstXrb->pixmap) {
return GL_TRUE;
}
}
}
return GL_FALSE;
}
/**
* Implement glCopyPixels for the front color buffer (or back buffer Pixmap)
@@ -646,31 +736,19 @@ xmesa_CopyPixels( GLcontext *ctx,
GLint srcx, GLint srcy, GLsizei width, GLsizei height,
GLint destx, GLint desty, GLenum type )
{
const XMesaContext xmesa = XMESA_CONTEXT(ctx);
const SWcontext *swrast = SWRAST_CONTEXT( ctx );
XMesaDisplay *dpy = xmesa->xm_visual->display;
XMesaBuffer xmbuf = XMESA_BUFFER(ctx->DrawBuffer);
const XMesaGC gc = xmbuf->cleargc; /* effected by glColorMask */
struct xmesa_renderbuffer *srcXrb
= xmesa_renderbuffer(ctx->ReadBuffer->_ColorReadBuffer->Wrapped);
struct xmesa_renderbuffer *dstXrb
= xmesa_renderbuffer(ctx->DrawBuffer->_ColorDrawBuffers[0][0]->Wrapped);
if (can_do_CopyPixels(ctx, type)) {
const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaDisplay *dpy = xmesa->xm_visual->display;
XMesaBuffer xmbuf = XMESA_BUFFER(ctx->DrawBuffer);
const XMesaGC gc = xmbuf->cleargc; /* effected by glColorMask */
struct xmesa_renderbuffer *srcXrb
= xmesa_renderbuffer(ctx->ReadBuffer->_ColorReadBuffer->Wrapped);
struct xmesa_renderbuffer *dstXrb
= xmesa_renderbuffer(ctx->DrawBuffer->_ColorDrawBuffers[0][0]->Wrapped);
ASSERT(dpy);
ASSERT(gc);
ASSERT(dpy);
ASSERT(gc);
if (swrast->NewState)
_swrast_validate_derived( ctx );
if (ctx->Color.DrawBuffer[0] == GL_FRONT &&
ctx->Pixel.ReadBuffer == GL_FRONT &&
srcXrb->pixmap &&
dstXrb->pixmap &&
type == GL_COLOR &&
(swrast->_RasterMask & ~CLIP_BIT) == 0 && /* no blend, z-test, etc */
ctx->_ImageTransferState == 0 && /* no color tables, scale/bias, etc */
ctx->Pixel.ZoomX == 1.0 && /* no zooming */
ctx->Pixel.ZoomY == 1.0) {
/* Note: we don't do any special clipping work here. We could,
* but X will do it for us.
*/
@@ -683,6 +761,7 @@ xmesa_CopyPixels( GLcontext *ctx,
_swrast_CopyPixels(ctx, srcx, srcy, width, height, destx, desty, type );
}
}
#endif /* XFree86Server */
@@ -1072,7 +1151,8 @@ xmesa_init_driver_functions( XMesaVisual xmvisual,
#ifndef XFree86Server
driver->CopyPixels = xmesa_CopyPixels;
if (xmvisual->undithered_pf == PF_8R8G8B &&
xmvisual->dithered_pf == PF_8R8G8B) {
xmvisual->dithered_pf == PF_8R8G8B &&
xmvisual->BitsPerPixel == 32) {
driver->DrawPixels = xmesa_DrawPixels_8R8G8B;
}
else if (xmvisual->undithered_pf == PF_5R6G5B) {

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