Compare commits

...

497 Commits
19.2 ... 7.9

Author SHA1 Message Date
Jeremy Huddleston
5078cb6858 apple: Dead code removal
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit e903cc17bb)
2011-06-13 23:14:32 -07:00
Jeremy Huddleston
025d348dc1 apple: applegl_destroy_context: Pass along the correct display
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit c6cf82fb55)
2011-06-13 23:14:09 -07:00
Jeremy Huddleston
2bf24ffaff osmesa: Fix missing symbols when GLX_INDIRECT_RENDERING is defined.
When GLX_INDIRECT_RENDERING is defined, some symbols are used in
libglapi.a but are not defined.  Define them through the help of
glapitemp.h.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
(cherry picked from commit 0e8d045bf8)
2011-06-13 23:10:42 -07:00
Jeremy Huddleston
02e7aa6cea darwin: Don't link against libGL when building libOSMesa
Everything should be resolved through glapi.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit cebdffaa2a)
2011-06-13 23:10:42 -07:00
Jeremy Huddleston
55bf1244e3 darwin: Set VG_LIB_{NAME,GLOB} to fix make install
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 22c320aa2c)
(cherry picked from commit 6ea70600b9)
2011-06-13 23:10:42 -07:00
Jeremy Huddleston
70d5758479 apple: Package applegl source into MesaLib tarball
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit e5d241ddb2)
2011-06-13 23:10:41 -07:00
Jeremy Huddleston
72b8f19fa6 darwin: Define GALLIUM_DRIVERS_DIRS in darwin config
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit d563009cd1)
2011-06-13 23:10:41 -07:00
Jeremy Huddleston
e004ac273d apple: Fix build failures in applegl_glx.c
See https://bugs.freedesktop.org/show_bug.cgi?id=29162

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>

This commit squashes three cherry-picks:
(cherry picked from commit 5d35343d12)
(cherry picked from commit 7c5f37c032)
(cherry picked from commit 2ee5272e16)
2011-06-13 23:10:41 -07:00
Jeremy Huddleston
9cbc705e83 apple: Build darwin using applegl rather than indirect
This reverts portions of 6849916170 that caused
the darwin config to fail to build due to missing implementations in that
commit.

See https://bugs.freedesktop.org/show_bug.cgi?id=29162

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 1885cf27c9)
2011-06-13 23:10:41 -07:00
Jeremy Huddleston
858db8cd4e glx: Dead code removal
Remove a redundant ifndef GLX_USE_APPLEGL

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 3843bbcb4c)
2011-06-13 23:10:40 -07:00
Jeremy Huddleston
d8802cd242 apple: ifdef out come glapi-foo on darwin
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 8593bb32ea)
2011-06-13 23:10:40 -07:00
Jeremy Huddleston
7c4cc8d2b9 apple: Change from XExtDisplayInfo to struct glx_display
Fixes regression introduced by: ab434f6b76 and
                                c356f5867f

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 7cdf969527)
2011-06-13 23:10:40 -07:00
Jeremy Huddleston
a6a5772250 apple: Rename GLXcontext
Fixes regression introduced by: c356f5867f

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 279e471750)
2011-06-13 23:10:40 -07:00
Jeremy Huddleston
9bcc214159 apple: Rename _gl_context_modes_find_visual to glx_config_find_visual
Fixes regression introduced by: 6ddf66e923

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit b7f0ed8444)
2011-06-13 23:10:39 -07:00
Jeremy Huddleston
e03abf70cd apple: Re-add driContext and do_destroy
Fixes regression introduced by: c491e585e4

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 488d6c739f)
2011-06-13 23:10:39 -07:00
Jeremy Huddleston
0c6fbf66cd apple: Rename GLXcontext
Fixes regression introduced by: c356f5867f

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 22613d1670)
2011-06-13 23:10:39 -07:00
Jeremy Huddleston
14b9e91d01 apple: Rename __GLcontextModes to struct glx_config
Fixes regression introduced by: 6ddf66e923

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit bb621cb61e)
2011-06-13 23:10:38 -07:00
Jeremy Huddleston
ff7e6622fc apple: Rename glcontextmodes.[ch] to glxconfig.[ch]
Fixes regression introduced by: 65d98e2577

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 4c9bab78a1)
2011-06-13 23:10:38 -07:00
Jeremy Huddleston
bde5310339 apple: Manually edit gl.spec to match mesa 7.9 ProgramParameters4dvNV
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-13 23:10:37 -07:00
Jeremy Huddleston
4f362e0494 apple: Update GL specs
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 8e89d0bea7)
2011-06-13 22:59:04 -07:00
Kenneth Graunke
5408ccb09f glsl: Accept precision qualifiers on sampler types, but only in ES.
GLSL 1.30 states clearly that only float and int are allowed, while the
GLSL ES specification's issues section states that sampler types may
take precision qualifiers.

Fixes compilation failures in 3DMarkMobileES 2.0 and GLBenchmark 2.0,
as well as a regression in the Meego Tablet UX.

(cherry-picked from 45e8e6c6b1)
2011-05-25 11:17:41 -07:00
José Fonseca
203624128c mesa: Fix GetVertexAttrib* inside display lists.
GetVertexAttrib*{,ARB} is no longer aliased to the NV calls.

This fixes tracing yofrankie with apitrace, given it requires accurate
results from GetVertexAttribiv*.

NOTE: This is a candidate for the stable branches.
2011-05-12 14:19:15 +01:00
Tom Stellard
ea95bf7d89 r300/compiler: Fix incorrect presubtract conversion
ADD instructions with constant swizzles can't be converted to
presubtract operations.

(cherry picked from commit 0fa81d6d05)
2011-04-16 14:23:04 -07:00
Tom Stellard
b8050add56 r300/compiler: Fix vertex shader MAD instructions with constant swizzles
(cherry picked from commit d8361400b7)
2011-04-05 09:37:20 -07:00
Marek Olšák
4633054b8b r300/compiler: apply the texture swizzle to shadow pass and fail values too
Piglit tests:
- glsl-fs-shadow2d-01
- glsl-fs-shadow2d-02
- glsl-fs-shadow2d-03
- fs-shadow2d-red-01
- fs-shadow2d-red-02
- fs-shadow2d-red-03

NOTE: This is a candidate for the stable branches.
(cherry picked from commit 0d96ae8fc7)
2011-04-04 19:14:35 +02:00
Marek Olšák
897e464a5d r300/compiler: propagate SaturateMode down to the result of shadow comparison
NOTE: This is a candidate for the stable branches.
(cherry picked from commit 2679760834)
2011-04-04 19:14:15 +02:00
Marek Olšák
0140b830af r300g: tell the GLSL compiler to lower the continue opcode
NOTE: This is a candidate for the stable branches.
(cherry picked from commit f814dd7a81)

Conflicts:

	src/gallium/drivers/r300/r300_screen.c
2011-04-03 19:43:36 +02:00
Tom Stellard
9e2c9cdf48 prog_optimize: Fix reallocating registers for shaders with loops
Registers that are used inside of loops need to be considered live
starting with the first instruction of the outermost loop.

https://bugs.freedesktop.org/show_bug.cgi?id=34370

(cherry picked from commit 18dcbd358f)

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-03-31 21:39:57 -07:00
Marek Olšák
e3dcb53e6e u_blitter: remove invalid assertion 2011-03-30 02:19:32 +02:00
Henri Verbeet
6b46754bc0 st/mesa: Validate state before doing blits.
Specifically, this ensures things like the front buffer actually exist. This
fixes piglt fbo/fbo-sys-blit and fd.o bug 35483.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
(cherry picked from commit 5d7c27f5ec)
2011-03-30 00:53:18 +02:00
Marek Olšák
7397c034ac r300g: fix alpha-test with no colorbuffer
Piglit:
- fbo-alphatest-nocolor

NOTE: This is a candidate for the stable branches.
(cherry picked from commit 226ae9d6c8)
2011-03-24 23:39:43 +01:00
José Fonseca
39149172c8 mesa: More glGet* fixes.
glGet(GL_NORMAL_ARRAY) giving potentially wrong results.

Most of glGet(GL_XXX_ARRAY_BUFFER_BINDING) giving totally bogus results.
2011-03-23 17:19:30 +00:00
José Fonseca
c8bd053d3a mesa: Fix typo glGet*v(GL_TEXTURE_COORD_ARRAY_*). 2011-03-22 23:01:01 +00:00
Marek Olšák
7272f8fb18 st/mesa: fix crash when using both user and vbo buffers with the same stride
If two buffers had the same stride where one buffer is a user one and
the other is a vbo, it was considered to be one interleaved buffer,
resulting in incorrect rendering and crashes.

This patch makes sure that the interleaved buffer is either user or vbo,
not both.
(cherry picked from commit 695cdee678)
2011-03-12 22:11:52 +01:00
Marek Olšák
c91d217ff7 r300/compiler: remove unused variables
(cherry picked from commit ff8baec5bc)
2011-03-12 22:04:20 +01:00
Marek Olšák
e2baddb653 r300/compiler: fix equal and notequal shadow compare functions
(cherry picked from commit 4dfcf3c4fe)
2011-03-12 22:03:59 +01:00
Marek Olšák
20c7067257 r300/compiler: saturate Z before the shadow comparison
This fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=31159

NOTE: This is a candidate for the 7.9 and 7.10 branches.
(cherry picked from commit eb1acd1613)
2011-03-12 22:03:46 +01:00
Marek Olšák
ca76f4f6aa r300/compiler: do not set TEX_IGNORE_UNCOVERED on r500
The docs say it can be set for direct texture lookups, but even that
causes problems.

This fixes the wireframe bug:
https://bugs.freedesktop.org/show_bug.cgi?id=32688

NOTE: This is a candidate for the 7.9 and 7.10 branches.
(cherry picked from commit 6da4866ffd)
2011-03-12 21:51:34 +01:00
Marek Olšák
c7305375d1 r300/compiler: TEX instructions don't support negation on source arguments
This fixes piglit:
- glsl-fs-texture2d-dependent-4

NOTE: This is a candidate for the 7.9 and 7.10 branches.
(cherry picked from commit 1e97b4dd10)
2011-03-12 21:51:21 +01:00
Marek Olšák
dea5e972ff r300/compiler: Abs doesn't cancel Negate (in the conversion to native swizzles)
NOTE: This is a candidate for the 7.9 and 7.10 branches.
(cherry picked from commit 589d835dfd)
2011-03-12 21:51:10 +01:00
Marek Olšák
c198d29fbe r300/compiler: fix translating the src negate bits in pair_translate
(1, -_, ...) was converted to (-1, ...) because of the negation
in the second component.
Masking out the unused bits fixes this.

Piglit:
- glsl-fs-texture2d-branching

NOTE: This is a candidate for the 7.9 and 7.10 branches.
(cherry picked from commit d96305e4fc)
2011-03-12 21:50:59 +01:00
Marek Olšák
90292b8001 r300/compiler: fix the saturate modifier when applied to TEX instructions
This bug can only be triggered if the source texture is either signed or float.
(cherry picked from commit e4707604ab)
2011-03-12 21:50:42 +01:00
Marek Olšák
6ea13078fb st/mesa: fail to alloc a renderbuffer if st_choose_renderbuffer_format fails
This fixes:
  state_tracker/st_format.c:401:st_pipe_format_to_mesa_format:
  Assertion `0' failed.
(cherry picked from commit fb5d9e1199)

Conflicts:

	src/mesa/state_tracker/st_cb_fbo.c
2011-03-12 21:46:18 +01:00
Marek Olšák
48d44713f9 st/mesa: fix crash when DrawBuffer->_ColorDrawBuffers[0] is NULL
This fixes the game Tiny and Big.
(cherry picked from commit 7942e6a5ae)
2011-03-12 21:40:52 +01:00
Brian Paul
351814a21c docs: fill in 7.9.2 release date 2011-03-08 09:19:13 -07:00
Ian Romanick
a6909b6bd3 docs: Add 7.9.2 md5sums 2011-03-02 14:20:27 -08:00
Ian Romanick
7e9d853665 docs: Add change log to 7.9.2 release notes 2011-03-02 14:18:05 -08:00
Ian Romanick
ca5cf9bf66 mesa: set version string to 7.9.2 (final) 2011-03-02 13:48:22 -08:00
Ian Romanick
dfae3ffa0f intel: Remove driver date and related bits from renderer string
Not only did this contain lies, it contained lies that wouldn't be
useful even if true.
(cherry picked from commit b0a7492aeb)
2011-03-02 13:47:41 -08:00
Ian Romanick
2b41289691 docs: Clean up bug fixes list
All the unnumbered bugs are first.  These are followed by numbered
bugs sorted by bug number.  This is analogous to 8aabb1bc on the 7.10
branch.
2011-03-01 13:22:02 -08:00
Ian Romanick
42c3e00bdb docs: Update 7.9.2 release notes for recent cherry picks 2011-03-01 13:16:53 -08:00
Cyril Brulebois
0ebbfa4335 Point to bugs.freedesktop.org rather than bugzilla.freedesktop.org
Suggested by a freedesktop.org admin.

Signed-off-by: Cyril Brulebois <kibi@debian.org>
(cherry picked from commit d252db7af1)
2011-03-01 12:57:23 -08:00
Brian Paul
fc5889a528 docs: updated environment variable list
(cherry picked from commit 1bf9954bb4)

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2011-03-01 12:57:07 -08:00
Sam Hocevar
a5b6d8ec4d docs: fix glsl_compiler name
(cherry picked from commit fde4943688)
2011-03-01 12:54:21 -08:00
Sam Hocevar
6eb1f39b55 docs: add glsl info
(cherry picked from commit 3e8fb54fb8)
2011-03-01 12:54:05 -08:00
Chad Versace
5e987d0849 tnl: Add support for datatype GL_FIXED in vertex arrays
Before populating the vertex buffer attribute pointer (VB->AttribPtr[]),
convert vertex data in GL_FIXED format to GL_FLOAT.

Fixes bug: http://bugs.freedesktop.org/show_bug.cgi?id=34047

NOTE: This is a candidate for the 7.9 and 7.10 branches.
(cherry picked from commit a231ac23f4)
2011-03-01 11:53:26 -08:00
Ian Romanick
9fe29f34f3 i915: Force lowering of all types of indirect array accesses in the FS
NOTE: This is a candidate for the 7.9 and 7.10 branches.

(cherry picked from commit 4c1dc1c4d7)
2011-03-01 11:53:06 -08:00
Ian Romanick
24a9d95ec7 i915: Calculate partial result to temp register first
Previously the SNE and SEQ instructions would calculate the partial
result to the destination register.  This would cause problems if the
destination register was also one of the source registers.

Fixes piglit tests glsl-fs-any, glsl-fs-struct-equal,
glsl-fs-struct-notequal, glsl-fs-vec4-operator-equal,
glsl-fs-vec4-operator-notequal.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
(cherry picked from commit 53b8b68843)
2011-03-01 10:49:56 -08:00
Ian Romanick
38c93ba921 i915: Only mark a register as available if all components are written
Previously a register would be marked as available if any component
was written.  This caused shaders such as this:

  0: TEX TEMP[0].xyz, INPUT[14].xyyy, texture[0], 2D;
  1: MUL TEMP[1], UNIFORM[0], TEMP[0].xxxx;
  2: MAD TEMP[2], UNIFORM[1], TEMP[0].yyyy, TEMP[1];
  3: MAD TEMP[1], UNIFORM[2], TEMP[0].zzzz, TEMP[2];
  4: ADD TEMP[0].xyz, TEMP[1].xyzx, UNIFORM[3].xyzx;
  5: TEX TEMP[1].w, INPUT[14].xyyy, texture[0], 2D;
  6: MOV TEMP[0].w, TEMP[1].wwww;
  7: MOV OUTPUT[2], TEMP[0];
  8: END

to produce incorrect code such as this:

  BEGIN
  DCL S[0]
  DCL T_TEX0
  R[0] = MOV T_TEX0.xyyy
  U[0] = TEXLD S[0],R[0]
  R[0].xyz = MOV U[0]
  R[1] = MUL CONST[0], R[0].xxxx
  R[2] = MAD CONST[1], R[0].yyyy, R[1]
  R[1] = MAD CONST[2], R[0].zzzz, R[2]
  R[0].xyz = ADD R[1].xyzx, CONST[3].xyzx
  R[0] = MOV T_TEX0.xyyy
  U[0] = TEXLD S[0],R[0]
  R[1].w = MOV U[0]
  R[0].w = MOV R[1].wwww
  oC = MOV R[0]
  END

Note that T_TEX0 is copied to R[0], but the xyz components of R[0] are
still expected to hold a calculated value.

Fixes piglit tests draw-elements-vs-inputs, fp-kill, and
glsl-fs-color-matrix.  It also fixes Meego bugzilla #13005.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
(cherry picked from commit a04582739e)
2011-03-01 10:49:49 -08:00
Kenneth Graunke
1156006e4a glsl: Use reralloc instead of plain realloc.
Plugs a memory leak when compiling shaders with user defined structures.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
(cherry picked from commit eb639349e2)
2011-02-28 16:33:09 -08:00
Ian Romanick
7be5744b5b linker: Fix off-by-one error implicit array sizing
Arrays are zero based.  If the highest element accessed is 6, the
array needs to have 7 elements.

Fixes piglit test glsl-fs-implicit-array-size-03 and bugzilla #34198.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
(cherry picked from commit 25b36e8ff8)
2011-02-28 16:01:08 -08:00
nobled
c73bedd191 glx: Put null check before use
'dpy' was being checked for null *after* it was already used once.

Also add a null check for psc, and drop gc's redundant initialization.
(cherry picked from commit b5dc40710d)
2011-02-28 16:01:08 -08:00
Ian Romanick
bf66888a81 glsl: Regenerate compiler files from cherry picks 2011-02-28 16:01:08 -08:00
Ian Romanick
808ba96f3e glsl: Finish out the reduce/reduce error fixes
Track variables, functions, and types during parsing.  Use this
information in the lexer to return the currect "type" for identifiers.

Change the handling of structure constructors.  They will now show up
in the AST as constructors (instead of plain function calls).

Fixes piglit tests constructor-18.vert, constructor-19.vert, and
constructor-20.vert.  Also fixes bugzilla #29926.

NOTE: This is a candidate for the 7.9 and 7.10 branches.

(cherry picked from commit 8842158944)
2011-02-28 16:01:08 -08:00
Keith Packard
cf2076f89d glsl: Eliminate reduce/reduce conflicts in glsl grammar
This requires lexical disambiguation between variable and type
identifiers (as most C compilers do).

Signed-off-by: Keith Packard <keithp@keithp.com>

NOTE: This is a candidate for the 7.9 and 7.10 branches.
(cherry picked from commit f4b812e1a6)
2011-02-28 16:01:08 -08:00
Chad Versace
e1e829689d glsl: Reinstate constant-folding for division by zero
Fixes regression: https://bugs.freedesktop.org/show_bug.cgi?id=34160

Commit e7c1f058d1 disabled constant-folding
when division-by-zero occured. This was a mistake, because the spec does
allow division by zero. (From section 5.9 of the GLSL 1.20 spec: Dividing
by zero does not cause an exception but does result in an unspecified
value.)

For floating-point division, the original pre-e7c1f05 behavior is
reinstated.

For integer division, constant-fold 1/0 to 0.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>

(cherry picked from commit 62c8c77333)
2011-02-28 15:27:41 -08:00
Chad Versace
3df97ee70c glsl: Set operators '%' and '%=' to be reserved when GLSL < 1.30
From section 5.9 of the GLSL 1.20 spec:
   The operator modulus (%) is reserved for future use.

From section 5.8 of the GLSL 1.20 spec:
   The assignments modulus into (%=), left shift by (<<=), right shift by
   (>>=), inclusive or into ( |=), and exclusive or into ( ^=). These
   operators are reserved for future use.

The GLSL ES 1.00 spec and GLSL 1.10 spec have similiar language.

Fixes bug:
https://bugs.freedesktop.org//show_bug.cgi?id=33916

Fixes Piglit tests:
spec/glsl-1.00/compiler/arithmetic-operators/modulus-00.frag
spec/glsl-1.00/compiler/assignment-operators/modulus-assign-00.frag
spec/glsl-1.10/compiler/arithmetic-operators/modulus-00.frag
spec/glsl-1.10/compiler/assignment-operators/modulus-assign-00.frag
spec/glsl-1.20/compiler/arithmetic-operators/modulus-00.frag
spec/glsl-1.20/compiler/assignment-operators/modulus-assign-00.frag
(cherry picked from commit 82f994f386)
2011-02-28 15:27:40 -08:00
Ian Romanick
7d6d3d6133 glcpp: Regenerate files from recent cherry picks 2011-02-28 15:27:40 -08:00
Chad Versace
a068f7a2df glcpp: Raise error when modulus is zero
For example, this now raises an error:
   #define XXX 1 / 0

Fixes bug: https://bugs.freedesktop.org//show_bug.cgi?id=33507
Fixes Piglit test: spec/glsl-1.10/preprocessor/modulus-by-zero.vert

NOTE: This is a candidate for the 7.9 and 7.10 branches.
(cherry picked from commit fd1252ab67)
2011-02-28 14:47:33 -08:00
Ian Romanick
d72c16a0d3 mesa: Initial size for secondary color array is 3
See table 6.7 on page 347 of the OpenGL 3.0 specification.
(cherry picked from commit 09e15ac76a)
2011-02-28 14:47:05 -08:00
Kenneth Graunke
2eb4816939 glsl: Fix use of uninitialized values in _mesa_glsl_parse_state ctor.
This has probably existed since e5e34ab18e or so.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
(cherry picked from commit dfdb9fda82)
2011-02-28 14:33:59 -08:00
Ian Romanick
8cf57be878 glsl: Reject shader versions not supported by the implementation
Previously we'd happily compile GLSL 1.30 shaders on any driver.  We'd
also happily compile GLSL 1.10 and 1.20 shaders in an ES2 context.
This has been a long standing FINISHME in the compiler.

NOTE: This is a candidate for the 7.9 and 7.10 branches
(cherry picked from commit 14880a510a)
2011-02-28 14:33:31 -08:00
Ian Romanick
bf50184f42 glsl: Ensure that all GLSL versions are supported in the stand-alone compiler
NOTE: This is a candidate for the 7.9 and 7.10 branches
(cherry picked from commit e5e34ab18e)
2011-02-28 14:33:22 -08:00
Ian Romanick
4d2a725196 intel: Fix typeos from 3d028024 and 790ff232
...and remove egg from face.
(cherry picked from commit 2fb0aebd4a)
2011-02-28 14:27:36 -08:00
Ian Romanick
bcfa054b29 i915: Set correct values for range/precision of fragment shader types
(cherry picked from commit 790ff232e2)
2011-02-28 14:27:36 -08:00
Ian Romanick
499936406b i965: Set correct values for range/precision of fragment shader types
(cherry picked from commit 3d028024e5)
2011-02-28 14:27:36 -08:00
Ian Romanick
56c63dba48 mesa: Connect glGetShaderPrecisionFormat into the dispatch table
(cherry picked from commit dde3270c19)
2011-02-28 14:27:35 -08:00
Brian Paul
9c8d677a16 mesa: implement glGetShaderPrecisionFormat()
Drivers should override the default range/precision info as needed.
No drivers do this yet.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>

(cherry picked from commit 3ee60a3558)
2011-02-28 14:27:35 -08:00
Chia-I Wu
f8d1b4fd26 mesa: Add glDepthRangef and glClearDepthf to APIspec.xml.
Core mesa has gained support for GL_ARB_ES2_compatibility.  Make GLES
generated dispatch table use them.
(cherry picked from commit a4a5a9a5ce)
2011-02-28 14:27:35 -08:00
Eric Anholt
3eda10aebf mesa: Add getter for GL_SHADER_COMPILER with ARB_ES2_compatibility.
Fixes piglit arb_es2_compatibility-shadercompiler
(cherry picked from commit 4620de7eea)
2011-02-28 14:27:35 -08:00
Eric Anholt
215ec57e69 mesa: Add getters for ARB_ES2_compatibility MAX_*_VECTORS.
Fixes piglit arb_es2_compatibility-maxvectors.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>

(cherry picked from commit 8395f206a8)
2011-02-28 14:27:35 -08:00
Eric Anholt
33aee8177e mesa: Add support for glDepthRangef and glClearDepthf.
These are ARB_ES2_compatibility float variants of the core double
entrypoints.  Fixes arb_es2_compatibility-depthrangef.
(cherry picked from commit e12c4faf7e)
2011-02-28 14:27:35 -08:00
Eric Anholt
c9d5d6ebc6 mesa: Add actual support for glReleaseShaderCompiler from ES2.
Fixes no-op dispatch warning in piglit
arb_es2_compatibility-releaseshadercompiler.c.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>

(cherry picked from commit 7b987578a9)
2011-02-28 14:27:34 -08:00
Eric Anholt
e63f8638cd mesa: Add extension enable bit for GL_ARB_ES2_compatibility.
(cherry picked from commit 9c6954fc9d)

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2011-02-28 14:27:34 -08:00
Ian Romanick
ae775f3f37 glapi: Regenerate for GL_ARB_ES2_compatibility.
This is not a cherry pick, but it matches 841ad6bf (and ac06d610).
2011-02-28 14:27:34 -08:00
Eric Anholt
bd0457346f glapi: Add entrypoints and enums for GL_ARB_ES2_compatibility.
(cherry picked from commit 8560cb939b)
2011-02-28 13:56:06 -08:00
Ian Romanick
161e36c0f7 mesa: Remove unsupported OES extensions
Based commit 19418e921 from master.  Chad's extension rework series,
of which 19418e921 is part, wasn't cherry picked to 7.9 because there
were too many conflicts.  Most of the conflicts were caused by
extensions that were removed in 7.10.
2011-02-25 17:34:02 -08:00
Paulo Zanoni
4996e4a845 dri_util: fail driCreateNewScreen if InitScreen is NULL
Without this, X doesn't start with UMS on r300g.

NOTE: This is a candidate for the 7.9 and 7.10 branches.

Signed-off-by: Paulo Zanoni <pzanoni@mandriva.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-02-22 15:20:35 -05:00
Dave Airlie
b093c9939e radeon: avoid segfault on 3D textures.
This is a candidate for 7.9 and 7.10
2011-02-22 15:11:09 -05:00
Dave Airlie
87a02b952b radeon/r200: fix fbo-clearmipmap + gen-teximage
sw clears were being used and not getting the correct offsets in the span
code.

also not emitting correct offsets for CB draws to texture levels.

(I've no idea why I'm playing with r100).

This is a candidate for 7.9 and 7.10
2011-02-22 15:07:45 -05:00
Brian Paul
1bac4815a8 glsl2: fix signed/unsigned comparison warning
(cherry picked from commit 3633e1f538)
2011-02-22 08:17:27 -07:00
Brian Paul
ffd9033227 glsl: add ir_shader case in switch stmt to silence warning 2011-02-22 08:17:21 -07:00
Brian Paul
439c298595 mesa: include compiler.h for ASSERT macro
This was already done in the 7.10 branch and master.
2011-02-22 07:20:12 -07:00
Marek Olšák
cd42dda3a5 st/dri: Track drawable context bindings
Needs to track this ourself since because we get into a race condition with
the dri_util.c code on make current when rendering to the front buffer.

This is what happens:
Old context is rendering to the front buffer.

App calls MakeCurrent with a new context. dri_util.c sets
drawable->driContextPriv to the new context and then calls the driver make
current. st/dri make current flushes the old context, which calls back into
st/dri via the flush frontbuffer hook. st/dri calls dri loader flush
frontbuffer, which calls invalidate buffer on the drawable into st/dri.

This is where things gets wrong. st/dri grabs the context from the dri
drawable (which now points to the new context) and calls invalidate
framebuffer to the new context which has not yet set the new drawable as its
framebuffers since we have not called make current yet, it asserts.
(cherry picked from commit 94ccc31ba4)

Conflicts:

	src/gallium/state_trackers/dri/common/dri_context.c
2011-02-20 17:08:20 +01:00
Brian Paul
c2b76d966e docs: add links to 7.9.1 and 7.9.2 release notes 2011-02-21 18:05:18 -07:00
Brian Paul
a28050de4f docs: update 7.9.2 release notes with Brian's cherry-picks 2011-02-21 18:05:01 -07:00
Brian Paul
9c122ce963 st/mesa: need to translate clear color according to surface's base format
When clearing a GL_LUMINANCE_ALPHA buffer, for example, we need to convert
the clear color (R,G,B,A) to (R,R,R,A).  We were doing this for texture border
colors but not renderbuffers.  Move the translation function to st_format.c
and share it.

This fixes the piglit fbo-clear-formats test.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
(cherry picked from commit e2d108ec82)

Conflicts:

	src/mesa/state_tracker/st_atom_sampler.c
2011-02-21 17:40:06 -07:00
Brian Paul
f0eff3061c st/mesa: fix the default case in st_format_datatype()
Part of the fix for piglit fbo-clear-formats

NOTE: This is a candidate for the 7.9 and 7.10 branches.
(cherry picked from commit c966c6980c)
2011-02-21 17:39:03 -07:00
Brian Paul
5a79a6dc04 st/mesa: set renderbuffer _BaseFormat in a few places
NOTE: This is a candidate for the 7.9 and 7.10 branches
(cherry picked from commit 633c9fcf78)
2011-02-21 17:38:32 -07:00
Brian Paul
652ceece0e cso: fix loop bound in cso_set_vertex_samplers()
Before we were looping to nr_samplers, which is the number of fragment
samplers, not vertex samplers.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
(cherry picked from commit d087cfaabf)
2011-02-21 17:31:48 -07:00
Julien Cristau
e39aa1966b glx: fix length of GLXGetFBConfigsSGIX
The extra length is the size of the request *minus* the size of the
VendorPrivate header, not the addition.

NOTE: This is a candidate for the 7.9 and 7.10 branches

Signed-off-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit cbe9fc12a6)
2011-02-21 17:30:44 -07:00
Julien Cristau
ba764ae5b1 glx: fix GLXChangeDrawableAttributesSGIX request
xGLXChangeDrawableAttributesSGIXReq follows the GLXVendorPrivate header
with a drawable, number of attributes, and list of (type, value)
attribute pairs.  Don't forget to put the number of attributes in there.
I don't think this can ever have worked.

NOTE: This is a candidate for the 7.9 and 7.10 branches

Signed-off-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit e27913f805)
2011-02-21 17:30:32 -07:00
Dimitry Andric
3959f9f7c8 glapi: add @GOTPCREL relocation type
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=33440
This replaces commit 731ec60da3

NOTE: This is a candidate for the 7.9 and 7.10 branches

Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit cfb9aae3ec)
2011-02-21 17:30:01 -07:00
Brian Paul
fa5c4b988a softpipe: fix off-by-one error in setup_fragcoord_coeff()
If we invert Y, need to subtract one from the surface height.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=26795
for softpipe.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
(cherry picked from commit 40ac24e631)
2011-02-21 17:29:18 -07:00
Brian Paul
0a218b00e7 st/mesa: fix incorrect fragcoord.x translation
emit_adjusted_wpos() needs separate x,y translation values.  If we
invert Y, we don't want to effect X.

Part of the fix for http://bugs.freedesktop.org/show_bug.cgi?id=26795

NOTE: This is a candidate for the 7.9 and 7.10 branches.
(cherry picked from commit bb56631f0c)
2011-02-21 17:28:53 -07:00
Dimitry Andric
8198e26969 glapi: adding @ char before type specifier in glapi_x86.S
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=33433
NOTE: This is a candidate for the 7.9 and 7.10 branches.

Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 37bffe8d12)
2011-02-21 17:28:36 -07:00
Julien Cristau
1b641f1b32 glx: fix request lengths
We were sending too long requests for GLXChangeDrawableAttributes,
GLXGetDrawableAttributes, GLXDestroyPixmap and GLXDestroyWindow.

NOTE: This is a candidate for the 7.9 and 7.10 branches

Signed-off-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 4324d6fdfb)
2011-02-21 17:26:10 -07:00
Dimitry Andric
8a9e6a57d0 mesa: s/movzxw/movzwl/ in read_rgba_span_x86.S
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=33386
NOTE: This is a candidate for the 7.9 and 7.10 branches

Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 811ee32a9e)
2011-02-21 17:25:17 -07:00
Dimitry Andric
279c03b98f mesa: s/movzx/movzbl/
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=33388
NOTE: This is a candidate for the 7.9 and 7.10 branches.

Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 3fda80246f)
2011-02-21 17:23:58 -07:00
Brian Paul
edfe056747 llvmpipe: make sure binning is active when we begin/end a query
This fixes a potential failure when a begin/end_query is the first
thing to happen after flushing the scene.

NOTE: This is a candidate for the 7.10 and 7.9 branches.
(cherry picked from commit 42dbc2530b)
2011-02-21 17:23:13 -07:00
Brian Paul
8ad9670866 mesa: check for dummy renderbuffer in _mesa_FramebufferRenderbufferEXT()
Fixes a failed assertion when a renderbuffer ID that was gen'd but not
previously bound was passed to glFramebufferRenderbuffer().  Generate
the same error that NVIDIA does.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
(cherry picked from commit dd973cd9e8)
2011-02-21 17:21:59 -07:00
Brian Paul
09cb5815ae mesa: don't assert in GetIntegerIndexed, etc
We were getting an assertion upon invalid pname.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
(cherry picked from commit 67722ae403)
2011-02-21 17:21:34 -07:00
Brian Paul
d1424f0185 mesa: fix num_draw_buffers==0 in fixed-function fragment program generation
This fixes a problem when glDrawBuffers(GL_NONE).  The fragment program
was writing to color output[0] but OutputsWritten was 0.  That led to a
failed assertion in the Mesa->TGSI translation code.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
(cherry picked from commit 2fa6012f6a)
2011-02-21 17:20:54 -07:00
Brian Paul
7e43495053 mesa: fix a few format table mistakes, assertions
The BaseFormat field was incorrect for a few R and RG formats.
Fix a couple assertions too.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
(cherry picked from commit 0073f50cd4)
2011-02-21 17:19:47 -07:00
Ian Romanick
246716c8f6 docs: Update 7.9.2 release notes
Add recent cherry picks
2011-02-21 14:47:43 -08:00
Ian Romanick
8159bef77f mesa: Fix error checks in GetVertexAttrib functions
Querying index zero is not an error in OpenGL ES 2.0.

Querying an index larger than the value returned by
GL_MAX_VERTEX_ATTRIBS is an error in all APIs.

Fixes bugzilla #32375.
(cherry picked from commit 5c3f1cdbbe)
2011-02-21 14:47:38 -08:00
Ian Romanick
d8392a2ca8 linker: Generate link errors when ES shaders are missing stages
ES requires that a vertex shader and a fragment shader be present.

Fixes bugzilla #32214.
(cherry picked from commit ce9171f9d8)
2011-02-21 13:50:35 -08:00
Ian Romanick
ac270e43e6 mesa: glGetUniform only returns a single element of an array
Also return it as the correct type.  Previously the whole array would
be returned and each element would be expanded to a vec4.

Fixes piglit test getuniform-01 and bugzilla #29823.

(cherry picked from commit 20d278a7ff)
2011-02-21 13:50:03 -08:00
Eric Anholt
fc09445c87 intel: Make renderbuffer tiling choice match texture tiling choice.
There really shouldn't be any difference between the two for us.
Fixes a bug where Z16 renderbuffers would be untiled on gen6, likely
leading to hangs.
(cherry picked from commit 29c4f95cbc)
(cherry picked from commit 4e0d6cf7ba)
2011-02-21 13:48:46 -08:00
Ian Romanick
0f3a9643c6 Use C-style system headers in C++ code to avoid issues with std:: namespace
Based on commit 497baf4e4a from master.
2011-02-21 13:19:05 -08:00
Eric Anholt
59422a1716 glsl: Fix the lowering of variable array indexing to not lose write_masks.
Fixes glsl-complex-subscript on 965.
(cherry picked from commit c00bc13564)
2011-02-21 13:19:05 -08:00
Marek Olšák
231e72cdbd mesa: fix texture3D mipmap generation for UNSIGNED_BYTE_3_3_2
(cherry picked from commit d5a1325f81)
2011-02-16 20:53:39 +01:00
Bryce Harrington
da623c9c44 r300g: Null pointer check for buffer deref in gallium winsys
radeon_drm_bufmgr_create_buffer_from_handle() can return NULL buffers
sometimes (seen when alt-tabbing in compiz).  Avoid dereferencing the
buffer pointer in this case.

Ref.: https://bugs.launchpad.net/ubuntu/+source/mesa/+bug/691653
Also: https://bugzilla.redhat.com/show_bug.cgi?id=660143

Signed-off-by: Bryce Harrington <bryce@canonical.com>
2011-02-11 02:32:48 +01:00
Vinson Lee
175f3c9674 ralloc: Add missing va_end following va_copy.
(cherry picked from commit cde443e0b9)
2011-02-07 15:03:10 -08:00
Kenneth Graunke
4e4a9d4050 Remove the talloc sources from the Mesa repository.
(cherry picked from commit 1568b19e3b)
2011-02-07 15:02:30 -08:00
Kenneth Graunke
f7993b66a6 Remove talloc from the SCons build system.
(cherry picked from commit 1f4fbc56e52ff2215f7eac7fc84ef8d8a8ec3c2f)

Conflicts:
	src/gallium/targets/libgl-gdi/SConscript
	src/mesa/SConscript
2011-02-07 15:02:30 -08:00
Kenneth Graunke
7f1a7a26e0 Remove talloc from the make and automake build systems.
(cherry picked from commit d610a57c8c69a0197ac7c3d0b22be1b8f0dc446f)
2011-02-07 15:02:30 -08:00
Kenneth Graunke
cdcc5da9fe ralloc: a new MIT-licensed recursive memory allocator.
(cherry picked from commit 42fd9c2ebb)
2011-02-07 15:02:30 -08:00
Kenneth Graunke
5afd1d6ac2 Convert everything from the talloc API to the ralloc API.
(cherry-picked from 2ac83dba30dfe6f61b2c9639100acbb329ac4543)

Conflicts:
	src/glsl/ast_function.cpp
	src/glsl/glcpp/glcpp.c
	src/glsl/glsl_parser_extras.cpp
	src/glsl/ir.cpp
	src/glsl/ir.h
	src/glsl/ir_explog_to_explog2.cpp
	src/glsl/ir_mat_op_to_vec.cpp
	src/glsl/ir_sub_to_add_neg.cpp
	src/glsl/lower_texture_projection.cpp
	src/glsl/lower_variable_index_to_cond_assign.cpp
	src/glsl/lower_vector.cpp
	src/mesa/drivers/dri/i965/brw_cubemap_normalize.cpp
	src/mesa/drivers/dri/i965/brw_fs.cpp
	src/mesa/drivers/dri/i965/brw_fs.h
	src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp
	src/mesa/main/shaderapi.c
	src/mesa/main/shaderobj.h
	src/mesa/program/ir_to_mesa.cpp
	src/mesa/program/register_allocate.c
	src/mesa/program/sampler.cpp
2011-02-07 15:02:30 -08:00
Kenneth Graunke
c9954dab04 ralloc: Add a fake implementation of ralloc based on talloc.
(cherry picked from commit dc55254f5b)

Conflicts:
	src/glsl/SConscript
2011-02-07 15:02:30 -08:00
Kenneth Graunke
e33d9b48c4 glcpp: Remove use of talloc reference counting.
We almost always want to simply steal; we only need to copy when copying
a token list (in which case we're already cloning stuff anyway).

(cherry picked from commit 6ecee54a9a)
2011-02-07 15:02:30 -08:00
Kenneth Graunke
f5bef74066 glsl, i965: Remove unnecessary talloc includes.
These are already picked up by ir.h or glsl_types.h.

(cherry picked from commit e256e4743c)
2011-02-07 15:02:30 -08:00
Kenneth Graunke
5e8523895a glsl: Don't bother unsetting a destructor that was never set.
This was totally copied and pasted from glsl_symbol_table.

(cherry picked from commit 21031b4e88)
2011-02-07 15:02:29 -08:00
Ian Romanick
ccc11aacbb docs: Update 7.9.2 release notes
Add recent cherry picks for precision qualifers, linker bugs, and other issues.
2011-02-04 16:53:25 -08:00
Eric Anholt
9acbde11f5 i965/vs: When MOVing to produce ABS, strip negate of the operand.
We were returning the negative absolute value, instead of the absolute
value.  Fixes glsl-vs-abs-neg.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>

(cherry picked from commit 9351ef7a44)
2011-02-04 16:53:25 -08:00
Eric Anholt
6c6894eac7 docs: Add a relnote for the Civ IV on i965. 2011-02-04 16:53:24 -08:00
Eric Anholt
41d4af17a1 i965: Avoid double-negation of immediate values in the VS.
In general, we have to negate in immediate values we pass in because
the src1 negate field in the register description is in the bits3 slot
that the 32-bit value is loaded into, so it's ignored by the hardware.
However, the src0 negate field is in bits1, so after we'd negated the
immediate value loaded in, it would also get negated through the
register description.  This broke this VP instruction in the position
calculation in civ4:

MAD TEMP[1], TEMP[1], CONST[256].zzzz, CONST[256].-y-y-y-y;

Bug #30156
(cherry picked from commit 1d1ad6306d)
2011-02-04 16:53:24 -08:00
Chris Wilson
bf3932aad6 intel: Check for unsupported texture when finishing using as a render target
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=32541
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
(cherry picked from commit 8b9570e685)
2011-02-04 18:17:46 -06:00
Ian Romanick
2b1150170a linker: Propagate max_array_access while linking functions
Update the max_array_access of a global as functions that use that
global are pulled into the linked shader.

Fixes piglit test glsl-fs-implicit-array-size-01 and bugzilla #33219.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
(cherry picked from commit 0f4b2a0a23)
2011-02-04 15:18:20 -08:00
Ian Romanick
a46bc59b27 linker: Set sizes for non-global arrays as well
Previously only global arrays with implicit sizes would be patched.
This causes all arrays that are actually accessed to be sized.

Fixes piglit test glsl-fs-implicit-array-size-02.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
(cherry picked from commit c87e9ef4d2)
2011-02-04 15:18:15 -08:00
Ian Romanick
1f34edbbde glsl: Don't assert when the value returned by a function has no rvalue
The rvalue of the returned value can be NULL if the shader says
'return foo();' and foo() is a function that returns void.

Existing GLSL specs do *NOT* say that this is an error.  The type of
the return value is void.  If the return type of the function is also
void, then this should compile without error.  I expect that future
versions of the GLSL spec will fix this (wink, wink, nudge, nudge).

Fixes piglit test glsl-1.10/compiler/expressions/return-01.vert and
bugzilla #33308.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
(cherry picked from commit 2db46fe5f0)
2011-02-04 15:18:06 -08:00
Kenneth Graunke
427d574920 glsl: Expose a public glsl_type::void_type const pointer.
This is analogous to glsl_type::int_type and all the others.
(cherry picked from commit 5c229e5fbd)
2011-02-04 15:18:00 -08:00
Chad Versace
13711c8a5a glsl: Mark 'in' variables at global scope as read-only
Fixes Piglit tests:
spec/glsl-1.30/compiler/storage-qualifiers/static-write-centroid-in-01.frag
spec/glsl-1.30/compiler/storage-qualifiers/static-write-in-01.frag
spec/glsl-1.30/compiler/storage-qualifiers/static-write-in-02.frag

(cherry picked from commit 01a584d093)

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2011-02-04 15:16:56 -08:00
Chad Versace
3ddf406530 glsl: Fix segfault due to missing printf argument
Fixes the following Piglit tests:
glslparsertest/shaders/array2.frag
glslparsertest/shaders/dataType6.frag

NOTE: This is a candidate for the 7.9 and 7.10 branches.
(cherry picked from commit 46f7105df4)
2011-02-04 14:37:06 -08:00
Chad Versace
a246791c20 glsl: Fix semantic checks on precision qualifiers
The check for
   Precision qualifiers only apply to floating point and integer types.
was incomplete. It rejected only type 'bool' and structures.
(cherry picked from commit 45e8e6c6b1)
2011-02-04 14:36:23 -08:00
Ian Romanick
b481b8059d glsl: Refresh autogenerated lexer and parser files.
For the previous few commits.
2011-02-04 14:35:59 -08:00
Chad Versace
6fc2c15dbd glsl: Remove redundant semantic check in parser
The removed semantic check also exists in ast_type_specifier::hir(), which
is a more natural location for it.

The check verified that precision statements are applied only to types
float and int.
(cherry picked from commit a9bf8c12ee)
2011-02-04 14:33:50 -08:00
Chad Versace
f5819379ed glsl: Add support for default precision statements
* Add new field ast_type_specifier::is_precision_statement.
* Add semantic checks in ast_type_specifier::hir().
* Alter parser rules accordingly.
(cherry picked from commit 08a286c9cc)
2011-02-04 14:33:37 -08:00
Chad Versace
dbc19fe94c glsl: Add semantic checks for precision qualifiers
* Check that precision qualifiers only appear in language versions 1.00,
  1.30, and later.
* Check that precision qualifiers do not apply to bools and structs.

Fixes the following Piglit tests:
* spec/glsl-1.30/precision-qualifiers/precision-bool-01.frag
* spec/glsl-1.30/precision-qualifiers/precision-struct-01.frag
* spec/glsl-1.30/precision-qualifiers/precision-struct-02.frag

(cherry picked from commit 889e1a5b6c)

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2011-02-04 14:33:12 -08:00
Chad Versace
6292060193 glsl: Change default value of ast_type_specifier::precision
Change default value to ast_precision_none, which denotes the absence of
a precision of a qualifier.

Previously, the default value was ast_precision_high. This made it
impossible to detect if a precision qualifier was present or not.
(cherry picked from commit aaa31bf8f4)
2011-02-04 14:31:36 -08:00
Chad Versace
378910ab97 glsl: Fix parser rule for type_specifier
Do not assign a value to ast_type_specifier::precision when no precision
qualifier is present.
(cherry picked from commit 33279cd2d3)
2011-02-04 14:31:30 -08:00
Ian Romanick
2925a5a1f5 i965: Make OPCODE_KIL_NV do its work in a temp, not the null reg!
This is similar to commit 0efea25c in 7.10.  The change was made
directly in the 7.9 branch because the affected code does not exist in
Mesa 7.10 or later.  It was removed with the change to the new
fragment shader back-end.

Fixes the GPU hang in piglit test glsl-fs-discard-03.
2011-02-04 10:05:56 -08:00
Ian Romanick
b632543289 docs: Update 7.9.2 release notes
Replace "Fix an error in uniform arrays in row calculating" with the
actual bugzilla that was fixed.
2011-01-26 10:16:19 -08:00
Ian Romanick
9e15c878bb mesa: bump version to 7.9.2-devel 2011-01-25 16:27:22 -08:00
Ian Romanick
ab6c7bbf4e docs: Initial set of release notes for 7.9.2 2011-01-25 16:22:26 -08:00
Jian Zhao
e4c1bcacef mesa: fix an error in uniform arrays in row calculating.
Fix the error in uniform row calculating, it may alloc one line
more which may cause out of range on memory usage, sometimes program
aborted when free the memory.

NOTE: This is a candidate for 7.9 and 7.10 branches.

Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 2a7380e9c3)
2011-01-19 10:58:06 -08:00
Ian Romanick
179edc673b glsl: Allow 'in' and 'out' when 'layout' is also available
All of the extensions that add the 'layout' keyword also enable (and
required) the use of 'in' and 'out' with shader globals.

This is related to (piglit) bugzilla #31804.

NOTE: This is a candidate for the 7.9 and 7.10 branches.

(cherry picked from commit 82c4b4f88a)
2011-01-19 10:50:35 -08:00
Ian Romanick
48e81e3b9e glsl: Track variable usage, use that to enforce semantics
In particular, variables cannot be redeclared invariant after being
used.

Fixes piglit test invariant-05.vert and bugzilla #29164.

NOTE: This is a candidate for the 7.9 and 7.10 branches.

(cherry picked from commit bd33055ef4)
2011-01-19 10:48:39 -08:00
Ian Romanick
1785904c5c glsl: Disallow 'in' and 'out' on globals in GLSL 1.20
Fixes piglit tests glsl-1.20/compiler/qualifiers/in-01.vert and
glsl-1.20/compiler/qualifiers/out-01.vert and bugzilla #32910.

NOTE: This is a candidate for the 7.9 and 7.10 branches.  This patch
also depends on the previous two commits.

(cherry picked from commit 469ea695bb)
2011-01-19 10:47:32 -08:00
Ian Romanick
28d47fed61 glsl & glcpp: Refresh autogenerated lexer and parser files.
For the previous few commits.
2011-01-19 10:46:15 -08:00
Ian Romanick
df033be3f7 glsl: Add version_string containing properly formatted GLSL version
(cherry picked from commit eebdfdfbcf)
2011-01-19 10:43:03 -08:00
Ian Romanick
ef2f4b5469 glcpp: Generate an error for division by zero
When GCC encounters a division by zero in a preprocessor directive, it
generates an error.  Since the GLSL spec says that the GLSL
preprocessor behaves like the C preprocessor, we should generate that
same error.

It's worth noting that I cannot find any text in the C99 spec that
says this should be an error.  The only text that I can find is line 5
on page 82 (section 6.5.5 Multiplicative Opertors), which says,

    "The result of the / operator is the quotient from the division of
    the first operand by the second; the result of the % operator is
    the remainder. In both operations, if the value of the second
    operand is zero, the behavior is undefined."

Fixes 093-divide-by-zero.c test and bugzilla #32831.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
(cherry picked from commit 9ca5300b6e)
2011-01-19 10:42:55 -08:00
Chad Versace
8d1e0de5f7 glcpp: Fix segfault when validating macro redefinitions
In _token_list_equal_ignoring_space(token_list_t*, token_list_t*), add
a guard that prevents dereferncing a null token list.

This fixes test src/glsl/glcpp/tests/092-redefine-macro-error-2.c and
Bugzilla #32695.
(cherry picked from commit 4fff52f1c9)
2011-01-19 10:42:45 -08:00
Chad Versace
5f9c50053c glsl: At link-time, check that globals have matching centroid qualifiers
Fixes bug 31923: http://bugs.freedesktop.org/show_bug.cgi?id=31923
(cherry picked from commit 61428dd2ab)
2011-01-19 10:42:38 -08:00
Ian Romanick
7757980139 glsl: Support the 'invariant(all)' pragma
Previously the 'STDGL invariant(all)' pragma added in GLSL 1.20 was
simply ignored by the compiler.  This adds support for setting all
variable invariant.

In GLSL 1.10 and GLSL ES 1.00 the pragma is ignored, per the specs,
but a warning is generated.

Fixes piglit test glsl-invariant-pragma and bugzilla #31925.

NOTE: This is a candidate for the 7.9 and 7.10 branches.

(cherry-picked from commit 86b4398cd1)
2011-01-19 10:42:00 -08:00
Brian Paul
dab59f70e6 draw: Fix an off-by-one bug in a vsplit assertion.
When use_spoken is true, istart (the first vertex of this segment) is
replaced by i0 (the spoken vertex of the fan).  There are still icount
vertices.

Thanks to Brian Paul for spotting this.
(cherry picked from commit abbb1c8f08)
2011-01-13 11:35:24 -07:00
Alberto Milone
4200c6bae4 r600c: add evergreen ARL support.
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
2011-01-11 14:49:30 -05:00
Marek Olšák
67aeab0b77 docs: fix messed up names with special characters in relnotes-7.9.1 2011-01-08 02:54:51 +01:00
Ian Romanick
f912245ed1 docs: Add 7.9.1 md5sums 2011-01-07 13:31:30 -08:00
Ian Romanick
42a9472dc6 docs: Add change log to 7.9.1 release notes 2011-01-07 13:28:22 -08:00
Ian Romanick
234144b48d mesa: set version string to 7.9.1 2011-01-07 12:16:29 -08:00
Ian Romanick
3d90628138 docs: Initial set of release notes for 7.9.1 2011-01-07 12:12:55 -08:00
Marek Olšák
d0f0a6920b r300/compiler: disable the rename_regs pass for loops
This workaround fixes rendering of kwin thumbnails.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
(cherry picked from commit 8543902bfb)

Conflicts:

	src/mesa/drivers/dri/r300/compiler/radeon_rename_regs.c
2011-01-07 07:25:12 +01:00
Chia-I Wu
110c49fddd egl: Check extensions.
Do not call into the driver if the extension for the called function is
not enabled.
(cherry picked from commit 6b2f1561ad)
2011-01-07 12:43:38 +08:00
Chia-I Wu
c438a09b4c egl_glx: Fix borken driver.
The driver was broken since 6eda3f311b.
All configs fail to pass _eglValidateConfig.  This fix might not be
complete, but at least EGL demos run.

This fixes bug #32825.
2011-01-05 18:54:44 +08:00
Brian Paul
0ab166d556 mesa: Bump the number of bits in the register index.
More than 1023 temporaries were being used for a Cinebench shader before
doing temporary optimization, causing the index value to wrap around to
-1024.
(cherry picked from commit a9fa0f3a2f)
2011-01-04 11:10:19 -07:00
Kenneth Graunke
b50658c804 i965: Internally enable GL_NV_blend_square on ES2.
Hopefully should fix bug #32520.
(cherry picked from commit 6bb1e4541e)
2011-01-04 09:50:14 -08:00
Kenneth Graunke
3c8dd6a8de Fix build on systems where "python" is python 3.
First, it changes autoconf to use a "python2" binary when available,
rather than plain "python" (which is ambiguous).  Secondly, it changes
the Makefiles to use $(PYTHON) $(PYTHON_FLAGS) rather than calling
python directly.

Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
Signed-off-by: Matthew William Cox <matt@mattcox.ca>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 3acc826520)
2011-01-04 09:50:14 -08:00
Marek Olšák
801e26a02a mesa: fix texel store functions for some float formats
These are copy-paste errors obviously.
(cherry picked from commit bf7b6f60ae)
2011-01-04 09:50:14 -08:00
Ian Romanick
247774085c Refresh autogenerated file builtin_function.cpp.
See also a954dbeb.
2011-01-04 09:50:14 -08:00
Kenneth Graunke
d5d573b592 glsl/builtins: Compute the correct value for smoothstep(vec, vec, vec).
These mistakenly computed 't' instead of t * t * (3.0 - 2.0 * t).

Also, properly vectorize the smoothstep(float, float, vec) variants.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
(cherry picked from commit d7423a6531)
2011-01-04 09:50:14 -08:00
Brian Paul
54c2846f23 st/mesa: fix renderbuffer pointer check in st_Clear()
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=30694

NOTE: This is a candidate for the 7.9 and 7.10 branches.
(cherry picked from commit efbd33aff9)
2011-01-04 08:00:25 -07:00
Brian Paul
8941450010 tdfx: s/Format/_BaseFormat/
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=31560
(cherry picked from commit d18df9e336)
2011-01-04 07:53:44 -07:00
Brian Paul
0ff45dd5d7 mesa: no-op glBufferSubData() on size==0
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=31439

NOTE: this is a candidate for the 7.9 branch
(cherry picked from commit 6e2e136428)
2011-01-03 17:05:24 -08:00
Kenneth Graunke
4e7cdca57a Remove OES_compressed_paletted_texture from the ES2 extension list.
We don't support it.
(cherry picked from commit d0f8eea9a0)
2011-01-03 17:05:24 -08:00
Brian Paul
69cc356832 glsl: new glsl_strtod() wrapper to fix decimal point interpretation
We always want to use '.' as the decimal point.

See http://bugs.freedesktop.org/show_bug.cgi?id=24531

NOTE: this is a candidate for the 7.10 branch.

(cherry picked from commit bb10e081c8)
2011-01-03 17:05:24 -08:00
Ian Romanick
0d98ceb4bf ir_to_mesa: Don't generate swizzles for record derefs of non-scalar/vectors
This is the same as what the array dereference handler does.

Fixes piglit test glsl-link-struct-array (bugzilla #31648).

NOTE: This is a candidate for the 7.9 and 7.10 branches.
(cherry picked from commit 2d577ee730)
2011-01-03 17:05:24 -08:00
Ian Romanick
40390b80e9 linker: Allow built-in arrays to have different sizes between shader stages
Fixes pitlit test glsl-link-varying-TexCoord (bugzilla #31650).
(cherry picked from commit cb2b547a47)
2011-01-03 17:05:24 -08:00
Henri Verbeet
7ffeced927 st/mesa: Handle wrapped depth buffers in st_copy_texsubimage().
(cherry picked from commit 59051ad443)
2010-12-31 07:51:53 +01:00
Henri Verbeet
b8c16ee7b1 r600: Evergreen has two extra frac_bits for the sampler LOD state.
Note: this is a candidate for the 7.9 branch.
(cherry picked from commit 228d0d1153)
2010-12-31 07:51:49 +01:00
Brian Paul
f5435ec3a9 st/mesa: fix mipmap generation bug
In st_finalize_texture() we were looking at the st_texture_object::
lastLevel field instead of the pipe_resource::last_level field to
determine which resource to store the mipmap in.

Then, in st_generate_mipmap() we need to call st_finalize_texture() to
make sure the destination resource is properly allocated.

These changes fix the broken piglit fbo-generatemipmap-formats test.
(cherry picked from commit cae2bb76c1)
2010-12-30 17:40:07 +01:00
richard
a3740ba31e r600c : inline vertex format is not updated in an app, switch to use vfetch constants. For the 7.9 and 7.10 branches as well. 2010-12-29 10:54:44 -05:00
Alex Deucher
166da97889 r600c: fix some opcodes on evergreen
There were a few places where we were using the wrong opcodes
on evergreen.  arl still needs to be fixed on evergreen; see
r600g for reference.

NOTE: This is a candidate for the 7.9 branch.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2010-12-29 10:54:14 -05:00
Luca Barbieri
2fb170c90f glsl: Unroll loops with conditional breaks anywhere (not just the end)
Currently we only unroll loops with conditional breaks at the end, which is
the form that lower_jumps generates.

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

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

Fixes glsl-mat-attribute.
(cherry picked from commit b13a2e640f)
2010-12-27 13:11:54 -08:00
Fabian Bieler
9d1c6dd79b glsl: fix lowering conditional returns in subroutines
this fix applies to the lower_sub_return 'branch' of the lower_jumps pass

Fixes piglit tests glsl-functions-5 and glsl-functions-6.
(cherry picked from commit ef534f3838)
2010-12-27 13:11:26 -08:00
Chia-I Wu
47552b2c66 mesa: Do not advertise GL_OES_texture_3D.
GL_OES_texture_3D has a GLSL counterpart.  Since it is not implemented,
GL_OES_texture_3D should not be advertised.
(cherry picked from commit d2028ba339)
2010-12-27 13:11:26 -08:00
Ian Romanick
edfe057f94 linker: Fix regressions caused by previous commit
That's what I get for not running piglit before pushing.

Don't try to patch types of unsized arrays when linking fails.

Don't try to patch types of unsized arrays that are shared between
shader stages.
(cherry picked from commit 002cd2c8d4)
2010-12-27 13:11:26 -08:00
Ian Romanick
a4cda571f0 linker: Ensure that unsized arrays have a size after linking
Fixes piglit test case glsl-vec-array (bugzilla #31908).

NOTE: This bug does not affect 7.9, but I think this patch is a
candiate for the 7.9 branch anyway.
(cherry picked from commit 6f53921c4b)
2010-12-27 13:09:26 -08:00
Eric Anholt
ecb68d51aa i965: Correct the dp_read message descriptor setup on g4x.
It's mostly like gen4 message descriptor setup, except that the sizes
of type/control changed to be like gen5.  Fixes 21 piglit cases on
gm45, including the regressions in bug #32311 from increased VS
constant buffer usage.
(cherry picked from commit 5dc53444c8)
2010-12-23 14:27:11 -08:00
Marek Olšák
be1f4cfd96 r300g: finally fix the texture corruption on r3xx-r4xx
Even though a bound texture stays bound when calling set_fragment_sampler_views,
it must be assigned a new cache region depending on the occupancy of other
texture units.

This fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=28800

Thanks to Álmos <aaalmosss@gmail.com> for finding the bug in the code.

NOTE: This is a candidate for both the 7.9 and 7.10 branches.
(cherry picked from commit daffaca53e)

Conflicts:

	src/gallium/drivers/r300/r300_state.c
2010-12-18 10:17:52 +01:00
Ian Romanick
7b6b66d617 glsl: Inherrit type of declared variable from initializer after processing assignment
do_assignment may apply implicit conversions to coerce the base type
of initializer to the base type of the variable being declared.  Fixes
piglit test glsl-implicit-conversion-02 (bugzilla #32287).  This
probably also fixes bugzilla #32273.

NOTE: This is a candidate for the 7.9 branch and the 7.10 branch.
(cherry picked from commit d7f27e2e76)

Conflicts:

	src/glsl/ast_to_hir.cpp
2010-12-17 13:51:46 -08:00
Ian Romanick
2b4277dcf3 glsl: Inherrit type of declared variable from initializer
Types of declared variables and their initializer must match excatly
except for unsized arrays.  Previously the type inherritance for
unsized arrays happened implicitly in the emitted assignment.
However, this assignment is never emitted for uniforms.  Now that type
is explicitly copied unconditionally.

Fixes piglit test array-compare-04.vert (bugzilla #32035) and
glsl-array-uniform-length (bugzilla #31985).

NOTE: This is a candidate for the 7.9 branch.
(cherry picked from commit b0fc5103cb)
2010-12-17 13:51:46 -08:00
Ian Romanick
585fa612c9 glcpp: Commit changes in generated files cause by previous commit 2010-12-17 13:51:45 -08:00
Kenneth Graunke
b8e73354d9 glcpp: Don't emit SPACE tokens in conditional_tokens production.
Fixes glslparsertest defined-01.vert.

Reported-by: José Fonseca <jfonseca@vmware.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Carl Worth <cworth@cworth.org>
(cherry picked from commit 800eed6765)
2010-12-17 13:14:25 -08:00
Eric Anholt
154d0a3e7e mesa: Add getters for ARB_copy_buffer's attachment points.
Fixes more complaints by oglconform.
(cherry picked from commit 43491adc44)
2010-12-17 12:58:15 -08:00
Eric Anholt
7c0ff4a5df mesa: Add getters for the rest of the supported draw buffers.
MAX_DRAW_BUFFERS is 8, so allow all 8 GL_DRAW_BUFFER# to be retrieved.
Fixes complaints by oglconform.
(cherry picked from commit 7cba339375)
2010-12-17 12:57:57 -08:00
Eric Anholt
d192179605 glsl: Fix flipped return of has_value() for array constants.
Fixes glsl-array-uniform.
(cherry picked from commit b381eff141)
2010-12-17 12:57:35 -08:00
Chad Versace
b2cd388b79 glsl: Fix linker bug in cross_validate_globals()
Cause linking to fail if a global has mismatching invariant qualifiers.

See https://bugs.freedesktop.org/show_bug.cgi?id=30261
(cherry picked from commit 7528f143df)
2010-12-17 12:56:40 -08:00
Aras Pranckevicius
bb2cd98e51 glsl: fix matrix type check in ir_algebraic
Fixes glsl-mat-mul-1.
(cherry picked from commit 4ce084c707)
2010-12-16 17:11:50 -08:00
Ian Romanick
d9d4f22e65 glsl: Ensure that equality comparisons don't return a NULL IR tree
This fixes bugzilla #32035 and piglit test case array-compare-01 and
array-compare-02.

NOTE: This is a candidate for the 7.9 branch.
(cherry picked from commit 6d36be508f)
2010-12-16 17:11:50 -08:00
Eric Anholt
d347b90b94 glsl: Mark the array access for whole-array comparisons.
By not doing so, the uniform contents of
glsl-uniform-non-uniform-array-compare.shader_test was getting thrown
out since nobody was recorded as dereferencing the array.
(cherry picked from commit b4f585665c)
2010-12-16 17:11:50 -08:00
Eric Anholt
23a868930c glsl: Quiet unreachable no-return-from-function warning.
(cherry picked from commit d56c97413e)
2010-12-16 16:56:51 -08:00
Eric Anholt
1e88b3461a glsl: Fix structure and array comparisions.
We were trying to emit a single ir_expression to compare the whole
thing.  The backends (ir_to_mesa.cpp and brw_fs.cpp so far) expected
ir_binop_any_nequal or ir_binop_all_equal to apply to at most a vector
(with matrices broken down by the lowering pass).  Break them down to
a bunch of ORed or ANDed any_nequals/all_equals.

Fixes:
glsl-array-compare
glsl-array-compare-02
glsl-fs-struct-equal
glsl-fs-struct-notequal
Bug #31909
(cherry picked from commit ff79633d9f)
2010-12-16 16:56:51 -08:00
Eric Anholt
573c78803d glsl: Add a helper constructor for expressions that works out result type.
This doesn't cover all expressions or all operand types, but it will
complain if you overreach and it allows for much greater slack on the
programmer's part.
(cherry picked from commit 6b937465d4)

The new constructors required some changes because the
ir_quadop_vector changes were not cherry picked over from master.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2010-12-16 16:56:51 -08:00
Ian Romanick
5650cc462d glsl: Add unary ir_expression constructor
(cherry picked from commit 13f57d42b6)
2010-12-16 16:56:51 -08:00
Vinson Lee
54a596e34a glsl: Fix 'control reaches end of non-void function' warning.
Fix this GCC warning.
ir.cpp: In static member function
'static unsigned int ir_expression::get_num_operands(ir_expression_operation)':
ir.cpp:199: warning: control reaches end of non-void function
(cherry picked from commit 855c66bde7)
2010-12-16 16:56:51 -08:00
Kenneth Graunke
2127692542 glsl: Refactor get_num_operands.
This adds sentinel values to the ir_expression_operation enum type:
ir_last_unop, ir_last_binop, and ir_last_opcode.  They are set to the
previous one so they don't trigger "unhandled case in switch statement"
warnings, but should never be handled directly.

This allows us to remove the huge array of 1s and 2s in
ir_expression::get_num_operands().
(cherry picked from commit 007f488150)
2010-12-16 16:56:40 -08:00
Ian Romanick
0795cb71fc i915: Correctly generate unconditional KIL instructions
Fixes piglit test glsl-fs-discard-03.

NOTE: This is a candidate for the 7.9 branch.
(cherry picked from commit c92550be64)
2010-12-16 10:34:59 -08:00
Kenneth Graunke
cefccebd89 glsl: Remove "discard" support from lower_jumps.
The new lower_discard and opt_discard_simplification passes should
handle all the necessary transformations, so lower_jumps doesn't need to
support it.

Also, lower_jumps incorrectly handled conditional discards - it would
unconditionally truncate all code after the discard.  Rather than fixing
the bug, simply remove the code.

NOTE: This is a candidate for the 7.9 branch.
2010-12-16 10:34:59 -08:00
Ian Romanick
927c752dd6 glsl: Add a lowering pass to move discards out of if-statements.
This should allow lower_if_to_cond_assign to work in the presence of
discards, fixing bug #31690 and likely #31983.

NOTE: This is a candidate for the 7.9 branch.
(cherry picked from commit 940df10100)
2010-12-16 10:34:59 -08:00
Marek Olšák
0b4287a687 ir_to_mesa: Add support for conditional discards.
NOTE: This is a candidate for the 7.9 branch.

Signed-off-by: Marek Olšák <maraeo@gmail.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit ead2ea89f4)
2010-12-16 10:34:59 -08:00
Ian Romanick
69d19cb84b glsl: Add an optimization pass to simplify discards.
NOTE: This is a candidate for the 7.9 branch.
(cherry picked from commit 9a1d063c6d)
2010-12-16 10:34:59 -08:00
Ian Romanick
0ab2bb8270 glsl/linker: Free any IR discarded by optimization passes.
Previously, IR for a linked shader was allocated directly out of the
gl_shader object - meaning all of it lived as long as the shader.

Now, IR is allocated out of a temporary context, and any -live- IR is
reparented/stolen to (effectively) the gl_shader.  Any remaining IR can
be freed.

NOTE: This is a candidate for the 7.9 branch.
(cherry picked from commit 2da02e75b1)
2010-12-16 10:34:59 -08:00
Kenneth Graunke
1e2e387a15 glsl: Add a virtual as_discard() method.
NOTE: This is candidate for the 7.9 branch.
(cherry picked from commit 1eb7a81f2e)
2010-12-16 10:34:59 -08:00
Marek Olšák
dcc7a8a80a r300g: fix rendering with a vertex attrib having a zero stride
The hardware apparently does support a zero stride, so let's use it.

This fixes missing objects in ETQW, but might also fix a ton of other
similar-looking bugs.

NOTE: This is a candidate for both the 7.9 and 7.10 branches.
(cherry picked from commit 2af8a19831)
2010-12-16 16:55:59 +01:00
Marek Olšák
0a8ad737e7 r300/compiler: fix swizzle lowering with a presubtract source operand
If a source operand has a non-native swizzle (e.g. the KIL instruction
cannot have a swizzle other than .xyzw), the lowering pass uses one or more
MOV instructions to move the operand to an intermediate temporary with
native swizzles.

This commit fixes that the presubtract information was lost during
the lowering.

NOTE: This is a candidate for both the 7.9 and 7.10 branches.
(cherry picked from commit d0990db6bd)
2010-12-16 16:55:16 +01:00
Dave Airlie
4b19941399 r300g: fixup rs690 tiling stride alignment calculations.
The RS690 memory controller prefers things to be on a different
boundary than the discrete GPUs, we had an attempt to fix this,
but it still failed, this consolidates the stride calculation
into one place and removes the really special case check.

This fixes gnome-shell and 16 piglit tests on my rs690 system.

NOTE: This is a candidate for both the 7.9 and 7.10 branches.

Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 32218e4cc8)
2010-12-16 18:15:25 +10:00
Ian Romanick
1cfd517b15 i915: Disallow alpha, red, RG, and sRGB as render targets
Fixes bugzilla #31832

NOTE: This is a candidate for the 7.9 branch.
(cherry picked from commit 78a340fd48)
2010-12-15 15:11:01 -08:00
Eric Anholt
a0d5da96b5 i965: Add support for rendering to SARGB8 FBOs.
Tested with fbo-generatemipmap-formats GL_EXT_texture_srgb.  The test
still fails on SLA8, though.
(cherry picked from commit 1946b81e70)
2010-12-15 14:39:58 -08:00
Kenneth Graunke
50ec3c74e3 glsl: Don't inline function prototypes.
Currently, the standalone compiler tries to do function inlining before
linking shaders (including linking against the built-in functions).
This resulted in the built-in function _prototypes_ being inlined rather
than the actual function definition.

This is only known to fix a bug in the standalone compiler; most
programs should be unaffected.  Still, it seems like a good idea.

NOTE: This is a candidate for the 7.9 branch.
(cherry picked from commit e8a24c65bc)
2010-12-15 14:38:37 -08:00
Kenneth Graunke
d595657e5a glsl: Use do_common_optimization in the standalone compiler.
NOTE: This is a candidate for the 7.9 branch.
(cherry picked from commit a82592de92)
2010-12-15 14:38:37 -08:00
Ian Romanick
c055239bae mesa: Fix glGet of ES2's GL_MAX_*_VECTORS properties.
Previously, the get table listed all three as having custom locations,
yet find_custom_value did not have cases to handle them.

MAX_VARYING_VECTORS does not need a custom location since MaxVaryings is
already stored as float[4] (or vec4).  MaxUniformComponents is stored as
the number of floats, however, so a custom implementation that divides
by 4 is necessary.

Fixes bugs.freedesktop.org #31495.
(cherry picked from commit 1197393faa)

Conflicts:

	src/mesa/main/get.c

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2010-12-15 14:38:37 -08:00
Kristian Høgsberg
6b96b002c8 i965: Don't write mrf assignment for pointsize output
https://bugs.freedesktop.org/show_bug.cgi?id=31894
(cherry picked from commit a889f9ee5c)
2010-12-15 14:38:37 -08:00
Ian Romanick
ce8f4f266e glsl: better handling of linker failures
Upon link error, exit translation loop, free program instructions.
Check for null pointers in calling code.
(cherry picked from commit 6162773ea4)
2010-12-15 14:25:42 -08:00
Brian Paul
e0dbd44a00 glsl: fix off by one in register index assertion
(cherry picked from commit 50fd99d172)
2010-12-15 14:24:09 -08:00
Kenneth Graunke
67b7a3844a glsl: Fix constant expression handling for <, >, <=, >= on vectors.
ir_binop_less, ir_binop_greater, ir_binop_lequal, and ir_binop_gequal
are defined to work on vectors as well as scalars, as long as the two
operands have the same type.

This is evident from both ir_validate.cpp and our use of these opcodes
in the GLSL lessThan, greaterThan, lessThanEqual, greaterThanEqual
built-in functions.

Found by code inspection.  Not known to fix any bugs.  Presumably, our
tests for the built-in comparison functions must pass because C.E.
handling is done on the ir_call of "greaterThan" rather than the inlined
opcode.  The C.E. handling of the built-in function calls is correct.

NOTE: This is a candidate for the 7.9 branch.
(cherry picked from commit e16c9d5d03)
2010-12-15 14:19:16 -08:00
Chad Versace
69cc62b907 glsl: Fix erroneous cast in ast_jump_statement::hir()
Return values were erroneously cast from (ir_rvalue*) to (ir_expression*).

NOTE: This is a candidate for the 7.9 branch.
(cherry picked from commit b4cdba687c)
2010-12-15 14:19:07 -08:00
Kenneth Graunke
8c8c1b2c99 glsl: Unconditionally define GL_FRAGMENT_PRECISION_HIGH in ES2 shaders.
This is really supposed to be defined only if the driver supports highp
in the fragment shader - but all of our current ES2 implementations do.
So, just define it.  In the future, we'll need to add a flag to
gl_context and only define the macro if the flag is set.

"Fixes" freedesktop.org bug #31673.
(cherry picked from commit d719bf8fb4)
2010-12-15 14:18:01 -08:00
Kenneth Graunke
9b8e56a502 glcpp: Define GL_FRAGMENT_PRECISION_HIGH if GLSL version >= 1.30.
Per section 4.5.4 of the GLSL 1.30 specification.
(cherry picked from commit 3fb83038a0)
2010-12-15 14:17:51 -08:00
Robert Hooker
5a8d1d5b72 egl_dri2: Add missing intel chip ids.
Signed-off-by: Robert Hooker <robert.hooker@canonical.com>
(cherry picked from commit 778917069c)
2010-12-15 14:17:29 -08:00
Robert Hooker
029252a448 intel: Add a new B43 pci id.
Signed-off-by: Robert Hooker <robert.hooker@canonical.com>
(cherry picked from commit e8b2d36723)
2010-12-15 14:17:11 -08:00
Peter Clifton
4b30da86a7 intel: Fix emit_linear_blit to use DWORD aligned width blits
The width of the 2D blits used to copy the data is defined as a 16-bit
signed integer, but the pitch must be DWORD aligned. Limit to an integral
number of DWORDs, (1 << 15 - 4) rather than (1 << 15 -1).

Fixes corruption to data uploaded with glBufferSubData.

Signed-off-by: Peter Clifton <pcjc2@cam.ac.uk>
(cherry picked from commit 10b9e018ca)
2010-12-15 12:39:53 -08:00
Eric Anholt
da5d6c42c0 i965: Allow OPCODE_SWZ to put immediates in the first arg.
Fixes assertion failure with texture swizzling in the GLSL path when
it's triggered (such as gen6 FF or ARB_fp shadow comparisons).

Fixes:
texdepth
texSwizzle
fp1-DST test
fp1-LIT test 3
(cherry picked from commit f00929cbdd)
2010-12-15 12:36:01 -08:00
Eric Anholt
0c56721cfc glsl: Free the loop state context when we free the loop state.
Since this was talloced off of NULL instead of the compile state, it
was a real leak over the course of the program.  Noticed with
valgrind --leak-check=full --show-reachable=yes.  We should really
change these passes to generally get the compile context as an argument
so simple mistakes like this stop mattering.
(cherry picked from commit 6929cdd14b)
2010-12-15 12:26:59 -08:00
Aras Pranckevicius
6333f1d224 glsl: fix crash in loop analysis when some controls can't be determined
Fixes loop-07.frag.
(cherry picked from commit d67df5dd9d)
2010-12-15 12:26:34 -08:00
Ian Romanick
639e65e054 mesa: Allow query of MAX_SAMPLES with EXT_framebuffer_multisample
Previously queries of MAX_SAMPLES were only allowed with
ARB_framebuffer_object, but EXT_framebuffer_multisample also enables
this query.  This seems to only effect the i915.  All other drivers
support both extensions or neither extension.

This patch is based on a patch that Kenneth sent along with the report.

NOTE: this is a candidate for the 7.9 branch.

Reported-by: Kenneth Waters <kwaters@chromium.org>
(cherry picked from commit bcef51c3b8)
2010-12-15 12:26:19 -08:00
Ian Romanick
8454f931d6 glsl: Fix incorrect gl_type of sampler2DArray and sampler1DArrayShadow
NOTE: this is a candidate for the 7.9 branch.
(cherry picked from commit 956ae44dcf)
2010-12-15 12:24:45 -08:00
Chad Versace
0da1c7b90f glsl: Fix ir_expression::constant_expression_value()
When the type of the ir_expression is error_type, return NULL.
This fixes bug 31371.
(cherry picked from commit b62c1c4595)
2010-12-15 12:24:25 -08:00
Kenneth Graunke
6e5907c390 ir_dead_functions: Actually free dead functions and signatures.
This makes linked shaders use around 36k less memory since the
built-in prototypes are now freed.
(cherry picked from commit a457ca7844)
2010-12-15 12:24:15 -08:00
Francisco Jerez
4c1db8c7a4 meta: Don't try to disable cube maps if the driver doesn't expose the extension.
Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 8eaa97592a)
2010-12-15 12:20:20 -08:00
Francisco Jerez
edd9b9350e meta: Fix incorrect rendering of the bitmap alpha component.
Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 7831994868)
2010-12-15 12:19:02 -08:00
Francisco Jerez
5c71690096 meta: Don't leak alpha function/reference value changes.
Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit d846362389)
2010-12-15 12:18:44 -08:00
Ian Romanick
44df2b0844 mesa: Make metaops use program refcounts instead of names.
Fixes failure on restoring state when the program was active but
deleted, and the name no longer exists.

Bug #31194
(cherry picked from commit a974949f3b)

Conflicts:

	src/mesa/drivers/common/meta.c
	src/mesa/main/shaderapi.c
	src/mesa/main/shaderapi.h

This required substantial edits because the 7.9 branch doesn't have
the EXT_separate_shader_objects changes.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2010-12-15 12:17:00 -08:00
Brian Paul
5b28db24ff mesa, st/mesa: disable GL_ARB_geometry_shader4
The new GLSL compiler doesn't support geom shaders yet so disable the
GL_ARB_geometry_shader4 extension.  Undo this when geom shaders work again.

NOTE: This is a candidate for the 7.10 branch.

(cherry picked from commit bb7c2691d2)
2010-12-14 16:29:52 -07:00
Brian Paul
2f4af9e37b tnl: a better way to initialize the gl_program_machine memory
This improves commit ef3f7e61b3

NOTE: This is a candidate for the 7.9 and 7.10 branches.

(cherry picked from commit 6577f753b2)
2010-12-14 16:29:39 -07:00
Brian Paul
34e0da8e73 tnl: Initialize gl_program_machine memory in run_vp.
Fixes piglit valgrind glsl-array-bounds-04 failure (FDO bug 29946).

NOTE:
This is a candidate for the 7.10 branch.
This is a candidate for the 7.9 branch.

(cherry picked from commit ef3f7e61b3)
2010-12-14 16:29:06 -07:00
Brian Paul
1ee289960f mesa: test for cube map completeness in glGenerateMipmap()
The texture is not cube complete if the base level images aren't of
the same size and format.

NOTE: This is a candidate for the 7.9 branch.

(cherry picked from commit ecb7cc3319)
2010-12-14 16:28:14 -07:00
Brian Paul
22ba37aae2 mesa: make glGet*(GL_NONE) generate GL_INVALID_ENUM
In find_value() check if we've hit the 0th/invalid entry before checking
if the pname matches.

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=31987

NOTE: This is a candidate for the 7.9 branch.

(cherry picked from commit 503983b09e)
2010-12-14 16:27:35 -07:00
Brian Paul
3b200dd3c5 mesa: return GL_FRAMEBUFFER_DEFAULT as FBO attachment type
If querying the default/window-system FBO's attachment type, return
GL_FRAMEBUFFER_DEFAULT (per the GL_ARB_framebuffer_object spec).

See http://bugs.freedesktop.org/show_bug.cgi?id=31947

NOTE: This is a candidate for the 7.9 branch.

(cherry picked from commit 6d13ec7dc0)
2010-12-14 16:26:30 -07:00
Brian Paul
5f05ade503 mesa: fix GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME query
Return 0 instead of generating an error.

See http://bugs.freedesktop.org/show_bug.cgi?id=30993

Note that piglit fbo-getframebufferattachmentparameter-01 still does
not pass.  But Mesa behaves the same as the NVIDIA driver in this case.
Perhaps the test is incorrect.

NOTE: This is a candidate for the 7.9 branch.

(cherry picked from commit 20cf1851d8)
2010-12-14 16:26:14 -07:00
Ian Romanick
9ef05d27a6 glsl: Commit lexer files changed by previous cherry picking 2010-12-14 13:10:14 -08:00
Kenneth Graunke
1d63a77177 glsl: Fix constant component count in vector constructor emitting.
Fixes freedesktop.org bug #31101 as well as piglit test cases
assignment-type-mismatch.vert and constructor-28.vert.
(cherry picked from commit ba2382f50d)
2010-12-14 11:55:55 -08:00
Chad Versace
554dbaa8a0 glsl: Fix ast-to-hir for ARB_fragment_coord_conventions
Function ast_declarator_list::hir(), when processing keywords added by
extension ARB_fragment_coord_conventions, made the mistake of checking only if
the extension was __supported by the driver__. The correct behavior is to check
if the extensi0n is __enabled in the parse state__.

NOTE: this is a candidate for the 7.9 branch.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 6e00627384)
2010-12-14 11:55:55 -08:00
Kenneth Graunke
1c089271fd generate_builtins.py: Output large strings as arrays of characters.
This works around MSVC's 65535 byte limit, unfortunately at the expense
of any semblance of readability and much larger file size.  Hopefully I
can implement a better solution later, but for now this fixes the build.
(cherry picked from commit 2cacaf6e7b)
2010-12-14 11:55:54 -08:00
Kenneth Graunke
2c57c020a3 glcpp: Return NEWLINE token for newlines inside multi-line comments.
This is necessary for the main compiler to get correct line numbers.
(cherry picked from commit bd55ba568b)
2010-12-14 11:55:54 -08:00
Ian Romanick
2f398485f2 linker: Improve handling of unread/unwritten shader inputs/outputs
Previously some shader input or outputs that hadn't received location
assignments could slip through.  This could happen when a shader
contained user-defined varyings and was used with either
fixed-function or assembly shaders.

See the piglit tests glsl-[fv]s-user-varying-ff and
sso-user-varying-0[12].

NOTE: this is a candidate for the 7.9 branch.

(cherry picked from commit cc90e62d70)
2010-12-14 11:55:54 -08:00
Ian Romanick
e5ad6c3366 glsl: Slightly change the semantic of _LinkedShaders
Previously _LinkedShaders was a compact array of the linked shaders
for each shader stage.  Now it is arranged such that each slot,
indexed by the MESA_SHADER_* defines, refers to a specific shader
stage.  As a result, some slots will be NULL.  This makes things a
little more complex in the linker, but it simplifies things in other
places.

As a side effect _NumLinkedShaders is removed.

NOTE: This may be a candidate for the 7.9 branch.  If there are other
patches that get backported to 7.9 that use _LinkedShader, this patch
should be cherry picked also.

(cherry picked from commit 3322fbaf3b)
2010-12-14 11:55:54 -08:00
Chad Versace
1c15fb4414 glsl: Fix lexer rule for ^=
The caret is a special character, and needs to be quoted or escaped.
(cherry picked from commit cba9062d58)
2010-12-14 11:55:54 -08:00
Ian Romanick
a138a59966 mesa: Refactor validation of shader targets
Actually validate that the implementation supports the particular
shader target as well.  Previously if a driver only supported vertex
shaders, for example, glCreateShaderObjectARB would gladly create a
fragment shader.

NOTE: this is a candidate for the 7.9 branch.
(cherry picked from commit 5cb24c4a75)
2010-12-14 11:55:54 -08:00
Ian Romanick
6fc544dd50 linker: Reject shaders that have unresolved function calls
This really amounts to just using the return value from
link_function_calls.  All the work was being done, but the result was
being ignored.

Fixes piglit test link-unresolved-funciton.

NOTE: this is a candidate for the 7.9 branch.
(cherry picked from commit 4a45595cf3)
2010-12-14 11:55:54 -08:00
Eric Anholt
42e9750975 intel: Allow CopyTexSubImage to InternalFormat 3/4 textures, like RGB/RGBA.
The format selection of the CopyTexSubImage is pretty bogus still, but
this at least avoids software fallbacks in nexuiz, bringing
performance from 7.5fps to 12.8fps on my machine.
(cherry picked from commit 3316a54205)
2010-12-14 11:55:54 -08:00
Ian Romanick
72a3bddb24 mesa: Validate assembly shaders when GLSL shaders are used
If an GLSL shader is used that does not provide all stages and
assembly shaders are provided for the missing stages, validate the
assembly shaders.

Fixes bugzilla #30787 and piglit tests glsl-invalid-asm0[12].

NOTE: this is a candidate for the 7.9 branch.
(cherry picked from commit b2b9b22c10)
2010-12-14 11:55:54 -08:00
Tom Stellard
e8bc8d6a5c r300/compiler: Don't allow presubtract sources to be remapped twice
https://bugs.freedesktop.org/show_bug.cgi?id=31193

NOTE: This is a candidate for the 7.9 branch.
(cherry picked from commit 4265c2f819)
2010-12-10 11:07:24 -08:00
Alex Deucher
dc4956922d gallium/egl: fix r300 vs r600 loading
Should fix:
https://bugs.freedesktop.org/show_bug.cgi?id=31841
2010-12-07 10:59:20 +10:00
Marek Olšák
b486197013 st/mesa: initialize key in st_vp_varient
This fixes endless vertex shader recompilations in find_translated_vp
if the shader contains an edge flag output.

NOTE: This is a candidate for the 7.9 branch.

Signed-off-by Brian Paul <brianp@vmware.com>
(cherry picked from commit c0c929cdac)
2010-12-06 22:44:04 +01:00
Marek Olšák
2cb8522523 mesa, st/mesa: fix gl_FragCoord with FBOs in Gallium
gl_FragCoord.y needs to be flipped upside down if a FBO is bound.

This fixes:
- piglit/fbo-fragcoord
- https://bugs.freedesktop.org/show_bug.cgi?id=29420

Here I add a new program state STATE_FB_WPOS_Y_TRANSFORM, which is set based
on whether a FBO is bound. The state contains a pair of transformations.
It can be either (XY=identity, ZW=transformY) if a FBO is bound,
or (XY=transformY, ZW=identity) otherwise, where identity = (1, 0),
transformY = (-1, height-1).

A classic driver (or st/mesa) may, based on some other state, choose whether
to use XY or ZW, thus negate the conditional "if (is a FBO bound) ...".
The reason for this is that a Gallium driver is allowed to only support WPOS
relative to either the lower left or the upper left corner, so we must flip
the Y axis accordingly again. (the "invert" parameter in emit_wpos_inversion)

NOTE: This is a candidate for the 7.9 branch.

Signed-off-by: Marek Olšák <maraeo@gmail.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit d531f9c2f5)
2010-12-06 22:43:15 +01:00
Brian Paul
564a6a15fe llvmpipe: fix broken stencil writemask
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=32070
(cherry picked from commit dbf996f308)

Conflicts:

	src/gallium/drivers/llvmpipe/lp_bld_depth.c
2010-12-03 09:47:23 -07:00
Marek Olšák
7d280a3bbe r300g: disable ARB_texture_swizzle if S3TC is enabled on r3xx-only
r3xx cannot swizzle compressed textures. r4xx+ is unaffected.

NOTE: This is a candidate for the 7.9 branch.
(cherry picked from commit fcf6b353bf)
2010-12-01 23:56:56 +01:00
Marek Olšák
988a35c7f7 r300g: fix texture swizzling with compressed textures on r400-r500
This fixes all S3TC piglit/texwrap tests.

NOTE: This is a candidate for the 7.9 branch.
(cherry picked from commit 6478a4de14)
2010-12-01 23:56:56 +01:00
Marek Olšák
4e7548aafc r300g: fix texture border color once again
I made the texwrap test be more thorough and realized that this driver code
had not been quite right. This commit fixes the border color for depth
textures, compressed textures, and 16-bits-per-channel textures
with up to 2 channels (R16, RG16).

NOTE: This is a candidate for the 7.9 branch.
(cherry picked from commit 1f1375d4d8)
2010-12-01 23:56:55 +01:00
Marek Olšák
277655d7fa r300/compiler: fix rc_rewrite_depth_out for it to work with any instruction
It looks like the function was originally written for ARB_fragment_program.

NOTE: This is a candidate for the 7.9 branch.
(cherry picked from commit ae3e58d973)
2010-12-01 23:56:55 +01:00
Marek Olšák
d42db5b738 r300g: fix rendering with no vertex elements
Fixes glsl-vs-point-size, although I meant to fix glsl-novertexdata.
Since swrast fails glsl-novertexdata too, I guess it's a core issue.
(cherry picked from commit ffb732d8bd)
2010-12-01 23:56:51 +01:00
Marek Olšák
62f2b7e759 r300g: fix texture border color for all texture formats
This fixes 8 texwrap format tests.
The code should handle arbitrary formats now and is cleaner.

NOTE: This is a candidate for the 7.9 branch.
(cherry picked from commit 7e2256688a)
2010-12-01 23:38:52 +01:00
Marek Olšák
44ba61c518 r300g: add a default channel ordering of texture border for unhandled formats
It should fix the texture border for compressed textures.
Broken since 8449a4772a.
(cherry picked from commit 676c3f08bd)

Conflicts:

	src/gallium/drivers/r300/r300_state_derived.c
2010-12-01 23:38:36 +01:00
Marek Olšák
1c746ba9d4 r300g: fix texture border for 16-bits-per-channel formats
This is kinda hacky, but it's hard to come up with a generic solution for
all formats when only a few are used in practice (I mostly get B8G8R8*8).
(cherry picked from commit 8449a4772a)
2010-12-01 23:34:59 +01:00
Marek Olšák
c9661d695b r300g: fix microtiling for 16-bits-per-channel formats
(cherry picked from commit d0408cf55d)
2010-12-01 23:33:33 +01:00
Brian Paul
aa7bf2d88e mesa: check for posix_memalign() errors
Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit b1097607db)
2010-11-29 09:21:26 -07:00
Brian Paul
9d644e7b95 st/mesa: fix mapping of zero-sized buffer objects
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=31934

(cherry picked from commit 97ae4dad1c)
2010-11-26 13:53:33 -07:00
Brian Paul
54047fcd8d meta: Mask Stencil.Clear against stencilMax in _mesa_meta_Clear
This fixes incorrect behaviour when the stencil clear value exceeds
the size of the stencil buffer, for example, when set with:

glClearStencil (~1); /* Set a bit pattern of 111...11111110 */
glClear (GL_STENCIL_BUFFER_BIT);

The clear value needs to be masked by the value 2^m - 1, where m is the
number of bits in the stencil buffer. Previously, we passed the value
masked with 0x7fffffff to _mesa_StencilFuncSeparate which then clamps,
NOT masks the value to the range 0 to 2^m - 1.

The result would be clearing the stencil buffer to 0xff, rather than 0xfe.

Signed-off-by: Peter Clifton <pcjc2@cam.ac.uk>
Signed-off-by: Brian Paul <brianp@vmware.com>

(cherry picked from commit ee88727df8)
2010-11-24 12:16:44 -07:00
Thomas Hellstrom
bcdd93e3a7 gallium/targets: Trivial crosscompiling fix
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-11-23 11:43:52 +01:00
Thomas Hellstrom
75065b0b55 svga/drm: Optionally resolve calls to powf during link-time
When linked with certain builds of libstdc++, it appears like powf is resolved
by a symbol in that library. Other builds of libstdc++ doesn't contain that
symbol resulting in a linker / loader error. Optionally
resolve that symbol and replace it with calls to logf and expf.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-11-23 11:43:45 +01:00
Thomas Hellstrom
8ae23176d6 st/egl: Fix build for include files in nonstandard places
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-11-23 11:43:34 +01:00
Thomas Hellstrom
7d0c0d32b5 mesa: Add talloc includes for gles
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-11-23 11:43:26 +01:00
Thomas Hellstrom
e5c78c2003 egl: Add an include for size_t
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-11-23 11:43:17 +01:00
Tom Stellard
930c168df6 r300/compiler: Use correct swizzles for all presubtract sources 2010-11-22 12:00:10 -08:00
Tom Stellard
5551faf649 r300/compiler: Ignore alpha dest register when replicating the result
When the result of the alpha instruction is being replicated to the RGB
destination register, we do not need to use alpha's destination register.
This fixes an invalid "Too many hardware temporaries used" error in
the case where a transcendent operation writes to a temporary register
greater than max_temp_regs.

NOTE: This is a candidate for the 7.9 branch.
(cherry picked from commit 23f577dbd4)
2010-11-22 11:21:53 -08:00
Tom Stellard
80ff25b628 r300/compiler: Use zero as the register index for unused sources
This fixes an invalid "Too many hardware temporaries used" error in the
case where a source reads from a temporary register with an index greater
than max_temp_regs and then the source is marked as unused before the
register allocation pass.

NOTE: This is a candidate for the 7.9 branch.
(cherry picked from commit d668659003)
2010-11-22 11:21:53 -08:00
Tom Stellard
7c8715ef0a r300/compiler: Fix instruction scheduling within IF blocks
Reads of registers that where not written to within the same block were
not being tracked.  So in a situations like this:
0: IF
1: ADD t0, t1, t2
2: MOV t2, t1

Instruction 2 didn't know that instruction 1 read from t2, so
in some cases instruction 2 was being scheduled before instruction 1.

NOTE: This is a candidate for the 7.9 branch.
(cherry picked from commit 3e5f9789d6)
2010-11-22 11:21:48 -08:00
Tom Stellard
06fa5d81da r300/compiler: Fix register allocator's handling of loops
NOTE: This is a candidate for the 7.9 branch.
(cherry picked from commit e2301b45c2)
2010-11-22 11:15:33 -08:00
Tom Stellard
b86bf31b05 r300/compiler: Make sure presubtract sources use supported swizzles
NOTE: This is a candidate for the 7.9 branch.
(cherry picked from commit 412803b5cd)
2010-11-22 11:04:07 -08:00
Brian Paul
68afe8f685 swrast: init alpha value to 1.0 in opt_sample_rgb_2d()
(cherry picked from commit 6a0255122a)
2010-11-22 09:05:31 -07:00
Chia-I Wu
0d060d9933 st/vega: Do not wait NULL fences.
(cherry picked from commit cc5c908d7d)
2010-11-20 15:59:58 +08:00
Chia-I Wu
aa5574e78f egl_dri2: Fix __DRI_DRI2 version 1 support.
Correctly set __DRI_API_OPENGL flag.
(cherry picked from commit aa139a14ba)
2010-11-20 15:59:58 +08:00
Chia-I Wu
5105e3d415 st/mesa: Unreference the sampler view in st_bind_surface.
Without this, update_textures may not pick up the new pipe_resource.

It is actually update_textures that should check
stObj->sampler_view->texture != stObj->pt, but let's follow st_TexImage
and others for now.
(cherry picked from commit cfc81d93f7)
2010-11-20 15:59:58 +08:00
Chia-I Wu
feacfc4a93 egl: Fix a false negative check in _eglCheckMakeCurrent.
This call sequence

  eglMakeCurrent(dpy, surf, surf, ctx1);
  eglMakeCurrent(dpy, surf, surf, ctx2);

should be valid if ctx1 and ctx2 have the same client API and are not
current in another thread.
(cherry picked from commit 0d43cbed2f)
2010-11-20 15:59:57 +08:00
Julien Cristau
b6ae3d7b23 Makefile: don't include the same files twice in the tarball
src/mesa/drivers/dri/*/*/*.[chS] is a superset of
src/mesa/drivers/dri/*/server/*.[ch] and
src/mesa/drivers/dri/common/xmlpool/*.[ch].
include/GL/internal/glcore.h is already in MAIN_FILES, no need for it in
DRI_FILES too.  src/glx/Makefile was listed twice.

Signed-off-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-11-15 08:53:12 -07:00
Brian Paul
3db8f85446 mesa: fix glDeleteBuffers() regression
This fixes a regression (failed assertion) from commit
c552f273f5 which was hit if glDeleteBuffers()
was called on a buffer that was never bound.

NOTE: this is a candidate for the 7.9 branch.
(cherry picked from commit 78587ea012)
2010-11-15 08:53:12 -07:00
Brian Paul
3e4ed38791 mesa: make glIsBuffer() return false for never bound buffers
Use a dummy buffer object as we do for frame/renderbuffer objects.
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=31514

Note: this is a candidate for the 7.9 branch.
(cherry picked from commit c552f273f5)
2010-11-15 08:53:12 -07:00
Brian Paul
acee46d9a1 mesa: handle more pixel types in mipmap generation code
NOTE: This is a candidate for the 7.9 branch.
(cherry picked from commit b3b6476695)
2010-11-15 08:53:11 -07:00
Brian Paul
97805cfedd mesa: add missing formats in _mesa_format_to_type_and_comps()
NOTE: this is a candidate for the 7.9 branch
(cherry picked from commit 79c65410c1)

Conflicts:

	src/mesa/main/formats.c
2010-11-15 08:53:04 -07:00
Daniel Lichtenberger
9b1ac4d127 radeon: fix potential segfault in renderbuffer update
Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=31617

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2010-11-15 01:36:02 -05:00
Roland Scheidegger
78ccca5a69 r200: fix r200 large points
DD_POINT_SIZE got never set for some time now (as it was set only in ifdefed
out code), which caused the r200 driver to use the point primitive mistakenly
in some cases which can only do size 1 instead of point sprite. Since the
logic to use point instead of point sprite prim is flaky at best anyway (can't
work correctly for per-vertex point size), just drop this and always emit point
sprites (except for AA points) - reasons why the driver tried to use points for
size 1.0 are unknown though it is possible they are faster or more conformant.
Note that we can't emit point sprites without point sprite cntl as that might
result in undefined point sizes, hence need drm version check (which was
unnecessary before as it should always have selected points). An
alternative would be to rely on the RE point size clamp controls which could
clamp the size to 1.0 min/max even if the SE point size is undefined, but currently
always use 0 for min clamp. (As a side note, this also means the driver does
not honor the gl spec which mandates points, but not point sprites, with zero size
to be rendered as size 1.)
This should fix recent reports of https://bugs.freedesktop.org/show_bug.cgi?id=702.
This is a candidate for the mesa 7.9 branch.
2010-11-11 01:14:10 +01:00
Mario Kleiner
2fe82c281d mesa/r300classic: Fix dri2Invalidate/radeon_prepare_render for page flipping.
A call to radeon_prepare_render() at the beginning of draw
operations was placed too deep in the call chain,
inside r300RunRenderPrimitive(), instead of
r300DrawPrims() where it belongs. This leads to
emission of stale target color renderbuffer into the cs if
bufferswaps via page-flipping are used, and thereby causes
massive rendering corruption due to unsynchronized
rendering into the active frontbuffer.

This patch fixes such problems for use with the
upcoming radeon page-flipping patches.

Signed-off-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de>
2010-11-08 13:54:10 -05:00
Alex Deucher
773e8fadc8 r600c: properly align mipmaps to group size
fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=31400
2010-11-08 12:11:14 -05:00
Alex Deucher
7f2d1280e7 r600c: add missing radeon_prepare_render() call on evergreen 2010-10-27 14:32:02 -04:00
Alex Deucher
075640e37e r100: revalidate after radeon_update_renderbuffers
This is a port of 603741a86d
to r100.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2010-10-27 13:58:54 -04:00
Thomas Hellstrom
fb7a095785 mesa: Make sure we have the talloc cflags when using the talloc headers
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-10-19 14:21:13 +02:00
Thomas Hellstrom
f245bb4c9c st/xorg: Fix compilation for Xservers >= 1.10
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-10-19 12:11:44 +02:00
Thomas Hellstrom
cc71f76be2 xorg/vmwgfx: Don't use deprecated x*alloc / xfree functions
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-10-19 12:11:31 +02:00
Thomas Hellstrom
47887b1efe st/xorg: Don't use deprecated x*alloc / xfree functions
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-10-19 12:11:21 +02:00
Thomas Hellstrom
764f9974e5 st/xorg: Fix compilation errors for Xservers compiled without Composite
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-10-19 12:11:13 +02:00
Thomas Hellstrom
aa2b751abb st/xorg, xorg/vmwgfx: Be a bit more frendly towards cross-compiling environments
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-10-19 12:11:02 +02:00
Brian Paul
6f5c6e5cc5 mesa: Add missing else in do_row_3D
This fixes erroneous "bad format in do_row()" messages

Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 746b602fbd)
2010-10-18 08:11:45 -06:00
Brian Paul
e5b2a8d350 egl/i965: include inline_wrapper_sw_helper.h
Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit e19187e1be)
2010-10-18 08:02:42 -06:00
Chia-I Wu
da580c734f st/egl: Do not finish a fence that is NULL.
i915g would dereference the NULL pointer.
(cherry picked from commit d6de1f44a0)
2010-10-15 11:20:39 +08:00
Chia-I Wu
db7de707a3 st/vega: Fix version check in context creation.
This fixes a regression since 4531356817.
(cherry picked from commit b2c0ef8b51)
2010-10-15 11:20:39 +08:00
Chia-I Wu
bce3917192 targets/egl: Fix linking with libdrm.
(cherry picked from commit da495ee870)
2010-10-15 11:20:39 +08:00
Thomas Hellstrom
2eac388bfe st/xorg: Fix typo
Pointed out by Jakob Bornecrantz.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-10-12 18:26:56 +02:00
Thomas Hellstrom
6730630804 st/xorg: Don't try to remove invalid fbs
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-10-12 14:20:27 +02:00
Thomas Hellstrom
d5618c55ec xorg/vmwgfx: Don't hide HW cursors when updating them
Gets rid of annoying cursor flicker

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-10-12 14:12:36 +02:00
Thomas Hellstrom
ee6417f97f st/xorg: Add a customizer option to get rid of annoying cursor update flicker
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-10-12 14:09:09 +02:00
Thomas Hellstrom
14bae5cdf2 xorg/vmwgfx: Make vmwarectrl work also on 64-bit servers
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-10-12 11:08:39 +02:00
Thomas Hellstrom
799e6d4d15 st/xorg: Don't try to use option values before processing options
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-10-12 10:28:57 +02:00
Daniel Vetter
6936fbc039 r200: revalidate after radeon_update_renderbuffers
By calling radeon_draw_buffers (which sets the necessary flags
in radeon->NewGLState) and revalidating if NewGLState is non-zero
in r200TclPrimitive. This fixes an assert in libdrm (the color-/
depthbuffer was changed but not yet validated) and and stops the
kernel cs checker from complaining about them (when they're too
small).

Thanks to Mario Kleiner for the hint to call radeon_draw_buffer
(instead of my half-broken hack).

v2: Also fix the swtcl r200 path.

Cc: Mario Kleiner <mario.kleiner@tuebingen.mpg.de>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2010-10-11 15:17:44 -04:00
Brian Paul
0a060c8fb0 st/mesa: replace assertion w/ conditional in framebuffer invalidation
https://bugs.freedesktop.org/show_bug.cgi?id=30632

NOTE: this is a candidate for the 7.9 branch.
(cherry picked from commit 3d6eec0a87)
2010-10-06 08:41:44 -06:00
Brian Paul
34c518be52 swrast: fix choose_depth_texture_level() to respect mipmap filtering state
NOTE: this is a candidate for the 7.9 branch.
(cherry picked from commit fb5e6f88fc)
2010-10-05 14:34:58 -06:00
Ian Romanick
2b4a05e74a docs: added news item for 7.9 release
Also fix link to release notes in 7.9-rc1 news item.
2010-10-05 10:08:28 -07:00
Ian Romanick
7afce798ee docs: Update mailing lines from sf.net to freedesktop.org
(cherry picked from commit c19bc5de96)
2010-10-05 10:08:21 -07:00
Ian Romanick
ab502d0d6b docs: download.html does not need to be updated for each release
(cherry picked from commit 41e371e351)
2010-10-05 10:08:14 -07:00
Ian Romanick
548a50caae docs: Import 7.8.x release notes from 7.8 branch. 2010-10-05 10:08:06 -07:00
Ian Romanick
11e290daa4 Add 7.9 md5sums 2010-10-04 18:59:34 -07:00
Ian Romanick
889cb2539b docs: Add 7.9 release date 2010-10-04 18:56:21 -07:00
Ian Romanick
242facde45 mesa: set version string to 7.9 (final) 2010-10-04 18:55:57 -07:00
Alex Deucher
73be0dfe03 Add evergreen support to release notes 2010-10-04 21:46:57 -04:00
Ian Romanick
0b300a4e3d docs: Update 7.9 release notes with one more bug fix 2010-10-04 17:43:52 -07:00
Eric Anholt
586797d7a8 i965: Fix glean/texSwizzle regression in previous commit.
Easy enough patch, who needs a full test run.  Oh, that's right.  Me.
(cherry picked from commit 14bf92ba19)
2010-10-04 17:41:56 -07:00
Eric Anholt
9b646b1fd3 i965: Set up swizzling of shadow compare results for GL_DEPTH_TEXTURE_MODE.
The brw_wm_surface_state.c handling of GL_DEPTH_TEXTURE_MODE doesn't
apply to shadow compares, which always return an intensity value.  The
texture swizzles can do the job for us.

Fixes:
glsl1-shadow2D(): 1
glsl1-shadow2D(): 3
(cherry picked from commit a7fa00dfc5)
2010-10-04 17:41:45 -07:00
Kenneth Graunke
dc8e22e4f0 i965: Fix incorrect batchbuffer size in gen6 clip state command.
FORCE_ZERO_RTAINDEX should be in the fourth (and final) dword.
(cherry picked from commit f317713432)
2010-10-04 17:41:33 -07:00
Ian Romanick
21078eef10 docs: Add list of bugs fixed in 7.9
(cherry picked from commit 7f440b3f9d76fa3a02877074d9701ab499d5de34)
2010-10-04 17:38:54 -07:00
Marek Olšák
968a9ec76e update release notes for Gallium
I am trying to be exhaustive, but still I might have missed tons of other
changes to Gallium.
2010-10-05 02:24:50 +02:00
Vinson Lee
2cdfda8851 tgsi: Remove duplicate case value.
Cherry-picked from master commit 2491258436
2010-10-04 17:31:33 +02:00
Jakob Bornecrantz
09d89dc95b tgsi: Actually care what check_soa_dependencies says
Thanks to José for the more complete list of supported opcodes.

Cherry-picked from master commit d21301675c
Also includes fix commit 4bb42a4f7e
2010-10-04 17:30:34 +02:00
José Fonseca
15ad34f012 tgsi: Don't ignore indirect registers in tgsi_check_soa_dependencies
Cherry-picked from master commit c66f0c4629
2010-10-04 17:30:00 +02:00
Alex Deucher
094fe2aa23 r600c: fix segfault in evergreen stencil code
Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=30551
2010-10-01 20:15:17 -04:00
Tom Fogal
ba889a2b3e Implement x86_64 atomics for compilers w/o intrinsics.
Really old gcc's (3.3, at least) don't have support for the
intrinsics we need.  This implements a fallback for that case.
2010-10-01 17:56:02 -06:00
richard
71cc467f4c evergreen : fix z format setting, enable stencil. 2010-10-01 16:18:16 -04:00
Alex Deucher
d6e2b707ba r600c: pull over 6xx/7xx vertex fixes for evergreen 2010-10-01 00:52:36 -04:00
Alex Deucher
0ab9d8d94b r600c: add reloc for CB_COLOR0_ATTRIB
We'll need a reloc for tiling eventually,
so add it now.
2010-09-30 20:57:38 -04:00
Adam Jackson
759e9fb737 i965: Update renderer strings for sandybridge
Signed-off-by: Adam Jackson <ajax@redhat.com>
(cherry picked from commit 0c86e1f294)
2010-09-30 13:32:42 -07:00
Zhenyu Wang
4af00f1a5e i965: always set tiling for fbo depth buffer on sandybridge
Sandybridge requires depth buffer must be tiling.

Fix 'fbo_firecube' demo.
(cherry picked from commit 72b368ae69)
2010-09-30 13:23:38 -07:00
Zhenyu Wang
1c8795075f i965: fallback lineloop on sandybridge for now
Until we fixed GS hang issue.
(cherry picked from commit 73dab75b41)
2010-09-30 13:23:37 -07:00
Kenneth Graunke
5d43c78d03 glsl: "Copyright", not "Constantright"
Clearly this started out as ir_copy_propagation.cpp, but the search and
replace was a bit overzealous.
(cherry picked from commit 565ff67688)
2010-09-30 13:23:37 -07:00
Marek Olšák
9f076a0848 r300g: fix conditional rendering in non-wait path
NOTE: This is a candidate for the 7.9 branch.
(cherry picked from commit 83278d384e)
2010-09-30 22:17:15 +02:00
Chia-I Wu
9bab8ca4f8 st/egl: Drop context argument from egl_g3d_get_egl_image.
Fix a regression since 17eace581d.
(cherry picked from commit e2b51b7c5b)
2010-09-30 23:48:34 +08:00
Chia-I Wu
f6eb5d991c mapi: Fix compiler warnings.
Do not use "void *" in arithmetics.
(cherry picked from commit ebeb4a7e8a)
2010-09-30 17:12:30 +08:00
Tom Stellard
f282d72678 r300/compiler: Don't merge instructions that write output regs and ALU result
https://bugs.freedesktop.org/show_bug.cgi?id=30415

(cherry picked from commit b27a809266)
2010-09-29 11:05:01 -07:00
Tom Stellard
e1918fd5d5 r300/compiler: Don't use rc_error() unless the error is unrecoverable
https://bugs.freedesktop.org/show_bug.cgi?id=30416

(cherry picked from commit 1b76dde0cd)
2010-09-29 11:04:12 -07:00
Tom Stellard
fcf5819945 r300/compiler: Fix segfault in error path
https://bugs.freedesktop.org/show_bug.cgi?id=30415

(cherry picked from commit d40ff5510c)
2010-09-29 11:03:02 -07:00
Brian Paul
c584318a21 Makefile: ensure Gallium's Makefile.xorg and SConscript.dri are in the tarball
Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 698893889a)
2010-09-29 09:53:02 -06:00
Kristian Høgsberg
b24238c49a glx: Only remove drawables from the hash when we actually delete them
https://bugs.freedesktop.org/show_bug.cgi?id=30457
2010-09-29 09:10:05 -04:00
Ian Romanick
5d3a4317e8 mesa: set version string to 7.9-rc2 2010-09-28 19:22:55 -07:00
Eric Anholt
836b44b2c8 glsl: Also update implicit sizes of varyings at link time.
Otherwise, we'll often end up with gl_TexCoord being 0 length, for
example.  With ir_to_mesa, things ended up working out anyway, as long
as multiple implicitly-sized arrays weren't involved.
(cherry picked from commit 586b4b500f)
2010-09-28 18:41:05 -07:00
Eric Anholt
83854a9c84 i965: Fix up part of my Sandybridge attributes support patch.
I confused the array sizing for number of files for the number of regs
in a file.
(cherry picked from commit ef8e002c75)
2010-09-28 18:40:32 -07:00
Eric Anholt
b4824096b0 i965: Fix all non-snb regression in the snb attribute interpolation commit.
This apparently had never been tested elsewhere before being merged to
master.
(cherry picked from commit f1dba03056)
2010-09-28 18:40:24 -07:00
Zhenyu Wang
71bdc82c19 i965: fallback bitmap operation on sandybridge
Need to bring back correct fb write with header to set pixel
write mask. Fallback for now.

Note: Conflicts in intel_pixel_bitmap.c due to the removal of
intel_texture_bitmap from master.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2010-09-28 18:37:20 -07:00
Zhenyu Wang
aaf7f78dfa i965: fix occlusion query on sandybridge
Fix pipe control command for depth stall and PS_DEPTH_COUNT write.
(cherry picked from commit 3074b61f64)
2010-09-28 18:36:05 -07:00
Zhenyu Wang
5c7a7d0b09 i965: fix point sprite on sandybridge
Need to set point sprite function in fixed SF state now on sandybridge.
(cherry picked from commit ec99833e92)
2010-09-28 18:36:01 -07:00
Zhenyu Wang
f736d85a5a i965: fix scissor state on sandybridge
Fix incorrect scissor rect struct and missed scissor state pointer
setting for sandybridge.
(cherry picked from commit 4b6b0bf24a)
2010-09-28 18:35:57 -07:00
Zhenyu Wang
40dc275431 i965: enable polygon offset on sandybridge
Depth offset function is moved to SF stage on sandybridge.
(cherry picked from commit 3f3059fcc0)
2010-09-28 18:35:41 -07:00
Zhenyu Wang
3dd52d51ce i965: fix pixel w interpolation on sandybridge
(cherry picked from commit 15a8e7ec90)
2010-09-28 18:35:35 -07:00
Zhenyu Wang
e00bb8732c i965: don't do calculation for delta_xy on sandybridge
Sandybridge doesn't have Xstart/Ystart in payload header.
(cherry picked from commit 85fa900b93)
2010-09-28 18:35:30 -07:00
Zhenyu Wang
11215cd535 i965: only allow SIMD8 kernel on sandybridge now
Until we fixed SIMD16 kernel, force to SIMD8 on sandybridge now.
(cherry picked from commit c58bf2cee5)
2010-09-28 18:35:26 -07:00
Zhenyu Wang
6831cf67d1 i965: sandybridge pipe control workaround before write cache flush
Must issue a pipe control with any non-zero post sync op before
write cache flush = 1 pipe control.
(cherry picked from commit 18c3b754f9)
2010-09-28 18:35:21 -07:00
Zhenyu Wang
ece465219f i965: Add all device ids for sandybridge
(cherry picked from commit c8033f1b1e)
2010-09-28 18:35:16 -07:00
Zhenyu Wang
0dc83cc437 i965: fix const register count for sandybridge
Sandybridge's PS constant buffer payload size is decided from
push const buffer command, incorrect size would cause wrong data
in payload for position and vertex attributes. This fixes coefficients
for tex2d/tex3d.
(cherry picked from commit 81aae67e58)
2010-09-28 18:35:11 -07:00
Zhenyu Wang
922d7e1025 i965: Fix sampler on sandybridge
Sandybridge has not much change on texture sampler with Ironlake.
(cherry picked from commit 956f866030)
2010-09-28 18:35:04 -07:00
Zhenyu Wang
4afb1c8451 i965: fix jump count on sandybridge
Jump count is for 64bit long each, so one instruction requires 2
like on Ironlake.
(cherry picked from commit c5a3b25bb9)
2010-09-28 18:34:58 -07:00
Zhenyu Wang
ad52c2b773 i965: VS use SPF mode on sandybridge for now
Until conditional instructions were fixed, use SPF mode instead for now.
(cherry picked from commit 9c39a9fcb2)
2010-09-28 18:34:53 -07:00
Zhenyu Wang
364b6e0709 i965: add sandybridge viewport state bo into validation list
(cherry picked from commit 7401a98e29)
2010-09-28 18:34:47 -07:00
Zhenyu Wang
32c1dc76af i965: ignore quads for GS kernel on sandybridge
Sandybridge's VF would convert quads to polygon which not required
for GS then. Current GS state still would cause hang on lineloop.
(cherry picked from commit a0b1d7b2b8)
2010-09-28 18:34:43 -07:00
Zhenyu Wang
f9ad343cf7 i965: ff sync message change for sandybridge
(cherry picked from commit 67dafa4b56)
2010-09-28 18:34:39 -07:00
Zhenyu Wang
76469d710c i965: fix point size setting in header on sandybridge
(cherry picked from commit fa589770e8)
2010-09-28 18:34:33 -07:00
Zhenyu Wang
6eec2dbfc8 i965: force zero in clipper to ignore RTAIndex on sandybridge
(cherry picked from commit 03218a0093)
2010-09-28 18:34:27 -07:00
Zhenyu Wang
a4f126beaf i965: Fix color interpolation on sandybridge
Don't double store position in vertex attribute. This makes color
interpolation right by using barycentric coordinates.
(cherry picked from commit 41c31c2ebd)
2010-09-28 18:34:22 -07:00
Zhenyu Wang
0d5400519e i965: enable accumulator update in PS kernel too on sandybridge
Accumulator update flag must be set for implicit update on sandybridge.
(cherry picked from commit 8c31a4c3cf)
2010-09-28 18:34:16 -07:00
Zhenyu Wang
36722d7673 i965: new state dump for sandybridge
Dump new state object on sandybridge for cc viewport, clip viewport,
depth stencil, cc and blend state.
(cherry picked from commit b016a78b98)
2010-09-28 18:34:11 -07:00
Zhenyu Wang
3c26f3883a i965: disasm quarter and write enable instruction control on sandybridge
(cherry picked from commit bf60f35934)
2010-09-28 18:34:01 -07:00
Eric Anholt
1975d851e8 i965: Add support for POW in gen6 FS.
Fixes glsl-algebraic-pow-2 in brw_wm_glsl.c mode.
(cherry picked from commit fe2d4a5ea0)
2010-09-28 18:33:49 -07:00
Eric Anholt
f4f1e0d108 i965: Set up inputs to the fragment shader according to FP InputsRead.
Sending down data that doesn't get read doesn't make any sense, and
would make handling things like gl_FrontFacing and gl_PointCoord
harder.
(cherry picked from commit 2f914053bc)
2010-09-28 18:33:34 -07:00
Eric Anholt
cda661fd1c i965: Add support for attribute interpolation on Sandybridge.
Things are simpler these days thanks to barycentric interpolation
parameters being handed in in the payload.
(cherry picked from commit a66e9a4d86)
2010-09-28 18:33:10 -07:00
Eric Anholt
1ab0d45c9f glsl: Fix broadcast_index of lower_variable_index_to_cond_assign.
It's trying to get an int smeared across all channels, not trying to
get a 1:1 mapping of a subset of a vector's channels.  This usually
ended up not mattering with ir_to_mesa, since it just smears floats
into every chan of a vec4.

Fixes:
glsl1-temp array with swizzled variable indexing
(cherry picked from commit 668cdbe129)
2010-09-28 18:31:05 -07:00
Dave Airlie
269dd51162 mesa/mipmap: fix warning since 1acadebd62
1acadebd62 fixed the pointer but not the cast.
(cherry picked from commit 865cf77503)
2010-09-28 18:29:17 -07:00
Eric Anholt
f60c28e083 mesa: Fix type typo in glGenerateMipmap handling of GL_UNSIGNED_INT data.
Fixes ARB_depth_texture/fbo-generatemipmap-formats.
(cherry picked from commit 1acadebd62)
2010-09-28 18:29:10 -07:00
Eric Anholt
aebd78f607 glsl: Fix copy'n'wasted ir_noop_swizzle conditions.
It considered .xyyy a noop for vec4 instead of .xyzw, and similar for vec3.
(cherry picked from commit 3ffab36768)
2010-09-28 18:26:25 -07:00
Eric Anholt
0391eaf088 glsl: Rework assignments with write_masks to have LHS chan count match RHS.
It turns out that most people new to this IR are surprised when an
assignment to (say) 3 components on the LHS takes 4 components on the
RHS.  It also makes for quite strange IR output:

(assign (constant bool (1)) (x) (var_ref color) (swiz x (var_ref v) ))
(assign (constant bool (1)) (y) (var_ref color) (swiz yy (var_ref v) ))
(assign (constant bool (1)) (z) (var_ref color) (swiz zzz (var_ref v) ))

But even worse, even we get it wrong, as shown by this line of our
current step(float, vec4):

(assign (constant bool (1)) (w)
	(var_ref t)
	(expression float b2f (expression bool >=
		    (swiz w (var_ref x))(var_ref edge))))

where we try to assign a float to the writemasked-out x channel and
don't supply anything for the actual w channel we're writing.  Drivers
right now just get lucky since ir_to_mesa spams the float value across
all the source channels of a vec4.

Instead, the RHS will now have a number of components equal to the
number of components actually being written.  Hopefully this confuses
everyone less, and it also makes codegen for a scalar target simpler.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit b39e6f33b6)
2010-09-28 18:25:57 -07:00
Marek Olšák
7436872dce configure.ac: do not build xorg-r300g by default
NOTE: This is a candidate for the 7.9 branch.
(cherry picked from commit 11eb422a16)
2010-09-28 19:52:22 +02:00
Marek Olšák
7a297bd926 configure.ac: look for libdrm_radeon before building gallium/r300,r600
NOTE: This is a candidate for the 7.9 branch.
(cherry picked from commit a1aec2e2be)
2010-09-28 19:52:16 +02:00
Marek Olšák
6c3a8aeb27 r300g: fix swizzling of texture border color
NOTE: This is a candidate for the 7.9 branch.
(cherry picked from commit e4fd65e9d7)
2010-09-28 19:51:38 +02:00
Marek Olšák
5c3be43cd2 r300/compiler: fix shadow sampling with swizzled coords
Taking the W component from coords directly ignores swizzling. Instead,
take the component which is mapped to W in the TEX instruction parameter.
The same for Z.

NOTE: This is a candidate for the 7.9 branch.
(cherry picked from commit 7128e1625b)

Conflicts:

	src/mesa/drivers/dri/r300/compiler/radeon_program_tex.c
2010-09-28 19:51:19 +02:00
Marek Olšák
5906b9ac51 r300/compiler: do not use copy propagation if SaturateMode is used
NOTE: This is a candidate for the 7.9 branch.
(cherry picked from commit c2ea7ffb0a)
2010-09-28 19:48:31 +02:00
Marek Olšák
89ed679a9e r300/compiler: fix projective mapping of 2D NPOT textures
NOTE: This is a candidate for the 7.9 branch.
(cherry picked from commit 6f747567ec)

Conflicts:

	src/mesa/drivers/dri/r300/compiler/radeon_program_tex.c
2010-09-28 19:48:00 +02:00
Kristian Høgsberg
7d154de048 glx: Invalidate buffers after binding a drawable
If the server doesn't send invalidate events, we may miss a
resize before the rendering starts.  Invalidate the buffers now
so the driver will recheck before rendering starts.

https://bugs.freedesktop.org/show_bug.cgi?id=29984
https://bugs.freedesktop.org/show_bug.cgi?id=30155
2010-09-28 08:32:45 -04:00
Ian Romanick
2a7ed4ba96 dri: Ensure that DRI driver cpp files are in tarballs
(cherry picked from commit 5717093f15fd7259441b2ee5583432fb9833c9a1)
2010-09-27 14:13:46 -07:00
Ian Romanick
8ad0396108 Add 7.9-rc1 md5sums 2010-09-27 10:20:25 -07:00
Ian Romanick
61653b488d mesa: set version string to 7.9-rc1 2010-09-27 10:17:11 -07:00
Marek Olšák
7e62335f35 r300g: fix macrotiling on R350
MACRO_SWITCH on R350 appears to use the RV350 mode by default. Who knew?

NOTE: This is a candidate for the 7.9 branch.
(cherry picked from commit 311ab3d468)

https://bugs.freedesktop.org/show_bug.cgi?id=30313
2010-09-26 23:00:16 +02:00
Joakim Sindholt
b8a60c84aa radeong: fix leaks
(cherry picked from commit 16baa465a2)
2010-09-26 19:59:11 +02:00
Joakim Sindholt
9f221e738d util/u_blitter: fix leak
(cherry picked from commit b51f6e7c23)
2010-09-26 19:53:47 +02:00
Tom Stellard
5c78e931c2 r300/compiler: Fix two mistakes in the presubtract optimization pass.
1. We can't turn an instruction into a presubtract operation if it
writes to one of the registers it reads from.
2. If we turn an instruction into a presubtract operation, we can't
remove that intruction unless all readers can use the presubtract
operation.

This fixes fdo bug 30337.
This is a candidate for the 7.9 branch.
(cherry picked from commit 522e994a22)
2010-09-25 15:53:20 -07:00
Marek Olšák
361084ac4b util: fix util_pack_color for B4G4R4A4
NOTE: This is a candidate for the 7.9 branch.
(cherry picked from commit 8619495790)
2010-09-25 01:54:12 +02:00
Marek Olšák
9409b544cc Build r300g by default
NOTE: This will go to 7.9 as well.
(cherry picked from commit 85a45dcd5d)
2010-09-25 01:54:12 +02:00
Marek Olšák
7261c3973d r300g: fix the border color for every format other than PIPE_FORMAT_B8G8R8A8
TX_BORDER_COLOR should be formatted according to the texture format.
Also the interaction with ARB_texture_swizzle should be fixed too.

NOTE: This is a candidate for the 7.9 branch.
(cherry picked from commit 9f35dcd24c)
2010-09-25 01:54:12 +02:00
Marek Olšák
bb4c9e0969 r300g: make accessing map_list and buffer_handles thread-safe
NOTE: This is a candidate for the 7.9 branch.
(cherry picked from commit a333485386)
2010-09-25 01:54:12 +02:00
Marek Olšák
aa05753059 r300g: fixup long-lived BO maps being incorrectly unmapped when flushing
Based on commit 3ddc714b20 by Dave Airlie.

NOTE: This is a candidate for the 7.9 branch.
(cherry picked from commit 206d92912c)
2010-09-25 01:54:12 +02:00
Marek Olšák
09085ada5d util: make calling remove_from_list multiple times in a row safe
This commit fixes an infinite loop in foreach_s if remove_from_list is used
more than once on the same item with other list operations in between.

NOTE: This is a candidate for the 7.9 branch because the commit
"r300g: fixup long-lived BO maps being incorrectly unmapped when flushing"
depends on it.
(cherry picked from commit 68afbe89c7)
2010-09-25 01:54:11 +02:00
Alex Deucher
77cc2a4e17 r600c: fix mipmap stride on evergreen
taken from Dave's r600g fix
2010-09-24 13:27:21 -04:00
Brian Paul
96085dc41a st/mesa: use the wrapped renderbuffer in CopyPixels()
Fixes assertion failures when copying stencil pixels.

NOTE: this is a candidate for the 7.9 branch.
(cherry picked from commit f5c810c42f)
2010-09-24 10:18:12 -06:00
Brian Paul
a128b62a35 st/mesa: add missing MESA_FORMAT_S8 case in st_mesa_format_to_pipe_format()
NOTE: this is a candidate for the 7.9 branch.
(cherry picked from commit 10dcc989ab)
2010-09-24 10:17:40 -06:00
Brian Paul
b756100892 mesa: fix assertions to handle srgb formats
http://bugs.freedesktop.org/show_bug.cgi?id=30333

NOTE: This is a candidate for the 7.9 branch.
(cherry picked from commit 9f7c8053e0)
2010-09-24 10:16:52 -06:00
Tom Stellard
3ad0279344 r300g: Always try to build libr300compiler.a
Make libr300compiler.a a PHONY target so that this library will always be
built.  This fixes the problem of libr300compiler.a not being updated
when r300g is being built and r300c is not.

(cherry picked from commit 92762842a0)
2010-09-23 15:42:40 -07:00
Kristian Høgsberg
97cfa1240c intel: Fix GL_ARB_shading_language_120 commit
Fix commit e7087175f8.  Move the reference to
GL_VERSION_2_1_functions to intel_extensions.c where it's available,
don't try to enable a non-existing extension and advertise 1.20 for all
intel chipsets, not just GEN4 and up.
(cherry picked from commit b91dba49e0)
2010-09-23 08:47:01 -07:00
Brian Paul
6b0c280660 mesa: don't advertise bogus GL_ARB_shading_language_120 extension
Instead of using the invalid GL_ARB_shading_language_120 extension to
determine the GLSL version, use a new ctx->Const.GLSLVersion field.
Updated the intel and r600 drivers, but untested.

See fd.o bug 29910

NOTE: This is a candidate for the 7.9 branch (but let's wait and see if
there's any regressions).
(cherry picked from commit e7087175f8)
2010-09-23 08:47:01 -07:00
Eric Anholt
b437c9102f i965: Share the KIL_NV implementation between glsl and non-glsl.
(cherry picked from commit 23c507f135)
2010-09-23 08:47:01 -07:00
Kenneth Graunke
4ec818ea4a glsl: Fix broken handling of ir_binop_equal and ir_binop_nequal.
When ir_binop_all_equal and ir_binop_any_nequal were introduced, the
meaning of these two opcodes changed to return vectors rather than a
single scalar, but the constant expression handling code was incorrectly
written and only worked for scalars.  As a result, only the first
component of the returned vector would be properly initialized.
(cherry picked from commit 6ea16b6c51)
2010-09-23 08:47:01 -07:00
Kenneth Graunke
80a6cbfea3 glsl: Add comments to clarify the types of comparison binops.
(cherry picked from commit 14eea26828)
2010-09-23 08:47:01 -07:00
Brian Paul
ec2031563a glsl2: silence compiler warnings in printf() calls
Such as: "ir_validate.cpp:143: warning: format ‘%p’ expects type ‘void*’,
but argument 2 has type ‘ir_variable*’"
(cherry picked from commit 1739124159)
2010-09-23 08:47:01 -07:00
Ian Romanick
b7d4f08f4e glsl: Add doxygen comments
(cherry picked from commit e053d62aa5)
2010-09-23 08:47:01 -07:00
Kenneth Graunke
2fc2b89680 glsl/builtins: Switch comparison functions to just return an expression.
(cherry picked from commit dbd2480507)
2010-09-23 08:47:01 -07:00
Kenneth Graunke
b29289a61c glsl/builtins: Fix equal and notEqual builtins.
Commit 309cd4115b incorrectly converted
these to all_equal and any_nequal, which is the wrong operation.
(cherry picked from commit 52f9156e88)
2010-09-23 08:47:01 -07:00
Kenneth Graunke
728829ab63 glsl: Properly handle nested structure types.
Fixes piglit test CorrectFull.frag.
(cherry picked from commit ca92ae2699)
2010-09-23 08:47:01 -07:00
Tilman Sauerbeck
9753ee3f3e glsl2: Fixed cloning of ir_call error instructions.
Those have the callee field set to the null pointer, so
calling the public constructor will segfault.

Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
(cherry picked from commit 3894fddccc)
2010-09-23 08:47:01 -07:00
Vinson Lee
2db5398449 glsl: Fix 'control reaches end of non-void function' warning.
Fixes this GCC warning.

lower_variable_index_to_cond_assign.cpp:
In member function
'bool variable_index_to_cond_assign_visitor::needs_lowering(ir_dereference_array*) const':

lower_variable_index_to_cond_assign.cpp:261:
warning: control reaches end of non-void function
(cherry picked from commit a822ae3f1a)
2010-09-23 08:47:01 -07:00
Vinson Lee
ee8a96707a ir_to_mesa: Remove unused member array_indexed from struct statevar_element.
Fixes this GCC warning.
warning: missing initializer for member 'statevar_element::array_indexed'
(cherry picked from commit ff78d6dcc0)
2010-09-23 08:47:01 -07:00
Tilman Sauerbeck
22dcee8da2 glsl2: Empty functions can be inlined.
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 19f8f32a96)
2010-09-23 08:47:00 -07:00
Ian Romanick
1b622bfbee glsl2: Add flags to enable variable index lowering
(cherry picked from commit a6ecd1c372)
2010-09-23 08:47:00 -07:00
Ian Romanick
2bb2efd7b2 glsl2: Refactor testing for whether a deref is of a matrix or array
(cherry picked from commit 6e4fe39da2)
2010-09-23 08:47:00 -07:00
Luca Barbieri
a19f0fb50b glsl: add pass to lower variable array indexing to conditional assignments
Currenly GLSL happily generates indirect addressing of any kind of
arrays.

Unfortunately DirectX 9 GPUs are not guaranteed to support any of them in
general.

This pass fixes that by lowering such constructs to a binary search on the
values, followed at the end by vectorized generation of equality masks, and
4 conditional assignments for each mask generation.

Note that this requires the ir_binop_equal change so that we can emit SEQ
to generate the boolean masks.

Unfortunately, ir_structure_splitting is too dumb to turn the resulting
constant array references to individual variables, so this will need to
be added too before this pass can actually be effective for temps.

Several patches in the glsl2-lower-variable-indexing were squashed
into this commit.  These patches fix bugs in Luca's original
implementation, and the individual patches can be seen in that branch.
This was done to aid bisecting in the future.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit a47539c7a1)
2010-09-23 08:47:00 -07:00
Kenneth Graunke
8df8bb43c7 glsl: Don't print blank (function ...) headers for built-ins.
Fixes a regression caused when I added my GLSL ES support.
(cherry picked from commit 8fbe968a62)
2010-09-23 08:47:00 -07:00
Kenneth Graunke
d2b6502c93 glsl: Change from has_builtin_signature to has_user_signature.
The print visitor needs this, and the only existing user can work with
has_user_signature just as well.
(cherry picked from commit 81f0339398)
2010-09-23 08:47:00 -07:00
Brian Paul
e68ec2212f glsl2: fix signed/unsigned comparison warning
(cherry picked from commit 7545514fb6)
2010-09-23 08:47:00 -07:00
Vinson Lee
c0f82e619c glsl: Fix 'format not a string literal and no format arguments' warning.
Fix the following GCC warning.
loop_controls.cpp: In function 'int calculate_iterations(ir_rvalue*, ir_rvalue*, ir_rvalue*, ir_expression_operation)':
loop_controls.cpp:88: warning: format not a string literal and no format arguments
(cherry picked from commit f20f2cc330)
2010-09-23 08:47:00 -07:00
José Fonseca
7f95c59509 draw: Prevent clipped vertices overflow.
Some pathological triangles cause a theoritically impossible number of
clipped vertices.

The clipper will still assert, but at least release builds will not
crash, while this problem is further investigated.
2010-09-23 16:48:59 +01:00
Keith Whitwell
6f310f379b draw: don't apply flatshading to clipped tris with <3 verts
If a triangle was completely culled by clipping, we would still try to
fix up its provoking vertex.
2010-09-23 16:28:27 +01:00
Dave Airlie
f279480df2 egl: fix build since 17eace581d
looks like mesa st didn't get updated.
2010-09-23 07:41:05 -04:00
Kristian Høgsberg
d382c51a23 dri: Pass the __DRIscreen and the __DRIscreen private back to image lookup
We will typically have a current context when we need to lookup the image,
but the lookup implementation don't need it so drop it.
2010-09-23 07:40:59 -04:00
Kristian Høgsberg
cdb3f23d8a glx: Hold on to drawables if we're just switching to another context
https://bugs.freedesktop.org/show_bug.cgi?id=30234
2010-09-23 07:40:27 -04:00
Eric Anholt
8f4c99a9af i965: Also enable CC statistics when doing OQs.
This is required by the spec, so respect that.

(oh, and it was required to actually fix occlusion-query-discard,
though I didn't know at the time of the commit since o-q-discard was
hanging the GPU)

(cherry picked from commit 4a0bc4716d)
2010-09-22 13:45:50 -07:00
Eric Anholt
5285100502 ir_to_mesa: Only compare vector_elements present for any_nequal/all_equal
Fixes: glsl-mat-from-int-ctor-03
(cherry picked from commit eaa6bf59db)
2010-09-22 13:43:10 -07:00
Eric Anholt
56dc7ca916 i965: Track the windowizer's dispatch for kill pixel, promoted, and OQ
Looks like the problem was we weren't passing the depth to the render
target as expected, so the chip would wedge.  Fixes GPU hang in
occlusion-query-discard.

Bug #30097
(cherry picked from commit dd9a88f4dd)
2010-09-22 13:15:59 -07:00
Eric Anholt
902dfdaa86 glsl: Add definition of gl_TextureMatrix inverse/transpose builtins.
Fixes glsl2/builtin-texturematrix.
Bug #30196.
(cherry picked from commit b5bb215629)
2010-09-22 13:15:59 -07:00
Kristian Høgsberg
c98ce41de3 dri2: Make createImageFromName() take a __DRIscreen instead of __DRIcontext
We can't expect to have a context when this is called, and we don't need one
so just require a __DRIscreen instead.

Reported by Yu Dai <yu.dai@intel.com>
2010-09-22 15:27:04 -04:00
Brian Paul
3cdfc62523 llvmpipe: use draw module to draw sprites
For the 7.9 branch, this is simpler than merging the sprite-coord branch
and less likely to break other drivers.

Fixes fd.o bug 29849.
2010-09-22 08:22:36 -06:00
Brian Paul
2606105cc5 glsl2: fix typo in error msg
(cherry picked from commit 2b95525429)
2010-09-21 14:58:24 -06:00
Keith Whitwell
141dbbfc78 llvmpipe: fix flatshading in new line code
Calculate interpolants before rearranging the vertices.
2010-09-21 14:40:22 +01:00
Brian Paul
e678c3f4e1 docs: mark as obsolete, remove dead links
(cherry picked from commit 0bc3e1f4f4)
2010-09-20 10:56:53 -06:00
Brian Paul
1b90889eb4 docs: remove old broken link
(cherry picked from commit a8fde1ba4d)
2010-09-20 10:56:41 -06:00
Brian Paul
a9fceb6979 llvmpipe: fix query bug when no there's no scene
(cherry picked from commit 7888a2f822)
2010-09-20 10:56:10 -06:00
Brian Paul
febd353bcd gallivm: fix incorrect vector shuffle datatype
The permutation vector must always be a vector of int32 values.

(cherry picked from commit 3c9f4c7b75)
2010-09-20 10:55:35 -06:00
Marek Olšák
0f1faa9c7b st/mesa: fix assertion failure in GetTexImage for cubemaps
Can be reproduced with mesa/demos/src/tests/blitfb.

NOTE: This is a candidate for the 7.9 branch.
(cherry picked from commit 168554904b)
2010-09-20 18:21:24 +02:00
Jakob Bornecrantz
b247620854 i915g: Link with wrapper sw winsys with scons
cherry picked from commit 208f1f3810
2010-09-20 15:45:35 +02:00
Michal Krol
d36344f900 svga: Integer constant register file has a separate namespace.
Count int and float constants independently. Since there are only
few i# constants available and hundreds of c# constants, it would
be too easy to end up with an i# declaration out of its range.
2010-09-20 09:29:26 +01:00
Michal Krol
202c1279c6 svga: Fix relative addressing translation for pixel shaders.
Pixel shaders do not have address registers a#, only one
loop register aL. Our only hope is to assume the address
register is in fact a loop counter and replace it with aL.

Do not translate ARL instruction for pixel shaders -- MOVA
instruction is only valid for vertex saders.

Make it more explicit relative addressing of inputs is only valid
for pixel shaders and constants for vertex shaders.
2010-09-20 09:29:24 +01:00
Jakob Bornecrantz
f6e811a7d0 scons: Link against talloc in the Gallium DRI drivers
cherry picked from commit b83156d42f
2010-09-20 00:08:06 +02:00
Luca Barbieri
bd009df1cc auxiliary: fix depth-only and stencil-only clears
Depth-only and stencil-only clears should mask out depth/stencil from the
output, mask out stencil/input from input, and OR or ADD them together.

However, due to a typo they were being ANDed, resulting in zeroing the buffer.
2010-09-19 21:51:25 +02:00
Chia-I Wu
d6df0cdcca egl: Enable drm platform by default.
This enables EGL_MESA_drm_display for st/egl in the default setup.
(cherry picked from commit 2a910b3396)
2010-09-19 17:37:00 +08:00
Chia-I Wu
52f6be0688 st/egl: s/kms/drm/ on the drm backend.
s/kms/drm/, s/kdpy/drmdpy/, and so forth.
(cherry picked from commit e4513e7fb9)
2010-09-19 17:30:00 +08:00
Chia-I Wu
b73cfde5ce st/egl: Rename kms backend to drm.
The main use of the backend is to support EGL_MESA_drm_display.  drm
should be a better name.
(cherry picked from commit e7424d7240)
2010-09-19 17:29:55 +08:00
Chia-I Wu
d7500ac4df st/egl: Split modeset code support to modeset.c.
The modeset code supports now obsolete EGL_MESA_screen_surface.  Move it
to a file of its own.
(cherry picked from commit c7c2e7d0ce)
2010-09-19 17:29:50 +08:00
Brian Paul
83917660f1 tgsi/sse: fix aos_to_soa() loop to handle num_inputs==0
Basically, change the loop from:
  do {...} while (--num_inputs != 0)
into:
  while (num_inputs != 0) { ... --num_inputs; }

Fixes fd.o bug 29987.
(cherry picked from commit 4b27c614cf)
2010-09-17 10:51:50 -07:00
Chia-I Wu
69f67f5ded libgl-xlib: Remove unused st_api_create_OpenGL.
st/egl no longer relies on libGL for OpenGL support.
2010-09-17 12:57:15 +08:00
Chia-I Wu
a42527be33 targets/egl: Use C++ compiler to link GL/ES state trackers.
Otherwise, applications compiled with C compiler might have trouble
using them.
2010-09-17 12:57:06 +08:00
Brian Paul
d169a67ad1 mesa: include mfeatures.h in formats.c
Otherwise, FEATURE_EXT_texture_sRGB was undefined.
This is (part of?) the fix for fd.o bug 30177.

(cherry picked from commit 3a6f9d0f47)
2010-09-16 12:42:53 -06:00
Marek Olšák
be16a35438 r300g/swtcl: fix CS overrun
https://bugs.freedesktop.org/show_bug.cgi?id=29901
(cherry picked from commit d4b2de13bc)
2010-09-16 20:35:39 +02:00
Brian Paul
d46b7c9f6f glx: add const qualifiers to __indirect_glMultiDrawArraysEXT()
(cherry picked from commit 4cd751bcc4)
2010-09-16 14:34:06 +08:00
Chia-I Wu
5d02503467 st/xlib: Notify the context when the front/back buffers are swapped.
The current context should be notified when the the front/back buffers
of the current drawable are swapped.  The notification was skipped when
xmesa_strict_invalidate is false (the default).

This fixes fdo bug #29774.
(cherry picked from commit 03224f492d)
2010-09-16 14:24:46 +08:00
Chia-I Wu
e3b89388ff mesa: Update ES APIspec.xml.
Enable some extensions now that the needed tokens are defined in
GLES/glext.h and GLES2/glext.h.  Update the prototype of MultiDrawArrays
now that the prototype of _mesa_MultiDrawArraysEXT has been updated.
(cherry picked from commit 9ca59b2427)
2010-09-16 14:24:45 +08:00
Chia-I Wu
d6538baa3b glapi: Fix ES build errors again.
This fixes an error in GLAPI ES.  My build is ok with or without this
patch, and the error affects others' setups.

[Patch from Francesco Marella]
(cherry picked from commit e3c46cf586)
2010-09-16 14:24:45 +08:00
Chia-I Wu
16a023ad7d glapi: Fix build errors for ES.
The latest glext.h defines GL_FIXED.  Test GL_OES_fixed_point instead to
decide whether to define GLfixed and GLclampx.

This fixes fdo bug #30205.
(cherry picked from commit cad87ebc3a)
2010-09-16 14:24:45 +08:00
Andre Maasikas
029eb8e764 r600c: fix buffer height setting in dri2 case
fbHeight is 0 in this case

uncovered by changes in b0bc026c and should fix kernel rejecting command
streams after that commit
2010-09-16 09:09:43 +03:00
Brian Paul
71b4054a6c tgsi: fix incorrect usage_mask for shadow tex instructions
The shadow versions of the texture targets use an extra component
(Z) to express distance from light source to the fragment.
Fixes the shadowtex demo with llvmpipe.

(cherry picked from commit 95254bbd2d)
2010-09-15 13:57:50 -06:00
Keith Whitwell
8e8a42ffc5 llvmpipe: return zero from floor_pot(zero) 2010-09-15 16:41:59 +01:00
Dave Airlie
fd4c6bd135 r300g: fix buffer reuse issue caused by previous commit
caused by 0b9eb5c9bb

test run glxgears, resize.
(cherry picked from commit 09ef8e9283)
2010-09-15 13:32:29 +02:00
Marek Olšák
5d4409e0e5 r300g: prevent creating multiple winsys BOs for the same handle
This fixes a DRM deadlock in the cubestorm xscreensaver, because somehow
there must not be 2 different BOs relocated in one CS if both BOs back
the same handle. I was told it is impossible to happen, but apparently
it is not, or there is something else wrong.
(cherry picked from commit 0b9eb5c9bb)
2010-09-15 04:34:36 +02:00
Luca Barbieri
26e63a431d auxiliary: fix unintended fallthrough 2010-09-14 23:22:16 +02:00
404 changed files with 23053 additions and 15997 deletions

View File

@@ -180,7 +180,7 @@ ultrix-gcc:
# Rules for making release tarballs
VERSION=7.9-devel
VERSION=7.9.2
DIRECTORY = Mesa-$(VERSION)
LIB_NAME = MesaLib-$(VERSION)
GLUT_NAME = MesaGLUT-$(VERSION)
@@ -329,6 +329,8 @@ GALLIUM_FILES = \
$(DIRECTORY)/src/gallium/Makefile.template \
$(DIRECTORY)/src/gallium/SConscript \
$(DIRECTORY)/src/gallium/targets/Makefile.dri \
$(DIRECTORY)/src/gallium/targets/Makefile.xorg \
$(DIRECTORY)/src/gallium/targets/SConscript.dri \
$(DIRECTORY)/src/gallium/*/Makefile \
$(DIRECTORY)/src/gallium/*/SConscript \
$(DIRECTORY)/src/gallium/*/*/Makefile \
@@ -342,25 +344,34 @@ GALLIUM_FILES = \
$(DIRECTORY)/src/gallium/*/*/*/*.[ch] \
$(DIRECTORY)/src/gallium/*/*/*/*.py
APPLE_DRI_FILES = \
$(DIRECTORY)/src/glx/apple/Makefile \
$(DIRECTORY)/src/glx/apple/*.[ch] \
$(DIRECTORY)/src/glx/apple/*.tcl \
$(DIRECTORY)/src/glx/apple/apple_exports.list \
$(DIRECTORY)/src/glx/apple/GL_aliases \
$(DIRECTORY)/src/glx/apple/GL_extensions \
$(DIRECTORY)/src/glx/apple/GL_noop \
$(DIRECTORY)/src/glx/apple/GL_promoted \
$(DIRECTORY)/src/glx/apple/specs/*.spec \
$(DIRECTORY)/src/glx/apple/specs/*.tm
DRI_FILES = \
$(DIRECTORY)/include/GL/internal/dri_interface.h \
$(DIRECTORY)/include/GL/internal/glcore.h \
$(DIRECTORY)/include/GL/internal/sarea.h \
$(DIRECTORY)/src/glx/Makefile \
$(DIRECTORY)/src/glx/Makefile \
$(DIRECTORY)/src/glx/*.[ch] \
$(APPLE_DRI_FILES) \
$(DIRECTORY)/src/mesa/drivers/dri/Makefile \
$(DIRECTORY)/src/mesa/drivers/dri/Makefile.template \
$(DIRECTORY)/src/mesa/drivers/dri/dri.pc.in \
$(DIRECTORY)/src/mesa/drivers/dri/common/xmlpool/*.[ch] \
$(DIRECTORY)/src/mesa/drivers/dri/common/xmlpool/*.po \
$(DIRECTORY)/src/mesa/drivers/dri/*/*.[chS] \
$(DIRECTORY)/src/mesa/drivers/dri/*/*.cpp \
$(DIRECTORY)/src/mesa/drivers/dri/*/*/*.[chS] \
$(DIRECTORY)/src/mesa/drivers/dri/*/Makefile \
$(DIRECTORY)/src/mesa/drivers/dri/*/*/Makefile \
$(DIRECTORY)/src/mesa/drivers/dri/*/Doxyfile \
$(DIRECTORY)/src/mesa/drivers/dri/*/server/*.[ch]
$(DIRECTORY)/src/mesa/drivers/dri/*/Doxyfile
SGI_GLU_FILES = \
$(DIRECTORY)/src/glu/Makefile \

View File

@@ -34,9 +34,6 @@ LLVM_LIBS = @LLVM_LIBS@
GLW_CFLAGS = @GLW_CFLAGS@
GLUT_CFLAGS = @GLUT_CFLAGS@
TALLOC_LIBS = @TALLOC_LIBS@
TALLOC_CFLAGS = @TALLOC_CFLAGS@
# dlopen
DLOPEN_LIBS = @DLOPEN_LIBS@
@@ -53,7 +50,7 @@ MKDEP_OPTIONS = @MKDEP_OPTIONS@
INSTALL = @INSTALL@
# Python and flags (generally only needed by the developers)
PYTHON2 = python
PYTHON2 = @PYTHON2@
PYTHON_FLAGS = -t -O -O
# Library names (base name)

View File

@@ -31,21 +31,23 @@ CXXFLAGS = -ggdb3 -Os -Wall -fno-strict-aliasing \
-I$(INSTALL_DIR)/include -I$(X11_DIR)/include $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(ASM_FLAGS) $(DEFINES)
# Library names (actual file names)
GL_LIB_NAME = libGL.dylib
GLU_LIB_NAME = libGLU.dylib
GLUT_LIB_NAME = libglut.dylib
GLW_LIB_NAME = libGLw.dylib
OSMESA_LIB_NAME = libOSMesa.dylib
GL_LIB_NAME = lib$(GL_LIB).dylib
GLU_LIB_NAME = lib$(GLU_LIB).dylib
GLUT_LIB_NAME = lib$(GLUT_LIB).dylib
GLW_LIB_NAME = lib$(GLW_LIB).dylib
OSMESA_LIB_NAME = lib$(OSMESA_LIB).dylib
VG_LIB_NAME = lib$(VG_LIB).dylib
# globs used to install the lib and all symlinks
GL_LIB_GLOB = libGL.*dylib
GLU_LIB_GLOB = libGLU.*dylib
GLUT_LIB_GLOB = libglut.*dylib
GLW_LIB_GLOB = libGLw.*dylib
OSMESA_LIB_GLOB = libOSMesa.*dylib
GL_LIB_GLOB = lib$(GL_LIB).*dylib
GLU_LIB_GLOB = lib$(GLU_LIB).*dylib
GLUT_LIB_GLOB = lib$(GLUT_LIB).*dylib
GLW_LIB_GLOB = lib$(GLW_LIB).*dylib
OSMESA_LIB_GLOB = lib$(OSMESA_LIB).*dylib
VG_LIB_GLOB = lib$(VG_LIB).*dylib
GL_LIB_DEPS = -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X11_DIR)/$(LIB_DIR) -lX11 -lXext -lm -lpthread
OSMESA_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB)
OSMESA_LIB_DEPS =
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB)
GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X11_DIR)/$(LIB_DIR) -lX11 -lXmu -lXi -lXext
GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X11_DIR)/$(LIB_DIR) -lX11 -lXt
@@ -57,3 +59,5 @@ GLU_DIRS = sgi
DRIVER_DIRS = osmesa
#DRIVER_DIRS = dri
DRI_DIRS = swrast
GALLIUM_DRIVERS_DIRS = softpipe trace rbug noop identity galahad failover
#GALLIUM_DRIVERS_DIRS += llvmpipe

View File

@@ -82,9 +82,6 @@ GLESv1_CM_LIB_GLOB = $(GLESv1_CM_LIB_NAME)*
GLESv2_LIB_GLOB = $(GLESv2_LIB_NAME)*
VG_LIB_GLOB = $(VG_LIB_NAME)*
TALLOC_LIBS = `pkg-config --libs talloc`
TALLOC_CFLAGS = `pkg-config --cflags talloc`
# Optional assembly language optimization files for libGL
MESA_ASM_SOURCES =
@@ -119,7 +116,7 @@ EGL_CLIENT_APIS = $(GL_LIB)
# Library dependencies
#EXTRA_LIB_PATH ?=
GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lm -lpthread $(TALLOC_LIBS)
GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lm -lpthread
EGL_LIB_DEPS = $(EXTRA_LIB_PATH) -ldl -lpthread
OSMESA_LIB_DEPS = $(EXTRA_LIB_PATH) -L$(TOP)/$(LIB_DIR) -l$(GL_LIB)
GLU_LIB_DEPS = $(EXTRA_LIB_PATH) -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lm

View File

@@ -45,7 +45,7 @@ EXTRA_LIB_PATH=-L/usr/X11R6/lib
LIBDRM_CFLAGS = $(shell pkg-config --cflags libdrm)
LIBDRM_LIB = $(shell pkg-config --libs libdrm)
DRI_LIB_DEPS = $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl -ltalloc $(LIBDRM_LIB)
DRI_LIB_DEPS = $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl $(LIBDRM_LIB)
GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lXdamage -lXfixes \
-lm -lpthread -ldl $(LIBDRM_LIB)

View File

@@ -41,4 +41,4 @@ else
endif
LD = g++
GL_LIB_DEPS = $(LLVM_LDFLAGS) $(LLVM_LIBS) $(EXTRA_LIB_PATH) -lX11 -lXext -lm -lpthread -ltalloc -lstdc++ -ludis86
GL_LIB_DEPS = $(LLVM_LDFLAGS) $(LLVM_LIBS) $(EXTRA_LIB_PATH) -lX11 -lXext -lm -lpthread -lstdc++ -ludis86

View File

@@ -30,6 +30,7 @@ AC_PROG_CPP
AC_PROG_CC
AC_PROG_CXX
AC_CHECK_PROGS([MAKE], [gmake make])
AC_CHECK_PROGS([PYTHON2], [python2 python])
AC_PATH_PROG([MKDEP], [makedepend])
AC_PATH_PROG([SED], [sed])
@@ -493,10 +494,6 @@ xxlib|xdri|xosmesa)
;;
esac
PKG_CHECK_MODULES([TALLOC], [talloc])
AC_SUBST([TALLOC_LIBS])
AC_SUBST([TALLOC_CFLAGS])
dnl
dnl Driver specific build directories
dnl
@@ -608,8 +605,8 @@ xlib)
GL_PC_LIB_PRIV="$GL_LIB_DEPS"
GL_PC_CFLAGS="$X11_INCLUDES"
fi
GL_LIB_DEPS="$GL_LIB_DEPS $SELINUX_LIBS -lm -lpthread $TALLOC_LIBS"
GL_PC_LIB_PRIV="$GL_PC_LIB_PRIV $SELINUX_LIBS -lm -lpthread $TALLOC_LIBS"
GL_LIB_DEPS="$GL_LIB_DEPS $SELINUX_LIBS -lm -lpthread"
GL_PC_LIB_PRIV="$GL_PC_LIB_PRIV $SELINUX_LIBS -lm -lpthread"
# if static, move the external libraries to the programs
# and empty the libraries for libGL
@@ -692,6 +689,11 @@ AC_SUBST([GLESv2_PC_LIB_PRIV])
AC_SUBST([HAVE_XF86VIDMODE])
PKG_CHECK_MODULES([LIBDRM_RADEON],
[libdrm_radeon libdrm >= $LIBDRM_RADEON_REQUIRED],
HAVE_LIBDRM_RADEON=yes,
HAVE_LIBDRM_RADEON=no)
dnl
dnl More X11 setup
dnl
@@ -896,7 +898,7 @@ if test "$mesa_driver" = dri; then
[AC_MSG_ERROR([Expat required for DRI.])])
# put all the necessary libs together
DRI_LIB_DEPS="$SELINUX_LIBS $LIBDRM_LIBS $EXPAT_LIB -lm -lpthread $DLOPEN_LIBS $TALLOC_LIBS"
DRI_LIB_DEPS="$SELINUX_LIBS $LIBDRM_LIBS $EXPAT_LIB -lm -lpthread $DLOPEN_LIBS"
fi
AC_SUBST([DRI_DIRS])
AC_SUBST([EXPAT_INCLUDES])
@@ -910,12 +912,7 @@ esac
case $DRI_DIRS in
*radeon*|*r200*|*r300*|*r600*)
PKG_CHECK_MODULES([LIBDRM_RADEON],
[libdrm_radeon libdrm >= $LIBDRM_RADEON_REQUIRED],
HAVE_LIBDRM_RADEON=yes,
HAVE_LIBDRM_RADEON=no)
if test "$HAVE_LIBDRM_RADEON" = yes; then
if test "x$HAVE_LIBDRM_RADEON" = xyes; then
RADEON_CFLAGS="-DHAVE_LIBDRM_RADEON=1 $LIBDRM_RADEON_CFLAGS"
RADEON_LDFLAGS=$LIBDRM_RADEON_LIBS
fi
@@ -974,12 +971,12 @@ case "$DRIVER_DIRS" in
*osmesa*)
# only link libraries with osmesa if shared
if test "$enable_static" = no; then
OSMESA_LIB_DEPS="-lm -lpthread $SELINUX_LIBS $DLOPEN_LIBS $TALLOC_LIBS"
OSMESA_LIB_DEPS="-lm -lpthread $SELINUX_LIBS $DLOPEN_LIBS"
else
OSMESA_LIB_DEPS=""
fi
OSMESA_MESA_DEPS=""
OSMESA_PC_LIB_PRIV="-lm -lpthread $SELINUX_LIBS $DLOPEN_LIBS $TALLOC_LIBS"
OSMESA_PC_LIB_PRIV="-lm -lpthread $SELINUX_LIBS $DLOPEN_LIBS"
;;
esac
AC_SUBST([OSMESA_LIB_DEPS])
@@ -1363,7 +1360,7 @@ fi
AC_ARG_WITH([egl-platforms],
[AS_HELP_STRING([--with-egl-platforms@<:@=DIRS...@:>@],
[comma delimited native platforms libEGL supports, e.g.
"x11,kms" @<:@default=auto@:>@])],
"x11,drm" @<:@default=auto@:>@])],
[with_egl_platforms="$withval"],
[with_egl_platforms=yes])
AC_ARG_WITH([egl-displays],
@@ -1376,6 +1373,9 @@ case "$with_egl_platforms" in
yes)
if test "x$enable_egl" = xyes && test "x$mesa_driver" != xosmesa; then
EGL_PLATFORMS="x11"
if test "$mesa_driver" = dri; then
EGL_PLATFORMS="$EGL_PLATFORMS drm"
fi
fi
;;
*)
@@ -1518,18 +1518,28 @@ elif test "x$enable_gallium_i965" = xauto; then
fi
dnl
dnl Gallium Radeon configuration
dnl Gallium Radeon r300g configuration
dnl
AC_ARG_ENABLE([gallium-radeon],
[AS_HELP_STRING([--enable-gallium-radeon],
[build gallium radeon @<:@default=disabled@:>@])],
[enable_gallium_radeon="$enableval"],
[enable_gallium_radeon=auto])
if test "x$enable_gallium_radeon" = xauto; then
if test "x$HAVE_LIBDRM_RADEON" = xyes; then
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r300"
gallium_check_st "radeon/drm" "dri-r300"
else
AC_MSG_WARN([libdrm_radeon is missing, not building gallium-radeon (r300)])
fi
fi
if test "x$enable_gallium_radeon" = xyes; then
if test "x$HAVE_LIBDRM_RADEON" = xyes; then
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r300"
gallium_check_st "radeon/drm" "dri-r300" "xorg-radeon"
elif test "x$enable_gallium_radeon" = xauto; then
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r300"
else
AC_MSG_ERROR([libdrm_radeon is missing, cannot build gallium-radeon (r300)])
fi
fi
dnl
@@ -1541,8 +1551,12 @@ AC_ARG_ENABLE([gallium-r600],
[enable_gallium_r600="$enableval"],
[enable_gallium_r600=auto])
if test "x$enable_gallium_r600" = xyes; then
if test "x$HAVE_LIBDRM_RADEON" = xyes; then
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r600"
gallium_check_st "r600/drm" "dri-r600"
else
AC_MSG_ERROR([libdrm_radeon is missing, cannot build gallium-r600])
fi
fi
dnl
@@ -1670,6 +1684,8 @@ echo ""
echo " CFLAGS: $cflags"
echo " CXXFLAGS: $cxxflags"
echo " Macros: $defines"
echo ""
echo " PYTHON2: $PYTHON2"
echo ""
echo " Run '${MAKE-make}' to build Mesa"

View File

@@ -145,7 +145,7 @@ Make sure the values in src/mesa/main/version.h are correct.
</p>
<p>
Update the docs/news.html file and docs/download.html files.
Update docs/news.html.
</p>
<p>
@@ -208,10 +208,11 @@ sftp USERNAME,mesa3d@web.sourceforge.net
<p>
Make an announcement on the mailing lists:
<em>m</em><em>e</em><em>s</em><em>a</em><em>3</em><em>d</em><em>-</em><em>d</em><em>e</em><em>v</em><em>@</em><em>l</em><em>i</em><em>s</em><em>t</em><em>s</em><em>.</em><em>s</em><em>f</em><em>.</em><em>n</em><em>e</em><em>t</em>,
<em>m</em><em>e</em><em>s</em><em>a</em><em>3</em><em>d</em><em>-</em><em>u</em><em>s</em><em>e</em><em>r</em><em>s</em><em>@</em><em>l</em><em>i</em><em>s</em><em>t</em><em>s</em><em>.</em><em>s</em><em>f</em><em>.</em><em>n</em><em>e</em><em>t</em>
<em>m</em><em>e</em><em>s</em><em>a</em><em>-</em><em>d</em><em>e</em><em>v</em><em>@</em><em>l</em><em>i</em><em>s</em><em>t</em><em>s</em><em>.</em><em>f</em><em>r</em><em>e</em><em>e</em><em>d</em><em>e</em><em>s</em><em>k</em><em>t</em><em>o</em><em>p</em><em>.</em><em>o</em><em>r</em><em>g</em>,
<em>m</em><em>e</em><em>s</em><em>a</em><em>-</em><em>u</em><em>s</em><em>e</em><em>r</em><em>s</em><em>@</em><em>l</em><em>i</em><em>s</em><em>t</em><em>s</em><em>.</em><em>f</em><em>r</em><em>e</em><em>e</em><em>d</em><em>e</em><em>s</em><em>k</em><em>t</em><em>o</em><em>p</em><em>.</em><em>o</em><em>r</em><em>g</em>
and
<em>m</em><em>e</em><em>s</em><em>a</em><em>3</em><em>d</em><em>-</em><em>a</em><em>n</em><em>n</em><em>o</em><em>u</em><em>n</em><em>c</em><em>e</em><em>@</em><em>l</em><em>i</em><em>s</em><em>t</em><em>s</em><em>.</em><em>s</em><em>f</em><em>.</em><em>n</em><em>e</em><em>t</em>
<em>m</em><em>e</em><em>s</em><em>a</em><em>-</em><em>a</em><em>n</em><em>n</em><em>o</em><em>u</em><em>n</em><em>c</em><em>e</em><em>@</em><em>l</em><em>i</em><em>s</em><em>t</em><em>s</em><em>.</em><em>f</em><em>r</em><em>e</em><em>e</em><em>d</em><em>e</em><em>s</em><em>k</em><em>t</em><em>o</em><em>p</em><em>.</em><em>o</em><em>r</em><em>g</em>
</p>

View File

@@ -72,13 +72,13 @@ drivers will be installed to <code>${libdir}/egl</code>.</p>
<li><code>--with-egl-platforms</code>
<p>List the platforms (window systems) to support. Its argument is a comma
seprated string such as <code>--with-egl-platforms=x11,kms</code>. It decides
seprated string such as <code>--with-egl-platforms=x11,drm</code>. It decides
the platforms a driver may support. The first listed platform is also used by
the main library to decide the native platform: the platform the EGL native
types such as <code>EGLNativeDisplayType</code> or
<code>EGLNativeWindowType</code> defined for.</p>
<p>The available platforms are <code>x11</code>, <code>kms</code>,
<p>The available platforms are <code>x11</code>, <code>drm</code>,
<code>fbdev</code>, and <code>gdi</code>. The <code>gdi</code> platform can
only be built with SCons.</p>

View File

@@ -9,16 +9,38 @@
<H1>Environment Variables</H1>
<p>
Mesa supports the following environment variables:
Normally, no environment variables need to be set. Most of the environment
variables used by Mesa/Gallium are for debugging purposes, but they can
sometimes be useful for debugging end-user issues.
</p>
<H2>LibGL environment variables</H2>
<ul>
<li>LIBGL_DEBUG - If defined debug information will be printed to stderr.
If set to 'verbose' additional information will be printed.
<li>LIBGL_DRIVERS_PATH - colon-separated list of paths to search for DRI drivers
<li>LIBGL_ALWAYS_INDIRECT - forces an indirect rendering context/connection.
<li>LIBGL_ALWAYS_SOFTWARE - if set, always use software rendering
<li>LIBGL_NO_DRAWARRAYS - if set do not use DrawArrays GLX protocol (for debugging)
</ul>
<H2>Core Mesa environment variables</H2>
<ul>
<li>MESA_NO_ASM - if set, disables all assembly language optimizations
<li>MESA_NO_MMX - if set, disables Intel MMX optimizations
<li>MESA_NO_3DNOW - if set, disables AMD 3DNow! optimizations
<li>MESA_NO_SSE - if set, disables Intel SSE optimizations
<li>MESA_DEBUG - if set, error messages are printed to stderr.
If the value of MESA_DEBUG is "FP" floating point arithmetic errors will
generate exceptions.
<li>MESA_DEBUG - if set, error messages are printed to stderr. For example,
if the application generates a GL_INVALID_ENUM error, a corresponding error
message indicating where the error occured, and possibly why, will be
printed to stderr.<br>
If the value of MESA_DEBUG is 'FP' floating point arithmetic errors will
generate exceptions.
<li>MESA_NO_DITHER - if set, disables dithering, overriding glEnable(GL_DITHER)
<li>MESA_TEX_PROG - if set, implement conventional texture env modes with
fragment programs (intended for developers only)
@@ -28,11 +50,14 @@ Setting this variable automatically sets the MESA_TEX_PROG variable as well.
<li>MESA_EXTENSION_OVERRIDE - can be used to enable/disable extensions.
A value such as "GL_EXT_foo -GL_EXT_bar" will enable the GL_EXT_foo extension
and disable the GL_EXT_bar extension.
<li>MESA_GLSL - <a href="shading.html#envvars">shading language options</a>
<li>MESA_GLSL - <a href="shading.html#envvars">shading language compiler options</a>
</ul>
<H2>Mesa Xlib driver environment variables</H2>
<p>
The following are only applicable to the Xlib software driver.
The following are only applicable to the Mesa Xlib software driver.
See the <A HREF="xlibdriver.html">Xlib software driver page</A> for details.
</p>
<ul>
@@ -51,9 +76,8 @@ See the <A HREF="xlibdriver.html">Xlib software driver page</A> for details.
</ul>
<p>
These environment variables are for the Intel i945/i965 drivers:
</p>
<h2>i945/i965 driver environment variables (non-Gallium)</h2>
<ul>
<li>INTEL_STRICT_CONFORMANCE - if set to 1, enable sw fallbacks to improve
OpenGL conformance. If set to 2, always use software rendering.
@@ -62,17 +86,71 @@ These environment variables are for the Intel i945/i965 drivers:
</ul>
<p>
These environment variables are for the Radeon R300 driver:
</p>
<h2>Radeon R300 driver environment variables (non-Gallium)</h2>
<ul>
<li>R300_NO_TCL - if set, disable hardware-accelerated Transform/Clip/Lighting.
</ul>
<h2>EGL environment variables</h2>
<p>
Mesa EGL supports different sets of environment variables. See the
<a href="egl.html">Mesa EGL</a> page for the details.
</p>
<h2>Gallium environment variables</h2>
<ul>
<li>GALLIUM_PRINT_OPTIONS - if non-zero, print all the Gallium environment
variables which are used, and their current values.
<li>GALLIUM_NOSSE - if non-zero, do not use SSE runtime code generation for
shader execution
<li>GALLIUM_NOPPC - if non-zero, do not use PPC runtime code generation for
shader execution
<li>GALLIUM_DUMP_CPU - if non-zero, print information about the CPU on start-up
<li>TGSI_PRINT_SANITY - if set, do extra sanity checking on TGSI shaders and
print any errors to stderr.
<LI>DRAW_FSE - ???
<LI>DRAW_NO_FSE - ???
<li>DRAW_USE_LLVM - if set to zero, the draw module will not use LLVM to execute
shaders, vertex fetch, etc.
</ul>
<h3>Softpipe driver environment variables</h3>
<ul>
<li>SOFTPIPE_DUMP_FS - if set, the softpipe driver will print fragment shaders
to stderr
<li>SOFTPIPE_DUMP_GS - if set, the softpipe driver will print geometry shaders
to stderr
<li>SOFTPIPE_NO_RAST - if set, rasterization is no-op'd. For profiling purposes.
</ul>
<h3>LLVMpipe driver environment variables</h3>
<ul>
<li>LP_NO_RAST - if set LLVMpipe will no-op rasterization
<li>LP_DEBUG - a comma-separated list of debug options is acceptec. See the
source code for details.
<li>LP_PERF - a comma-separated list of options to selectively no-op various
parts of the driver. See the source code for details.
<li>LP_NUM_THREADS - an integer indicating how many threads to use for rendering.
Zero turns of threading completely. The default value is the number of CPU
cores present.
</ul>
<p>
Other Gallium drivers have their own environment variables. These may change
frequently so the source code should be consulted for details.
</p>
<br>
<br>
</BODY>
</HTML>

View File

@@ -9,6 +9,9 @@
<center><h1>Mesa fbdev/DRI Drivers</h1></center>
<br>
<h1><center>NOTE: this information is obsolete and will be removed at
a future date</center></h1>
<h1>1. Introduction</h1>
<p>
@@ -22,7 +25,7 @@ Contributors to this project include Jon Smirl, Keith Whitwell and Dave Airlie.
<p>
Applications in the fbdev/DRI environment use
the <a href="http://www.nabble.com/file/p15480666/MiniGXL.html"> MiniGLX</a> interface to choose pixel
the MiniGLX 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.
@@ -315,8 +318,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="http://www.nabble.com/file/p15480666/MiniGLX.html">MiniGLX</a>
interface.
OpenGL/Mesa is interfaced to fbdev via the MiniGLX interface.
MiniGLX is a subset of Xlib and GLX API functions which provides just
enough functionality to setup OpenGL rendering and respond to simple
input events.
@@ -332,7 +334,7 @@ This allows some degree of flexibility for software development and testing.
However, the MiniGLX API is not binary-compatible with full Xlib/GLX.
Some of the structures are different and some macros/functions work
differently.
See the <code>GL/miniglx.h</code> header file for details.
See the GL/miniglx.h header file for details.
</p>

View File

@@ -11,6 +11,22 @@
<H1>News</H1>
<h2>October 4, 2010</h2>
<p>
<a href="relnotes-7.9.html">Mesa 7.9</a> (final) is released. This is a new
development release.
</p>
<h2>September 27, 2010</h2>
<p>
<a href="relnotes-7.9.html">Mesa 7.9.0-rc1</a> is released. This is a
release candidate for the 7.9 development release.
</p>
<h2>June 16, 2010</h2>
<p>
@@ -1277,7 +1293,6 @@ grateful.
<p>
</p><h2>March 18, 1999</h2>
<p>The new webpages are now online. Enjoy, and let me know if you find any errors.
For an eye-candy free version you can use <a href="http://www.mesa3d.org/txt/">http://www.mesa3d.org/txt/</a>.</p>
<p>
</p><h2>February 16, 1999</h2>
<p><a href="http://www.sgi.com/">SGI</a> releases its <a href="http://www.sgi.com/software/opensource/glx/">GLX

View File

@@ -26,7 +26,15 @@ for DRI hardware acceleration.
<h2>MD5 checksums</h2>
<pre>
tbd
c89b63d253605ed40e8ac370d25a833c MesaLib-7.8.2.tar.gz
6be2d343a0089bfd395ce02aaf8adb57 MesaLib-7.8.2.tar.bz2
a04ad3b06ac5ff3969a003fa7bbf7d5b MesaLib-7.8.2.zip
7c213f92efeb471f0331670d5079d4c0 MesaDemos-7.8.2.tar.gz
757d9e2e06f48b1a52848be9b0307ced MesaDemos-7.8.2.tar.bz2
8d0e5cfe68b8ebf90265d350ae2c48b1 MesaDemos-7.8.2.zip
b74482e3f44f35ed395c4aada4fd8240 MesaGLUT-7.8.2.tar.gz
a471807b65e49c325808ba4551be93ed MesaGLUT-7.8.2.tar.bz2
9f190268c42be582ef66e47365ee61e3 MesaGLUT-7.8.2.zip
</pre>
@@ -44,10 +52,95 @@ tbd
<ul>
<li>Fixed Gallium glDrawPixels(GL_DEPTH_COMPONENT).
<li>Fixed Gallium Cell driver to buildable, runable state
<li>Fixed bad error checking for glFramebufferRenderbuffer(attachment=GL_DEPTH_STENCIL_ATTACHMENT).
<li>Fixed incorrect Z coordinate handling in "meta" glDraw/CopyPixels.
<a href="https://bugs.freedesktop.org/show_bug.cgi?id=23670">Bug
#23670</a>.</li>
<li>Assorted i965 driver fixes.
Including but not limited to:
<ul>
<li>Fix scissoring when width or height is
0. <a href="https://bugs.freedesktop.org/show_bug.cgi?id=27643">Bug
#27643</a>.
<li>Fix bit allocation for number of color regions for
ARB_draw_buffers.</li>
<li>Set the correct provoking vertex for clipped first-mode
trifans. <a href="https://bugs.freedesktop.org/show_bug.cgi?id=24470">Bug
#24470</a>.</li>
<li>Use <code>R16G16B16A16_FLOAT</code> for 3-component half-float.</li>
<li>Fix assertion for surface tile offset usage on Ironlake.</li>
<li>Fix cube map layouts on Ironlake.</li>
<li>When an RB gets a new region, clear the old from the state
cache. <a href="https://bugs.freedesktop.org/show_bug.cgi?id=24119">Bug
#24119</a>.</li>
<li>Reject shaders with uninlined function calls instead of hanging.</li>
</ul>
</li>
<li>Assorted i915 driver fixes. Including but not limited to:
<ul>
<li>Fixed texture LOD clamping in i915 driver.
<a href="https://bugs.freedesktop.org/show_bug.cgi?id=24846">Bug
#24846</a>.</li>
<li>Fix off-by-one for drawing rectangle.
<a href="https://bugs.freedesktop.org/show_bug.cgi?id=27408">Bug
#27408</a>.</li>
</ul>
</li>
<li>Fixed hangs in etracer on 830 and 845
chipsets. <a href="https://bugs.freedesktop.org/show_bug.cgi?id=26557">Bug
#26557</a>.</li>
<li>Fixed tiling of small textures on all Intel drivers.</li>
<li>Fixed crash in Savage driver when using <code>_mesa_CopyTexImage2D</code>.
<a href="https://bugs.freedesktop.org/show_bug.cgi?id=27652">Bug
#27652</a>.</li>
<li>Assorted GLX fixes. Including but not limited to:
<ul>
<li>Fixed <code>__glXInitializeVisualConfigFromTags</code>'s handling of
unrecognized fbconfig tags.</li>
<li>Fixed regression with <code>GLX_USE_GL</code>.
<li>Fixed config chooser logic for 'mask' matching.</li>
<li>Report swap events correctly in direct rendered case (DRI2)</li>
<li>Fixed build with dri2proto which doesn't define
<code>X_DRI2SwapInterval</code>.</li>
<li>Get <code>GLX_SCREEN</code> first in <code>__glXQueryContextInfo</code>.
<a href="https://bugs.freedesktop.org/show_bug.cgi?id=14245">Bug
#14245</a>.</li>
</ul>
</li>
<li>Assorted GLSL fixes. Including but not limited to:
<ul>
<li>Change variable declared assertion into conditional in GLSL
compiler. <a href="https://bugs.freedesktop.org/show_bug.cgi?id=27921">Bug
#27921</a>.</li>
<li>Fix instruction indexing
bugs. <a href="https://bugs.freedesktop.org/show_bug.cgi?id=27566">Bug
#27566</a>.</li>
<li>Updated uniform location / offset encoding to be more like
other implementations.</li>
<li>Don't overwrite a driver's shader infolog with generic failure
message.</li>
</ul>
</li>
<li>Fixed OSMesa build for 16 and 32-bit color channel depth.
<li>Fixed OSMesa build with hidden symbol visibility. libOSMesa no longer links to libGL.
<a href="https://bugs.freedesktop.org/show_bug.cgi?id=28305">Bug
#28305</a>.
<li>Fixed handling of multiple render targets in fixed-function
texture envrionmnent programs.</li>
<li>Fixed conversion errors in <code>signed_rgba8888[rev]</code> texel
fetch.</li>
<li>Don't set srcLevel on <code>GL_TEXTURE_RECTANGLE_ARB</code> targets.</li>
<li>Various build fixes for OpenBSD.</li>
<li>Various build fixes for OS X.</li>
<li>Various build fixes for GCC 3.3.</li>
</ul>
<h2>Changes</h2>
<p>None.</p>
</body>
</html>

89
docs/relnotes-7.8.3.html Normal file
View File

@@ -0,0 +1,89 @@
<HTML>
<TITLE>Mesa Release Notes</TITLE>
<head><link rel="stylesheet" type="text/css" href="mesa.css"></head>
<BODY>
<body bgcolor="#eeeeee">
<H1>Mesa 7.8.3 Release Notes / (date tbd)</H1>
<p>
Mesa 7.8.3 is a bug fix release which fixes bugs found since the 7.8.2 release.
</p>
<p>
Mesa 7.8.3 implements the OpenGL 2.1 API, but the version reported by
glGetString(GL_VERSION) depends on the particular driver being used.
Some drivers don't support all the features required in OpenGL 2.1.
</p>
<p>
See the <a href="install.html">Compiling/Installing page</a> for prerequisites
for DRI hardware acceleration.
</p>
<h2>MD5 checksums</h2>
<pre>
x MesaLib-7.8.3.tar.gz
x MesaLib-7.8.3.tar.bz2
x MesaLib-7.8.3.zip
x MesaDemos-7.8.3.tar.gz
x MesaDemos-7.8.3.tar.bz2
x MesaDemos-7.8.3.zip
x MesaGLUT-7.8.3.tar.gz
x MesaGLUT-7.8.3.tar.bz2
x MesaGLUT-7.8.3.zip
</pre>
<h2>New features</h2>
<p>None.</p>
<h2>Changes</h2>
<ul>
<li>The radeon driver should use less memory when searching for a valid mip
image.</li>
</ul>
<h2>Bug fixes</h2>
<ul>
<li>Fix unsupported FB with D24S8 (bug
<a href="https://bugs.freedesktop.org/show_bug.cgi?id=23670">29116</a>)</li>
<li>Fix ReadPixels crash when reading depth/stencil from an FBO</li>
<li>Fixed a bug rendering to 16-bit buffers using swrast.</li>
<li>Fixed a state tracker/TGSI bug that caused crashes when using Windows'
memory debugging features.</li>
<li>Fixed an issue rendering to 32-bit channels with swrast (bug
<a href="https://bugs.freedesktop.org/show_bug.cgi?id=29487">29487</a>)</li>
<li>GLSL: fix indirect <TT>gl_TextureMatrix</TT> addressing (bug
<a href="https://bugs.freedesktop.org/show_bug.cgi?id=28967">28967</a>)</li>
<li>GLSL: fix for bug
<a href="https://bugs.freedesktop.org/show_bug.cgi?id=27216">27216</a></li>
<li>GLSL: fix zw fragcoord entries in some cases (bug
<a href="https://bugs.freedesktop.org/show_bug.cgi?id=29183">29183</a>)</li>
<li>Fix texture env generation in some cases (bug
<a href="https://bugs.freedesktop.org/show_bug.cgi?id=28169">28169</a>)</li>
<li>osmesa: a fix for calling <TT>OSMesaMakeCurrent</TT> twice was applied (bug
<a href="https://bugs.freedesktop.org/show_bug.cgi?id=10966">10966</a></li>
<li>A bug was fixed which could cause Mesa to ignore the
<TT>MESA_EXTENSION_OVERRIDE</TT> environment variable.</li>
<li>A bug related to specular highlights on backfaces was fixed.</li>
<li>A radeon-specific issue with <TT>glCopyTex(Sub)Image</TT> was
corrected.</li>
<li>radeon/wine: flush command stream in more cases, fixing wine d3d9
tests.</li>
<li>r600: fix sin+cos normalization.</li>
<li>r600: (properly) ignore <TT>GL_COORD_REPLACE</TT> when point sprites are
disabled.</li>
<li>radeon: avoid flushing when the context is not current.</li>
<li>r300c: a bug affecting unaligned BOs was fixed.</li>
<li>r300c: a hardlock caused by ARB_half_float_vertex incorrectly advertised on some chipsets.</li>
</ul>
</body>
</html>

406
docs/relnotes-7.9.1.html Normal file
View File

@@ -0,0 +1,406 @@
<HTML>
<head>
<TITLE>Mesa Release Notes</TITLE>
<link rel="stylesheet" type="text/css" href="mesa.css">
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
</head>
<BODY>
<body bgcolor="#eeeeee">
<H1>Mesa 7.9.1 Release Notes / January 7, 2011</H1>
<p>
Mesa 7.9.1 is a bug fix release which fixes bugs found since the 7.9 release.
</p>
<p>
Mesa 7.9.1 implements the OpenGL 2.1 API, but the version reported by
glGetString(GL_VERSION) depends on the particular driver being used.
Some drivers don't support all the features required in OpenGL 2.1.
</p>
<p>
See the <a href="install.html">Compiling/Installing page</a> for prerequisites
for DRI hardware acceleration.
</p>
<h2>MD5 checksums</h2>
<pre>
78422843ea875ad4eac35b9b8584032b MesaLib-7.9.1.tar.gz
07dc6cfb5928840b8b9df5bd1b3ae434 MesaLib-7.9.1.tar.bz2
c8eaea5b3c3d6dee784bd8c2db91c80f MesaLib-7.9.1.zip
ee9ecae4ca56fbb2d14dc15e3a0a7640 MesaGLUT-7.9.1.tar.gz
41fc477d524e7dc5c84da8ef22422bea MesaGLUT-7.9.1.tar.bz2
90b287229afdf19317aa989d19462e7a MesaGLUT-7.9.1.zip
</pre>
<h2>New features</h2>
<p>None.</p>
<h2>Bug fixes</h2>
<p>This list is likely incomplete.</p>
<ul>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=28800">Bug 28800</a> - [r300c, r300g] Texture corruption with World of Warcraft</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=29420">Bug 29420</a> - Amnesia / HPL2 RendererFeatTest - not rendering correctly</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=29946">Bug 29946</a> - [swrast] piglit valgrind glsl-array-bounds-04 fails</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=30261">Bug 30261</a> - [GLSL 1.20] allowing inconsistent invariant declaration between two vertex shaders</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=30632">Bug 30632</a> - [softpipe] state_tracker/st_manager.c:489: st_context_notify_invalid_framebuffer: Assertion `stfb &amp;&amp; stfb-&gt;iface == stfbi' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=30694">Bug 30694</a> - wincopy will crash on Gallium drivers when going to front buffer</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=30787">Bug 30787</a> - Invalid asm shader does not generate draw-time error when used with GLSL shader</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=30993">Bug 30993</a> - getFramebufferAttachmentParameteriv wrongly generates error</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31101">Bug 31101</a> - [glsl2] abort() in ir_validate::visit_enter(ir_assignment *ir)</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31193">Bug 31193</a> - [regression] aa43176e break water reflections</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31194">Bug 31194</a> - The mesa meta save/restore code doesn't ref the current GLSL program</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31371">Bug 31371</a> - glslparsertest: ir.cpp:358: ir_constant::ir_constant(const glsl_type*, const ir_constant_data*): Assertion `(type->base_type &gt;= 0) &amp;&amp; (type->base_type &lt;= 3)' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31439">Bug 31439</a> - Crash in glBufferSubData() with size == 0</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31495">Bug 31495</a> - [i965 gles2c bisected] OpenGL ES 2.0 conformance GL2Tests_GetBIFD_input.run regressed</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31514">Bug 31514</a> - isBuffer returns true for unbound buffers</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31560">Bug 31560</a> - [tdfx] tdfx_tex.c:702: error: const struct gl_color_table has no member named Format</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31617">Bug 31617</a> - Radeon/Compiz: 'failed to attach dri2 front buffer', error case not handled</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31648">Bug 31648</a> - [GLSL] array-struct-array gets assertion: `(size &gt;= 1) && (size &lt;= 4)' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31650">Bug 31650</a> - [GLSL] varying gl_TexCoord fails to be re-declared to different size in the second shader</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31673">Bug 31673</a> - GL_FRAGMENT_PRECISION_HIGH preprocessor macro undefined in GLSL ES</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31690">Bug 31690</a> - i915 shader compiler fails to flatten if in Aquarium webgl demo.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31832">Bug 31832</a> - [i915] Bad renderbuffer format: 21</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31841">Bug 31841</a> - [drm:radeon_cs_ioctl] *ERROR* Invalid command stream !</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31894">Bug 31894</a> - Writing to gl_PointSize with GLES2 corrupts other varyings</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31909">Bug 31909</a> - [i965] brw_fs.cpp:1461: void fs_visitor::emit_bool_to_cond_code(ir_rvalue*): Assertion `expr-&gt;operands[i]-&gt;type-&gt;is_scalar()' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31934">Bug 31934</a> - [gallium] Mapping empty buffer object causes SIGSEGV</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31983">Bug 31983</a> - [i915 gles2] "if (expression with builtin/varying variables) discard" breaks linkage</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31985">Bug 31985</a> - [GLSL 1.20] initialized uniform array considered as "unsized"</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31987">Bug 31987</a> - [gles2] if input a wrong pname(GL_NONE) to glGetBoolean, it will not case GL_INVALID_ENUM</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32035">Bug 32035</a> - [GLSL bisected] comparing unsized array gets segfault</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32070">Bug 32070</a> - llvmpipe renders stencil demo incorrectly</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32273">Bug 32273</a> - assertion fails when starting vdrift 2010 release with shaders enabled</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32287">Bug 32287</a> - [bisected GLSL] float-int failure</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32311">Bug 32311</a> - [965 bisected] Array look-ups broken on GM45</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32520">Bug 32520</a> - [gles2] glBlendFunc(GL_ZERO, GL_DST_COLOR) will result in GL_INVALID_ENUM</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32825">Bug 32825</a> - egl_glx driver completely broken in 7.9 branch [fix in master]</li>
</ul>
<h2>Changes</h2>
<p>The full set of changes can be viewed by using the following GIT command:</p>
<pre>
git log mesa-7.9..mesa-7.9.1
</pre>
<p>Alex Deucher (5):
<ul>
<li>r100: revalidate after radeon_update_renderbuffers</li>
<li>r600c: add missing radeon_prepare_render() call on evergreen</li>
<li>r600c: properly align mipmaps to group size</li>
<li>gallium/egl: fix r300 vs r600 loading</li>
<li>r600c: fix some opcodes on evergreen</li>
</ul></p>
<p>Aras Pranckevicius (2):
<ul>
<li>glsl: fix crash in loop analysis when some controls can't be determined</li>
<li>glsl: fix matrix type check in ir_algebraic</li>
</ul></p>
<p>Brian Paul (27):
<ul>
<li>swrast: fix choose_depth_texture_level() to respect mipmap filtering state</li>
<li>st/mesa: replace assertion w/ conditional in framebuffer invalidation</li>
<li>egl/i965: include inline_wrapper_sw_helper.h</li>
<li>mesa: Add missing else in do_row_3D</li>
<li>mesa: add missing formats in _mesa_format_to_type_and_comps()</li>
<li>mesa: handle more pixel types in mipmap generation code</li>
<li>mesa: make glIsBuffer() return false for never bound buffers</li>
<li>mesa: fix glDeleteBuffers() regression</li>
<li>swrast: init alpha value to 1.0 in opt_sample_rgb_2d()</li>
<li>meta: Mask Stencil.Clear against stencilMax in _mesa_meta_Clear</li>
<li>st/mesa: fix mapping of zero-sized buffer objects</li>
<li>mesa: check for posix_memalign() errors</li>
<li>llvmpipe: fix broken stencil writemask</li>
<li>mesa: fix GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME query</li>
<li>mesa: return GL_FRAMEBUFFER_DEFAULT as FBO attachment type</li>
<li>mesa: make glGet*(GL_NONE) generate GL_INVALID_ENUM</li>
<li>mesa: test for cube map completeness in glGenerateMipmap()</li>
<li>tnl: Initialize gl_program_machine memory in run_vp.</li>
<li>tnl: a better way to initialize the gl_program_machine memory</li>
<li>mesa, st/mesa: disable GL_ARB_geometry_shader4</li>
<li>glsl: fix off by one in register index assertion</li>
<li>st/mesa: fix mipmap generation bug</li>
<li>glsl: new glsl_strtod() wrapper to fix decimal point interpretation</li>
<li>mesa: no-op glBufferSubData() on size==0</li>
<li>tdfx: s/Format/_BaseFormat/</li>
<li>st/mesa: fix renderbuffer pointer check in st_Clear()</li>
<li>mesa: Bump the number of bits in the register index.</li>
</ul></p>
<p>Chad Versace (5):
<ul>
<li>glsl: Fix lexer rule for ^=</li>
<li>glsl: Fix ast-to-hir for ARB_fragment_coord_conventions</li>
<li>glsl: Fix ir_expression::constant_expression_value()</li>
<li>glsl: Fix erroneous cast in ast_jump_statement::hir()</li>
<li>glsl: Fix linker bug in cross_validate_globals()</li>
</ul></p>
<p>Chia-I Wu (10):
<ul>
<li>targets/egl: Fix linking with libdrm.</li>
<li>st/vega: Fix version check in context creation.</li>
<li>st/egl: Do not finish a fence that is NULL.</li>
<li>egl: Fix a false negative check in _eglCheckMakeCurrent.</li>
<li>st/mesa: Unreference the sampler view in st_bind_surface.</li>
<li>egl_dri2: Fix __DRI_DRI2 version 1 support.</li>
<li>st/vega: Do not wait NULL fences.</li>
<li>mesa: Do not advertise GL_OES_texture_3D.</li>
<li>egl_glx: Fix borken driver.</li>
<li>egl: Check extensions.</li>
</ul></p>
<p>Daniel Lichtenberger (1):
<ul>
<li>radeon: fix potential segfault in renderbuffer update</li>
</ul></p>
<p>Daniel Vetter (1):
<ul>
<li>r200: revalidate after radeon_update_renderbuffers</li>
</ul></p>
<p>Dave Airlie (1):
<ul>
<li>r300g: fixup rs690 tiling stride alignment calculations.</li>
</ul></p>
<p>Eric Anholt (13):
<ul>
<li>intel: Allow CopyTexSubImage to InternalFormat 3/4 textures, like RGB/RGBA.</li>
<li>glsl: Free the loop state context when we free the loop state.</li>
<li>i965: Allow OPCODE_SWZ to put immediates in the first arg.</li>
<li>i965: Add support for rendering to SARGB8 FBOs.</li>
<li>glsl: Add a helper constructor for expressions that works out result type.</li>
<li>glsl: Fix structure and array comparisions.</li>
<li>glsl: Quiet unreachable no-return-from-function warning.</li>
<li>glsl: Mark the array access for whole-array comparisons.</li>
<li>glsl: Fix flipped return of has_value() for array constants.</li>
<li>mesa: Add getters for the rest of the supported draw buffers.</li>
<li>mesa: Add getters for ARB_copy_buffer's attachment points.</li>
<li>i965: Correct the dp_read message descriptor setup on g4x.</li>
<li>glsl: Correct the marking of InputsRead/OutputsWritten on in/out matrices.</li>
</ul></p>
<p>Fabian Bieler (1):
<ul>
<li>glsl: fix lowering conditional returns in subroutines</li>
</ul></p>
<p>Francisco Jerez (3):
<ul>
<li>meta: Don't leak alpha function/reference value changes.</li>
<li>meta: Fix incorrect rendering of the bitmap alpha component.</li>
<li>meta: Don't try to disable cube maps if the driver doesn't expose the extension.</li>
</ul></p>
<p>Henri Verbeet (2):
<ul>
<li>r600: Evergreen has two extra frac_bits for the sampler LOD state.</li>
<li>st/mesa: Handle wrapped depth buffers in st_copy_texsubimage().</li>
</ul></p>
<p>Ian Romanick (33):
<ul>
<li>Add 7.9 md5sums</li>
<li>docs: Import 7.8.x release notes from 7.8 branch.</li>
<li>docs: download.html does not need to be updated for each release</li>
<li>docs: Update mailing lines from sf.net to freedesktop.org</li>
<li>docs: added news item for 7.9 release</li>
<li>mesa: Validate assembly shaders when GLSL shaders are used</li>
<li>linker: Reject shaders that have unresolved function calls</li>
<li>mesa: Refactor validation of shader targets</li>
<li>glsl: Slightly change the semantic of _LinkedShaders</li>
<li>linker: Improve handling of unread/unwritten shader inputs/outputs</li>
<li>glsl: Commit lexer files changed by previous cherry picking</li>
<li>mesa: Make metaops use program refcounts instead of names.</li>
<li>glsl: Fix incorrect gl_type of sampler2DArray and sampler1DArrayShadow</li>
<li>mesa: Allow query of MAX_SAMPLES with EXT_framebuffer_multisample</li>
<li>glsl: better handling of linker failures</li>
<li>mesa: Fix glGet of ES2's GL_MAX_*_VECTORS properties.</li>
<li>i915: Disallow alpha, red, RG, and sRGB as render targets</li>
<li>glsl/linker: Free any IR discarded by optimization passes.</li>
<li>glsl: Add an optimization pass to simplify discards.</li>
<li>glsl: Add a lowering pass to move discards out of if-statements.</li>
<li>i915: Correctly generate unconditional KIL instructions</li>
<li>glsl: Add unary ir_expression constructor</li>
<li>glsl: Ensure that equality comparisons don't return a NULL IR tree</li>
<li>glcpp: Commit changes in generated files cause by previous commit</li>
<li>glsl: Inherrit type of declared variable from initializer</li>
<li>glsl: Inherrit type of declared variable from initializer after processing assignment</li>
<li>linker: Ensure that unsized arrays have a size after linking</li>
<li>linker: Fix regressions caused by previous commit</li>
<li>linker: Allow built-in arrays to have different sizes between shader stages</li>
<li>ir_to_mesa: Don't generate swizzles for record derefs of non-scalar/vectors</li>
<li>Refresh autogenerated file builtin_function.cpp.</li>
<li>docs: Initial set of release notes for 7.9.1</li>
<li>mesa: set version string to 7.9.1</li>
</ul></p>
<p>Julien Cristau (1):
<ul>
<li>Makefile: don't include the same files twice in the tarball</li>
</ul></p>
<p>Kenneth Graunke (19):
<ul>
<li>glcpp: Return NEWLINE token for newlines inside multi-line comments.</li>
<li>generate_builtins.py: Output large strings as arrays of characters.</li>
<li>glsl: Fix constant component count in vector constructor emitting.</li>
<li>ir_dead_functions: Actually free dead functions and signatures.</li>
<li>glcpp: Define GL_FRAGMENT_PRECISION_HIGH if GLSL version &gt;= 1.30.</li>
<li>glsl: Unconditionally define GL_FRAGMENT_PRECISION_HIGH in ES2 shaders.</li>
<li>glsl: Fix constant expression handling for &lt, &gt;, &lt=, &gt;= on vectors.</li>
<li>glsl: Use do_common_optimization in the standalone compiler.</li>
<li>glsl: Don't inline function prototypes.</li>
<li>glsl: Add a virtual as_discard() method.</li>
<li>glsl: Remove "discard" support from lower_jumps.</li>
<li>glsl: Refactor get_num_operands.</li>
<li>glcpp: Don't emit SPACE tokens in conditional_tokens production.</li>
<li>glsl: Clean up code by adding a new is_break() function.</li>
<li>glsl: Consider the "else" branch when looking for loop breaks.</li>
<li>Remove OES_compressed_paletted_texture from the ES2 extension list.</li>
<li>glsl/builtins: Compute the correct value for smoothstep(vec, vec, vec).</li>
<li>Fix build on systems where "python" is python 3.</li>
<li>i965: Internally enable GL_NV_blend_square on ES2.</li>
</ul></p>
<p>Kristian Høgsberg (1):
<ul>
<li>i965: Don't write mrf assignment for pointsize output</li>
</ul></p>
<p>Luca Barbieri (1):
<ul>
<li>glsl: Unroll loops with conditional breaks anywhere (not just the end)</li>
</ul></p>
<p>Marek Olšák (17):
<ul>
<li>r300g: fix microtiling for 16-bits-per-channel formats</li>
<li>r300g: fix texture border for 16-bits-per-channel formats</li>
<li>r300g: add a default channel ordering of texture border for unhandled formats</li>
<li>r300g: fix texture border color for all texture formats</li>
<li>r300g: fix rendering with no vertex elements</li>
<li>r300/compiler: fix rc_rewrite_depth_out for it to work with any instruction</li>
<li>r300g: fix texture border color once again</li>
<li>r300g: fix texture swizzling with compressed textures on r400-r500</li>
<li>r300g: disable ARB_texture_swizzle if S3TC is enabled on r3xx-only</li>
<li>mesa, st/mesa: fix gl_FragCoord with FBOs in Gallium</li>
<li>st/mesa: initialize key in st_vp_varient</li>
<li>r300/compiler: fix swizzle lowering with a presubtract source operand</li>
<li>r300g: fix rendering with a vertex attrib having a zero stride</li>
<li>ir_to_mesa: Add support for conditional discards.</li>
<li>r300g: finally fix the texture corruption on r3xx-r4xx</li>
<li>mesa: fix texel store functions for some float formats</li>
<li>r300/compiler: disable the rename_regs pass for loops</li>
</ul></p>
<p>Mario Kleiner (1):
<ul>
<li>mesa/r300classic: Fix dri2Invalidate/radeon_prepare_render for page flipping.</li>
</ul></p>
<p>Peter Clifton (1):
<ul>
<li>intel: Fix emit_linear_blit to use DWORD aligned width blits</li>
</ul></p>
<p>Robert Hooker (2):
<ul>
<li>intel: Add a new B43 pci id.</li>
<li>egl_dri2: Add missing intel chip ids.</li>
</ul></p>
<p>Roland Scheidegger (1):
<ul>
<li>r200: fix r200 large points</li>
</ul></p>
<p>Thomas Hellstrom (17):
<ul>
<li>st/xorg: Don't try to use option values before processing options</li>
<li>xorg/vmwgfx: Make vmwarectrl work also on 64-bit servers</li>
<li>st/xorg: Add a customizer option to get rid of annoying cursor update flicker</li>
<li>xorg/vmwgfx: Don't hide HW cursors when updating them</li>
<li>st/xorg: Don't try to remove invalid fbs</li>
<li>st/xorg: Fix typo</li>
<li>st/xorg, xorg/vmwgfx: Be a bit more frendly towards cross-compiling environments</li>
<li>st/xorg: Fix compilation errors for Xservers compiled without Composite</li>
<li>st/xorg: Don't use deprecated x*alloc / xfree functions</li>
<li>xorg/vmwgfx: Don't use deprecated x*alloc / xfree functions</li>
<li>st/xorg: Fix compilation for Xservers &gt;= 1.10</li>
<li>mesa: Make sure we have the talloc cflags when using the talloc headers</li>
<li>egl: Add an include for size_t</li>
<li>mesa: Add talloc includes for gles</li>
<li>st/egl: Fix build for include files in nonstandard places</li>
<li>svga/drm: Optionally resolve calls to powf during link-time</li>
<li>gallium/targets: Trivial crosscompiling fix</li>
</ul></p>
<p>Tom Stellard (7):
<ul>
<li>r300/compiler: Make sure presubtract sources use supported swizzles</li>
<li>r300/compiler: Fix register allocator's handling of loops</li>
<li>r300/compiler: Fix instruction scheduling within IF blocks</li>
<li>r300/compiler: Use zero as the register index for unused sources</li>
<li>r300/compiler: Ignore alpha dest register when replicating the result</li>
<li>r300/compiler: Use correct swizzles for all presubtract sources</li>
<li>r300/compiler: Don't allow presubtract sources to be remapped twice</li>
</ul></p>
<p>Vinson Lee (1):
<ul>
<li>glsl: Fix 'control reaches end of non-void function' warning.</li>
</ul></p>
<p>richard (1):
<ul>
<li>r600c : inline vertex format is not updated in an app, switch to use vfetch constants. For the 7.9 and 7.10 branches as well.</li>
</ul></p>
</body>
</html>

336
docs/relnotes-7.9.2.html Normal file
View File

@@ -0,0 +1,336 @@
<HTML>
<head>
<TITLE>Mesa Release Notes</TITLE>
<link rel="stylesheet" type="text/css" href="mesa.css">
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
</head>
<BODY>
<body bgcolor="#eeeeee">
<H1>Mesa 7.9.2 Release Notes / March 2, 2011</H1>
<p>
Mesa 7.9.2 is a bug fix release which fixes bugs found since the 7.9.1 release.
</p>
<p>
Mesa 7.9.2 implements the OpenGL 2.1 API, but the version reported by
glGetString(GL_VERSION) depends on the particular driver being used.
Some drivers don't support all the features required in OpenGL 2.1.
</p>
<p>
See the <a href="install.html">Compiling/Installing page</a> for prerequisites
for DRI hardware acceleration.
</p>
<h2>MD5 checksums</h2>
<pre>
eb4ab8c1a03386def3ea34b1358e9cda MesaLib-7.9.2.tar.gz
8f6d1474912787ce13bd35f3bae9938a MesaLib-7.9.2.tar.bz2
427a81dd43ac97603768dc5c6af3df26 MesaLib-7.9.2.zip
aacb8f4db997e346db40c6066942140a MesaGLUT-7.9.2.tar.gz
18abe6cff4fad8ad4752c7b7ab548e5d MesaGLUT-7.9.2.tar.bz2
3189e5732d636c71baf3d8bc23ce7b11 MesaGLUT-7.9.2.zip
</pre>
<h2>New features</h2>
<p>None.</p>
<h2>Bug fixes</h2>
<p>This list is likely incomplete.</p>
<ul>
<li>Fix an off-by-one bug in a vsplit assertion.</li>
<li>Fix incorrect handling of <tt>layout</tt> qualifier
with <tt>in</tt>, <tt>out</tt>, <tt>attribute</tt>, and <tt>varying</tt>.</li>
<li>Fix an i965 GPU hang in GLSL shaders that contain an unconditional <tt>discard</tt> statement.</li>
<li>Fix an i965 shader bug where the negative absolute value was generated instead of the absolute value of a negation.</li>
<li>Fix numerous issues handling precision qualifiers in GLSL ES.</li>
<li>Fixed a few GLX protocol encoder bugs (Julien Cristau)</li>
<li>Assorted Gallium llvmpipe driver bug fixes</li>
<li>Assorted Mesa/Gallium state tracker bug fixes</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=26795">Bug 26795</a> - gl_FragCoord off by one in Gallium drivers.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=29164">Bug 29164</a> - [GLSL 1.20] invariant variable shouldn't be used before declaration</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=29823">Bug 29823</a> - GetUniform[if]v busted</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=29927">Bug 29927</a> - [glsl2] fail to compile shader with constructor for array of struct type</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=30156">Bug 30156</a> - [i965] After updating to Mesa 7.9, Civilization IV starts to show garbage</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31923">Bug 31923</a> - [GLSL 1.20] allowing inconsistent centroid declaration between two vertex shaders</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31925">Bug 31925</a> - [GLSL 1.20] "#pragma STDGL invariant(all)" fail</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32214">Bug 32214</a> - [gles2]no link error happens when missing vertex shader or frag shader</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32375">Bug 32375</a> - [gl gles2] Not able to get the attribute by function glGetVertexAttribfv</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32541">Bug 32541</a> - Segmentation Fault while running an HDR (high dynamic range) rendering demo</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32569">Bug 32569</a> - [gles2] glGetShaderPrecisionFormat not implemented yet</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32695">Bug 32695</a> - [glsl] SIGSEGV glcpp/glcpp-parse.y:833</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32831">Bug 32831</a> - [glsl] division by zero crashes GLSL compiler</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32910">Bug 32910</a> - Keywords 'in' and 'out' not handled properly for GLSL 1.20 shaders</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33219">Bug 33219</a> -[GLSL bisected] implicit sized array triggers segfault in ir_to_mesa_visitor::copy_propagate</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33306">Bug 33306</a> - GLSL integer division by zero crashes GLSL compiler</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33308">Bug 33308</a> -[glsl] ast_to_hir.cpp:3016: virtual ir_rvalue* ast_jump_statement::hir(exec_list*, _mesa_glsl_parse_state*): Assertion `ret != __null' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33316">Bug 33316</a> - uniform array will be allocate one line more and initialize it when it was freed will abort</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33386">Bug 33386</a> - Dubious assembler in read_rgba_span_x86.S</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33388">Bug 33388</a> - Dubious assembler in xform4.S</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33433">Bug 33433</a> - Error in x86-64 API dispatch code.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33507">Bug 33507</a> - [glsl] GLSL preprocessor modulus by zero crash</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33508">Bug 33508</a> - [glsl] GLSL compiler modulus by zero crash</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33916">Bug 33916</a> - Compiler accepts reserved operators % and %=</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34047">Bug 34047</a> - Assert in _tnl_import_array() when using GLfixed vertex datatypes with GLESv2</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34114">Bug 34114</a> - Sun Studio build fails due to standard library functions not being in global namespace</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34198">Bug 34198</a> - [GLSL] implicit sized array with index 0 used gets assertion</li>
<li><a href="https://bugs.launchpad.net/ubuntu/+source/mesa/+bug/691653">Ubuntu bug 691653</a> - compiz crashes when using alt-tab (the radeon driver kills it) </li>
<li><a href="https://bugs.meego.com/show_bug.cgi?id=13005">Meego bug 13005</a> - Graphics GLSL issue lead to camera preview fail on Pinetrail</li>
<!-- <li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=">Bug </a> - </li> -->
</ul>
<h2>Changes</h2>
<p>The full set of changes can be viewed by using the following GIT command:</p>
<pre>
git log mesa-7.9.1..mesa-7.9.2
</pre>
<p>Alberto Milone (1):
<ul>
<li>r600c: add evergreen ARL support.</li>
</ul></p>
<p>Brian Paul (19):
<ul>
<li>draw: Fix an off-by-one bug in a vsplit assertion.</li>
<li>mesa: fix a few format table mistakes, assertions</li>
<li>mesa: fix num_draw_buffers==0 in fixed-function fragment program generation</li>
<li>mesa: don't assert in GetIntegerIndexed, etc</li>
<li>mesa: check for dummy renderbuffer in _mesa_FramebufferRenderbufferEXT()</li>
<li>llvmpipe: make sure binning is active when we begin/end a query</li>
<li>st/mesa: fix incorrect fragcoord.x translation</li>
<li>softpipe: fix off-by-one error in setup_fragcoord_coeff()</li>
<li>cso: fix loop bound in cso_set_vertex_samplers()</li>
<li>st/mesa: set renderbuffer _BaseFormat in a few places</li>
<li>st/mesa: fix the default case in st_format_datatype()</li>
<li>st/mesa: need to translate clear color according to surface's base format</li>
<li>docs: update 7.9.2 release notes with Brian's cherry-picks</li>
<li>docs: add links to 7.9.1 and 7.9.2 release notes</li>
<li>mesa: include compiler.h for ASSERT macro</li>
<li>glsl: add ir_shader case in switch stmt to silence warning</li>
<li>glsl2: fix signed/unsigned comparison warning</li>
<li>mesa: implement glGetShaderPrecisionFormat()</li>
<li>docs: updated environment variable list</li>
</ul></p>
<p>Bryce Harrington (1):
<ul>
<li>r300g: Null pointer check for buffer deref in gallium winsys</li>
</ul></p>
<p>Chad Versace (14):
<ul>
<li>glsl: At link-time, check that globals have matching centroid qualifiers</li>
<li>glcpp: Fix segfault when validating macro redefinitions</li>
<li>glsl: Fix parser rule for type_specifier</li>
<li>glsl: Change default value of ast_type_specifier::precision</li>
<li>glsl: Add semantic checks for precision qualifiers</li>
<li>glsl: Add support for default precision statements</li>
<li>glsl: Remove redundant semantic check in parser</li>
<li>glsl: Fix semantic checks on precision qualifiers</li>
<li>glsl: Fix segfault due to missing printf argument</li>
<li>glsl: Mark 'in' variables at global scope as read-only</li>
<li>glcpp: Raise error when modulus is zero</li>
<li>glsl: Set operators '%' and '%=' to be reserved when GLSL &lt 1.30</li>
<li>glsl: Reinstate constant-folding for division by zero</li>
<li>tnl: Add support for datatype GL_FIXED in vertex arrays</li>
</ul></p>
<p>Chia-I Wu (1):
<ul>
<li>mesa: Add glDepthRangef and glClearDepthf to APIspec.xml.</li>
</ul></p>
<p>Chris Wilson (1):
<ul>
<li>intel: Check for unsupported texture when finishing using as a render target</li>
</ul></p>
<p>Cyril Brulebois (1):
<ul>
<li>Point to bugs.freedesktop.org rather than bugzilla.freedesktop.org</li>
</ul></p>
<p>Dave Airlie (2):
<ul>
<li>radeon/r200: fix fbo-clearmipmap + gen-teximage</li>
<li>radeon: avoid segfault on 3D textures.</li>
</ul></p>
<p>Dimitry Andric (4):
<ul>
<li>mesa: s/movzx/movzbl/</li>
<li>mesa: s/movzxw/movzwl/ in read_rgba_span_x86.S</li>
<li>glapi: adding @ char before type specifier in glapi_x86.S</li>
<li>glapi: add @GOTPCREL relocation type</li>
</ul></p>
<p>Eric Anholt (11):
<ul>
<li>i965: Avoid double-negation of immediate values in the VS.</li>
<li>docs: Add a relnote for the Civ IV on i965.</li>
<li>i965/vs: When MOVing to produce ABS, strip negate of the operand.</li>
<li>glsl: Fix the lowering of variable array indexing to not lose write_masks.</li>
<li>intel: Make renderbuffer tiling choice match texture tiling choice.</li>
<li>glapi: Add entrypoints and enums for GL_ARB_ES2_compatibility.</li>
<li>mesa: Add extension enable bit for GL_ARB_ES2_compatibility.</li>
<li>mesa: Add actual support for glReleaseShaderCompiler from ES2.</li>
<li>mesa: Add support for glDepthRangef and glClearDepthf.</li>
<li>mesa: Add getters for ARB_ES2_compatibility MAX_*_VECTORS.</li>
<li>mesa: Add getter for GL_SHADER_COMPILER with ARB_ES2_compatibility.</li>
</ul></p>
<p>Ian Romanick (42):
<ul>
<li>docs: Add 7.9.1 md5sums</li>
<li>glsl: Support the 'invariant(all)' pragma</li>
<li>glcpp: Generate an error for division by zero</li>
<li>glsl: Add version_string containing properly formatted GLSL version</li>
<li>glsl &amp; glcpp: Refresh autogenerated lexer and parser files.</li>
<li>glsl: Disallow 'in' and 'out' on globals in GLSL 1.20</li>
<li>glsl: Track variable usage, use that to enforce semantics</li>
<li>glsl: Allow 'in' and 'out' when 'layout' is also available</li>
<li>docs: Initial set of release notes for 7.9.2</li>
<li>mesa: bump version to 7.9.2-devel</li>
<li>docs: Update 7.9.2 release notes</li>
<li>i965: Make OPCODE_KIL_NV do its work in a temp, not the null reg!</li>
<li>glsl: Refresh autogenerated lexer and parser files.</li>
<li>glsl: Don't assert when the value returned by a function has no rvalue</li>
<li>linker: Set sizes for non-global arrays as well</li>
<li>linker: Propagate max_array_access while linking functions</li>
<li>docs: Update 7.9.2 release notes</li>
<li>Use C-style system headers in C++ code to avoid issues with std:: namespace</li>
<li>mesa: glGetUniform only returns a single element of an array</li>
<li>linker: Generate link errors when ES shaders are missing stages</li>
<li>mesa: Fix error checks in GetVertexAttrib functions</li>
<li>docs: Update 7.9.2 release notes</li>
<li>mesa: Remove unsupported OES extensions</li>
<li>glapi: Regenerate for GL_ARB_ES2_compatibility.</li>
<li>mesa: Connect glGetShaderPrecisionFormat into the dispatch table</li>
<li>i965: Set correct values for range/precision of fragment shader types</li>
<li>i915: Set correct values for range/precision of fragment shader types</li>
<li>intel: Fix typeos from 3d028024 and 790ff232</li>
<li>glsl: Ensure that all GLSL versions are supported in the stand-alone compiler</li>
<li>glsl: Reject shader versions not supported by the implementation</li>
<li>mesa: Initial size for secondary color array is 3</li>
<li>glcpp: Regenerate files from recent cherry picks</li>
<li>glsl: Finish out the reduce/reduce error fixes</li>
<li>glsl: Regenerate compiler files from cherry picks</li>
<li>linker: Fix off-by-one error implicit array sizing</li>
<li>i915: Only mark a register as available if all components are written</li>
<li>i915: Calculate partial result to temp register first</li>
<li>i915: Force lowering of all types of indirect array accesses in the FS</li>
<li>docs: Update 7.9.2 release notes for recent cherry picks</li>
<li>docs: Clean up bug fixes list</li>
<li>intel: Remove driver date and related bits from renderer string</li>
<li>mesa: set version string to 7.9.2 (final)</li>
</ul></p>
<p>Jian Zhao (1):
<ul>
<li>mesa: fix an error in uniform arrays in row calculating.</li>
</ul></p>
<p>Julien Cristau (3):
<ul>
<li>glx: fix request lengths</li>
<li>glx: fix GLXChangeDrawableAttributesSGIX request</li>
<li>glx: fix length of GLXGetFBConfigsSGIX</li>
</ul></p>
<p>Keith Packard (1):
<ul>
<li>glsl: Eliminate reduce/reduce conflicts in glsl grammar</li>
</ul></p>
<p>Kenneth Graunke (12):
<ul>
<li>glsl: Expose a public glsl_type::void_type const pointer.</li>
<li>glsl: Don't bother unsetting a destructor that was never set.</li>
<li>glsl, i965: Remove unnecessary talloc includes.</li>
<li>glcpp: Remove use of talloc reference counting.</li>
<li>ralloc: Add a fake implementation of ralloc based on talloc.</li>
<li>Convert everything from the talloc API to the ralloc API.</li>
<li>ralloc: a new MIT-licensed recursive memory allocator.</li>
<li>Remove talloc from the make and automake build systems.</li>
<li>Remove talloc from the SCons build system.</li>
<li>Remove the talloc sources from the Mesa repository.</li>
<li>glsl: Fix use of uninitialized values in _mesa_glsl_parse_state ctor.</li>
<li>glsl: Use reralloc instead of plain realloc.</li>
</ul></p>
<p>Marek Olšák (3):
<ul>
<li>docs: fix messed up names with special characters in relnotes-7.9.1</li>
<li>mesa: fix texture3D mipmap generation for UNSIGNED_BYTE_3_3_2</li>
<li>st/dri: Track drawable context bindings</li>
</ul></p>
<p>Paulo Zanoni (1):
<ul>
<li>dri_util: fail driCreateNewScreen if InitScreen is NULL</li>
</ul></p>
<p>Sam Hocevar (2):
<ul>
<li>docs: add glsl info</li>
<li>docs: fix glsl_compiler name</li>
</ul></p>
<p>Vinson Lee (1):
<ul>
<li>ralloc: Add missing va_end following va_copy.</li>
</ul></p>
<p>nobled (1):
<ul>
<li>glx: Put null check before use</li>
</ul></p>
</p>
</body>
</html>

View File

@@ -8,7 +8,7 @@
<body bgcolor="#eeeeee">
<H1>Mesa 7.9 Release Notes / date TBD</H1>
<H1>Mesa 7.9 Release Notes / October 4, 2010</H1>
<p>
Mesa 7.9 is a new development release.
@@ -28,7 +28,12 @@ for DRI hardware acceleration.
<h2>MD5 checksums</h2>
<pre>
tbd
ed65ab425b25895c7f473d0a5e6e64f8 MesaLib-7.9.tar.gz
82c740c49d572baa6da2b1a1eee90bca MesaLib-7.9.tar.bz2
cd2b6ecec759b0457475e94bbb38fedb MesaLib-7.9.zip
7b54af9fb9b1f6a1a65db2520f50848f MesaGLUT-7.9.tar.gz
20d07419d1929f833fdb36bced290ad5 MesaGLUT-7.9.tar.bz2
62a7edecd7c92675cd6029b05217eb0a MesaGLUT-7.9.zip
</pre>
@@ -37,16 +42,85 @@ tbd
<li>New, improved GLSL compiler written by Intel.
See the <a href="shading.html"> Shading Language</a> page for
more information.
<li>GL_EXT_timer_query extension (i965 driver only)
<li>New, very experimental Gallium driver for R600-R700 Radeons.
<li>Support for AMD Evergreen-based Radeons (HD 5xxx)
<li>GL_EXT_timer_query extension (i965 driver and softpipe only)
<li>GL_EXT_framebuffer_multisample extension (intel drivers, MAX_SAMPLES = 1)
<li>GL_ARB_texture_swizzle extension (alias of GL_EXT_texture_swizzle)
<li>GL_ARB_draw_elements_base_vertex, GL_ARB_fragment_program_shadow
and GL_EXT_draw_buffers2 in Gallium drivers
<li>GL_ARB_draw_elements_base_vertex, GL_ARB_fragment_program_shadow,
GL_ARB_window_pos, GL_EXT_gpu_program_parameters,
GL_ATI_texture_env_combine3, GL_MESA_pack_invert, and GL_OES_EGL_image
extensions in Gallium drivers
<li>GL_ARB_depth_clamp and GL_NV_depth_clamp extensions (in nv50 and r600
Gallium drivers)
<li>GL_ARB_half_float_vertex extension (in nvfx, r300, r600, softpipe,
and llvmpipe Gallium drivers)
<li>GL_EXT_draw_buffers2 (in nv50, r600, softpipe, and llvmpipe Gallium
drivers)
<li>GL_EXT_texture_swizzle (in nvfx, r300, r600, softpipe, and llvmpipe
Gallium drivers)
<li>GL_ATI_texture_mirror_once (in nvfx, nv50, r300, r600, softpipe, and
llvmpipe Gallium drivers)
<li>GL_NV_conditional_render (in r300 Gallium driver)
<li>Initial "signs of life" support for Sandybridge hardware in i965 DRI
driver.
</ul>
<h2>Bug fixes</h2>
<p>This list is likely incomplete.</p>
<ul>
<li>Massive improvements to the Gallium driver for R300-R500 Radeons; this
driver is now considered stable for use as a DRI (OpenGL) driver.
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=10908">Bug 10908</a> - GLSL: gl_FogParamaters gl_Fog built-in uniform not functioning</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=13753">Bug 13753</a> - Numerous bugs in GLSL uniform handling</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=16854">Bug 16854</a> - GLSL function call at global scope causes SEGV</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=16856">Bug 16856</a> - GLSL indexing of unsized array results in assertion failure</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=18659">Bug 18659</a> - Crash in shader/slang/slang_codegen.c _slang_gen_function_call_name()</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=19089">Bug 19089</a> - [GLSL] glsl1/shadow2D() cases fail</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=22622">Bug 22622</a> - [GM965 GLSL] noise*() cause GPU lockup</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=23743">Bug 23743</a> - For loop from 0 to 0 not optimized out</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=24553">Bug 24553</a> - shader compilation times explode when using more () pairs</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=25664">Bug 25664</a> - [GLSL] re-declaring an empty array fails to compile</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=25769">Bug 25769</a> - [GLSL] "float" can be implicitly converted to "int"</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=25808">Bug 25808</a> - [GLSL] const variable is modified successfully</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=25826">Bug 25826</a> - [GLSL] declaring an unsized array then re-declaring with a size fails</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=25827">Bug 25827</a> - [GLSL] vector constructor accepts too many arguments successfully</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=25829">Bug 25829</a> - [GLSL] allowing non-void function without returning value</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=25830">Bug 25830</a> - [GLSL] allowing non-constant-expression as const declaration initializer</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=25877">Bug 25877</a> - [GLSL 1.10] implicit conversion from "int" to "float" should not be allowed</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=25878">Bug 25878</a> - [GLSL] sampler is converted to int successfully</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=25994">Bug 25994</a> - [GM45][GLSL] 'return' statement in vertex shader unsupported</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=25999">Bug 25999</a> - [GLSL] embedded structure constructor fails to compile</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=26000">Bug 26000</a> - [GLSL] allowing different parameter qualifier between the function definition and declaration</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=26001">Bug 26001</a> - [GLSL 1.10] constructing matrix from matrix succeeds</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=26224">Bug 26224</a> - [GLSL] Cannot get location of a uniform struct member</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=26990">Bug 26990</a> - [GLSL] variable declaration in "while" fails to compile</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=27004">Bug 27004</a> - [GLSL] allowing macro redefinition</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=27060">Bug 27060</a> - [965] piglit glsl-fs-raytrace failure due to lack of function calls.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=27216">Bug 27216</a> - Assignment with a function call in an if statement causes an assertion failure</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=27261">Bug 27261</a> - GLSL Compiler fails on the following vertex shader</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=27265">Bug 27265</a> - GLSL Compiler doesnt link the attached vertex shader</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=27388">Bug 27388</a> - [i965] piglit glsl-vs-arrays failure</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=27403">Bug 27403</a> - GLSL struct causing "Invalid src register file ..." error</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=27914">Bug 27914</a> - GLSL compiler uses MUL+ADD where it could use MAD</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=28055">Bug 28055</a> - glsl-texcoord-array fails GLSL compilation</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=28374">Bug 28374</a> - SIGSEGV shader/slang/slang_typeinfo.c:534</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=28748">Bug 28748</a> - [i965] uninlined function calls support</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=28833">Bug 28833</a> - piglit/shaders/glsl-texcoord-array fail</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=28834">Bug 28834</a> - Add support for system fpclassify to GL_OES_query_matrix function for OpenBSD / NetBSD</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=28837">Bug 28837</a> - varying vec4 index support</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=28845">Bug 28845</a> - The GLU tesselator code has some warnings</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=28889">Bug 28889</a> - [regression] wine game crash</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=28894">Bug 28894</a> - slang build fails if absolute path contains spaces</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=28913">Bug 28913</a> - [GLSL] allowing two version statements</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=28931">Bug 28931</a> - Floating Point Exception in Warzone2100 Trunk version</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=28966">Bug 28966</a> - [r300g] Dynamic branching 3 demo does not run</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=28967">Bug 28967</a> - slang/slang_emit.c:350: storage_to_src_reg: Assertion `index &gt;= 0' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=29013">Bug 29013</a> - [r300g] translate_rgb_op: unknown opcode ILLEGAL OPCODE</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=29020">Bug 29020</a> - [r300g] Wine d3d9 tests hardlock</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=29910">Bug 29910</a> - Mesa advertises bogus GL_ARB_shading_language_120</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=30196">Bug 30196</a> - [GLSL] gl_TextureMatrix{Inverse,Transpose,InverseTranspose} unsupported</li>
</ul>

View File

@@ -13,7 +13,10 @@ The release notes summarize what's new or changed in each Mesa release.
</p>
<UL>
<LI><A HREF="relnotes-7.9.2.html">7.9.2 release notes</A>
<LI><A HREF="relnotes-7.9.1.html">7.9.1 release notes</A>
<LI><A HREF="relnotes-7.9.html">7.9 release notes</A>
<LI><A HREF="relnotes-7.8.3.html">7.8.3 release notes</A>
<LI><A HREF="relnotes-7.8.2.html">7.8.2 release notes</A>
<LI><A HREF="relnotes-7.8.1.html">7.8.1 release notes</A>
<LI><A HREF="relnotes-7.8.html">7.8 release notes</A>

View File

@@ -167,7 +167,7 @@ Here's an example of using the compiler to compile a vertex shader and
emit GL_ARB_vertex_program-style instructions:
</p>
<pre>
src/glsl/glslcompiler --dump-ast myshader.vert
src/glsl/glsl_compiler --dump-ast myshader.vert
</pre>
Options include

View File

@@ -23,6 +23,7 @@ each directory.
<ul>
<li><b>docs</b> - EGL documentation
<li><b>drivers</b> - EGL drivers
<li><b>glsl</b> - the GLSL compiler
<li><b>main</b> - main EGL library implementation. This is where all
the EGL API functions are implemented, like eglCreateContext().
</ul>

View File

@@ -805,7 +805,7 @@ typedef struct __DRIimageExtensionRec __DRIimageExtension;
struct __DRIimageExtensionRec {
__DRIextension base;
__DRIimage *(*createImageFromName)(__DRIcontext *context,
__DRIimage *(*createImageFromName)(__DRIscreen *screen,
int width, int height, int format,
int name, int pitch,
void *loaderPrivate);
@@ -841,7 +841,7 @@ typedef struct __DRIimageLookupExtensionRec __DRIimageLookupExtension;
struct __DRIimageLookupExtensionRec {
__DRIextension base;
__DRIimage *(*lookupEGLImage)(__DRIcontext *context, void *image,
__DRIimage *(*lookupEGLImage)(__DRIscreen *screen, void *image,
void *loaderPrivate);
};

View File

@@ -370,10 +370,9 @@ dri2_flush_front_buffer(__DRIdrawable * driDrawable, void *loaderPrivate)
}
static __DRIimage *
dri2_lookup_egl_image(__DRIcontext *context, void *image, void *data)
dri2_lookup_egl_image(__DRIscreen *screen, void *image, void *data)
{
struct dri2_egl_context *dri2_ctx = data;
_EGLDisplay *disp = dri2_ctx->base.Resource.Display;
_EGLDisplay *disp = data;
struct dri2_egl_image *dri2_img;
_EGLImage *img;
@@ -728,7 +727,7 @@ dri2_create_screen(_EGLDisplay *disp)
dri2_dpy = disp->DriverData;
dri2_dpy->dri_screen =
dri2_dpy->dri2->createNewScreen(0, dri2_dpy->fd, dri2_dpy->extensions,
&dri2_dpy->driver_configs, dri2_dpy);
&dri2_dpy->driver_configs, disp);
if (dri2_dpy->dri_screen == NULL) {
_eglLog(_EGL_WARNING, "DRI2: failed to create dri screen");
@@ -742,7 +741,7 @@ dri2_create_screen(_EGLDisplay *disp)
if (dri2_dpy->dri2->base.version >= 2)
api_mask = dri2_dpy->dri2->getAPIMask(dri2_dpy->dri_screen);
else
api_mask = __DRI_API_OPENGL;
api_mask = 1 << __DRI_API_OPENGL;
disp->ClientAPIsMask = 0;
if (api_mask & (1 <<__DRI_API_OPENGL))
@@ -889,10 +888,20 @@ const int i915_chip_ids[] = {
0x29b2, /* PCI_CHIP_Q35_G */
0x29c2, /* PCI_CHIP_G33_G */
0x29d2, /* PCI_CHIP_Q33_G */
0xa001, /* PCI_CHIP_IGD_G */
0xa011, /* Pineview */
};
const int i965_chip_ids[] = {
0x0042, /* PCI_CHIP_ILD_G */
0x0046, /* PCI_CHIP_ILM_G */
0x0102, /* PCI_CHIP_SANDYBRIDGE_GT1 */
0x0106, /* PCI_CHIP_SANDYBRIDGE_M_GT1 */
0x010a, /* PCI_CHIP_SANDYBRIDGE_S */
0x0112, /* PCI_CHIP_SANDYBRIDGE_GT2 */
0x0116, /* PCI_CHIP_SANDYBRIDGE_M_GT2 */
0x0122, /* PCI_CHIP_SANDYBRIDGE_GT2_PLUS */
0x0126, /* PCI_CHIP_SANDYBRIDGE_M_GT2_PLUS */
0x29a2, /* PCI_CHIP_I965_G */
0x2992, /* PCI_CHIP_I965_Q */
0x2982, /* PCI_CHIP_I965_G_1 */
@@ -904,6 +913,8 @@ const int i965_chip_ids[] = {
0x2e12, /* PCI_CHIP_Q45_G */
0x2e22, /* PCI_CHIP_G45_G */
0x2e32, /* PCI_CHIP_G41_G */
0x2e42, /* PCI_CHIP_B43_G */
0x2e92, /* PCI_CHIP_B43_G1 */
};
const struct dri2_driver_map driver_map[] = {
@@ -1509,7 +1520,6 @@ dri2_create_image_khr_pixmap(_EGLDisplay *disp, _EGLContext *ctx,
EGLClientBuffer buffer, const EGLint *attr_list)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_context *dri2_ctx = dri2_egl_context(ctx);
struct dri2_egl_image *dri2_img;
unsigned int attachments[1];
xcb_drawable_t drawable;
@@ -1577,7 +1587,7 @@ dri2_create_image_khr_pixmap(_EGLDisplay *disp, _EGLContext *ctx,
stride = buffers[0].pitch / buffers[0].cpp;
dri2_img->dri_image =
dri2_dpy->image->createImageFromName(dri2_ctx->dri_context,
dri2_dpy->image->createImageFromName(dri2_dpy->dri_screen,
buffers_reply->width,
buffers_reply->height,
format,
@@ -1628,7 +1638,6 @@ dri2_create_image_mesa_drm_buffer(_EGLDisplay *disp, _EGLContext *ctx,
EGLClientBuffer buffer, const EGLint *attr_list)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_context *dri2_ctx = dri2_egl_context(ctx);
struct dri2_egl_image *dri2_img;
EGLint width, height, format, name, stride, pitch, i, err;
@@ -1697,7 +1706,7 @@ dri2_create_image_mesa_drm_buffer(_EGLDisplay *disp, _EGLContext *ctx,
}
dri2_img->dri_image =
dri2_dpy->image->createImageFromName(dri2_ctx->dri_context,
dri2_dpy->image->createImageFromName(dri2_dpy->dri_screen,
width,
height,
format,

View File

@@ -142,7 +142,6 @@ static const struct {
{ GLX_STENCIL_SIZE, EGL_STENCIL_SIZE },
{ GLX_SAMPLE_BUFFERS, EGL_SAMPLE_BUFFERS },
{ GLX_SAMPLES, EGL_SAMPLES },
{ GLX_RENDER_TYPE, EGL_RENDERABLE_TYPE },
{ GLX_X_RENDERABLE, EGL_NATIVE_RENDERABLE },
{ GLX_X_VISUAL_TYPE, EGL_NATIVE_VISUAL_TYPE },
{ GLX_CONFIG_CAVEAT, EGL_CONFIG_CAVEAT },
@@ -218,6 +217,16 @@ convert_fbconfig(Display *dpy, GLXFBConfig fbconfig,
_eglSetConfigKey(&GLX_conf->Base, EGL_SURFACE_TYPE, surface_type);
_eglSetConfigKey(&GLX_conf->Base, EGL_RENDERABLE_TYPE, EGL_OPENGL_BIT);
glXGetFBConfigAttrib(dpy, fbconfig, GLX_TRANSPARENT_TYPE, &val);
if (val == GLX_NONE) {
_eglSetConfigKey(&GLX_conf->Base, EGL_TRANSPARENT_TYPE, EGL_NONE);
_eglSetConfigKey(&GLX_conf->Base, EGL_TRANSPARENT_RED_VALUE, 0);
_eglSetConfigKey(&GLX_conf->Base, EGL_TRANSPARENT_GREEN_VALUE, 0);
_eglSetConfigKey(&GLX_conf->Base, EGL_TRANSPARENT_BLUE_VALUE, 0);
}
return EGL_TRUE;
}
@@ -294,6 +303,7 @@ convert_visual(Display *dpy, XVisualInfo *vinfo,
surface_type |= EGL_PIXMAP_BIT;
_eglSetConfigKey(&GLX_conf->Base, EGL_SURFACE_TYPE, surface_type);
_eglSetConfigKey(&GLX_conf->Base, EGL_RENDERABLE_TYPE, EGL_OPENGL_BIT);
_eglSetConfigKey(&GLX_conf->Base, EGL_NATIVE_RENDERABLE, EGL_TRUE);

View File

@@ -57,7 +57,7 @@ EGL_NATIVE_PLATFORM=_EGL_INVALID_PLATFORM
ifeq ($(firstword $(EGL_PLATFORMS)),x11)
EGL_NATIVE_PLATFORM=_EGL_PLATFORM_X11
endif
ifeq ($(firstword $(EGL_PLATFORMS)),kms)
ifeq ($(firstword $(EGL_PLATFORMS)),drm)
EGL_NATIVE_PLATFORM=_EGL_PLATFORM_DRM
endif
ifeq ($(firstword $(EGL_PLATFORMS)),fbdev)

View File

@@ -402,11 +402,16 @@ eglCreateContext(EGLDisplay dpy, EGLConfig config, EGLContext share_list,
_EGLContext *context;
EGLContext ret;
if (config)
_EGL_CHECK_CONFIG(disp, conf, EGL_NO_CONTEXT, drv);
else
_EGL_CHECK_DISPLAY(disp, EGL_NO_CONTEXT, drv);
if (!config) {
/* config may be NULL if surfaceless */
if (!disp->Extensions.KHR_surfaceless_gles1 &&
!disp->Extensions.KHR_surfaceless_gles2 &&
!disp->Extensions.KHR_surfaceless_opengl)
RETURN_EGL_ERROR(disp, EGL_BAD_CONFIG, EGL_NO_CONTEXT);
}
if (!share && share_list != EGL_NO_CONTEXT)
RETURN_EGL_ERROR(disp, EGL_BAD_CONTEXT, EGL_NO_CONTEXT);
@@ -459,9 +464,19 @@ eglMakeCurrent(EGLDisplay dpy, EGLSurface draw, EGLSurface read,
if (!context && ctx != EGL_NO_CONTEXT)
RETURN_EGL_ERROR(disp, EGL_BAD_CONTEXT, EGL_FALSE);
if (!draw_surf || !read_surf) {
/* surfaces may be NULL if surfaceless */
if (!disp->Extensions.KHR_surfaceless_gles1 &&
!disp->Extensions.KHR_surfaceless_gles2 &&
!disp->Extensions.KHR_surfaceless_opengl)
RETURN_EGL_ERROR(disp, EGL_BAD_SURFACE, EGL_FALSE);
if ((!draw_surf && draw != EGL_NO_SURFACE) ||
(!read_surf && read != EGL_NO_SURFACE))
RETURN_EGL_ERROR(disp, EGL_BAD_SURFACE, EGL_FALSE);
if (draw_surf || read_surf)
RETURN_EGL_ERROR(disp, EGL_BAD_MATCH, EGL_FALSE);
}
ret = drv->API.MakeCurrent(drv, disp, draw_surf, read_surf, context);
@@ -1276,6 +1291,8 @@ eglCreateImageKHR(EGLDisplay dpy, EGLContext ctx, EGLenum target,
EGLImageKHR ret;
_EGL_CHECK_DISPLAY(disp, EGL_NO_IMAGE_KHR, drv);
if (!disp->Extensions.KHR_image_base)
RETURN_EGL_EVAL(disp, EGL_NO_IMAGE_KHR);
if (!context && ctx != EGL_NO_CONTEXT)
RETURN_EGL_ERROR(disp, EGL_BAD_CONTEXT, EGL_NO_IMAGE_KHR);
@@ -1296,6 +1313,8 @@ eglDestroyImageKHR(EGLDisplay dpy, EGLImageKHR image)
EGLBoolean ret;
_EGL_CHECK_DISPLAY(disp, EGL_FALSE, drv);
if (!disp->Extensions.KHR_image_base)
RETURN_EGL_EVAL(disp, EGL_FALSE);
if (!img)
RETURN_EGL_ERROR(disp, EGL_BAD_PARAMETER, EGL_FALSE);
@@ -1321,6 +1340,8 @@ eglCreateSyncKHR(EGLDisplay dpy, EGLenum type, const EGLint *attrib_list)
EGLSyncKHR ret;
_EGL_CHECK_DISPLAY(disp, EGL_NO_SYNC_KHR, drv);
if (!disp->Extensions.KHR_reusable_sync)
RETURN_EGL_EVAL(disp, EGL_NO_SYNC_KHR);
sync = drv->API.CreateSyncKHR(drv, disp, type, attrib_list);
ret = (sync) ? _eglLinkSync(sync, disp) : EGL_NO_SYNC_KHR;
@@ -1338,6 +1359,8 @@ eglDestroySyncKHR(EGLDisplay dpy, EGLSyncKHR sync)
EGLBoolean ret;
_EGL_CHECK_SYNC(disp, s, EGL_FALSE, drv);
assert(disp->Extensions.KHR_reusable_sync);
_eglUnlinkSync(s);
ret = drv->API.DestroySyncKHR(drv, disp, s);
@@ -1354,6 +1377,7 @@ eglClientWaitSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR t
EGLint ret;
_EGL_CHECK_SYNC(disp, s, EGL_FALSE, drv);
assert(disp->Extensions.KHR_reusable_sync);
ret = drv->API.ClientWaitSyncKHR(drv, disp, s, flags, timeout);
RETURN_EGL_EVAL(disp, ret);
@@ -1369,6 +1393,7 @@ eglSignalSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLenum mode)
EGLBoolean ret;
_EGL_CHECK_SYNC(disp, s, EGL_FALSE, drv);
assert(disp->Extensions.KHR_reusable_sync);
ret = drv->API.SignalSyncKHR(drv, disp, s, mode);
RETURN_EGL_EVAL(disp, ret);
@@ -1384,6 +1409,7 @@ eglGetSyncAttribKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint *v
EGLBoolean ret;
_EGL_CHECK_SYNC(disp, s, EGL_FALSE, drv);
assert(disp->Extensions.KHR_reusable_sync);
ret = drv->API.GetSyncAttribKHR(drv, disp, s, attribute, value);
RETURN_EGL_EVAL(disp, ret);
@@ -1407,14 +1433,14 @@ eglSwapBuffersRegionNOK(EGLDisplay dpy, EGLSurface surface,
_EGL_CHECK_SURFACE(disp, surf, EGL_FALSE, drv);
if (!disp->Extensions.NOK_swap_region)
RETURN_EGL_EVAL(disp, EGL_FALSE);
/* surface must be bound to current context in EGL 1.4 */
if (!ctx || !_eglIsContextLinked(ctx) || surf != ctx->DrawSurface)
RETURN_EGL_ERROR(disp, EGL_BAD_SURFACE, EGL_FALSE);
if (drv->API.SwapBuffersRegionNOK)
ret = drv->API.SwapBuffersRegionNOK(drv, disp, surf, numRects, rects);
else
ret = drv->API.SwapBuffers(drv, disp, surf);
RETURN_EGL_EVAL(disp, ret);
}
@@ -1433,6 +1459,8 @@ eglCreateDRMImageMESA(EGLDisplay dpy, const EGLint *attr_list)
EGLImageKHR ret;
_EGL_CHECK_DISPLAY(disp, EGL_NO_IMAGE_KHR, drv);
if (!disp->Extensions.MESA_drm_image)
RETURN_EGL_EVAL(disp, EGL_NO_IMAGE_KHR);
img = drv->API.CreateDRMImageMESA(drv, disp, attr_list);
ret = (img) ? _eglLinkImage(img, disp) : EGL_NO_IMAGE_KHR;
@@ -1450,6 +1478,8 @@ eglExportDRMImageMESA(EGLDisplay dpy, EGLImageKHR image,
EGLBoolean ret;
_EGL_CHECK_DISPLAY(disp, EGL_FALSE, drv);
assert(disp->Extensions.MESA_drm_image);
if (!img)
RETURN_EGL_ERROR(disp, EGL_BAD_PARAMETER, EGL_FALSE);

View File

@@ -272,10 +272,6 @@ _eglCheckMakeCurrent(_EGLContext *ctx, _EGLSurface *draw, _EGLSurface *read)
if (!surfaceless && (draw == NULL || read == NULL))
return _eglError(EGL_BAD_MATCH, "eglMakeCurrent");
/* context stealing from another thread is not allowed */
if (ctx->Binding && ctx->Binding != t)
return _eglError(EGL_BAD_ACCESS, "eglMakeCurrent");
/*
* The spec says
*
@@ -283,16 +279,23 @@ _eglCheckMakeCurrent(_EGLContext *ctx, _EGLSurface *draw, _EGLSurface *read)
* bound to contexts in another thread, an EGL_BAD_ACCESS error is
* generated."
*
* But it also says
* and
*
* "at most one context may be bound to a particular surface at a given
* time"
*
* The latter is more restrictive so we can check only the latter case.
*/
if ((draw && draw->CurrentContext && draw->CurrentContext != ctx) ||
(read && read->CurrentContext && read->CurrentContext != ctx))
if (ctx->Binding && ctx->Binding != t)
return _eglError(EGL_BAD_ACCESS, "eglMakeCurrent");
if (draw && draw->CurrentContext && draw->CurrentContext != ctx) {
if (draw->CurrentContext->Binding != t ||
draw->CurrentContext->ClientAPI != ctx->ClientAPI)
return _eglError(EGL_BAD_ACCESS, "eglMakeCurrent");
}
if (read && read->CurrentContext && read->CurrentContext != ctx) {
if (read->CurrentContext->Binding != t ||
read->CurrentContext->ClientAPI != ctx->ClientAPI)
return _eglError(EGL_BAD_ACCESS, "eglMakeCurrent");
}
/* simply require the configs to be equal */
if ((draw && draw->Config != ctx->Config) ||

View File

@@ -27,7 +27,7 @@ _eglGetNativePlatformFromEnv(void)
} egl_platforms[_EGL_NUM_PLATFORMS] = {
{ _EGL_PLATFORM_WINDOWS, "gdi" },
{ _EGL_PLATFORM_X11, "x11" },
{ _EGL_PLATFORM_DRM, "kms" },
{ _EGL_PLATFORM_DRM, "drm" },
{ _EGL_PLATFORM_FBDEV, "fbdev" }
};
_EGLPlatformType plat = _EGL_INVALID_PLATFORM;

View File

@@ -4,7 +4,7 @@
#include "egltypedefs.h"
#include "eglapi.h"
#include <stddef.h>
/**
* Define an inline driver typecast function.

View File

@@ -206,16 +206,16 @@ include ../Makefile.template
indices/u_indices_gen.c: indices/u_indices_gen.py
python $< > $@
$(PYTHON2) $< > $@
indices/u_unfilled_gen.c: indices/u_unfilled_gen.py
python $< > $@
$(PYTHON2) $< > $@
util/u_format_srgb.c: util/u_format_srgb.py
python $< > $@
$(PYTHON2) $< > $@
util/u_format_table.c: util/u_format_table.py util/u_format_pack.py util/u_format_parse.py util/u_format.csv
python util/u_format_table.py util/u_format.csv > $@
$(PYTHON2) util/u_format_table.py util/u_format.csv > $@
util/u_half.c: util/u_half.py
python util/u_half.py > $@
$(PYTHON2) util/u_half.py > $@

View File

@@ -595,7 +595,7 @@ enum pipe_error cso_set_vertex_samplers(struct cso_context *ctx,
error = temp;
}
for ( ; i < ctx->nr_samplers; i++) {
for ( ; i < ctx->nr_vertex_samplers; i++) {
temp = cso_single_vertex_sampler( ctx, i, NULL );
if (temp != PIPE_OK)
error = temp;

View File

@@ -263,6 +263,8 @@ do_clip_tri( struct draw_stage *stage,
clipmask &= ~(1<<plane_idx);
assert(n < MAX_CLIPPED_VERTICES);
if (n >= MAX_CLIPPED_VERTICES)
return;
inlist[n] = inlist[0]; /* prevent rotation of vertices */
for (i = 1; i <= n; i++) {
@@ -272,16 +274,22 @@ do_clip_tri( struct draw_stage *stage,
if (!IS_NEGATIVE(dp_prev)) {
assert(outcount < MAX_CLIPPED_VERTICES);
if (outcount >= MAX_CLIPPED_VERTICES)
return;
outlist[outcount++] = vert_prev;
}
if (DIFFERENT_SIGNS(dp, dp_prev)) {
struct vertex_header *new_vert;
assert(tmpnr < MAX_CLIPPED_VERTICES+1);
assert(tmpnr < MAX_CLIPPED_VERTICES + 1);
if (tmpnr >= MAX_CLIPPED_VERTICES + 1)
return;
new_vert = clipper->stage.tmp[tmpnr++];
assert(outcount < MAX_CLIPPED_VERTICES);
if (outcount >= MAX_CLIPPED_VERTICES)
return;
outlist[outcount++] = new_vert;
if (IS_NEGATIVE(dp)) {
@@ -321,10 +329,13 @@ do_clip_tri( struct draw_stage *stage,
/* If flat-shading, copy provoking vertex color to polygon vertex[0]
*/
if (n >= 3) {
if (clipper->flat) {
if (stage->draw->rasterizer->flatshade_first) {
if (inlist[0] != header->v[0]) {
assert(tmpnr < MAX_CLIPPED_VERTICES + 1);
if (tmpnr >= MAX_CLIPPED_VERTICES + 1)
return;
inlist[0] = dup_vert(stage, inlist[0], tmpnr++);
copy_colors(stage, inlist[0], header->v[0]);
}
@@ -332,6 +343,8 @@ do_clip_tri( struct draw_stage *stage,
else {
if (inlist[0] != header->v[2]) {
assert(tmpnr < MAX_CLIPPED_VERTICES + 1);
if (tmpnr >= MAX_CLIPPED_VERTICES + 1)
return;
inlist[0] = dup_vert(stage, inlist[0], tmpnr++);
copy_colors(stage, inlist[0], header->v[2]);
}
@@ -340,8 +353,8 @@ do_clip_tri( struct draw_stage *stage,
/* Emit the polygon as triangles to the setup stage:
*/
if (n >= 3)
emit_poly( stage, inlist, n, header );
}
}

View File

@@ -258,9 +258,10 @@ vsplit_segment_fan_linear(struct vsplit_frontend *vsplit, unsigned flags,
boolean use_spoken = ((flags & DRAW_SPLIT_BEFORE) != 0);
unsigned nr = 0, i;
assert(icount + !!use_spoken <= vsplit->segment_size);
assert(icount <= vsplit->segment_size);
if (use_spoken) {
/* replace istart by i0 */
vsplit->fetch_elts[nr++] = i0;
for (i = 1 ; i < icount; i++)
vsplit->fetch_elts[nr++] = istart + i;

View File

@@ -76,11 +76,15 @@ lp_build_broadcast_scalar(struct lp_build_context *bld,
}
else {
LLVMValueRef res;
/* The shuffle vector is always made of int32 elements */
struct lp_type i32_vec_type = lp_type_int_vec(32);
i32_vec_type.length = type.length;
#if HAVE_LLVM >= 0x207
res = LLVMBuildInsertElement(bld->builder, bld->undef, scalar,
LLVMConstInt(LLVMInt32Type(), 0, 0), "");
res = LLVMBuildShuffleVector(bld->builder, res, bld->undef,
lp_build_const_int_vec(type, 0), "");
lp_build_const_int_vec(i32_vec_type, 0), "");
#else
/* XXX: The above path provokes a bug in LLVM 2.6 */
unsigned i;

View File

@@ -605,8 +605,10 @@ tgsi_check_soa_dependencies(const struct tgsi_full_instruction *inst)
for (i = 0; i < inst->Instruction.NumSrcRegs; i++) {
if ((inst->Src[i].Register.File ==
inst->Dst[0].Register.File) &&
(inst->Src[i].Register.Index ==
inst->Dst[0].Register.Index)) {
((inst->Src[i].Register.Index ==
inst->Dst[0].Register.Index) ||
inst->Src[i].Register.Indirect ||
inst->Dst[0].Register.Indirect)) {
/* loop over dest channels */
uint channelsWritten = 0x0;
FOR_EACH_ENABLED_CHANNEL(*inst, chan) {

View File

@@ -2703,8 +2703,7 @@ static void aos_to_soa( struct x86_function *func,
struct x86_reg aos_input = x86_make_reg( file_REG32, reg_BX );
struct x86_reg num_inputs = x86_make_reg( file_REG32, reg_CX );
struct x86_reg stride = x86_make_reg( file_REG32, reg_DX );
int inner_loop;
int loop_top, loop_exit_fixup;
/* Save EBX */
x86_push( func, x86_make_reg( file_REG32, reg_BX ) );
@@ -2717,8 +2716,11 @@ static void aos_to_soa( struct x86_function *func,
x86_mov( func, num_inputs, x86_fn_arg( func, arg_num ) );
x86_mov( func, stride, x86_fn_arg( func, arg_stride ) );
/* do */
inner_loop = x86_get_label( func );
/* while (num_inputs != 0) */
loop_top = x86_get_label( func );
x86_cmp_imm( func, num_inputs, 0 );
loop_exit_fixup = x86_jcc_forward( func, cc_E );
{
x86_push( func, aos_input );
sse_movlps( func, make_xmm( 0 ), x86_make_disp( aos_input, 0 ) );
@@ -2750,9 +2752,10 @@ static void aos_to_soa( struct x86_function *func,
x86_lea( func, aos_input, x86_make_disp(aos_input, 16) );
x86_lea( func, soa_input, x86_make_disp(soa_input, 64) );
}
/* while --num_inputs */
/* --num_inputs */
x86_dec( func, num_inputs );
x86_jcc( func, cc_NE, inner_loop );
x86_jmp( func, loop_top );
x86_fixup_fwd_jump( func, loop_exit_fixup );
/* Restore EBX */
x86_pop( func, x86_make_reg( file_REG32, reg_BX ) );
@@ -2827,31 +2830,52 @@ static void soa_to_aos( struct x86_function *func,
* Check if the instructions dst register is the same as any src
* register and warn if there's a posible SOA dependency.
*/
static void
static boolean
check_soa_dependencies(const struct tgsi_full_instruction *inst)
{
switch (inst->Instruction.Opcode) {
uint opcode = inst->Instruction.Opcode;
/* XXX: we only handle src/dst aliasing in a few opcodes currently.
* Need to use an additional temporay to hold the result in the
* cases where the code is too opaque to fix.
*/
switch (opcode) {
case TGSI_OPCODE_ADD:
case TGSI_OPCODE_MOV:
case TGSI_OPCODE_MUL:
case TGSI_OPCODE_RCP:
case TGSI_OPCODE_RSQ:
case TGSI_OPCODE_EXP:
case TGSI_OPCODE_LOG:
case TGSI_OPCODE_DP3:
case TGSI_OPCODE_DP4:
case TGSI_OPCODE_DP2A:
case TGSI_OPCODE_EX2:
case TGSI_OPCODE_LG2:
case TGSI_OPCODE_POW:
case TGSI_OPCODE_XPD:
case TGSI_OPCODE_DPH:
case TGSI_OPCODE_COS:
case TGSI_OPCODE_SIN:
case TGSI_OPCODE_TEX:
case TGSI_OPCODE_TXB:
case TGSI_OPCODE_TXP:
case TGSI_OPCODE_NRM:
case TGSI_OPCODE_NRM4:
case TGSI_OPCODE_DP2:
/* OK - these opcodes correctly handle SOA dependencies */
break;
return TRUE;
default:
if (tgsi_check_soa_dependencies(inst)) {
uint opcode = inst->Instruction.Opcode;
if (!tgsi_check_soa_dependencies(inst))
return TRUE;
/* XXX: we only handle src/dst aliasing in a few opcodes
* currently. Need to use an additional temporay to hold
* the result in the cases where the code is too opaque to
* fix.
*/
if (opcode != TGSI_OPCODE_MOV) {
debug_printf("Warning: src/dst aliasing in instruction"
" is not handled:\n");
debug_printf("Warning: ");
tgsi_dump_instruction(inst, 1);
}
}
return FALSE;
}
}
@@ -2951,7 +2975,8 @@ tgsi_emit_sse2(
tgsi_get_processor_name(proc));
}
check_soa_dependencies(&parse.FullToken.FullInstruction);
if (ok)
ok = check_soa_dependencies(&parse.FullToken.FullInstruction);
break;
case TGSI_TOKEN_TYPE_IMMEDIATE:

View File

@@ -262,19 +262,20 @@ tgsi_util_get_inst_usage_mask(const struct tgsi_full_instruction *inst,
case TGSI_OPCODE_TXL:
case TGSI_OPCODE_TXP:
if (src_idx == 0) {
/* Note that the SHADOW variants use the Z component too */
switch (inst->Texture.Texture) {
case TGSI_TEXTURE_1D:
case TGSI_TEXTURE_SHADOW1D:
read_mask = TGSI_WRITEMASK_X;
break;
case TGSI_TEXTURE_SHADOW1D:
read_mask = TGSI_WRITEMASK_XZ;
break;
case TGSI_TEXTURE_2D:
case TGSI_TEXTURE_RECT:
case TGSI_TEXTURE_SHADOW2D:
case TGSI_TEXTURE_SHADOWRECT:
read_mask = TGSI_WRITEMASK_XY;
break;
case TGSI_TEXTURE_SHADOW2D:
case TGSI_TEXTURE_SHADOWRECT:
case TGSI_TEXTURE_3D:
case TGSI_TEXTURE_CUBE:
read_mask = TGSI_WRITEMASK_XYZ;

View File

@@ -29,6 +29,8 @@
#define PIPE_ATOMIC_ASM_MSVC_X86
#elif (defined(PIPE_CC_GCC) && defined(PIPE_ARCH_X86))
#define PIPE_ATOMIC_ASM_GCC_X86
#elif (defined(PIPE_CC_GCC) && defined(PIPE_ARCH_X86_64))
#define PIPE_ATOMIC_ASM_GCC_X86_64
#elif defined(PIPE_CC_GCC) && (PIPE_CC_GCC_VERSION >= 401)
#define PIPE_ATOMIC_GCC_INTRINSIC
#else
@@ -36,6 +38,51 @@
#endif
#if defined(PIPE_ATOMIC_ASM_GCC_X86_64)
#define PIPE_ATOMIC "GCC x86_64 assembly"
#ifdef __cplusplus
extern "C" {
#endif
#define p_atomic_set(_v, _i) (*(_v) = (_i))
#define p_atomic_read(_v) (*(_v))
static INLINE boolean
p_atomic_dec_zero(int32_t *v)
{
unsigned char c;
__asm__ __volatile__("lock; decl %0; sete %1":"+m"(*v), "=qm"(c)
::"memory");
return c != 0;
}
static INLINE void
p_atomic_inc(int32_t *v)
{
__asm__ __volatile__("lock; incl %0":"+m"(*v));
}
static INLINE void
p_atomic_dec(int32_t *v)
{
__asm__ __volatile__("lock; decl %0":"+m"(*v));
}
static INLINE int32_t
p_atomic_cmpxchg(int32_t *v, int32_t old, int32_t _new)
{
return __sync_val_compare_and_swap(v, old, _new);
}
#ifdef __cplusplus
}
#endif
#endif /* PIPE_ATOMIC_ASM_GCC_X86_64 */
#if defined(PIPE_ATOMIC_ASM_GCC_X86)

View File

@@ -268,7 +268,7 @@ void util_blitter_destroy(struct blitter_context *blitter)
pipe->delete_fs_state(pipe, ctx->fs_texfetch_depth[i]);
}
for (i = 0; i <= PIPE_MAX_COLOR_BUFS && ctx->fs_col[i]; i++)
for (i = 0; i <= PIPE_MAX_COLOR_BUFS; i++)
if (ctx->fs_col[i])
pipe->delete_fs_state(pipe, ctx->fs_col[i]);
@@ -741,8 +741,6 @@ void util_blitter_copy_region(struct blitter_context *blitter,
if (dst == src) {
assert(!is_overlap(srcx, srcx + width, srcy, srcy + height,
dstx, dstx + width, dsty, dsty + height));
} else {
assert(dst->format == src->format);
}
assert(src->target < PIPE_MAX_TEXTURE_TYPES);

View File

@@ -82,6 +82,7 @@ util_check_caps_out(struct pipe_screen *screen, const unsigned *list, int *out)
*out = i - 3;
return FALSE;
}
break;
case UTIL_CAPS_CHECK_UNIMPLEMENTED:
*out = i - 1;
return FALSE;

View File

@@ -394,7 +394,7 @@ util_pack_color(const float rgba[4], enum pipe_format format, union util_color *
return;
case PIPE_FORMAT_B4G4R4A4_UNORM:
{
uc->ub = ((a & 0xf0) << 8) | ((r & 0xf0) << 4) | ((g & 0xf0) << 0) | (b >> 4);
uc->us = ((a & 0xf0) << 8) | ((r & 0xf0) << 4) | ((g & 0xf0) << 0) | (b >> 4);
}
return;
case PIPE_FORMAT_A8_UNORM:

View File

@@ -46,6 +46,8 @@
do { \
(elem)->next->prev = (elem)->prev; \
(elem)->prev->next = (elem)->next; \
(elem)->next = elem; \
(elem)->prev = elem; \
} while (0)
/**

View File

@@ -332,7 +332,7 @@ util_clear_depth_stencil(struct pipe_context *pipe,
uint32_t *row = (uint32_t *)dst_map;
for (j = 0; j < width; j++) {
uint32_t tmp = *row & dst_mask;
*row++ = tmp & (zstencil & ~dst_mask);
*row++ = tmp | (zstencil & ~dst_mask);
}
dst_map += dst_stride;
}

View File

@@ -70,7 +70,7 @@ PROGS_DEPS := ../../auxiliary/libgallium.a
include ../../Makefile.template
lp_tile_soa.c: lp_tile_soa.py ../../auxiliary/util/u_format_parse.py ../../auxiliary/util/u_format_pack.py ../../auxiliary/util/u_format.csv
python lp_tile_soa.py ../../auxiliary/util/u_format.csv > $@
$(PYTHON2) $(PYTHON_FLAGS) lp_tile_soa.py ../../auxiliary/util/u_format.csv > $@
LDFLAGS += $(LLVM_LDFLAGS)
LIBS += -L../../auxiliary/ -lgallium libllvmpipe.a $(LLVM_LIBS) $(GL_LIB_DEPS)

View File

@@ -262,7 +262,7 @@ lp_build_stencil_op_single(struct lp_build_context *bld,
LLVMValueRef writemask = lp_build_const_int_vec(type, stencil->writemask);
mask = LLVMBuildAnd(bld->builder, mask, writemask, "");
/* res = (res & mask) | (stencilVals & ~mask) */
res = lp_build_select_bitwise(bld, writemask, res, stencilVals);
res = lp_build_select_bitwise(bld, mask, res, stencilVals);
}
else {
/* res = mask ? res : stencilVals */

View File

@@ -155,12 +155,9 @@ llvmpipe_create_context( struct pipe_screen *screen, void *priv )
draw_install_aapoint_stage(llvmpipe->draw, &llvmpipe->pipe);
draw_install_pstipple_stage(llvmpipe->draw, &llvmpipe->pipe);
/* convert points and lines into triangles:
* (otherwise, draw points and lines natively)
*/
draw_wide_point_sprites(llvmpipe->draw, FALSE);
draw_enable_point_sprites(llvmpipe->draw, FALSE);
draw_wide_point_threshold(llvmpipe->draw, 10000.0);
/* convert points/sprites into triangles. Draw non-AA lines natively */
draw_wide_point_sprites(llvmpipe->draw, TRUE);
draw_enable_point_sprites(llvmpipe->draw, TRUE);
draw_wide_line_threshold(llvmpipe->draw, 10000.0);
#if USE_DRAW_STAGE_PSTIPPLE

View File

@@ -92,8 +92,9 @@ llvmpipe_get_query_result(struct pipe_context *pipe,
int i;
if (!pq->fence) {
assert(0); /* query not in issued state */
return FALSE;
/* no fence because there was no scene, so results is zero */
*result = 0;
return TRUE;
}
if (!lp_fence_signalled(pq->fence)) {

View File

@@ -976,6 +976,8 @@ lp_setup_begin_query(struct lp_setup_context *setup,
/* init the query to its beginning state */
assert(setup->active_query == NULL);
set_scene_state(setup, SETUP_ACTIVE, "begin_query");
if (setup->scene) {
if (!lp_scene_bin_everywhere(setup->scene,
LP_RAST_OP_BEGIN_QUERY,
@@ -1004,6 +1006,8 @@ lp_setup_end_query(struct lp_setup_context *setup, struct llvmpipe_query *pq)
{
union lp_rast_cmd_arg dummy = { 0 };
set_scene_state(setup, SETUP_ACTIVE, "end_query");
assert(setup->active_query == pq);
setup->active_query = NULL;

View File

@@ -292,6 +292,7 @@ try_setup_line( struct lp_setup_context *setup,
float x2diff;
float y2diff;
float dx, dy;
float area;
boolean draw_start;
boolean draw_end;
@@ -311,6 +312,18 @@ try_setup_line( struct lp_setup_context *setup,
dx = v1[0][0] - v2[0][0];
dy = v1[0][1] - v2[0][1];
area = (dx * dx + dy * dy);
if (area == 0) {
LP_COUNT(nr_culled_tris);
return TRUE;
}
info.oneoverarea = 1.0f / area;
info.dx = dx;
info.dy = dy;
info.v1 = v1;
info.v2 = v2;
/* X-MAJOR LINE */
if (fabsf(dx) >= fabsf(dy)) {
@@ -573,12 +586,6 @@ try_setup_line( struct lp_setup_context *setup,
line->plane[3].dcdx = y[3] - y[0];
info.oneoverarea = 1.0f / (dx * dx + dy * dy);
info.dx = dx;
info.dy = dy;
info.v1 = v1;
info.v2 = v2;
/* Setup parameter interpolants:
*/
setup_line_coefficients( setup, line, &info);

View File

@@ -447,8 +447,10 @@ do_triangle_ccw(struct lp_setup_context *setup,
static INLINE uint32_t
floor_pot(uint32_t n)
{
assert(n);
#if defined(PIPE_CC_GCC) && defined(PIPE_ARCH_X86)
if (n == 0)
return 0;
__asm__("bsr %1,%0"
: "=r" (n)
: "rm" (n));

View File

@@ -39,5 +39,6 @@ EXTRA_OBJECTS = \
include ../../Makefile.template
.PHONY: $(COMPILER_ARCHIVE)
$(COMPILER_ARCHIVE):
$(MAKE) -C $(TOP)/src/mesa/drivers/dri/r300/compiler

View File

@@ -263,10 +263,6 @@ static void r300_clear(struct pipe_context* pipe,
zstex->hiz_in_use[fb->zsbuf->level])) {
r300->hyperz_state.dirty = TRUE;
}
/* XXX this flush "fixes" a hardlock in the cubestorm xscreensaver */
if (r300->flush_counter == 0)
pipe->flush(pipe, 0, NULL);
}
/* Clear a region of a color surface to a constant value. */

View File

@@ -424,4 +424,5 @@ void r300_parse_chipset(struct r300_capabilities* caps)
}
caps->is_rv350 = caps->family >= CHIP_FAMILY_RV350;
caps->dxtc_swizzle = caps->is_r400 || caps->is_r500;
}

View File

@@ -79,6 +79,8 @@ struct r300_capabilities {
boolean is_r500;
/* Whether or not the second pixel pipe is accessed with the high bit */
boolean high_second_pipe;
/* DXTC texture swizzling. */
boolean dxtc_swizzle;
};
/* Enumerations for legibility and telling which card we're running on. */

View File

@@ -79,6 +79,9 @@ static void r300_release_referenced_objects(struct r300_context *r300)
NULL);
}
/* The dummy VBO. */
pipe_resource_reference(&r300->dummy_vb, NULL);
/* The SWTCL VBO. */
pipe_resource_reference(&r300->vbo, NULL);
@@ -488,6 +491,7 @@ struct pipe_context* r300_create_context(struct pipe_screen* screen,
rtempl.target = PIPE_TEXTURE_2D;
rtempl.format = PIPE_FORMAT_I8_UNORM;
rtempl.bind = PIPE_BIND_SAMPLER_VIEW;
rtempl.usage = PIPE_USAGE_IMMUTABLE;
rtempl.width0 = 1;
rtempl.height0 = 1;
rtempl.depth0 = 1;
@@ -501,6 +505,19 @@ struct pipe_context* r300_create_context(struct pipe_screen* screen,
pipe_resource_reference(&tex, NULL);
}
{
struct pipe_resource vb = {};
vb.target = PIPE_BUFFER;
vb.format = PIPE_FORMAT_R8_UNORM;
vb.bind = PIPE_BIND_VERTEX_BUFFER;
vb.usage = PIPE_USAGE_IMMUTABLE;
vb.width0 = sizeof(float) * 16;
vb.height0 = 1;
vb.depth0 = 1;
r300->dummy_vb = screen->resource_create(screen, &vb);
}
return &r300->context;
fail:

View File

@@ -162,7 +162,6 @@ struct r300_sampler_state {
uint32_t filter0; /* R300_TX_FILTER0: 0x4400 */
uint32_t filter1; /* R300_TX_FILTER1: 0x4440 */
uint32_t border_color; /* R300_TX_BORDER_COLOR: 0x45c0 */
/* Min/max LOD must be clamped to [0, last_level], thus
* it's dependent on a currently bound texture */
@@ -457,6 +456,7 @@ struct r300_context {
size_t draw_vbo_size;
/* Whether the VBO must not be flushed. */
boolean draw_vbo_locked;
boolean draw_first_emitted;
/* Accelerated blit support. */
struct blitter_context* blitter;
@@ -470,6 +470,10 @@ struct r300_context {
* dummy texture there. */
struct r300_sampler_view *texkill_sampler;
/* When no vertex buffer is set, this one is used instead to prevent
* hardlocks. */
struct pipe_resource *dummy_vb;
/* The currently active query. */
struct r300_query *query_current;
/* The saved query for blitter operations. */

View File

@@ -475,6 +475,11 @@ void r300_emit_fb_state_pipelined(struct r300_context *r300,
for (i = 0; i < fb->nr_cbufs; i++) {
OUT_CS(r300_surface(fb->cbufs[i])->format);
}
for (; i < 1; i++) {
OUT_CS(R300_US_OUT_FMT_C4_8 |
R300_C0_SEL_B | R300_C1_SEL_G |
R300_C2_SEL_R | R300_C3_SEL_A);
}
for (; i < 4; i++) {
OUT_CS(R300_US_OUT_FMT_UNUSED);
}

View File

@@ -158,7 +158,7 @@ static void r300_render_condition(struct pipe_context *pipe,
uint mode)
{
struct r300_context *r300 = r300_context(pipe);
uint64_t result;
uint64_t result = 0;
boolean wait;
if (query) {
@@ -167,9 +167,9 @@ static void r300_render_condition(struct pipe_context *pipe,
if (!r300_get_query_result(pipe, query, wait, &result)) {
r300->skip_rendering = FALSE;
}
} else {
r300->skip_rendering = result == 0;
}
} else {
r300->skip_rendering = FALSE;
}

View File

@@ -1520,11 +1520,11 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
# define R300_TX_TRI_PERF_3_8 (3<<15)
# define R300_ANISO_THRESHOLD_MASK (7<<17)
# define R400_DXTC_SWIZZLE_ENABLE (1<<21)
# define R500_MACRO_SWITCH (1<<22)
# define R500_TX_MAX_ANISO(x) ((x) << 23)
# define R500_TX_MAX_ANISO_MASK (63 << 23)
# define R500_TX_ANISO_HIGH_QUALITY (1 << 30)
# define R500_BORDER_FIX (1<<31)
#define R300_TX_FORMAT0_0 0x4480

View File

@@ -676,9 +676,6 @@ static void r300_draw_vbo(struct pipe_context* pipe,
{
struct r300_context* r300 = r300_context(pipe);
if (!r300->velems->count || !r300->vertex_buffer_count)
return;
if (info->indexed && r300->index_buffer.buffer) {
unsigned offset;
@@ -753,6 +750,7 @@ static void r300_swtcl_draw_vbo(struct pipe_context* pipe,
draw_set_mapped_index_buffer(r300->draw, indices);
r300->draw_vbo_locked = TRUE;
r300->draw_first_emitted = FALSE;
draw_vbo(r300->draw, info);
draw_flush(r300->draw);
r300->draw_vbo_locked = FALSE;
@@ -907,10 +905,17 @@ static void r300_render_draw_arrays(struct vbuf_render* render,
DBG(r300, DBG_DRAW, "r300: render_draw_arrays (count: %d)\n", count);
if (r300->draw_first_emitted) {
if (!r300_prepare_for_rendering(r300,
PREP_FIRST_DRAW | PREP_EMIT_AOS_SWTCL,
NULL, 6, 0, 0))
return;
} else {
if (!r300_emit_states(r300,
PREP_FIRST_DRAW | PREP_EMIT_AOS_SWTCL,
NULL, 0, 0))
return;
}
/* Uncomment to dump all VBOs rendered through this interface.
* Slow and noisy!
@@ -937,6 +942,8 @@ static void r300_render_draw_arrays(struct vbuf_render* render,
OUT_CS(R300_VAP_VF_CNTL__PRIM_WALK_VERTEX_LIST | (count << 16) |
r300render->hwprim);
END_CS;
r300->draw_first_emitted = TRUE;
}
static void r300_render_draw_elements(struct vbuf_render* render,
@@ -955,10 +962,17 @@ static void r300_render_draw_elements(struct vbuf_render* render,
CS_LOCALS(r300);
DBG(r300, DBG_DRAW, "r300: render_draw_elements (count: %d)\n", count);
if (r300->draw_first_emitted) {
if (!r300_prepare_for_rendering(r300,
PREP_FIRST_DRAW | PREP_EMIT_AOS_SWTCL | PREP_INDEXED,
NULL, 256, 0, 0))
return;
} else {
if (!r300_emit_states(r300,
PREP_FIRST_DRAW | PREP_EMIT_AOS_SWTCL | PREP_INDEXED,
NULL, 0, 0))
return;
}
/* Below we manage the CS space manually because there may be more
* indices than it can fit in CS. */
@@ -999,6 +1013,8 @@ static void r300_render_draw_elements(struct vbuf_render* render,
end_cs_dwords = r300_get_num_cs_end_dwords(r300);
}
}
r300->draw_first_emitted = TRUE;
}
static void r300_render_destroy(struct vbuf_render* render)

View File

@@ -114,8 +114,9 @@ static int r300_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
case PIPE_CAP_TEXTURE_MIRROR_CLAMP:
case PIPE_CAP_TEXTURE_MIRROR_REPEAT:
case PIPE_CAP_BLEND_EQUATION_SEPARATE:
case PIPE_CAP_TEXTURE_SWIZZLE:
return 1;
case PIPE_CAP_TEXTURE_SWIZZLE:
return util_format_s3tc_enabled ? r300screen->caps.dxtc_swizzle : 1;
/* Unsupported features (boolean caps). */
case PIPE_CAP_TIMER_QUERY:
@@ -203,7 +204,7 @@ static int r300_get_shader_param(struct pipe_screen *pscreen, unsigned shader, e
case PIPE_SHADER_CAP_MAX_PREDS:
return is_r500 ? 1 : 0;
case PIPE_SHADER_CAP_TGSI_CONT_SUPPORTED:
return 1;
return 0;
}
break;
case PIPE_SHADER_VERTEX:
@@ -230,7 +231,7 @@ static int r300_get_shader_param(struct pipe_screen *pscreen, unsigned shader, e
case PIPE_SHADER_CAP_MAX_PREDS:
return is_r500 ? 4 : 0; /* XXX guessed. */
case PIPE_SHADER_CAP_TGSI_CONT_SUPPORTED:
return 1;
return 0;
default:
break;
}

View File

@@ -1171,7 +1171,6 @@ static void*
struct r300_sampler_state* sampler = CALLOC_STRUCT(r300_sampler_state);
boolean is_r500 = r300->screen->caps.is_r500;
int lod_bias;
union util_color uc;
sampler->state = *state;
@@ -1228,9 +1227,6 @@ static void*
sampler->filter1 |= r500_anisotropy(state->max_anisotropy);
}
util_pack_color(state->border_color, PIPE_FORMAT_B8G8R8A8_UNORM, &uc);
sampler->border_color = uc.ui;
/* R500-specific fixups and optimizations */
if (r300->screen->caps.is_r500) {
sampler->filter1 |= R500_BORDER_FIX;
@@ -1317,7 +1313,6 @@ static void r300_set_fragment_sampler_views(struct pipe_context* pipe,
}
for (i = 0; i < count; i++) {
if (&state->sampler_views[i]->base != views[i]) {
pipe_sampler_view_reference(
(struct pipe_sampler_view**)&state->sampler_views[i],
views[i]);
@@ -1340,7 +1335,6 @@ static void r300_set_fragment_sampler_views(struct pipe_context* pipe,
r300_assign_texture_cache_region(view_index, real_num_views);
view_index++;
}
}
for (i = count; i < tex_units; i++) {
if (state->sampler_views[i]) {
@@ -1367,6 +1361,7 @@ r300_create_sampler_view(struct pipe_context *pipe,
struct r300_sampler_view *view = CALLOC_STRUCT(r300_sampler_view);
struct r300_texture *tex = r300_texture(texture);
boolean is_r500 = r300_screen(pipe->screen)->caps.is_r500;
boolean dxtc_swizzle = r300_screen(pipe->screen)->caps.dxtc_swizzle;
if (view) {
view->base = *templ;
@@ -1383,7 +1378,8 @@ r300_create_sampler_view(struct pipe_context *pipe,
view->format = tex->tx_format;
view->format.format1 |= r300_translate_texformat(templ->format,
view->swizzle,
is_r500);
is_r500,
dxtc_swizzle);
if (is_r500) {
view->format.format2 |= r500_tx_format_msb_bit(templ->format);
}
@@ -1468,6 +1464,15 @@ static void r300_set_vertex_buffers(struct pipe_context* pipe,
struct pipe_vertex_buffer *vbo;
unsigned i, max_index = (1 << 24) - 1;
boolean any_user_buffer = FALSE;
struct pipe_vertex_buffer dummy_vb = {0};
/* There must be at least one vertex buffer set, otherwise it locks up. */
if (!count) {
dummy_vb.buffer = r300->dummy_vb;
dummy_vb.max_index = r300->dummy_vb->width0 / 4;
buffers = &dummy_vb;
count = 1;
}
if (count == r300->vertex_buffer_count &&
memcmp(r300->vertex_buffer, buffers,
@@ -1503,12 +1508,12 @@ static void r300_set_vertex_buffers(struct pipe_context* pipe,
any_user_buffer = TRUE;
}
if (vbo->max_index == ~0) {
/* if no VBO stride then only one vertex value so max index is 1 */
/* should think about converting to VS constants like svga does */
/* The stride of zero means we will be fetching only the first
* vertex, so don't care about max_index. */
if (!vbo->stride)
vbo->max_index = 1;
else
continue;
if (vbo->max_index == ~0) {
vbo->max_index =
(vbo->buffer->width0 - vbo->buffer_offset) / vbo->stride;
}
@@ -1621,6 +1626,14 @@ static void* r300_create_vertex_elements_state(struct pipe_context* pipe,
struct r300_vertex_element_state *velems;
unsigned i;
enum pipe_format *format;
struct pipe_vertex_element dummy_attrib = {0};
/* R300 Programmable Stream Control (PSC) doesn't support 0 vertex elements. */
if (!count) {
dummy_attrib.src_format = PIPE_FORMAT_R8G8B8A8_UNORM;
attribs = &dummy_attrib;
count = 1;
}
assert(count <= PIPE_MAX_ATTRIBS);
velems = CALLOC_STRUCT(r300_vertex_element_state);
@@ -1687,7 +1700,8 @@ static void* r300_create_vertex_elements_state(struct pipe_context* pipe,
* swizzles are already set up.
* Also compute the vertex size. */
for (i = 0; i < count; i++) {
/* This is OK because we check for aligned strides too. */
/* This is OK because we check for aligned strides too
* elsewhere. */
velems->hw_format_size[i] =
align(util_format_get_blocksize(velems->hw_format[i]), 4);
velems->vertex_size_dwords += velems->hw_format_size[i] / 4;

View File

@@ -25,6 +25,7 @@
#include "util/u_math.h"
#include "util/u_memory.h"
#include "util/u_pack_color.h"
#include "r300_context.h"
#include "r300_fs.h"
@@ -567,6 +568,96 @@ static void r300_update_rs_block(struct r300_context *r300)
}
}
static uint32_t r300_get_border_color(enum pipe_format format,
const float border[4],
boolean is_r500)
{
const struct util_format_description *desc;
float border_swizzled[4] = {0};
unsigned i;
union util_color uc = {0};
desc = util_format_description(format);
/* Do depth formats first. */
if (util_format_is_depth_or_stencil(format)) {
switch (format) {
case PIPE_FORMAT_Z16_UNORM:
return util_pack_z(PIPE_FORMAT_Z16_UNORM, border[0]);
case PIPE_FORMAT_X8Z24_UNORM:
case PIPE_FORMAT_S8_USCALED_Z24_UNORM:
if (is_r500) {
return util_pack_z(PIPE_FORMAT_X8Z24_UNORM, border[0]);
} else {
return util_pack_z(PIPE_FORMAT_Z16_UNORM, border[0]) << 16;
}
default:
assert(0);
return 0;
}
}
/* Apply inverse swizzle of the format. */
for (i = 0; i < 4; i++) {
switch (desc->swizzle[i]) {
case UTIL_FORMAT_SWIZZLE_X:
border_swizzled[2] = border[i];
break;
case UTIL_FORMAT_SWIZZLE_Y:
border_swizzled[1] = border[i];
break;
case UTIL_FORMAT_SWIZZLE_Z:
border_swizzled[0] = border[i];
break;
case UTIL_FORMAT_SWIZZLE_W:
border_swizzled[3] = border[i];
break;
}
}
/* Compressed formats. */
if (util_format_is_compressed(format)) {
util_pack_color(border_swizzled, PIPE_FORMAT_R8G8B8A8_UNORM, &uc);
return uc.ui;
}
switch (desc->channel[0].size) {
case 4:
util_pack_color(border_swizzled, PIPE_FORMAT_B4G4R4A4_UNORM, &uc);
break;
case 5:
if (desc->channel[1].size == 5) {
util_pack_color(border_swizzled, PIPE_FORMAT_B5G5R5A1_UNORM, &uc);
} else if (desc->channel[1].size == 6) {
util_pack_color(border_swizzled, PIPE_FORMAT_B5G6R5_UNORM, &uc);
} else {
assert(0);
}
break;
default:
case 8:
util_pack_color(border_swizzled, PIPE_FORMAT_B8G8R8A8_UNORM, &uc);
break;
case 10:
util_pack_color(border_swizzled, PIPE_FORMAT_B10G10R10A2_UNORM, &uc);
break;
case 16:
if (desc->nr_channels <= 2) {
border_swizzled[0] = border_swizzled[2];
util_pack_color(border_swizzled, PIPE_FORMAT_R16G16_UNORM, &uc);
} else {
util_pack_color(border_swizzled, PIPE_FORMAT_B8G8R8A8_UNORM, &uc);
}
break;
}
return uc.ui;
}
static void r300_merge_textures_and_samplers(struct r300_context* r300)
{
struct r300_textures_state *state =
@@ -599,7 +690,12 @@ static void r300_merge_textures_and_samplers(struct r300_context* r300)
texstate->format = view->format;
texstate->filter0 = sampler->filter0;
texstate->filter1 = sampler->filter1;
texstate->border_color = sampler->border_color;
/* Set the border color. */
texstate->border_color =
r300_get_border_color(view->base.format,
sampler->state.border_color,
r300->screen->caps.is_r500);
/* determine min/max levels */
max_level = MIN3(sampler->max_lod + view->base.first_level,
@@ -645,13 +741,18 @@ static void r300_merge_textures_and_samplers(struct r300_context* r300)
if (sampler->state.compare_mode == PIPE_TEX_COMPARE_NONE) {
texstate->format.format1 |=
r300_get_swizzle_combined(depth_swizzle,
view->swizzle);
view->swizzle, FALSE);
} else {
texstate->format.format1 |=
r300_get_swizzle_combined(depth_swizzle, 0);
r300_get_swizzle_combined(depth_swizzle, 0, FALSE);
}
}
if (r300->screen->caps.dxtc_swizzle &&
util_format_is_compressed(tex->desc.b.b.format)) {
texstate->filter1 |= R400_DXTC_SWIZZLE_ENABLE;
}
/* to emulate 1D textures through 2D ones correctly */
if (tex->desc.b.b.target == PIPE_TEXTURE_1D) {
texstate->filter0 &= ~R300_TX_WRAP_T_MASK;

View File

@@ -40,7 +40,8 @@
#include "pipe/p_screen.h"
unsigned r300_get_swizzle_combined(const unsigned char *swizzle_format,
const unsigned char *swizzle_view)
const unsigned char *swizzle_view,
boolean dxtc_swizzle)
{
unsigned i;
unsigned char swizzle[4];
@@ -51,10 +52,10 @@ unsigned r300_get_swizzle_combined(const unsigned char *swizzle_format,
R300_TX_FORMAT_B_SHIFT,
R300_TX_FORMAT_A_SHIFT
};
const uint32_t swizzle_bit[4] = {
R300_TX_FORMAT_X,
uint32_t swizzle_bit[4] = {
dxtc_swizzle ? R300_TX_FORMAT_Z : R300_TX_FORMAT_X,
R300_TX_FORMAT_Y,
R300_TX_FORMAT_Z,
dxtc_swizzle ? R300_TX_FORMAT_X : R300_TX_FORMAT_Z,
R300_TX_FORMAT_W
};
@@ -107,7 +108,8 @@ unsigned r300_get_swizzle_combined(const unsigned char *swizzle_format,
* makes available X, Y, Z, W, ZERO, and ONE for swizzling. */
uint32_t r300_translate_texformat(enum pipe_format format,
const unsigned char *swizzle_view,
boolean is_r500)
boolean is_r500,
boolean dxtc_swizzle)
{
uint32_t result = 0;
const struct util_format_description *desc;
@@ -169,7 +171,8 @@ uint32_t r300_translate_texformat(enum pipe_format format,
}
}
result |= r300_get_swizzle_combined(desc->swizzle, swizzle_view);
result |= r300_get_swizzle_combined(desc->swizzle, swizzle_view,
util_format_is_compressed(format) && dxtc_swizzle);
/* S3TC formats. */
if (desc->layout == UTIL_FORMAT_LAYOUT_S3TC) {
@@ -538,7 +541,7 @@ boolean r300_is_zs_format_supported(enum pipe_format format)
boolean r300_is_sampler_format_supported(enum pipe_format format)
{
return r300_translate_texformat(format, 0, TRUE) != ~0;
return r300_translate_texformat(format, 0, TRUE, FALSE) != ~0;
}
void r300_texture_setup_format_state(struct r300_screen *screen,
@@ -862,7 +865,7 @@ struct pipe_surface* r300_get_tex_surface(struct pipe_screen* screen,
tex->desc.b.b.nr_samples,
tex->desc.microtile,
tex->desc.macrotile[level],
DIM_HEIGHT);
DIM_HEIGHT, 0);
surface->cbzb_height = align((surface->base.height + 1) / 2,
tile_height);

View File

@@ -35,11 +35,13 @@ struct r300_texture;
struct r300_screen;
unsigned r300_get_swizzle_combined(const unsigned char *swizzle_format,
const unsigned char *swizzle_view);
const unsigned char *swizzle_view,
boolean dxtc_swizzle);
uint32_t r300_translate_texformat(enum pipe_format format,
const unsigned char *swizzle_view,
boolean is_r500);
boolean is_r500,
boolean dxtc_swizzle);
uint32_t r500_tx_format_msb_bit(enum pipe_format format);

View File

@@ -34,7 +34,7 @@ unsigned r300_get_pixel_alignment(enum pipe_format format,
unsigned num_samples,
enum r300_buffer_tiling microtile,
enum r300_buffer_tiling macrotile,
enum r300_dim dim)
enum r300_dim dim, boolean is_rs690)
{
static const unsigned table[2][5][3][2] =
{
@@ -44,7 +44,7 @@ unsigned r300_get_pixel_alignment(enum pipe_format format,
{{ 32, 1}, { 8, 4}, { 0, 0}}, /* 8 bits per pixel */
{{ 16, 1}, { 8, 2}, { 4, 4}}, /* 16 bits per pixel */
{{ 8, 1}, { 4, 2}, { 0, 0}}, /* 32 bits per pixel */
{{ 4, 1}, { 0, 0}, { 2, 2}}, /* 64 bits per pixel */
{{ 4, 1}, { 2, 2}, { 0, 0}}, /* 64 bits per pixel */
{{ 2, 1}, { 0, 0}, { 0, 0}} /* 128 bits per pixel */
},
{
@@ -53,10 +53,11 @@ unsigned r300_get_pixel_alignment(enum pipe_format format,
{{256, 8}, {64, 32}, { 0, 0}}, /* 8 bits per pixel */
{{128, 8}, {64, 16}, {32, 32}}, /* 16 bits per pixel */
{{ 64, 8}, {32, 16}, { 0, 0}}, /* 32 bits per pixel */
{{ 32, 8}, { 0, 0}, {16, 16}}, /* 64 bits per pixel */
{{ 32, 8}, {16, 16}, { 0, 0}}, /* 64 bits per pixel */
{{ 16, 8}, { 0, 0}, { 0, 0}} /* 128 bits per pixel */
}
};
static const unsigned aa_block[2] = {4, 8};
unsigned tile = 0;
unsigned pixsize = util_format_get_blocksize(format);
@@ -74,6 +75,14 @@ unsigned r300_get_pixel_alignment(enum pipe_format format,
} else {
/* Standard alignment. */
tile = table[macrotile][util_logbase2(pixsize)][microtile][dim];
if (macrotile == 0 && is_rs690 && dim == DIM_WIDTH) {
int align;
int h_tile;
h_tile = table[macrotile][util_logbase2(pixsize)][microtile][DIM_HEIGHT];
align = 64 / (pixsize * h_tile);
if (tile < align)
tile = align;
}
}
assert(tile);
@@ -89,7 +98,7 @@ static boolean r300_texture_macro_switch(struct r300_texture_desc *desc,
unsigned tile, texdim;
tile = r300_get_pixel_alignment(desc->b.b.format, desc->b.b.nr_samples,
desc->microtile, R300_BUFFER_TILED, dim);
desc->microtile, R300_BUFFER_TILED, dim, 0);
if (dim == DIM_WIDTH) {
texdim = u_minify(desc->b.b.width0, level);
} else {
@@ -113,6 +122,9 @@ static unsigned r300_texture_get_stride(struct r300_screen *screen,
unsigned level)
{
unsigned tile_width, width, stride;
boolean is_rs690 = (screen->caps.family == CHIP_FAMILY_RS600 ||
screen->caps.family == CHIP_FAMILY_RS690 ||
screen->caps.family == CHIP_FAMILY_RS740);
if (desc->stride_in_bytes_override)
return desc->stride_in_bytes_override;
@@ -131,38 +143,14 @@ static unsigned r300_texture_get_stride(struct r300_screen *screen,
desc->b.b.nr_samples,
desc->microtile,
desc->macrotile[level],
DIM_WIDTH);
DIM_WIDTH, is_rs690);
width = align(width, tile_width);
stride = util_format_get_stride(desc->b.b.format, width);
/* Some IGPs need a minimum stride of 64 bytes, hmm... */
if (!desc->macrotile[level] &&
(screen->caps.family == CHIP_FAMILY_RS600 ||
screen->caps.family == CHIP_FAMILY_RS690 ||
screen->caps.family == CHIP_FAMILY_RS740)) {
unsigned min_stride;
if (desc->microtile) {
unsigned tile_height =
r300_get_pixel_alignment(desc->b.b.format,
desc->b.b.nr_samples,
desc->microtile,
desc->macrotile[level],
DIM_HEIGHT);
min_stride = 64 / tile_height;
} else {
min_stride = 64;
}
return stride < min_stride ? min_stride : stride;
}
/* The alignment to 32 bytes is sort of implied by the layout... */
return stride;
} else {
return align(util_format_get_stride(desc->b.b.format, width), 32);
return align(util_format_get_stride(desc->b.b.format, width), is_rs690 ? 64 : 32);
}
}
@@ -179,7 +167,7 @@ static unsigned r300_texture_get_nblocksy(struct r300_texture_desc *desc,
desc->b.b.nr_samples,
desc->microtile,
desc->macrotile[level],
DIM_HEIGHT);
DIM_HEIGHT, 0);
height = align(height, tile_height);
/* This is needed for the kernel checker, unfortunately. */
@@ -256,7 +244,7 @@ static void r300_setup_miptree(struct r300_screen *screen,
{
struct pipe_resource *base = &desc->b.b;
unsigned stride, size, layer_size, nblocksy, i;
boolean rv350_mode = screen->caps.is_rv350;
boolean rv350_mode = screen->caps.family >= CHIP_FAMILY_R350;
boolean aligned_for_cbzb;
desc->size_in_bytes = 0;
@@ -351,7 +339,7 @@ static void r300_setup_tiling(struct r300_screen *screen,
{
struct r300_winsys_screen *rws = screen->rws;
enum pipe_format format = desc->b.b.format;
boolean rv350_mode = screen->caps.is_rv350;
boolean rv350_mode = screen->caps.family >= CHIP_FAMILY_R350;
boolean is_zb = util_format_is_depth_or_stencil(format);
boolean dbg_no_tiling = SCREEN_DBG_ON(screen, DBG_NO_TILING);
@@ -368,11 +356,11 @@ static void r300_setup_tiling(struct r300_screen *screen,
switch (util_format_get_blocksize(format)) {
case 1:
case 4:
case 8:
desc->microtile = R300_BUFFER_TILED;
break;
case 2:
case 8:
if (rws->get_value(rws, R300_VID_SQUARE_TILING_SUPPORT)) {
desc->microtile = R300_BUFFER_SQUARETILED;
}

View File

@@ -41,7 +41,7 @@ unsigned r300_get_pixel_alignment(enum pipe_format format,
unsigned num_samples,
enum r300_buffer_tiling microtile,
enum r300_buffer_tiling macrotile,
enum r300_dim dim);
enum r300_dim dim, boolean is_rs690);
boolean r300_texture_desc_init(struct r300_screen *rscreen,
struct r300_texture_desc *desc,

View File

@@ -575,7 +575,7 @@ setup_fragcoord_coeff(struct setup_context *setup, uint slot)
setup->coef[slot].dady[0] = 0.0;
/*Y*/
setup->coef[slot].a0[1] =
(spfs->origin_lower_left ? setup->softpipe->framebuffer.height : 0)
(spfs->origin_lower_left ? setup->softpipe->framebuffer.height-1 : 0)
+ (spfs->pixel_center_integer ? 0.0 : 0.5);
setup->coef[slot].dadx[1] = 0.0;
setup->coef[slot].dady[1] = spfs->origin_lower_left ? -1.0 : 1.0;

View File

@@ -203,7 +203,7 @@ svga_tgsi_translate( const struct svga_shader *shader,
emit.imm_start += key.vkey.num_zero_stride_vertex_elements;
}
emit.nr_hw_const = (emit.imm_start + emit.info.file_max[TGSI_FILE_IMMEDIATE] + 1);
emit.nr_hw_float_const = (emit.imm_start + emit.info.file_max[TGSI_FILE_IMMEDIATE] + 1);
emit.nr_hw_temp = emit.info.file_max[TGSI_FILE_TEMPORARY] + 1;
emit.in_main_func = TRUE;

View File

@@ -62,7 +62,8 @@ struct svga_shader_emitter
int imm_start;
int nr_hw_const;
int nr_hw_float_const;
int nr_hw_int_const;
int nr_hw_temp;
int insn_offset;

View File

@@ -197,10 +197,23 @@ translate_src_register( const struct svga_shader_emitter *emit,
break;
}
/* Indirect addressing (for coninstant buffer lookups only)
/* Indirect addressing.
*/
if (reg->Register.Indirect)
{
if (reg->Register.Indirect) {
if (emit->unit == PIPE_SHADER_FRAGMENT) {
/* Pixel shaders have only loop registers for relative
* addressing into inputs. Ignore the redundant address
* register, the contents of aL should be in sync with it.
*/
if (reg->Register.File == TGSI_FILE_INPUT) {
src.base.relAddr = 1;
src.indirect = src_token(SVGA3DREG_LOOP, 0);
}
}
else {
/* Constant buffers only.
*/
if (reg->Register.File == TGSI_FILE_CONSTANT) {
/* we shift the offset towards the minimum */
if (svga_arl_needs_adjustment( emit )) {
src.base.num -= svga_arl_adjustment( emit );
@@ -214,6 +227,8 @@ translate_src_register( const struct svga_shader_emitter *emit,
src.indirect.swizzle = SWIZZLE_XXXX;
}
}
}
src = swizzle( src,
reg->Register.SwizzleX,
@@ -538,7 +553,7 @@ static boolean emit_def_const( struct svga_shader_emitter *emit,
static INLINE boolean
create_zero_immediate( struct svga_shader_emitter *emit )
{
unsigned idx = emit->nr_hw_const++;
unsigned idx = emit->nr_hw_float_const++;
if (!emit_def_const( emit, SVGA3D_CONST_TYPE_FLOAT,
idx, 0, 0, 0, 1 ))
@@ -553,7 +568,7 @@ create_zero_immediate( struct svga_shader_emitter *emit )
static INLINE boolean
create_loop_const( struct svga_shader_emitter *emit )
{
unsigned idx = emit->nr_hw_const++;
unsigned idx = emit->nr_hw_int_const++;
if (!emit_def_const( emit, SVGA3D_CONST_TYPE_INT, idx,
255, /* iteration count */
@@ -571,7 +586,7 @@ create_loop_const( struct svga_shader_emitter *emit )
static INLINE boolean
create_sincos_consts( struct svga_shader_emitter *emit )
{
unsigned idx = emit->nr_hw_const++;
unsigned idx = emit->nr_hw_float_const++;
if (!emit_def_const( emit, SVGA3D_CONST_TYPE_FLOAT, idx,
-1.5500992e-006f,
@@ -581,7 +596,7 @@ create_sincos_consts( struct svga_shader_emitter *emit )
return FALSE;
emit->sincos_consts_idx = idx;
idx = emit->nr_hw_const++;
idx = emit->nr_hw_float_const++;
if (!emit_def_const( emit, SVGA3D_CONST_TYPE_FLOAT, idx,
-0.020833334f,
@@ -602,7 +617,7 @@ create_arl_consts( struct svga_shader_emitter *emit )
for (i = 0; i < emit->num_arl_consts; i += 4) {
int j;
unsigned idx = emit->nr_hw_const++;
unsigned idx = emit->nr_hw_float_const++;
float vals[4];
for (j = 0; j < 4 && (j + i) < emit->num_arl_consts; ++j) {
vals[j] = emit->arl_consts[i + j].number;
@@ -1593,6 +1608,14 @@ static boolean emit_arl(struct svga_shader_emitter *emit,
const struct tgsi_full_instruction *insn)
{
++emit->current_arl;
if (emit->unit == PIPE_SHADER_FRAGMENT) {
/* MOVA not present in pixel shader instruction set.
* Ignore this instruction altogether since it is
* only used for loop counters -- and for that
* we reference aL directly.
*/
return TRUE;
}
if (svga_arl_needs_adjustment( emit )) {
return emit_fake_arl( emit, insn );
} else {
@@ -2384,7 +2407,7 @@ static boolean make_immediate( struct svga_shader_emitter *emit,
float d,
struct src_register *out )
{
unsigned idx = emit->nr_hw_const++;
unsigned idx = emit->nr_hw_float_const++;
if (!emit_def_const( emit, SVGA3D_CONST_TYPE_FLOAT,
idx, a, b, c, d ))

View File

@@ -384,7 +384,6 @@ struct st_manager
* This function is optional.
*/
boolean (*get_egl_image)(struct st_manager *smapi,
struct st_context_iface *stctx,
void *egl_image,
struct st_egl_image *out);

View File

@@ -141,12 +141,18 @@ GLboolean
dri_unbind_context(__DRIcontext * cPriv)
{
/* dri_util.c ensures cPriv is not null */
struct dri_screen *screen = dri_screen(cPriv->driScreenPriv);
struct dri_context *ctx = dri_context(cPriv);
struct dri_drawable *draw = dri_drawable(ctx->dPriv);
struct dri_drawable *read = dri_drawable(ctx->rPriv);
struct st_api *stapi = screen->st_api;
if (--ctx->bind_count == 0) {
if (ctx->st == ctx->stapi->get_current(ctx->stapi)) {
ctx->st->flush(ctx->st, PIPE_FLUSH_RENDER_CACHE, NULL);
ctx->stapi->make_current(ctx->stapi, NULL, NULL, NULL);
stapi->make_current(stapi, NULL, NULL, NULL);
draw->context = NULL;
read->context = NULL;
}
}
@@ -169,10 +175,12 @@ dri_make_current(__DRIcontext * cPriv,
++ctx->bind_count;
draw->context = ctx;
if (ctx->dPriv != driDrawPriv) {
ctx->dPriv = driDrawPriv;
draw->texture_stamp = driDrawPriv->lastStamp - 1;
}
read->context = ctx;
if (ctx->rPriv != driReadPriv) {
ctx->rPriv = driReadPriv;
read->texture_stamp = driReadPriv->lastStamp - 1;

View File

@@ -61,9 +61,6 @@ struct dri_context
/* gallium */
struct st_api *stapi;
struct st_context_iface *st;
/* hooks filled in by dri2 & drisw */
__DRIimage * (*lookup_egl_image)(struct dri_context *ctx, void *handle);
};
static INLINE struct dri_context *

View File

@@ -132,6 +132,7 @@ dri_create_buffer(__DRIscreen * sPriv,
drawable->base.validate = dri_st_framebuffer_validate;
drawable->base.st_manager_private = (void *) drawable;
drawable->screen = screen;
drawable->sPriv = sPriv;
drawable->dPriv = dPriv;
dPriv->driverPrivate = (void *)drawable;

View File

@@ -41,6 +41,9 @@ struct dri_drawable
struct st_framebuffer_iface base;
struct st_visual stvis;
struct dri_screen *screen;
struct dri_context *context;
/* dri */
__DRIdrawable *dPriv;
__DRIscreen *sPriv;

View File

@@ -287,16 +287,14 @@ dri_fill_st_visual(struct st_visual *stvis, struct dri_screen *screen,
static boolean
dri_get_egl_image(struct st_manager *smapi,
struct st_context_iface *stctxi,
void *egl_image,
struct st_egl_image *stimg)
{
struct dri_context *ctx =
(struct dri_context *)stctxi->st_manager_private;
struct dri_screen *screen = (struct dri_screen *)smapi;
__DRIimage *img = NULL;
if (ctx->lookup_egl_image) {
img = ctx->lookup_egl_image(ctx, egl_image);
if (screen->lookup_egl_image) {
img = screen->lookup_egl_image(screen, egl_image);
}
if (!img)

View File

@@ -69,6 +69,9 @@ struct dri_screen
boolean sd_depth_bits_last;
boolean auto_fake_front;
enum pipe_texture_target target;
/* hooks filled in by dri2 & drisw */
__DRIimage * (*lookup_egl_image)(struct dri_screen *ctx, void *handle);
};
/** cast wrapper */

View File

@@ -51,7 +51,7 @@ static void
dri2_invalidate_drawable(__DRIdrawable *dPriv)
{
struct dri_drawable *drawable = dri_drawable(dPriv);
struct dri_context *ctx = dri_context(dPriv->driContextPriv);
struct dri_context *ctx = drawable->context;
dri2InvalidateDrawable(dPriv);
drawable->dPriv->lastStamp = *drawable->dPriv->pStamp;
@@ -291,25 +291,26 @@ dri2_flush_frontbuffer(struct dri_drawable *drawable,
}
static __DRIimage *
dri2_lookup_egl_image(struct dri_context *ctx, void *handle)
dri2_lookup_egl_image(struct dri_screen *screen, void *handle)
{
__DRIimageLookupExtension *loader = ctx->sPriv->dri2.image;
__DRIimageLookupExtension *loader = screen->sPriv->dri2.image;
__DRIimage *img;
if (!loader->lookupEGLImage)
return NULL;
img = loader->lookupEGLImage(ctx->cPriv, handle, ctx->cPriv->loaderPrivate);
img = loader->lookupEGLImage(screen->sPriv,
handle, screen->sPriv->loaderPrivate);
return img;
}
static __DRIimage *
dri2_create_image_from_name(__DRIcontext *context,
dri2_create_image_from_name(__DRIscreen *_screen,
int width, int height, int format,
int name, int pitch, void *loaderPrivate)
{
struct dri_screen *screen = dri_screen(context->driScreenPriv);
struct dri_screen *screen = dri_screen(_screen);
__DRIimage *img;
struct pipe_resource templ;
struct winsys_handle whandle;
@@ -537,6 +538,7 @@ dri2_init_screen(__DRIscreen * sPriv)
screen->auto_fake_front = dri_with_format(sPriv);
screen->broken_invalidate = !sPriv->dri2.useInvalidate;
screen->lookup_egl_image = dri2_lookup_egl_image;
return configs;
fail:
@@ -556,8 +558,6 @@ dri2_create_context(gl_api api, const __GLcontextModes * visual,
ctx = cPriv->driverPrivate;
ctx->lookup_egl_image = dri2_lookup_egl_image;
return TRUE;
}

View File

@@ -17,16 +17,16 @@ x11_INCLUDES = \
-I$(TOP)/src/mapi \
-I$(TOP)/src/mesa \
$(X11_CFLAGS) \
$(shell pkg-config --cflags-only-I libdrm)
$(shell pkg-config --cflags-only-I libdrm dri2proto)
x11_SOURCES = $(wildcard x11/*.c) \
$(TOP)/src/glx/dri2.c
x11_OBJECTS = $(x11_SOURCES:.c=.o)
kms_INCLUDES = -I$(TOP)/src/gallium/winsys $(shell pkg-config --cflags-only-I libdrm)
kms_SOURCES = $(wildcard kms/*.c)
kms_OBJECTS = $(kms_SOURCES:.c=.o)
drm_INCLUDES = -I$(TOP)/src/gallium/winsys $(shell pkg-config --cflags-only-I libdrm)
drm_SOURCES = $(wildcard drm/*.c)
drm_OBJECTS = $(drm_SOURCES:.c=.o)
fbdev_INCLUDES = -I$(TOP)/src/gallium/winsys/sw
@@ -34,8 +34,8 @@ fbdev_SOURCES = $(wildcard fbdev/*.c)
fbdev_OBJECTS = $(fbdev_SOURCES:.c=.o)
ALL_INCLUDES = $(common_INCLUDES) $(x11_INCLUDES) $(kms_INCLUDES) $(fbdev_INCLUDES)
ALL_SOURCES = $(common_SOURCES) $(x11_SOURCES) $(kms_SOURCES) $(fbdev_SOURCES)
ALL_INCLUDES = $(common_INCLUDES) $(x11_INCLUDES) $(drm_INCLUDES) $(fbdev_INCLUDES)
ALL_SOURCES = $(common_SOURCES) $(x11_SOURCES) $(drm_SOURCES) $(fbdev_SOURCES)
EGL_OBJECTS = $(common_OBJECTS)
EGL_CPPFLAGS = $(common_INCLUDES)
@@ -45,9 +45,9 @@ ifneq ($(findstring x11, $(EGL_PLATFORMS)),)
EGL_OBJECTS += $(x11_OBJECTS)
EGL_CPPFLAGS += -DHAVE_X11_BACKEND
endif
ifneq ($(findstring kms, $(EGL_PLATFORMS)),)
EGL_OBJECTS += $(kms_OBJECTS)
EGL_CPPFLAGS += -DHAVE_KMS_BACKEND
ifneq ($(findstring drm, $(EGL_PLATFORMS)),)
EGL_OBJECTS += $(drm_OBJECTS)
EGL_CPPFLAGS += -DHAVE_DRM_BACKEND
endif
ifneq ($(findstring fbdev, $(EGL_PLATFORMS)),)
EGL_OBJECTS += $(fbdev_OBJECTS)
@@ -87,8 +87,8 @@ $(common_OBJECTS): %.o: %.c
$(x11_OBJECTS): %.o: %.c
$(call egl-cc,x11)
$(kms_OBJECTS): %.o: %.c
$(call egl-cc,kms)
$(drm_OBJECTS): %.o: %.c
$(call egl-cc,drm)
$(fbdev_OBJECTS): %.o: %.c
$(call egl-cc,fbdev)

View File

@@ -65,8 +65,8 @@ egl_g3d_get_platform(_EGLDriver *drv, _EGLPlatformType plat)
break;
case _EGL_PLATFORM_DRM:
plat_name = "DRM";
#ifdef HAVE_KMS_BACKEND
nplat = native_get_kms_platform();
#ifdef HAVE_DRM_BACKEND
nplat = native_get_drm_platform();
#endif
break;
case _EGL_PLATFORM_FBDEV:

View File

@@ -609,8 +609,10 @@ egl_g3d_wait_client(_EGLDriver *drv, _EGLDisplay *dpy, _EGLContext *ctx)
gctx->stctxi->flush(gctx->stctxi,
PIPE_FLUSH_RENDER_CACHE | PIPE_FLUSH_FRAME, &fence);
if (fence) {
screen->fence_finish(screen, fence, 0);
screen->fence_reference(screen, &fence, NULL);
}
return EGL_TRUE;
}

View File

@@ -51,7 +51,6 @@ egl_g3d_st_manager(struct st_manager *smapi)
static boolean
egl_g3d_st_manager_get_egl_image(struct st_manager *smapi,
struct st_context_iface *stctx,
void *egl_image,
struct st_egl_image *out)
{

View File

@@ -227,7 +227,7 @@ const struct native_platform *
native_get_x11_platform(void);
const struct native_platform *
native_get_kms_platform(void);
native_get_drm_platform(void);
const struct native_platform *
native_get_fbdev_platform(void);

View File

@@ -0,0 +1,619 @@
/*
* Mesa 3-D graphics library
* Version: 7.9
*
* Copyright (C) 2010 LunarG Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
* Authors:
* Chia-I Wu <olv@lunarg.com>
*/
#include "util/u_memory.h"
#include "util/u_inlines.h"
#include "egllog.h"
#include "native_drm.h"
static boolean
drm_surface_validate(struct native_surface *nsurf, uint attachment_mask,
unsigned int *seq_num, struct pipe_resource **textures,
int *width, int *height)
{
struct drm_surface *drmsurf = drm_surface(nsurf);
if (!resource_surface_add_resources(drmsurf->rsurf, attachment_mask))
return FALSE;
if (textures)
resource_surface_get_resources(drmsurf->rsurf, textures, attachment_mask);
if (seq_num)
*seq_num = drmsurf->sequence_number;
if (width)
*width = drmsurf->width;
if (height)
*height = drmsurf->height;
return TRUE;
}
/**
* Add textures as DRM framebuffers.
*/
static boolean
drm_surface_init_framebuffers(struct native_surface *nsurf, boolean need_back)
{
struct drm_surface *drmsurf = drm_surface(nsurf);
struct drm_display *drmdpy = drmsurf->drmdpy;
int num_framebuffers = (need_back) ? 2 : 1;
int i, err;
for (i = 0; i < num_framebuffers; i++) {
struct drm_framebuffer *fb;
enum native_attachment natt;
struct winsys_handle whandle;
uint block_bits;
if (i == 0) {
fb = &drmsurf->front_fb;
natt = NATIVE_ATTACHMENT_FRONT_LEFT;
}
else {
fb = &drmsurf->back_fb;
natt = NATIVE_ATTACHMENT_BACK_LEFT;
}
if (!fb->texture) {
/* make sure the texture has been allocated */
resource_surface_add_resources(drmsurf->rsurf, 1 << natt);
fb->texture =
resource_surface_get_single_resource(drmsurf->rsurf, natt);
if (!fb->texture)
return FALSE;
}
/* already initialized */
if (fb->buffer_id)
continue;
/* TODO detect the real value */
fb->is_passive = TRUE;
memset(&whandle, 0, sizeof(whandle));
whandle.type = DRM_API_HANDLE_TYPE_KMS;
if (!drmdpy->base.screen->resource_get_handle(drmdpy->base.screen,
fb->texture, &whandle))
return FALSE;
block_bits = util_format_get_blocksizebits(drmsurf->color_format);
err = drmModeAddFB(drmdpy->fd, drmsurf->width, drmsurf->height,
block_bits, block_bits, whandle.stride, whandle.handle,
&fb->buffer_id);
if (err) {
fb->buffer_id = 0;
return FALSE;
}
}
return TRUE;
}
static boolean
drm_surface_flush_frontbuffer(struct native_surface *nsurf)
{
#ifdef DRM_MODE_FEATURE_DIRTYFB
struct drm_surface *drmsurf = drm_surface(nsurf);
struct drm_display *drmdpy = drmsurf->drmdpy;
if (drmsurf->front_fb.is_passive)
drmModeDirtyFB(drmdpy->fd, drmsurf->front_fb.buffer_id, NULL, 0);
#endif
return TRUE;
}
static boolean
drm_surface_swap_buffers(struct native_surface *nsurf)
{
struct drm_surface *drmsurf = drm_surface(nsurf);
struct drm_crtc *drmcrtc = &drmsurf->current_crtc;
struct drm_display *drmdpy = drmsurf->drmdpy;
struct drm_framebuffer tmp_fb;
int err;
if (!drmsurf->back_fb.buffer_id) {
if (!drm_surface_init_framebuffers(&drmsurf->base, TRUE))
return FALSE;
}
if (drmsurf->is_shown && drmcrtc->crtc) {
err = drmModeSetCrtc(drmdpy->fd, drmcrtc->crtc->crtc_id,
drmsurf->back_fb.buffer_id, drmcrtc->crtc->x, drmcrtc->crtc->y,
drmcrtc->connectors, drmcrtc->num_connectors, &drmcrtc->crtc->mode);
if (err)
return FALSE;
}
/* swap the buffers */
tmp_fb = drmsurf->front_fb;
drmsurf->front_fb = drmsurf->back_fb;
drmsurf->back_fb = tmp_fb;
resource_surface_swap_buffers(drmsurf->rsurf,
NATIVE_ATTACHMENT_FRONT_LEFT, NATIVE_ATTACHMENT_BACK_LEFT, FALSE);
/* the front/back textures are swapped */
drmsurf->sequence_number++;
drmdpy->event_handler->invalid_surface(&drmdpy->base,
&drmsurf->base, drmsurf->sequence_number);
return TRUE;
}
static void
drm_surface_wait(struct native_surface *nsurf)
{
/* no-op */
}
static void
drm_surface_destroy(struct native_surface *nsurf)
{
struct drm_surface *drmsurf = drm_surface(nsurf);
if (drmsurf->current_crtc.crtc)
drmModeFreeCrtc(drmsurf->current_crtc.crtc);
if (drmsurf->front_fb.buffer_id)
drmModeRmFB(drmsurf->drmdpy->fd, drmsurf->front_fb.buffer_id);
pipe_resource_reference(&drmsurf->front_fb.texture, NULL);
if (drmsurf->back_fb.buffer_id)
drmModeRmFB(drmsurf->drmdpy->fd, drmsurf->back_fb.buffer_id);
pipe_resource_reference(&drmsurf->back_fb.texture, NULL);
resource_surface_destroy(drmsurf->rsurf);
FREE(drmsurf);
}
static struct drm_surface *
drm_display_create_surface(struct native_display *ndpy,
const struct native_config *nconf,
uint width, uint height)
{
struct drm_display *drmdpy = drm_display(ndpy);
struct drm_config *drmconf = drm_config(nconf);
struct drm_surface *drmsurf;
drmsurf = CALLOC_STRUCT(drm_surface);
if (!drmsurf)
return NULL;
drmsurf->drmdpy = drmdpy;
drmsurf->color_format = drmconf->base.color_format;
drmsurf->width = width;
drmsurf->height = height;
drmsurf->rsurf = resource_surface_create(drmdpy->base.screen,
drmsurf->color_format,
PIPE_BIND_RENDER_TARGET |
PIPE_BIND_SAMPLER_VIEW |
PIPE_BIND_DISPLAY_TARGET |
PIPE_BIND_SCANOUT);
if (!drmsurf->rsurf) {
FREE(drmsurf);
return NULL;
}
resource_surface_set_size(drmsurf->rsurf, drmsurf->width, drmsurf->height);
drmsurf->base.destroy = drm_surface_destroy;
drmsurf->base.swap_buffers = drm_surface_swap_buffers;
drmsurf->base.flush_frontbuffer = drm_surface_flush_frontbuffer;
drmsurf->base.validate = drm_surface_validate;
drmsurf->base.wait = drm_surface_wait;
return drmsurf;
}
/**
* Choose a CRTC that supports all given connectors.
*/
static uint32_t
drm_display_choose_crtc(struct native_display *ndpy,
uint32_t *connectors, int num_connectors)
{
struct drm_display *drmdpy = drm_display(ndpy);
int idx;
for (idx = 0; idx < drmdpy->resources->count_crtcs; idx++) {
boolean found_crtc = TRUE;
int i, j;
for (i = 0; i < num_connectors; i++) {
drmModeConnectorPtr connector;
int encoder_idx = -1;
connector = drmModeGetConnector(drmdpy->fd, connectors[i]);
if (!connector) {
found_crtc = FALSE;
break;
}
/* find an encoder the CRTC supports */
for (j = 0; j < connector->count_encoders; j++) {
drmModeEncoderPtr encoder =
drmModeGetEncoder(drmdpy->fd, connector->encoders[j]);
if (encoder->possible_crtcs & (1 << idx)) {
encoder_idx = j;
break;
}
drmModeFreeEncoder(encoder);
}
drmModeFreeConnector(connector);
if (encoder_idx < 0) {
found_crtc = FALSE;
break;
}
}
if (found_crtc)
break;
}
if (idx >= drmdpy->resources->count_crtcs) {
_eglLog(_EGL_WARNING,
"failed to find a CRTC that supports the given %d connectors",
num_connectors);
return 0;
}
return drmdpy->resources->crtcs[idx];
}
/**
* Remember the original CRTC status and set the CRTC
*/
static boolean
drm_display_set_crtc(struct native_display *ndpy, int crtc_idx,
uint32_t buffer_id, uint32_t x, uint32_t y,
uint32_t *connectors, int num_connectors,
drmModeModeInfoPtr mode)
{
struct drm_display *drmdpy = drm_display(ndpy);
struct drm_crtc *drmcrtc = &drmdpy->saved_crtcs[crtc_idx];
uint32_t crtc_id;
int err;
if (drmcrtc->crtc) {
crtc_id = drmcrtc->crtc->crtc_id;
}
else {
int count = 0, i;
/*
* Choose the CRTC once. It could be more dynamic, but let's keep it
* simple for now.
*/
crtc_id = drm_display_choose_crtc(&drmdpy->base,
connectors, num_connectors);
/* save the original CRTC status */
drmcrtc->crtc = drmModeGetCrtc(drmdpy->fd, crtc_id);
if (!drmcrtc->crtc)
return FALSE;
for (i = 0; i < drmdpy->num_connectors; i++) {
struct drm_connector *drmconn = &drmdpy->connectors[i];
drmModeConnectorPtr connector = drmconn->connector;
drmModeEncoderPtr encoder;
encoder = drmModeGetEncoder(drmdpy->fd, connector->encoder_id);
if (encoder) {
if (encoder->crtc_id == crtc_id) {
drmcrtc->connectors[count++] = connector->connector_id;
if (count >= Elements(drmcrtc->connectors))
break;
}
drmModeFreeEncoder(encoder);
}
}
drmcrtc->num_connectors = count;
}
err = drmModeSetCrtc(drmdpy->fd, crtc_id, buffer_id, x, y,
connectors, num_connectors, mode);
if (err) {
drmModeFreeCrtc(drmcrtc->crtc);
drmcrtc->crtc = NULL;
drmcrtc->num_connectors = 0;
return FALSE;
}
return TRUE;
}
static boolean
drm_display_program(struct native_display *ndpy, int crtc_idx,
struct native_surface *nsurf, uint x, uint y,
const struct native_connector **nconns, int num_nconns,
const struct native_mode *nmode)
{
struct drm_display *drmdpy = drm_display(ndpy);
struct drm_surface *drmsurf = drm_surface(nsurf);
const struct drm_mode *drmmode = drm_mode(nmode);
uint32_t connector_ids[32];
uint32_t buffer_id;
drmModeModeInfo mode_tmp, *mode;
int i;
if (num_nconns > Elements(connector_ids)) {
_eglLog(_EGL_WARNING, "too many connectors (%d)", num_nconns);
num_nconns = Elements(connector_ids);
}
if (drmsurf) {
if (!drm_surface_init_framebuffers(&drmsurf->base, FALSE))
return FALSE;
buffer_id = drmsurf->front_fb.buffer_id;
/* the mode argument of drmModeSetCrtc is not constified */
mode_tmp = drmmode->mode;
mode = &mode_tmp;
}
else {
/* disable the CRTC */
buffer_id = 0;
mode = NULL;
num_nconns = 0;
}
for (i = 0; i < num_nconns; i++) {
struct drm_connector *drmconn = drm_connector(nconns[i]);
connector_ids[i] = drmconn->connector->connector_id;
}
if (!drm_display_set_crtc(&drmdpy->base, crtc_idx, buffer_id, x, y,
connector_ids, num_nconns, mode)) {
_eglLog(_EGL_WARNING, "failed to set CRTC %d", crtc_idx);
return FALSE;
}
if (drmdpy->shown_surfaces[crtc_idx])
drmdpy->shown_surfaces[crtc_idx]->is_shown = FALSE;
drmdpy->shown_surfaces[crtc_idx] = drmsurf;
/* remember the settings for buffer swapping */
if (drmsurf) {
uint32_t crtc_id = drmdpy->saved_crtcs[crtc_idx].crtc->crtc_id;
struct drm_crtc *drmcrtc = &drmsurf->current_crtc;
if (drmcrtc->crtc)
drmModeFreeCrtc(drmcrtc->crtc);
drmcrtc->crtc = drmModeGetCrtc(drmdpy->fd, crtc_id);
assert(num_nconns < Elements(drmcrtc->connectors));
memcpy(drmcrtc->connectors, connector_ids,
sizeof(*connector_ids) * num_nconns);
drmcrtc->num_connectors = num_nconns;
drmsurf->is_shown = TRUE;
}
return TRUE;
}
static const struct native_mode **
drm_display_get_modes(struct native_display *ndpy,
const struct native_connector *nconn,
int *num_modes)
{
struct drm_display *drmdpy = drm_display(ndpy);
struct drm_connector *drmconn = drm_connector(nconn);
const struct native_mode **nmodes_return;
int count, i;
/* delete old data */
if (drmconn->connector) {
drmModeFreeConnector(drmconn->connector);
FREE(drmconn->drm_modes);
drmconn->connector = NULL;
drmconn->drm_modes = NULL;
drmconn->num_modes = 0;
}
/* detect again */
drmconn->connector = drmModeGetConnector(drmdpy->fd, drmconn->connector_id);
if (!drmconn->connector)
return NULL;
count = drmconn->connector->count_modes;
drmconn->drm_modes = CALLOC(count, sizeof(*drmconn->drm_modes));
if (!drmconn->drm_modes) {
drmModeFreeConnector(drmconn->connector);
drmconn->connector = NULL;
return NULL;
}
for (i = 0; i < count; i++) {
struct drm_mode *drmmode = &drmconn->drm_modes[i];
drmModeModeInfoPtr mode = &drmconn->connector->modes[i];
drmmode->mode = *mode;
drmmode->base.desc = drmmode->mode.name;
drmmode->base.width = drmmode->mode.hdisplay;
drmmode->base.height = drmmode->mode.vdisplay;
drmmode->base.refresh_rate = drmmode->mode.vrefresh;
/* not all kernels have vrefresh = refresh_rate * 1000 */
if (drmmode->base.refresh_rate > 1000)
drmmode->base.refresh_rate = (drmmode->base.refresh_rate + 500) / 1000;
}
nmodes_return = MALLOC(count * sizeof(*nmodes_return));
if (nmodes_return) {
for (i = 0; i < count; i++)
nmodes_return[i] = &drmconn->drm_modes[i].base;
if (num_modes)
*num_modes = count;
}
return nmodes_return;
}
static const struct native_connector **
drm_display_get_connectors(struct native_display *ndpy, int *num_connectors,
int *num_crtc)
{
struct drm_display *drmdpy = drm_display(ndpy);
const struct native_connector **connectors;
int i;
if (!drmdpy->connectors) {
drmdpy->connectors =
CALLOC(drmdpy->resources->count_connectors, sizeof(*drmdpy->connectors));
if (!drmdpy->connectors)
return NULL;
for (i = 0; i < drmdpy->resources->count_connectors; i++) {
struct drm_connector *drmconn = &drmdpy->connectors[i];
drmconn->connector_id = drmdpy->resources->connectors[i];
/* drmconn->connector is allocated when the modes are asked */
}
drmdpy->num_connectors = drmdpy->resources->count_connectors;
}
connectors = MALLOC(drmdpy->num_connectors * sizeof(*connectors));
if (connectors) {
for (i = 0; i < drmdpy->num_connectors; i++)
connectors[i] = &drmdpy->connectors[i].base;
if (num_connectors)
*num_connectors = drmdpy->num_connectors;
}
if (num_crtc)
*num_crtc = drmdpy->resources->count_crtcs;
return connectors;
}
static struct native_surface *
drm_display_create_scanout_surface(struct native_display *ndpy,
const struct native_config *nconf,
uint width, uint height)
{
struct drm_surface *drmsurf;
drmsurf = drm_display_create_surface(ndpy, nconf, width, height);
return &drmsurf->base;
}
static struct native_display_modeset drm_display_modeset = {
.get_connectors = drm_display_get_connectors,
.get_modes = drm_display_get_modes,
.create_scanout_surface = drm_display_create_scanout_surface,
.program = drm_display_program
};
void
drm_display_fini_modeset(struct native_display *ndpy)
{
struct drm_display *drmdpy = drm_display(ndpy);
int i;
if (drmdpy->connectors) {
for (i = 0; i < drmdpy->num_connectors; i++) {
struct drm_connector *drmconn = &drmdpy->connectors[i];
if (drmconn->connector) {
drmModeFreeConnector(drmconn->connector);
FREE(drmconn->drm_modes);
}
}
FREE(drmdpy->connectors);
}
if (drmdpy->shown_surfaces) {
FREE(drmdpy->shown_surfaces);
drmdpy->shown_surfaces = NULL;
}
if (drmdpy->saved_crtcs) {
for (i = 0; i < drmdpy->resources->count_crtcs; i++) {
struct drm_crtc *drmcrtc = &drmdpy->saved_crtcs[i];
if (drmcrtc->crtc) {
/* restore crtc */
drmModeSetCrtc(drmdpy->fd, drmcrtc->crtc->crtc_id,
drmcrtc->crtc->buffer_id, drmcrtc->crtc->x, drmcrtc->crtc->y,
drmcrtc->connectors, drmcrtc->num_connectors,
&drmcrtc->crtc->mode);
drmModeFreeCrtc(drmcrtc->crtc);
}
}
FREE(drmdpy->saved_crtcs);
}
if (drmdpy->resources) {
drmModeFreeResources(drmdpy->resources);
drmdpy->resources = NULL;
}
drmdpy->base.modeset = NULL;
}
boolean
drm_display_init_modeset(struct native_display *ndpy)
{
struct drm_display *drmdpy = drm_display(ndpy);
/* resources are fixed, unlike crtc, connector, or encoder */
drmdpy->resources = drmModeGetResources(drmdpy->fd);
if (!drmdpy->resources) {
_eglLog(_EGL_DEBUG, "Failed to get KMS resources. Disable modeset.");
return FALSE;
}
drmdpy->saved_crtcs =
CALLOC(drmdpy->resources->count_crtcs, sizeof(*drmdpy->saved_crtcs));
if (!drmdpy->saved_crtcs) {
drm_display_fini_modeset(&drmdpy->base);
return FALSE;
}
drmdpy->shown_surfaces =
CALLOC(drmdpy->resources->count_crtcs, sizeof(*drmdpy->shown_surfaces));
if (!drmdpy->shown_surfaces) {
drm_display_fini_modeset(&drmdpy->base);
return FALSE;
}
drmdpy->base.modeset = &drm_display_modeset;
return TRUE;
}

View File

@@ -0,0 +1,240 @@
/*
* Mesa 3-D graphics library
* Version: 7.8
*
* Copyright (C) 2010 Chia-I Wu <olv@0xlab.org>
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include "util/u_memory.h"
#include "egllog.h"
#include "native_drm.h"
/* see get_drm_screen_name */
#include <radeon_drm.h>
#include "radeon/drm/radeon_drm.h"
static boolean
drm_display_is_format_supported(struct native_display *ndpy,
enum pipe_format fmt, boolean is_color)
{
return ndpy->screen->is_format_supported(ndpy->screen,
fmt, PIPE_TEXTURE_2D, 0,
(is_color) ? PIPE_BIND_RENDER_TARGET :
PIPE_BIND_DEPTH_STENCIL, 0);
}
static const struct native_config **
drm_display_get_configs(struct native_display *ndpy, int *num_configs)
{
struct drm_display *drmdpy = drm_display(ndpy);
const struct native_config **configs;
/* first time */
if (!drmdpy->config) {
struct native_config *nconf;
enum pipe_format format;
drmdpy->config = CALLOC(1, sizeof(*drmdpy->config));
if (!drmdpy->config)
return NULL;
nconf = &drmdpy->config->base;
nconf->buffer_mask =
(1 << NATIVE_ATTACHMENT_FRONT_LEFT) |
(1 << NATIVE_ATTACHMENT_BACK_LEFT);
format = PIPE_FORMAT_B8G8R8A8_UNORM;
if (!drm_display_is_format_supported(&drmdpy->base, format, TRUE)) {
format = PIPE_FORMAT_A8R8G8B8_UNORM;
if (!drm_display_is_format_supported(&drmdpy->base, format, TRUE))
format = PIPE_FORMAT_NONE;
}
if (format == PIPE_FORMAT_NONE) {
FREE(drmdpy->config);
drmdpy->config = NULL;
return NULL;
}
nconf->color_format = format;
/* support KMS */
if (drmdpy->resources)
nconf->scanout_bit = TRUE;
}
configs = MALLOC(sizeof(*configs));
if (configs) {
configs[0] = &drmdpy->config->base;
if (num_configs)
*num_configs = 1;
}
return configs;
}
static int
drm_display_get_param(struct native_display *ndpy,
enum native_param_type param)
{
int val;
switch (param) {
default:
val = 0;
break;
}
return val;
}
static void
drm_display_destroy(struct native_display *ndpy)
{
struct drm_display *drmdpy = drm_display(ndpy);
if (drmdpy->config)
FREE(drmdpy->config);
drm_display_fini_modeset(&drmdpy->base);
if (drmdpy->base.screen)
drmdpy->base.screen->destroy(drmdpy->base.screen);
if (drmdpy->fd >= 0)
close(drmdpy->fd);
FREE(drmdpy);
}
static const char *
get_drm_screen_name(int fd, drmVersionPtr version)
{
const char *name = version->name;
if (name && !strcmp(name, "radeon")) {
int chip_id;
struct drm_radeon_info info;
memset(&info, 0, sizeof(info));
info.request = RADEON_INFO_DEVICE_ID;
info.value = pointer_to_intptr(&chip_id);
if (drmCommandWriteRead(fd, DRM_RADEON_INFO, &info, sizeof(info)) != 0)
return NULL;
name = is_r3xx(chip_id) ? "r300" : "r600";
}
return name;
}
/**
* Initialize KMS and pipe screen.
*/
static boolean
drm_display_init_screen(struct native_display *ndpy)
{
struct drm_display *drmdpy = drm_display(ndpy);
drmVersionPtr version;
const char *name;
version = drmGetVersion(drmdpy->fd);
if (!version) {
_eglLog(_EGL_WARNING, "invalid fd %d", drmdpy->fd);
return FALSE;
}
name = get_drm_screen_name(drmdpy->fd, version);
if (name) {
drmdpy->base.screen =
drmdpy->event_handler->new_drm_screen(&drmdpy->base, name, drmdpy->fd);
}
drmFreeVersion(version);
if (!drmdpy->base.screen) {
_eglLog(_EGL_WARNING, "failed to create DRM screen");
return FALSE;
}
return TRUE;
}
static struct native_display *
drm_create_display(int fd, struct native_event_handler *event_handler,
void *user_data)
{
struct drm_display *drmdpy;
drmdpy = CALLOC_STRUCT(drm_display);
if (!drmdpy)
return NULL;
drmdpy->fd = fd;
drmdpy->event_handler = event_handler;
drmdpy->base.user_data = user_data;
if (!drm_display_init_screen(&drmdpy->base)) {
drm_display_destroy(&drmdpy->base);
return NULL;
}
drmdpy->base.destroy = drm_display_destroy;
drmdpy->base.get_param = drm_display_get_param;
drmdpy->base.get_configs = drm_display_get_configs;
drm_display_init_modeset(&drmdpy->base);
return &drmdpy->base;
}
static struct native_display *
native_create_display(void *dpy, struct native_event_handler *event_handler,
void *user_data)
{
int fd;
if (dpy) {
fd = dup((int) pointer_to_intptr(dpy));
}
else {
fd = open("/dev/dri/card0", O_RDWR);
}
if (fd < 0)
return NULL;
return drm_create_display(fd, event_handler, user_data);
}
static const struct native_platform drm_platform = {
"DRM", /* name */
native_create_display
};
const struct native_platform *
native_get_drm_platform(void)
{
return &drm_platform;
}

View File

@@ -23,8 +23,8 @@
* DEALINGS IN THE SOFTWARE.
*/
#ifndef _NATIVE_KMS_H_
#define _NATIVE_KMS_H_
#ifndef _NATIVE_DRM_H_
#define _NATIVE_DRM_H_
#include <xf86drm.h>
#include <xf86drmMode.h>
@@ -37,101 +37,110 @@
#include "common/native.h"
#include "common/native_helper.h"
struct kms_config;
struct kms_connector;
struct kms_mode;
struct drm_config;
struct drm_crtc;
struct drm_connector;
struct drm_mode;
struct drm_surface;
struct kms_crtc {
drmModeCrtcPtr crtc;
uint32_t connectors[32];
int num_connectors;
};
struct kms_display {
struct drm_display {
struct native_display base;
struct native_event_handler *event_handler;
int fd;
drmModeResPtr resources;
struct kms_config *config;
struct drm_config *config;
struct kms_connector *connectors;
/* for modesetting */
drmModeResPtr resources;
struct drm_connector *connectors;
int num_connectors;
struct kms_surface **shown_surfaces;
struct drm_surface **shown_surfaces;
/* save the original settings of the CRTCs */
struct kms_crtc *saved_crtcs;
struct drm_crtc *saved_crtcs;
};
struct kms_framebuffer {
struct drm_config {
struct native_config base;
};
struct drm_crtc {
drmModeCrtcPtr crtc;
uint32_t connectors[32];
int num_connectors;
};
struct drm_framebuffer {
struct pipe_resource *texture;
boolean is_passive;
uint32_t buffer_id;
};
struct kms_surface {
struct drm_surface {
struct native_surface base;
struct kms_display *kdpy;
struct drm_display *drmdpy;
struct resource_surface *rsurf;
enum pipe_format color_format;
int width, height;
unsigned int sequence_number;
struct kms_framebuffer front_fb, back_fb;
struct drm_framebuffer front_fb, back_fb;
boolean is_shown;
struct kms_crtc current_crtc;
struct drm_crtc current_crtc;
};
struct kms_config {
struct native_config base;
};
struct kms_connector {
struct drm_connector {
struct native_connector base;
uint32_t connector_id;
drmModeConnectorPtr connector;
struct kms_mode *kms_modes;
struct drm_mode *drm_modes;
int num_modes;
};
struct kms_mode {
struct drm_mode {
struct native_mode base;
drmModeModeInfo mode;
};
static INLINE struct kms_display *
kms_display(const struct native_display *ndpy)
static INLINE struct drm_display *
drm_display(const struct native_display *ndpy)
{
return (struct kms_display *) ndpy;
return (struct drm_display *) ndpy;
}
static INLINE struct kms_surface *
kms_surface(const struct native_surface *nsurf)
static INLINE struct drm_config *
drm_config(const struct native_config *nconf)
{
return (struct kms_surface *) nsurf;
return (struct drm_config *) nconf;
}
static INLINE struct kms_config *
kms_config(const struct native_config *nconf)
static INLINE struct drm_surface *
drm_surface(const struct native_surface *nsurf)
{
return (struct kms_config *) nconf;
return (struct drm_surface *) nsurf;
}
static INLINE struct kms_connector *
kms_connector(const struct native_connector *nconn)
static INLINE struct drm_connector *
drm_connector(const struct native_connector *nconn)
{
return (struct kms_connector *) nconn;
return (struct drm_connector *) nconn;
}
static INLINE struct kms_mode *
kms_mode(const struct native_mode *nmode)
static INLINE struct drm_mode *
drm_mode(const struct native_mode *nmode)
{
return (struct kms_mode *) nmode;
return (struct drm_mode *) nmode;
}
#endif /* _NATIVE_KMS_H_ */
boolean
drm_display_init_modeset(struct native_display *ndpy);
void
drm_display_fini_modeset(struct native_display *ndpy);
#endif /* _NATIVE_DRM_H_ */

View File

@@ -1,808 +0,0 @@
/*
* Mesa 3-D graphics library
* Version: 7.8
*
* Copyright (C) 2010 Chia-I Wu <olv@0xlab.org>
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include "pipe/p_screen.h"
#include "pipe/p_context.h"
#include "util/u_debug.h"
#include "util/u_memory.h"
#include "util/u_inlines.h"
#include "util/u_pointer.h"
#include "util/u_string.h"
#include "egllog.h"
#include "native_kms.h"
/* see get_drm_screen_name */
#include <radeon_drm.h>
#include "radeon/drm/radeon_drm.h"
static boolean
kms_surface_validate(struct native_surface *nsurf, uint attachment_mask,
unsigned int *seq_num, struct pipe_resource **textures,
int *width, int *height)
{
struct kms_surface *ksurf = kms_surface(nsurf);
if (!resource_surface_add_resources(ksurf->rsurf, attachment_mask))
return FALSE;
if (textures)
resource_surface_get_resources(ksurf->rsurf, textures, attachment_mask);
if (seq_num)
*seq_num = ksurf->sequence_number;
if (width)
*width = ksurf->width;
if (height)
*height = ksurf->height;
return TRUE;
}
/**
* Add textures as DRM framebuffers.
*/
static boolean
kms_surface_init_framebuffers(struct native_surface *nsurf, boolean need_back)
{
struct kms_surface *ksurf = kms_surface(nsurf);
struct kms_display *kdpy = ksurf->kdpy;
int num_framebuffers = (need_back) ? 2 : 1;
int i, err;
for (i = 0; i < num_framebuffers; i++) {
struct kms_framebuffer *fb;
enum native_attachment natt;
struct winsys_handle whandle;
uint block_bits;
if (i == 0) {
fb = &ksurf->front_fb;
natt = NATIVE_ATTACHMENT_FRONT_LEFT;
}
else {
fb = &ksurf->back_fb;
natt = NATIVE_ATTACHMENT_BACK_LEFT;
}
if (!fb->texture) {
/* make sure the texture has been allocated */
resource_surface_add_resources(ksurf->rsurf, 1 << natt);
fb->texture =
resource_surface_get_single_resource(ksurf->rsurf, natt);
if (!fb->texture)
return FALSE;
}
/* already initialized */
if (fb->buffer_id)
continue;
/* TODO detect the real value */
fb->is_passive = TRUE;
memset(&whandle, 0, sizeof(whandle));
whandle.type = DRM_API_HANDLE_TYPE_KMS;
if (!kdpy->base.screen->resource_get_handle(kdpy->base.screen,
fb->texture, &whandle))
return FALSE;
block_bits = util_format_get_blocksizebits(ksurf->color_format);
err = drmModeAddFB(kdpy->fd, ksurf->width, ksurf->height,
block_bits, block_bits, whandle.stride, whandle.handle,
&fb->buffer_id);
if (err) {
fb->buffer_id = 0;
return FALSE;
}
}
return TRUE;
}
static boolean
kms_surface_flush_frontbuffer(struct native_surface *nsurf)
{
#ifdef DRM_MODE_FEATURE_DIRTYFB
struct kms_surface *ksurf = kms_surface(nsurf);
struct kms_display *kdpy = ksurf->kdpy;
if (ksurf->front_fb.is_passive)
drmModeDirtyFB(kdpy->fd, ksurf->front_fb.buffer_id, NULL, 0);
#endif
return TRUE;
}
static boolean
kms_surface_swap_buffers(struct native_surface *nsurf)
{
struct kms_surface *ksurf = kms_surface(nsurf);
struct kms_crtc *kcrtc = &ksurf->current_crtc;
struct kms_display *kdpy = ksurf->kdpy;
struct kms_framebuffer tmp_fb;
int err;
if (!ksurf->back_fb.buffer_id) {
if (!kms_surface_init_framebuffers(&ksurf->base, TRUE))
return FALSE;
}
if (ksurf->is_shown && kcrtc->crtc) {
err = drmModeSetCrtc(kdpy->fd, kcrtc->crtc->crtc_id,
ksurf->back_fb.buffer_id, kcrtc->crtc->x, kcrtc->crtc->y,
kcrtc->connectors, kcrtc->num_connectors, &kcrtc->crtc->mode);
if (err)
return FALSE;
}
/* swap the buffers */
tmp_fb = ksurf->front_fb;
ksurf->front_fb = ksurf->back_fb;
ksurf->back_fb = tmp_fb;
resource_surface_swap_buffers(ksurf->rsurf,
NATIVE_ATTACHMENT_FRONT_LEFT, NATIVE_ATTACHMENT_BACK_LEFT, FALSE);
/* the front/back textures are swapped */
ksurf->sequence_number++;
kdpy->event_handler->invalid_surface(&kdpy->base,
&ksurf->base, ksurf->sequence_number);
return TRUE;
}
static void
kms_surface_wait(struct native_surface *nsurf)
{
/* no-op */
}
static void
kms_surface_destroy(struct native_surface *nsurf)
{
struct kms_surface *ksurf = kms_surface(nsurf);
if (ksurf->current_crtc.crtc)
drmModeFreeCrtc(ksurf->current_crtc.crtc);
if (ksurf->front_fb.buffer_id)
drmModeRmFB(ksurf->kdpy->fd, ksurf->front_fb.buffer_id);
pipe_resource_reference(&ksurf->front_fb.texture, NULL);
if (ksurf->back_fb.buffer_id)
drmModeRmFB(ksurf->kdpy->fd, ksurf->back_fb.buffer_id);
pipe_resource_reference(&ksurf->back_fb.texture, NULL);
resource_surface_destroy(ksurf->rsurf);
FREE(ksurf);
}
static struct kms_surface *
kms_display_create_surface(struct native_display *ndpy,
const struct native_config *nconf,
uint width, uint height)
{
struct kms_display *kdpy = kms_display(ndpy);
struct kms_config *kconf = kms_config(nconf);
struct kms_surface *ksurf;
ksurf = CALLOC_STRUCT(kms_surface);
if (!ksurf)
return NULL;
ksurf->kdpy = kdpy;
ksurf->color_format = kconf->base.color_format;
ksurf->width = width;
ksurf->height = height;
ksurf->rsurf = resource_surface_create(kdpy->base.screen,
ksurf->color_format,
PIPE_BIND_RENDER_TARGET |
PIPE_BIND_SAMPLER_VIEW |
PIPE_BIND_DISPLAY_TARGET |
PIPE_BIND_SCANOUT);
if (!ksurf->rsurf) {
FREE(ksurf);
return NULL;
}
resource_surface_set_size(ksurf->rsurf, ksurf->width, ksurf->height);
ksurf->base.destroy = kms_surface_destroy;
ksurf->base.swap_buffers = kms_surface_swap_buffers;
ksurf->base.flush_frontbuffer = kms_surface_flush_frontbuffer;
ksurf->base.validate = kms_surface_validate;
ksurf->base.wait = kms_surface_wait;
return ksurf;
}
/**
* Choose a CRTC that supports all given connectors.
*/
static uint32_t
kms_display_choose_crtc(struct native_display *ndpy,
uint32_t *connectors, int num_connectors)
{
struct kms_display *kdpy = kms_display(ndpy);
int idx;
for (idx = 0; idx < kdpy->resources->count_crtcs; idx++) {
boolean found_crtc = TRUE;
int i, j;
for (i = 0; i < num_connectors; i++) {
drmModeConnectorPtr connector;
int encoder_idx = -1;
connector = drmModeGetConnector(kdpy->fd, connectors[i]);
if (!connector) {
found_crtc = FALSE;
break;
}
/* find an encoder the CRTC supports */
for (j = 0; j < connector->count_encoders; j++) {
drmModeEncoderPtr encoder =
drmModeGetEncoder(kdpy->fd, connector->encoders[j]);
if (encoder->possible_crtcs & (1 << idx)) {
encoder_idx = j;
break;
}
drmModeFreeEncoder(encoder);
}
drmModeFreeConnector(connector);
if (encoder_idx < 0) {
found_crtc = FALSE;
break;
}
}
if (found_crtc)
break;
}
if (idx >= kdpy->resources->count_crtcs) {
_eglLog(_EGL_WARNING,
"failed to find a CRTC that supports the given %d connectors",
num_connectors);
return 0;
}
return kdpy->resources->crtcs[idx];
}
/**
* Remember the original CRTC status and set the CRTC
*/
static boolean
kms_display_set_crtc(struct native_display *ndpy, int crtc_idx,
uint32_t buffer_id, uint32_t x, uint32_t y,
uint32_t *connectors, int num_connectors,
drmModeModeInfoPtr mode)
{
struct kms_display *kdpy = kms_display(ndpy);
struct kms_crtc *kcrtc = &kdpy->saved_crtcs[crtc_idx];
uint32_t crtc_id;
int err;
if (kcrtc->crtc) {
crtc_id = kcrtc->crtc->crtc_id;
}
else {
int count = 0, i;
/*
* Choose the CRTC once. It could be more dynamic, but let's keep it
* simple for now.
*/
crtc_id = kms_display_choose_crtc(&kdpy->base,
connectors, num_connectors);
/* save the original CRTC status */
kcrtc->crtc = drmModeGetCrtc(kdpy->fd, crtc_id);
if (!kcrtc->crtc)
return FALSE;
for (i = 0; i < kdpy->num_connectors; i++) {
struct kms_connector *kconn = &kdpy->connectors[i];
drmModeConnectorPtr connector = kconn->connector;
drmModeEncoderPtr encoder;
encoder = drmModeGetEncoder(kdpy->fd, connector->encoder_id);
if (encoder) {
if (encoder->crtc_id == crtc_id) {
kcrtc->connectors[count++] = connector->connector_id;
if (count >= Elements(kcrtc->connectors))
break;
}
drmModeFreeEncoder(encoder);
}
}
kcrtc->num_connectors = count;
}
err = drmModeSetCrtc(kdpy->fd, crtc_id, buffer_id, x, y,
connectors, num_connectors, mode);
if (err) {
drmModeFreeCrtc(kcrtc->crtc);
kcrtc->crtc = NULL;
kcrtc->num_connectors = 0;
return FALSE;
}
return TRUE;
}
static boolean
kms_display_program(struct native_display *ndpy, int crtc_idx,
struct native_surface *nsurf, uint x, uint y,
const struct native_connector **nconns, int num_nconns,
const struct native_mode *nmode)
{
struct kms_display *kdpy = kms_display(ndpy);
struct kms_surface *ksurf = kms_surface(nsurf);
const struct kms_mode *kmode = kms_mode(nmode);
uint32_t connector_ids[32];
uint32_t buffer_id;
drmModeModeInfo mode_tmp, *mode;
int i;
if (num_nconns > Elements(connector_ids)) {
_eglLog(_EGL_WARNING, "too many connectors (%d)", num_nconns);
num_nconns = Elements(connector_ids);
}
if (ksurf) {
if (!kms_surface_init_framebuffers(&ksurf->base, FALSE))
return FALSE;
buffer_id = ksurf->front_fb.buffer_id;
/* the mode argument of drmModeSetCrtc is not constified */
mode_tmp = kmode->mode;
mode = &mode_tmp;
}
else {
/* disable the CRTC */
buffer_id = 0;
mode = NULL;
num_nconns = 0;
}
for (i = 0; i < num_nconns; i++) {
struct kms_connector *kconn = kms_connector(nconns[i]);
connector_ids[i] = kconn->connector->connector_id;
}
if (!kms_display_set_crtc(&kdpy->base, crtc_idx, buffer_id, x, y,
connector_ids, num_nconns, mode)) {
_eglLog(_EGL_WARNING, "failed to set CRTC %d", crtc_idx);
return FALSE;
}
if (kdpy->shown_surfaces[crtc_idx])
kdpy->shown_surfaces[crtc_idx]->is_shown = FALSE;
kdpy->shown_surfaces[crtc_idx] = ksurf;
/* remember the settings for buffer swapping */
if (ksurf) {
uint32_t crtc_id = kdpy->saved_crtcs[crtc_idx].crtc->crtc_id;
struct kms_crtc *kcrtc = &ksurf->current_crtc;
if (kcrtc->crtc)
drmModeFreeCrtc(kcrtc->crtc);
kcrtc->crtc = drmModeGetCrtc(kdpy->fd, crtc_id);
assert(num_nconns < Elements(kcrtc->connectors));
memcpy(kcrtc->connectors, connector_ids,
sizeof(*connector_ids) * num_nconns);
kcrtc->num_connectors = num_nconns;
ksurf->is_shown = TRUE;
}
return TRUE;
}
static const struct native_mode **
kms_display_get_modes(struct native_display *ndpy,
const struct native_connector *nconn,
int *num_modes)
{
struct kms_display *kdpy = kms_display(ndpy);
struct kms_connector *kconn = kms_connector(nconn);
const struct native_mode **nmodes_return;
int count, i;
/* delete old data */
if (kconn->connector) {
drmModeFreeConnector(kconn->connector);
FREE(kconn->kms_modes);
kconn->connector = NULL;
kconn->kms_modes = NULL;
kconn->num_modes = 0;
}
/* detect again */
kconn->connector = drmModeGetConnector(kdpy->fd, kconn->connector_id);
if (!kconn->connector)
return NULL;
count = kconn->connector->count_modes;
kconn->kms_modes = CALLOC(count, sizeof(*kconn->kms_modes));
if (!kconn->kms_modes) {
drmModeFreeConnector(kconn->connector);
kconn->connector = NULL;
return NULL;
}
for (i = 0; i < count; i++) {
struct kms_mode *kmode = &kconn->kms_modes[i];
drmModeModeInfoPtr mode = &kconn->connector->modes[i];
kmode->mode = *mode;
kmode->base.desc = kmode->mode.name;
kmode->base.width = kmode->mode.hdisplay;
kmode->base.height = kmode->mode.vdisplay;
kmode->base.refresh_rate = kmode->mode.vrefresh;
/* not all kernels have vrefresh = refresh_rate * 1000 */
if (kmode->base.refresh_rate > 1000)
kmode->base.refresh_rate = (kmode->base.refresh_rate + 500) / 1000;
}
nmodes_return = MALLOC(count * sizeof(*nmodes_return));
if (nmodes_return) {
for (i = 0; i < count; i++)
nmodes_return[i] = &kconn->kms_modes[i].base;
if (num_modes)
*num_modes = count;
}
return nmodes_return;
}
static const struct native_connector **
kms_display_get_connectors(struct native_display *ndpy, int *num_connectors,
int *num_crtc)
{
struct kms_display *kdpy = kms_display(ndpy);
const struct native_connector **connectors;
int i;
if (!kdpy->connectors) {
kdpy->connectors =
CALLOC(kdpy->resources->count_connectors, sizeof(*kdpy->connectors));
if (!kdpy->connectors)
return NULL;
for (i = 0; i < kdpy->resources->count_connectors; i++) {
struct kms_connector *kconn = &kdpy->connectors[i];
kconn->connector_id = kdpy->resources->connectors[i];
/* kconn->connector is allocated when the modes are asked */
}
kdpy->num_connectors = kdpy->resources->count_connectors;
}
connectors = MALLOC(kdpy->num_connectors * sizeof(*connectors));
if (connectors) {
for (i = 0; i < kdpy->num_connectors; i++)
connectors[i] = &kdpy->connectors[i].base;
if (num_connectors)
*num_connectors = kdpy->num_connectors;
}
if (num_crtc)
*num_crtc = kdpy->resources->count_crtcs;
return connectors;
}
static struct native_surface *
kms_display_create_scanout_surface(struct native_display *ndpy,
const struct native_config *nconf,
uint width, uint height)
{
struct kms_surface *ksurf;
ksurf = kms_display_create_surface(ndpy, nconf, width, height);
return &ksurf->base;
}
static boolean
kms_display_is_format_supported(struct native_display *ndpy,
enum pipe_format fmt, boolean is_color)
{
return ndpy->screen->is_format_supported(ndpy->screen,
fmt, PIPE_TEXTURE_2D, 0,
(is_color) ? PIPE_BIND_RENDER_TARGET :
PIPE_BIND_DEPTH_STENCIL, 0);
}
static const struct native_config **
kms_display_get_configs(struct native_display *ndpy, int *num_configs)
{
struct kms_display *kdpy = kms_display(ndpy);
const struct native_config **configs;
/* first time */
if (!kdpy->config) {
struct native_config *nconf;
enum pipe_format format;
kdpy->config = CALLOC(1, sizeof(*kdpy->config));
if (!kdpy->config)
return NULL;
nconf = &kdpy->config->base;
nconf->buffer_mask =
(1 << NATIVE_ATTACHMENT_FRONT_LEFT) |
(1 << NATIVE_ATTACHMENT_BACK_LEFT);
format = PIPE_FORMAT_B8G8R8A8_UNORM;
if (!kms_display_is_format_supported(&kdpy->base, format, TRUE)) {
format = PIPE_FORMAT_A8R8G8B8_UNORM;
if (!kms_display_is_format_supported(&kdpy->base, format, TRUE))
format = PIPE_FORMAT_NONE;
}
if (format == PIPE_FORMAT_NONE) {
FREE(kdpy->config);
kdpy->config = NULL;
return NULL;
}
nconf->color_format = format;
/* support KMS */
if (kdpy->resources)
nconf->scanout_bit = TRUE;
}
configs = MALLOC(sizeof(*configs));
if (configs) {
configs[0] = &kdpy->config->base;
if (num_configs)
*num_configs = 1;
}
return configs;
}
static int
kms_display_get_param(struct native_display *ndpy,
enum native_param_type param)
{
int val;
switch (param) {
default:
val = 0;
break;
}
return val;
}
static void
kms_display_destroy(struct native_display *ndpy)
{
struct kms_display *kdpy = kms_display(ndpy);
int i;
if (kdpy->config)
FREE(kdpy->config);
if (kdpy->connectors) {
for (i = 0; i < kdpy->num_connectors; i++) {
struct kms_connector *kconn = &kdpy->connectors[i];
if (kconn->connector) {
drmModeFreeConnector(kconn->connector);
FREE(kconn->kms_modes);
}
}
FREE(kdpy->connectors);
}
if (kdpy->shown_surfaces)
FREE(kdpy->shown_surfaces);
if (kdpy->saved_crtcs) {
for (i = 0; i < kdpy->resources->count_crtcs; i++) {
struct kms_crtc *kcrtc = &kdpy->saved_crtcs[i];
if (kcrtc->crtc) {
/* restore crtc */
drmModeSetCrtc(kdpy->fd, kcrtc->crtc->crtc_id,
kcrtc->crtc->buffer_id, kcrtc->crtc->x, kcrtc->crtc->y,
kcrtc->connectors, kcrtc->num_connectors,
&kcrtc->crtc->mode);
drmModeFreeCrtc(kcrtc->crtc);
}
}
FREE(kdpy->saved_crtcs);
}
if (kdpy->resources)
drmModeFreeResources(kdpy->resources);
if (kdpy->base.screen)
kdpy->base.screen->destroy(kdpy->base.screen);
if (kdpy->fd >= 0)
close(kdpy->fd);
FREE(kdpy);
}
static const char *
get_drm_screen_name(int fd, drmVersionPtr version)
{
const char *name = version->name;
if (name && !strcmp(name, "radeon")) {
int chip_id;
struct drm_radeon_info info;
memset(&info, 0, sizeof(info));
info.request = RADEON_INFO_DEVICE_ID;
info.value = pointer_to_intptr(&chip_id);
if (drmCommandWriteRead(fd, DRM_RADEON_INFO, &info, sizeof(info)) != 0)
return NULL;
name = is_r3xx(chip_id) ? "r300" : "r600";
}
return name;
}
/**
* Initialize KMS and pipe screen.
*/
static boolean
kms_display_init_screen(struct native_display *ndpy)
{
struct kms_display *kdpy = kms_display(ndpy);
drmVersionPtr version;
const char *name;
version = drmGetVersion(kdpy->fd);
if (!version) {
_eglLog(_EGL_WARNING, "invalid fd %d", kdpy->fd);
return FALSE;
}
name = get_drm_screen_name(kdpy->fd, version);
if (name) {
kdpy->base.screen =
kdpy->event_handler->new_drm_screen(&kdpy->base, name, kdpy->fd);
}
drmFreeVersion(version);
if (!kdpy->base.screen) {
_eglLog(_EGL_WARNING, "failed to create DRM screen");
return FALSE;
}
return TRUE;
}
static struct native_display_modeset kms_display_modeset = {
.get_connectors = kms_display_get_connectors,
.get_modes = kms_display_get_modes,
.create_scanout_surface = kms_display_create_scanout_surface,
.program = kms_display_program
};
static struct native_display *
kms_create_display(int fd, struct native_event_handler *event_handler,
void *user_data)
{
struct kms_display *kdpy;
kdpy = CALLOC_STRUCT(kms_display);
if (!kdpy)
return NULL;
kdpy->fd = fd;
kdpy->event_handler = event_handler;
kdpy->base.user_data = user_data;
if (!kms_display_init_screen(&kdpy->base)) {
kms_display_destroy(&kdpy->base);
return NULL;
}
kdpy->base.destroy = kms_display_destroy;
kdpy->base.get_param = kms_display_get_param;
kdpy->base.get_configs = kms_display_get_configs;
/* resources are fixed, unlike crtc, connector, or encoder */
kdpy->resources = drmModeGetResources(kdpy->fd);
if (kdpy->resources) {
kdpy->saved_crtcs =
CALLOC(kdpy->resources->count_crtcs, sizeof(*kdpy->saved_crtcs));
if (!kdpy->saved_crtcs) {
kms_display_destroy(&kdpy->base);
return NULL;
}
kdpy->shown_surfaces =
CALLOC(kdpy->resources->count_crtcs, sizeof(*kdpy->shown_surfaces));
if (!kdpy->shown_surfaces) {
kms_display_destroy(&kdpy->base);
return NULL;
}
kdpy->base.modeset = &kms_display_modeset;
}
else {
_eglLog(_EGL_DEBUG, "Failed to get KMS resources. Disable modeset.");
}
return &kdpy->base;
}
static struct native_display *
native_create_display(void *dpy, struct native_event_handler *event_handler,
void *user_data)
{
int fd;
if (dpy) {
fd = dup((int) pointer_to_intptr(dpy));
}
else {
fd = open("/dev/dri/card0", O_RDWR);
}
if (fd < 0)
return NULL;
return kms_create_display(fd, event_handler, user_data);
}
static const struct native_platform kms_platform = {
"KMS", /* name */
native_create_display
};
const struct native_platform *
native_get_kms_platform(void)
{
return &kms_platform;
}

View File

@@ -27,6 +27,7 @@
#define _NATIVE_X11_H_
#include "common/native.h"
#include <X11/Xlib.h>
struct native_display *
x11_create_ximage_display(Display *dpy,

View File

@@ -1086,20 +1086,30 @@ XMesaDestroyBuffer(XMesaBuffer b)
}
/**
* Notify the binding context to validate the buffer.
*/
void
xmesa_notify_invalid_buffer(XMesaBuffer b)
{
XMesaContext xmctx = XMesaGetCurrentContext();
if (xmctx && xmctx->xm_buffer == b)
xmctx->st->notify_invalid_framebuffer(xmctx->st, b->stfb);
}
/**
* Query the current drawable size and notify the binding context.
*/
void
xmesa_check_buffer_size(XMesaBuffer b)
{
XMesaContext xmctx = XMesaGetCurrentContext();
if (b->type == PBUFFER)
return;
xmesa_get_window_size(b->xm_visual->display, b, &b->width, &b->height);
if (xmctx && xmctx->xm_buffer == b)
xmctx->st->notify_invalid_framebuffer(xmctx->st, b->stfb);
xmesa_notify_invalid_buffer(b);
}

View File

@@ -360,6 +360,9 @@ extern void
xmesa_get_window_size(Display *dpy, XMesaBuffer b,
GLuint *width, GLuint *height);
extern void
xmesa_notify_invalid_buffer(XMesaBuffer b);
extern void
xmesa_check_buffer_size(XMesaBuffer b);

View File

@@ -339,6 +339,10 @@ xmesa_swap_st_framebuffer(struct st_framebuffer_iface *stfbi)
tmp = *front;
*front = *back;
*back = tmp;
/* the current context should validate the buffer after swapping */
if (!xmesa_strict_invalidate)
xmesa_notify_invalid_buffer(xstfb->buffer);
}
if (xmesa_strict_invalidate)

View File

@@ -73,7 +73,8 @@ void vegaFinish(void)
pipe = ctx->pipe;
pipe->flush(pipe, PIPE_FLUSH_RENDER_CACHE | PIPE_FLUSH_FRAME, &fence);
if (fence) {
pipe->screen->fence_finish(pipe->screen, fence, 0);
pipe->screen->fence_reference(pipe->screen, &fence, NULL);
}
}

View File

@@ -352,7 +352,7 @@ vg_api_create_context(struct st_api *stapi, struct st_manager *smapi,
return NULL;
/* only 1.0 is supported */
if (attribs->major != 1 || attribs->minor > 0)
if (attribs->major > 1 || (attribs->major == 1 && attribs->minor > 0))
return NULL;
pipe = smapi->screen->context_create(smapi->screen, NULL);

View File

@@ -10,7 +10,7 @@ LIBRARY_INCLUDES = \
$(shell pkg-config libkms --atleast-version=1.0 \
&& echo "-DHAVE_LIBKMS") \
$(shell pkg-config libkms --silence-errors --cflags-only-I) \
$(shell pkg-config --cflags-only-I pixman-1 xorg-server libdrm xproto) \
$(shell pkg-config --cflags-only-I pixman-1 xorg-server libdrm xproto dri2proto) \
-I$(TOP)/src/gallium/include \
-I$(TOP)/src/gallium/auxiliary \
-I$(TOP)/include \

View File

@@ -234,6 +234,10 @@ crtc_load_cursor_argb_ga3d(xf86CrtcPtr crtc, CARD32 * image)
64, 64, (void*)image, 64 * 4, 0, 0);
ms->ctx->transfer_unmap(ms->ctx, transfer);
ms->ctx->transfer_destroy(ms->ctx, transfer);
if (crtc->cursor_shown)
drmModeSetCursor(ms->fd, crtcp->drm_crtc->crtc_id,
crtcp->cursor_handle, 64, 64);
}
#if HAVE_LIBKMS
@@ -271,6 +275,10 @@ crtc_load_cursor_argb_kms(xf86CrtcPtr crtc, CARD32 * image)
memcpy(ptr, image, 64*64*4);
kms_bo_unmap(crtcp->cursor_bo);
if (crtc->cursor_shown)
drmModeSetCursor(ms->fd, crtcp->drm_crtc->crtc_id,
crtcp->cursor_handle, 64, 64);
return;
err_bo_destroy:
@@ -353,7 +361,7 @@ crtc_destroy(xf86CrtcPtr crtc)
drmModeFreeCrtc(crtcp->drm_crtc);
xfree(crtcp);
free(crtcp);
crtc->driver_private = NULL;
}
@@ -401,7 +409,7 @@ xorg_crtc_init(ScrnInfoPtr pScrn)
if (crtc == NULL)
goto out;
crtcp = xcalloc(1, sizeof(struct crtc_private));
crtcp = calloc(1, sizeof(struct crtc_private));
if (!crtcp) {
xf86CrtcDestroy(crtc);
goto out;

View File

@@ -201,11 +201,11 @@ dri2_create_buffer(DrawablePtr pDraw, unsigned int attachment, unsigned int form
DRI2Buffer2Ptr buffer;
BufferPrivatePtr private;
buffer = xcalloc(1, sizeof *buffer);
buffer = calloc(1, sizeof *buffer);
if (!buffer)
return NULL;
private = xcalloc(1, sizeof *private);
private = calloc(1, sizeof *private);
if (!private) {
goto fail;
}
@@ -217,9 +217,9 @@ dri2_create_buffer(DrawablePtr pDraw, unsigned int attachment, unsigned int form
if (dri2_do_create_buffer(pDraw, (DRI2BufferPtr)buffer, format))
return buffer;
xfree(private);
free(private);
fail:
xfree(buffer);
free(buffer);
return NULL;
}
@@ -229,8 +229,8 @@ dri2_destroy_buffer(DrawablePtr pDraw, DRI2Buffer2Ptr buffer)
/* So far it is safe to downcast a DRI2Buffer2Ptr to DRI2BufferPtr */
dri2_do_destroy_buffer(pDraw, (DRI2BufferPtr)buffer);
xfree(buffer->driverPrivate);
xfree(buffer);
free(buffer->driverPrivate);
free(buffer);
}
#endif /* DRI2INFOREC_VERSION >= 2 */
@@ -244,11 +244,11 @@ dri2_create_buffers(DrawablePtr pDraw, unsigned int *attachments, int count)
DRI2BufferPtr buffers;
int i;
buffers = xcalloc(count, sizeof *buffers);
buffers = calloc(count, sizeof *buffers);
if (!buffers)
goto fail_buffers;
privates = xcalloc(count, sizeof *privates);
privates = calloc(count, sizeof *privates);
if (!privates)
goto fail_privates;
@@ -263,9 +263,9 @@ dri2_create_buffers(DrawablePtr pDraw, unsigned int *attachments, int count)
return buffers;
fail:
xfree(privates);
free(privates);
fail_privates:
xfree(buffers);
free(buffers);
fail_buffers:
return NULL;
}
@@ -280,8 +280,8 @@ dri2_destroy_buffers(DrawablePtr pDraw, DRI2BufferPtr buffers, int count)
}
if (buffers) {
xfree(buffers[0].driverPrivate);
xfree(buffers);
free(buffers[0].driverPrivate);
free(buffers);
}
}

View File

@@ -45,6 +45,7 @@
#include "miscstruct.h"
#include "dixstruct.h"
#include "xf86xv.h"
#include "xorgVersion.h"
#ifndef XSERVER_LIBPCIACCESS
#error "libpciaccess needed"
#endif
@@ -122,7 +123,7 @@ xorg_tracker_set_functions(ScrnInfoPtr scrn)
Bool
xorg_tracker_have_modesetting(ScrnInfoPtr pScrn, struct pci_device *device)
{
char *BusID = xalloc(64);
char *BusID = malloc(64);
sprintf(BusID, "pci:%04x:%02x:%02x.%d",
device->domain, device->bus,
device->dev, device->func);
@@ -130,14 +131,14 @@ xorg_tracker_have_modesetting(ScrnInfoPtr pScrn, struct pci_device *device)
if (drmCheckModesettingSupported(BusID)) {
xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 0,
"Drm modesetting not supported %s\n", BusID);
xfree(BusID);
free(BusID);
return FALSE;
}
xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 0,
"Drm modesetting supported on %s\n", BusID);
xfree(BusID);
free(BusID);
return TRUE;
}
@@ -174,7 +175,7 @@ drv_free_rec(ScrnInfoPtr pScrn)
if (!pScrn->driverPrivate)
return;
xfree(pScrn->driverPrivate);
free(pScrn->driverPrivate);
pScrn->driverPrivate = NULL;
}
@@ -274,7 +275,7 @@ drv_init_drm(ScrnInfoPtr pScrn)
if (ms->fd < 0) {
char *BusID;
BusID = xalloc(64);
BusID = malloc(64);
sprintf(BusID, "PCI:%d:%d:%d",
((ms->PciInfo->domain << 8) | ms->PciInfo->bus),
ms->PciInfo->dev, ms->PciInfo->func
@@ -283,7 +284,7 @@ drv_init_drm(ScrnInfoPtr pScrn)
ms->fd = drmOpen(driver_descriptor.driver_name, BusID);
ms->isMaster = TRUE;
xfree(BusID);
free(BusID);
if (ms->fd >= 0)
return TRUE;
@@ -369,6 +370,7 @@ drv_pre_init(ScrnInfoPtr pScrn, int flags)
ms = modesettingPTR(pScrn);
ms->pEnt = pEnt;
ms->cust = cust;
ms->fb_id = -1;
pScrn->displayWidth = 640; /* default it */
@@ -402,19 +404,6 @@ drv_pre_init(ScrnInfoPtr pScrn, int flags)
if (!drv_init_drm(pScrn))
return FALSE;
use3D = cust ? !cust->no_3d : TRUE;
ms->from_3D = xf86GetOptValBool(ms->Options, OPTION_3D_ACCEL,
&use3D) ?
X_CONFIG : X_PROBED;
ms->no3D = !use3D;
if (!drv_init_resource_management(pScrn)) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Could not init "
"Gallium3D or libKMS.");
return FALSE;
}
pScrn->monitor = pScrn->confScreen->monitor;
pScrn->progClock = TRUE;
pScrn->rgbBits = 8;
@@ -444,11 +433,24 @@ drv_pre_init(ScrnInfoPtr pScrn, int flags)
/* Process the options */
xf86CollectOptions(pScrn, NULL);
if (!(ms->Options = xalloc(sizeof(drv_options))))
if (!(ms->Options = malloc(sizeof(drv_options))))
return FALSE;
memcpy(ms->Options, drv_options, sizeof(drv_options));
xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, ms->Options);
use3D = cust ? !cust->no_3d : TRUE;
ms->from_3D = xf86GetOptValBool(ms->Options, OPTION_3D_ACCEL,
&use3D) ?
X_CONFIG : X_PROBED;
ms->no3D = !use3D;
if (!drv_init_resource_management(pScrn)) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Could not init "
"Gallium3D or libKMS.");
return FALSE;
}
/* Allocate an xf86CrtcConfig */
xf86CrtcConfigInit(pScrn, &crtc_config_funcs);
xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
@@ -791,7 +793,9 @@ drv_screen_init(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
if (!ms->SWCursor)
xf86_cursors_init(pScreen, 64, 64,
HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_64 |
HARDWARE_CURSOR_ARGB);
HARDWARE_CURSOR_ARGB |
((cust && cust->unhidden_hw_cursor_update) ?
HARDWARE_CURSOR_UPDATE_UNHIDDEN : 0));
/* Must force it before EnterVT, so we are in control of VT and
* later memory should be bound when allocating, e.g rotate_mem */
@@ -862,8 +866,10 @@ drv_leave_vt(int scrnIndex, int flags)
}
}
if (ms->fb_id != -1) {
drmModeRmFB(ms->fd, ms->fb_id);
ms->fb_id = -1;
}
/* idle hardware */
if (!ms->kms)
@@ -944,7 +950,6 @@ drv_close_screen(int scrnIndex, ScreenPtr pScreen)
}
#endif
drmModeRmFB(ms->fd, ms->fb_id);
ms->destroy_front_buffer(pScrn);
if (ms->exa)
@@ -1178,6 +1183,8 @@ drv_bind_front_buffer_kms(ScrnInfoPtr pScrn)
stride,
ptr);
#if (XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(1, 9, 99, 1, 0))
/* This a hack to work around EnableDisableFBAccess setting the pointer
* the real fix would be to replace pScrn->EnableDisableFBAccess hook
* and set the rootPixmap->devPrivate.ptr to something valid before that.
@@ -1187,6 +1194,8 @@ drv_bind_front_buffer_kms(ScrnInfoPtr pScrn)
*/
pScrn->pixmapPrivate.ptr = ptr;
#endif
return TRUE;
err_destroy:

View File

@@ -720,7 +720,7 @@ ExaCreatePixmap(ScreenPtr pScreen, int size, int align)
{
struct exa_pixmap_priv *priv;
priv = xcalloc(1, sizeof(struct exa_pixmap_priv));
priv = calloc(1, sizeof(struct exa_pixmap_priv));
if (!priv)
return NULL;
@@ -737,7 +737,7 @@ ExaDestroyPixmap(ScreenPtr pScreen, void *dPriv)
pipe_resource_reference(&priv->tex, NULL);
xfree(priv);
free(priv);
}
static Bool
@@ -975,7 +975,7 @@ xorg_exa_close(ScrnInfoPtr pScrn)
ms->ctx = NULL;
exaDriverFini(pScrn->pScreen);
xfree(exa);
free(exa);
ms->exa = NULL;
}
@@ -987,7 +987,7 @@ xorg_exa_init(ScrnInfoPtr pScrn, Bool accel)
ExaDriverPtr pExa;
CustomizerPtr cust = ms->cust;
exa = xcalloc(1, sizeof(struct exa_context));
exa = calloc(1, sizeof(struct exa_context));
if (!exa)
return NULL;

View File

@@ -128,7 +128,7 @@ output_get_modes(xf86OutputPtr output)
for (i = 0; i < drm_connector->count_modes; i++) {
drm_mode = &drm_connector->modes[i];
if (drm_mode) {
mode = xcalloc(1, sizeof(DisplayModeRec));
mode = calloc(1, sizeof(DisplayModeRec));
if (!mode)
continue;
mode->Clock = drm_mode->clock;
@@ -195,7 +195,7 @@ output_destroy(xf86OutputPtr output)
{
struct output_private *priv = output->driver_private;
drmModeFreeConnector(priv->drm_connector);
xfree(priv);
free(priv);
output->driver_private = NULL;
}
@@ -262,14 +262,14 @@ xorg_output_init(ScrnInfoPtr pScrn)
drm_connector->connector_type_id);
priv = xcalloc(sizeof(*priv), 1);
priv = calloc(sizeof(*priv), 1);
if (!priv) {
continue;
}
output = xf86OutputCreate(pScrn, &output_funcs, name);
if (!output) {
xfree(priv);
free(priv);
continue;
}

View File

@@ -76,6 +76,7 @@ typedef struct _CustomizerRec
Bool dirty_throttling;
Bool swap_throttling;
Bool no_3d;
Bool unhidden_hw_cursor_update;
Bool (*winsys_pre_init) (struct _CustomizerRec *cust, int fd);
Bool (*winsys_screen_init)(struct _CustomizerRec *cust);
Bool (*winsys_screen_close)(struct _CustomizerRec *cust);

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