Compare commits

...

1274 Commits

Author SHA1 Message Date
Ian Romanick
de8f22af28 mesa: Bump version to 7.11 (final) 2011-07-31 22:48:10 -07:00
Ian Romanick
6ee71bab94 docs: More bits of 7.11 release notes 2011-07-31 22:47:26 -07:00
Jeremy Huddleston
6c72801c2b darwin: Use machine/endian.h to determine endianness
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 5b3c719983)
2011-07-31 09:47:56 -07:00
Jeremy Huddleston
0d2c369535 Fix PPC detection on darwin
Fixes regression introduced by 7004582c18

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit e737a99a6f)
2011-07-31 09:47:51 -07:00
Ian Romanick
fffd20cdc1 Merge remote-tracking branch 'origin/7.11' into 7.11 2011-07-28 16:18:51 -07:00
Ian Romanick
fad610fec9 mesa: Bump version to 7.11-rc4 2011-07-28 16:08:42 -07:00
Vadim Girlin
9ca791d380 r600g: fix vs export count
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=39572

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2011-07-28 19:05:59 -04:00
Kenneth Graunke
69720cb0c4 i965: Remove the now unused intel_renderbuffer::draw_offset field.
The previous commit removed the last use of this field.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit f73caddd33)
2011-07-28 14:23:08 -07:00
Kenneth Graunke
8589ca000a i965: Check actual tile offsets in Gen4 miptree workaround.
The purpose of the (irb->draw_offset & 4095) != 0 check was to ensure
that we don't have XYy offsets into a tile, since Gen4 hardware doesn't
support that.  However, it's insufficient: there are cases where
draw_offset & 4095 is 0 but we still have a Y-offset.  This leads to an
assertion failure in brw_update_renderbuffer_surface with tile_y != 0.

Instead, simply call intel_renderbuffer_tile_offsets to compute the
actual X/Y offsets and check if either are non-zero.  This makes both
the workaround and the assertion check the same things.

Fixes piglit test fbo-generatemipmap-formats, and should also fix
bugs #34009 and #39487.

NOTE: This is a candidate for stable release branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34009
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=39487
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Chad Versace <chad@chad-versace.us>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 15c0bc5eef)
2011-07-28 14:22:59 -07:00
Kenneth Graunke
dcbd00e73c i965/gen4: Fix message parameter loading for 1D TXD sampling.
We were neglecting to load dvdx and dvdy.  v is not optional.

Fixes glslparsertests tex-grad-0[12345].frag on Broadwater/Crestline.
(We still need an execution test using sampler1D.)

NOTE: This is a candidate for the 7.11 branch.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 3e1fd13f60)
2011-07-28 14:22:48 -07:00
Fredrik Höglund
bba1600531 st/mesa: fix the texture format in st_context_teximage
Commit 1a339b6c71 made
st_ChooseTextureFormat map GL_RGBA with type GL_UNSIGNED_BYTE
to PIPE_FORMAT_A8B8G8R8_UNORM.

The image format for ARGB pixmaps is PIPE_FORMAT_B8G8R8A8_UNORM
however. This mismatch caused the texture to be recreated in
st_finalize_texture.

NOTE: This is a candidate for the 7.11 branch.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=39209
Signed-off-by: Fredrik Höglund <fredrik@kde.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-07-28 11:56:45 -07:00
Ian Romanick
f4c55ea016 mesa: Ensure that r300 compiler files only appear once in the tarballs
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Tested-by: Jeremy Huddleston <jeremyhu@apple.com>
Cc: Andreas Radke <a.radke@arcor.de>
2011-07-28 11:47:46 -07:00
Ian Romanick
aa05fbe14d mesa: Bump version to 7.11-rc3 2011-07-28 11:47:45 -07:00
Ian Romanick
0a7574f62c mesa: Use --dereference to avoid symlinks in tarballs 2011-07-28 11:47:45 -07:00
Eric Anholt
1098f9228d i965/fs: Fix MRT drawing since the m0->m2 move for shader debug.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 3daa2d97eb)
2011-07-28 11:47:45 -07:00
Eric Anholt
5238303790 i965: Fix many of the trivial WebGL demos that broke due to IB optimization.
The index buffer state emit only occurred if there was an IB in place
and we were in either a new batch or a new IB state.  But because we
only flagged new IB state if IB state changed from the last IB state
we calculated, we could simply never emit IB state after batchbuffer
wraps if the first draw didn't use the IB and we didn't actually
change the IB.

Fixes piglit glx-multi-context-ib-1.
(cherry picked from commit 818db3848b)
2011-07-28 11:47:45 -07:00
Eric Anholt
a03974ffb9 i965: Emit texture cache flushes on gen6 along with render cache flushes.
It turns out that internally the texture cache gets flushed in a
couple of cases, particularly around 2D operations mixed with 3D.  In
almost all cases one of those happens between rendering to an
FBO-attached texture and rendering from that texture.  However, as of
the next patch, glean tfbo (and the new fbo-flushing-2 test) would
manage to get stale texture values because one of those flushes didn't
occur.  The intention of this code was always to get the render cache
cleared and ready to be used from the sampler cache (and it does on <=
gen4), so this just catches gen5 up.

This patch was also tested to fix fbo-flushing on gen7.
(cherry picked from commit 185868c9c2)
2011-07-28 11:47:45 -07:00
Paul Berry
2d64d34cb9 i965: vs optimization fix: Check val.{negate,abs} in accumulator_contains()
When emitting a MAC instruction in a vertex shader, brw_vs_emit()
calls accumulator_contains() to determine whether the accumulator
already contains the appropriate addend; if it does, then we can avoid
emitting an unnecessary MOV instruction.

However, accumulator_contains() wasn't checking the val.negate or
val.abs flags.  As a result, if the desired value was the negation, or
the absolute value, of what was already in the accumulator, we would
generate an incorrect shader.

Fixes piglit test vs-refract-vec4-vec4-float.

Tested on Gen5 and Gen6.

Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit d92463d5dc)
2011-07-28 11:47:45 -07:00
Kenneth Graunke
66b41af391 i965/gen7: Fix shadow sampling in the old brw_wm_emit backend.
On Ivybridge, the shadow comparitor goes in the first slot, rather than
at the end.  It's not necessary to send u, v, and r.

Fixes tests texturing/texdepth and glean/fbo.

NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 572f631895)
2011-07-28 11:47:45 -07:00
Kenneth Graunke
67aa20d9d5 i965/fs: Clear result before visiting shadow comparitor and LOD info.
Commit 53c89c67f3 ("i965: Avoid generating
MOVs for assignments of expressions.") added the line "this->result =
reg_undef" all over the code.  Unfortunately, since Eric developed his
patch before I landed Ivybridge support, he missed adding it to
fs_visitor::emit_texture_gen7() after rebasing.

Furthermore, since I developed TXD support before Eric's patch, I
neglected to add it to the gradient handling when I rebased.

Neglecting to set this causes the visitor to use this->result as storage
rather than generating a new temporary.  These missing statements
resulted in the same register being used to store several different
values.

Fixes the following piglit tests on Ivybridge:
- glsl-fs-shadow2dproj.shader_test
- glsl-fs-shadow2dproj-bias.shader_test

NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 156cef0fba)
2011-07-28 11:47:45 -07:00
Ian Romanick
7d6c37b0c2 glsl: Treat ir_dereference_array of non-var as a constant for lowering
Previously the code would just look at deref->array->type to see if it
was a constant.  This isn't good enough because deref->array might be
another ir_dereference_array... of a constant.  As a result,
deref->array->type wouldn't be a constant, but
deref->variable_referenced() would return NULL.  The unchecked NULL
pointer would shortly lead to a segfault.

Instead just look at the return of deref->variable_referenced().  If
it's NULL, assume that either a constant or some other form of
anonymous temporary storage is being dereferenced.

This is a bit hinkey because most drivers treat constant arrays as
uniforms, but the lowering pass treats them as temporaries.  This
keeps the behavior of the old code, so this change isn't making things
worse.

Fixes i965 piglit:

    vs-temp-array-mat[234]-index-col-rd
    vs-temp-array-mat[234]-index-col-row-rd
    vs-uniform-array-mat[234]-index-col-rd
    vs-uniform-array-mat[234]-index-col-row-rd

Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 156f85336f)
2011-07-28 11:47:45 -07:00
Ian Romanick
32c7224edb i965: When emitting a src/dst read of an output, keep the swizzle and neg
Fixes i965 piglit vs-varying-array-mat[234]-row-rd.

Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 1d3f09f159)
2011-07-28 11:47:45 -07:00
Ian Romanick
788acd552e i965: When emitting a src/dst write of an output, keep the write mask
Fixes i965 piglit:

    vs-varying-array-mat[234]-col-row-wr
    vs-varying-array-mat[234]-index-col-row-wr
    vs-varying-array-mat[234]-index-row-wr
    vs-varying-array-mat[234]-row-wr
    vs-varying-mat[234]-col-row-wr
    vs-varying-mat[234]-row-wr

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 337e2dfad0)
2011-07-28 11:47:45 -07:00
Ian Romanick
a2b8802ed5 prog_optimize: Set unused regs to PROGRAM_UNDEFINED after CMP->MOV conversion
Leaving the unused registers with other values caused assertion
failures and other problems in places that blindly iterate over all
sources.

brw_vs_emit.c:1381: get_src_reg: Assertion `c->regs[file][index].nr !=
0' failed.

Fixes i965 piglit:

    vs-uniform-array-mat[234]-col-row-rd
    vs-uniform-array-mat[234]-index-col-row-rd
    vs-uniform-array-mat[234]-index-row-rd
    vs-uniform-mat[234]-col-row-rd

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit fbeb68e880)
2011-07-28 11:47:45 -07:00
Ian Romanick
8b41ae0b2a ir_to_mesa: Copy reladdr in src_reg(dst_reg) constructor
Fixes i965 piglit:

    vs-temp-array-mat[234]-col-row-wr
    vs-temp-array-mat[234]-index-col-row-wr
    vs-temp-array-mat[234]-index-row-wr
    vs-temp-mat[234]-col-row-wr

Fixes swrast piglit:

    fs-temp-array-mat[234]-col-row-wr
    fs-temp-array-mat[234]-index-col-row-wr
    fs-temp-array-mat[234]-index-row-wr
    fs-temp-mat[234]-col-row-wr
    vs-temp-array-mat[234]-col-row-wr
    vs-temp-array-mat[234]-index-col-row-wr
    vs-temp-array-mat[234]-index-row-wr
    vs-temp-mat[234]-col-row-wr

Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit f7cd9a858c)
2011-07-28 11:47:44 -07:00
Ian Romanick
b00b5fe267 ir_to_mesa: Add each relative address to the previous
This fixes many cases of accessing arrays of matrices using
non-constant indices at each level.

Fixes i965 piglit:

    vs-temp-array-mat[234]-index-col-rd
    vs-temp-array-mat[234]-index-col-row-rd
    vs-temp-array-mat[234]-index-col-wr
    vs-uniform-array-mat[234]-index-col-rd

Fixes swrast piglit:

    fs-temp-array-mat[234]-index-col-rd
    fs-temp-array-mat[234]-index-col-row-rd
    fs-temp-array-mat[234]-index-col-wr
    fs-uniform-array-mat[234]-index-col-rd
    fs-uniform-array-mat[234]-index-col-row-rd
    fs-varying-array-mat[234]-index-col-rd
    fs-varying-array-mat[234]-index-col-row-rd
    vs-temp-array-mat[234]-index-col-rd
    vs-temp-array-mat[234]-index-col-row-rd
    vs-temp-array-mat[234]-index-col-wr
    vs-uniform-array-mat[234]-index-col-rd
    vs-uniform-array-mat[234]-index-col-row-rd
    vs-varying-array-mat[234]-index-col-rd
    vs-varying-array-mat[234]-index-col-row-rd
    vs-varying-array-mat[234]-index-col-wr

Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit d6e1a8f714)
2011-07-28 11:47:44 -07:00
Ian Romanick
3a5a7cfd2a glsl: When lowering non-constant vector indexing, respect existing conditions
If the non-constant index was in the LHS of an assignment, any
existing condititon on that assignment would be lost.

Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 601428d2bb)
2011-07-28 11:47:44 -07:00
Ian Romanick
aad12d15bb glsl: When lowering non-constant array indexing, respect existing conditions
If the non-constant index was in the LHS of an assignment, any
existing condititon on that assignment would be lost.

Fixes i965 piglit:

    fs-temp-array-mat[234]-col-row-wr
    fs-temp-array-mat[234]-index-col-row-wr
    fs-temp-array-mat[234]-index-col-wr
    fs-temp-array-mat[234]-index-row-wr
    vs-varying-array-mat[234]-index-col-wr

Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 5f83dfe5b7)
2011-07-28 11:47:44 -07:00
Ian Romanick
977db7cc65 glsl: Rework lowering of non-constant array indexing
The previous implementation could easily get tricked if the LHS of an
assignment included a non-constant index that was "inside" another
dereference.  For example:

    mat4 m[2];
    m[0][i] = vec4(0.0);

Due to the way it tracked whether the array was being assigned, it
would think that the non-constant index was in an r-value.  The new
code fixes that by tracking l-values and r-values differently.  The
index is also replaced by cloning the IR and replacing the index
variable instead of the odd way it was done before.

v2: Apply some simplifications suggested by Eric Anholt.  Making
assignment_generator::rvalue be ir_dereference instead of ir_rvalue
simplified the code a bit.

Fixes i965 piglit fs-temp-array-mat[234]-index-wr and
vs-varying-array-mat[234]-index-wr.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34691
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 1731ac3086)

To make bisects work, this also squashes in:

glsl: Correctly return progress from lower_variable_index_to_cond_assign

lower_variable_index_to_cond_assign runs until it can't make any more
progress.  It then returns the result of the last pass which will
always be false.  This caused the lowering loop in
_mesa_ir_link_shader to end before doing one last round of
lower_if_to_cond_assign.  This caused several if-statements (resulting
from lower_variable_index_to_cond_assign) to be left in the IR.

In addition to this change, lower_variable_index_to_cond_assign should
take a flag indicating whether or not it should even generate
if-statements.  This is easily controlled by
switch_generator::linear_sequence_max_length.  This would generate
much better code on architectures without any flow contol.

Fixes i915 piglit regressions glsl-texcoord-array and
glsl-fs-vec4-indexing-temp-src.

Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit c1e591eed4)
2011-07-28 11:47:44 -07:00
Ian Romanick
d31c1c33ed glsl: Split out part of variable_index_to_cond_assign_visitor::needs_lowering
Other code will soon need to know if an array needs lowering based
exclusively on the storage mode.

Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit d2296e784a)
2011-07-28 11:47:44 -07:00
Ian Romanick
3481a5a1e6 glsl: Move is_array_or_matrix outside visitor class
There's no reason for it to be there, and another class that may not
have access to the visitor will need it soon.

Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 8d5f3cef79)
2011-07-28 11:47:44 -07:00
Marek Olšák
a26b6cc001 configure.ac: add DLOPEN_LIBS to xlib build
Otherwise xlib-based llvmpipe fails to link.

NOTE: This is a candidate for the 7.11 branch.
(cherry picked from commit 0aed27ee37)
2011-07-28 00:29:07 +02:00
Benjamin Franzke
7d992b8471 wayland-drm: Add copyright notice to protocol
Fixes build since wayland 986703ac7365bc87a5501714adb9fc73157c62b7.
(cherry picked from commit 79dcfb266a)
2011-07-27 10:08:01 +02:00
Tobias Droste
0bfa310049 egl/gallium: fix build without softpipe and llvmpipe
Signed-off-by: Tobias Droste <tdroste@gmx.de>
Acked-by: Jakob Bornecrantz <wallbraker@gmail.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
(cherry picked from commit d4d5e3a336)
2011-07-27 09:43:03 +02:00
Benjamin Franzke
7555eb7478 Fix broken merge in cherry-pick from 42cdf407
Was cherry-picked to 337102684b.
2011-07-27 09:25:54 +02:00
Bryan Cain
fd461c5888 util: enable S3TC support when the force_s3tc_enable env var is set to "true"
NOTE: This is a candidate for the 7.10 and 7.11 branches.
2011-07-26 13:23:18 -05:00
Bryan Cain
208bae4251 st/mesa: respect force_s3tc_enable environment variable
NOTE: This is a candidate for the 7.10 and 7.11 branches.
2011-07-26 13:23:15 -05:00
Marek Olšák
13d12b35e9 configure.ac: do not check for llvm-config if llvm is disabled 2011-07-25 23:54:28 +02:00
Benjamin Franzke
337102684b configure: Move gbm before egl in SRC_DIRS
egl_dri2 built into libEGL depends on libgbm.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=39515
(cherry picked from commit 42cdf4074e)
2011-07-25 09:47:39 +02:00
Marek Olšák
b305c956be configure.ac: check for libdrm_radeon only when building classic
(cherry picked from commit 50e32fefb1)
2011-07-23 16:00:27 +02:00
Ian Romanick
7c98381ed4 glsl: Reject shaders that contain static recursion
The GLSL 1.20 and later specs say:

    "Recursion is not allowed, not even statically. Static recursion is
    present if the static function call graph of the program contains
    cycles."

Recursion is detected and rejected both a compile-time and at
link-time.  The complie-time check happens to detect some cases that
may be removed by various optimization passes.  The spec doesn't seem
to allow this, but other vendors (e.g., NVIDIA) appear to only check
at link-time after all optimizations.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=33885
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 02c5ae1b3f)

This also squashes in the following commit to make sure that bisects
in scons builds work:

glsl: Add ir_function_detect_recursion.cpp to SConscript.
(cherry picked from commit 76bccaff0c)
2011-07-23 01:55:25 -07:00
Ian Romanick
0ce6506d6e glsl: Make prototype_string publicly available
Also clarify the documentation for one of the parameters.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 1ad3ba4ad9)
2011-07-23 01:53:59 -07:00
Stéphane Marchesin
7fc66f0bed Revert "i915: Eliminate redundant CONSTANTS updates"
This reverts commit 87641cffd9.
(cherry picked from commit 3c0c624879)
2011-07-23 01:53:40 -07:00
Chia-I Wu
e24c3575e4 u_vbuf_mgr: restore buffer offsets
u_vbuf_upload_buffers modifies the buffer offsets.  If they are not
restored, and any of the vertex formats is not supported natively, the
next u_vbuf_mgr_draw_begin call will translate the vertex buffers with
incorrect buffer offsets.
(cherry picked from commit afc160e1c8)

Signed-off-by: Marek Olšák <maraeo@gmail.com>
2011-07-21 22:18:56 +02:00
Marek Olšák
2e50a93cf3 r600g: more valgrind fixes
(cherry picked from commit dc9d789d1b)
2011-07-21 15:03:03 +02:00
Marek Olšák
2c29c24543 r600g: zero memory of ioctl parameters
Fixes valgrind warning.
(cherry picked from commit daf6604435)
2011-07-21 15:02:53 +02:00
Marek Olšák
4cbaa2283c configure.ac: Check for the respective libdrm_* when building gallium drivers
In a rare case of building gallium only, we need to
check if the required packages are available

libdrm_[intel|nouveau] - gallium[i915 i965|nouveau]

v2: r300g and r600g do not need libdrm_radeon

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Marek Olšák <maraeo@gmail.com>
(cherry picked from commit c2426bbf86)

Conflicts:

	configure.ac
2011-07-21 14:57:19 +02:00
Marek Olšák
e29d44eacd mesa: GLES2 should return different error enums for invalid fbo queries
ES 2.0.25 page 127 says:

  If the value of FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE is NONE, then
  querying any other pname will generate INVALID_ENUM.

See also:
b9e9df78a0

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

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 000896c0bb)
2011-07-21 14:54:09 +02:00
Andrew Randrianasulu
f29208aa9b dri/nouveau: nv10: fix vertex format for GL_UNSIGNED_BYTE
Broken accidentally in f4efc256fd,
the switch to rnn headers.

NV10TCL_VTXFMT_TYPE_BYTE_RGBA became U8_UNORM but B8G8R8A8_UNORM
was used instead.
2011-07-21 10:33:33 +02:00
David Heidelberger
7af4e18dcd nvfx: handle PIPE_CAP_SM3
Signed-off-by: David Heidelberger <d.okias@gmail.com>
2011-07-21 10:33:03 +02:00
Eric Anholt
344db29ede i965: Apply a homebrew workaround for GPU hang in OGLC api-texcoord.
The behavior of flushes in the hardware is a maze of twisty passages,
and strangely the VS constants appear to be loaded during a pipeline
flush instead of at the time of the packet emit according to the
simulator.  On moving the STATE_BASE_ADDRESS packet to where it really
needed to live (in order for data loads by other packets to be
correct), we sometimes no longer got a flush between those packets
where we apparently needed it.  This replicates the flushes implied by
a STATE_BASE_ADDRESS update, fixing the GPU hangs in OGLC and the
"engine" demo.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=36821
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=39257
Tested-by: Keith Packard <keithp@keithp.com> (bzflag and etracer fixed)
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 3e5d36267d)
2011-07-20 12:50:06 -07:00
Eric Anholt
680c468f61 i965: Enable the PIPE_CONTROL workaround workaround out of paranoia.
There's scary stuff going on in PIPE_CONTROL internals, and if the
BSpec says to do this to make PIPE_CONTROL work, I'll go ahead and do
it because we'll probably never be able to debug it after the fact.

v2: Use stall at scoreboard instead of depth stall, as noted by Ken.
(cherry picked from commit 407785d0e9)
2011-07-20 12:50:06 -07:00
Eric Anholt
7ee4cb453b i965: Avoid kernel BUG_ON if we happen to wait on the pipe_control w/a BO.
For this and occlusion queries, we're trying to avoid setting
I915_GEM_DOMAIN_RENDER for the write domain, because the data written
is definitely not going through the render cache, but we do need to
tell the kernel that the object has been written.  However, with using
I915_GEM_DOMAIN_GTT, the kernel on retiring the batchbuffer sees that
the w/a BO has a write domain of GTT, and puts it on the flushing
list.  If something tries to wait for that BO to finish rendering
(such as the AUB dumper reading the contents of BOs), we get into
wait_request (since obj->active) but with a 0 seqno (since the object
is on the flushing list, not actually on a ringbuffer), and BUG_ONs.

To avoid the kernel bug (which I'm hoping to delete soon anyway), just
use I915_GEM_DOMAIN_INSTRUCTION like occlusion queries do.  This
doesn't result in more flushing, because we invalidate INSTRUCTION on
every batchbuffer now that we're state streaming, anyway.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit dc7422405f)
2011-07-20 12:50:06 -07:00
Eric Anholt
a152ab6df1 i915: Simplify intel_wpos_* with a helper function.
(cherry picked from commit cb5e0ba2aa)
2011-07-20 12:50:06 -07:00
Eric Anholt
a99914509e i915: Include gl_FragCoord.w data, not just xyz.
Fixes piglit fragcoord_w test.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34323
(cherry picked from commit fceda4342c)
2011-07-20 12:50:06 -07:00
Eric Anholt
891073fea3 i915: Fix incorrect depth scaling when enabling/disabling depth buffers.
We were updating our new viewport using the old buffers' _WindowMap.m.
We can do less math and avoid using that deprecated matrix by just
folding the viewport calculation right in to the driver.

Fixes piglit fbo-depthtex.
(cherry picked from commit debf751aea)
2011-07-20 12:50:06 -07:00
Eric Anholt
dcaec739ea i915: Make stencil test for no-stencil handling match depth test.
i915_update_draw_buffers() already handles the fallback bit for
missing stencil region, so here we just need to handle whether the GL
thinks we have stencil data or not (and disable the test if so).
(cherry picked from commit 79fee3a76b)
2011-07-20 12:50:06 -07:00
Eric Anholt
ea241750f7 i915: Disable the depth test whenever we don't have a depth buffer.
We were disabling it once at the moment we changed draw buffers, but
later enabling of depth test could turn it back on.  Fixes
fbo-nodepth-test.

Note that ctx->DrawBuffer has to be checked because during context
create we get called while it's still unset.  However, we know we'll
get an intel_draw_buffer() after that, so it's safe to make a silly
choice at this point.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=30080
(cherry picked from commit fc4fba52cf)
2011-07-20 12:50:06 -07:00
Eric Anholt
9efd6dc677 i915: Remove i965 paths from i915_update_drawbuffer() and i830's too.
Reviewed-by: Chad Versace <chad@chad-versace.us>
(cherry picked from commit 4c47fce92e)
2011-07-20 12:50:06 -07:00
Eric Anholt
c6ddeeed7a i965: Remove i915 paths from brw_update_draw_buffers().
Reviewed-by: Chad Versace <chad@chad-versace.us>
(cherry picked from commit 94efc350b4)
2011-07-20 12:50:05 -07:00
Eric Anholt
108e807b7b i965: Remove unused region calculations in brw_update_draw_buffer().
Reviewed-by: Chad Versace <chad@chad-versace.us>
(cherry picked from commit c68270a26b)
2011-07-20 12:50:05 -07:00
Eric Anholt
421bca32fb i965: Remove empty brw_set_draw_region.
Reviewed-by: Chad Versace <chad@chad-versace.us>
(cherry picked from commit 15af0f54b8)
2011-07-20 12:50:05 -07:00
Eric Anholt
0f0ab15a46 i965: Remove FALLBACK() from brw_update_draw_region().
The 965 driver doesn't use these for deciding on fallbacks.

Reviewed-by: Chad Versace <chad@chad-versace.us>
(cherry picked from commit dd898c3e89)
2011-07-20 12:50:05 -07:00
Eric Anholt
b3c2438d4e intel: Move intel_draw_buffers() code into each driver.
The illusion of shared code here wasn't fooling anybody.  It was
tempting to keep i830 and i915 still shared, but I think I actually
want to make them diverge shortly.

Reviewed-by: Chad Versace <chad@chad-versace.us>
(cherry picked from commit f34ec6169d)
2011-07-20 12:50:05 -07:00
Brian Paul
25287008b6 glsl: silence warning in linker.cpp
(cherry picked from commit 4470ff2ebf)
2011-07-20 09:02:22 -07:00
Jørgen Lind
62b282e749 Make it possible to use gbm with c++
NOTE: This is a candiate for 7.11
(cherry picked from commit 496bf3822a)
2011-07-20 09:02:18 -07:00
Paul Berry
9aa8c02ae2 glsl: Rewrote _mesa_glsl_process_extension to use table-driven logic.
Instead of using a chain of manually maintained if/else blocks to
handle "#extension" directives, we now consult a table that specifies,
for each extension, the circumstances under which it is available, and
what flags in _mesa_glsl_parse_state need to be set in order to
activate it.

This makes it easier to add new GLSL extensions in the future, and
fixes the following bugs:

- Previously, _mesa_glsl_process_extension would sometimes set the
  "_enable" and "_warn" flags for an extension before checking whether
  the extension was supported by the driver; as a result, specifying
  "enable" behavior for an unsupported extension would sometimes cause
  front-end support for that extension to be switched on in spite of
  the fact that back-end support was not available, leading to strange
  failures, such as those in
  https://bugs.freedesktop.org/show_bug.cgi?id=38015.

- "#extension all: warn" and "#extension all: disable" had no effect.

Notes:

- All extensions are currently marked as unavailable in geometry
  shaders.  This should not have any adverse effects since geometry
  shaders aren't supported yet.  When we return to working on geometry
  shader support, we'll need to update the table for those extensions
  that are available in geometry shaders.

- Previous to this commit, if a shader mentioned
  ARB_shader_texture_lod, extension ARB_texture_rectangle would be
  automatically turned on in order to ensure that the types
  sampler2DRect and sampler2DRectShadow would be defined.  This was
  unnecessary, because (a) ARB_shader_texture_lod works perfectly well
  without those types provided that the builtin functions that
  reference them are not called, and (b) ARB_texture_rectangle is
  enabled by default in non-ES contexts anyway.  I eliminated this
  unnecessary behavior in order to make the behavior of all extensions
  consistent.

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

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 3097715d41)
2011-07-20 08:15:32 -07:00
Paul Berry
b0ecde7f39 glsl: Changed extension enable bits to bools.
These were previously 1-bit-wide bitfields.  Changing them to bools
has a negligible performance impact, and allows them to be accessed by
offset as well as by direct structure access.

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

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 9c4445de6e)
2011-07-20 08:15:21 -07:00
Marek Olšák
fe70a40e47 prog_optimize: fix a warning that a variable may be uninitialized
(cherry picked from commit dade65505b)
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-07-20 08:01:47 -06:00
Ian Romanick
73b68316f4 mesa: Bump version to 7.11-rc2 2011-07-19 16:39:57 -07:00
Brian Paul
7ba7531929 mesa: remove depend files from tarballs
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-07-19 16:39:57 -07:00
Kenneth Graunke
2826e3a000 glsl: Correctly handle function matching when there are multiple inexact matches
This is a squash cherry pick commit of:

    glsl: Find the "closest" signature when there are multiple matches.

    Previously, ir_function::matching_signature had a fatal bug: if a
    function had more than one non-exact match, it would simply return NULL.

    This occured, for example, when looking for max(uvec3, uvec3):
    - max(vec3, vec3)   -> score 1 (found first)
    - max(ivec3, ivec3) -> score 1 (found second...used to return NULL here)
    - max(uvec3, uvec3) -> score 0 (exact match...the right answer)

    This did not occur for max(ivec3, ivec3) since the second match found
    was an exact match.

    The new behavior is to return a match with the lowest score.  If there
    is an exact match, that will be returned.  Otherwise, a match with the
    least number of implicit conversions is chosen.

    Fixes piglit tests max-uvec3.vert and glsl-inexact-overloads.shader_test.

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

    Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
    Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
    Reviewed-by: Eric Anholt <eric@anholt.net>
    (cherry picked from commit 60eb63a855)

    glsl: Suppress warning from matching_signature change.

    gcc isn't smart enough to see that we only look at matched_score after
    we've initialized it (because match != NULL happens at the same time)
    (cherry picked from commit b043409adf)

    glsl: Reject ambiguous function calls (multiple inexact matches).

    According to the GLSL 1.20 specification, "it is a semantic error if
    there are multiple ways to apply [implicit] conversions [...] such that
    the call can be made to match multiple signatures."

    Fixes a regression caused by 60eb63a855,
    which implemented the wrong policy of finding a "closest" match.
    However, this is not a revert, since the original code failed to
    continue looking for an exact match once it found two inexact matches.

    It's OK to have multiple inexact matches if there's also an exact match.

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

    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38971
    Reviewed-by: Eric Anholt <eric@anholt.net>
    Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
    (cherry picked from commit 7304909d65)
2011-07-19 16:39:56 -07:00
Paul Berry
f80ae99cbd glsl: Ensure that sampler declarations are always uniform or "in" parameters.
This brings us into compliance with page 17 (page 22 of the PDF) of
the GLSL 1.20 spec:

    "[Sampler types] can only be declared as function parameters or
    uniform variables (see Section 4.3.5 "Uniform"). ... [Samplers]
    cannot be used as out or inout function parameters."

The spec isn't explicit about whether this rule applies to
structs/arrays containing shaders, but the intent seems to be to
ensure that it can always be determined at compile time which sampler
is being used in each texture lookup.  So to avoid creating a
loophole, the rule needs to apply to structs/arrays containing shaders
as well.

Fixes piglit tests spec/glsl-1.10/compiler/samplers/*.frag, and fixes
bug 38987.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38987
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit f07221056e)
2011-07-19 16:39:56 -07:00
Paul Berry
ae11fb02dd glsl: Move type_contains_sampler() into glsl_type for later reuse.
The new location, as a member function of glsl_type, is more
consistent with queries like is_sampler(), is_boolean(), is_float(),
etc.  Placing the function inside glsl_type also makes it available to
any code that uses glsl_types.
(cherry picked from commit ddc1c96390)
2011-07-19 16:39:56 -07:00
Ian Romanick
a90b88f354 linker: Only over-ride built-ins when a prototype has been seen
The GLSL spec says:

    "If a built-in function is redeclared in a shader (i.e., a
    prototype is visible) before a call to it, then the linker will
    only attempt to resolve that call within the set of shaders that
    are linked with it."

This patch enforces this behavior.  When a function call is processed
a flag is set in the ir_call to indicate whether the previously seen
prototype is the built-in or not.  At link time a call will only bind
to an instance of a function that matches the "want built-in" setting
in the ir_call.

This has the odd side effect that first call to abs() in the shader
below will call the built-in and the second will not:

float foo(float x) { return abs(x); }
float abs(float x) { return -x; }
float bar(float x) { return abs(x); }

This seems insane, but it matches what the spec says.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=31744
(cherry picked from commit 66f4ac988d)
2011-07-19 16:39:56 -07:00
Ian Romanick
0e699cc0e8 configure.ac: Make --{without,with}-gallium-drivers work as expected
This version is mostly Dan's post to the mesa-dev mailing list on
6/22/2011.

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

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
(cherry picked from commit db311b45be)
2011-07-19 16:39:56 -07:00
Kenneth Graunke
e6e7c456de i965/gen7: Add support for gl_PointCoord.
This is exactly analogous to Eric's Gen6 change in commit
6861a70177.  His explanation:

"This is just like PointSprite overrides, but it's always on for that
 attribute."

Fixes glsl-fs-pointcoord and gtf/point_sprites.

Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>

(cherry-picked from commit 186e37c754)
2011-07-19 16:39:56 -07:00
Kenneth Graunke
31f4ab790f i965/gen7: Fix point sprite texture coordinate overrides.
This is exactly analogous to Eric's Gen6 change in commit
f304bb8a5d.  His explanation:

"We were assuming that the input attribute n to the FS was
 FRAG_ATTRIB_TEXn, which happened to be true often enough for our
 testcases."

Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>

(cherry-picked from commit 147d010295)
2011-07-19 16:39:56 -07:00
Kenneth Graunke
9f978104d8 i965/gen7: Refactor SF setup a bit to handle overrides in one place.
This is exactly analogous to Eric's Gen6 change in commit
e7280b16d6.

Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>

(cherry-picked from commit 5edb3ddf41)
2011-07-19 16:39:55 -07:00
Kenneth Graunke
9d78935100 i965/gen7: Remove gratuitous dirty flags from WM and PS state.
Commit b46dc45cee claimed that
NEW_POLYGONSTIPPLE is gratuitous, but somehow just changed comments
and whitespace instead of actually removing the flag.

While we're at it, 3DSTATE_PS doesn't appear to need NEW_LINE or
NEW_POLYGON either (those are in 3DSTATE_WM).  Also, 3DSTATE_WM
doesn't appear to need BRW_NEW_NR_WM_SURFACES or BRW_NEW_CURBE_OFFSETS
either (those are in 3DSTATE_PS).

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>

(cherry-picked from commit 57b57f6d1c)
2011-07-19 16:39:55 -07:00
Henri Verbeet
d469ebaa0a glx: Avoid calling __glXInitialize() in driReleaseDrawables().
This fixes a regression introduced by commit
a26121f375 (fd.o bug #39219).

Since the __glXInitialize() call should be unnecessary anyway, this is
probably a nicer fix for the original problem too.

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

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: padfoot@exemail.com.au
(cherry picked from commit 0f20e2e18f)
2011-07-19 23:29:16 +02:00
Chad Versace
f5fa4606ea intel: Fix stencil buffer to be W tiled
Until now, the stencil buffer was allocated as a Y tiled buffer, because
in several locations the PRM states that it is. However, it is actually
W tiled. From the PRM, 2011 Sandy Bridge, Volume 1, Part 2, Section
4.5.2.1 W-Major Format:
    W-Major Tile Format is used for separate stencil.

The GTT is incapable of W fencing, so we allocate the stencil buffer with
I915_TILING_NONE and decode the tile's layout in software.

This fix touches the following portions of code:
    - In intel_allocate_renderbuffer_storage(), allocate the stencil
      buffer with I915_TILING_NONE.
    - In intel_verify_dri2_has_hiz(), verify that the stencil buffer is
      not tiled.
    - In the stencil buffer's span functions, the tile's layout must be
      decoded in software.

This commit mutually depends on the xf86-video-intel commit
    dri: Do not tile stencil buffer
    Author: Chad Versace <chad@chad-versace.us>
    Date:   Mon Jul 18 00:38:00 2011 -0700

On Gen6 with separate stencil enabled, fixes the following Piglit tests:
    bugs/fdo23670-drawpix_stencil
    general/stencil-drawpixels
    spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX16-copypixels
    spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX16-drawpixels
    spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX16-readpixels
    spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX1-copypixels
    spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX1-drawpixels
    spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX1-readpixels
    spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX4-copypixels
    spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX4-drawpixels
    spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX4-readpixels
    spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX8-copypixels
    spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX8-drawpixels
    spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX8-readpixels
    spec/EXT_packed_depth_stencil/fbo-stencil-GL_DEPTH24_STENCIL8-copypixels
    spec/EXT_packed_depth_stencil/fbo-stencil-GL_DEPTH24_STENCIL8-readpixels
    spec/EXT_packed_depth_stencil/readpixels-24_8

Note: This is a candidate for the 7.11 branch.

Signed-off-by: Chad Versace <chad@chad-versace.us>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit f7dbcba280)
2011-07-19 13:15:00 -07:00
Vadim Girlin
89ed95ad3d r600g: fix corner case checks for the queries 2011-07-18 09:00:42 -04:00
Christoph Bumiller
3b605cb0d6 nv50,nvc0: add correct storage type for Z32_FLOAT 2011-07-18 13:48:19 +02:00
Christoph Bumiller
9bfb79923f nv50,nvc0: don't advertise unaligned texture format support
Because we don't support them.
For instance, R32G32B32 is not R32G32B32X32 as was assumed.

Add support for R8G8B8X8_UNORM instead of R8G8B8_UNORM surfaces.
2011-07-18 13:45:52 +02:00
Vadim Girlin
7d8a04643f r600g: fix queries and predication
Use all zpass data for predication instead of the last block only.
Use query buffer as a ring instead of reusing the same area
for each new BeginQuery. All query buffer offsets are in bytes
to simplify offsets math.
2011-07-15 15:43:48 -04:00
Alex Deucher
3065bae508 r600c/g: add new NI pci ids
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2011-07-15 10:56:31 -04:00
Chia-I Wu
443ff6024d targets/egl-static: fix a linking error
rbug is always linked in and it needs libpthread.
(cherry picked from commit 5fe5d236c2)
2011-07-14 11:56:39 +08:00
Eric Anholt
a20a950829 i915: Add support for gl_FragData[0] for output color.
We advertised ARB_draw_buffers, but either fell back to software when
using this output, or assertion failed.  Fixes glsl-fs-fragdata-1, and
failures in some webgl conformance tests.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=39024
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34906
(cherry picked from commit 556a47a262)
2011-07-13 13:14:09 -07:00
Eric Anholt
9279c1e556 i915: Fix NPOT compressed textures on 915.
We were failing at rounding, misplacing the non-baselevels.  Fixes:
3DFX_texture_compression_FXT1/fbo-generate-mipmaps
ARB_texture_compression/fbo-generate-mipmaps
EXT_texture_compression_s3tc/fbo-generate-mipmaps

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit f2fd0d6304)
2011-07-13 13:14:09 -07:00
Eric Anholt
b8f722a82e i915: Fix map/unmap mismatches from leaving INTEL_FALLBACK during TNL.
The first rendering after context create didn't know of the color
buffer yet, triggering a sw fallback.  The intel_prepare_render() from
intelSpanRenderStart then found the buffer and turned off fallbacks,
but intelSpanRenderFinish was never called and things were left
mapped.  By checking buffers before making the call on whether to do
the fallback pipeline or not, we avoid the fallback change inside of
the rendering pipeline.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=31561
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 6e6b388604)
2011-07-13 13:14:09 -07:00
Eric Anholt
9304645a07 i965: Fix fp-dst-aliasing-[12].vpfp.
There's no pretty way to avoid the overwriting of the src operands, so
just use a temporary destination and rely on the MOV optimization.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 46a7639174)
2011-07-13 13:14:09 -07:00
Eric Anholt
c3b3719096 i965: Fix fp-lit-src-equals-dst.
We were stomping over the source for the body of the LIT instruction
when doing the MOV of 1.0 to the uninteresting channels.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit e3ea5bc08e)
2011-07-13 13:14:09 -07:00
Eric Anholt
55a75856fb intel: Remove gratuitous context checks in intel_delete_renderbuffer().
Even if we don't have a current context, if we're freeing the rb we
should free its region (and BO).  The renderbuffer unreference checks
appear to be just cargo-cult from the region unreference code.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=30217
Reviewed-by: Chad Versace <chad@chad-versace.us>
(cherry picked from commit 007c2d6cd2)
2011-07-13 13:14:09 -07:00
Eric Anholt
e3e99be131 intel: Allow intel_region_reference() with *dst != NULL.
This should help us avoid leaking regions in region reference code by
making the API more predictable.

Reviewed-by: Chad Versace <chad@chad-versace.us>
(cherry picked from commit 036b74a7f8)
(cherry picked from commit d8f65c07e9)
2011-07-13 13:12:55 -07:00
Eric Anholt
5a7d1c9710 glsl: Fix make clean for dricore.
(cherry picked from commit abbbd14dd4)
2011-07-13 13:08:23 -07:00
Eric Anholt
6ac5554298 i965: Reissue PIPELINE_POINTERS and BINDING_TABLE_POINTERS on SBA change.
This was a requirement we didn't run into until we started using
STATE_BASE_ADDRESS for instruction data.
(cherry picked from commit a09c5c2e30)
2011-07-13 13:08:23 -07:00
Eric Anholt
9eace71048 i965/gen6: Fix scissors using invalid STATE_BASE_ADDRESS.
The scissor state was incorrectly in a .prepare function instead of
.emit, so the packet would end up in the batch before the
STATE_BASE_ADDRESS.  It appears that this doesn't actually hurt, as
the scissor address gets dereferenced according to the current SBA at
draw time.
(cherry picked from commit cd7bfd5d44)
2011-07-13 13:08:23 -07:00
Stéphane Marchesin
8d9202c162 i915g: don't try to check if a NULL buffer is busy. 2011-07-13 12:08:10 -07:00
Alex Deucher
ef9f16f632 r600g: emit SQ_LDS_RESOURCE_MGMT
Need to be initialized to a reasonable value as
compute code may change it.

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

NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-07-12 12:04:57 -04:00
Brian Paul
d739434af8 glx: add a few missing glXChooseFBConfig() attributes
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=38842

NOTE: This is a candidate for the 7.11 branch.
(cherry picked from commit d60880db35)
2011-07-12 09:46:50 -06:00
Brian Paul
72f2bd2a41 glext.h: update to version 71
(cherry picked from commit bb0d5cae00)
2011-07-12 09:46:42 -06:00
Benjamin Franzke
b0549fab5c configure: Require libudev for drm & wayland egl platforms
NOTE: This is a candidate for the 7.11 branch.
(cherry picked from commit 7ed1826e2e)
2011-07-12 09:58:11 +02:00
Benjamin Franzke
ac88916978 configure: Fix typo in gbm check for egl drm platform
NOTE: This is a candidate for the 7.11 branch.
(cherry picked from commit 9b8cd49930)
2011-07-12 09:58:11 +02:00
Benjamin Franzke
336b2c7fbd configure: Enable st/gbm if st/egl has drm platform
NOTE: This is a candidate for the 7.11 branch.
(cherry picked from commit b18b2994ef)
2011-07-12 09:58:11 +02:00
Benjamin Franzke
a8907c6005 egl_dri2: Fix compilation if udev devel files are not installed
NOTE: This is a candidate for the 7.11 branch.
(cherry picked from commit b2d6375e6a)
2011-07-12 09:58:11 +02:00
Benjamin Franzke
89af428aea egl: Fix Terminate with shared gbm screens
NOTE: This is a candidate for the 7.11 branch.
(cherry picked from commit 992680c8b4)
2011-07-12 09:58:11 +02:00
Marek Olšák
8a77029f4c swrast: fix depth/stencil blits when there's no colorbuffer
NOTE: This is a candidate for the 7.10 and 7.11 branches.
(cherry picked from commit d1214cca08)
2011-07-11 23:03:34 +02:00
Marek Olšák
928bf189ff mesa: return early if mask is cleared to zero in BlitFramebuffer
From ARB_framebuffer_object:
    If a buffer is specified in <mask> and does not exist in both the
    read and draw framebuffers, the corresponding bit is silently
    ignored.
(cherry picked from commit 83478e5d59)
2011-07-11 23:03:25 +02:00
Vadim Girlin
a9e34ada26 r600g: LIT: clamp negative src.y to 0
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=39083

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-07-10 13:30:20 -04:00
Eric Anholt
804995807d i965/gen4: Fix GPU hangs since the program streaming change.
This was tricky.  We were doing a use-before-initialize of
grf_reg_count, but the value usually got overwritten anyway -- when we
didn't have to do a relocation (typical), or on gen5 when we didn't
have relocations at all.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38771
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit d03fdc4cde)
2011-07-09 07:52:35 -07:00
Ian Romanick
b033f050fd mesa: Fix the parsers build rule so that 'make tarballs' can work
You'd think that with all the commit messages about adding stuff to
tarballs or fixing 'make tarballs' that someone would have noticed
that it was completely broken for 4 months (3158cc7).
2011-07-08 18:47:21 -07:00
Ian Romanick
c66982f7dc mesa: Bump version to 7.11-rc1 2011-07-08 18:26:39 -07:00
Ian Romanick
530c68d616 glsl: Fix depth unbalancing problem in if-statement flattening
Previously, if max_depth were 1, the following code would see the
first if-statement (correctly) not get flattened, but the second
if-statement would (incorrectly) get flattened:

void main()
{
    if (a)
        gl_Position = vec4(0);

    if (b)
        gl_Position = vec4(1);
}

This is because the visit_leave(ir_if*) method would not decrement the
depth before returning on the first if-statement.

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

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit d2c6cef18a)
2011-07-08 16:02:20 -07:00
Vadim Girlin
576f489dad r600g: introduce r600_bc_src_toggle_neg helper and fix SUB & LRP
SUB & LRP instructions should toggle NEG bit instead of setting it,
otherwise e.g. "SUB a,b,-1" is translated as "ADD a,b,-1"

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2011-07-08 17:23:54 -04:00
Vadim Girlin
270de51f1d r600g: introduce r600_bc_src_set_abs helper and fix LOG
LOG instruction should use absolute values of source operand.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2011-07-08 17:23:34 -04:00
Vadim Girlin
57fe695a17 r600g: RSQ: clear NEG for operand
Need to clear NEG bit because it applies after ABS, e.g. "RSQ ..., -1"
uses -|1| as operand.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2011-07-08 17:23:21 -04:00
Vadim Girlin
189303fb30 r600g: LIT: swap MUL_LIT operands to fix 0^0
For 0^0 case result of "LOG_CLAMPED ...,0" is -MAX_FLOAT, and then result of
"MUL_LIT ...,0,-MAX_FLOAT,..." is -MAX_FLOAT instead of 0 because of special
src1 checks for -MAX_FLOAT. So swap src0/1:
"MUL_LIT ...,-MAX_FLOAT,0,..." to get expected 0, then result of
"EXP_IEEE ...,0" is 1 as expected for LIT.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2011-07-08 17:23:07 -04:00
Brian Paul
c4da12e74f glsl: use casts to silence warning
(cherry picked from commit 7eb7d67d50)
2011-07-08 08:03:56 -06:00
Brian Paul
8428b48673 gallivm: Fix build with llvm-3.0
LLVM 3.0svn changes pretty rapidly. The change in
Target->createMCInstPrinter() signature which inspired commits
40ae214067 and
92e29dc5b0 has been reverted.

Signed-off-by: Gustaw Smolarczyk <wielkiegie@gmail.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit fc98444bd5)

Conflicts:

	src/gallium/auxiliary/gallivm/lp_bld_debug.cpp
2011-07-08 08:03:40 -06:00
Marek Olšák
b0a4f34ea8 st/mesa: handle float formats in st_format_datatype
NOTE: This is a candidate for the 7.11 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 7de28e80dc)
2011-07-08 13:24:50 +02:00
Marek Olšák
efd0ffd1b0 st/mesa: use the first non-VOID channel in st_format_datatype
Otherwise PIPE_FORMAT_X8B8G8R8_UNORM and friends would fail.

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

Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 292148dc4b)
2011-07-08 13:24:42 +02:00
Stéphane Marchesin
dc062db95d i915g: Improve flushing using heuristics. 2011-07-08 00:28:29 -07:00
Stéphane Marchesin
b292ef8f88 i915g: Move back to the old method for target format fixup.
Conflicts:

	src/gallium/drivers/i915/i915_state_emit.c
2011-07-08 00:27:59 -07:00
Eric Anholt
d3bfa9bb4a intel: Fix use of freed buffer if glBitmap is called after a swap.
Regions looked up from the framebuffer are invalid after
intel_prepare_render().

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=30266
Tested-by: Thomas Jones <thomas.jones@utoronto.ca>
(cherry picked from commit 066bee64e1)
2011-07-07 15:05:24 -07:00
Paul Berry
98af042079 glsl: permit explicit locations on fragment shader outputs, not inputs
From the OpenGL docs for GL_ARB_explicit_attrib_location:

    This extension provides a method to pre-assign attribute locations to
    named vertex shader inputs and color numbers to named fragment shader
    outputs.

This was accidentally implemented for fragment shader inputs.  This
patch fixes it to apply to fragment shader outputs.

Fixes piglit tests
spec/ARB_explicit_attrib_location/1.{10,20}/compiler/layout-{01,03,06,07,08,09,10}.frag

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

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

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38624
(cherry picked from commit b078aad8ab)
2011-07-07 14:23:08 -07:00
Ian Romanick
127bd9d5b6 linker: Assign locations for fragment shader output
Fixes an assertion failure in the piglib out-01.frag
ARB_explicit_attrib_location test.  The locations set via the layout
qualifier in fragment shader were not being applied to the shader
outputs.  As a result all of these variables still had a location of
-1 set.

This may need some more work for pre-3.0 contexts.  The problem is
dealing with generic outputs that lack a layout qualifier.  There is
no way for the application to specify a location
(glBindFragDataLocation is not supported) or query the location
assigned by the linker (glGetFragDataLocation is not supported).

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

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38624
Reviewed-by: Eric Anholt <eric@anholt.net>
Cc: Kenneth Graunke <kenneth@whitecape.org>
Cc: Vinson Lee <vlee@vmware.com>
(cherry picked from commit d32d4f780f)
2011-07-06 17:06:29 -07:00
Ian Romanick
b8972db223 glsl: Don't choke when printing an anonymous function parameter
NOTE: This is a candidate for the 7.10 and 7.11 branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38584
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 174cef7fee)
2011-07-06 17:06:19 -07:00
Ian Romanick
f28cf18609 ir_to_mesa: Allocate temporary instructions on the visitor's ralloc context
And don't delete them.  Let ralloc clean them up.  Deleting the
temporary IR leaves dangling references in the prog_instruction.  That
results in a bad dereference when printing the IR with MESA_GLSL=dump.

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

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38584
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit dbda466fc0)
2011-07-06 17:05:50 -07:00
Ian Romanick
42cd6192a2 glsl: Track initial mask in constant propagation live set
The set of values initially available (before any kills) must be
tracked with each constant in the set.  Otherwise the wrong component
can be selected after earlier components have been killed.

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

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=37383
Reviewed-by: Eric Anholt <eric@anholt.net>
Cc: Kenneth Graunke <kenneth@whitecape.org>
Cc: Matthias Bentrup <matthias.bentrup@googlemail.com>
(cherry picked from commit 0eb9797958)
2011-07-06 17:05:36 -07:00
Vadim Girlin
1ae00c5960 r600g: fix buffer overflow check in r600_query_begin 2011-07-05 16:16:54 -04:00
Vadim Girlin
65d0d69c91 r600g: fix bo map usage flags in r600_query_begin 2011-07-05 16:16:40 -04:00
Vadim Girlin
433afb7352 r600g: reduce flushes for queries 2011-07-05 16:16:23 -04:00
Vadim Girlin
f70c2f8521 r600g: fix buffer offset in r600_query_begin 2011-07-05 16:16:05 -04:00
Chia-I Wu
e4cef07b87 egl: add copyright notices
The list of copyright holders could be incomplete.  Please update
directly or notify me if your name is missing.
(cherry picked from commit f2001df508)
2011-07-02 18:25:28 +09:00
Vadim Girlin
2196feb47f r600g: fix check for empty cs 2011-06-30 16:40:45 -04:00
Chia-I Wu
b90c710c6c target/egl-static: fix a compiler warning
(cherry picked from commit 3e3df5fcd1)
2011-06-30 15:01:17 +09:00
Chia-I Wu
bd1ceb5c5b targets/egl-static: fix library search order
Use

  $(MKLIB) -ldflags '-L$(TOP)/$(LIB_DIR)'

instead of

  $(MKLIB) -L$(TOP)/$(LIB_DIR)

to make sure the local library path appears before system's.
(cherry picked from commit 24137afb31)
2011-06-30 15:01:17 +09:00
Chia-I Wu
567778e49a targets/gbm: attemp to fix unresolved symbols
Move system libraries (usually .so) out of --start-group / --end-group
pair.  Add possiblly missing archives, defines, and shared libraries.
(cherry picked from commit 56ec8e17d3)
2011-06-30 15:01:17 +09:00
Chia-I Wu
0fafcc6919 targets/egl-static: do not use DRI_LIB_DEPS
It brings in libraries that are not necessarily needed.
(cherry picked from commit 1e9f0b1736)
2011-06-30 15:01:17 +09:00
Chia-I Wu
29574af377 egl: fix EGL_MATCH_NATIVE_PIXMAP
EGL_MATCH_NATIVE_PIXMAP is valid for eglChooseConfig, but invalid for
eglGetConfigAttrib.
(cherry picked from commit 8ea5330200)
2011-06-30 15:01:17 +09:00
Chia-I Wu
0eb780262c st/egl: update fbdev backend
Considering fbdev as an in-kernel window system,

 - opening a device opens a connection
 - there is only one window: the framebuffer
 - fb_var_screeninfo decides window position, size, and even color format
 - there is no pixmap

Now EGL is built on top of this window system.  So we should have

 - the fd as the handle of the native display
 - reject all but one native window: NULL
 - no pixmap support

modeset support is still around, but it should be removed soon.
(cherry picked from commit aa281dd392)
2011-06-30 15:01:16 +09:00
Chia-I Wu
e43a096f0c st/d3d1x: fix for st/egl native.h interface change
The interface was changed in 73df31eedd.
(cherry picked from commit 3a07d9594a)
2011-06-30 15:01:16 +09:00
Chia-I Wu
52aa06a2cd st/egl: fix a compile error
It is triggered when --with-driver=xlib is specified.
(cherry picked from commit ed47d65c7c)
2011-06-30 15:01:16 +09:00
Chia-I Wu
5d1561b4ab st/egl: reorganize backend initialization
Remove set_event_handler() and pass the event handler with
native_get_XXX_platform().  Add init_screen() so that the pipe screen is
created later.  This way we don't need to pass user_data to
create_display().
(cherry picked from commit 73df31eedd)
2011-06-30 15:01:16 +09:00
Kenneth Graunke
a8d7f36d65 i965/gen7: Add missing ! to brw->gs.prog_active assertion.
A typo in commit c173541d97 accidentally removed the !.
It's supposed to assert that there is _not_ an active GS program.

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

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry-picked from commit 5ddc518401)
2011-06-29 11:00:16 -07:00
Emil Velikov
82ebfa6387 st/mesa: Use correct internal target
Commit 1a339b6c(st/mesa: prefer native texture formats when possible)
introduced two new arguments to the st_choose_format() functions.
This patch fixes the order and passes the correct internal_target
rather than GL_NONE

NOTE: This is a candidate for the 7.11 branch
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 9b5c538726)
2011-06-29 07:20:08 -06:00
Andre Maasikas
ee416c6ffe st/mesa: fix overwriting gl_format with pipe_format since 9d380f48
fixes assert later on in texcompress2/r600g

Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 19789e403c)
2011-06-29 06:59:46 -06:00
Marek Olšák
ebc884d3dd r300g: drop support for ARGB, ABGR, XRGB, XBGR render targets
Blending and maybe even alpha-test don't work with those formats.

Only supporting RGBA, BGRA, RGBX, BGRX.

NOTE: This is a candidate for the 7.10 and 7.11 branches.
(cherry picked from commit bc517d64da)
2011-06-25 20:05:08 +02:00
Brian Paul
9383cfb4ba Revert "Fix 24bpp software rendering"
This reverts commit c0c0bb6cb1.
2011-06-25 06:20:32 -06:00
Stéphane Marchesin
ac8f59b23e i915g: always upload the vs constants.
This fixes a crash in llvm draw.
2011-06-24 19:59:17 -07:00
Eric Anholt
773556e0f5 i965/gen5: Fix grf_used calculation for 16-wide.
If we happened to allocate a texture result (or other vector) to the
highest hardware register slot, and we were in 16-wide, we would
under-count the registers used and potentially wrap around to g0 if
that allocation crossed a 16-register block boundary.  Bad rendering
and hangs ensued.

Tested-by: Ian Romanick <idr@freedesktop.org>
2011-06-24 17:57:53 -07:00
Stéphane Marchesin
7b44830ef4 i915g: add fake occlusion queries.
Those always return 0, but at least we don't crash when exposing GL 2.0.
2011-06-24 17:28:54 -07:00
Stéphane Marchesin
3a7953910a i915g: Don't do shader fixup if no surface is bound. 2011-06-24 16:43:58 -07:00
Stéphane Marchesin
1a69b50b3b i915g: Fix point sprites. 2011-06-24 16:30:19 -07:00
Brian Paul
6b28b44d45 indices: fix conversion of PIPE_PRIM_POLYGON to lines
When the fill mode is PIPE_POLYGON_MODE_LINE we were basically
converting the polygon into triangles, then drawing the outline of all
the triangles.  But we really only want to draw the lines around the
perimeter of the polygon, not the interior lines.

NOTE: This is a candidate for the 7.10 branch.
2011-06-24 16:44:43 -06:00
Paul Berry
95c2e0b601 i965: fix mask used to write to clip distance registers when gen>6
In gen6 and above, clip distances 0-3 are written to message register
3's xyzw components, and 4-7 to message register 4's xyzw components.
Therefore when when writing the clip distances we need to examine the
lower 2 bits of the clip distance index to see which component to
write to.

emit_vertex_write() was examining the lower 3 bits, causing clip
distances 4-7 not to be written correctly.

Fixes piglit test vs-clip-vertex-01.shader_test
2011-06-24 15:35:49 -07:00
Alex Deucher
3acae45915 r600g: limit fs_write_all shader rebuild to eg+
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-24 18:27:39 -04:00
Alex Deucher
feec48114b r600g: eg+ support for FS_COLOR0_WRITES_ALL_CBUFS
Evergreen+ don't support multi-writes so we need to emulate
it in the shader. Fixes the following piglit tests:
fbo-drawbuffers-fragcolor
ati_draw_buffers-arbfp-no-option

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-24 18:22:47 -04:00
Chad Versace
6062692cc6 intel: Fix workaround for _mesa_update_framebuffer
In intel_draw_buffer, there exists a workaround to prevent
_mesa_update_framebuffer from creating a swrast depth wrapper when
using separate stencil. This commit fixes the workaround, which was
incomplete for s8z24 texture renderbuffers.

Fixes fbo-blit-d24s8 on gen5 with separate stencil manually enabled.

Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-24 14:47:21 -07:00
Chad Versace
97f263c229 intel: Change framebuffer validation criteria
Since all infrastructure is now in place to support packed
depth/stencil renderbuffers when using separate stencil, there is no
need for special cases when separate stencil is enabled.

Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-24 14:47:21 -07:00
Chad Versace
e357ae9494 intel: In intel_update_wrapper, support s8z24 textures when using separate stencil
Also, in order to coerce intel_update_tex_wrapper_regions() to
allocate the hiz region, alter intel_update_tex_wrapper_regions() to
examine the renderbuffer format instead of the texture image format.

Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-24 14:47:20 -07:00
Chad Versace
bffae4c9cd intel: Factor region updates out of intel_update_wrapper
... and into new function intel_update_tex_wrapper_regions.

This prevents code duplication in the next commit.

Also add a note explaining that the hiz region is broken for mipmapped
depth textures.

Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-24 14:47:20 -07:00
Chad Versace
d09704b4e9 intel: During glTexImage, allocate renderbuffers for faking s8z24 textures
... when using separate stencil.

Define function intel_tex_image_x8z24_create_renderbuffers and call it
in intelTexImage after the miptree has been created and filled with data.

Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-24 14:47:20 -07:00
Chad Versace
5cd4d85517 intel: Declare some functions in intel_fbo.c as non-static
... because they will be needed by intel_tex_image_s8z24_create_renderbuffers.

Redeclared functions are:
    intel_alloc_renderbuffer_storage
    intel_renderbuffer_set_draw_offsets

Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-24 14:47:20 -07:00
Chad Versace
8869a26237 intel: Change signature of intel_create_wrapped_renderbuffer
Redeclare as non-static because
intel_tex_image_s8z24_create_renderbuffers will use it.

Remove the 'wrapper' parameter, because there is no wrapper for
intel_texture_image.depth_rb and stencil_rb.

Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-24 14:47:20 -07:00
Chad Versace
951b75808e intel: Perform gather on s8z24 texture images during glGetTexImage
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-24 14:47:19 -07:00
Chad Versace
01e493980c intel: Define functions intel_texture_s8z24_scatter/gather
... which copy the stencil bits between intel_image->depth_rb and
intel_image->stencil_rb.

Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-24 14:47:19 -07:00
Chad Versace
1a062dfc6f intel: Add fields to intel_texture for faking s8z24 with separate stencil
Add the fields depth_rb and stencil_rb, and put hooks in place to
release the renderbuffers in intelFreeTextureImageData and
intelTexImage.

Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-24 14:47:19 -07:00
Stéphane Marchesin
407832b0d2 st/mesa: add PIPE_FORMAT_R8G8B8A8_UNORM as the first RGBA format.
Otherwise we can end up creating RGBA render targets (which are BGRA on the
hardware), and then we bind them as RGBA textures (which are RGBA on the
hardware). This generates software fallbacks every time we bind the frame as
a texture.
2011-06-24 14:32:48 -07:00
Marek Olšák
100a37587f mesa: don't allocate memory in _mesa_unpack_depth_span if we don't need it
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-06-24 22:09:27 +02:00
Marek Olšák
12c105b5de mesa: fix a memory leak in _mesa_unpack_depth_span
NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-06-24 22:09:27 +02:00
Marek Olšák
e41a91cea7 mesa: fix texstore of DEPTH24_STENCIL8 if srcFormat is STENCIL_INDEX
NOTE: This is a candidate for the 7.10 branch.
2011-06-24 22:09:27 +02:00
Marek Olšák
2b41399bb4 mesa: remove unused function _mesa_new_depthstencil_renderbuffer
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-06-24 22:09:27 +02:00
Brian Paul
09e71cf722 st/mesa: fix pipe_get_transfer() call in fallback_copy_texsubimage()
Commit 1a339b6c71 caused us to take
a different path through the glCopyTexSubImage() code.  The
pipe_get_transfer() call neglected to pass the texture's level, face
and slice info.  So we were always transferring from the 0th mipmap
level even when the source renderbuffer was a non-zero mipmap level
in a texture.

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

NOTE: This is a candidate for the 7.10 branch.
2011-06-24 14:03:40 -06:00
Benjamin Franzke
629c15aaac egl_dri2: Build drm platform only if enabled 2011-06-24 22:00:45 +02:00
Vadim Girlin
eafd331cf3 r600g: implement fragment and vertex color clamp
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=38440

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2011-06-24 15:23:41 -04:00
Vadim Girlin
d81126b714 r600g: optimize spi update
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2011-06-24 15:23:38 -04:00
Vadim Girlin
8567e02dca r600g: LIT: fix x&y slots order
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2011-06-24 15:23:35 -04:00
Eric Anholt
0c27dcb75c i965: Make the brw_format_for_mesa_format table static const.
Once again, assuming the compiler is clever works out so poorly.  The
generated code initialized the structure on the stack, then did a
lookup into it.  This was a performance regression from
70c6cd39bd.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-06-24 10:37:22 -07:00
Eric Anholt
3541cc0d40 i965: Don't bother telling swrast_setup about state updates until fallback.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-06-24 10:37:18 -07:00
Eric Anholt
6cf3d1cace i965: Don't bother telling tnl about state updates unless we fall back.
This was sucking up 1% of the CPU on 3DMMES.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-06-24 10:37:15 -07:00
Eric Anholt
18d4a44bdc i965: Reuse existing program data when a new compiled program matches.
It's common in applications just before the advent of
EXT_separate_shader_objects to have multiple linked shaders with the
same VS or FS.  While we aren't detecting those at the Mesa level, we
can detect when our compiled output happens to match an existing
compiled program.

This patch was created after noting the incredible amount of compiled
program data generated by Heroes of Newerth.  It reduces the program
data in use at the start menu (replayed by apitrace) from 828kb to
632kb, and reduces CACHE_NEW_WM_PROG state flagging by 3/4.  It
doesn't impact our rate of hardware state changes yet, because things
depending on CACHE_NEW_WM_PROG also depend on BRW_NEW_FRAGMENT_PROGRAM
which is still being flagged.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-06-24 10:36:49 -07:00
Brian Paul
d91dc4a356 st/mesa: fix all_varyings_in_vbos() regression
Fixes regression from d631c19db4.
See http://bugs.freedesktop.org/show_bug.cgi?id=38626
2011-06-24 10:41:44 -06:00
Marc Pignat
c0c0bb6cb1 Fix 24bpp software rendering
This patch add the support for 24bpp in the dri/swrast implementation.

Signed-off-by: Marc Pignat <marc@pignat.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-06-24 09:38:24 -06:00
Brian Paul
08183357c0 gallium/tests/trivial: update comment 2011-06-24 09:02:57 -06:00
Brian Paul
b663292ae9 gallium/tests/trivial: use CXX to do final link 2011-06-24 09:02:47 -06:00
Alon Levy
c9760c5c89 gallium/tests/trivial: make it build
Signed-off-by: Alon Levy <alevy@redhat.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-06-24 08:59:42 -06:00
Chia-I Wu
febf5e4147 st/egl: make native_buffer interface typed
Use a typed struct to describe the native buffer and let the backends
map the native buffer to winsys_handle for
resource_from_handle/resource_to_handle.
2011-06-24 16:49:27 +09:00
Chia-I Wu
875a1f8960 targets/egl: removed
Not used.
2011-06-24 16:49:27 +09:00
Chia-I Wu
b8f097f7a0 targets/egl-static: replace targets/egl
Build egl_gallium from targets/egl-static intead of targets/egl.  The
latter exposes (unversioned) gallium interfaces and is frowned upon.
2011-06-24 16:49:27 +09:00
Chia-I Wu
7451bffad4 targets/egl-static: allow st/mesa to be dynamically loaded
When shared glapi is not enabled, there are two glapi providers and we
cannot decide which one to link to at build time.  It results in
unresolved symbols in st/mesa.  This commit makes st/mesa a loadable
module when shared glapi is not enabled, and hopes that the apps will
link to one of the glapi providers (GL or GLES).
2011-06-24 16:43:03 +09:00
Chia-I Wu
a000745f80 targets/egl-static: add support for driver lookup
Use pci id to driver map to look up the driver name.  This is based on
a433755ec5.
2011-06-24 16:43:03 +09:00
Chia-I Wu
f36d210c93 targets/gbm: build pipe drivers
Build pipe drivers here instead of using those built by the
soon-to-be-removed targets/egl.

[with an update by Benjamin Franzke to use --{start|end}-group]
2011-06-24 16:43:03 +09:00
Benjamin Franzke
15e64242f9 configure: Disable drm egl platform by default
So that gbm(_dri) which pulls in shared-glapi is not needed.
2011-06-24 09:37:19 +02:00
Stéphane Marchesin
d3d3fea720 dri/r200: properly spell current_atom. 2011-06-23 21:00:26 -07:00
Stéphane Marchesin
5f691ba36f dri/r200: rename __atom to current_atom.
__atom is defined by gcc when the atom compile optimizations are used.
2011-06-23 20:58:05 -07:00
Vinson Lee
ad7387fe12 gallivm: Fix x86 build with llvm-3.0svn.
LLVM revision 133739 renamed StackAlignment to StackAlignmentOverride.
2011-06-23 20:48:05 -07:00
Chia-I Wu
45aecf0114 st/egl: drop guess_gl_api from egl_g3d_loader
It is not used and confusing.
2011-06-24 12:18:52 +09:00
Chia-I Wu
cb29ee91a2 st/egl: use a helper to get st_api from the loader 2011-06-24 12:18:52 +09:00
Brian Paul
ca7510bbf9 mesa: fix incorrect error string 2011-06-23 17:09:13 -06:00
Christoph Bumiller
9c5d15e929 nv50,nvc0: prevent pushbuf flush during ctx reloc emission
Should unify this too, but will delay that until the planned
libdrm_nouveau/winsys changes which are likely to cause major
changes to this bo validation code too.
2011-06-24 00:15:58 +02:00
Brian Paul
1f544cc587 st/mesa: fix format selection regression
Note all gallium formats are supported by Mesa so disable them.
Fixes regression from 1a339b6c71.

See https://bugs.freedesktop.org/show_bug.cgi?id=38602
2011-06-23 16:06:42 -06:00
Eric Anholt
d631c19db4 vbo: Don't discount stride == 0 for testing all varyings in VBOs.
In fixed function, stride == 0 (e.g. glColor4f() outside of the draw
call) would get turned into uniform inputs, which is why it was
ignored originally in this test.  For shaders, drivers end up seeing a
need to upload stride == 0 data, and get confused by needing to upload
when vbo_all_varyings_in_vbos() returned true.  In the 965 driver
case, it wouldn't bother to compute the min/max index, and uploaded
nothing if the min/max wasn't known.

We've talked about removing the ff stride=0-into-uniforms code, so
this check shouldn't be missed once that's gone.

Fixes ARB_vertex_buffer_object/mixed-immediate-and-vbo
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=37934
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-06-23 13:43:23 -07:00
Eric Anholt
8f28c05d07 vbo: Don't bother checking for stride == 0 for "any varying in a VBO".
We would still want to consider that data as being in a VBO even if we
managed to produce this case, which as far as I know we can't.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-06-23 13:43:17 -07:00
Eric Anholt
babe1fc004 i965/gen6: Add a couple more packets to the nonpipelined workaround list.
All the packets chosen before came from grepping the pdf for
nonpipelined, and these two came from grepping for non.pipelined.  We
could stand a review by looking at all packets emitted and identifying
what kind they are.
2011-06-23 13:41:42 -07:00
Paul Berry
935e7e4126 glsl: Flagged extension EXT_texture3D as "supported" in the builtin compiler.
Previously, the builtins in OES_texture_3D.{frag,vert} were only
compiling properly as a consequence of bug 38015, which allows
unsupported extensions to be enabled.  This fix eliminates the builtin
compiler's reliance on bug 38015, so that bug 38015 can be fixed.
2011-06-23 13:39:47 -07:00
Benjamin Franzke
e9d49d282d st/egl: Fix scons build 2011-06-23 22:23:57 +02:00
Benjamin Franzke
737bd7367e st/egl: Hookup gbm for drm backend 2011-06-23 21:07:17 +02:00
Benjamin Franzke
e5fc4c81ce egl_dri2: Hookup gbm as drm platform 2011-06-23 21:07:17 +02:00
Benjamin Franzke
48d4a001b3 gbm: Add gallium (drm) backend 2011-06-23 21:07:17 +02:00
Benjamin Franzke
2ff797060d gbm: Add dri backend 2011-06-23 21:07:17 +02:00
Benjamin Franzke
eddcecbf74 Add gbm (generic/graphics buffer manager) 2011-06-23 21:07:17 +02:00
Benjamin Franzke
15d7f1c1c7 st/dri: Implement DRIimageExtension::dupImage 2011-06-23 21:07:17 +02:00
Benjamin Franzke
3af3c58dfd intel: Implement DRIimageExtension::dupImage 2011-06-23 21:07:17 +02:00
Benjamin Franzke
5fbbd4c19f dri: Add dupImage to DRIimageExtension 2011-06-23 21:07:17 +02:00
Benjamin Franzke
fa5478c5fe r600g: Add R8G8B8A8_UNORM to evergreen colorswap table
Fixes broken glTexImage2D with format=GL_RGBA since
1a339b6c71

The origin for this behaviour is that r600_is_format_supported
checks only against r600_state_inline.h tables not evergreens.
2011-06-23 21:06:36 +02:00
Marek Olšák
1e5cef96d1 r600g: bump shader input limits 2011-06-23 15:58:49 +02:00
Brian Paul
8a5a28b731 st/wgl: return height, not width for WGL_PBUFFER_HEIGHT_ARB
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=38599
2011-06-23 06:54:53 -06:00
Benjamin Franzke
87c3bb65bb st/egl/wayland: Take resize parameters only if size changes
This matches what we do in egl_dri2, and clients should
behave like this anyway.
2011-06-23 12:17:48 +02:00
Chia-I Wu
7587c140cd st/mesa: use a helper for st_framebuffer creation
In st_api_make_current, we would like to reuse the exising
st_framebuffer if possible.  Use a helper function to make the code
clearer.
2011-06-23 10:36:00 +09:00
Stéphane Marchesin
1a339b6c71 st/mesa: prefer native texture formats when possible.
If possible, we want to match the hardware format to what the app uses. By
doing so, we avoid the need for pixel conversions and therefore greatly speed
up texture uploads.
2011-06-22 17:02:21 -07:00
Stéphane Marchesin
98ce1373e4 i915g: Add draw point sprites.
It's not that much work; hopefully blend func separate also works and we get GL 2.0 for real.
2011-06-22 16:51:02 -07:00
Stéphane Marchesin
468c2c0841 i915g: Fix comment.
Reported-by: Marcin Baczynski <marbacz@gmail.com>
2011-06-22 16:47:36 -07:00
Stéphane Marchesin
465183c6ae i915g: Support more texture and render target formats. 2011-06-22 16:44:54 -07:00
Alex Deucher
5ff22ab229 r600c: add missing bank tiling case for evergreen
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-22 12:38:29 -04:00
Alex Deucher
c4930cb417 r600g: fix num_banks interpretation on eg+
Field is encoded:
0 = 4 banks
1 = 8 banks
2 = 16 banks

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-22 12:34:37 -04:00
Michel Dänzer
eb2c9b5814 r600g: Fix use of uninitialized local variable extra_size.
Should fix http://bugs.freedesktop.org/show_bug.cgi?id=38566 .
2011-06-22 16:23:36 +02:00
Thierry Vignaud
76bd1c1818 mesa: add missing DRI Makefiles to tarball
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-06-22 08:22:02 -06:00
Brian Paul
9786688672 mesa: comments and 80-column wrapping 2011-06-22 08:12:10 -06:00
Brian Paul
3c95ff209f mesa: update comments in update_program_enables() 2011-06-22 08:12:10 -06:00
Brian Paul
79dddedfd1 mesa: update/fix comments in update_program() 2011-06-22 08:12:10 -06:00
Brian Paul
f3f080e526 mesa: update comment for gl_texture_unit 2011-06-22 08:12:10 -06:00
Marcin Slusarz
50d7d03a79 xorg/nouveau: blacklist all pre NV30 cards
Bail out early in probe, so other driver can take control of the card.
Doing it in screen_create would be too late.
2011-06-22 12:35:40 +02:00
Andre Maasikas
63e8cda9f1 r600c: use BASE_VTX_LOC & AUTO_INDEX for drawing nonindexed with offset
Saves cmd buffer space as we were generating indexes into cs  in this case.
This was laying around in https://bugs.freedesktop.org/show_bug.cgi?id=32768
for a long time.
2011-06-22 12:40:12 +03:00
Alex Deucher
21972c85ea r600g: fix fbo depth/stencil texture allocation for evergreen+
evergreen+ stores depth and stencil separately so when we
allocate a depth/stencil fbo, make sure we allocate enough
memory for both depth and stencil buffers.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-21 17:32:42 -04:00
Chad Versace
3db27d4a4a intel: Allocate s8_z24 non-texture renderbuffers when using separate stencil
Now all infrastructure is in place to support s8_z24 non-texture
renderbuffers for gen7.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-21 11:22:05 -07:00
Chad Versace
36e05c6870 intel: Unobfuscate intel_alloc_renderbuffer_storage
Hiz buffer allocation can only occur if the 'else' branch has been taken,
so move the hiz buffer allocation into the 'else' branch.

Having the hiz buffer allocation dangling outside of the if-tree was just
damn confusing.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-21 11:21:57 -07:00
Chad Versace
39d0e3632a intel: Add fields to intel_renderbuffer for unwrapping packed depth/stencil buffers
Add the following fields:
    intel_renderbuffer.wrapped_depth;
    intel_renderbuffer.wrapped_stencil

If the intel_context is using separate stencil and the renderbuffer has
a packed depth/stencil format, then wrapped_depth and wrapped_stencil are
the real renderbuffers.

Alter the following functions to accomodate the wrapped buffers:
    intel_delete_renderbuffer
    intel_draw_buffer
    intel_get_renderbuffer
    intel_renderbuffer_map
    intel_renderbuffer_unmap

Subsequent commits allocate renderbuffer storage for wrapped_depth and
wrapped_stencil.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-21 11:21:57 -07:00
Chad Versace
23ed3b90c7 intel: Unconditionally enable support for S8_Z24 texture format
Commit b5c847c7ca erroneously disabled
support for S8_Z24 texture format when the context required separate
stencil (intel_context.must_use_separate_stencil).

But the GL spec requires implementations to support GL_DEPTH24_STENCIL8.
So we better find a way to fake it...

From page 180 (196 of pdf) of the OpenGL 3.0 spec:
    In addition, implementations are required to support the following
    sized internal [texture] formats.

    [...]

    - Combined depth+stencil formats: DEPTH32F_STENCIL8 and and
      DEPTH24_STENCIL8.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-21 11:21:57 -07:00
Benjamin Franzke
0cb356dd5c egl_dri2/wayland: Hook up new buffer.release event 2011-06-21 13:11:43 -04:00
Benjamin Franzke
8c91d751c8 winsys/wayland: Fix warning 2011-06-21 13:11:43 -04:00
Benjamin Franzke
0c74091591 st/mesa: Invalidate drawables on context switch 2011-06-21 15:09:55 +02:00
Dave Airlie
e251b3903a r600g: use maths instead of a loop to work out mask.
This is equivalent results with less looping.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-21 15:18:44 +10:00
Dave Airlie
59a402cecd r600g: optimise draw vbo function a bit more.
this drop a bunch of unnecessary checks (i.e. should be trapped
at gallium level), and also removes the switch statement in favour
of some calculated values for the vgt values.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-21 14:20:49 +10:00
Pierre-Eric Pelloux-Prayer
abe74a9820 r600g: reorder LIT instructions to support src == dst
the attached patch should be an improvement over Vadim Girlin's patch
fixing LIT instruction for r600g (commit
2fe39b46e7).

Instructions used in tgsi_lit have been reordered to always write to a
dst channel after the same channel in src has been read (so if src ==
dst, input values are not overwritten before being used).

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-21 12:50:44 +10:00
Ben Skeggs
4112ca54e3 nvfx: nasty hack to make glFinish() actually finish..
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-06-21 12:59:53 +10:00
Stéphane Marchesin
75be6b76ee glx: Fix compile. 2011-06-20 17:19:00 -07:00
Stéphane Marchesin
649d03d54d st/mesa: Remove unneeded texture format terminators.
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-06-20 18:15:50 -06:00
Brian Paul
bc60a7515a st/mesa: put const qualifer on format_map table 2011-06-20 18:15:50 -06:00
Jeremy Huddleston
4fbdde889c glx: Bind to our context before __glXSetCurrentContext
We want to bind to our context before calling __glXSetCurrentContext or
messing with the gc rect in order to properly handle error conditions.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-20 16:54:58 -07:00
Jeremy Huddleston
517614141b glx: Destroy the old context only after the new one has been bound
This fixes a regression introduced by 49d7e48b33

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-20 16:54:58 -07:00
Jeremy Huddleston
559e4f8ebc glx: Allow a context-specific fallback for glXGetProcAddress
In applegl, GLX advertises the same extensions provided by OpenGL.framework
even if such extensions are not provided by glapi.  This allows a client
to get access to such API.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-20 16:54:58 -07:00
Jeremy Huddleston
fbd7448977 glapi: Update specs to correctly list FramebufferTextureLayerARB as an alias of FramebufferTextureLayerEXT
FramebufferTextureLayer is an alias of FramebufferTextureLayerEXT, so
FramebufferTextureLayerARB needs to be listed as an alias of
FramebufferTextureLayerEXT rather than FramebufferTextureLayer.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-20 16:54:58 -07:00
Ian Romanick
de77324d8f linker: Reject shaders that use too many varyings
Previously it was up to the driver or later code generator to reject
these shaders.  It turns out that nobody did this.

This will need changes to support geometry shaders.

NOTE: This is a candidate for the stable branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=37743
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-06-20 15:01:10 -07:00
Dan Nicholson
4e5c51a05e glw: Mark all extern symbols GLAPI to regain default visibility (#31294)
Since switching to hidden visibility on gcc, GLw apps were failing to
link. Use the GLAPI definition to use default visibility where necessary.

$ nm lib/libGLw.so | grep DrawingArea
0000000000004020 T GLwCreateMDrawingArea
0000000000003430 T GLwDrawingAreaMakeCurrent
0000000000003410 T GLwDrawingAreaSwapBuffers
0000000000204c60 D glwDrawingAreaClassRec
0000000000204d48 D glwDrawingAreaWidgetClass
00000000002053c0 D glwMDrawingAreaClassRec
00000000002054e0 D glwMDrawingAreaWidgetClass

Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
Tested-by: justin <jlec@gentoo.org>
2011-06-20 12:31:01 -07:00
Eric Anholt
f6e5230b26 i965/gen6: Apply documented workaround for nonpipelined state packets.
Fixes a 100% reproducible GPU hang in topogun-1.06-orc-84k.trace.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-06-20 08:42:16 -07:00
Eric Anholt
0ab7d6f437 i965/gen6: Limit the workaround flush to once per primitive.
We're about to call this function in a bunch of state emits, so let's
not spam the hardware with flushes too hard.
2011-06-20 08:37:43 -07:00
Eric Anholt
dfada714f8 i965/gen6: Use an BO instead of writing to address 0 for PIPE_CONTROL W/A.
This was spectacularly unsafe.  On my system, address 0 happens to be
the hardware status page for the render ring, and the first quadword
of that happens to contain nothing we ever look at, but I sure didn't
look forward to having to debug some day when, for example, the kernel
happened to bind the ringbuffer before binding the hwsp.
2011-06-20 08:37:43 -07:00
Eric Anholt
8f9e8d79c8 i965/gen6: Factor the PIPE_CONTROL workaround to a separate function.
We're need this workaorund a lot more than we're currently doing, so
let's reuse it.
2011-06-20 08:37:43 -07:00
Eric Anholt
911768700e i965/gen6: Remove state flagging on BRW_NEW_CURBE_OFFSETS.
That flag was leftover from gen4, where brw_curbe.c is choosing ranges
of the CURBE space for constants to live in, and the unit state tells
where to load them from.  That's not the case on gen6 -- we don't set
this flag (since constants aren't in the URB), nor do we have any
state like that to upload.
2011-06-20 08:37:43 -07:00
Eric Anholt
c860f48f11 i965/gen4: Remove old VS unit state key structure.
We're streaming VS state out now, not caching it.
2011-06-20 08:37:42 -07:00
Eric Anholt
7d4d608240 i965/gen6: Add missing state flag for VS push constants.
It was already annotated up above and everything.
2011-06-20 08:37:42 -07:00
Eric Anholt
b46dc45cee i965/gen6+: Correct gratuitous dependency on NEW_POLYGONSTIPPLE.
That flag is for the contents of the stipple, not the enable flag.
2011-06-20 08:37:42 -07:00
Eric Anholt
416a698b3c i965/gen6+: Add a missing state flag for WM constants. 2011-06-20 08:37:42 -07:00
Kristian Høgsberg
16a04e019d wayland: Pass use_invalidate extension to driver 2011-06-20 11:05:26 -04:00
Benjamin Franzke
80636ff2da egl_dri2/x11: Check availability of the dri2 extension
Do this before query versions, or xcb will shutdown
and the connection can not be used for swrast.
2011-06-20 10:06:24 -04:00
Chia-I Wu
8eea050f5a docs: update EGL for changed configure options 2011-06-20 11:19:16 +09:00
Chia-I Wu
66c71d150a configure.ac: remove deprecated EGL options 2011-06-20 11:19:16 +09:00
Marcin Slusarz
c772d4e6f3 xorg/nouveau: rename to nouveau2
Signed-off-by: Marek Olšák <maraeo@gmail.com>
2011-06-20 02:29:28 +02:00
Marcin Slusarz
a97b40a886 st/xorg: initialize drm_mode.type
it's uninitialized, but used by kernel (drm_mode_setcrtc -> drm_mode_set_crtcinfo)

Signed-off-by: Marek Olšák <maraeo@gmail.com>
2011-06-20 02:28:02 +02:00
Marcin Slusarz
21c0556b61 st/xorg: add GALLIUM_AUXILIARIES to target dependencies
Without it changes to GALLIUM_AUXILIARIES don't induce target rebuild

Signed-off-by: Marek Olšák <maraeo@gmail.com>
2011-06-20 02:26:53 +02:00
Marcin Slusarz
2f6a9687cf gallium/nouveau: remove unused nouveau_screen_bo_user 2011-06-20 02:23:12 +02:00
Marcin Slusarz
fe20edf959 st/xorg: fix crash triggered by rendercheck -t composite -f a8r8g8b8 -o Src, Saturate
samplers[0] may remain uninititialized if src picture/pixmap is null
2011-06-20 02:20:26 +02:00
Marcin Slusarz
54d1b718b8 st/xorg: fix crash triggered by rendercheck -t blend -f a8r8g8b8 -o Clear 2011-06-20 02:11:12 +02:00
Marek Olšák
badf0335ef r600g: implement seamless_cube_map on r600-r700
st/mesa guarantees that all bound sampler states have the same value
in seamless_cube_map.
2011-06-20 00:19:07 +02:00
Marek Olšák
9bcce02f47 r600g: remove some magic numbers 2011-06-19 23:28:33 +02:00
Marek Olšák
1251e1df0f configure.ac: add back --enable-gallium-egl 2011-06-19 21:15:55 +02:00
Cyril Brulebois
9ba2907f2e configure.ac: Avoid running llvm-config when it hadn't been checked for.
If --disable-gallium is passed, llvm-config isn't checked for, so mark
it explicitly as absent, through LLVM_CONFIG=no.

Passing --disable-gallium would result in:
| ../configure: line 9739: --version: command not found
| ../configure: line 9740: --cppflags: command not found
| ../configure: line 9741: --libs: command not found
| ../configure: line 9743: --ldflags: command not found

With this commit, one gets that instead:
| configure: error: LLVM is required to build Gallium R300 on x86 and x86_64

Signed-off-by: Cyril Brulebois <kibi@debian.org>
2011-06-19 21:15:55 +02:00
Marek Olšák
0c7c5b6876 configure.ac: build r600g by default
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-19 21:15:52 +02:00
Marek Olšák
58b6a19ea4 configure.ac: add option --with-gallium-drivers=DIRS
This removes all the --enable-gallium-$driver options and --disable-gallium.

Gallium can be disabled by --with-gallium-drivers= (without parameters).

Default is:
--with-gallium-drivers=r300,swrast

Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-19 21:15:48 +02:00
Marek Olšák
440d71db78 configure.ac: remove --with-state-trackers
There is an obvious redundancy:

--with-driver=dri VS --with-state-trackers=dri
--with-driver=xlib VS --with-state-trackers=glx
--enable-openvg VS --with-state-trackers=vega
--enable-egl VS --with-state-trackers=egl

This patch adds two new options for the remaining state trackers:
--enable-xorg
--enable-d3d1x

Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-19 21:15:45 +02:00
Marek Olšák
ad50abbac9 configure.ac: remove redundant option --enable-gallium-egl
We already have --enable-gallium, --enable-egl, and --with-state-trackers=egl.

Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-19 21:13:57 +02:00
Marek Olšák
d1f66a9424 u_vbuf_mgr: make u_vbuf_mgr_draw_begin return flags in a bitmask 2011-06-19 21:09:18 +02:00
Marek Olšák
8623c68aec r600g: fix warning: assignment discards qualifiers from pointer target type 2011-06-19 21:09:18 +02:00
Marek Olšák
0d58723cde u_vbuf_mgr: fix uploading if format size is greater than stride 2011-06-19 21:09:18 +02:00
Kenneth Graunke
dd3b812962 i965: Enable extension GL_ARB_shader_texture_lod.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=36987

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-18 17:54:01 -07:00
Kenneth Graunke
6430df3773 i965/fs: Add support for TXD with shadow comparisons.
Our hardware doesn't have a sample_d_c message, so we have to do a
regular sample_d and emit instructions to manually perform the
comparison.

This requires a state dependent recompile whenever the sampler's compare
mode or function change.  This adds the per-sampler comparison functions
to brw_wm_prog_key, but only sets them when the sampler's compare mode
is GL_COMPARE_R_TO_TEXTURE (i.e. only for shadow sampling).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-18 17:53:57 -07:00
Kenneth Graunke
01fa9addf4 i965/fs: Refactor texture result swizzling into a helper function.
The next patch will add a few additional uses.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-18 17:53:55 -07:00
Kenneth Graunke
f1622cfe9c i965/fs: Move sampler fetch to the top of the ir_texture visit function.
This makes it available earlier, which will soon be necessary.
(Separating code motion from actual changes.)

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-18 17:53:53 -07:00
Kenneth Graunke
6c947cfd19 i965/fs: Add support for non-shadow textureGrad (TXD) on gen4.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-18 17:53:52 -07:00
Kenneth Graunke
2f4a4b943f i965/fs: Add support for non-shadow textureGrad (TXD) on gen5/6.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-18 17:53:50 -07:00
Kenneth Graunke
3fa910fff9 i965/fs: Add support for non-shadow textureGrad (TXD) on Ivybridge.
This is somewhat ugly, but I couldn't think of a nicer way to handle the
interleaved coordinate/derivative parameter loading.

Ironlake and Sandybridge will still hit an assertion in visit().

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-18 17:53:47 -07:00
Kenneth Graunke
ad9481e128 i965/fs: Check for compilation failure and bail before optimizing.
Prior to this patch, it would attempt to optimize and allocate registers
for the program even if it failed to compile.  This seems wasteful.

More importantly, the "message length > 11" failure seems to choke the
instruction scheduler, making it somehow use an undefined value and
segmentation fault.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-18 17:53:24 -07:00
Eric Anholt
c173541d97 i965: Use state streaming on programs, and state base address on gen5+.
There will be a little bit of thrashing of the program cache BO as the
cache warms up, but once the application is in steady state, this
reduces relocations on gen5 and later.

On my T420 laptop, cairogl firefox-talos-gfx performance improves 2.6%
+/- 1.3% (n=6).  No statistically significant performance difference
on nexuiz (n=5).
2011-06-18 16:00:45 -07:00
Eric Anholt
962dab9486 i965: Only flag the new-batch related state as dirty at new batch time.
This was debug code from the initial import of the driver.  No
statistically significant performance difference on cairo-gl or
nexuiz (n=6).
2011-06-18 16:00:45 -07:00
Eric Anholt
6f998b58bc mesa: Fix render-to-texture regression.
Accidentally introduced in fc8c4a3a7b.
Fixes fbo-drawbuffers-maxtargets and friends.
2011-06-18 15:59:00 -07:00
Eric Anholt
001e071443 mesa: Flag _NEW_BUFFERS when unbinding an attachment on glDeleteTextures.
The _ColorDrawBuffers[] wouldn't get updated despite us having updated
what it depends on (Attachments[]->Renderbuffer).  Other callers of
_mesa_remove_attachment are already flagging _NEW_BUFFERS for other
reasons.  The specific bug report that led to this fix (and
the fbo-finish-deleted testcase) was fixed by
23b6f9606d, though.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-06-18 15:26:26 -07:00
Eric Anholt
a5a36d9b15 i965: Don't try to continue space before the start of a VBO.
This loop is trying to see if all the buffers to be uploaded happen to
be the same increment from the start of the 3DSTATE_VERTEX_BUFFERS
currently loaded in the hardware.  However, we might be at a smaller
offset than the previous set of VERTEX_BUFFERS, so we can't reuse
because that packet made the first entry be its starting offset (you
can't access outside the given bounds).

Fixes piglit ARB_vertex_buffer_object/elements-negative-offset.
2011-06-18 15:20:36 -07:00
Eric Anholt
5c2c60175d i965: Add missing state flag for vertex elements on current VS program.
Fixes a missing 3DSTATE_VERTEX_ELEMENTS on topogun.trace.
2011-06-18 15:20:35 -07:00
Marek Olšák
a4f4e24f07 r300g: rename AOS -> VARRAYS 2011-06-18 21:09:08 +02:00
Marek Olšák
7df7eaf845 r300g: fix handling PREP_* options
This should fix rendering >65532 vertices using draw_arrays on r300-r400.

NOTE: This is a candidate for the 7.10 branch.
2011-06-18 21:09:08 +02:00
Vadim Girlin
2fe39b46e7 r600g: fix LIT to handle src==dst properly
Current LIT implementation uses dst components for storing temp
results, possibly overwriting still needed values (depends on the
swizzles).
This patch uses temp reg for one of such cases (found in etqw) and
fixes "LIT R.z, R.xyzz".

Tested on evergreen. Fixes some etqw-demo rendering glitches when
"Lighting" is set to "High" in the settings.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-18 16:03:04 +10:00
Vadim Girlin
8ab1c5328b r600g: fix RSQ to use abs value of operand on evergreen
fixes https://bugs.freedesktop.org/show_bug.cgi?id=36917

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-18 16:01:03 +10:00
Vadim Girlin
a916d4279a r600g: fix source box in r600_resource_copy_region
Source box needs to be adjusted for blitting from compressed formats.

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

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-18 15:45:59 +10:00
Brian Paul
753660780a mesa: allow depth texture arrays
The GL_EXT_texture_array spec allows this (Section 3.8.1).
Fixes failing piglit fbo-depth-array test.

NOTE: This is a candidate for the 7.10 branch.
2011-06-17 13:44:59 -06:00
Brian Paul
da5c852d63 st/mesa: remove unneeded test for GL_TRUE 2011-06-17 13:44:59 -06:00
Brian Paul
15750d89b9 st/mesa: remove redundant _mesa_is_depth_format() call
The _mesa_is_depth_or_stencil_format() call covers all depth
format cases too.
2011-06-17 13:44:59 -06:00
Brian Paul
3ea6fdfdf1 st/mesa: remove trailing whitespace in st_format.c 2011-06-17 13:44:59 -06:00
Brian Paul
befaab8fa1 st/mesa: move comment for ChooseTextureFormat() to right place 2011-06-17 13:44:59 -06:00
Jeremy Huddleston
cb5a5f055b apple: Use apple_cgl_get_dl_handle() rather than opening a new handle
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-17 12:20:57 -07:00
José Fonseca
10562fbc5c scons: List all targets. 2011-06-17 20:13:16 +01:00
José Fonseca
ef4bf40db0 scons: Remember the options set on the command line.
Save them in config.py
2011-06-17 20:13:16 +01:00
José Fonseca
c9be435c79 scons: Don't list MSVS_VERSION option outside windows platforms. 2011-06-17 20:13:16 +01:00
José Fonseca
d6a0fe19e8 scons: Correct glapi USE_xxx_ASM flags. 2011-06-17 20:13:16 +01:00
José Fonseca
c7bd0fa485 scons: Accept verbose=yes instead of quiet=no.
'verbose' is affirmative, and much more common name for this sort of option.
2011-06-17 20:13:16 +01:00
Stéphane Marchesin
bf69ce37f0 glx: implement drawable refcounting.
The current dri context unbind logic will leak drawables until the process
dies (they will then get released by the GEM code). There are two ways to fix
this: either always call driReleaseDrawables every time we unbind a context
(but that costs us round trips to the X server at getbuffers() time) or
implement proper drawable refcounting. This patch implements the latter.

Signed-off-by: Antoine Labour <piman@chromium.org>
Signed-off-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2011-06-17 11:20:19 -07:00
José Fonseca
8173471fc2 scons: Move all env setup to scons/gallium.py 2011-06-17 16:41:05 +01:00
José Fonseca
4175010749 scons: make embedding orthogonal to the platform
To enable embedding in platforms other than linux.
2011-06-17 14:50:37 +01:00
Brian Paul
fc8c4a3a7b mesa: use helper functions to distinguish between user/winsys FBOs
And replace IS_CUBE_FACE() macro w/ inline function.
2011-06-16 07:31:58 -06:00
Brian Paul
37e6ab7b2d mesa: refactor, create _mesa_update_draw_buffers() helper
Move this code out of _mesa_make_current() and put it into a
helper function.
2011-06-16 07:31:58 -06:00
Brian Paul
2960526816 mesa: updated comments in _make_current() 2011-06-16 07:31:58 -06:00
Vadim Girlin
016621ee14 r600: fix SPI inputs setup on r600/r700
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-16 15:23:06 +10:00
Chad Versace
8875dd5871 intel: Fix typo in intel_offset_S8 comments
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-15 15:50:45 -07:00
Chad Versace
d105f6684d i965/gen5,6: Fix hang when emitting hiz buffer without stencil buffer
When emitting either a hiz or stencil buffer, the 'separate stencil
enable' and 'hiz enable' bits are set in 3DSTATE_DEPTH_BUFFER. Therefore
we must emit both 3DSTATE_HIER_DEPTH_BUFFER and 3DSTATE_STENCIL_BUFFER.

Even if there is no stencil buffer, 3DSTATE_STENCIL_BUFFER must be
emitted; failure to do so causes a hang on gen5 and a stall on gen6.

This also fixes a silly, obvious segfault that occured when a hiz buffer
xor separate stencil buffer existed.

Fixes the piglit tests below on Gen5 when hiz and separate stencil are
manually enabled:
    fbo-alphatest-nocolor
    fbo-depth-sample-compare
    fbo
    hiz-depth-read-fbo-d24-s0
    hiz-depth-stencil-test-fbo-d24-s0
    hiz-depth-test-fbo-d24-s0
    hiz-stencil-read-fbo-d0-s8
    hiz-stencil-test-fbo-d0-s8
    fbo-missing-attachment-clear
    fbo-clear-formats
    fbo-depth-*

Changes piglit test result from crash to fail:
    hiz-depth-stencil-test-fbo-d0-s8

Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-15 15:47:59 -07:00
Marek Olšák
6f243ec25d r600g: disable render condition for some blitter operations 2011-06-15 15:24:37 +02:00
Mike Kaplinskiy
40aec11b75 r600g: fix TXD src regs needing fetching.
[airlied: final chunk of Mike's patch from bug 37476
this uses a loop to emit the GRADIENTS and does a check to
see if we need to fetch to a temporary register. It also
increases the context src gpr to 4 which is needed here.]

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-15 16:58:40 +10:00
Mike Kaplinskiy
6415f25663 r600g: use inlines for some common tex instr setup code.
[airlied: taken from Mike's patch in bug 37476]

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-15 16:58:40 +10:00
Kenneth Graunke
ef8f6a8c59 glsl/builtins: Actually implement int/ivec variants of abs().
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>

NOTE: This is a candidate for stable release branches (and don't forget
      to re-run "make builtins" after cherry-picking.)
2011-06-14 23:41:16 -07:00
Mike Kaplinskiy
de91ea1c06 r600g: fix TXD when shadowing is enabled.
Mike had actually done a lot of the TXD support in a patch in bug
37476 which I see now, I'll add the bits of his work that I didn't think
to add to my work.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-15 15:54:21 +10:00
Dave Airlie
13c9a8552b r600g: add TXD support.
This at least passes the piglit arb_shader_texture_lod-texgrad test,
the AMD shader analyzer seems to multiply the V component by an unspecified
constant value no idea why.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-15 15:18:42 +10:00
Brian Paul
34a774797c i915g: add const qualifier to silence warning 2011-06-14 20:47:47 -06:00
Marek Olšák
d9ca94836e r600g: also set TILE_MODE of the base level 2011-06-15 04:16:05 +02:00
Marek Olšák
677a4406d2 r600g: force OpenGL's BASE_LEVEL behavior on r600-r700
This sets the base level as the zero level, which fixes
piglit/texturing/tex-miplevel-selection*.

The r600 hardware ignores the BASE_LEVEL field in some cases, so we can't
use it.

Evergreen might need this too.
2011-06-15 03:39:24 +02:00
Kenneth Graunke
7c7a8a38e5 glsl/generate_builtins.py: Remove regexp to kill pointer addresses.
Commit 56ef62d988
"glsl: Generate readable unique names at print time."
changed ir_print_visitor to not generate @0x1234567 suffixes except
where necessary.  So there's no need to manually remove them.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-06-14 18:29:48 -07:00
Jeremy Huddleston
1e16c34c5c glapi: _glapi_create_table_from_handle: Set missing pointers to NoOp rather than NULL
This change to _glapi_create_table_from_handle causes it to fill the dispatch
table with NoOps for unimplemented functionality.  This matches what is done
in indirect_init.c and also allows us to enable logging (when built with
-DDEBUG and the MESA_DEBUG or LIBGL_DEBUG environment variables are set) to
catch cases where clients are trying to use these unimplemented extentions.

Additionally, this fixes some gcc -pedantic warnings.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-14 18:22:01 -07:00
Brian Paul
3751aa4592 st/mesa: fix indentation, whitespace 2011-06-14 17:19:53 -06:00
Brian Paul
99feecc7d1 st/mesa: replace st->ctx with ctx 2011-06-14 17:19:53 -06:00
Brian Paul
c1477f6ffe st/mesa: fix comments, whitespace 2011-06-14 17:19:53 -06:00
Brian Paul
cbad86841b docs: 7.10.3 updates 2011-06-14 17:19:53 -06:00
Brian Paul
ee231b30a8 st/mesa: improved is_interleaved_arrays() checking
Check that the difference in array pointers/offsets from the 0th
array are less than the stride, for both VBOs and user-space arrays.
Previously, we were only doing this for the later.

This tightens up the interleaved array test and fixes a problem with
the llvmpipe driver where we were creating way too many vertex fetch
variants only because the pipe_vertex_element::src_offset values were
changing frequently.  This change results in a 5x speed-up for one of
the viewperf tests.

Also, clean up the function to make it easier to understand.
2011-06-14 17:19:53 -06:00
Alex Deucher
24a760e9cb r600c: add tiling support for evergreen+
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-14 18:40:37 -04:00
Marek Olšák
7d488ade23 r600g: fix RGB32F texturing 2011-06-14 20:47:57 +02:00
Marek Olšák
df6355512a r600g: fix indentation and comments 2011-06-14 20:37:57 +02:00
Eric Anholt
10e418f381 mesa: Switch generate_mipmaps_compressed() to using TexImage2D to upload.
The code was playing fast and loose with rowstrides, which meant that
if a driver chose anything different for its alignment requirements,
the generated mipmaps came out garbage.  Unlike the uncompressed case,
we can't generate mipmaps directly into image->Data, so by using
TexImage2D we cut out most of the weird logic that existed to generate
in-place into ->Data.  The up/downside is that the driver recovery
code for the fact that _mesa_generate_mipmaps whacked ->Data has to be
turned off for compressed now.

Fixes 6 piglit tests about compressed mipmap gen.
2011-06-14 11:17:39 -07:00
Eric Anholt
b0c4db68b2 mesa: Remove uncompressed code from generate_mipmaps_compressed(). 2011-06-14 11:17:39 -07:00
Eric Anholt
2bfd81df0a mesa: Remove compressed code from generate_mipmaps_uncompressed(). 2011-06-14 11:17:39 -07:00
Eric Anholt
ba55ccd312 mesa: Split _mesa_generate_mipmap along compressed/uncompressed lines.
The path taken is wildly different based on this (do we generate from
a temporary image, or from level-1's data), and we appear to have
stride bugs in the compressed case that are tough to disentangle.

This just duplicates the code for the moment, the followon commit will
do the actual changes.  Only real code change here is handling
maxLevel in one common place.
2011-06-14 11:17:39 -07:00
Eric Anholt
b9fbb9df22 intel: Fix miptree height alignment for compressed NPOT textures.
This is effectively just "round up when dividing by 4" compared to the
previous code.  Fixes the broken stripe at the top of
fbo-generatemipmap-formats GL_EXT_texture_compression_rgtc.
2011-06-14 11:17:39 -07:00
Eric Anholt
56965aa007 intel: Drop dead preinitialization of align_w, align_h. 2011-06-14 11:17:39 -07:00
Eric Anholt
f94fef83db intel: Drop the cpp argument to intel_miptree_create(). 2011-06-14 11:17:39 -07:00
Eric Anholt
6dcc398ac0 intel: Calculate compress_byte in intel_miptree_create.
One less argument and thing to get wrong.
2011-06-14 11:17:39 -07:00
Eric Anholt
9c5fdbb721 intel: Use the gl_format to get the base_format for miptree create.
One less argument to this insanely long function call.
2011-06-14 11:17:39 -07:00
Eric Anholt
9a523a48af intel: Drop the internal_format field of the mipmap tree.
This has been replaced with the gl_format now.
2011-06-14 11:17:38 -07:00
Eric Anholt
0fac09a87c intel: Make the intel_miptree_match_image format check more specific.
We don't care just about the internalFormat/cpp/compressed, but about
the specific format chosen.  We have no support for format
translations as part of texture validation, and furthermore it has
restrictions in the GL specification.  However, we should be making
consistent decisions for this check anyway.
2011-06-14 11:17:38 -07:00
Eric Anholt
afbe605eff i915: Drop dead argument to translate_texture_format(). 2011-06-14 11:17:38 -07:00
Eric Anholt
4a60b0c8d2 intel: Add block alignment for RGTC textures.
We were using the default 4x2 alignment instead of the 4x4 required
for RGTC textures.
2011-06-14 11:17:26 -07:00
Eric Anholt
d5809115b5 intel: Add the MESA_FORMAT as a field of the miptree.
We only had internal_format before, which is way more irritating to
work with.
2011-06-14 11:15:43 -07:00
Eric Anholt
51ce86b781 intel: Fix 2x2 and 1x1 compressed teximages from _mesa_generate_mipmap()
Generally image uploads to a the region occur at TexImage time, but
that's not the case for fallback _mesa_generate_mipmap(), and in this
path we were forgetting to align the width when dividing height.  We
were just leaving out parts of the compressed block at 2x2 and 1x1
levels.

Fixes gen-compressed-teximage.
2011-06-14 11:15:29 -07:00
Marek Olšák
13dcf3f20d r600g: disable shader_texture_lod until there is driver support 2011-06-14 20:03:04 +02:00
Adam Jackson
130e7ead87 llvmpipe: SSE2 fastpaths for b8g8r8x8 {un,}swizzle
Copy-and-paste from the bgra cases.  The C paths attempt to avoid
copying the 'x' channel, but it's harmless, you might as well.  Good for
about 5% in glxgears (740 to 780 fps).

Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-06-14 11:51:13 -04:00
Christoph Bumiller
a8b9a75b92 nv50: fix copy/paste error in nv50_gmtyprog_validate
Used the vertprog instead of gmtyprog.
2011-06-14 17:15:08 +02:00
Jeremy Huddleston
a128355ecb apple: Set the glapi dispatch table on context bind
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-14 00:48:20 -07:00
Marek Olšák
c17fb8539f configure.ac: cleanup the gallium-r300 option 2011-06-14 04:11:26 +02:00
Marek Olšák
e823ab1b00 st/xorg: remove unused variable 2011-06-14 03:49:26 +02:00
Marek Olšák
f318a15f45 r600g: do not link with softpipe 2011-06-14 01:45:11 +02:00
Marek Olšák
b5b7d2acc6 r300g: do not link with softpipe 2011-06-14 01:45:11 +02:00
Marek Olšák
be2b9bdcee xorg-radeon: rename to xorg-r300 2011-06-14 01:45:11 +02:00
Marek Olšák
63e38bd0f6 target-helpers: remove copy-pasted function inline_noop_helper 2011-06-14 01:45:11 +02:00
Vadim Girlin
9346d895e7 r600g: skip SPI setup for position and face inputs
fixes fdo bug 38145

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-14 09:17:16 +10:00
Dave Airlie
2743851c1a r600g: move depth texture flushing out of line.
this needs a piglit run.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-14 09:17:16 +10:00
Eric Anholt
296e6b9038 meta: Fix glCopyTexImage(GL_LUMINANCE) from non-GL_LUMINANCE source.
glReadPixels() was performing RGB -> L conversion differently from the
glTexImage() style conversion appropriate for glCopyTexImage().

Fixes gles2conform copy_texture.
2011-06-13 15:56:36 -07:00
Eric Anholt
df46eb8ec0 intel: Fix mipmap and format handling of blit glCopyPixels().
Fixes fbo-mipmap-copypix.
2011-06-13 15:56:36 -07:00
Eric Anholt
ef0d548838 intel: Do the drawable x/y offset in intel_renderbuffer_map() for spans.
We were mapping the renderbuffer once, then walking over all the
buffers to map just the texture ones using the other texture mapping
function that handled the x/y offset to the image in the region.  But
then we would go and overwrite *those* mappings with the original
mappings for depth/stencil, which was wrong.

Instead, just walk over the attachments once and map the attachments.
Wasn't that easy?
2011-06-13 15:56:36 -07:00
Eric Anholt
fb60e2061b intel: Use rb->Data and rb->RowStride to handle spans Y flipping.
This is already pointing at 0 or Height - 1 and with an appropriate
pitch, so no need to recompute those values per customization of the
spans code.  Cuts 3 out of 21kb of the compiled size.

Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-06-13 15:56:36 -07:00
Eric Anholt
d29117752f intel: Clean up intel_render_texture with a rename and a helper function.
The "newImage" isn't particularly new -- it might be the same texture
that was attached to the same attachment point before.  This function
also gets called when just rebinding back to an FBO with a texture
attachment.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-06-13 15:56:36 -07:00
Eric Anholt
b17aab5753 intel: Move the draw_x/draw_y to the renderbuffer where it belongs.
It was originally located in the region because the tracking of
depth/color buffers was on the regions, and getting back to the irb
would have been tricky.  Now, we're keying off of the renderbuffer in
more places, which means we can move these fields where they belong.

This could fix potential rendering failure with a single texture
having multiple images attached to different renderbuffers across
shareCtx (as far as I can tell, this was the only failure we could
cause, since anything else should trigger intel_render_texture in
between, for example a BindFramebuffer).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-06-13 15:56:36 -07:00
Brian Paul
4fa01d705f dri: include swrast.h, not s_texrender.h 2011-06-13 16:07:55 -06:00
Jeremy Huddleston
816b8acfe8 glx: Remove check for gc->vtable->destroy
gc->vtable->destroy is always set and is used unconditionally
in other places, so don't bother checking for it first.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-13 14:51:01 -07:00
Jeremy Huddleston
c6cf82fb55 apple: applegl_destroy_context: Pass along the correct display
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-13 14:51:01 -07:00
Jeremy Huddleston
e903cc17bb apple: Dead code removal
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-13 14:51:01 -07:00
Jeremy Huddleston
b44d13e67b glapi: Add check for NULL symbol_prefix in gentable and fix warnings
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-13 14:50:37 -07:00
Daniel Vetter
df8d26ec09 i915g: add a few more render target formats
Snatched from xvmc.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-06-13 23:05:43 +02:00
Brian Paul
755f2e2ae5 mesa: move texrender.c to swrast
This stuff is really for software rendering, it's not core Mesa.
A small step toward pushing the FetchTexel() stuff down into swrast.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-13 13:45:39 -06:00
Brian Paul
8852e35e29 vbo: minor simplification in print_draw_arrays() debug function 2011-06-13 13:45:39 -06:00
Brian Paul
e6e1864f1c mesa: move invariant code out of loop in get_tex_rgba() 2011-06-13 13:45:39 -06:00
Mathias Fröhlich
2f0b44f981 r600g: Put shaders into immutable buffers.
Put the shader programs into an immutable buffer object.
Also make sure that those object can be taken from the user
space buffer object pool.
2011-06-13 11:33:20 -04:00
Mathias Fröhlich
b0f1767d77 r600g: Allow VRAM for the initial domain for every buffer binding. 2011-06-13 11:33:14 -04:00
Mathias Fröhlich
e1f88016ec r600g: Set the domains value also for recycled buffer objects. 2011-06-13 11:31:55 -04:00
Mathias Fröhlich
e2529442e6 r600g: Fix typo.
Fix an obvious typo in the yet unused part of the shader setup.
2011-06-13 11:31:13 -04:00
Pierre-Eric Pelloux-Prayer
92563476e4 r600g: remove useless call to u_upload_flush
No regressions found with :
- piglit (quick.tests)
- Unigine Heaven
- Lightsmark
- openarena
- Imprudence (Second Life fork)

agd5f Note: this patch was previously reverted due to piglit
regressions, but I'm not able to reproduce them here.
See this bug:
https://bugs.freedesktop.org/show_bug.cgi?id=34008
and discussion:
http://lists.freedesktop.org/archives/dri-devel/2011-June/011996.html

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-13 11:26:54 -04:00
Marek Olšák
317247390a st/mesa: rebind vertex arrays if _NEW_BUFFER_OBJECT is dirty
This fixes piglit/vbo-bufferdata. It's a regression in 7.11.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-06-13 17:03:56 +02:00
Pierre-Eric Pelloux-Prayer
b19d86701e r600g: fixed bo memory leak issue
pipe_resource_reference call was miossing, thus creating massive memory under certain conditions.
Fix : https://bugs.freedesktop.org/show_bug.cgi?id=37168
2011-06-13 10:47:07 -04:00
Chia-I Wu
77b7e1b58f mapi: declare x86_entry_start/end static
x86_entry_start and x86_entry_end are defined by the inline assembly.
Declaring them static saves one instruction in entry_get_public.
2011-06-13 12:19:47 +08:00
Benjamin Franzke
3e1caf5d26 mapi: Fix tls with shared/es-glapi on x86-64
x86_64_entry_start needs to be declared static in the C code,
in order to have the correct address in entry_get_public
(seems not to be needed on x86).

The compiler needs to lookup a local not a global object.

Otherwise addresses needed for _glapi_proc_address will be computed
from some random offset (0x6400229a61058b48 in my case).
2011-06-13 12:19:47 +08:00
Chia-I Wu
982cb36584 wayland-drm: remove depend on "make clean" 2011-06-13 12:19:47 +08:00
Chia-I Wu
77e031a1c4 egl_dri2: try swrastg_dri if swrast_dri fails
Per libGL.
2011-06-13 12:19:39 +08:00
Chia-I Wu
cf69eeacc6 egl_dri2: add dri2_load_driver_swrast
Refactor dri2_load_driver and add dri2_load_driver_swrast for loading
swrast DRI driver.
2011-06-13 11:11:43 +08:00
Benjamin Franzke
16e30276e8 egl_dri2: Compare configs before matching them
This compares attribs like buffer size, and will prevent merging
unequal configs because of match criterion is e.g. ATLEAST.
2011-06-12 08:56:35 -04:00
Benjamin Franzke
a23bf646bd st/eglwayland: Add support for EGL_DEFAULT_DISPLAY 2011-06-12 08:56:35 -04:00
Benjamin Franzke
b8325fd255 egl_dri2/wayland: Add support for EGL_DEFAULT_DISPLAY 2011-06-12 08:56:35 -04:00
Jeremy Huddleston
9a00dd9746 apple: Request OpenGL 3.2 from OpenGL.framework if available
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-11 23:43:38 -07:00
Jeremy Huddleston
df1dacf093 apple: Store the CGL API version number for future reference
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-11 23:43:03 -07:00
Jeremy Huddleston
02b6e97c75 apple: Use a struct glx_config * rather than a void * in apple_visual_create_pfobj
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-11 22:54:59 -07:00
Jeremy Huddleston
f35913b96e apple: Use _glapi_create_table_from_handle to initialize our dispatch table
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-11 21:55:01 -07:00
Jeremy Huddleston
85937f4c0d glapi: Add API that can create a _glapi_table from a dlfcn handle
Example usage:

void *handle = dlopen(opengl_library_path, RTLD_LOCAL);
struct _glapi_table *disp = _glapi_create_table_from_handle(handle, "gl");

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-11 21:55:01 -07:00
Marek Olšák
837dc61011 r300g: max_anisotropy of 1 is not anisotropic filtering 2011-06-11 23:03:20 +02:00
Daniel Vetter
219150433a i915g: implement fence signalling
v2: Incorporated feedback from Jakob Bornecrantz.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-06-11 17:11:26 +02:00
Eric Anholt
4176025d46 i965: Add support for GL_FIXED vertex attributes.
This sadly requires work in the VS to rescale them, because the
hardware doesn't support this format natively.

Fixes arb_es2_compatibility-fixed-type and gtf/fixed_data_type.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-06-10 13:17:10 -07:00
Eric Anholt
20f087863d glsl: Fix incorrect optimization of instructions before discard statements.
The function was named "find_unconditional_discard", but didn't
actually check that the discard statement found was unconditional.
Fixes piglit glsl-fs-discard-04.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-06-10 13:17:01 -07:00
Eugeni Dodonov
23ef4a6063 Fix format not a string literal error with -Werror=format-security
A trivial fix for error: format not a string literal and no format
arguments with compiling with -Werror=format-security flags.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-06-10 12:20:07 -07:00
Chad Versace
97d230b0bc i965/brw: Fix emit_depthbuffer() when packed depth/stencil texture is attached
If either depth or stencil buffer has packed depth/stencil format, then do
not use separate stencil.

Before this commit, emit_depthbuffer() incorrectly assumed that the
texture's stencil renderbuffer wrapper was a *separate* stencil buffer,
because the depth and stencil renderbuffer wrappers are distinct for
depth/stencil textures (that is, depth_irb != stencil_irb).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38134
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-10 10:37:30 -07:00
Alex Deucher
eca3e910ed r600g: VGT_PRIMITIVE_TYPE is special
It's a special reg and does not require a flush like
the other CONFIG regs.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-09 16:54:23 -04:00
Alex Deucher
8681ebcf7f r600g: Handle CONFIG regs properly
CONFIG regs (byte offsets 0x8000-0xac00) are single state and the pipeline
must be flushed and hw idle when they are changed.  Border color regs
are in the CONFIG range and this is why a flush is required when changing
them.  CONTEXT regs (byte offset 0x28000+) are multi-state and those do
not require flushes when changing them.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-09 16:26:50 -04:00
Eric Anholt
6861a70177 i965/gen6: Add support for gl_PointCoord.
This is just like PointSprite overrides, but it's always on for that
attribute.

Fixes glsl-fs-pointcoord, gtf/point_sprites.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2011-06-09 08:41:54 -07:00
Eric Anholt
f304bb8a5d i965/gen6: Fix point sprite texture coordinate overrides.
We were assuming that the input attribute n to the FS was
FRAG_ATTRIB_TEXn, which happened to be true often enough for our
testcases.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2011-06-09 08:41:51 -07:00
Eric Anholt
e7280b16d6 i965/gen6: Refactor SF setup a bit to handle overrides in one place.
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2011-06-09 08:41:45 -07:00
Marek Olšák
da8b4c0798 r300g: fix texturing with non-3D textures and wrap R mode set to sample border
If the wrap R (3rd) mode is set to CLAMP or CLAMP_TO_BORDER and the texture
isn't 3D, r300 always samples the border color regardless of texture
coordinates.

I HATE THIS HARDWARE.

NOTE: This is a candidate for the 7.10 branch.
2011-06-09 04:19:03 +02:00
Marek Olšák
466ce95ddf r300g: don't enable aniso with nearest filtering 2011-06-09 04:19:03 +02:00
Dave Airlie
04554c7d3a r600g: adjust vs/ps gprs on r600/r700 cards when needed.
Ideally we'd have a compiler and register spilling and all that
but this is good enough for now to avoid the gpu hang in piglit,

glsl-vs-vec4-indexing-temp-dst-in-nested-loop-combined

on r600/r700 cards.

based on r600c patch
Andre Maasikas <amaasikas@gmail.com>
r600c: bump sq gpr resources if a shader needs more than default

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-09 11:25:02 +10:00
Marek Olšák
d56fe67c62 r600g: remove unused variable 2011-06-09 01:34:24 +02:00
Marek Olšák
578d4539ba r300g: fix draw_vbo splitting on r3xx-r4xx
NOTE: This is a candidate for the 7.10 branch.
2011-06-09 01:25:52 +02:00
Marek Olšák
f48412c39f r300g: make translate_primitive table-driven 2011-06-09 01:25:52 +02:00
Roland Scheidegger
d302804deb util: fix strict aliasing issues in u_format_r11g11b10f.h 2011-06-09 01:14:51 +02:00
Roland Scheidegger
c1090f3019 mesa: get rid of homegrown logbase2 implementation in drivers
Some of the logbase2 functions did just the same as _mesa_logbase2,
though they were taking signed numbers (but it shouldn't matter for them).
2011-06-09 01:14:51 +02:00
Roland Scheidegger
da009212fe mesa: fix gcc version check for _mesa_bitcount
The version check was bogus, and only inside a non-gcc block anyway.
2011-06-09 01:14:50 +02:00
Roland Scheidegger
b537f54b3a mesa: use __builtin_clz for logbase2 when available
Also rename to _mesa_logbase2 and move to imports.h to keep the ugly
ifdef GNUC stuff outside other files (also to allow reuse).
2011-06-09 01:14:50 +02:00
Roland Scheidegger
b3d5822e93 util: add gcc version check for builtins
Looks like only next_power_of_two, logbase2 and bitcount use builtins
requiring gcc 3.4, so maybe everything else compiles with older gcc.
2011-06-09 01:14:50 +02:00
Benjamin Bellec
894db40f12 util: better logbase2/next_power_of_two implementations
Use __builtin_clz when available for logbase/next_power_of_two,
and replace next_power_of_two with faster implementation otherwise.
2011-06-09 01:14:50 +02:00
José Fonseca
9f865646f1 glx/xlib: Handle glXCreateContextAttribsARB in glXGetProcAddress. 2011-06-08 22:53:27 +01:00
Kenneth Graunke
4ef8464068 i965/gen7: Call gen7_create_constant_surface instead of brw_[...].
Fixes 17 piglit tests:
- glsl-vs-arrays-3
- glsl-vs-texturematrix-2
- glsl-vs-uniform-array-2
- arl
- nv-arl
- nv-init-zero-addr
- vp-address-01
- vp-arl-constant-array
- vp-arl-constant-array-huge
- vp-arl-constant-array-huge-offset
- vp-arl-constant-array-huge-offset-neg
- vp-arl-constant-array-huge-relative-offset
- vp-arl-constant-array-huge-varying
- vp-arl-env-array
- vp-arl-local-array
- vp-arl-neg-array
- vp-arl-neg-array-2

Fixes 4 glean tests:
- glsl1-constant array of vec4 with variable indexing, vertex shader
- glsl1-constant array with variable indexing, vertex shader
- glsl1-constant array with variable indexing, vertex shader (2)
- vp1-ARL test

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-08 14:51:11 -07:00
Kenneth Graunke
acf82657f4 i965/gen7: Enable SIMD16 fragment shader dispatch.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-08 14:51:11 -07:00
Kenneth Graunke
2a63807616 i965/gen7: Don't emit 3DSTATE_GS_SVB_INDEX on Ivybridge.
According to vol2a.07, it only applies from Cantiga to Sandybridge.

I found this in my ringbuffers while investigating various GPU hangs.
While it may not have been the cause, it seemed wise to remove it.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-08 14:51:11 -07:00
Kenneth Graunke
626440add5 i965/gen7: Program stencil buffers on Ivybridge.
Thanks to Chad's hard work implementing separate stencil and HiZ
support, this is entirely straightforward.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-08 14:51:11 -07:00
Kenneth Graunke
53b53a141e i965/gen7: Add a prepare_depthbuffer function.
We need to call add_validated_bo to do proper aperture space accounting.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-08 14:50:38 -07:00
Kenneth Graunke
a00ca90815 i965/gen7: gen7_emit_depthbuffer needs the _NEW_DEPTH dirty bit.
For ctx->Depth.Mask.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-08 14:31:12 -07:00
Kenneth Graunke
bd265201da i965/gen7: Remove stencil renderbuffer from gen7_depth_format.
Since Gen7 doesn't support packed depth/stencil, the stencil buffer
can't possibly be relevant for determining the depth format.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-08 14:31:04 -07:00
Brian Paul
e37e196151 st/mesa: more helpful debug message in destroy_program_variants_cb() 2011-06-08 15:15:07 -06:00
Brian Paul
2d22186ca8 svga: fix typos, update comments 2011-06-08 15:08:19 -06:00
Jeremy Huddleston
3b23cf43a4 glx: Remove some GLX_USE_APPLEGL guards around glapi
Now that we're using glapi, we don't need some GLX_USE_APPLEGL ifdef-foo

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-08 12:03:10 -07:00
Jeremy Huddleston
1b90d7d36b darwin: Use -fvisibility=hidden to set default symbol visibility
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-08 11:47:00 -07:00
Jeremy Huddleston
2835c5112d darwin: mklib: Make the real file match the id
This makes mesa more consistent with glibtool and XCode where the
generated file matches the dylib id rather using an extra symlink

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-08 11:24:26 -07:00
Chad Versace
aea2236af6 intel: Request DRI2 buffers for separate stencil and hiz
When it is sensible to do so,
    1) intelCreateBuffer() now attaches separate depth and stencil
       buffers
       to the framebuffer it creates.
    2) intel_update_renderbuffers() requests for the framebuffer
       a separate stencil buffer (DRI2BufferStencil).

The criteria for "sensible" is:
    - The GLX config has nonzero depth and stencil bits.
    - The hardware supports separate stencil.
    - The X driver supports separate stencil, or its support has not yet
      been determined.

If the hardware supports hiz too, then intel_update_renderbuffers()
also requests DRI2BufferHiz.

If after requesting DRI2BufferStencil we determine that X driver did not
actually support separate stencil, we clean up the mistake and never ask
for DRI2BufferStencil again.

CC: Ian Romanick <idr@freedesktop.org>
CC: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-08 10:06:40 -07:00
Chad Versace
f4efb7ff4f intel: Add assertions to intelCreateBuffer()
Assert that the GLX config has an expected depth/stencil bit combination:
one of d24/s8, d16/s0, d0/s0. These are the only depth/stencil
configurations that we advertise.

Remove the check for software stencil, because given the assertions'
constraints the check always fails.

CC: Ian Romanick <idr@freedesktop.org>
CC: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-08 10:06:40 -07:00
Chad Versace
89d34cfd3e intel: Refactor intel_update_renderbuffers()
Extract the code that queries DRI2 to obtain the DRIdrawable's buffers
into intel_query_dri2_buffers_no_separate_stencil().

Extract the code that assigns the DRI buffer's DRM region to the
corresponding renderbuffer into
intel_process_dri2_buffer_no_separate_stencil().

Rationale
---------
The next commit enables intel_update_renderbuffers() to query for separate
stencil and hiz buffers. Without separating the separate-stencil and
no-separate-stencil paths, intel_update_renderbuffers() degenerates into
an impenetrable labyrinth of if-trees.

CC: Ian Romanick <idr@freedesktop.org>
CC: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-08 10:06:40 -07:00
Chad Versace
84294fe26c intel: Add function intel_renderbuffer_set_hiz_region()
It's the analog of intel_renderbuffer_set_region(), but for the hiz region
of course.

CC: Ian Romanick <idr@freedesktop.org>
CC: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-08 10:06:40 -07:00
Chad Versace
beb8b7da20 intel/intel_context.c: Remove unused functions
Remove functions intel_override_hiz() and
intel_override_separate_stencil(). They are now located in intel_screen.c.

CC: Ian Romanick <idr@freedesktop.org>
CC: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-08 10:06:40 -07:00
Chad Versace
6b2bf272ee intel: Add flags to intel_screen for hiz and separate stencil
Add the fields below to intel_screen. The expression in parens is the
value to which intelInitScreen2() currently sets the field.
    GLboolean hw_has_separate_stencil      (true iff gen >= 7)
    GLboolean hw_must_use_separate_stencil (true iff gen >= 7)
    GLboolean hw_has_hiz                   (always false)
    enum intel_dri2_has_hiz dri2_has_hiz   (INTEL_DRI2_HAS_HIZ_UNKNOWN)

The analogous fields in intel_context now inherit their values from
intel_screen.

When hiz and separate stencil become completely implemented for a given
chipset, then the respective fields need to be enabled.

CC: Ian Romanick <idr@freedesktop.org>
CC: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-08 10:06:40 -07:00
Chad Versace
df9f533c67 intel: Define enum intel_dri2_has_hiz
... which indicates if the X driver supports DRI2BufferHiz and
DRI2BufferStencil.

I'm placing this in its own commit due to the large comment block.

CC: Ian Romanick <idr@freedesktop.org>
CC: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-08 10:06:40 -07:00
Chad Versace
4501a5d6e8 dri2: Add token for DRI2BufferHiz
CC: Ian Romanick <idr@freedesktop.org>
CC: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-08 10:06:40 -07:00
Chad Versace
ff99103c0a intel: Define span functions for S8 renderbuffers
Since the stencil buffer is interleaved, the generic Mesa renderbuffer
accessors do not suffice. Custom span functions are necessary.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-08 10:06:39 -07:00
Chad Versace
2abc8cae87 i965/brw: Emit state for hiz and separate stencil buffers
When emitting 3DSTATE_DEPTH_BUFFER, also emit 3DSTATE_HIER_DEPTH_BUFFER if
there is a hiz buffer. Ditto for 3DSTATE_STENCIL_BUFFER and a separate
stencil buffer.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-08 10:06:39 -07:00
Chia-I Wu
6b492d0976 st/egl: set EGL_ALPHA_MASK_SIZE 2011-06-09 00:23:24 +08:00
Chia-I Wu
4bb748b609 mesa: merge glapidispatch.h into dispatch.h
glapidispatch.h was located in glapi and shared with mesa core.  Because
the way it was shared, mesa core must include it indirectly via
main/dispatch.h.

Now that it is no longer needed by glapi and is located in core mesa,
merging it with main/dispatch.h to avoid wrong uses.
2011-06-08 23:19:01 +08:00
Chia-I Wu
0dc45374f2 mesa: fix function remapping for dlist
glapidispatch.h should not be included directly.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=36282
2011-06-08 23:18:57 +08:00
Chia-I Wu
fed482f5e3 mesa: fix GLES remap table setup again
Generate different glapidispatch.h's for GL and GLES.  For GLES, we want
a local remap table.

This reverts commit 5af46e8360.  The
commit will break GL remap table setup when main/glapidispatch.h is
regenerated.
2011-06-08 23:17:57 +08:00
Alex Deucher
fe3a343441 r600g: fix mixup in GPR resource reg setup
GLOBAL_GPR regs should be 0.  Need to set the
number of temp regs in SQ_GPR_RESOURCE_MGMT_1.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-08 10:50:18 -04:00
Brian Paul
7c2847a972 vbo: run 'indent' on vbo_save_api.c 2011-06-08 08:05:41 -06:00
Brian Paul
9404835ccd mesa: add include/c99/*.h files to tarballs
See https://bugs.freedesktop.org/show_bug.cgi?id=36238

NOTE: This is a candidate for the 7.10 branch.
2011-06-08 08:05:41 -06:00
Brian Paul
f1733d16de vbo: rename DO_FALLBACK -> dlist_fallback 2011-06-08 08:05:41 -06:00
Brian Paul
62811057f4 vbo: remove node->count > 0 test in vbo_save_playback_vertex_list()
See piglit dlist-fdo31590.c test and
http://bugs.freedesktop.org/show_bug.cgi?id=31590

In this case we had node->prim_count=1 but node->count==0 because the
display list started with glBegin() but had no vertices.  The call to
glEvalCoord1f() triggered the DO_FALLBACK() path.  When replaying the
display list, the old condition basically no-op'd the call to
vbo_save_playback_vertex_list call().  That led to the invalid operation
error being raised in glEnd().

NOTE: This is a candidate for the 7.10 branch.
2011-06-08 08:05:41 -06:00
Brian Paul
f1cdce95f6 vbo: check array indexes to prevent negative indexing
See the piglit dlist-fdo31590.c test

NOTE: This is a candidate for the 7.10 branch.
2011-06-08 08:05:41 -06:00
Brian Paul
a25271fcb8 st: use _mesa_is_bufferobj() 2011-06-08 08:05:41 -06:00
Brian Paul
d329b68f35 vbo: added a comment 2011-06-08 08:05:41 -06:00
Brian Paul
713fb50759 gallium: fix comments for pipe_stream_output_state 2011-06-08 08:05:40 -06:00
Brian Paul
3d75c42bbf mesa: remove old comment 2011-06-08 08:05:40 -06:00
Brian Paul
f9c2feb96b mesa: add more sampler types to is_sampler_type() 2011-06-08 08:05:40 -06:00
Brian Paul
5f2deba9f3 gallium: s/bool/boolean/ 2011-06-08 08:05:40 -06:00
Brian Paul
f6572017b9 draw: fix edge flag handling in clipper (for unfilled tris/quads/polygons)
Previously, we were errantly drawing some interior edges of clipped
polygons and quads.  Also, we were introducing extra edges where
polygons intersected the view frustum clip planes.

The main problem was that we were ignoring the edgeflags encoded in
the primitive header's 'flags' field which are set during polygon/quad
->tri decomposition.  We need to observe those during clipping.  Since
we can't modify the existing vert's edgeflag fields, we need to store
them in a parallel array.

Edge flags also need to be handled differently for view frustum planes
vs. user-defined clip planes.  In the former case we don't want to draw
new clip edges but in the later case we do.  This matches NVIDIA's
behaviour and it just looks right.

Finally, note that the LLVM draw code does not properly set vertex
edge flags.  It's OK on the regular software path though.
2011-06-08 08:05:40 -06:00
Jeremy Huddleston
0e8d045bf8 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>
2011-06-07 23:06:37 -07:00
Jeremy Huddleston
3a71f880d2 apple: Update dispatch table to current OpenGL specs
This updates the apple dispatch table to match the current glapi.
Aliases are still not handled very well.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-07 23:06:37 -07:00
Jeremy Huddleston
3871e74733 apple: Dead code removal
Now that we're using glapi, all of this is no longer needed.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-07 23:06:36 -07:00
Jeremy Huddleston
e157f381f2 apple: Remove apple_glx_get_proc_address
Now that we're using glapi, we don't need to special case this.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-07 23:06:36 -07:00
Jeremy Huddleston
7d215e7c4d apple: Use glapi rather than reinventing the wheel
With this change, Apple's libGL is now using glapi rather than implementing
its own dispatch.  In this implementation, two dispatch tables are created:

__ogl_framework_api always points into OpenGL.framework.
__applegl_api is the vtable that is used.  It points into OpenGL.framework
or to local implementations that override / interpose this in OpenGL.framework

The initialization for __ogl_framework_api was copied from XQuartz with some
modifications and probably still needs further edits to better deal with
aliases.

This is a good step towards supporting both indirect and direct rendering
on darwin.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-07 23:06:35 -07:00
Jeremy Huddleston
88cec59170 apple: Rename __gl_api to __ogl_framework_api
In starting the migration to using mapi, rename __gl_api to
__ogl_framework_api since it is a vtable for OpenGL.framework

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-07 23:06:35 -07:00
Dave Airlie
19b9e523c5 r600g: missed one line in eg dyn gpr fallback.
need more sleep or something.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 14:53:11 +10:00
Dave Airlie
9fb404b47e r600g: set enable always bits for r600/r700 sq registers.
This makes sure these are enabled even if set to 0 at startup.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 14:50:58 +10:00
Dave Airlie
190bfea2de r600g: condition evergreen dyn gpr resource management
So only with kernel version 2.7 can this work, thanks to Alex
for pointing that out. Also add a workaround for a hw bug.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 14:50:58 +10:00
Dave Airlie
e84981dede r600g: fix warnings in winsys.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 14:11:49 +10:00
Dave Airlie
c1f9884bbf r600g: enable dynamic GPR resource management on evergreen
Evergreen can do this as well as cayman, so we should enable it.

This fixes a gpu lockup with
glsl-vs-vec4-indexing-temp-dst-in-nested-loop-combined.shader_test

I need to add a better workaround for r600/r700.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 14:11:48 +10:00
Dave Airlie
f659cc46bc r600g: only add blocks once to the dirty/enabled lists.
This caused a loop in some tests.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 14:04:26 +10:00
Dave Airlie
a5329d4f78 r600g: fix regression in recent state changes.
We weren't emitting the SQ setup regs at all which really is
fail.

When a state is always enabled we need to add it to the dirty list
as well.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 13:22:02 +10:00
Dave Airlie
745abb53cf r600g: move simple part of bo reloc processing inline.
This just moves the messy stuff out of the fast path,
and leaves the fast-case in the fast path.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 11:47:01 +10:00
Dave Airlie
e66053d01c r600g: take alpha ref update out of line.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 11:47:00 +10:00
Dave Airlie
ba78a5a679 r600g: split resource emit path from main register emit path
Since resources don't generally vary in size, this splits
the emit path, it also takes into a/c that texture and vertex resources
have different number of relocs, and avoids emitting the extra
reloc for vertex resources.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 11:47:00 +10:00
Dave Airlie
ff8717527d r600g: exit bo per reg scanning loop early.
Exit this loop early to avoid pointless iterations later.

Move the resource bos to the first two regs, it actually
doesn't matter which regs we use for this in resource land.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 11:47:00 +10:00
Dave Airlie
138f660b58 r600g: reorder evergreen draw packets to be smaller.
We were always re-emitting lots of unnecessary changes here,
avoid doing that.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 11:47:00 +10:00
Dave Airlie
4707ae20ad r600g: inline r600_bo_reference.
This relies on the reference member being first, so document it.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 11:46:59 +10:00
Dave Airlie
ff298a66d7 r600g: no need to drop the references here.
We drop them when we reference the new objects in the next line.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 11:46:59 +10:00
Dave Airlie
e21601e46e r600g: use memcmp instead of a loop in state_set_resource
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 11:46:50 +10:00
Ian Romanick
bb4758669c mesa: Ignore blits to/from missing buffers
The EXT_framebuffer_object spec (and later specs) say:

     "If a buffer is specified in <mask> and does not exist in both
     the read and draw framebuffers, the corresponding bit is silently
     ignored."

Check for color, depth, and stencil that the source and destination
FBOs have the specified buffers.  If the buffer is missing, remove the
bit from the blit request mask and continue.

Fixes the crash in piglit test 'fbo-missing-attachment-blit from', and
fixes 'fbo-missing-attachment-blit es2 from'.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=37739
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>

NOTE: This is a candidate for the stable branches.
2011-06-07 18:29:52 -07:00
Ian Romanick
7f9c17aaa8 mesa: Don't try to clear a NULL renderbuffer
In an ES2 context (or if GL_ARB_ES2_compatibility) is supported, the
framebuffer can be complete with some attachments be missing.  In this
case the _ColorDrawBuffers pointer will be NULL.

Fixes the crash in piglit test fbo-missing-attachment-clear.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=37739
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>

NOTE: This is a candidate for the stable branches.
2011-06-07 18:29:52 -07:00
Nicolas Kaiser
1d71bbed3b mga: enable GL_ARB_vertex_array_object extension
Tested on a Matrox G550 AGP.

Signed-off-by: Nicolas Kaiser <nikai@nikai.net>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-06-07 16:32:30 -06:00
Benjamin Franzke
ac3c2c8ece egl_dri2: Add missing header 2011-06-07 17:59:16 -04:00
Benjamin Franzke
3b11d67ef6 egl_dri2: Add missing license 2011-06-07 17:58:59 -04:00
Benjamin Franzke
ec2b08de77 egl_dri2: Use libudev only if available
Broken since 7f881c43df.
2011-06-07 17:58:47 -04:00
Pierre-Eric Pelloux-Prayer
bdf2e11285 r600g : fix incorrect size computation in r600_query_result
query->num_results already has the size in dwords of the query
buffer.  There no need to multiply again.  We were reading past
the end of the buffer, resulting in reading garbage.

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

agd5f: clarify the comment.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-07 17:40:37 -04:00
Alex Deucher
5d4c479822 r600g: remove pre-r6xx asic families and pci ids
Not sure why these were included originally.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-07 17:04:52 -04:00
Alex Deucher
7c1d478192 r600g: always clear query memory
According to the hw documentation, the driver needs to:
- allocate 128 bits for each possible DB
- clear the 128 bits for each possible DB
- write 1 to bits 127 and 63 for upper DBs that don't
exist on a particular asic

Previously we were only doing these steps if the
asic had less than the max possible DBs.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-07 16:44:40 -04:00
Marek Olšák
d7111353bd r300g: consolidate deducing chipset info
Use the new PCI ID table, make it simpler.
2011-06-07 21:02:52 +02:00
Marek Olšák
4123131f3c r300_pci_ids: set families to match r300g 2011-06-07 21:02:52 +02:00
Marek Olšák
eaae63b715 r600g: add missing r300 families
Wondering why r600g needs to include r300_pci_ids.h
2011-06-07 21:02:52 +02:00
Eric Anholt
6d894f68af intel: Update intel-decode.c from intel-gpu-tools. 2011-06-07 11:44:11 -07:00
Eric Anholt
23b6f9606d intel: Implement glFinish() correctly by waiting on all previous rendering.
Before, we were waiting for (most of) the current framebuffer to be
done, which is not quite the same thing.
2011-06-07 10:46:04 -07:00
Jeremy Huddleston
6ea70600b9 darwin: Fix VG_LIB_GLOB to also match the unversioned symlink
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-07 13:27:42 -04:00
Jeremy Huddleston
cebdffaa2a darwin: Don't link against libGL when building libOSMesa
Everything should be resolved through glapi.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-07 13:27:42 -04:00
Marek Olšák
ed0e4bb4c1 r300_pci_ids: add missing 4B48
Found in r300_chipset.h.
2011-06-07 18:45:23 +02:00
Benjamin Franzke
42ba8d141f r300g: Remove is_r3xx
Use r300_pci_ids.h instead.

Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-07 10:28:20 -04:00
Benjamin Franzke
2bb253120e r600g: Use radeon pciid list for the family lookup table
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-07 10:28:20 -04:00
Benjamin Franzke
6b82193677 radeon: Use pciid list to generate PCI_CHIP_<FAMILY>_<ID> defines
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-07 10:28:20 -04:00
Benjamin Franzke
a433755ec5 targets/egl: Support driver name lookup using pci lists
Make use of this in drm and wayland st/egl backends.

Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-07 10:28:20 -04:00
Benjamin Franzke
7f881c43df egl_dri2: Use external driver pci list
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-07 10:28:19 -04:00
Benjamin Franzke
88fd16d548 Add radeon pci id lists
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-07 10:28:19 -04:00
Benjamin Franzke
09f83ce4da Add intel pci id lists
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-07 10:28:19 -04:00
Brian Paul
681ed756c0 tgsi: s/varient/variant/ 2011-06-07 07:57:26 -06:00
Brian Paul
b3e75a61ee draw: rename draw_vs_varient.c to draw_vs_variant.c 2011-06-07 07:57:26 -06:00
Brian Paul
47f3d5d42d draw/llvm: whitespace, formatting fixes 2011-06-07 07:57:26 -06:00
Brian Paul
57f2f84f0e draw: s/1/TRUE/ 2011-06-07 07:57:26 -06:00
Eric Anholt
ef59049c52 i965: Fix flipped GT1 vs GT2 URB VS entry count limits. 2011-06-07 00:08:42 -07:00
Stéphane Marchesin
7d2cb9a53c Merge branch 'master' of ssh://git.freedesktop.org/git/mesa/mesa 2011-06-06 20:42:30 -07:00
Stéphane Marchesin
abb4365269 i915g: Do generic remapping.
With complex shaders there are often "holes" in the fs inputs, and we only
have 8 tex coorsd to map those to. To fix this, we remap fs inputs to [0..8].
This lets us to run many more GLSL programs.
2011-06-06 20:40:16 -07:00
Jeremy Huddleston
22c320aa2c darwin: Set VG_LIB_{NAME,GLOB} to fix make install
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-06 19:56:19 -04:00
Dave Airlie
ca01fe007d r600g: optimise the draw emission packets for r600/eg
This just reduces code size a bit for this chunk.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-07 09:43:09 +10:00
Dave Airlie
63184bc8b2 r600g: use an enabled list to track enabled blocks.
At the end of flushing we were scanning over 450 blocks
with generally about 50 enabled. This reduces the scanning
to just the list of enabled blocks.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-07 09:33:53 +10:00
Dave Airlie
f356bb74de r600g/winsys: overhaul resource range/blocks.
There isn't much point taking the overhead of range/block lookups on resources
we aren't going to be getting resource registers at wierd offsets.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-07 09:32:29 +10:00
Dave Airlie
be7af43f5a r600g: split out block init
This just splits this function up as pre-cursor to reusing
the internals of it.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-07 09:32:00 +10:00
Dave Airlie
cf0f02e501 r600g: move resource setting to its own structures.
resource setting could be a fair bit more lightweight,
this patch just separates the resource structs from the standard
reg tracking structs in the driver, later patches will improve
the winsys.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-07 09:30:55 +10:00
Dave Airlie
eb4bb48ef4 r600g: only call bo loop if nbos is positive.
we don't need to loop over all the registers unless we have
some bos in the block, also avoid setting the ctx flags,
and move the optional stuff down below this chunk.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-07 09:28:59 +10:00
Dave Airlie
6cd3534676 r600g: don't need to call the packet dirty function if not dirty.
also fix a unneeded dirty check and add a dirty check speedup.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-07 09:25:50 +10:00
Stéphane Marchesin
2292025c49 i915g: implement more opcodes. 2011-06-06 12:36:00 -07:00
Stéphane Marchesin
0f091333d1 i915g: implement TGSI_OPCODE_SEQ. 2011-06-06 12:36:00 -07:00
Stéphane Marchesin
0ce977a66e i915g: handle varyings properly. 2011-06-06 12:36:00 -07:00
Stéphane Marchesin
893b92adff i915g: add missing and unsupported PIPE_CAPs to avoid debug messages. 2011-06-06 12:35:59 -07:00
Stéphane Marchesin
3d3ecb8520 dri2: protect dri2FlushFrontBuffer against NULL buffers. 2011-06-06 12:35:59 -07:00
Stéphane Marchesin
cec2082ae5 Gallium: fix indentation in u_blitter.c 2011-06-06 12:35:59 -07:00
Stéphane Marchesin
3103c08ae9 i915g: don't destroy a texture buffer if it's NULL. 2011-06-06 12:35:58 -07:00
Stéphane Marchesin
1af8b7250f llvmpipe: use $(CXX) instead of g++ for linking.
This allows setting the path to the C++ compiler.
2011-06-06 12:35:58 -07:00
Kenneth Graunke
c2e659037f i965: Update SURFACE_STATE dumping for Ivybridge.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-06-06 11:06:05 -07:00
Kenneth Graunke
4ba9cfe4b8 i965: Update SAMPLER_STATE dumping for Ivybridge.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-06-06 11:06:05 -07:00
Kenneth Graunke
f9a3200adb i965: Update SF_CLIP_VIEWPORT state dumping for Ivybridge.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-06-06 11:06:04 -07:00
Jeremy Huddleston
e5d241ddb2 apple: Package applegl source into MesaLib tarball
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-06 12:48:08 -04:00
Jeremy Huddleston
d563009cd1 darwin: Define GALLIUM_DRIVERS_DIRS in darwin config
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-06 11:38:05 -04:00
Jeremy Huddleston
2ee5272e16 apple: Finish build fixes for applegl_glx.c
libGL.dylib now *builds* on darwin.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-06 11:27:19 -04:00
Jeremy Huddleston
7c5f37c032 apple: More fixes for compilation failures
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-06 11:17:38 -04:00
Andreas Faenger
f4537f99cc softpipe: Anisotropic filtering extension.
Reference implementation which produces high quality renderings.
Based on Higher Quality Elliptical Weighted Avarage Filter (EWA).

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-06-06 08:21:09 -06:00
Brian Paul
b438005d96 st/mesa: fix renderbuffer internal format for accum buffer
Fixes an accum buffer regression since switching to the table-based
format selection code.
2011-06-06 08:06:34 -06:00
Marcin Slusarz
155cf15ce2 util: add \n to debug_checkpoint_full
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2011-06-06 12:41:07 +01:00
Marcin Slusarz
fb40f1f532 nv50: fix nv50_sampler_state_delete array overflow
num_samplers is array of 3 elements, not 5
2011-06-06 11:20:54 +02:00
Jeremy Huddleston
5d35343d12 apple: Fix multiple build failures in applegl_glx.c
It is still not building, but this gets us many steps closer

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

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-05 21:25:27 -04:00
Jeremy Huddleston
1885cf27c9 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>
2011-06-05 20:52:15 -04:00
Jeremy Huddleston
3843bbcb4c glx: Dead code removal
Remove a redundant ifndef GLX_USE_APPLEGL

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-05 20:52:15 -04:00
Jeremy Huddleston
8593bb32ea apple: ifdef out come glapi-foo on darwin
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-05 20:52:14 -04:00
Jeremy Huddleston
7cdf969527 apple: Change from XExtDisplayInfo to struct glx_display
Fixes regression introduced by: ab434f6b76 and
                                c356f5867f

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-05 20:52:14 -04:00
Ben Skeggs
1d24e6ec1d dri/nouveau: fix gnome-shell segfault
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-06-06 10:17:59 +10:00
Jeremy Huddleston
279e471750 apple: Rename GLXcontext
Fixes regression introduced by: c356f5867f

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-05 18:22:47 -04:00
Jeremy Huddleston
b7f0ed8444 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>
2011-06-05 18:19:59 -04:00
Jeremy Huddleston
488d6c739f apple: Re-add driContext and do_destroy
Fixes regression introduced by: c491e585e4

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-05 18:10:55 -04:00
Jeremy Huddleston
22613d1670 apple: Rename GLXcontext
Fixes regression introduced by: c356f5867f

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-05 18:10:55 -04:00
Jeremy Huddleston
bb621cb61e apple: Rename __GLcontextModes to struct glx_config
Fixes regression introduced by: 6ddf66e923

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-05 18:07:05 -04:00
Jeremy Huddleston
4c9bab78a1 apple: Rename glcontextmodes.[ch] to glxconfig.[ch]
Fixes regression introduced by: 65d98e2577

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-05 18:03:45 -04:00
Jeremy Huddleston
8e89d0bea7 apple: Update GL specs
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-05 18:03:44 -04:00
Eric Anholt
e8ea8793e3 meta: Don't do sRGB encode for framebuffer blits on sRGB-enabled framebuffers.
Fixes fbo-srgb-blit.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=35373
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-06-05 11:29:00 -07:00
Eric Anholt
a513bee2f2 meta: Don't do srgb to linear decode when blitting srgb textures.
Fixes the GL_SRGB8_ALPHA8 -> GL_RGBA8 blits in fbo-srgb-blit.c

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-06-05 11:28:59 -07:00
Eric Anholt
164108e3db glx: Fix use-before-null-check in dri2InvalidateBuffers().
The compiler used our dereference here to skip the NULL check below.
Fixes window resize in "jconsole -J-Dsun.java2d.opengl=True" under
OpenJDK 6.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=37766
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-06-03 16:03:34 -07:00
Eric Anholt
836a595594 i965: Drop remaining strict conformance fallback for GL_POINT_SMOOTH.
We actually could do this in hardware in the fragment shader using
gl_PointCoord and the point's size.
2011-06-03 16:03:18 -07:00
Eric Anholt
e9868979c5 i965: Drop strict conformance fallback for GL_LINE_STIPPLE.
We implement line stipples, just not *quite* correctly.  We have a
piglit testcase to use when we want to fix it, if we do.  Until then,
don't lie to our test suites.
2011-06-03 16:03:18 -07:00
Eric Anholt
d313346db6 i965: Drop strict conformance fallback for GL_LINE_SMOOTH.
We do have hardware antialised lines.  If we care, we should actually
fix them to be conformant (or as close as possible) instead of using
this knob to fool testcases using swrast.

For some interesting reading on the state of GL_*_SMOOTH across
several drivers, see:
http://homepage.mac.com/arekkusu/bugs/invariance/HWAA.html
2011-06-03 16:03:18 -07:00
Eric Anholt
d8b733643d i965: Drop strict conformance fallback for GL_POLYGON_SMOOTH.
From my reading of the GL 2.1 spec, no antialiasing is strictly
conformant for polygon smoothing.  Yes, it's absurd, but then,
hardware doesn't support this so maybe it's not so absurd.
2011-06-03 16:03:18 -07:00
Eric Anholt
3f05374574 i965: Drop INTEL_CONFORMANCE=2 fallback code.
This was just a duplicate of no_rast=true driconf option, which is
relatively standard across drivers.
2011-06-03 16:03:18 -07:00
Paul Berry
6491e9593d glsl: fixed printing of structure constants.
ir_print_visitor::visit(ir_constant *) was failing to index properly
into ir->type->fields.structure, so the first field name was being
reprinted for every field in the structure.

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-06-03 12:48:49 -06:00
Paul Berry
26b566e19c AST dump: fixed printing of conditionals.
ast_expression::print() had an incorrect index into the subexpressions
array, so (a ? b : c) was being incorrectly rendered as (a ? b : b).

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-06-03 11:07:00 -06:00
Dave Airlie
4077336fc7 r600g: move spi update to only when states change.
This updates the spi state after ps/vs binding or rasteriser state
change.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-03 15:27:00 +10:00
Dave Airlie
1dbcb83881 cso: move cso hashes to a more table driven scheme
this removes a bad branch pain in the hash table lookup fn.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-03 15:26:59 +10:00
Dave Airlie
970726dd6f u_prim: convert u_trim_pipe_prim to table driven.
This makes this function not be an always miss for the branch predictor.

Noticed using cachegrind, makes a minor difference to gears numbers on r600g.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-03 15:26:59 +10:00
Dave Airlie
de0adb691f r600g: make conv pipe prim table driven.
This is a lot more branch predictor friendly, it actually
showed up in cachegrind profiles.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-03 15:26:59 +10:00
Brian Paul
aaeb9a8216 mesa: fix typo (s/GLGL/GLSL/) 2011-06-02 21:49:49 -06:00
Brian Paul
52f6e79b7c mesa: 80-column wrapping 2011-06-02 21:49:49 -06:00
Brian Paul
9653acc52a mesa: consolidate glGetUniform code 2011-06-02 21:49:49 -06:00
Brian Paul
bbce18c647 mesa: refactor/consolidate uniform lookup code 2011-06-02 21:49:49 -06:00
Brian Paul
230c71d9ee mesa: add some minor fixes for geometry shaders 2011-06-02 21:49:49 -06:00
Brian Paul
b03296c1e9 dri: add missing files from 873379a881 2011-06-02 18:27:10 -06:00
Pierre-Eric Pelloux-Prayer
09201cc7a0 mesa: add implementation of glDrawElementsInstancedBaseVertex
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-06-02 17:55:48 -06:00
Pierre-Eric Pelloux-Prayer
0dae94610e glapi: regenerated files
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-06-02 17:55:13 -06:00
Brian Paul
898f4c5133 glapi: add glDrawElementsInstancedBaseVertex() function to xml
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-06-02 17:54:55 -06:00
Johannes Obermayr
873379a881 dri/nouveau: Fix build with --enable-shared-dricore.
- Based on the work of Себастьян Gliţa Κατινα <cglita@yahoo.com>
- Split Makefile.template into Makefile.defines and Makefile.targets
- Adapt other drivers to new situation
- Fixes https://bugs.freedesktop.org/show_bug.cgi?id=35441

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-06-02 17:21:26 -06:00
Brian Paul
a9c5efb111 r300: remove MIN3 macro, already defined in macros.h 2011-06-02 17:21:26 -06:00
Dave Airlie
51d0892ee2 r600g: sampler and texture state doesn't need a range/block.
These are handled separately in the winsys, so don't need the calculations
done at this point. this manifested as a crash in point-sprite,

Thanks to XoD on #radeon for pointing it out.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-03 08:54:25 +10:00
Adam Jackson
e09e5cb7d8 glx: Remove (unused, broken) fastImageUnpack fast path
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-06-02 15:37:22 -04:00
Adam Jackson
776a2a5447 glx: Fix another case of using req outside of the display lock
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-06-02 15:37:21 -04:00
Marek Olšák
bddf275db4 softpipe: add a better fake implementation of fences
The flush function, when asked for, should not return a NULL fence.

NULL can only be returned if fences are not implemented, and st/mesa
doesn't call any of the fence functions if it receives a NULL fence
(because some drivers don't even set the fence hooks).

ARB_sync is exposed if fence_finish is set.
2011-06-02 16:50:46 +02:00
Brian Paul
f62e1f41b4 util: faster logbase2 2011-06-02 08:45:27 -06:00
Benjamin Bellec
bab3b4a758 mesa: faster logbase2
With minor clean-ups by Brian Paul.

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-06-02 08:31:20 -06:00
Brian Paul
029ea39fb9 st/mesa: add GL_R11F_G11F_B10F to format table
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=37839
2011-06-02 08:01:28 -06:00
Christoph Bumiller
d1fd740bb7 d3d1x/sm4: don't reset 1st index of multi-dimensional operands to 0 2011-06-02 14:10:37 +02:00
Christoph Bumiller
a531513b06 d3d1x/sm4: fix swizzle for 1 component operands
For example, "mov o0.w, l(1)" would use imm_values[3], which is
not valid.
2011-06-02 14:10:34 +02:00
Chris Wilson
f61d1deac7 i965: Raise const.MaxTextureLevels to 14 (8192)
Mesa now limits, by default, the max number of texture levels to 15 so we
can now support the architectural maximum for gen4-6 of 14.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-02 08:30:21 +01:00
Dave Airlie
b0dc2d0c3b r600g: add spi state and move spi/vgt to modify register
This modifies the VGT state and move the SPI setup to its own discrete state.

It then just sets the SPI state up and the VGT state up once and modifies
them thereafter.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-02 15:08:24 +10:00
Dave Airlie
573758fd09 r600g: decrease CPU time on set buffer resources
This splits the initialisation and the setting of values in the resource
buffers. We only should end up initialising once and updateing with new values
when needed.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-02 15:03:52 +10:00
Dave Airlie
4423c79ddf r600g: work out range/block etc at state build time.
This moves the overhead of working out the range/block to state build time,
it also allows the compiler to use constants for a lot of things instead
of working them out each time.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-02 14:59:29 +10:00
Dave Airlie
42502b6f03 r600g: deinline r600_pipe_state_add_reg.
This is going to get too big to be a forced inline. Also going to remove it
from some hotpaths.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-02 14:53:15 +10:00
Dave Airlie
7f6672f6a7 r600g: prepare for passing ctx into _r600_pipe_state_add_reg
This moves the functions down the file, and also adds a ctx parameter.

This is precursor patch just moving stuff around and getting it ready.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-02 14:50:18 +10:00
Dave Airlie
991dbd71fd r600g: migrate macros from r600_priv.h to r600.h
this is just an precursor change for some later patches.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-02 14:42:11 +10:00
Dave Airlie
c1159eea54 r600g: remote ctx arg to block/range macros.
These aren't used anymore.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-02 14:40:40 +10:00
Dave Airlie
8782fdc1db r600g: avoid copying unnecessary pieces of a block.
This just avoids copying stuff if its going to modify the number of dwords
later anyways.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-02 14:29:37 +10:00
Dave Airlie
9eb86f89a9 r600g: optimise state setting in r600_draw_vbo.
This drop the r600_draw_vbo CPU usage on a run of nexuiz from 1.40% to 0.72%
in sysprof for me on my Fusion APU.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-02 14:22:42 +10:00
Dave Airlie
8fcafeb475 r600g: force new evergreen blocks for large range.
This range was 76 dwords long, the 75th dword changes, the first 60 or so
don't. split the block so it emits less often.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-02 14:22:42 +10:00
Brian Paul
57242715cb st/mesa: add format table entry for GL_RGB9_E5
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=37839
2011-06-01 16:25:42 -06:00
Nathan Kidd
f3652f0983 glapi: Make xserver location error more helpful
glx code hasn't lived under xserver/GL for a long time now.

Signed-off-by: Nathan Kidd <nkidd@opentext.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-06-01 08:30:59 -06:00
Marek Olšák
b9e9df78a0 mesa: queries of non-existent FBO attachments should return INVALID_OPERATION
OpenGL 4.0 Compatibility, page 449:

If the value of FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE is NONE, no
framebuffer is bound to target. In this case querying pname FRAMEBUFFER_-
ATTACHMENT_OBJECT_NAME will return zero, and all other queries will generate
an INVALID_OPERATION error.

Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-06-01 16:07:58 +02:00
Marek Olšák
d69dc2e203 mesa: UseShaderProgramEXT and Uniform* shouldn't be allowed inside Begin/End
I couldn't find this being required by the spec.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-06-01 16:03:26 +02:00
Marek Olšák
37a85b1830 r300g: remove unused debug option DBG_UPLOAD
And renumber the options.
2011-06-01 04:47:41 +02:00
Alex Deucher
c5903ed454 r600c: add support for llano
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-31 18:10:01 -04:00
Alex Deucher
414cd5df50 r600g: add llano support
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-31 18:10:01 -04:00
Eric Anholt
c331b3123e i965/fs: Use the embedded compare in SEL on gen6+.
This avoids the extra CMP and the predication on SEL, so in addition
to one less instruction, it makes scheduling less constrained.

Improves glbenchmark Egypt performance 0.6% +/- 0.2% (n=3).  Reduces
FS instruction count across affected shaders in shader-db by 1.3%
without regressing any.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-31 12:23:50 -07:00
Benjamin Franzke
089aa313b4 wayland-drm: Check visual for being NULL 2011-05-31 15:13:37 -04:00
Benjamin Franzke
fc5aec9342 Fiuxp make tarballs for wayland-egl/drm 2011-05-31 15:13:37 -04:00
Benjamin Franzke
a7cd65fb38 st/egl: Fix udev linkage when egl_dri2 is not build 2011-05-31 15:13:37 -04:00
Benjamin Franzke
aa87a938fb egl_dri2: Fix usage of bool values 2011-05-31 15:13:36 -04:00
Benjamin Franzke
5bf6cc95c1 wayland-egl: Remove left-over headers and struct 2011-05-31 15:13:36 -04:00
Eric Anholt
f04765922c i965: Remove brw_surface_state struct that is now unused.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-05-31 12:07:29 -07:00
Eric Anholt
ee643b23ff i965: Switch brw_state_dump to using bitshifting for surface state.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-05-31 12:07:29 -07:00
Eric Anholt
e764f10ea5 i965: Replace struct with bit shifting for WM null surfaces.
Reduces compiled size of brw_wm_surface_state.o another 1.9%.

Overall, this brw_wm_surface_state reduction series cuts
firefox-talos-gfx runtime by 0.68% +/- 0.42% (n=6).

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-05-31 12:07:29 -07:00
Eric Anholt
9bdc44a528 i965: Replace struct with bit shifting for WM pull constant surfaces.
This reduces compiled size (4.7% of brw_wm_surface_state.o).

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-05-31 12:07:28 -07:00
Eric Anholt
ac11c01dde i965: Replace struct with bit shifting for WM render target surfaces.
This massively reduces compiled size (6.7% of brw_wm_surface_state.o).

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-05-31 12:07:28 -07:00
Eric Anholt
ae5c1fceba i965: Replace structs with bitfield shifting for WM texture surfaces.
This massively reduces compiled size (4.9% of brw_wm_surface_state.o).

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-05-31 12:07:28 -07:00
Eric Anholt
7d437b1f7f i965: Add defines for surface state setup using bitfield shifting.
It turns out that gcc is just awful at generating code for
brw_structs.h style state setup, and using bitshifting on u32s
generates better code while being similarly readable (and more
verifiable compared to the specs, using the INTEL_MASK macro).
2011-05-31 12:07:28 -07:00
Eric Anholt
3412069e23 i965: Don't compute brw->wm.input_size_masks when it's unused.
It's only used in the old fragment program path, to avoid projection
when w is always 1.  We do want to do this in the new path pre-gen6
too, but we'll probably do it through the ir.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-31 12:07:28 -07:00
Eric Anholt
bcbb1a536f i965: Drop a gratuitous "if" that the compiler didn't eliminate at -O2.
Oddly, this increases compiled code size.  (marking the 'if' as likely
also increases code size, but not as much).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-05-31 12:07:28 -07:00
Eric Anholt
d1946f5348 i965: Move prepare_wm_surfaces texobj declarations inside of _ReallyEnabled.
Interestingly, the compiler wasn't doing this for us at -O2, so we
were doing the computation for every non-_ReallyEnabled unit.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-05-31 12:07:28 -07:00
Ian Romanick
f29bc77572 intel: Remove unused NO_TILE macro
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-31 11:46:29 -07:00
Marek Olšák
b1246cf13b r300g: set squared microtiling for the dummy zbuffer
The pitch of 4 is allowed for squared microtiling only.
2011-05-31 18:19:27 +02:00
Alex Deucher
b5518834e3 r600g: cs init fixes
- all asics need to emit CONTEXT_CONTROL
- all r6xx asics need to emit 3D_START_CMDBUF

The ddx and r600c already do this. r600g should as well.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-31 10:43:31 -04:00
Marek Olšák
c4175c811e r300g: log when getting unsupported texture format 2011-05-31 15:20:38 +02:00
Dave Airlie
d2ede5e648 gallium: include limits.h in p_config.h
We are getting inconsistent methods for endian detection (same answer when
it works, just doesn't work on some platforms) depending on whether __GLIBC__
is defined, which of course depends on include ordering before p_config.h

Just make p_config.h include limits.h to solve this.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-31 17:28:48 +10:00
Dave Airlie
0cdd82df53 r600g: add context control to start of CS
On my original R600 card this at least lets gnome shell run for a while longer
and the piglit r300-readcache test case works a lot more reliably.

Still a few more stability issues running a piglit test run though.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-31 15:42:45 +10:00
Dave Airlie
65ee7cd1df r600g: don't emit color blend register on original R600.
The original R600 doesn't have these so don't emit them.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-31 10:52:07 +10:00
Marek Olšák
29ceeeba20 mesa: forbid UseProgram to be called inside Begin/End
The spec doesn't state it should be an error, but. We have this piglit test
useprogram-inside-begin that passes with this commit. No idea what's correct.

NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-30 16:26:02 +02:00
Marek Olšák
1b37a41661 st/mesa: don't use resource_copy_region for CopyPixels with conditional render
The conditional rendering should be able to kill CopyPixels.
I assume the render condition has no effect on resource_copy_region.

This fixes piglit:
- NV_conditional_render/copypixels

NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-30 10:51:06 +02:00
Marek Olšák
8d45bbc422 st/mesa: conditional rendering should not kill texture decompression via blit
NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-30 10:51:03 +02:00
Marek Olšák
91e56c8897 st/mesa: CopyTex(Sub)Image should not be killed by conditional rendering
NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-30 10:51:01 +02:00
Marek Olšák
ccfeb90b75 st/mesa: BlitFramebuffer should not be killed by conditional rendering
NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-30 10:50:58 +02:00
Marek Olšák
c0277d9539 swrast: BlitFramebuffer should not be killed by conditional rendering
NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-30 10:50:53 +02:00
Marek Olšák
1c95c3ef9c st/mesa: GenerateMipmap should not be killed by conditional rendering
NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-30 10:50:43 +02:00
Marek Olšák
24ed0b384b st/mesa: fix typos and add some format fallbacks in format_map
Always default to DEFAULT_*_FORMATS for mandatory GL formats.
   (st_choose_format must not fail for those)
Use DEFAULT_RGBA when alpha is required instead of RGB.
Use DEFAULT_RGB otherwise.

These are more or less the remaining differences between the old code and
the new one.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-30 10:49:35 +02:00
Marek Olšák
6c638b7ca1 st/mesa: consolidate listing of depth formats
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-30 10:49:31 +02:00
Marek Olšák
26d718ff71 st/mesa: add GL_DEPTH_COMPONENT32 fallback formats
This makes D32 work again on chipsets which can't do it.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-30 10:49:27 +02:00
Marek Olšák
49d4e803d3 st/mesa: fix changing internal format via RenderbufferStorage
The problem is: The second time the function is called with a new
internal format, strb->format is usually not PIPE_FORMAT_NONE.

RenderbufferStorage(... GL_RGBA8 ...);
RenderbufferStorage(... GL_RGBA16 ...); // had no effect on the format

Broken with: fd6f2d6e57
Test: piglit/fbo-storage-completeness

NOTE: This is a candidate for the 7.10 branch.
(if fd6f2d6e57 is cherry-picked as well)

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-30 10:49:21 +02:00
Marek Olšák
ff038170ff tgsi/ureg: bump the limit of immediates
Lowered indirect addressing can create lots of immediates.

Fixes piglit/glsl-fs-uniform-array-7 on r300g.

NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-30 10:48:03 +02:00
Marek Olšák
f133ff51a2 trace: implement texture_barrier 2011-05-29 16:17:11 +02:00
Marek Olšák
b9e8cb0a59 trace: implement render_condition 2011-05-29 16:17:11 +02:00
Marek Olšák
76056510bc r300g: clear can be killed by render condition
Fixes piglit:
- NV_conditional_render/clear
2011-05-29 16:17:11 +02:00
Tom Stellard
aae56150f5 r300g: Fix non-dri builds
This is just a temporary solution for now until there is a better way
to share code between mesa and gallium.
2011-05-28 21:16:00 -07:00
Marek Olšák
f76787b3ea r300g: fix occlusion queries when depth test is disabled or zbuffer is missing
From now on, depth test is always enabled in hardware.

If depth test is disabled in Gallium, the hardware Z function is set to ALWAYS.

If there is no zbuffer set, the colorbuffer0 memory is set as a zbuffer
to silence the CS checker.

This fixes piglit:
- occlusion-query-discard
- NV_conditional_render/bitmap
- NV_conditional_render/drawpixels
- NV_conditional_render/vertex_array
2011-05-29 05:15:27 +02:00
Marek Olšák
d18792f93d r300g: cleanup render_condition a bit 2011-05-29 05:15:27 +02:00
Marek Olšák
70b86fb273 r300g: remove fake occlusion queries (debug option) 2011-05-29 05:15:27 +02:00
Marek Olšák
2397f20b6b r300g: remove debug option DBG_FALL 2011-05-29 05:15:27 +02:00
Marek Olšák
9a3f861faf r300g: print some HyperZ debug info 2011-05-29 03:03:14 +02:00
Stéphane Marchesin
fc48de4fab glx: Fix glXGetFBConfigFromVisualSGIX.
We want to check for Success, otherwise it will fail even with the right visual.

NOTE: This is a candidate for the 7.10 branch.

Signed-off-by: Antoine Labour <piman@chromium.org>
Signed-off-by: Stéphane Marchesin <marcheu@chromium.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-05-27 11:58:36 -06:00
Pierre-Eric Pelloux-Prayer
4eeabd5a3d mesa: set parameter list StateFlags field in _mesa_layout_parameters()
When using _mesa_layout_parameters, all params copied in the 'layout'
output in the PASS 1 don't modify StateFlags (because they are simply
memcpy'ed).
This patch fixes the problem, assuring output gl_prog_param_list
StateFlags field is the same as the input one.

NOTE: This is a candidate for the 7.10 branch.

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-05-27 11:58:36 -06:00
Eric Anholt
0653c450cc i965/fs: Fix up for 8752764076.
I failed to commit and squash before pushing.
2011-05-27 09:51:28 -07:00
Eric Anholt
9bd7e9c6b2 mesa: Include shader target in dumps of GLSL source.
This makes automatic parsing of MESA_GLSL=dump output easier.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-27 09:07:32 -07:00
Eric Anholt
8752764076 i965/fs: Do a FS compile up front at link time to produce link errors.
At glLinkShaders time, a fail() call in FS compile in 8-wide (the one
that's required to succeed, though we may relax that at some point for
pre-Ironlake performance) will now report out as a link error.
2011-05-27 09:07:32 -07:00
Eric Anholt
d1f70a8a6c i965/fs: Split the GLSL IR -> FS LIR visitor to brw_fs_visitor.cpp.
We now have:
brw_fs.cpp handles calling out to everything and optimization.
brw_fs_visitor.cpp handles translating to our LIR.
brw_fs_emit.cpp handles emitting from our LIR to native code.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-27 08:51:40 -07:00
Eric Anholt
11dd9e9c0f i965/fs: Split the BRW native code emit to brw_fs_emit.cpp
This is all separate from the visitor and the optimization passes
which feed into it.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-27 08:51:39 -07:00
Eric Anholt
b7b700aeb0 i965: Move a couple of GLSL IR -> BRW helper functions to brw_shader.cpp.
These will be used by the VS backend as well.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-27 08:51:30 -07:00
Eric Anholt
14b86f3c91 i965: Move non-FS-specific shader support to brw_shader.cpp.
These only existed in brw_fs.cpp because it was the only .cpp file in
the area when I wrote them.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-27 08:51:05 -07:00
Eric Anholt
53c89c67f3 i965: Avoid generating MOVs for assignments of expressions.
No statistically significant difference measured in 3dbenchmark
egypt/pro.  It does reduce fragment shader instructions across
shader-db by 0.3%.
2011-05-27 08:19:52 -07:00
Eric Anholt
1791857d7d i965/fs: Move the computation of register block count from unit to compile.
No net code size change, but unit update is down 0.8% code size
pre-gen6.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-27 08:19:27 -07:00
Eric Anholt
615117ce4e i965/fs: Track fixed GRF regs separate from allocated GRF file in scheduling.
There's an assumption here that fixed GRFs will never intersect with
the allocated GRFs.  That's true today, though it might change some
day if we decide to register-allocate the regs containing push
constants once they're dead.

This fixes a regression in 0f7325b890 in
Lightsmark from the texture instructions now containing g0 references
instead of having that be implied.  Performance is improved 15.2% +/-
3.6% (n=3).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34968
2011-05-27 08:08:23 -07:00
Eric Anholt
40540cc517 i965/fs: Add a helper function for add_dep(before, after, before->latency).
This lets us avoid a bunch of before==NULL checks in the callers.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-27 08:08:23 -07:00
Trevor Davenport
828b26b7eb nv50: fix emit_add_a16 to emit correct source reg
emit_add_a16 was using the incorrect source.
This caused adds in the form of:

   add u16 $a0 s32 $a1 u32 0x00000200

to have a source AREG of $a0 instead of $a1.

Fixes World of Warcraft in OpenGL and D3D without GLSL.
2011-05-27 10:25:40 +02:00
Brian Paul
4609e80288 mesa: s/height/depth/ in texsubimage()
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=37648
2011-05-26 19:25:44 -06:00
Brian Paul
e401c1f57f mesa: plug _mesa_GetObjectParameterivAPPLE into display list dispatch table 2011-05-26 19:25:44 -06:00
Brian Paul
6126d50e75 mesa: plug in GL_ARB_vertex_array_object display list functions 2011-05-26 19:25:44 -06:00
Brian Paul
e00481586c mesa: more geometry shader display list functions 2011-05-26 19:25:44 -06:00
Brian Paul
3b0f431820 mesa: more transform feedback display list functions 2011-05-26 19:25:44 -06:00
Brian Paul
919e260bff mesa: make query object API functions static
Only directly referenced by the _mesa_init_queryobj_dispatch() function.
2011-05-26 19:25:44 -06:00
Brian Paul
848bcd2e8c mesa: simplify query object display list dispatch setup 2011-05-26 19:25:44 -06:00
Eric Anholt
f7b3f40b70 i965: Pack the lookup and line_aa bits into the first dword of the key.
They were occupying whole 32-bit words, despite being only 10 or so
bits.  Reduces code size slightly (80/3300 bytes).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-26 10:07:38 -07:00
Eric Anholt
9a729ab4b2 i965: Remove dead shadowtex_mask entry in the WM key.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-26 10:07:38 -07:00
Eric Anholt
f147599ef4 i965: Remove linear_color for GL_PERSPECTIVE_CORRECTION_HINT.
From the GL 2.1 spec:

   "Required perspective-correct interpolation for all fragment
    attributes except depth in sections 3.4.1 and 3.5.1, effectively
    making GL PERSPECTIVE CORRECT HINT a no-op."

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-26 10:07:38 -07:00
Eric Anholt
c095335fa5 intel: Drop doubly irrelevant code in intelReadBuffers.
First, FBO read/draw == NULL validation happens in mesa core not
intelReadBuffers -> intel_draw_buffers.  Second, that condition is no
longer tested for in our driver since ARB_ES2_compatibility was added.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-26 08:54:29 -07:00
Eric Anholt
6d4b974e89 mesa: Flush vertices before updating drawbuffer computed state.
Otherwise, the driver is likely to draw the flushed vertices to the
new drawbuffer instead of the old one, missing the point of the flush.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-26 08:54:29 -07:00
Eric Anholt
d3451f7f9c mesa: Allow NULL read/draw in complete FBOs in ARB_ES2_compatibility.
From the ARB_ES2_compatibility spec:

    "(8) How should we handle draw buffer completeness?

    RESOLVED: Remove draw/readbuffer completeness checks, and treat
    drawbuffers referring to missing attachments as if they were NONE."

Fixes arb_es2_compatibility-drawbuffers when the short-circuit for
ARB_ES2_compatibility in the previous commit is dropped.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-26 08:54:29 -07:00
Eric Anholt
f73ff463a2 mesa: Trigger FBO validation on DrawBuffers change in non-ES2 mode.
glDrawBuffers pointing at an unattached buffer is supposed to be
incomplete without ARB_ES2_compatibility.  The testcase to catch the
bug of not implementing that bit of the spec was tricked by this
missing piece of state update.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-26 08:54:29 -07:00
Brian Paul
179a88d52c mesa: minor whitespace fixes 2011-05-25 21:07:50 -06:00
Brian Paul
f84be846ca mesa: plug in sync object display list functions
Most just dispatch through to the immediate mode functions, except
for glWaitSync(), per the extension spec.
2011-05-25 21:06:51 -06:00
Brian Paul
95fa22c864 mesa: display list support for glProgramParameteriARB() 2011-05-25 20:44:35 -06:00
Brian Paul
001aa6c979 mesa: plug shader object functions into display list dispatch 2011-05-25 20:39:08 -06:00
Brian Paul
4535c98cdb mesa: plug in GL 3.0 ClearBuffer() display list functions 2011-05-25 20:27:44 -06:00
Brian Paul
8f7c815568 mesa: fill in missing sampler object display list functions 2011-05-25 20:20:22 -06:00
Brian Paul
3e06803c2c st/mesa: simplify some st_context(ctx)->pipe code 2011-05-25 18:16:03 -06:00
Brian Paul
bf14ab417c st/mesa: fix incorrect texture level/face/slice accesses
If we use FBOs to access mipmap levels with glRead/Draw/CopyPixels()
we need to be sure to access the correct mipmap level/face/slice.
Before, we were just passing zero in quite a few places.

This fixes the new piglit fbo-mipmap-copypix test.

NOTE: This is a candidate for the 7.10 branch.
2011-05-25 18:07:35 -06:00
Jakob Bornecrantz
1697dac642 i915g: Bump texture sizes
Spotted and tested by Christopher Egert.

Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2011-05-25 22:06:11 +02:00
Eric Anholt
b5846865de i965: Warnings cleanup.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-25 11:16:36 -07:00
Eric Anholt
fa42de5ad7 i965: Fix assertion failures in unused brw_reg setup by deleting it.
I was using undefined values to create an unused value.  Go me.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=37366
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-25 11:16:36 -07:00
Alex Deucher
5ed7a7b720 r600g: remove duplicate opcode in r600_opcodes.h
V_SQ_CF_WORD1_SQ_CF_INST_HALT is 0x1f on both
evergreen and cayman.

Reported-by: Gustaw Smolarczyk <wielkiegie@gmail.com>
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-25 11:04:25 -04:00
Chad Versace
e7bcfadc22 intel: Change FBO validation criteria to accomodate hiz and seprate stencil
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-05-25 07:41:32 -07:00
Chad Versace
ce8fdf666f intel: Fix intel_draw_buffer() to accomodate hiz and separate stencil
The logic of intel_draw_buffers() expected that stencil buffers were
always combined depth/stencil.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-05-25 07:41:32 -07:00
Chad Versace
c270f1a628 intel: Add hiz_region to intel_mipmap_tree
When a texture is attached to multiple FBO's, a separate renderbuffer
wrapper is created for each attachment. This necessitates storing the hiz
region for these renderbuffers in the texture itself instead of the
renderbuffer wrapper.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-05-25 07:41:32 -07:00
Chad Versace
6ed829fe50 intel: Refactor the wrapping of textures with renderbuffers
Before this commit, the renderbuffer's region was updated in
intel_renderbuffer_texture(). This commit moves the update into
intel_update_wrapper(), which is a more logical location for updates.

This is in preparation for the next commit, which allocates and
updates the texture's hiz region in intel_update_wrapper(). Having the two
region updates located in the same function makes good form.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-05-25 07:41:32 -07:00
Chad Versace
7c0e6d9bbc intel: Add hiz_region to intel_renderbuffer
A hiz surface must be supplied to the hardware when rendering to a depth
buffer with hiz. There are three potential places to store that surface:
    1. Allocate a larger intel_region for the depthbuffer, and let the
       region's tail be the hiz surface.
    2. Allocate a separate intel_region for hiz, and store it as
       brw_context state.
    3. Allocate a separate intel_region for hiz, and store it in
       intel_renderbuffer.

We choose method 3.

Method 1 has not been chosen due to future complications it might cause
when requesting a DRI drawable's depth buffer attachment from X.

Method 2 has not been chosen because storing the hiz region apart from
the depth region makes lazy hiz/depth resolves difficult to implement.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-05-25 07:41:32 -07:00
Chad Versace
a9e6509785 intel: Add is_hiz_depth_format() to intel_contex.vtbl
Given a format, is_hiz_depth_format() indicates if HiZ can be enabled on
a depthbuffer of that format.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-05-25 07:41:32 -07:00
Chad Versace
1a1411e09b intel: Allocate region for separate stencil buffer
... in intel_alloc_renderbuffer_storage().  The stencil buffer has quirky
pitch requirements, so its region allocation is a special case.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-05-25 07:41:32 -07:00
Chad Versace
b5c847c7ca intel: Change supported texture formats for separate stencil
When hardware supports separate stencil, enable support for separate
depth/stencil texture formats in the table
intel_context.ctx.TextureFormatsSupported. If the hardware must use
separate stencil, then disable support for combined depth/stencil formats.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-05-25 07:41:31 -07:00
Chad Versace
4e0654ec29 mesa: Add MESA_FORMAT_X8_Z24 to _mesa_choose_tex_format
Prefer MESA_FORMAT_X8_Z24 over MESA_FORMAT_S8_Z24 for textures with
internal format GL_DEPTH_COMPONENT*.

i965 needs MESA_FORMAT_X8_Z24 for HiZ and separate stencil.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-05-25 07:41:31 -07:00
Chad Versace
76f77cb07e intel: Add flags to intel_context for hiz and separate stencil
Add the following flags:
    intel_context.has_separate_stencil
    intel_context.must_use_separate_stencil
    intel_context.has_hiz

The flags are currently set to false, and will be enabled for a given
chipset once the feature is completely implemented.

Since it may be some time before these features are completed, their
values can be overridden with environment variables INTEL_HIZ and
INTEL_SEPARATE_STENCIL. Valid values for these environment variables are
"0" and "1".

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-05-25 07:41:31 -07:00
Adam Jackson
a95ec18549 glx: Don't refer to the request buffer outside of {L,Unl}ockDisplay
... because that's not a safe thing to do.  The request buffer is shared
storage among all threads, and after UnlockDisplay the 'req' pointer may
point into someone else's request.

NOTE: This is a candidate for the 7.10 branch.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-05-25 06:19:29 -04:00
Alex Deucher
c44dad559a egl_dri2: add new cayman pci ids
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-25 01:27:34 -04:00
Alex Deucher
017cd5dcc3 r600g: fix eg/cayman scissor workaround
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-24 22:44:16 -04:00
Dave Airlie
868c04205c r600g: add workaround for buggy hw scissor on eg/cayman.
This is ported from the same fix to the DDX.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-25 11:50:17 +10:00
Dave Airlie
7779f6d1df r600g: add initial cayman acceleration support.
Cayman is the RadeonHD 69xx series of GPUs. This adds support for
3D acceleration to the r600g driver.

Major changes:
Some context registers moved around - mainly MSAA and clipping/guardband related.
GPR allocation is all dynamic
no vertex cache - all unified in texture cache.
5-wide to 4-wide shader engines (no scalar or trans slot)
	- some changes to how instructions are placed into slots
	- removal of END_OF_PROGRAM bit in favour of END flow control clause
	- no vertex fetch clause - TC accepts vertex or texture

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-25 11:42:45 +10:00
Dave Airlie
d1b8f8e8b3 r600g: don't lookup a vs semantic for position/face.
These don't need one, and I was seeing 0xff being returned and set in
the GPU registers with some tests.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-25 10:01:25 +10:00
Dave Airlie
ece871c038 r600g: flush the DB dest base as well.
If we do this for CB bases then we should do it for DB bases.

noticed while adding cayman support.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-25 09:37:33 +10:00
Adam Jackson
3869be74af glx: More comment cleanup
Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-05-24 16:45:02 -04:00
Adam Jackson
a3aecd190b glx: Remove some misleading comments
These functions have already been modified for direct rendering.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-05-24 16:44:33 -04:00
Adam Jackson
5a6897ff0b drisw: Namespace better for ease of navigation
Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-05-24 16:44:21 -04:00
Adam Jackson
b24f291e42 drisw: dead store removal
Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-05-24 16:43:53 -04:00
Mike Kaplinskiy
d3b6e8a2b8 mesa: fix glGetTexImage for cases when srgb decode is skipped
See http://bugs.freedesktop.org/show_bug.cgi?id=37150

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-05-24 09:06:04 -06:00
Brian Paul
cd5417aac7 st/mesa: prefer formats without stencil for DEPTH_COMPONENT
for fast Z clears to be used more often.

Original patch by Marek Olšák.  Rebased to table-driven st_choose_format()
by Brian Paul.
2011-05-24 09:00:17 -06:00
Brian Paul
d57e95f22a st/mesa: rewrite st_choose_format() to be table driven
Instead of using a giant switch statement with lots of code, use a
table to convert GL format enums to pipe formats.

Tested by running the old code next to the new and asserting that
the return value was the same for piglit tests.

We're doing a linear search, but if that ever appears to be too slow
the table could easily be sorted or hashed.
2011-05-24 08:49:01 -06:00
José Fonseca
c3c1976f52 wgl: Don't hold on to user supplied HDC.
Certain applications (e.g., Bernina My Label, and the Windows
implementation of Processing language) destroy the device context used when
creating the frame-buffer, causing presents to fail because we were still
referring to the old device context internally.

This change ensures we always use the same HDC passed to the ICD
entry-points when available, or our own HDC when not available (necessary
only when flushing on single buffered visuals).
2011-05-24 13:12:39 +01:00
Thierry Reding
5af46e8360 mesa: Fix remap_table setup.
Since the SET_xxx and GET_xxx macros used to initialize the remap_table
have been replaced by inline functions, the missing late macro expansion
leads to driDispatchRemapTable not being redefined to remap_table, which
in turn causes the remap_table not to be setup properly.

This commit fixes the issue by moving the table redefinition after the
definition of driDispatchRemapTable but in front of the inline function
definitions.
2011-05-23 16:19:44 +01:00
Adam Jackson
e8b1c6d6f5 mesa: Fix return type of _mesa_get_format_bytes() (#37351)
Despite that negative values aren't sensible here, making this unsigned
is dangerous.  Consider get_pointer_generic, which computes a value of
the form:

    void *base + (int x * int stride + int y) * unsigned bpp

The usual arithmetic conversions will coerce the (x*stride + y)
subexpression to unsigned.  Since stride can be negative, this is
disastrous.

Fixes at least the following piglit tests on Ironlake:

    fbo/fbo-blit-d24s8
    spec/ARB_depth_texture/fbo-clear-formats
    spec/EXT_packed_depth_stencil/fbo-clear-formats

NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Chad Versace <chad.versace@intel.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-05-23 11:07:34 -04:00
Kenneth Graunke
d0c6d24a9e i965/gen7: Fix miptree layout for cube surfaces.
Volume 1a section 8.20.4.7.3 gives new equations which multiply by 12
instead of 11.

Fixes 8 piglit tests:
- fbo-cubemap
- texCube
- glsl-fs-texturecube
- glsl-fs-texturecube-2
- glsl-fs-texturecube-2-bias
- glsl-fs-texturecube-bias
- arb_seamless_cubemap
- cubemap

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-22 15:01:16 -07:00
Kenneth Graunke
b522eb0717 i965: Remove comments about pre-965 hardware.
They're irrelevant for this driver.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-22 15:01:16 -07:00
pepp
fd6f2d6e57 st/mesa: assign renderbuffer's format field when allocating storage
See http://bugs.freedesktop.org/show_bug.cgi?id=36173

NOTE: This is a candidate for the 7.10 branch.

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-05-21 09:49:14 -06:00
Christian König
3c5e741862 r600g: fix "Fixed-Point Data Conversions"
According to OpenGL 3.1 chapter 2.1.5 the representation without zero
should only be used for vertex attribute values, but not for textures
or frame-buffers.
2011-05-21 16:40:20 +02:00
Kenneth Graunke
9be8524af7 i965: Fix sampling on Ivybridge after headerless change.
Fixes a regression since 90e922267a.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-20 16:33:43 -07:00
Kenneth Graunke
24de02acac i965: Remove "TXD" from justification of sampler message headers.
The coordinate offsets set in the m1 header are for textureOffset;
they have nothing to do with textureGrad (TXD).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-20 16:33:43 -07:00
Kenneth Graunke
5e48560926 i965/gen7: Add support for rendering to depthbuffer mipmap levels > 0.
The same as 3e43adef95 but for Gen7.

This doesn't quite fix GL_ARB_depth_texture/fbo-clear-formats; there's
still a 1 pixel wide black line on the right edge of the smaller squares.

The results were entirely wrong before, and are at least close now.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-20 16:31:18 -07:00
Benjamin Franzke
733fa000ce st/egl: Add support for EGL_DRM_BUFFER_USE_CURSOR_MESA 2011-05-20 19:10:22 +02:00
Benjamin Franzke
ea90eca44b st/dri: Support dri2 useflags in dri2_create_image 2011-05-20 19:10:22 +02:00
Benjamin Franzke
ca79036fe8 st/egl/wayland: Deal with wayland visual changes
Since wayland 4bde293ff8109d55eeaee8732f5a6ee0c8cd4bd9 we cant
lookup visuals, as we dont receive the visual token events.

The format for pixmap-images thus has to default to argb for now.
2011-05-20 13:05:14 -04:00
Thierry Reding
8e7d4d4e0c mesa: Emit definition of GLAPIENTRYP in es_generator.py.
GLES uses GL_APIENTRYP instead of GLAPIENTRYP, which breaks with the
latest API table generation code. This fixes the issue by emitting a
definition for GL_APIENTRYP when generating the GLES files.
2011-05-20 12:59:23 +01:00
José Fonseca
075d2bfb72 glapi: More type-checking in Get_xxx too. 2011-05-20 12:59:23 +01:00
José Fonseca
a436b3b2d4 gallivm: Fix for dynamically linked LLVM 2.8 library.
This prevents the error

    prog: for the -disable-mmx option: may only occur zero or one times!

when creating a new context after XCloseDisplay with DRI drivers linked
with a shared LLVM 2.8 library.
2011-05-20 11:54:52 +01:00
Brian Paul
4f59b32178 r300: move declaration before code 2011-05-19 21:23:39 -06:00
Brian Paul
38f89c7008 st/glx: define/set new ST_CONTEXT_FLAG_bits 2011-05-19 21:18:33 -06:00
Brian Paul
1929d52fd9 st/glx: pass major, minor, context flags, etc to XMesaCreateContext() 2011-05-19 21:18:33 -06:00
Brian Paul
d1cd1cc871 st/glx: implement glXCreateContextAttribsARB() 2011-05-19 21:18:33 -06:00
Brian Paul
81183b1e3e st/glx: pass version, context flags, etc to create_context() 2011-05-19 21:18:33 -06:00
Brian Paul
7be3e50731 st/glx: refactor create-context functions 2011-05-19 21:18:33 -06:00
Brian Paul
43bdabd47d mesa: fix vertex array enable checking in check_valid_to_render()
In particular, this fixes the case where a vertex shader only uses
generic vertex attributes (non-0th).  Before, we were no-op'ing the
glDrawArrays/Elements().

This fixes the new piglit pos-array test.

NOTE: This is a candidate for the 7.10 branch.
2011-05-19 21:18:33 -06:00
Roland Scheidegger
be0a2f62f3 mesa: handle some srgb cases in the fast path in _mesa_get_teximage
Previously, always did unorm8->float/nonlinear-to-linear conversion (using
lookup table), then convert back to nonlinear (using the expensive math
func pow among others), and finally convert back to int (assuming caller
wants unorm8), because the float texture fetch function is used for getting
the actual texel values. This should probably all be changed at some point,
but for now simply enable the memcpy path also for srgb formats (but if for
instance swizzling is required, still the whole conversion will be done).
2011-05-20 01:43:40 +02:00
Kristian Høgsberg
339544f4bb wayland-drm: Use new generic error event 2011-05-19 12:07:00 -04:00
José Fonseca
ec4dfc2aad glapi: Implement SET_xxx as inline functions instead of macros.
In order to have the benefit of type checking, and detect missing
GLAPIENTRY keywords on public entrypoints.
2011-05-19 16:49:49 +01:00
José Fonseca
f4a9868811 mesa: add another missing GLAPIENTRY keyword
NOTE: this is a candidate for the 7.10 branch.
2011-05-19 16:39:57 +01:00
Maxim Levitsky
116133af34 nv50: add support for user clip planes
Clip distance is calculated each time vertex position is written
which is suboptiomal is some cases but very safe.
User clip planes are an obsolete feature anyway.

Every time number of clip planes increases, the vertex program
is recompiled.
That ensures no overhead in normal case (no user clip planes)
and reasonable overhead otherwise.

Fixes 3D windows in compiz, and reflection effect in neverball.
Also fixes compiz expo plugin when windows were dragged and each
window shown 3 times.
2011-05-19 12:50:28 +02:00
Kristian Høgsberg
bfaa458445 wayland: Fix link order for libwayland-drm.a 2011-05-18 18:57:05 -04:00
Eric Anholt
3e43adef95 i965: Add support for rendering to depthbuffer mipmap levels > 0.
Fixes
GL_ARB_depth_texture/fbo-clear-formats
GL_EXT_packed_depth_stencil/fbo-clear-formats
2011-05-18 13:57:18 -07:00
Eric Anholt
a98dd64af7 i965: Stop caching the combined depth/stencil region in brw_context.c.
This was going to get in the way of separate depth/stencil (which
wants to know about both, and whether they are the same rb), and also
wasn't a sufficient flag for the fix in the following commit.
2011-05-18 13:57:17 -07:00
Eric Anholt
64f8ddaf9b i965/gen6: Add support for point min/max size from ARB_point_parameters.
Fixes glean pointAtten.
2011-05-18 13:57:17 -07:00
Eric Anholt
90e922267a i965/fs: Don't emit a header on gen5+ sample messages unless required.
Improves glbenchmark egypt performance 0.6% +/- 0.4% (n=6).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-18 13:57:17 -07:00
Eric Anholt
4bbc7915f1 i965/fs: Fix GPU hang on texture2d-bias on pre-Ironlake.
In the 16-wide rework, I missed that we were setting some things to be
SIMD16 mode (corresponding to their setup in emit_texture_gen4()).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-18 13:57:17 -07:00
Eric Anholt
b126a0c0cb i965: Add support for correct GL_CLAMP behavior by clamping coordinates.
This removes the stupid strict-conformance fallback code I broke when
adding ARB_sampler_objects.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=36572
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
2011-05-18 13:57:17 -07:00
Eric Anholt
7592f00560 i965/fs: Drop the viewport index/rtai clearing in gen6 fb writes.
These fields are documented to be in the payload, and though the FB
write docs say they *aren't* in the payload, for all other fields the
payload and header is structured so that no overwriting is required
except for non-default options.
2011-05-18 13:57:17 -07:00
Eric Anholt
136eb2bde7 i965/fs: Add support for "if" statements in 16-wide mode on gen6+.
It turns out there's nothing in the hardware preventing this.  It
appears that it ought to work on pre-gen6 as well, but just produces
GPU hangs.

Improves glbenchmark Egypt framerate 4.4% +/- 0.3% (n=3), and Pro by
2.6% +/- 0.6% (n=3).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-18 13:57:17 -07:00
Eric Anholt
27b0392661 i965/fs: Fix discard and alpha test in 16-wide.
As of gen6, alt-mode (which we use) MOVs of floats are not raw --
they'll modify infs/nans.  This broke discard and alpha test in
16-wide, where apparently the upper 8 bits of the pixel enables being
set were causing the whole value to get trashed upon being moved.
Treating the values as UD instead of float makes sure they get
preserved.  While I'm here, replace the two 8-wide moves of the halves
of the header with a single compressed move.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=36648
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-18 13:57:17 -07:00
Eric Anholt
367020d87c i965/gen6: Fix blending state when no color buffer is bound.
This is part of fixing fbo-alphatest-nocolor -- a regression in
35e8fe5c99 after the initial regression,
that had us using a garbage BLEND_STATE[0] (in particular, the alpha
test enable) if no color buffer was bound.
2011-05-18 13:57:16 -07:00
Eric Anholt
51761a1aef i965/fs: Cut an instruction and a temporary from gen6 discard statements.
I thought I was thwarted initially when I couldn't do conditional mod
on a MOV, and couldn't use two immediate constants in one instruction.
But g0 != g0 is also a way to produce a failing comparison.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-18 13:57:16 -07:00
Eric Anholt
5dd5be69f0 i965/fs: Fix compiler warnings about dead code from 9634318290 2011-05-18 13:57:16 -07:00
José Fonseca
61c67eca7d gallivm: Tell LLVM to not assume a 16-byte aligned stack on x86.
Fixes fdo 36738.
2011-05-18 18:14:37 +01:00
Andreas Faenger
8a98aabe0b swrast: anisotropic filtering extension
Anisotropic filtering extension for swrast intended to be used by osmesa
to create high quality renderings.
Based on Higher Quality Elliptical Weighted Avarage Filter (EWA).
A 2nd implementation using footprint assembly is also provided.

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-05-18 08:14:33 -06:00
Brian Paul
707eadcb7f mesa: simplify error check in _mesa_MapBufferRange() 2011-05-18 08:14:32 -06:00
Brian Paul
496bf04905 mesa: only update array _MaxElement if array is enabled
Fixes failed assertion when calling _mesa_print_arrays() debug function.
2011-05-18 08:14:32 -06:00
Brian Paul
de1df26b5c mesa: check that flex/bison are installed
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=36651

NOTE: This is a candidate for the 7.10 branch.
2011-05-18 07:51:33 -06:00
Kenneth Graunke
3e0bb02358 i965: Rename IS_GT1 and IS_GT2 to IS_SNB_GT1 and IS_SNB_GT2.
This should help distinguish Sandybridge GT1/GT2 from Ivybridge GT1/GT2.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-18 01:31:29 -07:00
Tapani Pälli
2758e65f28 add $SELINUX_LIBS to EGL and OpenVG lib deps
Correctly links against selinux library when MESA is built with --enable-selinux option.

Fixes bug #36333 in Freedesktop bugzilla

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-18 17:58:53 +10:00
Dave Airlie
bb31ecf4fb mesa/st: split updating vertex and fragment shader stages.
this seems like a logical thing to do and sets the correct st flags
for vertex textures.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-18 17:31:51 +10:00
Dave Airlie
6bd8647b54 st/mesa: only memset sampler when about to use it.
This function was taking a lot more CPU than required due to it memsetting
a bunch of memory that didn't require it from what I can see.

We should only memset here when we are about to fill out the sampler,
otherwise we end up doing a bunch of memsets for everytime this function
is called, basically setting 0 memory to 0.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-18 17:31:51 +10:00
Dave Airlie
ecc051d65b r600g: bump domain selection up one layer.
this is taken from a patch from Mathias Froehlich, just going to
stage it in a few pieces.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-18 17:31:51 +10:00
Eric Anholt
4e98318fc1 i965: Instead of fallback on missing region, just bind a null renderbuffer.
The change for GPU hanging in 13bab58f04
fell back even when rb == NULL, which is wrong for GLES2 and caused
segfaulting in GLES2 conformance.  For the GPU hang case (where the
broken 2D driver failed to allocate a BO for the window system
renderbuffer), it also would assertion fail/segfault immediately after
the fallback setup when the renderbuffer map failed.

Fixes GLES2 conformance packed_depth_stencil.

Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-17 23:48:17 -07:00
Kenneth Graunke
461e193971 i965: Updated fixed-point sizes in Ivybridge SAMPLER_STATE.
Texture LOD Bias is now S4.8 instead of S4.6;
Min LOD, and Max LOD are now U4.8 instead of U4.6.

Fixes piglit test tex-miplevel-selection.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-17 23:48:16 -07:00
Kenneth Graunke
ead7d73a51 i965: Ivybridge uses the Gen4 SAMPLER_BORDER_COLOR_STATE.
Volume 5c 1.13.7 lists it as [PreDevILK] and [DevIVB+].

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-17 23:47:52 -07:00
Kenneth Graunke
b2c1f8ff1d egl: Recognize Ivybridge PCI IDs.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:02 -07:00
Kenneth Graunke
1b3d354743 intel: Recognize new Ivybridge PCI IDs.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:02 -07:00
Kenneth Graunke
7f5e0d2a90 i965: Disable register spilling on Ivybridge for now.
The data port messages for this are rather different.  For now, fail to
compile rather than hanging the GPU.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:02 -07:00
Kenneth Graunke
344283de5d i965: Fix RNDZ and RNDE on Sandybridge and Ivybridge.
On gen4/5, the RNDZ and RNDE instructions return floor(x), but set special
"round increment bits" in the flag register; a predicated ADD (+1) fixes
the result.

The documentation still lists '.r' as existing, and says that the
predicated add is necessary, but it apparently lies.  According to the
simulator, BRW_CONDITIONAL_R (7) is not a valid conditional modifier
and the RNDZ and RNDE instructions simply produce the correct value.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:02 -07:00
Kenneth Graunke
199a2f90ab i965: Fix data port reads on Ivybridge.
These also need to use gen7_dp.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:02 -07:00
Kenneth Graunke
2a95568f64 i965: Avoid register coalescing away MATH workarounds on Ivybridge.
The MATH instruction cannot handle source modifiers, even on Gen7.
So, apply this workaround for Sandybridge on Ivybridge as well.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:02 -07:00
Kenneth Graunke
6e918163df i965: Make the CONT instruction point to the WHILE instruction.
This fixes piglit test glsl-fs-loop-continue.shader_test on Ivybridge.
According to the documentation, the CONT instruction's UIP field should
point to the WHILE instruction on both Sandybridge and Ivybridge.

The previous code made UIP point to the implicit DO instruction, which
seems incorrect.  I'm not sure how it could have worked on Sandybridge.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:02 -07:00
Kenneth Graunke
77397ef96e i965: Add support for loops on Ivybridge.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:02 -07:00
Kenneth Graunke
64ce592679 i965: Add support for IF/ELSE/ENDIF control flow on Ivybridge.
Ivybridge's IF instruction doesn't support conditional modifiers.
It also introduces UIP, which must point to the ENDIF instruction.

ELSE and ENDIF remain the same except that JIP moves from dst to src1.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:01 -07:00
Kenneth Graunke
ff6e3c73f6 i965: Add support for Ivybridge texturing messages.
Ivybridge puts the shadow comparator first, then lod/bias, and finally
the coordinate---unlike previous generations which always reserved four
slots for the coordinate at the beginning.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:01 -07:00
Kenneth Graunke
36f8de02e7 i965: Fix sampler message descriptor on Ivybridge.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:01 -07:00
Kenneth Graunke
3f44043da3 i965: Fix SAMPLER_STATE on Ivybridge.
Most of this code copied from brw_wm_sampler_state.c.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:01 -07:00
Kenneth Graunke
3984372104 i965: Mark some brw_wm_sampler_state.c helper functions as non-static.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:01 -07:00
Kenneth Graunke
b2b6cc6622 i965: Update SURFACE_STATE for Ivybridge.
I'm still not happy with the amount of code duplication here, but it
will have to do for now.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:01 -07:00
Kenneth Graunke
c12a93d5c4 i965: Mark a few more brw_wm_surface_state functions as non-static.
I need to reuse them.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:01 -07:00
Kenneth Graunke
70c6cd39bd i965: Change brw_format_for_mesa_format to a non-static function.
This will make it easier to share between files.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:01 -07:00
Kenneth Graunke
62b79b4bb9 i965: Set Address Modify Enable in VERTEX_BUFFER on Ivybridge.
Otherwise, Ivybridge seems to ignore the newly supplied data, giving us
rubbish for vertices.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:01 -07:00
Kenneth Graunke
09d881bf74 i965: Enable channel masks in Ivybridge's URB_WRITE_HWORD header.
This shouldn't be done using MRFs, but until I have a proper solution
for dealing with MRFs, this allows my hack to keep working.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:00 -07:00
Kenneth Graunke
97d4d6f77e i965: Fix the URB write message descriptor on Ivybridge.
The message header is still incorrect, but this is a start.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:00 -07:00
Kenneth Graunke
ce526a7452 i965: Fix render target writes on Ivybridge.
Ivybridge shifts the data port messages by one bit.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:00 -07:00
Kenneth Graunke
482e8a6cd5 i965: Mad hacks to avoid using MRFs on Ivybridge.
Ivybridge's SEND instruction uses GRFs instead of MRFs.  Unfortunately,
a lot of our code explicitly uses MRFs, and rewriting it would take a
fair bit of effort.  In the meantime, use a hack:

- Change brw_set_dest, brw_set_src0, and brw_set_src1 to implicitly
  convert any MRFs into the top 16 GRFs.
- Enable gen6_resolve_implied_move on Ivybridge: Moving g0 to m0
  actually moves it to g111 thanks to the previous hack.

It remains to officially reserve these registers so the allocator
doesn't try to reuse them.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:00 -07:00
Kenneth Graunke
550ad737f7 i965: Emit 3DPRIMITIVE Ivybridge-style.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:00 -07:00
Kenneth Graunke
fa4b23581b i965: Don't use the GS for breaking down quads on Ivybridge.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:00 -07:00
Kenneth Graunke
d58400eb4a i965: Emit extra 0's in 3DSTATE_MULTISAMPLE on Ivybridge.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:00 -07:00
Kenneth Graunke
8c8985bdd7 i965: Add depth buffer support on Ivybridge.
This also disables the HiZ and separate stencil buffers.  We still need
to implement stencil.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:00 -07:00
Kenneth Graunke
bc08d4ebb8 i965: Upload sampler state pointers on Ivybridge.
Since we currently only support sampling in the fragment shader, we only
bother to emit the PS variant.  In the future we'll need to emit others.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:00 -07:00
Kenneth Graunke
a94fe79464 i965: Disable binding table pointers for unused pipeline stages.
This may not be necessary, but it seems like a good idea.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:00 -07:00
Kenneth Graunke
706dbf85f1 i965: Upload binding table pointers on Ivybridge.
Ivybridge uses per-stage commands to update binding table pointers.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:59 -07:00
Kenneth Graunke
e0e2c04596 i965: Split BRW_NEW_BINDING_TABLE dirty bit into one per stage.
Ivybridge can update each stage's binding table pointer independently,
so we want separate dirty bits.  Previous generations can simply
subscribe to all three dirty bits and emit as usual.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:59 -07:00
Kenneth Graunke
bac10b58de i965: Explicitly disable unused pipeline stages on Ivybridge.
This may not be strictly necessary, but seems wise.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:59 -07:00
Kenneth Graunke
6b2010df7d i965: Initial Ivybridge VS state.
Copied from gen6_vs_state.c; reuses create_vs_constant_bo from there.

The 3DSTATE_VS command is identical but 3DSTATE_CONSTANT_VS is not.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:59 -07:00
Kenneth Graunke
18402fbf79 i965: Initial Ivybridge Viewport state setup.
SF and CLIP viewport state has been combined into SF_CLIP_VIEWPORT;
SF_CLIP and CC state pointers can now be uploaded independently.

Some portions of the hardware documentation refer to separate upload
commands for SF and CLIP; these are outdated and incorrect.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:59 -07:00
Kenneth Graunke
81fd03fe56 i965: Initial Ivybridge Clip state setup.
Copied from gen6_clip_state.c.

This enables early culling and sets the necessary fields.  Otherwise, it
is entirely the same, so I doubt this patch is strictly necessary for a
functional driver.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:59 -07:00
Kenneth Graunke
24d0ed72c1 i965: Initial Ivybridge CC state setup.
The state itself still seems to be the same; the only change is that
each part (CC, BLEND, DEPTH_STENCIL) can now be uploaded independently.
Thus, we still rely on the code in gen6_cc.c to set up the state.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:59 -07:00
Kenneth Graunke
a924d69b57 i965: Initial Ivybridge WM/PS state setup.
Copied from gen6_wm_state.c.

The main change from Sandybridge seems to be that 3DSTATE_WM was split
into two separate state packet commands: 3DSTATE_WM and 3DSTATE_PS.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:59 -07:00
Kenneth Graunke
7d608d0c33 i965: Initial Ivybridge SF/SBE state setup.
Copied from gen6_sf_state.c.

The main change from Sandybridge seems to be that 3DSTATE_SF was split
into two separate state packet commands: 3DSTATE_SF and 3DSTATE_SBE
("setup backend").  The bit-offsets are even the same - only the DWords
numbers have shuffled around a bit.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:59 -07:00
Kenneth Graunke
3dc4bc1f78 i965: Make gen6_sf_state.c's get_attr_override non-static.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:59 -07:00
Kenneth Graunke
8832920c29 i965: Initial Ivybridge URB space partitioning, including push constants.
Currently this always reserves 16kB for push constants, regardless of
how much space is needed, and partitions it evenly betwen the VS and FS.
This is probably not ideal, but is straightforward.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:58 -07:00
Kenneth Graunke
477e2fe031 i965: Set maximum number of threads for Ivybridge.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:58 -07:00
Kenneth Graunke
235fa21a09 i965: Split out tracked state atoms for Ivybridge.
Currently, gen7_atoms is a verbatim copy of gen6_atoms; future commits
will update it to contain gen7-specific state.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:58 -07:00
Kenneth Graunke
89a82d72ca intel: Initial IS_GEN7 plumbing.
Currently, IS_GEN7, IS_IVYBRIDGE, IS_IVB_GT1, and IS_IVB_GT2 all return
false.  This allows me to write the code for them before actually adding
the PCI IDs and thus enabling the hardware.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:58 -07:00
Kenneth Graunke
d55471768e i965: Rename max_vs_handles to max_vs_entries for consistency.
The documentation uses the term "vertex URB entries", the code talks
about "entry size", and so on.  Also, handles are just "pointers" to
entries (actually small integers).

Also rename max_gs_handles to max_gs_entries.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:58 -07:00
Kenneth Graunke
d0f0d06482 i965: Convert BRW_NEW_* dirty bits to use an enum.
This will make it much easier to add new dirty bits.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Chad Versace <chad.versace@intel.com>
2011-05-17 23:32:58 -07:00
Kenneth Graunke
c638180fc7 i965: Rework IF/ELSE jump target back-patching.
The primary motivation for this is to better support Ivybridge control
flow.  Ivybridge IF instructions need to point to the first instruction
of the ELSE block -and- the ENDIF instruction; the existing code only
supported back-patching one instruction ago.

A second goal is to simplify and centralize the back-patching, hopefully
clarifying the code somewhat.

Previously, brw_ELSE back-patched the IF instruction, and brw_ENDIF
back-patched the previous instruction (IF or ELSE).  With this patch,
brw_ENDIF is responsible for patching both the IF and (optional) ELSE.

To support this, the control flow stack (if_stack) maintains pointers to
both the IF and ELSE instructions.  Unfortunately, in single program
flow (SPF) mode, both were emitted as ADD instructions, and thus
indistinguishable.

To remedy this, this patch simply emits IF and ELSE, rather than ADDs;
brw_ENDIF will convert them to ADDs (the SPF version of back-patching).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:58 -07:00
Kenneth Graunke
5936d96d33 i965: Move IF stack handling into the EU abstraction layer/brw_compile.
This hides the IF stack and back-patching of IF/ELSE instructions from
each of the code generators, greatly simplifying the interface.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:58 -07:00
Kenneth Graunke
774fb90db3 i965: Get a ralloc context into brw_compile.
This would be so much easier if we were using C++; we could simply use
constructors and destructors.  Instead, we have to update all the
callers.

While we're at it, ralloc various brw_wm_compile fields rather than
explicitly calloc/free'ing them.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:58 -07:00
Kenneth Graunke
ebeea98573 i965/gs: Move generation check for bailing earlier.
On Sandybridge, we don't need to break down primitives.  There's no need
to bother setting up brw_compile and such if it's not going to be used;
bail as early as possible.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:57 -07:00
Kenneth Graunke
c6175d7870 i965: Add _NEW_LIGHT to Gen6 clip state dirty bits.
ctx->Light.ProvokingVertex depends on _NEW_LIGHT.

Found by inspection.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:30:46 -07:00
Brian Paul
3559440873 mesa: add some missing GLAPIENTRY keywords
NOTE: this is a candidate for the 7.10 branch.
2011-05-17 21:24:05 -06:00
Tom Stellard
217cd216ea r300/compiler: Fix bug in rc_get_variables()
Variables that write to the same source select need to pe paired
together otherwise the register allocator might fail.

https://bugs.freedesktop.org/show_bug.cgi?id=36753
2011-05-17 19:13:47 -07:00
Marek Olšák
390196ecc7 u_vbuf_mgr: fix max_index computation when src_offset is abused as buffer_offset 2011-05-17 01:21:30 +02:00
Marek Olšák
a3ac28a736 mesa: make RGB9_E5 non-renderable on swrast again
_BaseFormat for RGB9_E5 is GL_RGBA due to the previous revert.
2011-05-17 00:13:43 +02:00
Marek Olšák
947190ab4b Revert "mesa: set reasonable defaults in update_wrapper"
This reverts commit 1d5f16ff8f.

It breaks fbo-readpixels on swrast.
For some reason, swrast likes GL_RGBA and CHAN_TYPE.
2011-05-17 00:13:43 +02:00
Kenneth Graunke
1309d2ea72 i965: Pass brw_compile pointer to brw_set_src[01].
This makes it symmetric with brw_set_dest, which is convenient, and will
also allow for assertions to be made based off of intel->gen.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-16 13:30:16 -07:00
Kenneth Graunke
2b8e7215eb i965: Fix "Paramater" typo in gen6_wm_state.c.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-16 09:41:00 -07:00
Benjamin Franzke
b8033a5651 egl: Compile wayland-drm.a into libEGL independent of egl_dri2
Fixes egl_gallium when egl_dri2 is not enabled.
2011-05-16 10:36:36 +02:00
Dave Airlie
c9aa3bbda4 st/mesa: overhaul vertex/fragment sampler and sampler views.
This fixes piglits fragment-and-vertex-texturing test on llvmpipe for me.

I've no idea if someone had another plan for this that is smarter than what
I've done here, but what I've basically done is

split fragment and vertex sampler and sampler_view setup function, factor
out the common chunks of both.

side-cleanups:
drop st->state.sampler_list - unused
don't update border color if we have no border color.

should fix https://bugs.freedesktop.org/show_bug.cgi?id=35849

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-16 06:40:26 +10:00
Dave Airlie
bc16c73407 gallium: block signals for new thread when spawning threads
I'm hard pressed to think of any reason a gallium thread would want to
receive a signal, especially considering its probably loaded as a library
and you don't want the threads interfering with the main threads signal
handling.

This solves a problem loading llvmpipe into the X server for AIGLX,
where the X server relies on the SIGIO signal going to the main thread,
but once llvmpipe loads the SIGIO can end up in any of its threads.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-16 06:40:26 +10:00
Dave Airlie
bd5b7a6f71 r600g: reduce flushes so only when texture and CB overlap.
We only need to do this when the texture and CB are using the
same memory area.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-15 18:09:15 +10:00
Tom Stellard
6d539579ad r300/compiler: Use ALU Result for IF conditionals
This saves one instruction per IF.
2011-05-14 22:35:28 -07:00
Marek Olšák
8a4136f624 r300g: HiZ fixes
Nothing special, just changing conditions for when HiZ can be enabled and
when HiZ memory becomes invalid.

I was thinking about it again and realized it had not been quite right.
2011-05-15 03:28:32 +02:00
Marek Olšák
19f59dd413 r300g: don't set other HyperZ states if depth and stencil tests are disabled
Such as HiZ.
2011-05-15 03:28:32 +02:00
Marek Olšák
fdd37af3f7 r300g: dynamically ask for and release Hyper-Z access
We ask for Hyper-Z access when clearing a zbuffer.
We release it if no zbuffer clear has been done for 2 seconds.
2011-05-15 03:28:32 +02:00
Marek Olšák
904f43f190 r300g: fix conversion from int to boolean 2011-05-15 03:26:29 +02:00
Marek Olšák
51095f74cf u_vbuf_mgr: fix max_index computation once again
See how I compute and use the 'unused' variable in the code.
It's crucial for getting max_index right.

Fixed with the help of apitrace.
(bisecting the problematic draw call manually was not fun though)

This should fix:
https://bugs.freedesktop.org/show_bug.cgi?id=36268
https://bugs.freedesktop.org/show_bug.cgi?id=36609
2011-05-14 20:03:03 +02:00
Marek Olšák
ad2999d211 st/mesa: set correct baseInternalFormat for _mesa_texstore in DrawPixels
GL_RGBA was always used for baseInternalFormat regardless of the chosen
texture internal format.

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

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-14 01:53:30 +02:00
Kenneth Graunke
2bba244329 i965: Use BRW_DATAPORT_READ_TARGET_DATA_CACHE instead of 0.
Using the #define'd constant is better than 0 with a comment.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Chad Versace <chad.versace@intel.com>
2011-05-13 15:20:52 -07:00
Kenneth Graunke
c77855d64e i965: Rename dp_render_target struct to gen6_dp.
This is actually just the message descriptor for Gen6+ dataport access;
it has nothing to do with the render cache.  Access to the sampler cache
and constant cache also would use this struct; rename for clarity.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-13 15:20:45 -07:00
Kenneth Graunke
17eaff77b0 i965: Attempt to un-muddle Gen6 data port message target defines.
These are documented on page 245 of IHD_OS_Vol4_Part2.pdf (the public
Sandybridge documentation/SEND instruction description).

Somebody had the bright idea to reuse gen4/5 defines labelled READ/WRITE
which just happened to be the same values as Render Cache/Sampler Cache.
It turns out that this field has nothing to do with READ/WRITE on
Sandybridge, but rather represents which data port to direct it to.

This was especially confusing in brw_set_dp_read_message, which
used "BRW_MESSAGE_TARGET_DATAPORT_WRITE."  In a read function.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-13 15:19:31 -07:00
Christoph Bumiller
5f5d486717 nvc0: prevent overlap between load address and destination regs
For example, an indirect load like "ld b128 $r0q c0[$r0]" seems to
overwrite the address register before finishing the load, but only
if there are a lot of threads running.

Visible as displaced geoemtry in Unigine Heaven.
2011-05-13 18:47:54 +02:00
Marek Olšák
dd445ae120 docs: update relnotes-7.11 2011-05-13 18:10:30 +02:00
Marek Olšák
e28e3a774c st/mesa: expose ARB_shader_texture_lod if SM3 is supported
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-13 17:57:56 +02:00
Matt Turner
fae77579ad util_logbase2 takes and returns unsigned, not int
Signed-off-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-05-12 16:37:50 -06:00
Matt Turner
c5ac8a8aa2 Remove redundant util_unsigned_logbase2
util_logbase2 is exactly the same function.

Signed-off-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-05-12 16:37:34 -06:00
Matt Turner
48a0a096f8 u_math.h: Remove redundant mingw32 ffs definition
Signed-off-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-05-12 16:37:20 -06:00
Benjamin Franzke
184bb09ff5 st/egl: Implement EGL_WL_bind_wayland_display for x11,drm,wayland 2011-05-13 09:31:10 -04:00
Benjamin Franzke
83c68758be egl_dri2: Discard similar configs 2011-05-13 09:31:09 -04:00
Kristian Høgsberg
93aea63a33 egl_dri2: Make it possible to not compile in the X11 platform 2011-05-13 09:31:09 -04:00
Francesco Marella
64e3cd0c42 nvfx: fill some PIPE_CAPs
Signed-off-by: Francesco Marella <francesco.marella@gmail.com>
2011-05-13 14:56:40 +02:00
Kenneth Graunke
f247b2d633 i965: Fix incorrectly named data port define.
According to my documentation this is actually "Media Block Write" on
Gen4-5; there has never been a "DWord Block Write."

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-13 08:36:07 -07:00
Kenneth Graunke
ceaec24149 i965: Fix typo in Gen6 "DWord Scattered Write" message define.
It's DWORD, not DWORLD.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-13 08:35:13 -07:00
Vinson Lee
ac85ab066b i915g: Fix typos in print messages. 2011-05-12 23:21:58 -07:00
Dave Airlie
c7b1497f4e r600g: don't unmap if we haven't mapped
should fix https://bugs.freedesktop.org/show_bug.cgi?id=37157

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-13 14:03:47 +10:00
Marek Olšák
8a50637453 mesa: EXT_texture_sRGB_decode little fixup
It doesn't fix bug 37150 though.
2011-05-13 01:43:28 +02:00
Dave Airlie
1ca3efe548 r600g: use a local var to store pointer to which register we are working on
this just makes the code a little bit cleaner.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-13 09:26:17 +10:00
Dave Airlie
240049adfa r600g: make range/block act more like a page table
only allocate the blocks ptr in the range if we ever have one,
otherwise don't bother wasting the memory.

valgrind glxinfo
before:
==967==     in use at exit: 419,754 bytes in 706 blocks
==967==   total heap usage: 3,552 allocs, 2,846 frees, 3,550,131 bytes allocated

after:
==5227==     in use at exit: 419,754 bytes in 706 blocks
==5227==   total heap usage: 3,452 allocs, 2,746 frees, 3,140,531 bytes allocate

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-13 09:26:16 +10:00
Dave Airlie
d79a4a612b r600g: reduce r600_reg footprint
This drops 6k of the text segment, a minor drop in the ocean, however
it also makes the code a lot cleaner and removes a lot of duplicated
information, hopefully making it more maintainable.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-13 09:22:41 +10:00
Dave Airlie
d015d2f391 r600g: reduce memory usage from range/block hash table.
This table covered a large range unnecessarily, reduce the address
range covered, use the fact that the bottom two bits aren't significant,
and remove unused fields from the range struct. It also drops the hash_size/shift in context in favour of a define, which should make doing the math
a bit less CPU intensive.

valgrind glxinfo
Before:
==320==     in use at exit: 419,754 bytes in 706 blocks
==320==   total heap usage: 3,691 allocs, 2,985 frees, 7,272,467 bytes allocated

After:
==967==     in use at exit: 419,754 bytes in 706 blocks
==967==   total heap usage: 3,552 allocs, 2,846 frees, 3,550,131 bytes allocated

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-13 09:22:40 +10:00
Dave Airlie
5e15497452 r600g: delay mapping until first map request. (v2)
Currently r600g always maps every bo, this is quite pointless as it wastes
VM and on 32-bit with wine running VM space is quite useful.

So with this patch we don't create the mappings until first use, without
tiling enabled this probably won't make a major difference on its own,
but with tiled staged uploads it should avoid keeping maps for most of the
textures unnecessarily.

v2: add bo data ptr check

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-13 09:22:39 +10:00
José Fonseca
5de2c67ba7 egl/dri2: Avoid unused static functions. 2011-05-12 15:24:26 +01:00
José Fonseca
4a47d6d46b egl/dri2: Prevent uninitialized variable dereference. 2011-05-12 15:23:48 +01:00
José Fonseca
6c26072bd1 egl/dri2: Fix const pointer duplication, prevent unitialized variable dereference.
Based on zhigang gong <zhigang.gong@gmail.com>'s patch.
2011-05-12 15:23:02 +01:00
José Fonseca
6a661895e9 egl: Fix int <-> ptr casts.
Based on zhigang gong <zhigang.gong@gmail.com>'s patch.
2011-05-12 15:12:16 +01:00
zhigang gong
6699cd4e8d glu: Fix _GLUfuncptr typedef.
typedef void (GLAPIENTRYP _GLUfuncptr)(); causes the following warning:
function declaration isn't a prototype.

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2011-05-12 11:45:30 +01:00
José Fonseca
32a95cb70c 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 01:09:55 +01:00
Tom Stellard
95c93651b4 r300/compiler: Fix bug in rc_get_variables()
Variables that share readers were not always being linked together.

https://bugs.freedesktop.org/show_bug.cgi?id=36939
2011-05-11 16:16:29 -07:00
Tom Stellard
4612554dce r300/compiler: Limit instructions to 3 source selects
Some presubtract conversions were generating more than 3 source
selects.

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

Note: This is a candidate for the 7.10 branch.
2011-05-11 16:16:29 -07:00
Tom Stellard
d1e8195c07 r300/compiler: Add simple unit test framework
Plus three tests for rc_inst_can_use_presub()
2011-05-11 16:16:29 -07:00
Alex Deucher
b9f2750900 r600g: fix flushes on rs780/rs880
They need the same hack as rv670.

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

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-11 12:10:01 -04:00
José Fonseca
7a271151a5 mesa: Don't append fog code for programs that don't output color.
Fixes fdo 36919.

NOTE: This is a candidate for the stable branches.

It should be cherry-picked to the sames branches that
3aa21f93dc was.
2011-05-11 14:04:08 +01:00
José Fonseca
2812b60a84 svga/drm: Implement svga_winsys_screen::get_hw_version. 2011-05-10 16:36:35 +01:00
José Fonseca
a67ecfeebc st/wgl: Remove buggy assertion.
The assertion is wrong, now that state tracker can cope with a window with
zero width or height.
2011-05-10 16:13:05 +01:00
Maxim Levitsky
d6b248652a nv50: fix mistake in pipe caps for pre-NVA0 cards
Introduced by 531b12af35.
2011-05-10 10:16:54 +02:00
Kenneth Graunke
68074387a4 ir_to_mesa: Emit TXD instruction.
Mesa already supports this because of NV_fragment_program.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Marek Olšák <maraeo@gmail.com>
2011-05-09 11:23:54 -07:00
Kenneth Graunke
5a3a242a8f glsl: Add compiler support for ARB_shader_texture_lod.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Marek Olšák <maraeo@gmail.com>
2011-05-09 11:23:54 -07:00
Kenneth Graunke
1d4eb8d5d8 mesa: Add ARB_shader_texture_lod to the extension list; off by default.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-09 11:23:54 -07:00
Marcin Slusarz
4e1b1cbd0d nv50/nvc0: make transfers aware of PIPE_TRANSFER_MAP_DIRECTLY
If state tracker asked us to map resource directly and we can't
do it (because of tiling), return NULL instead of doing full transfer
- state tracker should handle it and fallback to some other method
or repeat transfer without PIPE_TRANSFER_MAP_DIRECTLY.

It greatly improves performance of xorg state tracker on nv50+,
because its fallback (DFS/UTS) is much faster than full transfer.
2011-05-09 20:19:19 +02:00
Matt Turner
86852236a3 r300/compiler: align memory allocations to 8-bytes
Eliminates unaligned accesses on strict architectures. Spotted by Jay
Estabrook.

Signed-off-by: Matt Turner <mattst88@gmail.com>

NOTE: This is a candidate for the 7.10 branch.
2011-05-09 20:01:58 +02:00
Marek Olšák
7297f2ac3c r300g: unreference a zbuffer surface after decompression 2011-05-09 20:01:58 +02:00
Marek Olšák
56b39fcd8b r300g: remove redundant state variable hyperz_locked 2011-05-09 20:01:58 +02:00
Marek Olšák
801fbdf286 mesa: document instructions ir_to_mesa emits
GLSL stopped using:
   BRA, EXP, LOG, LRP, NRM3, NRM4, XPD.

GLSL started using:
   KIL, SCS, SSG, SWZ.
(omg why SWZ? isn't proc_src_register flexible enough?)

GLSL doesn't use these opcodes some Radeons do support:
   ARR, DP2A, DST, LRP, XPD.

These opcodes are now unused:
   AND, NOT, NRM3, NRM4, OR, XOR.
(plus maybe the NV extensions which are unused by Gallium)

In addition to that, we don't use two-dimensional indirect addressing,
which the Mesa IR can do.
2011-05-09 20:01:58 +02:00
Michel Dänzer
39be542f73 r300c: Fix up for register allocator rewrite.
Was broken by commit fe622bac0c ('r300/compiler:
Rewrite register allocator').
2011-05-09 18:26:50 +02:00
Jerome Glisse
b9e8ea6a27 r600g: anisotropic filtering support for evergreen hw
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2011-05-09 12:18:41 -04:00
Carl-Philip Haensch
ad904cdf98 r600g: add support for anisotropic filtering 2011-05-09 12:09:16 -04:00
Michel Dänzer
9d792d013c gallium: Factor out unknown endianness detection. 2011-05-09 12:29:47 +02:00
Matt Turner
991c1f0249 Don't allow compilation if endianness isn't known
PIPE_ARCH_UNKNOWN_ENDIAN is used no where else. All #else branches of
ifdef PIPE_ARCH_LITTLE assume big-endian. Not #error'ing out here
only serves to allow bad things to happen.

Signed-off-by: Matt Turner <mattst88@gmail.com>
2011-05-09 12:23:21 +02:00
Matt Turner
5e945863ca p_config.h: Rely on glibc endianness definitions when available
Suggested by Julien Cristau.

Signed-off-by: Matt Turner <mattst88@gmail.com>
2011-05-09 12:22:59 +02:00
Marcin Slusarz
bd3ce30ee7 st/xorg: add some debugging messages to xorg_exa.c 2011-05-09 12:22:50 +02:00
Marcin Slusarz
6e0263fdd4 st/xorg: remove DEBUG_PRINT macro and add exa_debug_printf
Localizes preprocessor usage to one place.
2011-05-09 12:22:45 +02:00
Marcin Slusarz
7c5eaf5a2d st/xorg: fix compilation of xorg_exa.c with DEBUG_PRINT set to 1 2011-05-09 12:22:24 +02:00
Nicolas Kaiser
7074801ed7 cell: fix unbalanced parenthesis
Signed-off-by: Nicolas Kaiser <nikai@nikai.net>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-05-08 07:41:26 -06:00
Matt Turner
de3d9fa956 mesa: add precision to M_PI constant
Value found in my math.h header.

Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-05-06 10:36:32 -06:00
Matt Turner
ebc0b2dca0 mesa: replace ONE_DIV_LN2 constant with M_LOG2E
1/ln(2) is equivalent to log2(e), so define it as such.

log2(e) = ln(e)/ln(2) = 1/ln(2)

Worst of all, the definitions for M_LOG2E and ONE_DIV_LN2
(right beside each other!) weren't the same.

Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-05-06 10:33:15 -06:00
Marek Olšák
03615c02d8 r300/compiler: implement TXD and TXL opcodes 2011-05-07 02:51:38 +02:00
Marek Olšák
d8e222d887 r300g: handle seamless_cube_map caps 2011-05-07 02:51:38 +02:00
Benjamin Franzke
6bb230970c egl/wayland: Follow wl_resource_destroy changes 2011-05-06 16:50:45 -04:00
Christoph Bumiller
531b12af35 nv50,nvc0: activate seamless cube map filtering 2011-05-06 21:11:03 +02:00
Marek Olšák
27d3e0b25c docs: update relnotes-7.11 2011-05-06 20:14:28 +02:00
Marek Olšák
483d2ea5e3 docs: update GL3 status 2011-05-06 20:14:28 +02:00
Marek Olšák
d931b0d8b3 r600g: implement seamless_cube_map for evergreen
The r600/r700 support will follow soon.
2011-05-06 20:13:05 +02:00
Marek Olšák
a5f0a11477 gallium: implement seamless cubemap extensions
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-06 20:06:30 +02:00
Marek Olšák
bf65c9ea41 mesa: handle TEXTURE_CUBE_MAP_SEAMLESS in SamplerParameter
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-06 20:06:30 +02:00
Marek Olšák
a19c42ffc6 mesa: implement AMD_seamless_cubemap_per_texture 2011-05-06 20:06:30 +02:00
Alex Deucher
3b20a89941 r600g: avoid recursion in rv670 flush workaround
Should fix:
https://bugs.freedesktop.org/show_bug.cgi?id=36914

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-06 13:19:21 -04:00
Marcin Slusarz
3b2bc4ac5b gallium/xorg st/nv50: add PIPE_BIND_CURSOR
We need to distinguish surfaces for mouse cursors from scanouts,
because nv50 hardware display engine ignores tiling flags.
2011-05-06 19:09:23 +02:00
Kostas Georgiou
8c3226be90 Add pci id for FirePro 2270
Signed-off-by: Kostas Georgiou <georgiou@opengamma.com>
2011-05-06 13:03:40 -04:00
Alex Deucher
2c3232da7a egl_dri2: add new radeon pci ids
There seriously needs to be a better way to do
this.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-06 13:02:24 -04:00
Kristian Høgsberg
e5169e9615 egl: Add a cursor use bit to MESA_drm_image 2011-05-06 10:33:50 -04:00
Benjamin Franzke
834b84149d egl/wayland-drm: Generalize interface
Do not depend on _EGLDisplay and _EGLImage.
2011-05-06 10:33:50 -04:00
nobled
a3e2c8f31f glx: Check flush DRI extension version at runtime
The DRI driver itself might not have version 3 of the
DRI2 flush extension, in which case this would've
pointed to out of bounds memory...
2011-05-06 09:39:24 +02:00
Alex Deucher
31d27259b6 r600g: add back SOURCE_FORMAT setting that get accidently dropped
Spotted by Henri Verbeet

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-05 19:30:30 -04:00
Alex Deucher
5939bc03bc r600g: fix up the rules for enabling SOURCE_FORMAT(EXPORT_NORM)
Setting SOURCE_FORMAT to EXPORT_NORM is an optimization.
Leaving SOURCE_FORMAT at 0 will work in all cases, but is less
efficient.  The conditions for the setting the EXPORT_NORM
optimization are as follows:

R600/RV6xx:
BLEND_CLAMP is enabled
BLEND_FLOAT32 is disabled
11-bit or smaller UNORM/SNORM/SRGB

R7xx/evergreen:
11-bit or smaller UNORM/SNORM/SRGB
16-bit or smaller FLOAT

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-05 18:54:03 -04:00
Alex Deucher
bf7a3ddca6 r600g: further r6xx cache flush fixes
Don't emit sync packets for additional CBs or DB.
Spotted by Fredrik Höglund.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-05 18:45:55 -04:00
Dave Airlie
5066f7cd0e r600g: add rv670 flushing workaround.
Hopefully we can find out the proper fix for this, but for now
this makes the fbo mipmap tests pass on my rv670 (x2 card).

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-06 08:41:13 +10:00
Alex Deucher
d116fe51c1 r600g: fix cache flushes on r6xx
r6xx asics have some problems with the surface
sync logic for the CB and DB.  It's recommended
to use the event write interface for flushing
the DB/CB caches rather than the sync packets.
A single event write flush flushes all dst
caches, so we only need one for all CBs and DB.

Should fix:
https://bugs.freedesktop.org/show_bug.cgi?id=35312

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-06 08:07:12 +10:00
Marcin Slusarz
a041525ed9 mesa: don't call git if it's not git repository
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-05-05 13:49:21 -07:00
Marcin Slusarz
02a6c9428d mesa: don't touch git_sha1.h if sha1 didn't change
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-05-05 13:49:15 -07:00
Henri Verbeet
f60235e73a r600g: Match alpha ref precision to color format precision.
This fixes piglit fbo-alphatest-formats on Evergreen.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-05-05 21:00:38 +02:00
Dave Airlie
dc4a3edcf9 Revert "DRI2/GLX: make swap event handling match spec"
This reverts commit 70227e21bb.

revert this until we sort things out, with a new glproto release
with compatible struct names.
2011-05-05 16:25:33 +10:00
Dave Airlie
ae7abf080b r600g: do RV6xx base updates inline with state updates.
This seems more in line with what the documentation suggests we should be
doing. It doesn't fix the rv635 regression, though I thought it might,
so it means I've no idea whats actually going wrong there.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-05 09:07:49 +10:00
Jesse Barnes
70227e21bb DRI2/GLX: make swap event handling match spec
We only handle a 32 bit swap count, so use the new structure definitions.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2011-05-04 14:08:48 -07:00
Jesse Barnes
6ae9e8cbab GLX: don't crash when indirect clients try to set an event mask
After sending the GLXChangeDrawableAttributes request, we also set a
local set of attributes on the DRI drawable.  But in the indirect case
this array won't be present, so skip the setting in that case to avoid a
crash.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2011-05-04 14:08:48 -07:00
José Fonseca
37058c3497 scons: Add a few more human friendly messages. 2011-05-04 14:10:24 +01:00
José Fonseca
da87370032 mesa/gdi: Silence gcc warning about unused result. 2011-05-04 14:10:15 +01:00
José Fonseca
9fbd708932 st/wgl: Allow to create pbuffers bigger than the desktop.
We use a hidden window for pbuffer contexts, but Windows limits window
sizes to the desktop size by default. This means that creating a big
pbuffer on a small resolution single monitor would truncate the pbuffer
size to the desktop.

This change overrides the windows maximum size, allow to create windows
arbitrarily large.
2011-05-04 13:09:14 +01:00
José Fonseca
c636daa145 st/wgl: Cope with zero width/height windows.
While ensuring the framebuffer area is never zero.
2011-05-04 13:09:13 +01:00
Brian Paul
fc30910c65 i915g: add const qualifier to silence warning 2011-05-03 18:56:20 -06:00
Brian Paul
f85cd39fc4 mesa: remove unused restart.[ch] files
_mesa_PrimitiveRestartIndex() is in varray.c and glPrimitiveRestart()
is handled in the vbo module.
2011-05-03 18:22:04 -06:00
Ian Romanick
0f0179b8c2 glsl: Remove extra newline from error message 2011-05-03 14:51:02 -07:00
Alex Deucher
27477248d3 r600c: add some new pci ids
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-03 16:12:04 -04:00
Alex Deucher
c120d9d1cc r600g: add some new pci ids
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-03 15:26:07 -04:00
Marcin Slusarz
a8bbce8d6d st/xorg: flush after loading the cursor
We need cursor data to land in destination buffer before drmModeSetCursor.
It fixes "cursor lag" on nv50.
2011-05-03 16:36:54 +02:00
Michel Dänzer
5829332a9b gallium/draw: Fix enum type taken by draw_get_shader_param().
Pointed out by clang:

src/gallium/auxiliary/draw/draw_context.h:251:41: warning: implicit conversion
from enumeration type 'enum pipe_cap' to different enumeration type
'enum pipe_shader_cap' [-Wconversion]
      return tgsi_exec_get_shader_param(param);
             ~~~~~~~~~~~~~~~~~~~~~~~~~~ ^~~~~
2011-05-03 16:33:15 +02:00
Marek Olšák
5ba2e7adf0 mesa: implement AMD_shader_stencil_export
It's just an alias of the ARB variant with some GLSL compiler changes.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-03 12:03:22 +02:00
Marek Olšák
93754d8499 r600g: reorder caps 2011-05-03 12:03:22 +02:00
Marek Olšák
320adb93a1 r600g: set correct PIPE_CAP_MAX_COMBINED_SAMPLERS 2011-05-03 12:03:22 +02:00
Marek Olšák
a677952e68 mesa: make AMD_draw_buffers_blend an alias of the ARB variant
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-05-03 00:35:50 +02:00
Marek Olšák
3be1c7f260 glapi: regenerate files for AMD_draw_buffers_blend 2011-05-03 00:35:50 +02:00
Marek Olšák
9ecb46f59e glapi: add functions for AMD_draw_buffers_blend
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-05-03 00:35:50 +02:00
Marek Olšák
62aa51b78a mesa: flush vertices before changing GL_RASTERIZER_DISCARD state, not after
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-05-03 00:35:50 +02:00
Marek Olšák
aafbaa9e6a mesa: make _NEW_TEXTURE dirty when changing GL_TEXTURE_CUBE_MAP_SEAMLESS
Otherwise there would be no way to know whether the state has been changed.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-05-03 00:35:50 +02:00
Christoph Bumiller
220abb7adf nv50,nvc0: advertise GL_FIXED vertex buffers as supported
We'll handle them like f64 vertex buffers, by falling back to
copying vertex data to the command buffer through translate.
2011-05-03 00:02:36 +02:00
Christoph Bumiller
f986a6560f mesa,st/mesa: fix WPOS adjustment
Tested-by: Marek Olšák <maraeo@gmail.com>
2011-05-03 00:00:55 +02:00
Jon TURNEY
9cb800a97c Default to --disable-gallium-r300 if not --with-driver=dri
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Signed-off-by: Marek Olšák <maraeo@gmail.com>
2011-05-02 17:34:42 +02:00
Marek Olšák
02b352e2ac gallium: reorder fields of pipe_rasterizer_state to pack it more tightly
sizeof(struct pipe_rasterizer_state):
    Before: 32 bytes
    After: 28 bytes

Reviewed-by: Brian Paul <brianp@vmare.com>
2011-05-02 17:16:09 +02:00
Marek Olšák
ca6896ba14 r600g: document some new evergreen formats 2011-05-02 17:16:09 +02:00
Marek Olšák
929b3d8233 r600g: remove some more FIXME comments 2011-05-02 13:15:43 +02:00
Michel Dänzer
5815d06ac5 st/xorg: Fix two more instances of typo 'accle'. 2011-05-02 09:36:49 +02:00
Marcin Slusarz
951244c4cd st/xorg: fix typos 2011-05-02 09:28:16 +02:00
Eric Anholt
484b51d484 i965/gen6: Align interleaved URB writes for overflow outputs as well.
Fixes glsl-max-varyings.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=35614
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-01 20:13:10 -07:00
Marcin Slusarz
eb0a9e9a5a targets/xorg-nouveau: load nouveau_dri.so instead of i915_dri.so 2011-05-02 02:39:44 +02:00
Marcin Slusarz
1654988562 targets/xorg-nouveau: add libnvc0.a to nouveau libs 2011-05-02 02:39:44 +02:00
Marek Olšák
0d5ceb5891 r600g: remove some FIXME comments
All texture LOD tests pass.
2011-05-02 01:43:33 +02:00
Marek Olšák
72c6a748b9 Revert "r600g: truncate point sampled texture coordinates"
This reverts commit 1dc204d145.

MC_COORD_TRUNCATE is for MPEG and produces quite an interesting behavior
on regular textures. Anyway that commit broke filtering in demos/cubemap.
2011-05-02 01:20:22 +02:00
Marek Olšák
fb8786bda3 st/mesa: remove set-but-unused variables 2011-05-01 14:31:41 +02:00
Marek Olšák
08520bdea2 tgsi: remove set-but-unused variables 2011-05-01 14:13:09 +02:00
Marek Olšák
cacdc42e36 draw: remove set-but-unused variable 2011-05-01 14:12:47 +02:00
Marek Olšák
425cfa139b rbug: remove set-but-unused variables 2011-05-01 14:07:31 +02:00
Marek Olšák
847d397b34 ir_to_mesa: remove set-but-unused variables 2011-05-01 14:02:36 +02:00
Marek Olšák
2032daced1 mesa: remove set-but-unused variables in texcompress_s3tc 2011-05-01 14:02:35 +02:00
Marek Olšák
2d2b546189 mesa: remove set-but-unused variable in bind_attrib_location 2011-05-01 14:02:35 +02:00
Marek Olšák
f507530d25 mesa: remove unused-but-set variable in extract_uint_rgba 2011-05-01 14:02:35 +02:00
Marek Olšák
97398d1d56 r300/compiler: remove set-but-unused variables 2011-05-01 14:02:35 +02:00
Marek Olšák
56e83b4aa2 r600g: remove set-but-unused variable 2011-05-01 13:25:52 +02:00
Marek Olšák
e9d2ef79de r600g: remove FIXME comment
DONTBLOCK is correctly handled in r600_bo_map.
2011-05-01 01:54:29 +02:00
José Fonseca
dc9e5ed5e1 mesa: GL_PROVOKING_VERTEX_EXT is a GLenum, not GLboolean. 2011-04-30 22:38:00 +01:00
Tom Stellard
7679a4ddf4 r300/compiler: Cleanups from the regalloc merge 2011-04-30 13:15:29 -07:00
Tom Stellard
d7cf9833d7 r300/compiler: Add return statement to rc_list() 2011-04-30 12:57:09 -07:00
Tom Stellard
7edf7d1169 r300g: Fix scons build
Broken by the dependency on ralloc introduced by
fe622bac0c
2011-04-30 12:35:06 -07:00
Daniel Vetter
899b786b19 i915g: enable X-tiling for s3tc textures
Tested-by: Christopher Egert <cme3000@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-04-30 20:42:34 +02:00
Tom Stellard
d379e938f0 r300/compiler: Enable swizzle packing in the allocator for r300 and r400 2011-04-30 11:00:16 -07:00
Tom Stellard
1b75d48e84 r300/compiler: Handle loops in the register allocator 2011-04-30 11:00:16 -07:00
Tom Stellard
ac952a11df r300/compiler: Handle loops in rc_get_readers() 2011-04-30 11:00:16 -07:00
Tom Stellard
fe622bac0c r300/compiler: Rewrite register allocator
The new allocator uses ra and does swizzle packing.

Also, a data structure (struct rc_variable) and associated functions have
been added for generating UD and DU chains.
2011-04-30 11:00:15 -07:00
Tom Stellard
e4a765ae2d ra: Add ra_set_node_reg()
This function can be used to avoid creating single register classes for
input/payload registers.  This makes optimistic coloring less likely
to fail.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-04-30 11:00:15 -07:00
Tom Stellard
dbac75fa2f r300/compiler: Use RC_MASK_W when converting RGB to Alpha instructions 2011-04-30 11:00:15 -07:00
Tom Stellard
4f4d1d06da r300/compiler: rc_reader_data: Add ExitOnAbort flag 2011-04-30 11:00:15 -07:00
Tom Stellard
bbcee3268a r300/compiler: Add more info to struct rc_reader
For pair instructions we need a reference to both the arg
and source.
2011-04-30 11:00:15 -07:00
Tom Stellard
6a6068e5e1 r300/compiler: Add remove dead sources pass
The instruction scheduler will sometimes leave orphaned sources when
converting instructions from RGB to Alpha.  If one of these orphaned
sources has an index greater than the maximum temporary register index,
then the compiler will incorrectly report "Too many hardware temporaries
used".  The dead sources pass cleans up these orphaned sources.
2011-04-30 11:00:15 -07:00
Marek Olšák
bd661a933b docs: add ARB_ES2_compatibility in relnotes-7.11 2011-04-30 12:02:01 +02:00
Marek Olšák
fdff7e635b st/mesa: expose ARB_ES2_compatibility if GL_FIXED vertex format is supported
Tested with softpipe and llvmpipe.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-30 12:02:01 +02:00
Marek Olšák
0f1e59deac mesa: accept GL_FIXED in glVertexAttribPointer (ARB_ES2_compatibility)
GL_FIXED should not be accepted in the other gl*Pointer calls in OpenGL.

There is a new piglit for this: arb_es2_compatibility-fixed-type.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-30 12:02:01 +02:00
Brian Paul
076bd11112 mesa: fix error string, remove out of date comment 2011-04-29 18:42:09 -06:00
Brian Paul
be293c14c6 mesa: remove commented-out #include 2011-04-29 18:40:56 -06:00
Thierry Vignaud
04bdb2f314 mesa: fix tarball creation
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-04-29 17:56:35 -06:00
Eric Anholt
6a02679f01 i965/gen6: Fix LogicOp handling for GL_COPY and/or floating-point RTs.
We were accidentally leaving blending enabled for LogicOp GL_COPY,
which ARB_color_buffer_float/GL_RGBA32F-render (and friends) caught.
Additionally, the GL spec says that no LogicOp should be done to
floating-point targets, and the GPU gets really angry even if you say
to LogicOp GL_COPY to float.
2011-04-29 15:27:02 -07:00
Eric Anholt
3032582d03 i965: Remove dead entrypoints to state cache, rename the one that's left.
As we expanded the usage of the state cache, it grew extra
functionality.  However, with the recent state streaming rework, we're
back to the state cache being used only for shader kernels, which is
the piece of GPU state that's actually expensive to compute again from
scratch, since it involves compiling.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:27:02 -07:00
Eric Anholt
acb4d5cd96 i965/gen4: Move the GS state to state streaming.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:26:56 -07:00
Eric Anholt
8ba0c025a4 i965/gen4: Move clip state to state streaming
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:26:50 -07:00
Eric Anholt
d6ba7b1603 i965: Drop the now unused brw_cache_data() function.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:26:50 -07:00
Eric Anholt
bb7ff01deb i965: Fix up state dumping for SF state.
It was moved to state streaming a while back and this was left over.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:26:50 -07:00
Eric Anholt
588cebce2d i965/gen4: Move VS state to state streaming.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:26:43 -07:00
Eric Anholt
04e3f1d3c2 mesa: Add a bunch of documentation to the register allocator.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:26:34 -07:00
Eric Anholt
a82a43e8d9 i965/gen6: Use the dynamic state base address to reduce relocations.
Now that all the dynamic state is streamed through the top of the
batchbuffer, we can cut out many of our relocations to that state by
using the base address.

Improves 3DMMES taiji performance 3.3% +/- 0.4% (n=15).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:26:23 -07:00
Eric Anholt
855f56ca13 i965/gen6: Move scissor state to state streaming.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:26:18 -07:00
Eric Anholt
5c742ea1ee i965: Move sampler state to state streaming.
Overall, across this series since the last set of numbers, gen6 3DMMES
taiji performance has dropped 0.8% +/- 0.3% (n=15), probably due to
the increased reissuing of state from some of the state objects that
otherwise never changed, and increased occurrence of the per-batch
overhead as we've increased how much we put in the batch BO without
increasing the batch BO's size.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:26:14 -07:00
Eric Anholt
1a447749ed i965/gen4: Move WM state to state streaming.
The samplers are about to become streamed for gen6 performance, which
would cause this unit to blow out the state cache.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:26:04 -07:00
Eric Anholt
c108a3f863 i965/gen6: Move the depth/stencil state to state streaming.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:25:59 -07:00
Eric Anholt
35e8fe5c99 i965/gen6: Move the blend state to state streaming.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:25:54 -07:00
Eric Anholt
2ee1fd2e8f i965/gen6: Move the color calc state to state streaming.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:25:50 -07:00
Eric Anholt
d67c08319f i965: Move the CC VP to state streaming.
This is in a way a revert of f5bb775fd1.
The tiny win that had will be overwhelmed by the win of using the gen6
dynamic state base address.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:25:49 -07:00
Eric Anholt
8d2047ca7e i965/gen6: Move the SF VP to state streaming.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:25:45 -07:00
Eric Anholt
3628e123f1 i965/gen6: Move the clip VP to state streaming.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:25:41 -07:00
Eric Anholt
32cc0c9d8d i965/gen6: Stream the VS push constants.
Improves 3DMMES taiji demo performance by 10.1% +/- 0.9% (n=15).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:25:37 -07:00
Eric Anholt
90c70123b8 i965/gen6: Stream the WM push constants.
Improves 3DMMES taiji demo performance by 5.1% +/- 1.9% (n=15), by
reducing CPU time spent thrashing around those tiny little constant BOs.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:25:30 -07:00
Eric Anholt
530de3a2f5 i965: Give the push constants and pull constants unique function names.
This helps clarify profiling results.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:23:21 -07:00
Eric Anholt
03b2e0fcdf i965: Fix fragcoord_w on gen6 with 16-wide.
The payload regs can go all the way up to register 60+, so just give
them 8 bits to be addressed by instead of 3-4 (which made source_w_reg
of 8 end up 0).  There's no reason to aggressively pack these fields,
as they are just used as compiler information, where being easier to
access is probably more important than shaving a byte or two off of
the structure.

Fixes piglit fragcoord_w.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=36649
2011-04-29 12:25:21 -07:00
Eric Anholt
8c1637a4c2 meta: Don't ask for floating point textures if not ARB_texture_float.
I was promoting to float for ARB_color_buffer_float unclamped, which
failed when ARB_texture_float wasn't present.  Since the metaops don't
need results outside of [0,1] when not drawing to a floating point
destination, they can just use a fixed point texture when floating
point destinations are impossible.

Fixes regression in fdo23670-depth_test when --enable-texture-float is
not present.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=36473
2011-04-29 12:02:44 -07:00
Brian Paul
2be2e1d3ad mesa: fix a few incorrect error messages 2011-04-29 12:03:48 -06:00
Benjamin Franzke
dc520d4fef egl/wayland: Fix possible lockup in drm initialization
Lockup happens when wl_drm interface is not available.
2011-04-29 17:05:16 +02:00
Jon TURNEY
8a58eccc62 Add git_sha1.h to .gitignore
Since commit de579a1 "Include GIT SHA1 in GL version string"

$ git status
 On branch master
 Your branch is ahead of 'origin/master' by 2 commits.

 Untracked files:
   (use "git add <file>..." to include in what will be committed)

       src/mesa/main/git_sha1.h
nothing added to commit but untracked files present (use "git add" to track)

Add git_sha1.h to .gitignore so git knows not to warn it is present but untracked

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2011-04-29 12:56:53 +01:00
Marek Olšák
f8279fb9d8 r600g: print opcodes names instead of numbers 2011-04-29 13:16:40 +02:00
Marek Olšák
f974bdebee docs: update relnotes-7.11 2011-04-29 11:32:55 +02:00
Marek Olšák
aed76e5af3 docs: update GL3 status 2011-04-29 11:32:55 +02:00
Marek Olšák
aeac658e25 mesa: remove unused variable bytesPerRow 2011-04-29 11:32:55 +02:00
Marek Olšák
8b558451ad r600g: implement EXT_packed_float 2011-04-29 11:31:55 +02:00
Marek Olšák
e62530a6c0 st/mesa: support EXT_packed_float
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-29 11:31:55 +02:00
Marek Olšák
631d23daa9 mesa: implement EXT_packed_float
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-04-29 11:31:55 +02:00
Marek Olšák
b48359184e util: implement R11G11B10_FLOAT pack/unpack functions
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-29 11:31:55 +02:00
Marek Olšák
1271424615 mesa, util: move RGB9E5 conversion functions to gallium/util
Also use MAX3 and incorporate Ian's suggestion in texformat.c.

I don't think wrapping u_format_rgb9e5.h in another header and thus making it
more complicated is worth it.
2011-04-29 11:31:55 +02:00
Marek Olšák
de9f55437a r600g: trivially implement EXT_texture_shared_exponent
Nothing else needed.
2011-04-29 11:31:55 +02:00
Marek Olšák
349184be36 util: implement R9G9B9E5 pack and unpack functions
softpipe and llvmpipe support done (sampler only).

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-29 11:31:55 +02:00
Marek Olšák
1da44f5923 st/mesa: support EXT_texture_shared_exponent
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-29 11:31:55 +02:00
Marek Olšák
9d7698c468 mesa: implement EXT_texture_shared_exponent
swrast support done.

There is no renderbuffer support in swrast, because it's not required
by the extension.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-29 11:31:55 +02:00
Marek Olšák
1d5f16ff8f mesa: set reasonable defaults in update_wrapper
I was wondering why I had been getting GL_RGBA for GL_RGB9_E5.

Instead of setting GL_RGBA and CHAN_TYPE for most types,
use the helper functions to obtain the info.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-29 11:31:55 +02:00
Christopher Egert
608a4a17fe i915g: Enable S3TC texture support
Reviewed-by: Jakob Bornecrantz <wallbraker@gmail.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Christopher Egert <cme3000@gmail.com>
Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2011-04-29 02:15:07 +02:00
Kenneth Graunke
19efd1442c prog_print: Add support for printing the TXD opcode.
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-28 14:51:29 -07:00
Brian Paul
8cce283038 llvmpipe: move active_query assignment
Fixes piglit regression.
2011-04-28 12:41:49 -06:00
Brian Paul
284191560b llvmpipe: move active_query assignment in lp_setup_begin_query()
If we run out of bin memory and do an early return from
lp_setup_begin_query() we'd omit setting the setup->active_query
pointer.  Then, when lp_setup_end_query() was later called, the
assertion for setup->active_query == pq would fail.  Moving the
assigment in lp_setup_begin_query() avoids that.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2011-04-28 07:51:55 -06:00
José Fonseca
fa7a051c25 sgi: Fix MSVC build.
Including windows.h was ineffective on MSVC because we define the NOGDI macro,
which skips the wingdi.h include.

Unsetting NOGDI is also a bad idea because it causes all sort of symbol
clashes with SGI code.

The real problem is that WINGDAPI was not being defined, also due to NOGDI,
so simply define it to blank if not done already.  This seems to make
everybody happy.
2011-04-27 19:06:07 +01:00
Brian Paul
f9cc6acbfa st/mesa: raise shader MaxParameters if driver supports more
The default value is 64 but drivers usually advertise more, like 4096.
Allows ARB vp/fp programs to use more parameters.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2011-04-27 11:58:42 -06:00
Brian Paul
f3c92c2323 mesa: emit more info in program parser error message 2011-04-27 11:57:04 -06:00
Brian Paul
0be6ae74e9 svga: emit user-defined clip plane state
User-defined clip planes were a swtnl fallback before.
2011-04-27 11:51:30 -06:00
Eric Anholt
33afdf8356 docs: Note that ES2_compatibility is already done. 2011-04-27 09:48:38 -07:00
Eric Anholt
aa3e1c25d3 Revert "intel: use throttle ioctl for throttling"
This reverts commit 50ade6ea69.

Fixes jerky rendering again on apps that don't block on the GPU per
frame and are GPU bound (e.g. 3DMMES on Ironlake).  The whole point of
this complicated throttle scheme is to wait on frame n-1 to have
started rendering before starting frame n's rendering.  Otherwise, the
GPU-bound app will race ahead and call the GL to draw many
nearly-identical frames, then >0ms later get stuck waiting for them
(all dispatched at about the same time) to retire, then render a new
batch of nearly-identical frames.
2011-04-27 09:48:26 -07:00
Brian Paul
66d95919d5 st/mesa: choose 3-component float formats before 4-component formats
If GL_RGB16F or GL_RGB32F is specified let's try the 3-component float
texture formats before trying the 4-component ones.  Before this,
GL_RGB16/32F were treated the same as GL_RGBA16/32F.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
2011-04-27 09:06:31 -06:00
Brian Paul
48aa772589 st/mesa: whitespace fixes 2011-04-27 09:05:30 -06:00
Marek Olšák
b8de75d537 util: make macros MIN3, MAX3, MIN4, MAX4 little more efficient 2011-04-27 13:16:35 +02:00
Marek Olšák
069a9766a9 mesa: add macros MIN3 and MAX3 2011-04-27 13:16:35 +02:00
Marek Olšák
7e5953fca2 gallium/nouveau: fix printf warnings 2011-04-27 13:16:35 +02:00
Marek Olšák
31200d0688 gallivm: fix warning: ‘value’ may be used uninitialized in this function
The path where it's uninitialized is guarded by an assert.
2011-04-27 13:16:35 +02:00
Marek Olšák
e031bed122 st/mesa: fix warning: ‘user_memory’ may be used uninitialized in this function
It's initialized later in a conditional the condition of which is always true
the first time it's evaluated.
2011-04-27 13:16:35 +02:00
Marek Olšák
1e5dc6a778 svga: fix warning: ‘uc.ui’ may be used uninitialized in this function
This is safe because it's initialized if buffers & PIPE_CLEAR_COLOR and
probably doesn't have any effect otherwise.
2011-04-27 13:16:35 +02:00
nobled
39cd791f34 os: simplify ifdef
The actual code that needs this include is just using
"if defined (PIPE_OS_UNIX)", and the two conditions should match.

This should also make the file compile under Hurd.
2011-04-27 11:35:02 +01:00
Brian Paul
2d422a6c48 docs: fix typo, wrap lines in 7.11 release notes 2011-04-26 14:58:33 -06:00
Brian Paul
83eda35f16 docs: add GL_ARB_robustness to 7.11 release notes 2011-04-26 14:57:57 -06:00
Brian Paul
6b329b9274 Squashed commit of the following:
commit 864fe253b04105b7469e5f7b064dc37637b944f8
Author: Brian Paul <brianp@vmware.com>
Date:   Thu Apr 21 20:13:07 2011 -0600

    mesa: s/exec/disp/ in _mesa_init_histogram_dispatch()

    This function isn't normally compiled (FEATURE_histogram).

commit f4bf45e2b94b582cacd19cdca873c5be627e4250
Author: nobled <nobled@dreamwidth.org>
Date:   Thu Apr 21 07:53:58 2011 -0600

    mesa: hook up GL_ARB_robustness dispatch functions

    ...and advertise the extension.

    Signed-off-by: Brian Paul <brianp@vmware.com>

commit 2b89e38e5f572dc40cebc06381ae7c5d04386998
Author: nobled <nobled@dreamwidth.org>
Date:   Thu Apr 21 07:53:58 2011 -0600

    mesa: regenerated API files for GL_ARB_robustness

    Signed-off-by: Brian Paul <brianp@vmware.com>

commit 5d5ebfb7135cec9d833adef86cbf4d0f3d9beca8
Author: nobled <nobled@dreamwidth.org>
Date:   Thu Apr 21 07:53:57 2011 -0600

    glapi: add ARB_robustness xml

    Signed-off-by: Brian Paul <brianp@vmware.com>

commit 0159d1d6d99f4bbc18381dc2081c20d3aff17ac9
Author: nobled <nobled@dreamwidth.org>
Date:   Thu Apr 21 07:53:57 2011 -0600

    mesa: implement GL_ARB_robustness functions

    Signed-off-by: Brian Paul <brianp@vmware.com>

commit 938fd71f4c4742f274922d53492a7290ab8d9c9b
Author: nobled <nobled@dreamwidth.org>
Date:   Thu Apr 21 07:53:57 2011 -0600

    mesa: add context fields for GL_ARB_robustness

    Signed-off-by: Brian Paul <brianp@vmware.com>

commit 72075137bc79e65be03dac7e97b6dba93c3a86a4
Author: nobled <nobled@dreamwidth.org>
Date:   Thu Apr 21 07:53:57 2011 -0600

    mesa: standardize more bounds-checking error messages

    Signed-off-by: Brian Paul <brianp@vmware.com>

commit 32a3fc23746db49da903fbc08afa0135af3007d2
Author: nobled <nobled@dreamwidth.org>
Date:   Thu Apr 21 07:53:57 2011 -0600

    mesa: standardize some bounds-checking error messages

    Signed-off-by: Brian Paul <brianp@vmware.com>

commit cecbf1f4d164207de373dec0cadee2e84e1f9656
Author: nobled <nobled@dreamwidth.org>
Date:   Thu Apr 21 07:53:57 2011 -0600

    mesa: add more bounds-checking support for client memory buffers

    Signed-off-by: Brian Paul <brianp@vmware.com>

commit edc895b52383d5bd274422db56adead1d81daf5f
Author: nobled <nobled@dreamwidth.org>
Date:   Thu Apr 21 07:53:57 2011 -0600

    mesa: add bounds-checking support for client memory buffers

    Signed-off-by: Brian Paul <brianp@vmware.com>

commit 3a96ef28a538f158a219b406cd090dee70470c85
Author: nobled <nobled@dreamwidth.org>
Date:   Thu Apr 21 07:53:57 2011 -0600

    mesa: use is_bufferobj() helper function

    Signed-off-by: Brian Paul <brianp@vmware.com>
2011-04-26 14:54:41 -06:00
Eric Anholt
37642518b8 i965/fs: Add support for compute-to-mrf in 16-wide mode.
This is more painful than instruction scheduling, as we have to
compare two MRF writes to see if they coincide, and have to handle
partial GRF writes before that (for example, the result of a math
instruction written to color).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:20:22 -07:00
Eric Anholt
445289b509 i965/fs: Typo fix a comment.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:20:19 -07:00
Eric Anholt
0834607a89 i965/fs: Enable constant propagation in 16-wide.
All that needed fixing was skipping the newly-possible
uncompressed/sechalf partial GRF constant writes.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:20:16 -07:00
Eric Anholt
91d1a14158 i965/fs: Fix and enable the instruction scheduler for 16-wide.
Most of the work of the scheduler is agnostic to wide dispatch.  It
operates on our virtual GRF file, which means instructions are
generally referring to 8 or 16 wide naturally.  For the MRF file
management we're trying to track the actual hardware MRF file, so we
need to watch if an instruction writes multiple MRFs.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:20:12 -07:00
Eric Anholt
3b20f999bb i965/fs: Add support for 16-wide dispatch with uniforms in use.
This is glued in in a bit of an ugly way -- we rely on the uniforms
having been set up by 8-wide dispatch, and we just reuse them without
the ability to add new uniforms for any reason, since the 8-wide
compile is already completed.  Today, this all works out because our
optimization passes are effectively the same for both and even if they
weren't, we don't reduce the set of uniforms pushed after
optimization.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:20:05 -07:00
Eric Anholt
b061b5ffb0 hash_table: Add an iterator for doing things like cleanup of the HT.
Without this, consumers often have to keep linked lists of the
entries, at additional malloc cost.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:20:02 -07:00
Eric Anholt
b943b9b1a6 i965/fs: Add a little whitespace between shader dumping debug.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:19:59 -07:00
Eric Anholt
9c57780dc0 i965/fs: Add support for compr4 MRF writes.
These reduce an emitted (not decoded) instruction per shader on
g4x/gen5, but may allow for additional register coalescing as well.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:19:52 -07:00
Eric Anholt
42ad2f0b9b i965/fs: Add support for 16-wide dispatch on gen5.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:19:49 -07:00
Eric Anholt
662f1b48bd i965/fs: Add initial support for 16-wide dispatch on gen6.
At this point it doesn't do uniforms, which have to be laid out the
same between 8 and 16.  Other than that, it supports everything but
flow control, which was the thing that forced us to choose 8-wide for
general GLSL support.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:19:46 -07:00
Eric Anholt
76b7a0c1af i965/fs: Add support for discard instructions in 16-wide mode.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:19:43 -07:00
Eric Anholt
148a32e622 i965/fs: Add support for math instructions in 16-wide mode.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:19:40 -07:00
Eric Anholt
54990673a6 i965/fs: Fix interference calculation of pixel_[xy] in 16-wide.
Fixes glsl-fs-ceil in that mode, which produced the code in the comment.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:19:33 -07:00
Eric Anholt
af20328271 i965/fs: Disable some optimization passes under 16-wide for now.
These are fixable for 16, but that can wait until after it's basically
working.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:19:30 -07:00
Eric Anholt
8575d18362 i965/fs: Add support for 16-wide texturing on gen5+.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:19:27 -07:00
Eric Anholt
141b0bb277 i965/fs: Add support for computing pixel_[xy] in 16-wide.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:19:25 -07:00
Eric Anholt
2ac1cb8b83 i965/fs: Add support for 16-wide dispatch to the register allocator.
Note that the virtual grfs are in increments of the dispatch_width,
not hardware registers -- this makes the 16-wide emit and 8-wide emit
mostly the same.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:19:21 -07:00
Eric Anholt
7c647a2fe9 i965: Move the destination reg setup for 8/16 wide to the emit code.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:19:05 -07:00
Kristian Høgsberg
5dfba09d49 intel: Use tiling for dri2AllocateBuffer implementation 2011-04-26 13:26:34 -04:00
Kristian Høgsberg
7363088f9f intel: Set gen in intelInitScreen, just copy value in intelInitContext 2011-04-26 13:26:31 -04:00
Kristian Høgsberg
63325a0586 intel: Use X tiling for DRM EGL Images 2011-04-26 13:26:28 -04:00
Ian Romanick
cd354b4eb8 mesa: Remove SWcontext::_FogMode, use gl_context::gl_fog_attrib::Mode everywhere
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-25 18:27:17 -07:00
Kristian Høgsberg
f274dfaca4 egl: Use the right extension name in #ifdef 2011-04-25 15:34:04 -04:00
Kristian Høgsberg
b6ed837ffe wayland: Fix prototypes for EGL_WL_bind_wayland_display extension 2011-04-25 15:07:15 -04:00
Nicolas Kaiser
4dfbb81891 main: remove duplicated includes
Remove duplicated includes of guarded headers.

Signed-off-by: Nicolas Kaiser <nikai@nikai.net>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-04-25 11:03:01 -06:00
Benjamin Franzke
6a35ed1f66 winsys/wayland: Fix typo in Makefile
Reported by dir1212 on irc.
2011-04-25 18:17:07 +02:00
Benjamin Franzke
d72e7f0dd9 st/egl: Add wayland shm softpipe support 2011-04-25 10:45:57 -04:00
Benjamin Franzke
34fd282b27 st/egl: Generalize wayland backend a bit 2011-04-25 10:45:56 -04:00
Benjamin Franzke
aaa3c0d6de winsys: Add wayland shm sw winsys 2011-04-25 10:45:56 -04:00
Henri Verbeet
b2a98c3531 r600g: Unify comment style somewhat.
Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-04-25 14:06:22 +02:00
Henri Verbeet
d7577ae3a6 r600g: Cleanup the big endian support a bit.
In particular, make sure the code is at least compiled on little endian
systems.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-04-25 14:06:21 +02:00
Henri Verbeet
32001c2244 r600g: Use EG constants in EG r600_colorformat_endian_swap().
This would actually fail to compile when PIPE_ARCH_BIG_ENDIAN is defined.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-04-25 14:06:21 +02:00
Marek Olšák
0fecb928f5 configure.ac: require LLVM for r300g on x86 and x86_64 2011-04-25 13:45:05 +02:00
Marek Olšák
a86fc719d6 configure.ac: enable LLVM by default on x86 and x86_64 2011-04-25 13:45:05 +02:00
Marek Olšák
9e59ed59c1 mesa: add stricter checks for float formats in the texstore memcpy path
E.g. when the internal format was RGBA16F and the source was RG, it would use
memcpy.
2011-04-25 13:45:05 +02:00
Marek Olšák
628544421d mesa: implement generate-mipmap fallback for RGB10_A2
I hit this when testing RV350, which lacks RGB10_A2 render target
support. It had been missed when implementing the format and probably
unused by anything else too.

Not applicable to 7.10.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-04-25 13:45:05 +02:00
Vinson Lee
077b1a6144 r600g: Remove r600_helper.c from SConscript.
This is a follow-up to commit d737857ed2.
2011-04-24 23:58:39 -07:00
Marek Olšák
774c165d76 docs: update GL3 status 2011-04-25 01:54:12 +02:00
Marek Olšák
71667533d1 r600g: remove some pointless and unused functions 2011-04-25 01:20:40 +02:00
Marek Olšák
512c814849 r600g: do not reset device to 0 when doing unrelated operations
Seems to be a copy-paste bug.
2011-04-25 01:20:40 +02:00
Marek Olšák
def6a91a62 r600g: trivially implement LATC/3DC
Passes fbo-generatemipmap-formats.
2011-04-25 01:20:40 +02:00
Dave Airlie
d737857ed2 r600g: drop r600_helper.c no point in it
move the one function into state common

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-25 09:06:14 +10:00
Dave Airlie
de48199693 r600g: enable EXT_draw_buffers2
Doesn't cause any piglit regression and passes the fbo-draw-buffers-blend
test.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-25 06:55:09 +10:00
Dave Airlie
863eecd0d8 st/mesa: fix regression since a22aba4eae
"st/mesa: check image size before copy_image_data_to_texture()" caused
a regression in piglit fbo-generatemipmap-formats test on all gallium drivers.

Level 0 for NPOT textures will not match minified values, so don't do this
check for level 0.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-25 05:59:47 +10:00
Dave Airlie
0a9cec3475 r600g: fix glean clipflat test.
the provoking vertex doesn't apply to quad/strip/polygon.

This fixes clipFlat on r600g.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-24 20:35:06 +10:00
Marek Olšák
0b3122cfcb r300g: reorder caps 2011-04-24 12:00:00 +02:00
Marek Olšák
0c71da18ee r300g: fix exposing caps on r300-r400
Broken with 72239d16cd.
2011-04-24 12:00:00 +02:00
Bryan Cain
f18a086326 glsl: Fix typos in comments. 2011-04-23 21:33:47 -07:00
Dave Airlie
6372660d12 r600g: fix glsl-fs-abs-neg
the hw does neg after abs, so don't neg the source in the ABS instruction case.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-24 11:04:46 +10:00
Dave Airlie
77dc4c154c r600g: fix bank swizzle calcs for scalar only operations.
In the initial code if we had nothing in the vector slots r would
never get reset to 0, so we'd fail to compile shaders, after the previous
commit this would happen for the LIT tests. When I fixed that we did a lot
of unnecessary loops through all the vector states when we had no vector
slots filled. So this patch optimises thing for the scalar only state.

This fixes the 3 LIT piglit tests on r600g.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-24 08:33:19 +10:00
Dave Airlie
22d5a71e4d r600g: PV/PS have cycle restrictions in scalar operations
In the R600 ISA document:
Section 4.7.5 Cycle restrictions for the ALU.trans states that
PV/PS have cycle restrictions wrt constants.

This is part of a fix for the LIT tests

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-24 08:30:08 +10:00
Eric Anholt
e4da46e007 mesa: Add some comments about FRAG_RESULT_COLOR vs FRAG_RESULT_DATAn.
This came from reading what swrast does, and 965 now behaves the same
and gallium appears to as well.
2011-04-23 13:21:58 -07:00
Eric Anholt
d7f4c4e1b1 mesa: Fix fragment.color (no index) writes with OPTION ARB_draw_buffers.
Fixes a bug in Trine where fragment.color would write
FRAG_RESULT_COLOR (which is interpreted by drivers as being the "write
this to all color buffers" option) instead of FRAG_RESULT_DATA0 (just
the first target).

Fixes piglit ATI_draw_buffers/arbfp-no-index.
2011-04-23 13:21:57 -07:00
Eric Anholt
79bde19ef9 i965: Don't double-emit fragment.color writes for MRT with ARB_fp. 2011-04-23 13:21:57 -07:00
Eric Anholt
bad8da8b00 i965: Fill in the remaining fields of gen5+ sampler default color.
Still doesn't fix texwrap.
2011-04-23 13:21:57 -07:00
Eric Anholt
e1e6545c88 i965: Fix batch decode for the gen5+ sampler default color. 2011-04-23 13:21:57 -07:00
Eric Anholt
1f32c665c8 intel: Add support for ARB_sampler_objects.
This extension support consists of replacing
"gl_texture_obj->Sampler." with "_mesa_get_samplerobj(ctx, unit)->".
One instance of referencing the texture's base sampler remains in the
initial miptree allocation, where I'm not sure we have a clear
association with any texture unit.

Tested with piglit ARB_sampler_objects/sampler-objects.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-23 13:21:57 -07:00
Eric Anholt
1df72402d9 i965: Add support for NV_conditional_render.
Since we lack hardware support for it, this is a simple matter of
checking _mesa_check_conditional_render at the entrypoints, and
suppressing it for the metaops where it doesn't apply.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-23 13:21:57 -07:00
Eric Anholt
332822bd3d swrast: Disable glAccum drawing during conditional rendering. 2011-04-23 13:21:56 -07:00
Eric Anholt
fb60040b69 meta: Don't do conditional rendering on GenerateMipmaps and BlitFramebuffer.
The NV_conditional_render spec calls out specific operations that
conditional rendering applies to, which doesn't include these.

Fixes NV_conditional_render/generatemipmap on swrast.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-23 13:14:56 -07:00
Eric Anholt
4093fdce6d i965: Add support for ARB_texture_compression_rgtc.
Tested with rgtc-teximage-0[12].
EXT_texture_compression_rgtc/fbo-generatemipmap-formats fails in NPOT
just like S3TC does.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-23 13:14:56 -07:00
Eric Anholt
7d1a2056a8 mesa: Don't assert on the compressed convertformat for GenerateMipmaps.
This assertion doesn't make any sense to me -- the convertFormat is
already something valid (tested above), and the BaseFormat dictated by
convertFormat doesn't matter to the function about to be called (it's
the datatype/comps that were pulled out of convertFormat).

Fixes assertion failure in
GL_EXT_texture_compression_rgtc/fbo-generatemipmap-formats

(still has a rendering failure in NPOT like S3TC does).

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-23 13:14:56 -07:00
Eric Anholt
bc880b8d40 mesa: Choose RGTC formats for GL_COMPRESSED_RED, GL_COMPRESSED_RG.
We were falling through to the default R8 and RG88 formats instead of
compressing when possible.  Noticed by swrast fbo-blending-formats
actually doing rendering.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-23 13:14:56 -07:00
José Fonseca
da49de811d mesa/gdi: Address compiler warnings.
In particular the function prototypes.
2011-04-23 20:25:11 +01:00
José Fonseca
5bd545f5aa mesa/gdi: Remove InitCritSections.cpp.
We are now able to declare global critical sections through other
mechanisms so this is useless code.
2011-04-23 18:44:19 +01:00
José Fonseca
336487450e Drop fx windows driver.
Irrelevant now that glide driver was removed.
2011-04-23 18:32:56 +01:00
Jakob Bornecrantz
fed8a07ddb glu: Fix linux build 2011-04-23 17:01:19 +02:00
Jakob Bornecrantz
97efac09b2 glu: Clone the enviroment 2011-04-23 16:58:48 +02:00
José Fonseca
c2c44f2641 docs: Remove MSVS project files.
They were totally broken for several releases.

scons now builds everything the project files built and more, and can be
kept up-to-date with little effort.
2011-04-23 13:18:45 +01:00
José Fonseca
d34ddad9a5 scons: Build glu. 2011-04-23 13:16:03 +01:00
José Fonseca
15eaf8297e scons: Build classic mesa gdi driver.
Build as

  scons platform=windows mesagdi
2011-04-23 12:41:28 +01:00
José Fonseca
4c92f3fa6e osmesa: Fix Mingw build.
Build as

  scons platform=windows osmesa
2011-04-23 12:23:42 +01:00
José Fonseca
8e8a56eaa0 scons: Build osmesa.
Just type

  scons osmesa
2011-04-23 12:22:59 +01:00
José Fonseca
c89cca648d mapi/glapi: Avoid warnings about visibility being unsupported on MinGW. 2011-04-23 12:14:39 +01:00
José Fonseca
abda64efce mesa/vf: Remove.
Unused.  Probably replaced by translate module.
2011-04-23 11:49:41 +01:00
José Fonseca
de29ee0e6d graw: Replace dead symlinks to delete python statetracker shaders with their contents. 2011-04-23 11:07:27 +01:00
Brian Paul
931432fea6 draw: fix point/line/tri flushing bug in vbuf code
Need to reset the point/line/tri functions to point to the "first"
versions whenever we flush vertices.  Fixes unfilled polygon rendering
errors seen in demos/samples/logo.c.  See comments for more info.

NOTE: This is a candidate for the 7.10 branch.
2011-04-22 13:39:50 -06:00
Marek Olšák
72239d16cd r300g: do not advertise color_buffer_float on r300 and r400
It seems they can't do unclamped vertex colors. Tested on RV350.
2011-04-22 20:25:24 +02:00
Marek Olšák
9d07ff63fc r300/compiler: fix up error message 2011-04-22 20:25:24 +02:00
Benjamin Franzke
01b036adea egl/wayland: Follow buffer.attach removal 2011-04-22 12:21:46 -04:00
Benjamin Franzke
b1a9172277 egl/wayland: Update to buffer.damage addition 2011-04-22 12:21:37 -04:00
Marek Olšák
5b2ff543ab configure.ac: fix up the help text for --enable-gallium-r300 2011-04-22 16:56:31 +02:00
Marek Olšák
673cec467a r300g: disallow A16F,L16F,LA16F,I16F texture formats on DRM<2.8.0 2011-04-22 16:19:41 +02:00
Benjamin Franzke
400a99a679 st/egl: Update to wayland protocol,egl changes 2011-04-22 08:56:36 -04:00
Benjamin Franzke
f09c66b3cc egl_dri2: Create wl_buffers for pixmap surfaces
Needed since wayland-egl doesnt do this anymore.
2011-04-22 08:56:33 -04:00
Benjamin Franzke
1617b268ef egl/wayland: Add new version parameter for post_drm 2011-04-22 08:56:30 -04:00
Benjamin Franzke
2225397d1c egl/wayland: Fix prefixes for interface names 2011-04-22 08:56:27 -04:00
Marek Olšák
1faf079a69 swrast: fix readpix clamping
Broken with e5c6a92a12. (ARB_color_buffer_float)

Clamping should occur if type != float, otherwise the MSBs of the resulting
pixels are killed off. For example, reading back LUMINANCE = R+G+B can be
greater than 0xff, but the result is naturally masked by 0xff
for UNSIGNED_BYTE, leading to bogus results.

The following bug report seems to want clamping to occur if type == half_float
too. Not sure what's correct.

Bug: [bisected pineview] oglc case pxconv-read failed
https://bugs.freedesktop.org/show_bug.cgi?id=35852

Tested by: Fang Xun <xunx.fang@intel.com>
Reviewed-and-tested-by: Ian Romanick <ian.d.romanick@intel.com>
2011-04-22 06:35:36 +02:00
Kristian Høgsberg
7142a67473 WL_bind_wayland_display: clarify that context must be NULL 2011-04-21 23:47:59 -04:00
Ian Romanick
d439491a77 i915: Gut all remaining bits of hardware fog
None of this ever gets used.  Fog is always calculated by a fragment
program.  Even though the fixed-function fog unit is never used, state
updates are still sent to the hardware.  Removing those spurious state
updates can't hurt performance.

Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Corbin Simpson <MostAwesomeDude@gmail.com>
Acked-by: Alex Deucher <alexdeucher@gmail.com>
2011-04-21 17:33:41 -07:00
Ian Romanick
499f7c0114 i915: i915_context::vertex_fog is always I915_FOG_NONE, so kill it
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Corbin Simpson <MostAwesomeDude@gmail.com>
Acked-by: Alex Deucher <alexdeucher@gmail.com>
2011-04-21 17:33:38 -07:00
Ian Romanick
c41cb17037 i915: There's always a fragment program
Fragment programs are generated by core Mesa for fixed-function.
Because of this, there's no reason to handle cases where there is no
fragment program for fog.

Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Corbin Simpson <MostAwesomeDude@gmail.com>
Acked-by: Alex Deucher <alexdeucher@gmail.com>
2011-04-21 17:33:35 -07:00
Ian Romanick
8fc5ed18bc i915: Delete disabled try_pixel_fog paths
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Corbin Simpson <MostAwesomeDude@gmail.com>
Acked-by: Alex Deucher <alexdeucher@gmail.com>
2011-04-21 17:33:32 -07:00
Ian Romanick
4d203a01e2 mesa: Kill gl_fragment_program::FogOption with fire
All drivers expect this to always be GL_NONE.  Don't let there be any
opportunity for a bad value to leak out and infect some unsuspecting
driver.  If any driver for hardware that had fixed-function
per-fragment fog (i915 and perhaps some r300-ish) was ever going to
add support, it would have done it by now.

Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Corbin Simpson <MostAwesomeDude@gmail.com>
Acked-by: Alex Deucher <alexdeucher@gmail.com>
2011-04-21 17:33:29 -07:00
Ian Romanick
df7555e763 i915: gl_fragment_program::FogOption is always GL_NONE so don't check it
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Corbin Simpson <MostAwesomeDude@gmail.com>
Acked-by: Alex Deucher <alexdeucher@gmail.com>
2011-04-21 17:33:26 -07:00
Ian Romanick
8780c38983 i965: gl_fragment_program::FogOption is always GL_NONE so don't check it
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Corbin Simpson <MostAwesomeDude@gmail.com>
Acked-by: Alex Deucher <alexdeucher@gmail.com>
2011-04-21 17:33:24 -07:00
Ian Romanick
f0188d4b08 mesa: gl_fragment_program::FogOption is always GL_NONE so don't check it
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Corbin Simpson <MostAwesomeDude@gmail.com>
Acked-by: Alex Deucher <alexdeucher@gmail.com>
2011-04-21 17:33:21 -07:00
Ian Romanick
3aa21f93dc mesa: Fix bugs in ff fragment shader fog handling
This patch fixes two bugs related to fog in the fixed-function
fragment shader generation code.

Fog was only lowered to instructions if MRTs were used.  The fragment
shader assembler always lowers "fog option" code to instructions, and
many drivers (e.g., r300) expect this.

When fog lowering did happen, it was after the instruction count was
checked against implementation limits.  Since fog lowering may add up
to 5 instructions, a program that was below the limits before lowering
may exceed the limits after lowering.

NOTE: This is a candidate for the stable branches.

Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Corbin Simpson <MostAwesomeDude@gmail.com>
Acked-by: Alex Deucher <alexdeucher@gmail.com>
2011-04-21 17:33:18 -07:00
Brian Paul
a22aba4eae st/mesa: check image size before copy_image_data_to_texture()
We should only copy images into the dest texture if the size is correct.
This fixes a failed assertion when finalizing a texture with mis-defined
mipmap levels such as:
level 0: 32x32
level 1: 8x8

Also, fix incorrect mipmap level used in assertion at the top of
copy_image_data_to_texture().

NOTE: This is a candidate for the 7.10 branch.
2011-04-21 13:02:02 -06:00
Marek Olšák
4ad63659c0 galahad,util: warn on resource target mismatch in copy_region
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2011-04-21 15:51:18 +02:00
Marek Olšák
f9dafcb8f2 st/mesa: implement CopyBufferSubData using resource_copy_region
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2011-04-21 15:51:18 +02:00
Marek Olšák
883d8a0b44 gallium: add fallback for copying buffers to all drivers
Just to keep drivers working.

Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2011-04-21 15:51:18 +02:00
Marek Olšák
64f55216e4 util: add a simple memcpy path for copying buffers in util_resource_copy_region
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2011-04-21 15:51:18 +02:00
Kenneth Graunke
08ba9778db glsl/ast_to_hir: Only use the local 'type' variable as a temporary.
Lots of code (deleted by this patch) tried to make type == result->type,
but not all cases did.  Don't pretend; just use result->type.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-04-20 16:46:17 -07:00
Kenneth Graunke
dfaaf7c5e8 i965: Remove dead vertex buffer structs.
We do this OUT_BATCH-style in brw_draw_upload.c.
2011-04-20 16:43:52 -07:00
Kristian Høgsberg
c0f8c9911c wayland-egl: Update to wayland-egl.h changes, drop struct wl_egl_display 2011-04-20 17:47:20 -04:00
Brian Paul
42d377224a mesa: fix void pointer arithmetic warning 2011-04-20 12:04:25 -06:00
Eric Anholt
2ea0aa4cd9 docs: Mention that GLSL 1.30 is started.
Things definitely remaining todo: switch statements, clip distances.
On 965, we also need real integers in the VS, and implementations of
some things like isinf/isnan.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-20 10:35:43 -07:00
Eric Anholt
6e13cbcb74 docs: Update for Intel ARB_texture_float and ARB_color_buffer_float.
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-20 10:35:43 -07:00
Eric Anholt
d22e2ebe35 intel: Add support for ARB_color_buffer_float.
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-20 10:35:42 -07:00
Eric Anholt
99fa449bb9 meta: Add support for ARB_color_buffer_float to _mesa_meta_Clear().
Tested with piglit arb_color_buffer_float-clear.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-20 10:35:42 -07:00
Eric Anholt
b249197259 meta: Add support for ARB_color_buffer_float to _mesa_meta_DrawPixels.
Tested with piglit arb_color_buffer_float-drawpixels.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-20 10:35:42 -07:00
Eric Anholt
87478cd6e3 intel: Add support for ARB_texture_float.
For 1 and 2-channel formats the hardware only supports rendering to R
and RG.  To do I and L render targets we just call them R and
everything works out.  For A, we would need to rewrite the CC to do
the alpha channel's blending on color instead, and send the fragment
alpha down the red channel.  For LA, there doesn't seem to be any
hope, because we can't do independent color/alpha blending while
treating the LA surface as RG.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-20 10:35:42 -07:00
Eric Anholt
0bbbeba2db intel: Add support for blit copies of >32bpp formats.
The blitter only does up 32bpp at a time, so we handle it by mangling
coordinates and calling the surface 32bpp.

Fixes ARB_texture_rg/fbo-generatemipmap-formats-float with ARB_texture_float.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-20 10:35:42 -07:00
Eric Anholt
b31a99367c mesa: Add renderbuffer accessors for A, I, L, FLOAT32.
Of these, intel will be using I and L initially, and A once we rewrite
fragment shaders and the CC for rendering to it as R.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-20 10:35:42 -07:00
Eric Anholt
bad08969b5 mesa: Add renderbuffer accessors for MESA_FORMAT_R_FLOAT32, RG_FLOAT32.
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-20 10:35:42 -07:00
Eric Anholt
f7c26109c2 mesa: Add ChooseTexFormat fallbacks for floating point textures.
This covers X_FLOAT16 -> X_FLOAT32, and X -> RGBA_FLOAT32.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-20 10:35:41 -07:00
Eric Anholt
ba99c2fbd9 mesa: Add renderbuffer accessors for MESA_FORMAT_RGBA_FLOAT32.
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-20 10:35:41 -07:00
Eric Anholt
a45b757f78 swrast: Add LUMINANCE, INTENSITY, LUMINANCE_ALPHA to span asserts.
Fixes ARB_texture_float/fbo-alphatest-formats.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-20 10:35:41 -07:00
Alex Deucher
abee17057f r600g: fix userspace fences again
reinstate b7617346dc after the
rework in 6067a2a67f.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-04-20 13:09:09 -04:00
Fredrik Höglund
6067a2a67f r600g: don't flush the dest caches on every draw
Keep track of when the caches are dirty, and only flush them when
the framebuffer state is set and when the context is flushed.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-20 09:08:15 +10:00
Brian Paul
8b7f760f83 translate: disable clamping of instanced array indexes
This fixes piglit's draw-instanced-divisor test for softpipe on both
the generic and SSE paths.  This is temporary until we have the
correct per-array max_index information.
2011-04-19 16:13:47 -06:00
Alex Deucher
08d1c91e6c r600g: add evergreen+ big endian support
Based on Cédric's r6xx/r7xx patch.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-04-19 13:35:19 -04:00
Cédric Cano
843dfe3206 r600g: add big endian support for r6xx/r7xx
Signed-off-by: Cedric Cano <ccano@interfaceconcept.com>
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-04-19 13:02:14 -04:00
Alex Deucher
b545b2987a r600c: add evergreen big endian support
Based on Cedric's r6xx/r7xx patch.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-04-19 12:06:52 -04:00
Cédric Cano
3c3a259603 r600c: add big endian support for r6xx/r7xx
Signed-off-by: Cedric Cano <ccano@interfaceconcept.com>
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-04-19 12:06:52 -04:00
Brian Paul
7a6061d7a6 Makefile: add missing Scons files 2011-04-19 09:07:44 -06:00
Thierry Vignaud
494b333b03 Makefile: add missing .cpp, .ll, .yy files
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-04-19 08:34:06 -06:00
Dave Airlie
66866d642f r600g: add cb support for snorm formats.
Check for signed type and enable SNORM.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-19 20:44:13 +10:00
Marek Olšák
5722286be2 configure.ac: rename --enable-gallium-radeon to --enable-gallium-r300
Also fix up the help string for both r300 and r600.
2011-04-19 12:28:51 +02:00
Marek Olšák
ab13ebf7c1 r200: enable some extensions
Such as:
- GL_ARB_half_float_pixel
- GL_ARB_vertex_array_object
- GL_APPLE_vertex_array_object
- GL_EXT_gpu_program_parameters
2011-04-19 12:23:41 +02:00
Dave Airlie
c98fa6be4b r600g: fix warnings with piglit texture-rg test.
Fill in the swaps for the formats to fix warnings.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-19 18:45:58 +10:00
Dave Airlie
723e35d4a6 r600g: make loop const always flush
this needs revisiting, we really don't want to be flushing all 32 of these,
but currently we don't flush any of them, and it seems to have caused a regression
as reported on irc with doom3 on evergreen.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-19 16:39:50 +10:00
Tom Stellard
ffc1d166d2 r300/compiler: Fix dataflow analysis bug with ELSE blocks
Writes within ELSE blocks were being ignored which prevented us from
discovering all possible writers for some register values.

Fixes piglit glsl-fs-raytrace-bug27060
2011-04-18 21:27:03 -07:00
Bryan Cain
f41e1db327 glsl: fix conversions from uint to bool and from float/bool to uint
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2011-04-18 17:09:47 -07:00
Dave Airlie
f05adb83f5 r600g: add dirty tracking to context reg.
just makes the code more consistent.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-19 10:12:20 +10:00
Dave Airlie
5b5a16e320 r600g: deinline some large functions.
really at these sort of sizes these are pointless inlines.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-19 10:12:20 +10:00
Dave Airlie
a6e32da8bd r600g: consolidate r600/evergreen code for resource emission.
These really didn't have much difference, and totally not inline material.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-19 10:12:20 +10:00
Bas Nieuwenhuizen
02522b76a1 r600g: don't flush caches if we already did so, even for a subset of the flags
Merging the flushes that are left doesn't seem to give a significant
performance improvement

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-19 10:12:20 +10:00
Dave Airlie
e3b9cf15bb r600g: attempt to avoid emitting resources that are the same
This just avoids reemitting resources that haven't changed.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-19 10:12:20 +10:00
Dave Airlie
162bc40eed r600g: modify block to only emit the first few dirty registers. (v2)
This gets me from 2200 to 1978 dwords for a gears frame.

This is due to us having some 32-dwords blocks in the SPI, that we only
modify the first dwords off.

v2: fix dirty reg count from Bas Nieuwenhuizen

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-19 10:12:19 +10:00
Dave Airlie
c058067e57 r600g: track dirty registers better. (v2)
This is a first step to decreasing the CPU usage, by decreasing how much
stuff we pass to the GPU and hence to the kernel CS checker.

This adds a check to see if the values we need to write are actually dirty,
and avoids writing if they are. However certain register need to always
be written so we add a new flag to say which ones should be always written
if used. (Note this could probably be done cleaner with a larger refactoring,
 since I think the CONST_BUFFER_SIZE_PS/VS and CONST_CACHE_PS/VS might
be better off as a special state).

It also moves the need_bo to be a flags on the register now.

With this, a frame of gears goes from emitting 3k dwords to emitting 2k dwords,
and I'm sure it could get a lot smaller.

v2: fix some evergreen dirty bits.

Original patch from: Bas Nieuwenhuizen, I NIHed nearly the same thing
before seeing his patch on the list, oops.

Reviewed-by: Bas Nieuwenhuizen
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-19 10:12:19 +10:00
Ian Romanick
edf2e4f79d glsl: 80-column wrapping and whitespace fixes 2011-04-18 17:06:08 -07:00
Kenneth Graunke
ff5dd55e26 i965: Convert 3DPRIMITIVE command from struct-style to OUT_BATCH style.
Most of the newer portions of the code use OUT_BATCH style.  I prefer
this style because it offers a clear distinction between a) hardware
messages/structures with a mandatory format, and b) data structures for
our own internal use that we can format however we want.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-04-18 15:26:34 -07:00
Kenneth Graunke
42a8057000 i965: Allocate the whole URB to the VS and fix calculations for Gen6.
Since we never enable the GS on Sandybridge, there's no need to allocate
it any URB space.

Furthermore, the previous calculation was incorrect: it neglected to
multiply by nr_vs_entries, instead comparing whether twice the size of
a single VS URB entry was bigger than the entire URB space.  It also
neglected to take into account that vs_size is in units of 128 byte
blocks, while urb_size is in bytes.

Despite the above problems, the calculations resulted in an acceptable
programming of the URB in most cases, at least on GT2.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-04-18 15:26:34 -07:00
Ian Romanick
3d5cfcfed1 glsl: Emit a warning when the left-hand operand of a comma has no effect
The expression

    x = y, 5, 3;

will generate

    0:7(9): warning: left-hand operand of comma expression has no effect

The warning is only emitted for the left-hand operands, becuase the
right-most operand is the result of the expression.  This could be
used in an assignment, etc.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-18 14:43:48 -07:00
Brian Paul
7ca38f5d97 mesa: fix void pointer arithmetic warnings
And fix a couple logic errors in the put_*_generic() functions.
2011-04-18 13:01:05 -06:00
Brian Paul
9418d05914 mesa: fix wrong parameter type in set_sampler_max_lod() 2011-04-18 12:43:42 -06:00
Brian Paul
1249e54f8b nvfx: comment-out unused var 2011-04-18 12:34:29 -06:00
Eric Anholt
dad95c112f intel: Add I8 and L8 to intel_mesa_format_to_rb_datatype().
Fixes warnings in fbo-storage-formats.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-18 11:19:54 -07:00
Eric Anholt
bc57df0356 Revert "intel: Add spans code for the ARB_texture_rg support."
This reverts what remains of commit
28bab24e16.  It was garbage, trying to
use a MESA_FORMAT enum as a preprocessor token, and I don't know how I
thought it was even tested.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-18 11:19:54 -07:00
Eric Anholt
73f0700481 intel: Use mesa core's R8, RG88, R16, RG1616 RB accessors.
Fixes:
ARB_texture_rg/fbo-alphatest-formats

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-18 11:19:54 -07:00
Eric Anholt
2b624634dd swrast: Don't try to adjust_colors for <8bpc when handling R16, RG1616.
The GL_RED and GL_RG were tricking this code into executing, but it's
totally unprepared for a 16-bit channel and just rescaled the values
down to 0.  We don't have anything with <8bit channels alongside >8bit
channels, so disabling it should be safe.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-18 11:19:54 -07:00
Eric Anholt
f0471d904c mesa: Add renderbuffer accessors for R8/RG88/R16/RG1616.
This will replace the current (broken by trying to use an enum in the
preprocessor) spantmp2.h support I wrote for the intel driver.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-18 11:19:54 -07:00
Eric Anholt
a52803e108 mesa: Use _mesa_get_format_bytes to refactor out the RB get_row_*
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-18 11:19:54 -07:00
Eric Anholt
6ab9889a27 mesa: Use _mesa_get_format_bytes to refactor out the RB get_pointer_*
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-18 11:19:54 -07:00
Eric Anholt
0778fdb002 intel: Use Mesa core's renderbuffer accessors for depth.
Since we're using GTT mappings now (no manual detiling), there's
really nothing special to accessing these buffers, other than needing
the new RowStride field of gl_renderbuffer to accomodate padding.

Reduces the driver size by 2.7kb, and improves glean depthStencil
performance 3-10x (!)

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-18 11:19:54 -07:00
Eric Anholt
9f164823c7 mesa: Add a function to set up the default renderbuffer accessors.
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-18 11:19:53 -07:00
Eric Anholt
155200c154 mesa: Add a gl_renderbuffer.RowStride field like textures have.
This will allow some drivers to reuse the core renderbuffer.c get/put
row functions in place of using the spantmp.h macros.  Note that
unlike textures, we use a signed integer here to allow for handling
FBO orientation.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-18 11:19:53 -07:00
Eric Anholt
348ea34d03 mesa: Repack single-byte fields in gl_renderbuffer.
Cuts 8 out of 120 bytes in the struct.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-18 11:19:53 -07:00
Eric Anholt
91226ce648 mesa: Remove renderbuffer deletion debug field.
It has presumably served its purpose by now, and other object deletion
doesn't do this.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-18 11:19:53 -07:00
Eric Anholt
641dd899bd swrast: Don't assert against glReadPixels of GL_RED and GL_RG.
Everything appears to already be in place for this.  Fixes aborts in:
ARB_texture_rg/fbo-alphatest-formats-float
ARB_texture_rg/fbo-blending-formats-float.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-18 11:19:53 -07:00
Eric Anholt
cd3568c329 intel: Use _mesa_base_tex_format for FBO texture attachments.
The _mesa_base_fbo_format variant doesn't handle some texture
internalformats, such as "3".

Fixes:
fbo-blending-formats.
fbo-alphatest-formats
EXT_texture_sRGB/fbo-alphatest-formats

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-18 11:19:53 -07:00
Marek Olšák
699ecec58c r300g: remove non-existing include path from SConscript 2011-04-18 03:07:46 +02:00
Marek Olšák
d35aeff4bb r300g/winsys: rename r300->radeon and do a little cleanup
Renaming a few files, types, and functions.
Also make the winsys independent of r300g.
2011-04-18 02:52:32 +02:00
Thierry Vignaud
f79717d27a Fix mesa tarball creation again
Signed-off-by: Marek Olšák <maraeo@gmail.com>
2011-04-18 01:26:47 +02:00
Marek Olšák
fc8e30edbc r600g: disable ARB_draw_instanced
The very presence of this extension breaks things.
This should bring us closer to being able to run Unigine Heaven.

The extension will be re-enabled once gl_InstanceID is implemented.
2011-04-18 00:44:17 +02:00
Marek Olšák
3f32efa2b8 r300g: disable ARB_draw_instanced on SWTCL chipsets.
This fixes Unigine Heaven.
2011-04-18 00:44:17 +02:00
Eric Anholt
4673f9433f i965: Quit spamming gen6 DP read/write send instructions with gen5 bits.
This was copy-and-paste from originally trying to get DP read/write
working reliably, and notably for other common messages (URB, sampler)
we weren't doing this.
2011-04-17 10:26:09 -07:00
Eric Anholt
59c6b775a6 i965/fs: Add gen6 register spilling support.
Most of this is code movement to get the scratch space allocated in a
shared location.  Other than that, the only real changes are that the
old oword block messages now operate on oword-aligned areas (with new
messages for unaligned access, which we don't do), and that the
caching control is in the SFID part of the descriptor instead of
message control.

Fixes glsl-fs-convolution-1.
2011-04-17 10:26:09 -07:00
Eric Anholt
14eedf3028 mesa: Fix _mesa_unpack_dudv_span_byte assertion.
It was accepting only GL_DUDV_ATI and not the specific sized format
GL_DU8DV8_ATI.  Fixes assertion failure at startup in Shadowgrounds.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-17 10:26:09 -07:00
Carl Worth
9dacbe2226 glcpp: Fix attempts to expand recursive macros infinitely (bug #32835).
The 095-recursive-define test case was triggering infinite recursion
with the following test case:

	#define A(a, b) B(a, b)
	#define C A(0, C)
	C

Here's what was happening:

  1. "C" was pushed onto the active list to expand the C node

  2. While expanding the "0" argument, the active list would be
     emptied by the code at the end of _glcpp_parser_expand_token_list

  3. When expanding the "C" argument, the active list was now empty,
     so lather, rinse, repeat.

We fix this by adjusting the final popping at the end of
_glcpp_parser_expand_token_list to never pop more nodes then this
particular invocation had pushed itself. This is as simple as saving
the original state of the active list, and then interrupting the
popping when we reach this same state.

With this fix, all of the glcpp-test tests now pass.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=32835
Signed-off-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-and-tested-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-17 01:02:24 -07:00
Dave Airlie
93d42571a6 r600g: use some loops.
unrolling loops is for Gentoo users, and I really want to put something
else inside these loops later.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-17 17:19:28 +10:00
Dave Airlie
70de2705b4 r600g: consolidate the same piece of cut-n-paste code into a function.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-17 17:11:36 +10:00
Marcin Slusarz
b5dfc38eea gallium: include u_format.h for util_format_is_supported
Without it gcc complains:
nv50_screen.c: In function ‘nv50_screen_is_format_supported’:
nv50_screen.c:48: warning: implicit declaration of function ‘util_format_is_supported’

and handles it wrongly - util_format_is_supported returns boolean, which is typedef'ed
to uchar, but function without prototype is assumed to return int.

For me nv50_screen_is_format_supported was returning true for float formats without
--enable-texture-float...
2011-04-17 01:15:52 +02:00
Christoph Bumiller
25a7f66214 nvc0: work around what looks like a code prefetch bug
Sounds very unlikely, but I don't have a better explanation at the
moment.
The GPU throws page faults at the first page after the code buffer
quite frequently on startup, and traces don't show us overflowing.
2011-04-17 00:17:14 +02:00
Christoph Bumiller
f4ad25fefb nv50,nvc0: add new texture and render target formats 2011-04-17 00:17:14 +02:00
Christoph Bumiller
b4c7cd3fd6 nv50,nvc0: fix normalized RG16 and RGBA32 texture format entries 2011-04-17 00:17:14 +02:00
Christoph Bumiller
a582b859f7 nvc0: fix viewport rectangle calculation 2011-04-17 00:17:14 +02:00
Tom Stellard
97535699ee prog_optimize: Add simplify CMP optimization pass
This pass coverts CMP T0, T1 T2 T0 -> MOV T0, T2 when the CMP
instruction is the first instruction to write to register T0.
This pass is useful for hardware that requires a lot of lowering passes
that generate many CMP instructions.
2011-04-16 13:55:55 -07:00
Tom Stellard
257cc48de2 prog_optimize: get_src_arg_mask() respect writemask for more opcodes
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-04-16 13:55:54 -07:00
Tom Stellard
0fa81d6d05 r300/compiler: Fix incorrect presubtract conversion
ADD instructions with constant swizzles can't be converted to
presubtract operations.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-04-16 13:55:54 -07:00
Carl-Philip Haensch
d5a5893adc mesa: provide more info for glCompressedTexImage() errors
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-04-16 08:13:47 -06:00
Brian Paul
af0e2ef8cc mesa: move error check code in compressedteximage()
This was mistakenly inside the #if FEATURE_ES block.
2011-04-16 08:05:14 -06:00
José Fonseca
77db34b50d docs: Reapply some of Marek's typo fixes.
There were some typos too.
2011-04-16 11:15:29 +01:00
José Fonseca
bb78f6ad78 gallium/docs: Improve min_index/max_index description. 2011-04-16 10:18:20 +01:00
José Fonseca
4ee40c37a0 docs: Undo Marek typo fixes to original text.
Not really typos.
2011-04-16 09:41:00 +01:00
Brian Paul
41b38bd21c translate: s/varient/variant/ 2011-04-15 10:16:53 -06:00
Brian Paul
0630593c5f vbo: init prim[] array with memset()
This fixes a Coverity warning about uninitialized data.
2011-04-15 08:33:20 -06:00
Brian Paul
1b800c10e4 vega: move ureg_destroy(ureg) after last use of ureg var 2011-04-15 08:33:20 -06:00
Brian Paul
2c57caa893 st/mesa: simplify a bit of the previous patch
Grrr, this was supposed to go in the previous commit.
2011-04-15 08:33:20 -06:00
Pierre-Eric Pelloux-Prayer
6e9c7c4c11 st/mesa: add handling for 'PIPE_FORMAT_B8G8R8X8_UNORM' in st_fast_readpixels
With minor edits by Brian Paul.

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-04-15 08:30:10 -06:00
Marek Olšák
d2afae33f8 Revert "r300/compiler: Don't try to convert RGB to Alpha in full instructions"
This reverts commit cd2857fae1.

It breaks Unigine Heaven.
2011-04-15 05:08:00 +02:00
Marek Olšák
9305922563 docs: update relnotes-7.11
I made a glxinfo diff between 7.10 and master and added missing items
and also sorted the list.
2011-04-15 05:08:00 +02:00
Marek Olšák
397e478683 docs: update GL3 status 2011-04-15 05:08:00 +02:00
Marek Olšák
75fa5c99a8 gallium: add and use generic function for querying patented format support (v2)
v2: Unsigned floats are allowed regardless of the configure switch.
2011-04-15 05:08:00 +02:00
Marek Olšák
848f7d368d configure.ac: add an enable switch for float textures (v2)
So --enable-texture-float it is.

Hardware drivers (including the Gallium ones) should
use #ifdef TEXTURE_FLOAT_ENABLED to hide any code that may
expose floating-point renderbuffers via any interface,
public or private.

v2: Print a warning when using --enable-texture-float.
2011-04-15 05:08:00 +02:00
Marek Olšák
2d12dbb28d docs: add patents.txt
Thanks to José Fonseca for writing this.
2011-04-15 05:08:00 +02:00
Marek Olšák
faba01d171 r300g: enable A/L/LA/I float render targets 2011-04-15 05:08:00 +02:00
Marek Olšák
8e28d842d1 st/mesa: convert Mesa float formats to Gallium
Squashed commit of the following:

Author: Marek Olšák <maraeo@gmail.com>

    st/mesa: require RGBA16F and RGBA32F to be renderable
    st/mesa: fix L32F and L16F format translation
    st/mesa: also convert the R/RG float formats

commit 49a9948b6a81b7d813304d081139d98e95ba5d1a
Author: Luca Barbieri <luca@luca-barbieri.com>
Date:   Fri Aug 20 10:36:17 2010 +0200

    mesa/st: enable ARB_texture_float if supported formats allow it

commit 7383632f7b6f9021b65f4973b7e7c99f0e8ce9b2
Author: Luca Barbieri <luca@luca-barbieri.com>
Date:   Tue Aug 24 21:00:46 2010 +0200

    mesa/st: support ARB_texture_float internal formats

commit 7c362cc06982586c2d29fac55f6bcc4bcd1550b5
Author: Luca Barbieri <luca@luca-barbieri.com>
Date:   Tue Aug 24 21:00:33 2010 +0200

    mesa/st: convert L/A/I floating point formats
2011-04-15 05:08:00 +02:00
Luca Barbieri
33128310b0 gallium: add A/L/LA/I floating point formats 2011-04-15 05:08:00 +02:00
Marek Olšák
15f99d1362 mesa: finish up ARB_texture_float
Squashed commit of the following:

Author: Marek Olšák <maraeo@gmail.com>

    mesa: handle floating-point formats in _mesa_base_fbo_format
    mesa: add ARB/ATI_texture_float, remove MESAX_texture_float

commit 123bb110852739dffadcc81ad80b005b1c4f586d
Author: Luca Barbieri <luca@luca-barbieri.com>
Date:   Wed Aug 25 01:35:42 2010 +0200

    mesa: compute floatMode for FBOs and return it on RGBA_FLOAT_MODE
2011-04-15 05:08:00 +02:00
Marek Olšák
0ecbb0ab74 mesa: add R/RG floating-point formats 2011-04-15 05:08:00 +02:00
Marek Olšák
19648fcf01 mesa: fix L16F and L32F format properties 2011-04-15 05:08:00 +02:00
Carl Worth
3d78f83cde Add expected file for 095-recursive-define test case.
It's clear enough that the current segmentation fault isn't what we
want. And it's also very easy to know what we do want here, (just
check with any functional C preprocessor such as "gcc -E").

Add the desired output as an expected file so that the test suite
gives useful output, (showing the omitted output and the segfault),
rather than just reporting "No such file" for the expected file.
2011-04-14 16:20:49 -07:00
Carl Worth
02d293c08e glcpp: Simplify calling convention of parser's active_list functions
These were all written as generic list functions, (accepting and returning
a list to act upon). But they were only ever used with parser->active as
the list. By simply accepting the parser itself, these functions can update
parser->active and now return nothing at all. This makes the code a bit
more compact.

And hopefully the code is no less readable since the functions are also
now renamed to have "_parser_active" in the name for better correlation
with nearby tests of the parser->active field.
2011-04-14 15:35:41 -07:00
Carl Worth
0b80f2d4c9 glcpp: Add --valgrind option to the glcpp-test utility
The common case for this test suite is to quickly test that everything
returns the correct results. In this case, the second run of the test
suite under valgrind was just annoying, (and the user would often
interrupt it).

Now, do what is wanted in the common case by default (just run the
test suite), and require a run with "glcpp-test --valgrind" in order
to test with valgrind.
2011-04-14 14:55:52 -07:00
Carl Worth
6affa4806a Add an expected file for 084-unbalanced-parentheses
The expected file here captures the current behavior of glcpp (which
is to generate an obscure "syntax error, unexpected $end" diagnostic
for this case).

It would certainly be better for glcpp to generate a nicer diagnostic,
(such as "missing closing parenthesis in function-like macro
definition" or so), but the current behavior is at least correct, and
expected. So we can make the test suite more useful by marking the
current behavior as expected.
2011-04-14 14:43:11 -07:00
Carl Worth
d3c6ed382d Add an expected file for 094-divide-by-zero-short-circuit
The expected file here captures the current behavior of glcpp (which
is to generate a division-by-zero error) for this case.

It's easy to argue that it should be short-circuiting the evaluation
and not generating the diagnostic (which happens to be what gcc does).
But it doesn't seem like we should force this behavior on our
pre-processor, (and, as always, the GLSL specification of the
pre-processor is too vague on this point).
2011-04-14 14:42:52 -07:00
Carl Worth
ea3b2560b1 Add an expected file for 093-divide-by-zero
This test is behaving just fine already---it's generating an informative
diagnostic, ("error: division by 0 in preprocessor directive"), so adding
this in the expected file makes things pass.
2011-04-14 14:29:34 -07:00
José Fonseca
6881cfc7f7 mesa/st: Avoid spurious transfers when creating fbo textures without image data.
We could actually try to do an early return both for gallium textures and
malloc memory textures, but I'm not sure exactly which situations
stImage->pt is NULL, and whether texImage->Data == NULL would be acceptible
or not.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-14 19:51:45 +01:00
pepp
78e90bf247 st/mesa: add support for GL_RGBA + GL_UNSIGNED_INT_8_8_8_8 in st_fast_readpixels
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-04-14 07:55:02 -06:00
Eric Anholt
a9a02c8a39 mesa: Expose ATI_draw_buffers.
This is the same as ARB_draw_buffers (which derived from it), except
for s/ARB/ATI/.  The glapi bits were already in place, and what was
missing was just the ARB_fp part.  The new Humble Bundle game "trine"
tries to use this extension without checking that it's exposed, which
this works around.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=36182
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-04-13 18:07:32 -07:00
Eric Anholt
fb6e39737a mesa: Add support for OPTION ATI_draw_buffers to ARB_fp.
Tested by piglit ati_draw_buffers-arbfp.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-04-13 18:07:01 -07:00
Eric Anholt
28cec9e832 mesa: Add support for the ARB_fragment_program part of ARB_draw_buffers.
Fixes fbo-drawbuffers-arbfp.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34321
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-04-13 18:05:44 -07:00
Eric Anholt
4847f802c2 i965/fs: Constant-fold immediates in src0 of SEL instructions.
This is like what we do for add/mul, but we have to invert the
predicate to choose the other source instead.

This removes 5 extra moves of constants in nexuiz shaders.  No
statistically significant performance difference on my Sandybridge
laptop (n=5).

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-04-13 17:57:53 -07:00
Eric Anholt
811c147220 i965/fs: Constant-fold immediates in src0 of CMP instructions.
This is like what we do with add/mul, but we also have to flip the
conditional test.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-04-13 17:57:46 -07:00
Eric Anholt
756c262756 glsl: Perform type checking on "^^" operands.
We were letting any old operand through, which generally resulted in
assertion failures later.

Fixes array-logical-xor.vert.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-04-13 17:57:43 -07:00
Eric Anholt
175829f1a8 glsl: When we've emitted a semantic error for ==, return a bool constant.
This prevents later errors (including an assertion failure) from
cascading the failure.

Fixes invalid-equality-04.vert.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=33303
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@intel.com>
2011-04-13 15:48:26 -07:00
Eric Anholt
9e04b190b5 glsl: Semantically check the RHS of `||' even when short-circuiting.
We just do the AST-to-HIR processing, and only push the instructions
if needed in the constant false case.

Fixes glslparsertest/glsl2/logic-02.frag

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-04-13 15:48:26 -07:00
Eric Anholt
7ec0c97896 glsl: Semantically check the RHS of `&&' even when short-circuiting.
We just do the AST-to-HIR processing, and only push the instructions
if needed in the constant true case.

Fixes glslparsertest/glsl2/logic-01.frag

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-04-13 15:48:25 -07:00
Eric Anholt
01822706ec glsl: Avoid cascading errors when looking for a scalar boolean and failing.
By always using a boolean, we should generally avoid further
complaints.  The failure case I see is logic_not, where the user might
understandably make the mistake of using `!' on a boolean vector (like
a piglit case did recently!), and then get a further complaint that
the new boolean type doesn't match the bvec it gets assigned to.

Fixes invalid-logic-not-06.vert (assertion failure when the bad type
ends up in an expression and ir_constant_expression gets angry).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=33314
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-04-13 15:48:02 -07:00
989 changed files with 78414 additions and 97109 deletions

View File

@@ -183,7 +183,7 @@ ultrix-gcc:
# Rules for making release tarballs
VERSION=7.11-devel
VERSION=7.11
DIRECTORY = Mesa-$(VERSION)
LIB_NAME = MesaLib-$(VERSION)
GLUT_NAME = MesaGLUT-$(VERSION)
@@ -200,6 +200,9 @@ MAIN_FILES = \
$(DIRECTORY)/configure.ac \
$(DIRECTORY)/acinclude.m4 \
$(DIRECTORY)/aclocal.m4 \
$(DIRECTORY)/SConstruct \
$(DIRECTORY)/common.py \
$(DIRECTORY)/scons/*py \
$(DIRECTORY)/bin/config.guess \
$(DIRECTORY)/bin/config.sub \
$(DIRECTORY)/bin/extract_git_sha1 \
@@ -227,30 +230,37 @@ MAIN_FILES = \
$(DIRECTORY)/include/GL/vms_x_fix.h \
$(DIRECTORY)/include/GL/wglext.h \
$(DIRECTORY)/include/GL/wmesa.h \
$(DIRECTORY)/include/pci_ids/*.h \
$(DIRECTORY)/include/c99/*.h \
$(DIRECTORY)/src/getopt/SConscript \
$(DIRECTORY)/src/getopt/getopt*.[ch] \
$(DIRECTORY)/src/glsl/Makefile \
$(DIRECTORY)/src/glsl/Makefile.template \
$(DIRECTORY)/src/glsl/SConscript \
$(DIRECTORY)/src/glsl/*.[ch] \
$(DIRECTORY)/src/glsl/*.ll \
$(DIRECTORY)/src/glsl/*.yy \
$(DIRECTORY)/src/glsl/*.[cly]pp \
$(DIRECTORY)/src/glsl/README \
$(DIRECTORY)/src/glsl/glcpp/*.[chly] \
$(DIRECTORY)/src/glsl/glcpp/README \
$(DIRECTORY)/src/glsl/builtins \
$(DIRECTORY)/src/Makefile \
$(DIRECTORY)/src/SConscript \
$(DIRECTORY)/src/mesa/Makefile* \
$(DIRECTORY)/src/mesa/SConscript \
$(DIRECTORY)/src/mesa/sources.mak \
$(DIRECTORY)/src/mesa/descrip.mms \
$(DIRECTORY)/src/mesa/gl.pc.in \
$(DIRECTORY)/src/mesa/osmesa.pc.in \
$(DIRECTORY)/src/mesa/depend \
$(MAIN_ES_FILES) \
$(DIRECTORY)/src/mesa/main/*.[chS] \
$(DIRECTORY)/src/mesa/main/*.cpp \
$(DIRECTORY)/src/mesa/main/descrip.mms \
$(DIRECTORY)/src/mesa/math/*.[ch] \
$(DIRECTORY)/src/mesa/math/descrip.mms \
$(DIRECTORY)/src/mesa/program/*.[chly] \
$(DIRECTORY)/src/mesa/program/*.cpp \
$(DIRECTORY)/src/mesa/program/Makefile \
$(DIRECTORY)/src/mesa/program/descrip.mms \
$(DIRECTORY)/src/mesa/swrast/*.[ch] \
$(DIRECTORY)/src/mesa/swrast/descrip.mms \
@@ -309,7 +319,10 @@ MAPI_FILES = \
$(DIRECTORY)/src/mapi/mapi/mapi_abi.py \
$(DIRECTORY)/src/mapi/mapi/sources.mak \
$(DIRECTORY)/src/mapi/mapi/*.[ch] \
$(DIRECTORY)/src/mapi/shared-glapi/SConscript \
$(DIRECTORY)/src/mapi/shared-glapi/Makefile \
$(DIRECTORY)/src/mapi/vgapi/Makefile \
$(DIRECTORY)/src/mapi/vgapi/SConscript \
$(DIRECTORY)/src/mapi/vgapi/vgapi.csv \
$(DIRECTORY)/src/mapi/vgapi/vg.pc.in
@@ -322,9 +335,22 @@ EGL_FILES = \
$(DIRECTORY)/src/egl/*/*.[ch] \
$(DIRECTORY)/src/egl/*/*/Makefile \
$(DIRECTORY)/src/egl/*/*/*.[ch] \
$(DIRECTORY)/src/egl/wayland/wayland-drm/protocol/*.xml \
$(DIRECTORY)/src/egl/wayland/wayland-egl/*.pc.in \
$(DIRECTORY)/src/egl/main/SConscript \
$(DIRECTORY)/src/egl/main/*.pc.in \
$(DIRECTORY)/src/egl/main/*.def
GBM_FILES = \
$(DIRECTORY)/src/gbm/Makefile \
$(DIRECTORY)/src/gbm/main/*.pc.in \
$(DIRECTORY)/src/gbm/main/*.[ch] \
$(DIRECTORY)/src/gbm/main/Makefile \
$(DIRECTORY)/src/gbm/backends/Makefile \
$(DIRECTORY)/src/gbm/backends/Makefile.template \
$(DIRECTORY)/src/gbm/backends/*/*.[ch] \
$(DIRECTORY)/src/gbm/backends/*/Makefile \
GALLIUM_FILES = \
$(DIRECTORY)/src/mesa/state_tracker/*[ch] \
$(DIRECTORY)/src/gallium/Makefile \
@@ -346,14 +372,17 @@ GALLIUM_FILES = \
$(DIRECTORY)/src/gallium/*/*/*/*.[ch] \
$(DIRECTORY)/src/gallium/*/*/*/*.py
APPLE_DRI_FILES = \
$(DIRECTORY)/src/glx/apple/Makefile \
$(DIRECTORY)/src/glx/apple/*.[ch]
DRI_FILES = \
$(DIRECTORY)/include/GL/internal/dri_interface.h \
$(DIRECTORY)/include/GL/internal/sarea.h \
$(DIRECTORY)/src/glx/Makefile \
$(DIRECTORY)/src/glx/*.[ch] \
$(DIRECTORY)/src/mesa/drivers/dri/Makefile \
$(DIRECTORY)/src/mesa/drivers/dri/Makefile.template \
$(APPLE_DRI_FILES) \
$(DIRECTORY)/src/mesa/drivers/dri/Makefile* \
$(DIRECTORY)/src/mesa/drivers/dri/dri.pc.in \
$(DIRECTORY)/src/mesa/drivers/dri/common/xmlpool/*.po \
$(DIRECTORY)/src/mesa/drivers/dri/*/*.[chS] \
@@ -361,6 +390,7 @@ DRI_FILES = \
$(DIRECTORY)/src/mesa/drivers/dri/*/*/*.[chS] \
$(DIRECTORY)/src/mesa/drivers/dri/*/Makefile \
$(DIRECTORY)/src/mesa/drivers/dri/*/*/Makefile \
$(DIRECTORY)/src/mesa/drivers/dri/*/*/SConscript \
$(DIRECTORY)/src/mesa/drivers/dri/*/Doxyfile
SGI_GLU_FILES = \
@@ -390,14 +420,13 @@ GLW_FILES = \
$(DIRECTORY)/src/glw/*.[ch] \
$(DIRECTORY)/src/glw/Makefile* \
$(DIRECTORY)/src/glw/README \
$(DIRECTORY)/src/glw/glw.pc.in \
$(DIRECTORY)/src/glw/depend
$(DIRECTORY)/src/glw/glw.pc.in
GLUT_FILES = \
$(DIRECTORY)/include/GL/glut.h \
$(DIRECTORY)/include/GL/glutf90.h \
$(DIRECTORY)/src/glut/glx/Makefile* \
$(DIRECTORY)/src/glut/glx/depend \
$(DIRECTORY)/src/glut/glx/SConscript \
$(DIRECTORY)/src/glut/glx/glut.pc.in \
$(DIRECTORY)/src/glut/glx/*def \
$(DIRECTORY)/src/glut/glx/*.[ch] \
@@ -405,19 +434,13 @@ GLUT_FILES = \
$(DIRECTORY)/src/glut/beos/*.cpp \
$(DIRECTORY)/src/glut/beos/Makefile
DEPEND_FILES = \
$(TOP)/src/mesa/depend \
$(TOP)/src/glx/depend \
$(TOP)/src/glw/depend \
$(TOP)/src/glut/glx/depend \
$(TOP)/src/glu/sgi/depend
LIB_FILES = \
$(MAIN_FILES) \
$(MAPI_FILES) \
$(ES_FILES) \
$(EGL_FILES) \
$(GBM_FILES) \
$(GALLIUM_FILES) \
$(DRI_FILES) \
$(SGI_GLU_FILES) \
@@ -428,7 +451,7 @@ parsers: configure
-@touch $(TOP)/configs/current
$(MAKE) -C src/glsl glsl_parser.cpp glsl_parser.h glsl_lexer.cpp
$(MAKE) -C src/glsl/glcpp glcpp-lex.c glcpp-parse.c glcpp-parse.h
$(MAKE) -C src/mesa/program lex.yy.c program_parse.tab.c program_parse.tab.h
$(MAKE) -C src/mesa program/lex.yy.c program/program_parse.tab.c program/program_parse.tab.h
# Everything for new a Mesa release:
ARCHIVES = $(LIB_NAME).tar.gz \
@@ -448,27 +471,21 @@ AUTOCONF = autoconf
AC_FLAGS =
aclocal.m4: configure.ac acinclude.m4
$(ACLOCAL) $(ACLOCAL_FLAGS)
configure: rm_depend configure.ac aclocal.m4 acinclude.m4
configure: configure.ac aclocal.m4 acinclude.m4
$(AUTOCONF) $(AC_FLAGS)
rm_depend:
@for dep in $(DEPEND_FILES) ; do \
rm -f $$dep ; \
touch $$dep ; \
done
rm_config: parsers
rm -f configs/current
rm -f configs/autoconf
$(LIB_NAME).tar: rm_config
cd .. ; tar -cf $(DIRECTORY)/$(LIB_NAME).tar $(LIB_FILES)
cd .. ; tar --dereference -cf $(DIRECTORY)/$(LIB_NAME).tar $(LIB_FILES)
$(LIB_NAME).tar.gz: $(LIB_NAME).tar
gzip --stdout --best $(LIB_NAME).tar > $(LIB_NAME).tar.gz
$(GLUT_NAME).tar: rm_depend
cd .. ; tar -cf $(DIRECTORY)/$(GLUT_NAME).tar $(GLUT_FILES)
$(GLUT_NAME).tar:
cd .. ; tar --dereference -cf $(DIRECTORY)/$(GLUT_NAME).tar $(GLUT_FILES)
$(GLUT_NAME).tar.gz: $(GLUT_NAME).tar
gzip --stdout --best $(GLUT_NAME).tar > $(GLUT_NAME).tar.gz
@@ -499,4 +516,4 @@ md5: $(ARCHIVES)
@-md5sum $(GLUT_NAME).tar.bz2
@-md5sum $(GLUT_NAME).zip
.PHONY: tarballs rm_depend rm_config md5
.PHONY: tarballs rm_config md5

View File

@@ -40,6 +40,8 @@ env = Environment(
ENV = os.environ,
)
opts.Save('config.py', env)
# Backwards compatability with old target configuration variable
try:
targets = ARGUMENTS['targets']
@@ -80,44 +82,6 @@ env.Append(CPPPATH = [
if env['msvc']:
env.Append(CPPPATH = ['#include/c99'])
# Embedded
if env['platform'] == 'embedded':
env.Append(CPPDEFINES = [
'_POSIX_SOURCE',
('_POSIX_C_SOURCE', '199309L'),
'_SVID_SOURCE',
'_BSD_SOURCE',
'_GNU_SOURCE',
'PTHREADS',
])
env.Append(LIBS = [
'm',
'pthread',
'dl',
])
# Posix
if env['platform'] in ('posix', 'linux', 'freebsd', 'darwin'):
env.Append(CPPDEFINES = [
'_POSIX_SOURCE',
('_POSIX_C_SOURCE', '199309L'),
'_SVID_SOURCE',
'_BSD_SOURCE',
'_GNU_SOURCE',
'PTHREADS',
'HAVE_POSIX_MEMALIGN',
])
if env['gcc']:
env.Append(CFLAGS = ['-fvisibility=hidden'])
if env['platform'] == 'darwin':
env.Append(CPPDEFINES = ['_DARWIN_C_SOURCE'])
env.Append(LIBS = [
'm',
'pthread',
'dl',
])
# for debugging
#print env.Dump()
@@ -130,7 +94,7 @@ if env['platform'] in ('posix', 'linux', 'freebsd', 'darwin'):
#
# Create host environent
if env['crosscompile'] and env['platform'] != 'embedded':
if env['crosscompile'] and not env['embedded']:
host_env = Environment(
options = opts,
# no tool used
@@ -179,3 +143,18 @@ SConscript(
duplicate = 0 # http://www.scons.org/doc/0.97/HTML/scons-user/x2261.html
)
########################################################################
# List all aliases
try:
from SCons.Node.Alias import default_ans
except ImportError:
pass
else:
aliases = default_ans.keys()
aliases.sort()
env.Help('\n')
env.Help('Recognized targets:\n')
for alias in aliases:
env.Help(' %s\n' % alias)

View File

@@ -1,10 +1,20 @@
#!/bin/sh
touch src/mesa/main/git_sha1.h
if [ ! -f src/mesa/main/git_sha1.h ]; then
touch src/mesa/main/git_sha1.h
fi
if [ ! -d .git ]; then
exit
fi
if which git > /dev/null; then
# Extract the 7-digit "short" SHA1 for the current HEAD, convert
# it to a string, and wrap it in a #define. This is used in
# src/mesa/main/version.c to put the GIT SHA1 in the GL_VERSION string.
git log -n 1 --oneline |\
sed 's/^\([^ ]*\) .*/#define MESA_GIT_SHA1 "git-\1"/' \
> src/mesa/main/git_sha1.h
> src/mesa/main/git_sha1.h.tmp
if ! cmp -s src/mesa/main/git_sha1.h.tmp src/mesa/main/git_sha1.h; then
mv src/mesa/main/git_sha1.h.tmp src/mesa/main/git_sha1.h
fi
fi

View File

@@ -767,9 +767,8 @@ case $ARCH in
OPTS="${OPTS} -exported_symbols_list ${EXPORTS}"
fi
LINKNAME="lib${LIBNAME}.${MAJOR}.${LIBSUFFIX}"
LINKNAME2="lib${LIBNAME}.${LIBSUFFIX}"
LIBNAME="lib${LIBNAME}.${MAJOR}.${MINOR}.${LIBSUFFIX}"
LINKNAME="lib${LIBNAME}.${LIBSUFFIX}"
LIBNAME="lib${LIBNAME}.${MAJOR}.${LIBSUFFIX}"
# examine first object to determine ABI
set ${OBJECTS}
@@ -782,9 +781,6 @@ case $ARCH in
OPTS=${ALTOPTS}
fi
# XXX can we always add -isysroot /Developer/SDKs/MacOSX10.4u.sdk
# to OPTS here?
# determine linker
if [ $CPLUSPLUS = 1 ] ; then
LINK="g++"
@@ -796,8 +792,7 @@ case $ARCH in
${LINK} ${OPTS} ${LDFLAGS} -o ${LIBNAME} ${OBJECTS} ${DEPS}
ln -s ${LIBNAME} ${LINKNAME}
ln -s ${LIBNAME} ${LINKNAME2}
FINAL_LIBS="${LIBNAME} ${LINKNAME} ${LINKNAME2}"
FINAL_LIBS="${LIBNAME} ${LINKNAME}"
fi
;;

View File

@@ -79,14 +79,17 @@ def AddOptions(opts):
from SCons.Options.EnumOption import EnumOption
opts.Add(EnumOption('build', 'build type', 'debug',
allowed_values=('debug', 'checked', 'profile', 'release')))
opts.Add(BoolOption('quiet', 'quiet command lines', 'yes'))
opts.Add(BoolOption('verbose', 'verbose output', 'no'))
opts.Add(EnumOption('machine', 'use machine-specific assembly code', default_machine,
allowed_values=('generic', 'ppc', 'x86', 'x86_64')))
opts.Add(EnumOption('platform', 'target platform', host_platform,
allowed_values=('linux', 'cell', 'windows', 'winddk', 'wince', 'darwin', 'embedded', 'cygwin', 'sunos', 'freebsd8')))
allowed_values=('linux', 'cell', 'windows', 'winddk', 'wince', 'darwin', 'cygwin', 'sunos', 'freebsd8')))
opts.Add(BoolOption('embedded', 'embedded build', 'no'))
opts.Add('toolchain', 'compiler toolchain', default_toolchain)
opts.Add(BoolOption('gles', 'EXPERIMENTAL: enable OpenGL ES support', 'no'))
opts.Add(BoolOption('llvm', 'use LLVM', default_llvm))
opts.Add(BoolOption('debug', 'DEPRECATED: debug build', 'yes'))
opts.Add(BoolOption('profile', 'DEPRECATED: profile build', 'no'))
opts.Add(EnumOption('MSVS_VERSION', 'MS Visual C++ version', None, allowed_values=('7.1', '8.0', '9.0')))
opts.Add(BoolOption('quiet', 'DEPRECATED: quiet command lines', 'yes'))
if host_platform == 'windows':
opts.Add(EnumOption('MSVS_VERSION', 'MS Visual C++ version', None, allowed_values=('7.1', '8.0', '9.0')))

View File

@@ -26,6 +26,8 @@ LDFLAGS = @LDFLAGS@
EXTRA_LIB_PATH = @EXTRA_LIB_PATH@
RADEON_CFLAGS = @RADEON_CFLAGS@
RADEON_LDFLAGS = @RADEON_LDFLAGS@
NOUVEAU_CFLAGS = @NOUVEAU_CFLAGS@
NOUVEAU_LIBS = @NOUVEAU_LIBS@
INTEL_LIBS = @INTEL_LIBS@
INTEL_CFLAGS = @INTEL_CFLAGS@
X11_LIBS = @X11_LIBS@
@@ -58,6 +60,10 @@ INSTALL = @INSTALL@
PYTHON2 = @PYTHON2@
PYTHON_FLAGS = -t -O -O
# Flex and Bison for GLSL compiler
FLEX = @FLEX@
BISON = @BISON@
# Library names (base name)
GL_LIB = GL
GLU_LIB = GLU
@@ -69,6 +75,7 @@ GLESv2_LIB = GLESv2
VG_LIB = OpenVG
GLAPI_LIB = glapi
WAYLAND_EGL_LIB = wayland-egl
GBM_LIB = gbm
# Library names (actual file names)
GL_LIB_NAME = @GL_LIB_NAME@
@@ -82,6 +89,7 @@ GLESv2_LIB_NAME = @GLESv2_LIB_NAME@
VG_LIB_NAME = @VG_LIB_NAME@
GLAPI_LIB_NAME = @GLAPI_LIB_NAME@
WAYLAND_EGL_LIB_NAME = @WAYLAND_EGL_LIB_NAME@
GBM_LIB_NAME = @GBM_LIB_NAME@
# Globs used to install the lib and all symlinks
GL_LIB_GLOB = @GL_LIB_GLOB@
@@ -95,6 +103,7 @@ GLESv2_LIB_GLOB = @GLESv2_LIB_GLOB@
VG_LIB_GLOB = @VG_LIB_GLOB@
GLAPI_LIB_GLOB = @GLAPI_LIB_GLOB@
WAYLAND_EGL_LIB_GLOB = @WAYLAND_EGL_LIB_GLOB@
GBM_LIB_GLOB = @GBM_LIB_GLOB@
# Directories to build
LIB_DIR = @LIB_DIR@
@@ -102,6 +111,7 @@ SRC_DIRS = @SRC_DIRS@
GLU_DIRS = @GLU_DIRS@
DRIVER_DIRS = @DRIVER_DIRS@
EGL_DRIVERS_DIRS = @EGL_DRIVERS_DIRS@
GBM_BACKEND_DIRS = @GBM_BACKEND_DIRS@
GALLIUM_DIRS = @GALLIUM_DIRS@
GALLIUM_DRIVERS_DIRS = @GALLIUM_DRIVERS_DIRS@
GALLIUM_WINSYS_DIRS = @GALLIUM_WINSYS_DIRS@
@@ -141,7 +151,8 @@ GLESv1_CM_LIB_DEPS = $(EXTRA_LIB_PATH) @GLESv1_CM_LIB_DEPS@
GLESv2_LIB_DEPS = $(EXTRA_LIB_PATH) @GLESv2_LIB_DEPS@
VG_LIB_DEPS = $(EXTRA_LIB_PATH) @VG_LIB_DEPS@
GLAPI_LIB_DEPS = $(EXTRA_LIB_PATH) @GLAPI_LIB_DEPS@
WAYLAND_EGL_LIB_DEPS = $(EXTRA_LIBPATH) @WAYLAND_EGL_LIB_DEPS@
WAYLAND_EGL_LIB_DEPS = $(EXTRA_LIB_PATH) @WAYLAND_EGL_LIB_DEPS@
GBM_LIB_DEPS = $(EXTRA_LIB_PATH) @GBM_LIB_DEPS@
# DRI dependencies
MESA_MODULES = @MESA_MODULES@
@@ -200,6 +211,9 @@ EGL_PC_CFLAGS = @GL_PC_CFLAGS@
WAYLAND_EGL_PC_REQ_PRIV = @WAYLAND_EGL_PC_REQ_PRIV@
WAYLAND_EGL_PC_LIB_PRIV = @WAYLAND_EGL_PC_LIB_PRIV@
WAYLAND_EGL_PC_CFLAGS = @WAYLAND_EGL_PC_CFLAGS@
GBM_PC_REQ_PRIV = @GBM_PC_REQ_PRIV@
GBM_PC_LIB_PRIV = @GBM_PC_LIB_PRIV@
GBM_PC_CFLAGS = @GBM_PC_CFLAGS@
XCB_DRI2_CFLAGS = @XCB_DRI2_CFLAGS@
XCB_DRI2_LIBS = @XCB_DRI2_LIBS@

View File

@@ -25,27 +25,29 @@ DEFINES = -D_DARWIN_C_SOURCE -DPTHREADS -D_GNU_SOURCE \
ARCH_FLAGS += $(RC_CFLAGS)
CFLAGS = -ggdb3 -Os -Wall -Wmissing-prototypes -std=c99 -ffast-math -fno-strict-aliasing \
CFLAGS = -ggdb3 -Os -Wall -Wmissing-prototypes -std=c99 -ffast-math -fno-strict-aliasing -fvisibility=hidden \
-I$(INSTALL_DIR)/include -I$(X11_DIR)/include $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(ASM_FLAGS) $(DEFINES)
CXXFLAGS = -ggdb3 -Os -Wall -fno-strict-aliasing \
CXXFLAGS = -ggdb3 -Os -Wall -fno-strict-aliasing -fvisibility=hidden \
-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

@@ -38,6 +38,8 @@ MKLIB_OPTIONS =
MKDEP = makedepend
MKDEP_OPTIONS = -fdepend
MAKE = make
FLEX = flex
BISON = bison
# Use MINSTALL for installing libraries, INSTALL for everything else
MINSTALL = $(SHELL) $(TOP)/bin/minstall
@@ -61,7 +63,7 @@ GLESv2_LIB = GLESv2
VG_LIB = OpenVG
GLAPI_LIB = glapi
WAYLAND_EGL_LIB = wayland-egl
GBM_LIB = gbm
# Library names (actual file names)
GL_LIB_NAME = lib$(GL_LIB).so
@@ -75,6 +77,7 @@ GLESv2_LIB_NAME = lib$(GLESv2_LIB).so
VG_LIB_NAME = lib$(VG_LIB).so
GLAPI_LIB_NAME = lib$(GLAPI_LIB).so
WAYLAND_EGL_LIB_NAME = lib$(WAYLAND_EGL_LIB).so
GBM_LIB_NAME = lib$(GBM_LIB).so
# globs used to install the lib and all symlinks
GL_LIB_GLOB = $(GL_LIB_NAME)*
@@ -88,6 +91,7 @@ GLESv2_LIB_GLOB = $(GLESv2_LIB_NAME)*
VG_LIB_GLOB = $(VG_LIB_NAME)*
GLAPI_LIB_GLOB = $(GLAPI_LIB_NAME)*
WAYLAND_EGL_LIB_GLOB = $(WAYLAND_EGL_LIB_NAME)*
GBM_LIB_GLOB = $(GBM_LIB_NAME)*
DRI_CFLAGS = $(CFLAGS)
DRI_CXXFLAGS = $(CXXFLAGS)
@@ -111,6 +115,9 @@ DRIVER_DIRS = x11 osmesa
# EGL drivers to build
EGL_DRIVERS_DIRS = glx
# gbm backends to build
GBM_BACKEND_DIRS = dri
# Gallium directories and
GALLIUM_DIRS = auxiliary drivers state_trackers
GALLIUM_AUXILIARIES = $(TOP)/src/gallium/auxiliary/libgallium.a
@@ -138,6 +145,7 @@ GLESv2_LIB_DEPS = $(EXTRA_LIB_PATH) -lpthread
VG_LIB_DEPS = $(EXTRA_LIB_PATH) -lpthread
GLAPI_LIB_DEPS = $(EXTRA_LIB_PATH) -lpthread
WAYLAND_EGL_LIB_DEPS = $(EXTRA_LIB_PATH) -lwayland-client -ldrm
GBM_LIB_DEPS = $(EXTRA_LIB_PATH) -ludev -ldl
# Program dependencies - specific GL/glut libraries added in Makefiles
APP_LIB_DEPS = -lm
@@ -157,6 +165,9 @@ DRI_DRIVER_SEARCH_DIR = $(DRI_DRIVER_INSTALL_DIR)
# EGL driver install directory
EGL_DRIVER_INSTALL_DIR = $(INSTALL_LIB_DIR)/egl
# gbm backend install directory
GBM_BACKEND_INSTALL_DIR = $(INSTALL_LIB_DIR)/gbm
# Xorg driver install directory (for xorg state-tracker)
XORG_DRIVER_INSTALL_DIR = $(INSTALL_LIB_DIR)/xorg/modules/drivers
@@ -189,3 +200,6 @@ VG_PC_CFLAGS =
WAYLAND_EGL_PC_REQ_PRIV =
WAYLAND_EGL_PC_LIB_PRIV =
WAYLAND_EGL_PC_CFLAGS =
GBM_PC_REQ_PRIV =
GBM_PC_LIB_PRIV =
GBM_PC_CFLAGS =

View File

@@ -63,11 +63,16 @@ GALLIUM_WINSYS_DIRS = sw sw/xlib drm/vmware drm/intel drm/i965
GALLIUM_TARGET_DIRS =
GALLIUM_STATE_TRACKERS_DIRS = egl
DRI_DIRS = i810 i915 i965 mach64 mga r128 r200 r300 r600 radeon \
DRI_DIRS = i810 i915 i965 mach64 mga nouveau r128 r200 r300 r600 radeon \
savage sis tdfx unichrome swrast
INTEL_LIBS = `pkg-config --libs libdrm_intel`
INTEL_CFLAGS = `pkg-config --cflags libdrm_intel`
INTEL_LIBS = $(shell pkg-config --libs libdrm_intel)
INTEL_CFLAGS = $(shell pkg-config --cflags libdrm_intel)
RADEON_LIBS = `pkg-config --libs libdrm_radeon`
RADEON_CFLAGS = `pkg-config --cflags libdrm_radeon`
NOUVEAU_LIBS = $(shell pkg-config --libs libdrm_nouveau)
NOUVEAU_CFLAGS = $(shell pkg-config --cflags libdrm_nouveau)
LIBDRM_RADEON_LIBS = $(shell pkg-config --libs libdrm_radeon)
LIBDRM_RADEON_CFLAGS = $(shell pkg-config --cflags libdrm_radeon)
RADEON_CFLAGS = "-DHAVE_LIBDRM_RADEON=1 $(LIBDRM_RADEON_CFLAGS)"
RADEON_LDFLAGS = $(LIBDRM_RADEON_LIBS)

View File

@@ -21,6 +21,7 @@ dnl Versions for external dependencies
LIBDRM_REQUIRED=2.4.24
LIBDRM_RADEON_REQUIRED=2.4.24
LIBDRM_INTEL_REQUIRED=2.4.24
LIBDRM_NOUVEAU_REQUIRED=0.6
DRI2PROTO_REQUIRED=2.1
GLPROTO_REQUIRED=1.4.11
LIBDRM_XORG_REQUIRED=2.4.24
@@ -39,6 +40,12 @@ if test "x$MKDEP" = "x"; then
AC_MSG_ERROR([makedepend is required to build Mesa])
fi
AC_PATH_PROG([FLEX], [flex])
test "x$FLEX" = "x" && AC_MSG_ERROR([flex is needed to build Mesa])
AC_PATH_PROG([BISON], [bison])
test "x$BISON" = "x" && AC_MSG_ERROR([bison is needed to build Mesa])
dnl Our fallback install-sh is a symlink to minstall. Use the existing
dnl configuration in that case.
AC_PROG_INSTALL
@@ -319,6 +326,21 @@ else
esac
fi
dnl
dnl potentially-infringing-but-nobody-knows-for-sure stuff
dnl
AC_ARG_ENABLE([texture-float],
[AS_HELP_STRING([--enable-texture-float],
[enable floating-point textures and renderbuffers @<:@default=disabled@:>@])],
[enable_texture_float="$enableval"],
[enable_texture_float=no]
)
if test "x$enable_texture_float" = xyes; then
AC_MSG_WARN([Floating-point textures enabled.])
AC_MSG_WARN([Please consult docs/patents.txt with your lawyer before building Mesa.])
DEFINES="$DEFINES -DTEXTURE_FLOAT_ENABLED"
fi
GL_LIB_NAME='lib$(GL_LIB).'${LIB_EXTENSION}
GLU_LIB_NAME='lib$(GLU_LIB).'${LIB_EXTENSION}
GLUT_LIB_NAME='lib$(GLUT_LIB).'${LIB_EXTENSION}
@@ -330,6 +352,7 @@ GLESv2_LIB_NAME='lib$(GLESv2_LIB).'${LIB_EXTENSION}
VG_LIB_NAME='lib$(VG_LIB).'${LIB_EXTENSION}
GLAPI_LIB_NAME='lib$(GLAPI_LIB).'${LIB_EXTENSION}
WAYLAND_EGL_LIB_NAME='lib$(WAYLAND_EGL_LIB).'${LIB_EXTENSION}
GBM_LIB_NAME='lib$(GBM_LIB).'${LIB_EXTENSION}
GL_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GL_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
GLU_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GLU_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
@@ -343,6 +366,7 @@ GLESv2_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GLESv2_LIB)'${LIB_VERSION_SEPARATOR}'*'${LI
VG_LIB_GLOB=${LIB_PREFIX_GLOB}'$(VG_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
GLAPI_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GLAPI_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
WAYLAND_EGL_LIB_GLOB=${LIB_PREFIX_GLOB}'$(WAYLAND_EGL_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
GBM_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GBM_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
AC_SUBST([GL_LIB_NAME])
AC_SUBST([GLU_LIB_NAME])
@@ -355,6 +379,7 @@ AC_SUBST([GLESv2_LIB_NAME])
AC_SUBST([VG_LIB_NAME])
AC_SUBST([GLAPI_LIB_NAME])
AC_SUBST([WAYLAND_EGL_LIB_NAME])
AC_SUBST([GBM_LIB_NAME])
AC_SUBST([GL_LIB_GLOB])
AC_SUBST([GLU_LIB_GLOB])
@@ -367,6 +392,7 @@ AC_SUBST([GLESv2_LIB_GLOB])
AC_SUBST([VG_LIB_GLOB])
AC_SUBST([GLAPI_LIB_GLOB])
AC_SUBST([WAYLAND_EGL_LIB_GLOB])
AC_SUBST([GBM_LIB_GLOB])
dnl
dnl Arch/platform-specific settings
@@ -485,7 +511,7 @@ if test "x$enable_selinux" = "xyes"; then
DEFINES="$DEFINES -DMESA_SELINUX"
fi
dnl Determine which APIs to support
dnl Options for APIs
AC_ARG_ENABLE([opengl],
[AS_HELP_STRING([--disable-opengl],
[disable support for standard OpenGL API @<:@default=no@:>@])],
@@ -501,32 +527,70 @@ AC_ARG_ENABLE([gles2],
[enable support for OpenGL ES 2.x API @<:@default=no@:>@])],
[enable_gles2="$enableval"],
[enable_gles2=no])
AC_ARG_ENABLE([gles-overlay],
[AS_HELP_STRING([--enable-gles-overlay],
[DEPRECATED. Same as --enable-gles1 and --enable-gles2])],
[enable_gles1="$enableval"; enable_gles2="$enableval"],
[])
AC_ARG_ENABLE([openvg],
[AS_HELP_STRING([--enable-openvg],
[enable support for OpenVG API @<:@default=no@:>@])],
[enable_openvg="$enableval"],
[enable_openvg=no])
AC_ARG_ENABLE([xorg],
[AS_HELP_STRING([--enable-xorg],
[enable support for X.Org DDX API @<:@default=no@:>@])],
[enable_xorg="$enableval"],
[enable_xorg=no])
AC_ARG_ENABLE([d3d1x],
[AS_HELP_STRING([--enable-d3d1x],
[enable support for Direct3D 10 & 11 low-level API @<:@default=no@:>@])],
[enable_d3d1x="$enableval"],
[enable_d3d1x=no])
AC_ARG_ENABLE([egl],
[AS_HELP_STRING([--disable-egl],
[disable EGL library @<:@default=enabled@:>@])],
[enable_egl="$enableval"],
[enable_egl=yes])
AC_ARG_ENABLE([gbm],
[AS_HELP_STRING([--enable-gbm],
[enable gbm library @<:@default=auto@:>@])],
[enable_gbm="$enableval"],
[enable_gbm=auto])
AC_ARG_ENABLE([gallium_egl],
[AS_HELP_STRING([--enable-gallium-egl],
[enable optional EGL state tracker (not required
for EGL support in Gallium with OpenGL and OpenGL ES)
@<:@default=disable@:>@])],
[enable_gallium_egl="$enableval"],
[enable_gallium_egl=no])
AC_ARG_ENABLE([gallium_gbm],
[AS_HELP_STRING([--enable-gallium-gbm],
[enable optional gbm state tracker (not required for
gbm support in Gallium)
@<:@default=auto@:>@])],
[enable_gallium_gbm="$enableval"],
[enable_gallium_gbm=auto])
dnl smooth the transition; should be removed eventually
if test "x$enable_openvg" = xno; then
case "x$with_state_trackers" in
x*vega*)
AC_MSG_WARN([vega state tracker is enabled without --enable-openvg])
enable_openvg=yes
;;
esac
fi
# Option for Gallium drivers
GALLIUM_DRIVERS_DEFAULT="r300,r600,swrast"
AC_ARG_WITH([gallium-drivers],
[AS_HELP_STRING([--with-gallium-drivers@<:@=DIRS...@:>@],
[comma delimited Gallium drivers list, e.g.
"i915,i965,nouveau,r300,r600,svga,swrast"
@<:@default=r300,r600,swrast@:>@])],
[with_gallium_drivers="$withval"],
[with_gallium_drivers="$GALLIUM_DRIVERS_DEFAULT"])
# Doing '--without-gallium-drivers' will set this variable to 'no'. Clear it
# here so that the script doesn't choke on an unknown driver name later.
case "$with_gallium_drivers" in
yes) with_gallium_drivers="$GALLIUM_DRIVERS_DEFAULT" ;;
no) with_gallium_drivers='' ;;
esac
if test "x$enable_opengl" = xno -a \
"x$enable_gles1" = xno -a \
"x$enable_gles2" = xno -a \
"x$enable_openvg" = xno; then
"x$enable_openvg" = xno -a \
"x$enable_xorg" = xno -a \
"x$enable_d3d1x" = xno; then
AC_MSG_ERROR([at least one API should be enabled])
fi
@@ -635,11 +699,6 @@ if test "x$enable_gles2" = xyes; then
CORE_DIRS="$CORE_DIRS mapi/es2api"
fi
# build vgapi if OpenVG is enabled
if test "x$enable_openvg" = xyes; then
CORE_DIRS="$CORE_DIRS mapi/vgapi"
fi
# build glsl and mesa if OpenGL or OpenGL ES is enabled
case "x$enable_opengl$enable_gles1$enable_gles2" in
x*yes*)
@@ -652,11 +711,14 @@ xlib)
DRIVER_DIRS="x11"
GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/xlib"
GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS libgl-xlib"
GALLIUM_STATE_TRACKERS_DIRS="glx $GALLIUM_STATE_TRACKERS_DIRS"
;;
dri)
SRC_DIRS="$SRC_DIRS glx"
DRIVER_DIRS="dri"
GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/xlib sw/dri"
GALLIUM_STATE_TRACKERS_DIRS="dri $GALLIUM_STATE_TRACKERS_DIRS"
HAVE_ST_DRI="yes"
;;
osmesa)
DRIVER_DIRS="osmesa"
@@ -767,7 +829,7 @@ xlib)
GL_PC_LIB_PRIV="$GL_LIB_DEPS"
GL_PC_CFLAGS="$X11_INCLUDES"
fi
GL_LIB_DEPS="$GL_LIB_DEPS $SELINUX_LIBS -lm -lpthread"
GL_LIB_DEPS="$GL_LIB_DEPS $SELINUX_LIBS -lm -lpthread $DLOPEN_LIBS"
GL_PC_LIB_PRIV="$GL_PC_LIB_PRIV $SELINUX_LIBS -lm -lpthread"
# if static, move the external libraries to the programs
@@ -893,11 +955,6 @@ AC_SUBST([MESA_MODULES])
AC_SUBST([HAVE_XF86VIDMODE])
PKG_CHECK_MODULES([LIBDRM_RADEON],
[libdrm_radeon >= $LIBDRM_RADEON_REQUIRED],
HAVE_LIBDRM_RADEON=yes,
HAVE_LIBDRM_RADEON=no)
dnl
dnl More X11 setup
dnl
@@ -983,8 +1040,8 @@ if test "$mesa_driver" = dri -o "$mesa_driver" = no; then
# the new interface. i810 are missing because there is no
# x86-64 system where they could *ever* be used.
if test "x$DRI_DIRS" = "xyes"; then
DRI_DIRS="i915 i965 mach64 mga r128 r200 r300 r600 radeon \
savage tdfx unichrome swrast"
DRI_DIRS="i915 i965 mach64 mga nouveau r128 r200 r300 r600 \
radeon savage tdfx unichrome swrast"
fi
;;
powerpc*)
@@ -1011,8 +1068,8 @@ if test "$mesa_driver" = dri -o "$mesa_driver" = no; then
fi
if test "x$DRI_DIRS" = "xyes"; then
DRI_DIRS="i810 i915 i965 mach64 mga r128 r200 r300 r600 radeon tdfx \
unichrome savage sis swrast"
DRI_DIRS="i810 i915 i965 mach64 mga nouveau r128 r200 r300 r600 \
radeon tdfx unichrome savage sis swrast"
fi
;;
gnu*)
@@ -1040,7 +1097,7 @@ if test "$mesa_driver" = dri -o "$mesa_driver" = no; then
# default drivers
if test "x$DRI_DIRS" = "xyes"; then
DRI_DIRS="i810 i915 i965 mach64 mga r128 r200 r300 r600 radeon \
DRI_DIRS="i810 i915 i965 mach64 mga nouveau r128 r200 r300 r600 radeon \
savage sis tdfx unichrome swrast"
fi
@@ -1076,8 +1133,19 @@ case $DRI_DIRS in
;;
esac
case $DRI_DIRS in
*nouveau*)
PKG_CHECK_MODULES([NOUVEAU], [libdrm_nouveau >= $LIBDRM_NOUVEAU_REQUIRED])
;;
esac
case $DRI_DIRS in
*radeon*|*r200*|*r300*|*r600*)
PKG_CHECK_MODULES([LIBDRM_RADEON],
[libdrm_radeon >= $LIBDRM_RADEON_REQUIRED],
HAVE_LIBDRM_RADEON=yes,
HAVE_LIBDRM_RADEON=no)
if test "x$HAVE_LIBDRM_RADEON" = xyes; then
RADEON_CFLAGS="-DHAVE_LIBDRM_RADEON=1 $LIBDRM_RADEON_CFLAGS"
RADEON_LDFLAGS=$LIBDRM_RADEON_LIBS
@@ -1153,45 +1221,75 @@ AC_SUBST([OSMESA_MESA_DEPS])
AC_SUBST([OSMESA_PC_REQ])
AC_SUBST([OSMESA_PC_LIB_PRIV])
dnl
dnl gbm configuration
dnl
if test "x$enable_gbm" = xauto; then
case "$with_egl_platforms" in
*drm*)
enable_gbm=yes ;;
*)
enable_gbm=no ;;
esac
fi
if test "x$enable_gbm" = xyes; then
SRC_DIRS="$SRC_DIRS gbm"
GBM_BACKEND_DIRS=""
PKG_CHECK_MODULES([LIBUDEV], [libudev], [],
AC_MSG_ERROR([gbm needs udev]))
GBM_LIB_DEPS="$DLOPEN_LIBS $LIBUDEV_LIBS"
if test "$mesa_driver" = dri; then
GBM_BACKEND_DIRS="$GBM_BACKEND_DIRS dri"
if test "$SHARED_GLAPI" -eq 0; then
AC_MSG_ERROR([gbm_dri requires --enable-shared-glapi])
fi
fi
fi
AC_SUBST([GBM_LIB_DEPS])
AC_SUBST([GBM_BACKEND_DIRS])
GBM_PC_REQ_PRIV="libudev"
GBM_PC_LIB_PRIV="$DLOPEN_LIBS"
GBM_PC_CFLAGS=
AC_SUBST([GBM_PC_REQ_PRIV])
AC_SUBST([GBM_PC_LIB_PRIV])
AC_SUBST([GBM_PC_CFLAGS])
dnl
dnl EGL configuration
dnl
AC_ARG_ENABLE([egl],
[AS_HELP_STRING([--disable-egl],
[disable EGL library @<:@default=enabled@:>@])],
[enable_egl="$enableval"],
[enable_egl=yes])
EGL_CLIENT_APIS=""
if test "x$enable_egl" = xno; then
if test "x$mesa_driver" = xno; then
AC_MSG_ERROR([cannot disable EGL when there is no mesa driver])
fi
if test "x$enable_openvg" = xyes; then
AC_MSG_ERROR([cannot enable OpenVG without EGL])
fi
fi
if test "x$enable_egl" = xyes; then
SRC_DIRS="$SRC_DIRS egl"
EGL_LIB_DEPS="$DLOPEN_LIBS -lpthread"
EGL_LIB_DEPS="$DLOPEN_LIBS $SELINUX_LIBS -lpthread"
EGL_DRIVERS_DIRS=""
if test "$enable_static" != yes; then
# build egl_glx when libGL is built
if test "$mesa_driver" = xlib -o "$mesa_driver" = dri; then
EGL_DRIVERS_DIRS="glx"
fi
PKG_CHECK_MODULES([LIBUDEV], [libudev > 150],
[have_libudev=yes],[have_libudev=no])
if test "$have_libudev" = yes; then
DEFINES="$DEFINES -DHAVE_LIBUDEV"
fi
if test "$mesa_driver" = dri; then
# build egl_dri2 when xcb-dri2 is available
PKG_CHECK_MODULES([XCB_DRI2], [x11-xcb xcb-dri2 xcb-xfixes],
[have_xcb_dri2=yes],[have_xcb_dri2=no])
PKG_CHECK_MODULES([LIBUDEV], [libudev > 150],
[have_libudev=yes],[have_libudev=no])
if test "$have_xcb_dri2" = yes; then
EGL_DRIVER_DRI2=dri2
DEFINES="$DEFINES -DHAVE_XCB_DRI2"
if test "$have_libudev" = yes; then
DEFINES="$DEFINES -DHAVE_LIBUDEV"
fi
# workaround a bug in xcb-dri2 generated by xcb-proto 1.6
AC_CHECK_LIB(xcb-dri2, xcb_dri2_connect_alignment_pad, [],
[DEFINES="$DEFINES -DXCB_DRI2_CONNECT_DEVICE_NAME_BROKEN"])
@@ -1204,6 +1302,96 @@ fi
AC_SUBST([EGL_LIB_DEPS])
AC_SUBST([EGL_DRIVERS_DIRS])
dnl
dnl EGL Gallium configuration
dnl
if test "x$enable_gallium_egl" = xyes; then
if test "x$with_gallium_drivers" = x; then
AC_MSG_ERROR([cannot enable egl_gallium without Gallium])
fi
if test "x$enable_egl" = xno; then
AC_MSG_ERROR([cannot enable egl_gallium without EGL])
fi
GALLIUM_STATE_TRACKERS_DIRS="egl $GALLIUM_STATE_TRACKERS_DIRS"
GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS egl-static"
HAVE_ST_EGL="yes"
fi
dnl
dnl gbm Gallium configuration
dnl
if test "x$enable_gallium_gbm" = xauto; then
case "$enable_gbm$HAVE_ST_EGL$with_egl_platforms" in
yesyes*drm*)
enable_gallium_gbm=yes ;;
*)
enable_gallium_gbm=no ;;
esac
fi
if test "x$enable_gallium_gbm" = xyes; then
if test "x$with_gallium_drivers" = x; then
AC_MSG_ERROR([cannot enable gbm_gallium without Gallium])
fi
if test "x$enable_gbm" = xno; then
AC_MSG_ERROR([cannot enable gbm_gallium without gbm])
fi
GALLIUM_STATE_TRACKERS_DIRS="gbm $GALLIUM_STATE_TRACKERS_DIRS"
GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS gbm"
HAVE_ST_GBM="yes"
fi
dnl
dnl X.Org DDX configuration
dnl
if test "x$enable_xorg" = xyes; then
PKG_CHECK_MODULES([XORG], [xorg-server >= 1.6.0])
PKG_CHECK_MODULES([LIBDRM_XORG], [libdrm >= $LIBDRM_XORG_REQUIRED])
PKG_CHECK_MODULES([LIBKMS_XORG], [libkms >= $LIBKMS_XORG_REQUIRED])
PKG_CHECK_MODULES(XEXT, [xextproto >= 7.0.99.1],
HAVE_XEXTPROTO_71="yes"; DEFINES="$DEFINES -DHAVE_XEXTPROTO_71",
HAVE_XEXTPROTO_71="no")
GALLIUM_STATE_TRACKERS_DIRS="xorg $GALLIUM_STATE_TRACKERS_DIRS"
HAVE_ST_XORG=yes
fi
dnl
dnl OpenVG configuration
dnl
VG_LIB_DEPS=""
if test "x$enable_openvg" = xyes; then
if test "x$enable_egl" = xno; then
AC_MSG_ERROR([cannot enable OpenVG without EGL])
fi
if test "x$with_gallium_drivers" = x; then
AC_MSG_ERROR([cannot enable OpenVG without Gallium])
fi
if test "x$enable_gallium_egl" = xno; then
AC_MSG_ERROR([cannot enable OpenVG without egl_gallium])
fi
EGL_CLIENT_APIS="$EGL_CLIENT_APIS "'$(VG_LIB)'
VG_LIB_DEPS="$VG_LIB_DEPS $SELINUX_LIBS -lpthread"
CORE_DIRS="$CORE_DIRS mapi/vgapi"
GALLIUM_STATE_TRACKERS_DIRS="vega $GALLIUM_STATE_TRACKERS_DIRS"
HAVE_ST_VEGA=yes
fi
dnl
dnl D3D1X configuration
dnl
if test "x$enable_d3d1x" = xyes; then
if test "x$with_gallium_drivers" = x; then
AC_MSG_ERROR([cannot enable D3D1X without Gallium])
fi
GALLIUM_STATE_TRACKERS_DIRS="d3d1x $GALLIUM_STATE_TRACKERS_DIRS"
HAVE_ST_D3D1X=yes
fi
dnl
dnl GLU configuration
dnl
@@ -1420,17 +1608,8 @@ AC_SUBST([PROGRAM_DIRS])
dnl
dnl Gallium configuration
dnl
AC_ARG_ENABLE([gallium],
[AS_HELP_STRING([--disable-gallium],
[build gallium @<:@default=enabled@:>@])],
[enable_gallium="$enableval"],
[enable_gallium=yes])
if test "x$enable_gallium" = xno -a "x$enable_openvg" = xyes; then
AC_MSG_ERROR([cannot enable OpenVG without Gallium])
fi
if test "x$enable_gallium" = xyes; then
if test "x$with_gallium_drivers" != x; then
SRC_DIRS="$SRC_DIRS gallium gallium/winsys gallium/targets"
AC_PATH_PROG([LLVM_CONFIG], [llvm-config], [no])
fi
AC_SUBST([LLVM_CFLAGS])
@@ -1438,160 +1617,23 @@ AC_SUBST([LLVM_LIBS])
AC_SUBST([LLVM_LDFLAGS])
AC_SUBST([LLVM_VERSION])
dnl
dnl Gallium state trackers configuration
dnl
AC_ARG_ENABLE([gallium-egl],
[AS_HELP_STRING([--enable-gallium-egl],
[enable gallium EGL state tracker @<:@default=auto@:>@])],
[enable_gallium_egl="$enableval"],
[enable_gallium_egl=auto])
if test "x$enable_gallium_egl" = xauto; then
case "$mesa_driver" in
dri|no)
enable_gallium_egl=$enable_egl
;;
*)
enable_gallium_egl=$enable_openvg
;;
esac
fi
case "x$enable_egl$enable_gallium_egl" in
xnoyes)
AC_MSG_ERROR([cannot build Gallium EGL state tracker without EGL])
esac
AC_ARG_WITH([state-trackers],
[AS_HELP_STRING([--with-state-trackers@<:@=DIRS...@:>@],
[comma delimited state_trackers list, e.g.
"egl,glx" @<:@default=auto@:>@])],
[with_state_trackers="$withval"],
[with_state_trackers=yes])
case "$with_state_trackers" in
no)
GALLIUM_STATE_TRACKERS_DIRS=""
;;
yes)
# look at what else is built
case "$mesa_driver" in
xlib)
GALLIUM_STATE_TRACKERS_DIRS=glx
;;
dri)
GALLIUM_STATE_TRACKERS_DIRS="dri"
HAVE_ST_DRI="yes"
# Have only tested st/xorg on 1.6.0 servers
PKG_CHECK_MODULES(XORG, [xorg-server >= 1.6.0 libdrm >= $LIBDRM_XORG_REQUIRED libkms >= $LIBKMS_XORG_REQUIRED],
HAVE_ST_XORG="yes"; GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS xorg",
HAVE_ST_XORG="no")
;;
esac
if test "x$enable_egl" = xyes; then
if test "$enable_openvg" = yes; then
GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS vega"
st_egl="yes"
fi
if test "$enable_gallium_egl" = yes; then
GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS egl"
HAVE_ST_EGL="yes"
fi
fi
;;
*)
# verify the requested state tracker exist
state_trackers=""
_state_trackers=`IFS=', '; echo $with_state_trackers`
for tracker in $_state_trackers; do
case "$tracker" in
dri)
if test "x$mesa_driver" != xdri; then
AC_MSG_ERROR([cannot build dri state tracker without mesa driver set to dri])
fi
HAVE_ST_DRI="yes"
;;
egl)
if test "x$enable_egl" != xyes; then
AC_MSG_ERROR([cannot build egl state tracker without EGL library])
fi
HAVE_ST_EGL="yes"
;;
xorg)
PKG_CHECK_MODULES([XORG], [xorg-server >= 1.6.0])
PKG_CHECK_MODULES([LIBDRM_XORG], [libdrm >= $LIBDRM_XORG_REQUIRED])
PKG_CHECK_MODULES([LIBKMS_XORG], [libkms >= $LIBKMS_XORG_REQUIRED])
HAVE_ST_XORG="yes"
;;
vega)
if test "x$enable_openvg" != xyes; then
AC_MSG_ERROR([cannot build vega state tracker without --enable-openvg])
fi
have_st_vega="yes"
;;
esac
if test -n "$tracker"; then
test -d "$srcdir/src/gallium/state_trackers/$tracker" || \
AC_MSG_ERROR([state tracker '$tracker' doesn't exist])
if test -n "$state_trackers"; then
state_trackers="$state_trackers $tracker"
else
state_trackers="$tracker"
fi
fi
done
GALLIUM_STATE_TRACKERS_DIRS="$state_trackers"
# append --enable-openvg/--enable-gallium-egl to --with-state-trackers
if test "x$have_st_vega" != xyes -a "x$enable_openvg" = xyes; then
AC_MSG_ERROR([--with-state-trackers specified but vega is missing])
fi
if test "x$HAVE_ST_EGL" != xyes -a "x$enable_gallium_egl" = xyes; then
AC_MSG_ERROR([--with-state-trackers specified but egl is missing])
fi
;;
esac
EGL_CLIENT_APIS=""
VG_LIB_DEPS=""
case "x$enable_opengl$enable_gles1$enable_gles2" in
x*yes*)
EGL_CLIENT_APIS="$EGL_CLIENT_APIS "'$(GL_LIB)'
;;
esac
if test "x$enable_openvg" = xyes; then
EGL_CLIENT_APIS="$EGL_CLIENT_APIS "'$(VG_LIB)'
VG_LIB_DEPS="$VG_LIB_DEPS -lpthread"
fi
AC_SUBST([VG_LIB_DEPS])
AC_SUBST([EGL_CLIENT_APIS])
if test "x$HAVE_ST_EGL" = xyes; then
GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS egl"
fi
if test "x$HAVE_ST_XORG" = xyes; then
PKG_CHECK_MODULES(XEXT, [xextproto >= 7.0.99.1],
HAVE_XEXTPROTO_71="yes"; DEFINES="$DEFINES -DHAVE_XEXTPROTO_71",
HAVE_XEXTPROTO_71="no")
fi
AC_ARG_WITH([egl-platforms],
[AS_HELP_STRING([--with-egl-platforms@<:@=DIRS...@:>@],
[comma delimited native platforms libEGL supports, e.g.
"x11,drm" @<:@default=auto@:>@])],
[with_egl_platforms="$withval"],
[with_egl_platforms=yes])
AC_ARG_WITH([egl-displays],
[AS_HELP_STRING([--with-egl-displays@<:@=DIRS...@:>@],
[DEPRECATED. Use --with-egl-platforms instead])],
[with_egl_platforms="$withval"])
EGL_PLATFORMS=""
WAYLAND_EGL_LIB_DEPS=""
@@ -1600,9 +1642,6 @@ 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
;;
*)
@@ -1621,7 +1660,15 @@ yes)
PKG_CHECK_MODULES([WAYLAND], [wayland-client wayland-server],, \
[AC_MSG_ERROR([cannot find libwayland-client])])
WAYLAND_EGL_LIB_DEPS="$WAYLAND_LIBS $LIBDRM_LIBS"
GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/wayland"
fi
if test "$plat" = "drm" && test "x$enable_gbm" = "xno"; then
AC_MSG_ERROR([EGL platform drm needs gbm])
fi
case "$plat$have_libudev" in
waylandno|drmno)
AC_MSG_ERROR([cannot build $plat platfrom without udev]) ;;
esac
done
EGL_PLATFORMS="$egl_platforms"
;;
@@ -1672,10 +1719,20 @@ dnl Gallium LLVM
dnl
AC_ARG_ENABLE([gallium-llvm],
[AS_HELP_STRING([--enable-gallium-llvm],
[build gallium LLVM support @<:@default=disabled@:>@])],
[build gallium LLVM support @<:@default=enabled on x86/x86_64@:>@])],
[enable_gallium_llvm="$enableval"],
[enable_gallium_llvm=auto])
if test "x$with_gallium_drivers" = x; then
enable_gallium_llvm=no
fi
if test "x$enable_gallium_llvm" = xauto; then
case "$host_cpu" in
i*86|x86_64) enable_gallium_llvm=yes;;
esac
fi
if test "x$enable_gallium_llvm" = xyes; then
AC_PATH_PROG([LLVM_CONFIG], [llvm-config], [no])
if test "x$LLVM_CONFIG" != xno; then
LLVM_VERSION=`$LLVM_CONFIG --version`
LLVM_CFLAGS=`$LLVM_CONFIG --cppflags`
@@ -1707,109 +1764,57 @@ gallium_check_st() {
fi
}
dnl
dnl Gallium SVGA configuration
dnl
AC_ARG_ENABLE([gallium-svga],
[AS_HELP_STRING([--enable-gallium-svga],
[build gallium SVGA @<:@default=disabled@:>@])],
[enable_gallium_svga="$enableval"],
[enable_gallium_svga=auto])
if test "x$enable_gallium_svga" = xyes; then
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS svga"
gallium_check_st "svga/drm" "dri-vmwgfx" "xorg-vmwgfx"
elif test "x$enable_gallium_svga" = xauto; then
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS svga"
fi
dnl
dnl Gallium i915 configuration
dnl
AC_ARG_ENABLE([gallium-i915],
[AS_HELP_STRING([--enable-gallium-i915],
[build gallium i915 @<:@default=disabled@:>@])],
[enable_gallium_i915="$enableval"],
[enable_gallium_i915=auto])
if test "x$enable_gallium_i915" = xyes; then
GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS i915/sw"
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS i915"
gallium_check_st "i915/drm" "dri-i915" "xorg-i915"
elif test "x$enable_gallium_i915" = xauto; then
GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS i915/sw"
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS i915"
fi
dnl
dnl Gallium i965 configuration
dnl
AC_ARG_ENABLE([gallium-i965],
[AS_HELP_STRING([--enable-gallium-i965],
[build gallium i965 @<:@default=disabled@:>@])],
[enable_gallium_i965="$enableval"],
[enable_gallium_i965=auto])
if test "x$enable_gallium_i965" = xyes; then
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS i965"
gallium_check_st "i965/drm" "dri-i965" "xorg-i965"
elif test "x$enable_gallium_i965" = xauto; then
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS i965"
fi
dnl
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
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r300"
gallium_check_st "radeon/drm" "dri-r300"
fi
if test "x$enable_gallium_radeon" = xyes; then
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r300"
gallium_check_st "radeon/drm" "dri-r300" "xorg-radeon"
fi
dnl
dnl Gallium Radeon r600g configuration
dnl
AC_ARG_ENABLE([gallium-r600],
[AS_HELP_STRING([--enable-gallium-r600],
[build gallium radeon @<:@default=disabled@:>@])],
[enable_gallium_r600="$enableval"],
[enable_gallium_r600=auto])
if test "x$enable_gallium_r600" = xyes; then
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r600"
gallium_check_st "r600/drm" "dri-r600"
fi
dnl
dnl Gallium Nouveau configuration
dnl
AC_ARG_ENABLE([gallium-nouveau],
[AS_HELP_STRING([--enable-gallium-nouveau],
[build gallium nouveau @<:@default=disabled@:>@])],
[enable_gallium_nouveau="$enableval"],
[enable_gallium_nouveau=no])
if test "x$enable_gallium_nouveau" = xyes; then
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS nouveau nvfx nv50 nvc0"
gallium_check_st "nouveau/drm" "dri-nouveau" "xorg-nouveau"
fi
dnl
dnl Gallium swrast configuration
dnl
AC_ARG_ENABLE([gallium-swrast],
[AS_HELP_STRING([--enable-gallium-swrast],
[build gallium swrast @<:@default=auto@:>@])],
[enable_gallium_swrast="$enableval"],
[enable_gallium_swrast=auto])
if test "x$enable_gallium_swrast" = xyes || test "x$enable_gallium_swrast" = xauto; then
if test "x$HAVE_ST_DRI" = xyes; then
GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS dri-swrast"
gallium_require_llvm() {
if test "x$MESA_LLVM" = x0; then
case "$host_cpu" in
i*86|x86_64) AC_MSG_ERROR([LLVM is required to build $1 on x86 and x86_64]);;
esac
fi
}
dnl Gallium drivers
if test "x$with_gallium_drivers" != x; then
# This is for compile-testing
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS i915 i965 r300 svga"
GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS i915/sw"
gallium_drivers=`IFS=', '; echo $with_gallium_drivers`
for driver in $gallium_drivers; do
case "x$driver" in
xsvga)
gallium_check_st "svga/drm" "dri-vmwgfx" "xorg-vmwgfx"
;;
xi915)
PKG_CHECK_MODULES([INTEL], [libdrm_intel >= $LIBDRM_INTEL_REQUIRED])
gallium_check_st "i915/drm" "dri-i915" "xorg-i915"
;;
xi965)
PKG_CHECK_MODULES([INTEL], [libdrm_intel >= $LIBDRM_INTEL_REQUIRED])
gallium_check_st "i965/drm" "dri-i965" "xorg-i965"
;;
xr300)
gallium_require_llvm "Gallium R300"
gallium_check_st "radeon/drm" "dri-r300" "xorg-r300"
;;
xr600)
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r600"
gallium_check_st "r600/drm" "dri-r600"
;;
xnouveau)
PKG_CHECK_MODULES([NOUVEAU], [libdrm_nouveau >= $LIBDRM_NOUVEAU_REQUIRED])
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS nouveau nvfx nv50 nvc0"
gallium_check_st "nouveau/drm" "dri-nouveau" "xorg-nouveau"
;;
xswrast)
if test "x$HAVE_ST_DRI" = xyes; then
GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS dri-swrast"
fi
;;
*)
AC_MSG_ERROR([Unknown Gallium driver: $driver])
;;
esac
done
fi
dnl prepend CORE_DIRS to SRC_DIRS
@@ -1884,7 +1889,7 @@ if test "$enable_egl" = yes; then
egl_drivers="$egl_drivers builtin:egl_$d"
done
if test "$enable_gallium" = yes -a "$HAVE_ST_EGL" = yes; then
if test "x$HAVE_ST_EGL" = xyes; then
echo " EGL drivers: ${egl_drivers} egl_gallium"
echo " EGL Gallium STs:$EGL_CLIENT_APIS"
else

View File

@@ -12,13 +12,13 @@ Feature Status
GL 3.0:
GLSL changes (GL_EXT_gpu_shader4, etc) not started
Conditional rendering (GL_NV_conditional_render) DONE (swrast & softpipe)
GLSL 1.30 (GL_EXT_gpu_shader4, etc.) started
Conditional rendering (GL_NV_conditional_render) DONE (swrast, softpipe, i965)
Map buffer subranges (GL_ARB_map_buffer_range) DONE
Clamping controls (GL_ARB_color_buffer_float) DONE
Float textures, renderbuffers (GL_ARB_texture_float) BRANCH ~mareko/mesa floating2
GL_EXT_packed_float not started
GL_EXT_texture_shared_exponent not started
Float textures, renderbuffers (GL_ARB_texture_float) DONE (gallium r300)
GL_EXT_packed_float DONE (gallium r600)
GL_EXT_texture_shared_exponent DONE (gallium, swrast)
Float depth buffers (GL_ARB_depth_buffer_float) not started
Framebuffer objects (GL_EXT_framebuffer_object) DONE
Half-float DONE
@@ -45,7 +45,7 @@ Depth format cube textures 0% done
GL 3.1:
GLSL 1.30 and 1.40 not started
GLSL 1.40 not started
Instanced drawing (GL_ARB_draw_instanced) DONE (gallium, swrast)
Buffer copying (GL_ARB_copy_buffer) DONE
Primitive restart (GL_NV_primitive_restart) DONE (gallium)
@@ -65,7 +65,7 @@ BGRA vertex order (GL_ARB_vertex_array_bgra) DONE
Base vertex offset(GL_ARB_draw_elements_base_vertex) DONE
Frag shader coord (GL_ARB_fragment_coord_conventions) DONE (swrast, gallium)
Provoking vertex (GL_ARB_provoking_vertex) DONE
Seamless cubemaps (GL_ARB_seamless_cube_map) DONE, mostly?
Seamless cubemaps (GL_ARB_seamless_cube_map) DONE
Multisample textures (GL_ARB_texture_multisample) not started
Frag depth clamp (GL_ARB_depth_clamp) DONE
Fence objects (GL_ARB_sync) DONE
@@ -80,7 +80,7 @@ GL_ARB_occlusion_query2 DONE (swrast, gallium)
GL_ARB_sampler_objects DONE (gallium)
GL_ARB_texture_rgb10_a2ui not started
GL_ARB_texture_swizzle DONE (same as EXT version)
GL_ARB_timer_query DONE (only Xlib sw driver)
GL_ARB_timer_query ~60% done (the EXT variant)
GL_ARB_instanced_arrays DONE (gallium)
GL_ARB_vertex_type_2_10_10_10_rev not started
@@ -105,7 +105,7 @@ GL_ARB_transform_feedback3 not started
GL 4.1:
GLSL 4.1 not started
GL_ARB_ES2_compatibility not started
GL_ARB_ES2_compatibility DONE (i965)
GL_ARB_get_program_binary not started
GL_ARB_separate_shader_objects some infrastructure done
GL_ARB_shader_precision not started

View File

@@ -66,6 +66,7 @@ New Tokens
EGL_DRM_BUFFER_USE_SCANOUT_MESA 0x0001
EGL_DRM_BUFFER_USE_SHARE_MESA 0x0002
EGL_DRM_BUFFER_USE_CURSOR_MESA 0x0004
Accepted in the <target> parameter of eglCreateImageKHR:
@@ -89,13 +90,16 @@ Additions to the EGL 1.4 Specification:
extension is EGL_DRM_BUFFER_FORMAT_ARGB32_MESA, where each pixel
is a CPU-endian, 32-bit quantity, with alpha in the upper 8 bits,
then red, then green, then blue. The bit values accepted by
EGL_DRM_BUFFER_USE_MESA are EGL_DRM_BUFFER_USE_SCANOUT_MESA and
EGL_DRM_BUFFER_USE_SHARE_MESA. EGL_DRM_BUFFER_USE_SCANOUT_MESA
requests that the created EGLImage should be usable as a scanout
buffer with the DRM kernel modesetting API. The
EGL_DRM_BUFFER_USE_SHARE_MESA bit requests that the EGLImage can
be shared with other processes by passing the underlying DRM
buffer name.
EGL_DRM_BUFFER_USE_MESA are EGL_DRM_BUFFER_USE_SCANOUT_MESA,
EGL_DRM_BUFFER_USE_SHARE_MESA and EGL_DRM_BUFFER_USE_CURSOR_MESA.
EGL_DRM_BUFFER_USE_SCANOUT_MESA requests that the created EGLImage
should be usable as a scanout buffer with the DRM kernel
modesetting API. EGL_DRM_BUFFER_USE_SHARE_MESA requests that the
EGLImage can be shared with other processes by passing the
underlying DRM buffer name. EGL_DRM_BUFFER_USE_CURSOR_MESA
requests that the image must be usable as a cursor with KMS. When
EGL_DRM_BUFFER_USE_CURSOR_MESA is set, width and height must both
be 64.
To create a process local handle or a global DRM name for a
buffer, call

View File

@@ -1,114 +1,33 @@
File: docs/README.WIN32
Last updated: Apr 25, 2007
NOTE: This information only applies to Mesa 7.8 and older. Nowadays
it's probably better to use Scons to build for Windows.
Last updated: 23 April 2011
Quick Start
----- -----
Unzip the MesaLib, MesaGLUT, and MesaDemos ZIP files into the same
directory. The libs and demos build separately, so if you do not care
about the demos or GLUT, you only need to unzip MesaLib. If you unzip
more than one ZIP file, they all need to be unzipped into the same
directory. Don't worry, you will not overwrite anything.
Windows drivers are build with SCons. Makefiles or Visual Studio projects are
no longer shipped or supported.
The Windows build system uses Microsoft Visual Studio. Project files
for a specific version of Visual Studio are in their own directory in
the top-level "windows" directory. For example, Visual Studio 8 files
are in windows/VC8.
Run
Support has been dropped for versions of Visual Studio prior to 8. The
main reason is because Microsoft now provides a free compiler and
developer environment. Visual Studio Express can be found at
scons osmesa mesagdi
http://msdn.microsoft.com/vstudio/express/visualc/default.aspx
to build classic mesa Windows GDI drivers; or
You'll also need the Platform SDK. Instructions for obtaining and
using the SDK with Visual Studio Express can be found at
scons libgl-gdi
http://msdn.microsoft.com/vstudio/express/visualc/usingpsdk/
The project files to build the core Mesa library, Windows Mesa
drivers, OSMesa, and GLU are in the mesa directory. The project files
to build GLUT and some demo programs are in the progs directory.
Makefiles are no longer shipped or supported, but can be generated
from the projects using Visual Studio.
to build gallium based GDI driver.
Windows Drivers
------- -------
At this time, only the GDI driver is known to work. Most of the demos
in progs/demos should work with this driver.
At this time, only the gallium GDI driver is known to work.
Source code also exists in the tree for other drivers in
src/mesa/drivers/windows, but the status of this code is unknown.
The GDI driver operates basically by writing pixel spans into a DIB
section and then blitting the DIB to the window. The driver was
recently cleaned up and rewitten and so may have bugs or may be
missing some functionality. The older versions of the CVS source may
be useful in figuring out any problems, or report them to me.
To build Mesa with the GDI driver, build the mesa, gdi, and glu
projects in the Visual Studio workspace found at
windows/VC8/mesa/mesa.sln
The osmesa DLL can also be built with the osmesa project.
The build system creates a lib top-level directory and copies
resulting LIB and DLL files to this lib directory. The files are:
OPENGL32.LIB, GLU32.LIB, OSMESA32.LIB
OPENGL32.DLL, GLU32.DLL, OSMESA32.DLL
If the MesaDemos ZIP file was extracted, the DLL files are also copied
to the demos directory. This facilitates running the demos as described
below.
GLUT and Demos
---- --- -----
A Visual Studio workspace can be found at
windows/VC8/progs/progs.sln
It can be used to build GLUT and a few demos. The GLUT lib and DLL
are copied to the top-level lib directory, along with the Mesa libs.
The demo build system expects to find the LIB files in the top level
lib directory, so you must build the Mesa libs first. The demo
executables are placed in the demos directory, because some of them
rely on data files found there. Also, the Mesa lib DLL's were copied
there by the Mesa lib build process. Therefore, you should be able to
simply run the demo executables from the demo directory.
If you want to run the demos from the Visual Studio, you may have to
change the startup directory and explicitly state where the executables are.
You may also build all the demo programs by using a makefile. Go to
the progs/demos directory and make sure you have executed VCVARS32.BAT
or whatever setup script is appropriate for your compiler. Then,
nmake -f Makefile.win
should build all the demos.
Build System Notes
----- ------ -----
VC8
---
No notes.
General
-------
@@ -128,11 +47,5 @@ the linker import files associated with the DLL files.
The si-glu sources are used to build the GLU libs. This was done
mainly to get the better tessellator code.
To build "mangled" Mesa, add the preprocessor define USE_MGL_NAMESPACE
to the project settings. You will also need to edit src/mesa.def to
change all the gl* symbols to mgl*. Because this is easy to do with a
global replace operation in a text editor, no additional mangled
version of mesa.def is maintained or shipped.
If you have a Windows-related build problem or question, please post
to the mesa-dev or mesa-users list.

View File

@@ -82,7 +82,7 @@ Additions to the EGL 1.4 Specification:
Import a wl_buffer by calling eglCreateImageKHR with
wl_buffer as EGLClientBuffer, EGL_WAYLAND_BUFFER_WL as the target,
and an empty attribute_list.
NULL context and an empty attribute_list.
Issues

View File

@@ -29,12 +29,14 @@ directly dispatched to the drivers.</p>
the driver for your hardware. For example</p>
<pre>
$ ./configure --enable-gles2 --enable-openvg --enable-gallium-nouveau
$ ./configure --enable-gles1 --enable-gles2 \
--with-dri-drivers=... \
--with-gallium-drivers=...
</pre>
<p>The main library and OpenGL is enabled by default. The first option above
enables <a href="opengles.html">OpenGL ES 2.x</a>. The second option enables
<a href="openvg.html">OpenVG</a>.</p>
<p>The main library and OpenGL is enabled by default. The first two options
above enables <a href="opengles.html">OpenGL ES 1.x and 2.x</a>. The last two
options enables the listed classic and and Gallium drivers respectively.</p>
</li>
@@ -42,8 +44,8 @@ enables <a href="opengles.html">OpenGL ES 2.x</a>. The second option enables
</ol>
<p>In the given example, it will build and install <code>libEGL</code>,
<code>libGL</code>, <code>libGLESv1_CM</code>, <code>libGLESv2</code>,
<code>libOpenVG</code>, and one or more EGL drivers.</p>
<code>libGL</code>, <code>libGLESv1_CM</code>, <code>libGLESv2</code>, and one
or more EGL drivers.</p>
<h3>Configure Options</h3>
@@ -65,6 +67,12 @@ drivers will be installed to <code>${libdir}/egl</code>.</p>
</li>
<li><code>--enable-gallium-egl</code>
<p>Enable the optional <code>egl_gallium</code> driver.</p>
</li>
<li><code>--with-egl-platforms</code>
<p>List the platforms (window systems) to support. Its argument is a comma
@@ -88,15 +96,17 @@ internal library that supports multiple APIs.</p>
</li>
<li><code>--enable-openvg</code>
<li><code>--enable-shared-glapi</code>
<p>OpenVG must be explicitly enabled by this option.</p>
<p>By default, <code>libGL</code> has its own copy of <code>libglapi</code>.
This options makes <code>libGL</code> use the shared <code>libglapi</code>. This
is required if applications mix OpenGL and OpenGL ES.</p>
</li>
<li><code>--enable-gallium-egl</code>
<li><code>--enable-openvg</code>
<p>Explicitly enable or disable <code>egl_gallium</code>.</p>
<p>OpenVG must be explicitly enabled by this option.</p>
</li>
@@ -220,8 +230,7 @@ distribution.</p>
<p>Generally, <code>egl_dri2</code> is preferred over <code>egl_gallium</code>
when the system already has DRI drivers. As <code>egl_gallium</code> is loaded
before <code>egl_dri2</code> when both are available, <code>egl_gallium</code>
may either be disabled with <code>--disable-gallium-egl</code> or packaged
separately.</p>
is disabled by default.</p>
<h2>Developers</h2>
@@ -307,17 +316,5 @@ not be called with the sample display at the same time. If a driver has access
to an <code>EGLDisplay</code> without going through the EGL APIs, the driver
should as well lock the display before using it.
<h3>TODOs</h3>
<ul>
<li>Pass the conformance tests</li>
<li>Mixed use of OpenGL, OpenGL ES 1.1, and OpenGL ES 2.0 is supported. But
which one of <code>libGL.so</code>, <code>libGLESv1_CM.so</code>, and
<code>libGLESv2.so</code> should an application link to? Bad things may happen
when, say, an application is linked to <code>libGLESv2.so</code> and
<code>libcairo</code>, which is linked to <code>libGL.so</code> instead.</li>
</ul>
</body>
</html>

View File

@@ -274,7 +274,6 @@ For example, compiling and linking a GLUT application can be done with:
<p>
Please see the <a href="#scons">instructions on building with SCons</a>.
Alternatively see <a href="README.WIN32">README.WIN32</a> file.
</p>

View File

@@ -11,11 +11,18 @@
<H1>News</H1>
<h2>June 13, 2011</h2>
<p>
<a href="relnotes-7.10.3.html">Mesa 7.10.3</a> is released. This is a bug
fix release.
</p>
<h2>April 6, 2011</h2>
<p>
<a href="relnotes-7.10.2.html">Mesa 7.10.2</a> is released. This is a bug
fix release release.
fix release.
</p>
<h2>March 2, 2011</h2>

View File

@@ -34,27 +34,10 @@ EGL drivers for your hardware.</p>
<h2>Run the Demos</h2>
<p>There are some demos in <code>progs/egl/</code>. You can use them to test
your build. For example,</p>
<pre>
$ cd progs/egl/eglut
$ make
$ cd ../opengles1
$ make
$ ./torus_x11
</pre>
<p>There are some demos in <code>mesa/demos</code> repository.</p>
<h2>Developers</h2>
<h3>Internal Libraries</h3>
<table border="1" style="text-align: center;">
<tr><td>Library Name</td><td>Used By</td><td>Enabled</td><td>OpenGL</td><td>OpenGL ES 1.x</td><td>OpenGL ES 2.x</td></tr>
<tr><td><code>libmesa.a</td><td>Classic DRI drivers</td><td>y</td><td>y</td><td>--enable-gles1</td><td>--enable-gles2</td></tr>
<tr><td><code>libmesagallium.a</td><td>Gallium EGL and DRI drivers</td><td>y</td><td>y</td><td>--enable-gles1</td><td>--enable-gles2</td></tr>
</table>
<h3>Dispatch Table</h3>
<p>OpenGL ES has an additional indirection when dispatching fucntions</p>

View File

@@ -11,7 +11,7 @@
<H1>OpenVG State Tracker</H1>
<p>
The current version of the OpenVG state tracker implements OpenVG 1.0.
The current version of the OpenVG state tracker implements OpenVG 1.1.
</p>
<p>
More informations about OpenVG can be found at
@@ -26,9 +26,9 @@ Please refer to <a href="egl.html">Mesa EGL</a> for more information about EGL.
<h2>Building the library</h2>
<ol>
<li>Run <code>configure</code> with <code>--enable-openvg</code>. If you do
not need OpenGL, you can add <code>--disable-opengl</code> to save the
compilation time.</li>
<li>Run <code>configure</code> with <code>--enable-openvg</code> and
<code>--enable-gallium-egl</code>. If you do not need OpenGL, you can add
<code>--disable-opengl</code> to save the compilation time.</li>
<li>Build and install Mesa as usual.</li>
</ol>
@@ -36,7 +36,7 @@ compilation time.</li>
<h3>Sample build</h3>
A sample build looks as follows:
<pre>
$ ./configure --disable-opengl --enable-openvg
$ ./configure --disable-opengl --enable-openvg --enable-gallium-egl
$ make
$ make install
</pre>

31
docs/patents.txt Normal file
View File

@@ -0,0 +1,31 @@
ARB_texture_float:
Silicon Graphics, Inc. owns US Patent #6,650,327, issued November 18,
2003 [1].
SGI believes this patent contains necessary IP for graphics systems
implementing floating point rasterization and floating point
framebuffer capabilities described in ARB_texture_float extension, and
will discuss licensing on RAND terms, on an individual basis with
companies wishing to use this IP in the context of conformant OpenGL
implementations [2].
The source code to implement ARB_texture_float extension is included
and can be toggled on at compile time, for those who purchased a
license from SGI, or are in a country where the patent does not apply,
etc.
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.
You should contact a lawyer or SGI's legal department if you want to
enable this extension.
[1] http://www.google.com/patents/about?id=mIIOAAAAEBAJ&dq=6650327
[2] http://www.opengl.org/registry/specs/ARB/texture_float.txt

303
docs/relnotes-7.10.3.html Normal file
View File

@@ -0,0 +1,303 @@
<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.10.3 Release Notes / June 13, 2011</H1>
<p>
Mesa 7.10.3 is a bug fix release which fixes bugs found since the 7.10.2 release.
</p>
<p>
Mesa 7.10.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>
d77b02034c11d6c2a55c07f82367d780 MesaLib-7.10.3.tar.gz
8c38fe8266be8e1ed1d84076ba5a703b MesaLib-7.10.3.tar.bz2
614d063ecd170940d9ae7b355d365d59 MesaLib-7.10.3.zip
8768fd562ede7ed763d92b2d22232d7a MesaGLUT-7.10.3.tar.gz
1496415b89da9549f0f3b34d9622e2e2 MesaGLUT-7.10.3.tar.bz2
1f29d0e7398fd3bf9f36f5db02941198 MesaGLUT-7.10.3.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=29162">Bug 29162</a> - mesa/darwin is severly broken</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31590">Bug 31590</a> - Black space between colors on mole hill example</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32395">Bug 32395</a> - [glsl] Incorrect code generation for shadow2DProj() with bias</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32564">Bug 32564</a> - [llvmpipe] prog: Unknown command line argument '-disable-mmx'. Try: 'prog -help' with llvm-2.9svn</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32835">Bug 32835</a> - [glsl] recursive #define results in infinite stack recursion</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33303">Bug 33303</a> - [glsl] ir_constant_expression.cpp:72: virtual ir_constant* ir_expression::constant_expression_value(): Assertion `op[0]->type->base_type == op[1]->type->base_type' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33314">Bug 33314</a> - [glsl] ir_constant_expression.cpp:122: virtual ir_constant* ir_expression::constant_expression_value(): Assertion `op[0]->type->base_type == GLSL_TYPE_BOOL' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33512">Bug 33512</a> - [SNB] case ogles2conform/GL/gl_FragCoord/gl_FragCoord_xy_frag.test and gl_FragCoord_w_frag.test fail</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34280">Bug 34280</a> - r200 mesa-7.10 font distortion</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34321">Bug 34321</a> - The ARB_fragment_program subset of ARB_draw_buffers not implemented</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=35603">Bug 35603</a> - GLSL compiler freezes compiling shaders</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36173">Bug 36173</a> - struct renderbuffer's 'format' field never set when using FBO</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36238">Bug 36238</a> - Mesa release files don't contain scons control files</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36410">Bug 36410</a> - [SNB] Rendering errors in 3DMMES subtest taiji</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36527">Bug 36527</a> - [wine] Wolfenstein: Failed to translate rgb instruction.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36651">Bug 36651</a> - mesa requires bison and flex to build but configure does not check for them</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36738">Bug 36738</a> - Openarena crash with r300g, swrastg + llvm &gt; 2.8</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=37648">Bug 37648</a> - Logic error in mesa/main/teximage.c:texsubimage</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=37739">Bug 37739</a> - Color clear of FBO without color buffer crashes</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.10.2..mesa-7.10.3
</pre>
<p>Alan Hourihane (1):
<ul>
<li>Check for out of memory when creating fence</li>
</ul></p>
<p>Alex Buell (1):
<ul>
<li>configure: bump LIBDRM_REQUIRED to 2.4.24</li>
</ul></p>
<p>Alex Deucher (2):
<ul>
<li>r600c: add new pci ids</li>
<li>r600g: add new pci ids</li>
</ul></p>
<p>Brian Paul (19):
<ul>
<li>docs: add link to 7.10.2 release notes</li>
<li>scons: remove dangling reference to state_trackers/python/SConscript</li>
<li>Makefile: add missing Scons files</li>
<li>llvmpipe: document issue with LLVM 2.8 and earlier with AVX</li>
<li>docs: replace llvmpipe/README with docs/llvmpipe.html</li>
<li>glsl: add static qualifier to silence warning</li>
<li>glsl: add cast to silence signed/unsigned comparison warning</li>
<li>mesa: s/height/depth/ in texsubimage()</li>
<li>mesa: fix void pointer arithmetic warnings</li>
<li>mesa: add some missing GLAPIENTRY keywords</li>
<li>mesa: check that flex/bison are installed</li>
<li>st/mesa: fix incorrect texture level/face/slice accesses</li>
<li>draw: fix edge flag handling in clipper (for unfilled tris/quads/polygons)</li>
<li>vbo: check array indexes to prevent negative indexing</li>
<li>vbo: remove node-&gt;count &gt; 0 test in vbo_save_playback_vertex_list()</li>
<li>st/mesa: fix software accum buffer format bug</li>
<li>mesa: add include/c99/inttypes.h include/c99/stdbool.h include/c99/stdint.h files to tarballs</li>
<li>docs: 7.10.3 release notes skeleton file, links</li>
<li>mesa: bump version to 7.10.3</li>
</ul></p>
<p>Carl Worth (2):
<ul>
<li>glcpp: Simplify calling convention of parser's active_list functions</li>
<li>glcpp: Fix attempts to expand recursive macros infinitely (bug #32835).</li>
</ul></p>
<p>Dave Airlie (1):
<ul>
<li>st/mesa: fix compressed mipmap generation.</li>
</ul></p>
<p>Eric Anholt (19):
<ul>
<li>i965: Fix the VS thread limits for GT1, and clarify the WM limits on both.</li>
<li>glsl: Avoid cascading errors when looking for a scalar boolean and failing.</li>
<li>glsl: Semantically check the RHS of `&amp;&amp;' even when short-circuiting.</li>
<li>glsl: Semantically check the RHS of `||' even when short-circuiting.</li>
<li>glsl: When we've emitted a semantic error for ==, return a bool constant.</li>
<li>glsl: Perform type checking on "^^" operands.</li>
<li>intel: Use _mesa_base_tex_format for FBO texture attachments.</li>
<li>swrast: Don't assert against glReadPixels of GL_RED and GL_RG.</li>
<li>mesa: Add a gl_renderbuffer.RowStride field like textures have.</li>
<li>mesa: Add a function to set up the default renderbuffer accessors.</li>
<li>intel: Use Mesa core's renderbuffer accessors for depth.</li>
<li>mesa: Use _mesa_get_format_bytes to refactor out the RB get_pointer_*</li>
<li>mesa: Use _mesa_get_format_bytes to refactor out the RB get_row_*</li>
<li>mesa: Add renderbuffer accessors for R8/RG88/R16/RG1616.</li>
<li>swrast: Don't try to adjust_colors for &lt8bpc when handling R16, RG1616.</li>
<li>intel: Use mesa core's R8, RG88, R16, RG1616 RB accessors.</li>
<li>Revert "intel: Add spans code for the ARB_texture_rg support."</li>
<li>mesa: Add support for the ARB_fragment_program part of ARB_draw_buffers.</li>
<li>mesa: Add support for OPTION ATI_draw_buffers to ARB_fp.</li>
</ul></p>
<p>Hans de Goede (1):
<ul>
<li>texstore: fix regression stricter check for memcpy path for unorm88 and unorm1616</li>
</ul></p>
<p>Henri Verbeet (3):
<ul>
<li>mesa: Also update the color draw buffer if it's explicitly set to GL_NONE.</li>
<li>glx: Destroy dri2Hash on DRI2 display destruction.</li>
<li>glx: Only remove the glx_display from the list after it's destroyed.</li>
</ul></p>
<p>Ian Romanick (9):
<ul>
<li>docs: Add 7.10.2 md5sums</li>
<li>glsl: Fix off-by-one error setting max_array_access for non-constant indexing</li>
<li>ir_to_mesa: Handle shadow compare w/projection and LOD bias correctly</li>
<li>intel: Fix ROUND_DOWN_TO macro</li>
<li>glsl: Regenerate compiler and glcpp files from cherry picks</li>
<li>i965: Remove hint_gs_always and resulting dead code</li>
<li>mesa: Don't try to clear a NULL renderbuffer</li>
<li>mesa: Ignore blits to/from missing buffers</li>
<li>docs: Add list of bugs fixed in 7.10.3 release</li>
</ul></p>
<p>Jeremy Huddleston (18):
<ul>
<li>apple: Update GL specs</li>
<li>apple: Rename glcontextmodes.[ch] to glxconfig.[ch]</li>
<li>apple: Rename __GLcontextModes to struct glx_config</li>
<li>apple: Rename GLXcontext</li>
<li>apple: Re-add driContext and do_destroy</li>
<li>apple: Rename _gl_context_modes_find_visual to glx_config_find_visual</li>
<li>apple: Rename GLXcontext</li>
<li>apple: Change from XExtDisplayInfo to struct glx_display</li>
<li>apple: ifdef out come glapi-foo on darwin</li>
<li>glx: Dead code removal</li>
<li>apple: Build darwin using applegl rather than indirect</li>
<li>apple: Fix build failures in applegl_glx.c</li>
<li>darwin: Define GALLIUM_DRIVERS_DIRS in darwin config</li>
<li>apple: Package applegl source into MesaLib tarball</li>
<li>darwin: Set VG_LIB_{NAME,GLOB} to fix make install</li>
<li>darwin: Don't link against libGL when building libOSMesa</li>
<li>darwin: Fix VG_LIB_GLOB to also match the unversioned symlink</li>
<li>osmesa: Fix missing symbols when GLX_INDIRECT_RENDERING is defined.</li>
</ul></p>
<p>José Fonseca (13):
<ul>
<li>llvmpipe: Update readme.</li>
<li>mesa: GL_PROVOKING_VERTEX_EXT is a GLenum, not GLboolean.</li>
<li>mesa: Fix GetVertexAttrib* inside display lists.</li>
<li>draw: Fix draw_variant_output::format's type.</li>
<li>gallivm: Tell LLVM to not assume a 16-byte aligned stack on x86.</li>
<li>gallivm: Fix for dynamically linked LLVM 2.8 library.</li>
<li>st/wgl: Adjust the pbuffer invisible window size.</li>
<li>st/wgl: Fix debug output format specifiers of stw_framebuffer_get_size().</li>
<li>st/wgl: Prevent spurious framebuffer sizes when the window is minimized.</li>
<li>st/wgl: Cope with zero width/height windows.</li>
<li>st/wgl: Allow to create pbuffers bigger than the desktop.</li>
<li>st/wgl: Remove buggy assertion.</li>
<li>wgl: Don't hold on to user supplied HDC.</li>
</ul></p>
<p>Kenneth Graunke (10):
<ul>
<li>i965/fs: Switch W and 1/W in Sandybridge interpolation setup.</li>
<li>i965: Refactor Sandybridge implied move handling.</li>
<li>i965: Resolve implied moves in brw_dp_READ_4_vs_relative.</li>
<li>intel: Add IS_GT2 macro for recognizing Sandybridge GT2 systems.</li>
<li>i965: Allocate the whole URB to the VS and fix calculations for Gen6.</li>
<li>intel: Support glCopyTexImage() from ARGB8888 to XRGB8888.</li>
<li>glsl: Fix memory error when creating the supported version string.</li>
<li>glsl: Regenerate autogenerated file builtin_function.cpp.</li>
<li>i965: Rename various gen6 #defines to match the documentation.</li>
<li>i965: Never enable the GS on Gen6.</li>
</ul></p>
<p>Kostas Georgiou (1):
<ul>
<li>r600c/g: Add pci id for FirePro 2270</li>
</ul></p>
<p>Marek Olšák (18):
<ul>
<li>tgsi/ureg: bump the limit of immediates</li>
<li>st/mesa: fix changing internal format via RenderbufferStorage</li>
<li>st/mesa: GenerateMipmap should not be killed by conditional rendering</li>
<li>swrast: BlitFramebuffer should not be killed by conditional rendering</li>
<li>st/mesa: BlitFramebuffer should not be killed by conditional rendering</li>
<li>st/mesa: CopyTex(Sub)Image should not be killed by conditional rendering</li>
<li>st/mesa: conditional rendering should not kill texture decompression via blit</li>
<li>mesa: forbid UseProgram to be called inside Begin/End</li>
<li>mesa: UseShaderProgramEXT and Uniform* shouldn't be allowed inside Begin/End</li>
<li>mesa: queries of non-existent FBO attachments should return INVALID_OPERATION</li>
<li>r300g: fix draw_vbo splitting on r3xx-r4xx</li>
<li>r300g: fix texturing with non-3D textures and wrap R mode set to sample border</li>
<li>r300g: fix occlusion queries when depth test is disabled or zbuffer is missing</li>
<li>r300g: clear can be killed by render condition</li>
<li>st/mesa: remove asserts in st_texture_image_copy</li>
<li>mesa: fix up assertion in _mesa_source_buffer_exists</li>
<li>mesa: invalidate framebuffer if internal format of renderbuffer is changed</li>
<li>mesa: return after invalidating renderbuffer</li>
</ul></p>
<p>Matt Turner (1):
<ul>
<li>r300/compiler: align memory allocations to 8-bytes</li>
</ul></p>
<p>Tom Stellard (3):
<ul>
<li>r300/compiler: Fix incorrect presubtract conversion</li>
<li>r300/compiler: Fix dataflow analysis bug with ELSE blocks</li>
<li>r300/compiler: Limit instructions to 3 source selects</li>
</ul></p>
<p>Vinson Lee (1):
<ul>
<li>gallivm: Disable MMX-disabling code on llvm-2.9.</li>
</ul></p>
<p>Zou Nan hai (1):
<ul>
<li>i965: Align interleaved URB write length to 2</li>
</ul></p>
<p>pepp (1):
<ul>
<li>st/mesa: assign renderbuffer's format field when allocating storage</li>
</ul></p>
</body>
</html>

View File

@@ -10,7 +10,7 @@
<body bgcolor="#eeeeee">
<H1>Mesa 7.11 Release Notes / (release date TBD)</H1>
<H1>Mesa 7.11 Release Notes / July 31, 2011</H1>
<p>
Mesa 7.11 is a new development release.
@@ -36,28 +36,308 @@ tbd
<h2>New features</h2>
<ul>
<li>GL_ARB_ES2_compatibility (gallium drivers)
<li>GL_ARB_color_buffer_float (gallium drivers, i965)
<li>GL_ARB_draw_buffers_blend (gallium)
<li>GL_ARB_draw_instanced extension (gallium drivers, swrast)
<li>GL_ARB_instanced_arrays extension (gallium drivers)
<li>GL_ARB_texture_compression_rgtc (gallium r600, swrast)
<li>GL_ARB_draw_buffers_blend (gallium)
<li>GL_EXT_texture_sRGB_decode (gallium drivers, swrast, i965)
<li>GL_ARB_occlusion_query2 (gallium drivers, swrast)
<li>GL_ARB_robustness (all drivers)
<li>GL_ARB_sampler_objects (gallium drivers)
<li>GL_ARB_seamless_cube_map (gallium r600)
<li>GL_ARB_shader_texture_lod (gallium drivers, i965)
<li>GL_ARB_sync (gallium drivers only, intel support was in 7.6)
<li>GL_ARB_texture_compression_rgtc (gallium drivers, swrast, i965)
<li>GL_ARB_texture_float (gallium, i965)
<li>GL_EXT_packed_float (gallium r600)
<li>GL_EXT_texture_compression_latc (gallium drivers, swrast)
<li>GL_EXT_texture_compression_rgtc (gallium drivers, swrast, i965)
<li>GL_EXT_texture_filter_anisotropic (swrast)
<li>GL_EXT_texture_shared_exponent (gallium drivers, swrast)
<li>GL_EXT_texture_sRGB_decode (gallium drivers, swrast, i965)
<li>GL_EXT_texture_snorm (gallium drivers)
<li>GL_AMD_draw_buffers_blend (alias of the ARB variant)
<li>GL_AMD_seamless_cubemap_per_texture (gallium r600)
<li>GL_AMD_shader_stencil_export (alias of the ARB variant)
<li>GL_ATI_draw_buffers (all drivers)
<li>GL_ATI_texture_compression_3dc (gallium drivers, swrast)
<li>GL_ATI_texture_float (gallium, i965)
<li>GL_NV_conditional_render (i965)
<li>GL_NV_texture_barrier (gallium drivers)
<li>Enable 16-wide fragment shader execution in i965 driver. This should improve performance in many applications.
<li>Initial alpha-level support for Intel "Ivybridge" chipsets in the i965 driver.
</ul>
<h2>Bug fixes</h2>
<p>This list is likely incomplete. This list only includes bug fixes not
included in the previous release (7.10.3). Many of these are regressions that
did not exist in the 7.10 release series at all.</p>
<ul>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=25871">Bug 25871</a> - nearest neighbour samples wrong texel (precision/rounding problem)</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=29162">Bug 29162</a> - mesa/darwin is severly broken</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=30080">Bug 30080</a> - [i915] piglit nodepth-test fails</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=30217">Bug 30217</a> - Possible sources of memory leaks reported by valgrind</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=30266">Bug 30266</a> - Regression, segfault in libdrm_intel when calling glBitmap</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31561">Bug 31561</a> - [i915] intel_regions.c:289: intel_region_release: Assertion `region-&gt;map_refcount == 0' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31744">Bug 31744</a> - [GLSL] overriding built-in function impacts another shader</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32308">Bug 32308</a> - [llvmpipe] src/gallium/auxiliary/gallivm/lp_bld_init.c:319:gallivm_register_garbage_collector_callback: Assertion `NumCallbacks &lt; 32' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32309">Bug 32309</a> - [softpipe] SIGSEGV sp_state_derived.c:204</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32459">Bug 32459</a> - [softpipe] glean depthStencil regression</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32460">Bug 32460</a> - [softpipe] piglit texwrap 1D regression</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32534">Bug 32534</a> - [arrandale/sandybridge] Mesa swallowing GEM ioctl failures</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32560">Bug 32560</a> - To fix: 64-bit-portabilty-issue state_tracker/st_program.c:427</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32634">Bug 32634</a> - [r300g, bisected] Massive corruption in Unigine Sanctuary</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32768">Bug 32768</a> - VBO rendering using glDrawArrays causes program termination and "cs IB too big" message</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32804">Bug 32804</a> - [swrast] glean pixelFormats regression</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32814">Bug 32814</a> - Build error in osmesa.c due to change in _mesa_update_framebuffer_visual() signature</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32859">Bug 32859</a> - Mesa doesn't compile under NetBSD</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32912">Bug 32912</a> - [bisected, r300g] Unigine Sanctuary: r300_emit.c:902:r300_emit_vertex_arrays: Assertion `&amp;buf-&gt;b.b' failed with RADEON_HYPERZ=1</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32945">Bug 32945</a> - [RADEON:KMS:R300G] HiZ: Weird behavior with 3 pipes</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33046">Bug 33046</a> - [bisected]glean/pixelFormats and 3 oglc cases segfault</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33185">Bug 33185</a> - [RADEON:KMS:R300G] X crashes when kwin effects are turned on</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33215">Bug 33215</a> - [llvmpipe] piglit fbo-drawbuffers2-blend regression</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33247">Bug 33247</a> - [swrast] tnl/t_draw.c:471: _tnl_draw_prims: Assertion `prim[i].num_instances &gt; 0' failed</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33284">Bug 33284</a> - [llvmpipe] piglit fbo-drawbuffers-fragcolor fails</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33306">Bug 33306</a> - [glsl] GLSL integer division by zero crashes GLSL compiler</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33353">Bug 33353</a> - [softpipe] piglit fbo-srgb looks incorrect</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33360">Bug 33360</a> - inclusion of $(TALLOC_LIBS) in src/mesa/drivers/osmesa/Makefile causes a build failure</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33374">Bug 33374</a> - [bisect] FTBFS on commit 9767d3b5 (glapi: Fix OpenGL ES 1.1 and 2.0 interop)</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=33555">Bug 33555</a> - [softpipe] tgsi/tgsi_sse2.c:1527:emit_tex: Assertion `0' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33885">Bug 33885</a> - [glsl] GLSL compiler allows recursion</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33823">Bug 33823</a> - [glsl] ralloc.c:78: get_header: Assertion `info-&gt;canary == 0x5A1106' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33934">Bug 33934</a> - 3D blitting is orders of magnitude slower than equivalent 2D blitting.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33946">Bug 33946</a> - Crash: Mesa checks for invalid pointer, then uses it anyway.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34008">Bug 34008</a> - r600g: piglit failure (regression)</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34009">Bug 34009</a> - Automatic Mipmap Generation produces very blurry image.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34042">Bug 34042</a> - Surfaceless eglMakeCurrent() fails if the supplied EGLContext is not a dummy context</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34049">Bug 34049</a> - r600g: assertion failure (regression)</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34119">Bug 34119</a> - [glsl] piglit glsl-texcoord-array regression</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34323">Bug 34323</a> - [i915 GLSL gles2] gl_FragCoord.w not correct</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34346">Bug 34346</a> - src/glsl relies on $PWD which can be unset</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34378">Bug 34378</a> - st/mesa: 2a904fd6a0cb80eec6dec2bae07fd8778b04caf3 breaks sauerbraten</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34419">Bug 34419</a> - Kwin crashes screensaver exits</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34463">Bug 34463</a> - state_tracker/st_texture.c:370:st_texture_image_copy: Assertion `u_minify(src-&gt;width0, srcLevel) == width' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34468">Bug 34468</a> - src/glsl/Makefile fix</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34541">Bug 34541</a> - [ilk, wine] massive render corruption after recent patchset</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34589">Bug 34589</a> - [pineview bisected]many cases regression</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34595">Bug 34595</a> - [bisected piketon]oglc half_float_vertex(misc.fillmode.wireframe) regressed</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34597">Bug 34597</a> - [bisected piketon]oglc blend-constcolor and 7 draw-buffers2 subcases regressed</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34603">Bug 34603</a> - [bisected piketon]oglc vbo subcase basic.bufferdata regressed</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34604">Bug 34604</a> - [bisected piketon]piglit fbo/fbo-depth-sample-compare regressed</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34646">Bug 34646</a> - [bisected piketon]ogles2conform GL2Tests/GL/gl_FragCoord/gl_FragCoord_w_frag.test</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34656">Bug 34656</a> - i965: Crash when running WebGL Conformance Test in firefox-4 nightly build</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34691">Bug 34691</a> - [GLSL] matrix array member assignment with a complex subscript fails</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34906">Bug 34906</a> - [Pineview] Some WebGL conformance tests will crash firefox</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34968">Bug 34968</a> - Bad fps in Lightsmark benchmark</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=35025">Bug 35025</a> - [Patch] Serious compiler warnings</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=35312">Bug 35312</a> - r600g: Automatic mipmap generation doesn't work properly</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=35373">Bug 35373</a> - [[GM45] OpenGL] GL_EXT_texture_sRGB_decode broken</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=35434">Bug 35434</a> - [RADEON:KMS:R600G] etqw: broken ground textures</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=35441">Bug 35441</a> - [PATCH] Mesa does not find nouveau include files with --enable-shared-dricore</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=35614">Bug 35614</a> - [SNB] random hang on piglit case shaders/glsl-max-varyings</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=35820">Bug 35820</a> - [bisected SNB] System hangs when Gnome with compiz start up</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=35822">Bug 35822</a> - [bisected pineview] many cases related to depth and stencil failed</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=35849">Bug 35849</a> - when sampling textures from both fragment and vertex shaders the vertex texture has the incorrect texture bound</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=35852">Bug 35852</a> - [bisected pineview] oglc case pxconv-read failed</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=35961">Bug 35961</a> - src/gallium/auxiliary/util/u_draw.c:77:util_draw_max_index: Assertion `buffer_size - format_size &lt;= buffer_size' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36032">Bug 36032</a> - piglit fdo9833 regression</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36033">Bug 36033</a> - main/shaderapi.c:1044: validate_samplers: Assertion `(sizeof(targetName)/sizeof(*(targetName))) == NUM_TEXTURE_TARGETS' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36086">Bug 36086</a> - [wine] Segfault r300_resource_copy_region with some wine apps and RADEON_HYPERZ</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36182">Bug 36182</a> - Game Trine from http://www.humblebundle.com/ needs ATI_draw_buffers</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36268">Bug 36268</a> - [r300g, bisected] minor flickering in Unigine Sanctuary</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36282">Bug 36282</a> - 34a5d3b9f4740601708c82093e2114356d749e65: glxgears segfaults when compiled with shared glapi</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36333">Bug 36333</a> - can't build demos if mesa build with --enable-selinux</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36473">Bug 36473</a> - [bisected] piglit bugs/fdo23670-depth_test failed</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36572">Bug 36572</a> - [bisected]oglc case texenv segfaults</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36609">Bug 36609</a> - 45920d2ecb38b14fdda5253fecce996570c22863 breaks sauerbraten on r300g</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36648">Bug 36648</a> - [bisected SNB]piglit fbo/fbo-alphatest-nocolor failed</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36649">Bug 36649</a> - [bisected SNB]oglc draw-buffers2 failed with 16-wide</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36753">Bug 36753</a> - Some textures now rendered as completely black after register allocator rewrite.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36821">Bug 36821</a> - [bisected SNB]oglc api-texcoord causes GPU hang</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36914">Bug 36914</a> - r600g: add rv670 flushing workaround. Causes games and some mesa demos to segfault.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36917">Bug 36917</a> - Rendering glitches in ETQW</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36939">Bug 36939</a> - multitexturing is messed up in quake wars (regression)</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36987">Bug 36987</a> - Intel GMA 4500 ARB_shader_texture_lod support</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=37028">Bug 37028</a> - Amnesia/HPL2 Demo: Strange graphical bugs on r600g</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=37150">Bug 37150</a> - sRGB textures are too bright in Starcraft 2</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=37154">Bug 37154</a> - main/texstore.c:4187: _mesa_texstore_rgb9_e5: Assertion `baseInternalFormat == 0x1907' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=37157">Bug 37157</a> - [bisected] KDE KWin crashes on start with delayed BO mapping</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=37168">Bug 37168</a> - Regression: Severe memory leak when running Second Life</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=37366">Bug 37366</a> - [i965 bisected ILK] Fragment shader discard tests occasionally fail</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=37383">Bug 37383</a> - incorrect GLSL optimization</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=37476">Bug 37476</a> - [wine] Devil May Cry 4: TXD tgsi opcode unsupported / translation from TGSI failed / missing vertex shader</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=37743">Bug 37743</a> - [bisected i965]oglc GLSLlinker subcase negative.varying.beyondMaxVaryingFloats aborted</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=37766">Bug 37766</a> - Crash in dri2InvalidateBuffers when resizing Java window with OpenGL pipeline enabled</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=37839">Bug 37839</a> - main/teximage.c:2393: _mesa_choose_texture_format: Assertion `f != MESA_FORMAT_NONE' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=37934">Bug 37934</a> - Corruption with topogun trace</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=38015">Bug 38015</a> - Some extensions enabled even when not supported by the underlying driver</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=38134">Bug 38134</a> - [bisected i965]piglit fbo/fbo-blit-d24s8 crashed</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=38145">Bug 38145</a> - r600g/evergreen: Incorrect rendering of some effects in doom3</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=38440">Bug 38440</a> - ETQW: Model in team select rendering too bright</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=38566">Bug 38566</a> - [regression] ETQW crashes with 21972c85ea734dbfcf69629c6b0b940efb42d4ba</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=38584">Bug 38584</a> - MESA_GLSL=dump causes SEGV in ir_print_visitor::unique_name</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=38599">Bug 38599</a> - THe value of WGL_PBUFFER_HEIGHT_ARB is returned as width in wglQueryPbufferARB</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=38602">Bug 38602</a> - [bisected] Wrong display after "prefer native texture formats when possible" commit</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=38624">Bug 38624</a> - program/ir_to_mesa.cpp:1440: virtual void ir_to_mesa_visitor::visit(ir_dereference_variable*): Assertion `var-&gt;location != -1' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=38626">Bug 38626</a> - vbo: Don't discount stride breaks piglit on softpipe/r600g</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=38649">Bug 38649</a> - piglit fbo-copyteximage regression</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=38762">Bug 38762</a> - [IVB bisected]3D demos like glxgears abort</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=38771">Bug 38771</a> - [[GM45] DRI] GPU hangs with current Mesa GIT when running certain OpenGL applications</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=38842">Bug 38842</a> - Various valid GLX attributes are rejected by MESA glxChooseFBConfig</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=38971">Bug 38971</a> - [bisected]oglc glsl-autointconv subcase negative.function.ambiguousMatch failed</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=38987">Bug 38987</a> - sampler allowed as non-uniform / non-function parameters</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=39024">Bug 39024</a> - [Pineview webgl] many webgl conformance cases crash the browser</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=39083">Bug 39083</a> - [regression, bisected, r600g] Wrong rendering of Bubbles3D screensaver</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=39119">Bug 39119</a> - setting SQ_LDS_RESOURCE_MGMT register to zero in other applications muddles up font rendering permanently</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=39209">Bug 39209</a> - [bisected] Wrong display after "prefer native texture formats when possible" commit - part2</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=39219">Bug 39219</a> - libgl conflict with xbmc causes lock up on xbmc exit</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=39257">Bug 39257</a> - [bisected SNB]Mesa demos engine causes GPU hang</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=39487">Bug 39487</a> - [i965] brw_wm_surface_state.c:495: brw_update_renderbuffer_surface: Assertion `brw-&gt>has_surface_tile_offset || (tile_x == 0 &amp;&amp; tile_y == 0)' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=39515">Bug 39515</a> - FTBFS: libEGL depends on libgbm, but libEGL builds first</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=39572">Bug 39572</a> - Cogs: GPU hang</li>
</ul>
<h2>Changes</h2>
<ul>
<li>The Windows MSVC project files have been removed. They haven't been maintained
in quite a while. Building with SCons is an alterantive.
<li>The Windows MSVC project files have been removed.
They haven't been maintained in quite a while.
Building with SCons is an alternative.
<li>Removed GL_SGI_texture_color_table support from swrast driver - the only
driver that implemented it.
</ul>
<p>The full set of changes can be viewed by using the following GIT command:</p>
<pre>
git log mesa-7.10..mesa-7.11
</pre>
</body>
</html>

View File

@@ -14,6 +14,7 @@ The release notes summarize what's new or changed in each Mesa release.
<UL>
<LI><A HREF="relnotes-7.11.html">7.11 release notes</A>
<LI><A HREF="relnotes-7.10.3.html">7.10.3 release notes</A>
<LI><A HREF="relnotes-7.10.2.html">7.10.2 release notes</A>
<LI><A HREF="relnotes-7.10.1.html">7.10.1 release notes</A>
<LI><A HREF="relnotes-7.10.html">7.10 release notes</A>

View File

@@ -131,6 +131,7 @@ typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYIMAGEKHRPROC) (EGLDisplay dpy, EGL
/* EGL_DRM_BUFFER_USE_MESA bits */
#define EGL_DRM_BUFFER_USE_SCANOUT_MESA 0x0001
#define EGL_DRM_BUFFER_USE_SHARE_MESA 0x0002
#define EGL_DRM_BUFFER_USE_CURSOR_MESA 0x0004
#define EGL_DRM_BUFFER_MESA 0x31D3 /* eglCreateImageKHR target */
#define EGL_DRM_BUFFER_STRIDE_MESA 0x31D4 /* eglCreateImageKHR attribute */
@@ -151,10 +152,9 @@ struct wl_display;
#ifdef EGL_EGLEXT_PROTOTYPES
EGLAPI EGLBoolean EGLAPIENTRY eglBindWaylandDisplayWL(EGLDisplay dpy, struct wl_display *display);
EGLAPI EGLBoolean EGLAPIENTRY eglUnbindWaylandDisplayWL(EGLDisplay dpy, struct wl_display *display);
#else
typedef EGLBoolean (EGLAPIENTRY PFNEGLBINDWAYLANDDISPLAYWL) (EGLDisplay dpy, struct wl_display *display);
typedef EGLBoolean (EGLAPIENTRY PFNEGLUNBINDWAYLANDDISPLAYWL) (EGLDisplay dpy, struct wl_display *display);
#endif
typedef EGLBoolean (EGLAPIENTRYP PFNEGLBINDWAYLANDDISPLAYWL) (EGLDisplay dpy, struct wl_display *display);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLUNBINDWAYLANDDISPLAYWL) (EGLDisplay dpy, struct wl_display *display);
#endif
#if KHRONOS_SUPPORT_INT64 /* EGLTimeKHR requires 64-bit uint support */

View File

@@ -80,10 +80,16 @@ typedef void *EGLNativePixmapType;
#elif defined(WL_EGL_PLATFORM)
typedef struct wl_egl_display *EGLNativeDisplayType;
typedef struct wl_display *EGLNativeDisplayType;
typedef struct wl_egl_pixmap *EGLNativePixmapType;
typedef struct wl_egl_window *EGLNativeWindowType;
#elif defined(__GBM__)
typedef struct gbm_device *EGLNativeDisplayType;
typedef struct gbm_bo *EGLNativePixmapType;
typedef void *EGLNativeWindowType;
#elif defined(__unix__) || defined(__unix)
#ifdef MESA_EGL_NO_X11_HEADERS

View File

@@ -6,7 +6,7 @@ extern "C" {
#endif
/*
** Copyright (c) 2007-2010 The Khronos Group Inc.
** Copyright (c) 2007-2011 The Khronos Group Inc.
**
** Permission is hereby granted, free of charge, to any person obtaining a
** copy of this software and/or associated documentation files (the
@@ -29,9 +29,9 @@ extern "C" {
*/
/* Header file version number, required by OpenGL ABI for Linux */
/* glext.h last updated $Date: 2010-12-09 02:15:08 -0800 (Thu, 09 Dec 2010) $ */
/* glext.h last updated $Date: 2011-07-06 02:49:14 -0700 (Wed, 06 Jul 2011) $ */
/* Current version at http://www.opengl.org/registry/ */
#define GL_GLEXT_VERSION 67
#define GL_GLEXT_VERSION 71
/* Function declaration macros - to move into glplatform.h */
#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__)
@@ -5032,6 +5032,32 @@ extern "C" {
#define GL_SKIP_DECODE_EXT 0x8A4A
#endif
#ifndef GL_NV_texture_multisample
#define GL_TEXTURE_COVERAGE_SAMPLES_NV 0x9045
#define GL_TEXTURE_COLOR_SAMPLES_NV 0x9046
#endif
#ifndef GL_AMD_blend_minmax_factor
#define GL_FACTOR_MIN_AMD 0x901C
#define GL_FACTOR_MAX_AMD 0x901D
#endif
#ifndef GL_AMD_sample_positions
#define GL_SUBSAMPLE_DISTANCE_AMD 0x883F
#endif
#ifndef GL_EXT_x11_sync_object
#define GL_SYNC_X11_FENCE_EXT 0x90E1
#endif
#ifndef GL_AMD_multi_draw_indirect
#endif
#ifndef GL_EXT_framebuffer_multisample_blit_scaled
#define GL_SCALED_RESOLVE_FASTEST_EXT 0x90BA
#define GL_SCALED_RESOLVE_NICEST_EXT 0x90BB
#endif
/*************************************************************/
@@ -11041,6 +11067,58 @@ typedef void (APIENTRYP PFNGLVDPAUUNMAPSURFACESNVPROC) (GLsizei numSurface, cons
#define GL_EXT_texture_sRGB_decode 1
#endif
#ifndef GL_NV_texture_multisample
#define GL_NV_texture_multisample 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glTexImage2DMultisampleCoverageNV (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations);
GLAPI void APIENTRY glTexImage3DMultisampleCoverageNV (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations);
GLAPI void APIENTRY glTextureImage2DMultisampleNV (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations);
GLAPI void APIENTRY glTextureImage3DMultisampleNV (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations);
GLAPI void APIENTRY glTextureImage2DMultisampleCoverageNV (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations);
GLAPI void APIENTRY glTextureImage3DMultisampleCoverageNV (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations);
typedef void (APIENTRYP PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations);
typedef void (APIENTRYP PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC) (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations);
typedef void (APIENTRYP PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC) (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations);
typedef void (APIENTRYP PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC) (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations);
typedef void (APIENTRYP PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC) (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations);
#endif
#ifndef GL_AMD_blend_minmax_factor
#define GL_AMD_blend_minmax_factor 1
#endif
#ifndef GL_AMD_sample_positions
#define GL_AMD_sample_positions 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glSetMultisamplefvAMD (GLenum pname, GLuint index, const GLfloat *val);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLSETMULTISAMPLEFVAMDPROC) (GLenum pname, GLuint index, const GLfloat *val);
#endif
#ifndef GL_EXT_x11_sync_object
#define GL_EXT_x11_sync_object 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI GLsync APIENTRY glImportSyncEXT (GLenum external_sync_type, GLintptr external_sync, GLbitfield flags);
#endif /* GL_GLEXT_PROTOTYPES */
typedef GLsync (APIENTRYP PFNGLIMPORTSYNCEXTPROC) (GLenum external_sync_type, GLintptr external_sync, GLbitfield flags);
#endif
#ifndef GL_AMD_multi_draw_indirect
#define GL_AMD_multi_draw_indirect 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glMultiDrawArraysIndirectAMD (GLenum mode, const GLvoid *indirect, GLsizei primcount, GLsizei stride);
GLAPI void APIENTRY glMultiDrawElementsIndirectAMD (GLenum mode, GLenum type, const GLvoid *indirect, GLsizei primcount, GLsizei stride);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC) (GLenum mode, const GLvoid *indirect, GLsizei primcount, GLsizei stride);
typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC) (GLenum mode, GLenum type, const GLvoid *indirect, GLsizei primcount, GLsizei stride);
#endif
#ifndef GL_EXT_framebuffer_multisample_blit_scaled
#define GL_EXT_framebuffer_multisample_blit_scaled 1
#endif
#ifdef __cplusplus
}

View File

@@ -284,7 +284,7 @@ typedef GLUtesselator GLUtriangulatorObj;
#define GLU_TESS_MAX_COORD 1.0e150
/* Internal convenience typedefs */
typedef void (GLAPIENTRYP _GLUfuncptr)();
typedef void (GLAPIENTRYP _GLUfuncptr)(void);
GLAPI void GLAPIENTRY gluBeginCurve (GLUnurbs* nurb);
GLAPI void GLAPIENTRY gluBeginPolygon (GLUtesselator* tess);

View File

@@ -692,6 +692,7 @@ struct __DRIswrastExtensionRec {
#define __DRI_BUFFER_FAKE_FRONT_LEFT 7
#define __DRI_BUFFER_FAKE_FRONT_RIGHT 8
#define __DRI_BUFFER_DEPTH_STENCIL 9 /**< Only available with DRI2 1.1 */
#define __DRI_BUFFER_HIZ 10
struct __DRIbufferRec {
unsigned int attachment;
@@ -816,6 +817,7 @@ struct __DRIdri2ExtensionRec {
#define __DRI_IMAGE_USE_SHARE 0x0001
#define __DRI_IMAGE_USE_SCANOUT 0x0002
#define __DRI_IMAGE_USE_CURSOR 0x0004
/**
* queryImage attributes
@@ -847,6 +849,11 @@ struct __DRIimageExtensionRec {
void *loaderPrivate);
GLboolean (*queryImage)(__DRIimage *image, int attrib, int *value);
/**
* The new __DRIimage will share the content with the old one, see dup(2).
*/
__DRIimage *(*dupImage)(__DRIimage *image, void *loaderPrivate);
};

View File

@@ -0,0 +1,4 @@
CHIPSET(0x7121, I810, i8xx)
CHIPSET(0x7123, I810_DC100, i8xx)
CHIPSET(0x7125, I810_E, i8xx)
CHIPSET(0x1132, I815, i8xx)

View File

@@ -0,0 +1,15 @@
CHIPSET(0x3577, I830_M, i8xx)
CHIPSET(0x2562, 845_G, i8xx)
CHIPSET(0x3582, I855_GM, i8xx)
CHIPSET(0x2572, I865_G, i8xx)
CHIPSET(0x2582, I915_G, i915)
CHIPSET(0x258A, E7221_G, i915)
CHIPSET(0x2592, I915_GM, i915)
CHIPSET(0x2772, I945_G, i945)
CHIPSET(0x27A2, I945_GM, i945)
CHIPSET(0x27AE, I945_GME, i945)
CHIPSET(0x29B2, Q35_G, i945)
CHIPSET(0x29C2, G33_G, i945)
CHIPSET(0x29D2, Q33_G, i945)
CHIPSET(0xA011, IGD_GM, i945)
CHIPSET(0xA001, IGD_G, i945)

View File

@@ -0,0 +1,27 @@
CHIPSET(0x29A2, I965_G, i965)
CHIPSET(0x2992, I965_Q, i965)
CHIPSET(0x2982, I965_G_1, i965)
CHIPSET(0x2972, I946_GZ, i965)
CHIPSET(0x2A02, I965_GM, i965)
CHIPSET(0x2A12, I965_GME, i965)
CHIPSET(0x2A42, GM45_GM, g4x)
CHIPSET(0x2E02, IGD_E_G, g4x)
CHIPSET(0x2E12, Q45_G, g4x)
CHIPSET(0x2E22, G45_G, g4x)
CHIPSET(0x2E32, G41_G, g4x)
CHIPSET(0x2E42, B43_G, g4x)
CHIPSET(0x2E92, B43_G1, g4x)
CHIPSET(0x0042, ILD_G, ilk)
CHIPSET(0x0046, ILM_G, ilk)
CHIPSET(0x0102, SANDYBRIDGE_GT1, snb_gt1)
CHIPSET(0x0112, SANDYBRIDGE_GT2, snb_gt2)
CHIPSET(0x0122, SANDYBRIDGE_GT2_PLUS, snb_gt2)
CHIPSET(0x0106, SANDYBRIDGE_M_GT1, snb_gt1)
CHIPSET(0x0116, SANDYBRIDGE_M_GT2, snb_gt2)
CHIPSET(0x0126, SANDYBRIDGE_M_GT2_PLUS, snb_gt2)
CHIPSET(0x010A, SANDYBRIDGE_S, snb_gt1)
CHIPSET(0x0152, IVYBRIDGE_GT1, ivb_gt1)
CHIPSET(0x0162, IVYBRIDGE_GT2, ivb_gt2)
CHIPSET(0x0156, IVYBRIDGE_M_GT1, ivb_gt1)
CHIPSET(0x0166, IVYBRIDGE_M_GT2, ivb_gt2)
CHIPSET(0x015a, IVYBRIDGE_S_GT1, ivb_gt1)

View File

@@ -0,0 +1,77 @@
#ifndef _PCI_ID_DRIVER_MAP_H_
#define _PCI_ID_DRIVER_MAP_H_
#include <stddef.h>
#ifndef ARRAY_SIZE
#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
#endif
#if !defined(DRIVER_MAP_DRI2_ONLY) && !defined(DRIVER_MAP_GALLIUM_ONLY)
static const int i810_chip_ids[] = {
#define CHIPSET(chip, desc, misc) chip,
#include "pci_ids/i810_pci_ids.h"
#undef CHIPSET
};
#endif
static const int i915_chip_ids[] = {
#define CHIPSET(chip, desc, misc) chip,
#include "pci_ids/i915_pci_ids.h"
#undef CHIPSET
};
static const int i965_chip_ids[] = {
#define CHIPSET(chip, desc, misc) chip,
#include "pci_ids/i965_pci_ids.h"
#undef CHIPSET
};
#ifndef DRIVER_MAP_GALLIUM_ONLY
static const int r100_chip_ids[] = {
#define CHIPSET(chip, name, family) chip,
#include "pci_ids/radeon_pci_ids.h"
#undef CHIPSET
};
static const int r200_chip_ids[] = {
#define CHIPSET(chip, name, family) chip,
#include "pci_ids/r200_pci_ids.h"
#undef CHIPSET
};
#endif
static const int r300_chip_ids[] = {
#define CHIPSET(chip, name, family) chip,
#include "pci_ids/r300_pci_ids.h"
#undef CHIPSET
};
static const int r600_chip_ids[] = {
#define CHIPSET(chip, name, family) chip,
#include "pci_ids/r600_pci_ids.h"
#undef CHIPSET
};
static const struct {
int vendor_id;
const char *driver;
const int *chip_ids;
int num_chips_ids;
} driver_map[] = {
#if !defined(DRIVER_MAP_DRI2_ONLY) && !defined(DRIVER_MAP_GALLIUM_ONLY)
{ 0x8086, "i810", i810_chip_ids, ARRAY_SIZE(i810_chip_ids) },
#endif
{ 0x8086, "i915", i915_chip_ids, ARRAY_SIZE(i915_chip_ids) },
{ 0x8086, "i965", i965_chip_ids, ARRAY_SIZE(i965_chip_ids) },
#ifndef DRIVER_MAP_GALLIUM_ONLY
{ 0x1002, "radeon", r100_chip_ids, ARRAY_SIZE(r100_chip_ids) },
{ 0x1002, "r200", r200_chip_ids, ARRAY_SIZE(r200_chip_ids) },
#endif
{ 0x1002, "r300", r300_chip_ids, ARRAY_SIZE(r300_chip_ids) },
{ 0x1002, "r600", r600_chip_ids, ARRAY_SIZE(r600_chip_ids) },
{ 0x10de, "nouveau", NULL, -1 },
{ 0x0000, NULL, NULL, 0 },
};
#endif /* _PCI_ID_DRIVER_MAP_H_ */

View File

@@ -0,0 +1,22 @@
CHIPSET(0x5148, R200_QH, R200)
CHIPSET(0x514C, R200_QL, R200)
CHIPSET(0x514D, R200_QM, R200)
CHIPSET(0x4242, R200_BB, R200)
CHIPSET(0x4966, RV250_If, RV250)
CHIPSET(0x4967, RV250_Ig, RV250)
CHIPSET(0x4C64, RV250_Ld, RV250)
CHIPSET(0x4C66, RV250_Lf, RV250)
CHIPSET(0x4C67, RV250_Lg, RV250)
CHIPSET(0x5960, RV280_5960, RV280)
CHIPSET(0x5961, RV280_5961, RV280)
CHIPSET(0x5962, RV280_5962, RV280)
CHIPSET(0x5964, RV280_5964, RV280)
CHIPSET(0x5965, RV280_5965, RV280)
CHIPSET(0x5C61, RV280_5C61, RV280)
CHIPSET(0x5C63, RV280_5C63, RV280)
CHIPSET(0x5834, RS300_5834, RS300)
CHIPSET(0x5835, RS300_5835, RS300)
CHIPSET(0x7834, RS350_7834, RS300)
CHIPSET(0x7835, RS350_7835, RS300)

View File

@@ -0,0 +1,226 @@
CHIPSET(0x4144, R300_AD, R300)
CHIPSET(0x4145, R300_AE, R300)
CHIPSET(0x4146, R300_AF, R300)
CHIPSET(0x4147, R300_AG, R300)
CHIPSET(0x4E44, R300_ND, R300)
CHIPSET(0x4E45, R300_NE, R300)
CHIPSET(0x4E46, R300_NF, R300)
CHIPSET(0x4E47, R300_NG, R300)
CHIPSET(0x4E48, R350_NH, R350)
CHIPSET(0x4E49, R350_NI, R350)
CHIPSET(0x4E4B, R350_NK, R350)
CHIPSET(0x4148, R350_AH, R350)
CHIPSET(0x4149, R350_AI, R350)
CHIPSET(0x414A, R350_AJ, R350)
CHIPSET(0x414B, R350_AK, R350)
CHIPSET(0x4E4A, R360_NJ, R350)
CHIPSET(0x4150, RV350_AP, RV350)
CHIPSET(0x4151, RV350_AQ, RV350)
CHIPSET(0x4152, RV350_AR, RV350)
CHIPSET(0x4153, RV350_AS, RV350)
CHIPSET(0x4154, RV350_AT, RV350)
CHIPSET(0x4155, RV350_AU, RV350)
CHIPSET(0x4156, RV350_AV, RV350)
CHIPSET(0x4E50, RV350_NP, RV350)
CHIPSET(0x4E51, RV350_NQ, RV350)
CHIPSET(0x4E52, RV350_NR, RV350)
CHIPSET(0x4E53, RV350_NS, RV350)
CHIPSET(0x4E54, RV350_NT, RV350)
CHIPSET(0x4E56, RV350_NV, RV350)
CHIPSET(0x5460, RV370_5460, RV370)
CHIPSET(0x5462, RV370_5462, RV370)
CHIPSET(0x5464, RV370_5464, RV370)
CHIPSET(0x5B60, RV370_5B60, RV370)
CHIPSET(0x5B62, RV370_5B62, RV370)
CHIPSET(0x5B63, RV370_5B63, RV370)
CHIPSET(0x5B64, RV370_5B64, RV370)
CHIPSET(0x5B65, RV370_5B65, RV370)
CHIPSET(0x3150, RV380_3150, RV380)
CHIPSET(0x3152, RV380_3152, RV380)
CHIPSET(0x3154, RV380_3154, RV380)
CHIPSET(0x3155, RV380_3155, RV380)
CHIPSET(0x3E50, RV380_3E50, RV380)
CHIPSET(0x3E54, RV380_3E54, RV380)
CHIPSET(0x4A48, R420_JH, R420)
CHIPSET(0x4A49, R420_JI, R420)
CHIPSET(0x4A4A, R420_JJ, R420)
CHIPSET(0x4A4B, R420_JK, R420)
CHIPSET(0x4A4C, R420_JL, R420)
CHIPSET(0x4A4D, R420_JM, R420)
CHIPSET(0x4A4E, R420_JN, R420)
CHIPSET(0x4A4F, R420_JO, R420)
CHIPSET(0x4A50, R420_JP, R420)
CHIPSET(0x4A54, R420_JT, R420)
CHIPSET(0x5548, R423_UH, R423)
CHIPSET(0x5549, R423_UI, R423)
CHIPSET(0x554A, R423_UJ, R423)
CHIPSET(0x554B, R423_UK, R423)
CHIPSET(0x5550, R423_5550, R423)
CHIPSET(0x5551, R423_UQ, R423)
CHIPSET(0x5552, R423_UR, R423)
CHIPSET(0x5554, R423_UT, R423)
CHIPSET(0x5D57, R423_5D57, R423)
CHIPSET(0x554C, R430_554C, R430)
CHIPSET(0x554D, R430_554D, R430)
CHIPSET(0x554E, R430_554E, R430)
CHIPSET(0x554F, R430_554F, R430)
CHIPSET(0x5D48, R430_5D48, R430)
CHIPSET(0x5D49, R430_5D49, R430)
CHIPSET(0x5D4A, R430_5D4A, R430)
CHIPSET(0x5D4C, R480_5D4C, R480)
CHIPSET(0x5D4D, R480_5D4D, R480)
CHIPSET(0x5D4E, R480_5D4E, R480)
CHIPSET(0x5D4F, R480_5D4F, R480)
CHIPSET(0x5D50, R480_5D50, R480)
CHIPSET(0x5D52, R480_5D52, R480)
CHIPSET(0x4B48, R481_4B48, R481)
CHIPSET(0x4B49, R481_4B49, R481)
CHIPSET(0x4B4A, R481_4B4A, R481)
CHIPSET(0x4B4B, R481_4B4B, R481)
CHIPSET(0x4B4C, R481_4B4C, R481)
CHIPSET(0x564A, RV410_564A, RV410)
CHIPSET(0x564B, RV410_564B, RV410)
CHIPSET(0x564F, RV410_564F, RV410)
CHIPSET(0x5652, RV410_5652, RV410)
CHIPSET(0x5653, RV410_5653, RV410)
CHIPSET(0x5657, RV410_5657, RV410)
CHIPSET(0x5E48, RV410_5E48, RV410)
CHIPSET(0x5E4A, RV410_5E4A, RV410)
CHIPSET(0x5E4B, RV410_5E4B, RV410)
CHIPSET(0x5E4C, RV410_5E4C, RV410)
CHIPSET(0x5E4D, RV410_5E4D, RV410)
CHIPSET(0x5E4F, RV410_5E4F, RV410)
CHIPSET(0x5A41, RS400_5A41, RS400)
CHIPSET(0x5A42, RS400_5A42, RS400)
CHIPSET(0x5A61, RC410_5A61, RC410)
CHIPSET(0x5A62, RC410_5A62, RC410)
CHIPSET(0x5954, RS480_5954, RS480)
CHIPSET(0x5955, RS480_5955, RS480)
CHIPSET(0x5974, RS482_5974, RS480)
CHIPSET(0x5975, RS482_5975, RS480)
CHIPSET(0x7100, R520_7100, R520)
CHIPSET(0x7101, R520_7101, R520)
CHIPSET(0x7102, R520_7102, R520)
CHIPSET(0x7103, R520_7103, R520)
CHIPSET(0x7104, R520_7104, R520)
CHIPSET(0x7105, R520_7105, R520)
CHIPSET(0x7106, R520_7106, R520)
CHIPSET(0x7108, R520_7108, R520)
CHIPSET(0x7109, R520_7109, R520)
CHIPSET(0x710A, R520_710A, R520)
CHIPSET(0x710B, R520_710B, R520)
CHIPSET(0x710C, R520_710C, R520)
CHIPSET(0x710E, R520_710E, R520)
CHIPSET(0x710F, R520_710F, R520)
CHIPSET(0x7140, RV515_7140, RV515)
CHIPSET(0x7141, RV515_7141, RV515)
CHIPSET(0x7142, RV515_7142, RV515)
CHIPSET(0x7143, RV515_7143, RV515)
CHIPSET(0x7144, RV515_7144, RV515)
CHIPSET(0x7145, RV515_7145, RV515)
CHIPSET(0x7146, RV515_7146, RV515)
CHIPSET(0x7147, RV515_7147, RV515)
CHIPSET(0x7149, RV515_7149, RV515)
CHIPSET(0x714A, RV515_714A, RV515)
CHIPSET(0x714B, RV515_714B, RV515)
CHIPSET(0x714C, RV515_714C, RV515)
CHIPSET(0x714D, RV515_714D, RV515)
CHIPSET(0x714E, RV515_714E, RV515)
CHIPSET(0x714F, RV515_714F, RV515)
CHIPSET(0x7151, RV515_7151, RV515)
CHIPSET(0x7152, RV515_7152, RV515)
CHIPSET(0x7153, RV515_7153, RV515)
CHIPSET(0x715E, RV515_715E, RV515)
CHIPSET(0x715F, RV515_715F, RV515)
CHIPSET(0x7180, RV515_7180, RV515)
CHIPSET(0x7181, RV515_7181, RV515)
CHIPSET(0x7183, RV515_7183, RV515)
CHIPSET(0x7186, RV515_7186, RV515)
CHIPSET(0x7187, RV515_7187, RV515)
CHIPSET(0x7188, RV515_7188, RV515)
CHIPSET(0x718A, RV515_718A, RV515)
CHIPSET(0x718B, RV515_718B, RV515)
CHIPSET(0x718C, RV515_718C, RV515)
CHIPSET(0x718D, RV515_718D, RV515)
CHIPSET(0x718F, RV515_718F, RV515)
CHIPSET(0x7193, RV515_7193, RV515)
CHIPSET(0x7196, RV515_7196, RV515)
CHIPSET(0x719B, RV515_719B, RV515)
CHIPSET(0x719F, RV515_719F, RV515)
CHIPSET(0x7200, RV515_7200, RV515)
CHIPSET(0x7210, RV515_7210, RV515)
CHIPSET(0x7211, RV515_7211, RV515)
CHIPSET(0x71C0, RV530_71C0, RV530)
CHIPSET(0x71C1, RV530_71C1, RV530)
CHIPSET(0x71C2, RV530_71C2, RV530)
CHIPSET(0x71C3, RV530_71C3, RV530)
CHIPSET(0x71C4, RV530_71C4, RV530)
CHIPSET(0x71C5, RV530_71C5, RV530)
CHIPSET(0x71C6, RV530_71C6, RV530)
CHIPSET(0x71C7, RV530_71C7, RV530)
CHIPSET(0x71CD, RV530_71CD, RV530)
CHIPSET(0x71CE, RV530_71CE, RV530)
CHIPSET(0x71D2, RV530_71D2, RV530)
CHIPSET(0x71D4, RV530_71D4, RV530)
CHIPSET(0x71D5, RV530_71D5, RV530)
CHIPSET(0x71D6, RV530_71D6, RV530)
CHIPSET(0x71DA, RV530_71DA, RV530)
CHIPSET(0x71DE, RV530_71DE, RV530)
CHIPSET(0x7281, RV560_7281, RV560)
CHIPSET(0x7283, RV560_7283, RV560)
CHIPSET(0x7287, RV560_7287, RV560)
CHIPSET(0x7290, RV560_7290, RV560)
CHIPSET(0x7291, RV560_7291, RV560)
CHIPSET(0x7293, RV560_7293, RV560)
CHIPSET(0x7297, RV560_7297, RV560)
CHIPSET(0x7280, RV570_7280, RV570)
CHIPSET(0x7288, RV570_7288, RV570)
CHIPSET(0x7289, RV570_7289, RV570)
CHIPSET(0x728B, RV570_728B, RV570)
CHIPSET(0x728C, RV570_728C, RV570)
CHIPSET(0x7240, R580_7240, R580)
CHIPSET(0x7243, R580_7243, R580)
CHIPSET(0x7244, R580_7244, R580)
CHIPSET(0x7245, R580_7245, R580)
CHIPSET(0x7246, R580_7246, R580)
CHIPSET(0x7247, R580_7247, R580)
CHIPSET(0x7248, R580_7248, R580)
CHIPSET(0x7249, R580_7249, R580)
CHIPSET(0x724A, R580_724A, R580)
CHIPSET(0x724B, R580_724B, R580)
CHIPSET(0x724C, R580_724C, R580)
CHIPSET(0x724D, R580_724D, R580)
CHIPSET(0x724E, R580_724E, R580)
CHIPSET(0x724F, R580_724F, R580)
CHIPSET(0x7284, R580_7284, R580)
CHIPSET(0x793F, RS600_793F, RS600)
CHIPSET(0x7941, RS600_7941, RS600)
CHIPSET(0x7942, RS600_7942, RS600)
CHIPSET(0x791E, RS690_791E, RS690)
CHIPSET(0x791F, RS690_791F, RS690)
CHIPSET(0x796C, RS740_796C, RS740)
CHIPSET(0x796D, RS740_796D, RS740)
CHIPSET(0x796E, RS740_796E, RS740)
CHIPSET(0x796F, RS740_796F, RS740)

View File

@@ -0,0 +1,265 @@
CHIPSET(0x9400, R600_9400, R600)
CHIPSET(0x9401, R600_9401, R600)
CHIPSET(0x9402, R600_9402, R600)
CHIPSET(0x9403, R600_9403, R600)
CHIPSET(0x9405, R600_9405, R600)
CHIPSET(0x940A, R600_940A, R600)
CHIPSET(0x940B, R600_940B, R600)
CHIPSET(0x940F, R600_940F, R600)
CHIPSET(0x94C0, RV610_94C0, RV610)
CHIPSET(0x94C1, RV610_94C1, RV610)
CHIPSET(0x94C3, RV610_94C3, RV610)
CHIPSET(0x94C4, RV610_94C4, RV610)
CHIPSET(0x94C5, RV610_94C5, RV610)
CHIPSET(0x94C6, RV610_94C6, RV610)
CHIPSET(0x94C7, RV610_94C7, RV610)
CHIPSET(0x94C8, RV610_94C8, RV610)
CHIPSET(0x94C9, RV610_94C9, RV610)
CHIPSET(0x94CB, RV610_94CB, RV610)
CHIPSET(0x94CC, RV610_94CC, RV610)
CHIPSET(0x94CD, RV610_94CD, RV610)
CHIPSET(0x9580, RV630_9580, RV630)
CHIPSET(0x9581, RV630_9581, RV630)
CHIPSET(0x9583, RV630_9583, RV630)
CHIPSET(0x9586, RV630_9586, RV630)
CHIPSET(0x9587, RV630_9587, RV630)
CHIPSET(0x9588, RV630_9588, RV630)
CHIPSET(0x9589, RV630_9589, RV630)
CHIPSET(0x958A, RV630_958A, RV630)
CHIPSET(0x958B, RV630_958B, RV630)
CHIPSET(0x958C, RV630_958C, RV630)
CHIPSET(0x958D, RV630_958D, RV630)
CHIPSET(0x958E, RV630_958E, RV630)
CHIPSET(0x958F, RV630_958F, RV630)
CHIPSET(0x9500, RV670_9500, RV670)
CHIPSET(0x9501, RV670_9501, RV670)
CHIPSET(0x9504, RV670_9504, RV670)
CHIPSET(0x9505, RV670_9505, RV670)
CHIPSET(0x9506, RV670_9506, RV670)
CHIPSET(0x9507, RV670_9507, RV670)
CHIPSET(0x9508, RV670_9508, RV670)
CHIPSET(0x9509, RV670_9509, RV670)
CHIPSET(0x950F, RV670_950F, RV670)
CHIPSET(0x9511, RV670_9511, RV670)
CHIPSET(0x9515, RV670_9515, RV670)
CHIPSET(0x9517, RV670_9517, RV670)
CHIPSET(0x9519, RV670_9519, RV670)
CHIPSET(0x95C0, RV620_95C0, RV620)
CHIPSET(0x95C2, RV620_95C2, RV620)
CHIPSET(0x95C4, RV620_95C4, RV620)
CHIPSET(0x95C5, RV620_95C5, RV620)
CHIPSET(0x95C6, RV620_95C6, RV620)
CHIPSET(0x95C7, RV620_95C7, RV620)
CHIPSET(0x95C9, RV620_95C9, RV620)
CHIPSET(0x95CC, RV620_95CC, RV620)
CHIPSET(0x95CD, RV620_95CD, RV620)
CHIPSET(0x95CE, RV620_95CE, RV620)
CHIPSET(0x95CF, RV620_95CF, RV620)
CHIPSET(0x9590, RV635_9590, RV635)
CHIPSET(0x9591, RV635_9591, RV635)
CHIPSET(0x9593, RV635_9593, RV635)
CHIPSET(0x9595, RV635_9595, RV635)
CHIPSET(0x9596, RV635_9596, RV635)
CHIPSET(0x9597, RV635_9597, RV635)
CHIPSET(0x9598, RV635_9598, RV635)
CHIPSET(0x9599, RV635_9599, RV635)
CHIPSET(0x959B, RV635_959B, RV635)
CHIPSET(0x9610, RS780_9610, RS780)
CHIPSET(0x9611, RS780_9611, RS780)
CHIPSET(0x9612, RS780_9612, RS780)
CHIPSET(0x9613, RS780_9613, RS780)
CHIPSET(0x9614, RS780_9614, RS780)
CHIPSET(0x9615, RS780_9615, RS780)
CHIPSET(0x9616, RS780_9616, RS780)
CHIPSET(0x9710, RS880_9710, RS880)
CHIPSET(0x9711, RS880_9711, RS880)
CHIPSET(0x9712, RS880_9712, RS880)
CHIPSET(0x9713, RS880_9713, RS880)
CHIPSET(0x9714, RS880_9714, RS880)
CHIPSET(0x9715, RS880_9715, RS880)
CHIPSET(0x9440, RV770_9440, RV770)
CHIPSET(0x9441, RV770_9441, RV770)
CHIPSET(0x9442, RV770_9442, RV770)
CHIPSET(0x9443, RV770_9443, RV770)
CHIPSET(0x9444, RV770_9444, RV770)
CHIPSET(0x9446, RV770_9446, RV770)
CHIPSET(0x944A, RV770_944A, RV770)
CHIPSET(0x944B, RV770_944B, RV770)
CHIPSET(0x944C, RV770_944C, RV770)
CHIPSET(0x944E, RV770_944E, RV770)
CHIPSET(0x9450, RV770_9450, RV770)
CHIPSET(0x9452, RV770_9452, RV770)
CHIPSET(0x9456, RV770_9456, RV770)
CHIPSET(0x945A, RV770_945A, RV770)
CHIPSET(0x945B, RV770_945B, RV770)
CHIPSET(0x945E, RV770_945E, RV770)
CHIPSET(0x9460, RV790_9460, RV770)
CHIPSET(0x9462, RV790_9462, RV770)
CHIPSET(0x946A, RV770_946A, RV770)
CHIPSET(0x946B, RV770_946B, RV770)
CHIPSET(0x947A, RV770_947A, RV770)
CHIPSET(0x947B, RV770_947B, RV770)
CHIPSET(0x9480, RV730_9480, RV730)
CHIPSET(0x9487, RV730_9487, RV730)
CHIPSET(0x9488, RV730_9488, RV730)
CHIPSET(0x9489, RV730_9489, RV730)
CHIPSET(0x948A, RV730_948A, RV730)
CHIPSET(0x948F, RV730_948F, RV730)
CHIPSET(0x9490, RV730_9490, RV730)
CHIPSET(0x9491, RV730_9491, RV730)
CHIPSET(0x9495, RV730_9495, RV730)
CHIPSET(0x9498, RV730_9498, RV730)
CHIPSET(0x949C, RV730_949C, RV730)
CHIPSET(0x949E, RV730_949E, RV730)
CHIPSET(0x949F, RV730_949F, RV730)
CHIPSET(0x9540, RV710_9540, RV710)
CHIPSET(0x9541, RV710_9541, RV710)
CHIPSET(0x9542, RV710_9542, RV710)
CHIPSET(0x954E, RV710_954E, RV710)
CHIPSET(0x954F, RV710_954F, RV710)
CHIPSET(0x9552, RV710_9552, RV710)
CHIPSET(0x9553, RV710_9553, RV710)
CHIPSET(0x9555, RV710_9555, RV710)
CHIPSET(0x9557, RV710_9557, RV710)
CHIPSET(0x955F, RV710_955F, RV710)
CHIPSET(0x94A0, RV740_94A0, RV740)
CHIPSET(0x94A1, RV740_94A1, RV740)
CHIPSET(0x94A3, RV740_94A3, RV740)
CHIPSET(0x94B1, RV740_94B1, RV740)
CHIPSET(0x94B3, RV740_94B3, RV740)
CHIPSET(0x94B4, RV740_94B4, RV740)
CHIPSET(0x94B5, RV740_94B5, RV740)
CHIPSET(0x94B9, RV740_94B9, RV740)
CHIPSET(0x68E0, CEDAR_68E0, CEDAR)
CHIPSET(0x68E1, CEDAR_68E1, CEDAR)
CHIPSET(0x68E4, CEDAR_68E4, CEDAR)
CHIPSET(0x68E5, CEDAR_68E5, CEDAR)
CHIPSET(0x68E8, CEDAR_68E8, CEDAR)
CHIPSET(0x68E9, CEDAR_68E9, CEDAR)
CHIPSET(0x68F1, CEDAR_68F1, CEDAR)
CHIPSET(0x68F2, CEDAR_68F2, CEDAR)
CHIPSET(0x68F8, CEDAR_68F8, CEDAR)
CHIPSET(0x68F9, CEDAR_68F9, CEDAR)
CHIPSET(0x68FE, CEDAR_68FE, CEDAR)
CHIPSET(0x68C0, REDWOOD_68C0, REDWOOD)
CHIPSET(0x68C1, REDWOOD_68C1, REDWOOD)
CHIPSET(0x68C8, REDWOOD_68C8, REDWOOD)
CHIPSET(0x68C9, REDWOOD_68C9, REDWOOD)
CHIPSET(0x68D8, REDWOOD_68D8, REDWOOD)
CHIPSET(0x68D9, REDWOOD_68D9, REDWOOD)
CHIPSET(0x68DA, REDWOOD_68DA, REDWOOD)
CHIPSET(0x68DE, REDWOOD_68DE, REDWOOD)
CHIPSET(0x68A0, JUNIPER_68A0, JUNIPER)
CHIPSET(0x68A1, JUNIPER_68A1, JUNIPER)
CHIPSET(0x68A8, JUNIPER_68A8, JUNIPER)
CHIPSET(0x68A9, JUNIPER_68A9, JUNIPER)
CHIPSET(0x68B0, JUNIPER_68B0, JUNIPER)
CHIPSET(0x68B8, JUNIPER_68B8, JUNIPER)
CHIPSET(0x68B9, JUNIPER_68B9, JUNIPER)
CHIPSET(0x68BA, JUNIPER_68BA, JUNIPER)
CHIPSET(0x68BE, JUNIPER_68BE, JUNIPER)
CHIPSET(0x68BF, JUNIPER_68BF, JUNIPER)
CHIPSET(0x6880, CYPRESS_6880, CYPRESS)
CHIPSET(0x6888, CYPRESS_6888, CYPRESS)
CHIPSET(0x6889, CYPRESS_6889, CYPRESS)
CHIPSET(0x688A, CYPRESS_688A, CYPRESS)
CHIPSET(0x6898, CYPRESS_6898, CYPRESS)
CHIPSET(0x6899, CYPRESS_6899, CYPRESS)
CHIPSET(0x689B, CYPRESS_689B, CYPRESS)
CHIPSET(0x689E, CYPRESS_689E, CYPRESS)
CHIPSET(0x689C, HEMLOCK_689C, HEMLOCK)
CHIPSET(0x689D, HEMLOCK_689D, HEMLOCK)
CHIPSET(0x9802, PALM_9802, PALM)
CHIPSET(0x9803, PALM_9803, PALM)
CHIPSET(0x9804, PALM_9804, PALM)
CHIPSET(0x9805, PALM_9805, PALM)
CHIPSET(0x9806, PALM_9806, PALM)
CHIPSET(0x9807, PALM_9807, PALM)
CHIPSET(0x9640, SUMO_9640, SUMO)
CHIPSET(0x9641, SUMO_9641, SUMO)
CHIPSET(0x9642, SUMO2_9642, SUMO2)
CHIPSET(0x9643, SUMO2_9643, SUMO2)
CHIPSET(0x9644, SUMO2_9644, SUMO2)
CHIPSET(0x9645, SUMO2_9645, SUMO2)
CHIPSET(0x9647, SUMO_9647, SUMO)
CHIPSET(0x9648, SUMO_9648, SUMO)
CHIPSET(0x964a, SUMO_964A, SUMO)
CHIPSET(0x964e, SUMO_964E, SUMO)
CHIPSET(0x964f, SUMO_964F, SUMO)
#ifndef RADEON_CLASSIC
CHIPSET(0x6700, CAYMAN_6700, CAYMAN)
CHIPSET(0x6701, CAYMAN_6701, CAYMAN)
CHIPSET(0x6702, CAYMAN_6702, CAYMAN)
CHIPSET(0x6703, CAYMAN_6703, CAYMAN)
CHIPSET(0x6704, CAYMAN_6704, CAYMAN)
CHIPSET(0x6705, CAYMAN_6705, CAYMAN)
CHIPSET(0x6706, CAYMAN_6706, CAYMAN)
CHIPSET(0x6707, CAYMAN_6707, CAYMAN)
CHIPSET(0x6708, CAYMAN_6708, CAYMAN)
CHIPSET(0x6709, CAYMAN_6709, CAYMAN)
CHIPSET(0x6718, CAYMAN_6718, CAYMAN)
CHIPSET(0x6719, CAYMAN_6719, CAYMAN)
CHIPSET(0x671C, CAYMAN_671C, CAYMAN)
CHIPSET(0x671D, CAYMAN_671D, CAYMAN)
CHIPSET(0x671F, CAYMAN_671F, CAYMAN)
#endif
CHIPSET(0x6720, BARTS_6720, BARTS)
CHIPSET(0x6721, BARTS_6721, BARTS)
CHIPSET(0x6722, BARTS_6722, BARTS)
CHIPSET(0x6723, BARTS_6723, BARTS)
CHIPSET(0x6724, BARTS_6724, BARTS)
CHIPSET(0x6725, BARTS_6725, BARTS)
CHIPSET(0x6726, BARTS_6726, BARTS)
CHIPSET(0x6727, BARTS_6727, BARTS)
CHIPSET(0x6728, BARTS_6728, BARTS)
CHIPSET(0x6729, BARTS_6729, BARTS)
CHIPSET(0x6738, BARTS_6738, BARTS)
CHIPSET(0x6739, BARTS_6739, BARTS)
CHIPSET(0x673E, BARTS_673E, BARTS)
CHIPSET(0x6740, TURKS_6740, TURKS)
CHIPSET(0x6741, TURKS_6741, TURKS)
CHIPSET(0x6742, TURKS_6742, TURKS)
CHIPSET(0x6743, TURKS_6743, TURKS)
CHIPSET(0x6744, TURKS_6744, TURKS)
CHIPSET(0x6745, TURKS_6745, TURKS)
CHIPSET(0x6746, TURKS_6746, TURKS)
CHIPSET(0x6747, TURKS_6747, TURKS)
CHIPSET(0x6748, TURKS_6748, TURKS)
CHIPSET(0x6749, TURKS_6749, TURKS)
CHIPSET(0x6750, TURKS_6750, TURKS)
CHIPSET(0x6758, TURKS_6758, TURKS)
CHIPSET(0x6759, TURKS_6759, TURKS)
CHIPSET(0x675F, TURKS_675F, TURKS)
CHIPSET(0x6760, CAICOS_6760, CAICOS)
CHIPSET(0x6761, CAICOS_6761, CAICOS)
CHIPSET(0x6762, CAICOS_6762, CAICOS)
CHIPSET(0x6763, CAICOS_6763, CAICOS)
CHIPSET(0x6764, CAICOS_6764, CAICOS)
CHIPSET(0x6765, CAICOS_6765, CAICOS)
CHIPSET(0x6766, CAICOS_6766, CAICOS)
CHIPSET(0x6767, CAICOS_6767, CAICOS)
CHIPSET(0x6768, CAICOS_6768, CAICOS)
CHIPSET(0x6770, CAICOS_6770, CAICOS)
CHIPSET(0x6778, CAICOS_6778, CAICOS)
CHIPSET(0x6779, CAICOS_6779, CAICOS)

View File

@@ -0,0 +1,23 @@
CHIPSET(0x4C57, RADEON_LW, RV200)
CHIPSET(0x4C58, RADEON_LX, RV200)
CHIPSET(0x4C59, RADEON_LY, RV100)
CHIPSET(0x4C5A, RADEON_LZ, RV100)
CHIPSET(0x5144, RADEON_QD, R100)
CHIPSET(0x5145, RADEON_QE, R100)
CHIPSET(0x5146, RADEON_QF, R100)
CHIPSET(0x5147, RADEON_QG, R100)
CHIPSET(0x5159, RADEON_QY, RV100)
CHIPSET(0x515A, RADEON_QZ, RV100)
CHIPSET(0x5157, RV200_QW, RV200)
CHIPSET(0x5158, RV200_QX, RV200)
CHIPSET(0x515E, RN50_515E, UNKNOWN)
CHIPSET(0x5969, RN50_5969, UNKNOWN)
CHIPSET(0x4136, RS100_4136, RS100)
CHIPSET(0x4336, RS100_4336, RS100)
CHIPSET(0x4137, RS200_4137, RS200)
CHIPSET(0x4337, RS200_4337, RS200)
CHIPSET(0x4237, RS250_4237, RS200)
CHIPSET(0x4437, RS250_4437, RS200)

View File

@@ -59,6 +59,7 @@ def quietCommandLines(env):
env['LEXCOMSTR'] = " Generating $TARGET ..."
env['YACCCOMSTR'] = " Generating $TARGET ..."
env['CODEGENCOMSTR'] = " Generating $TARGET ..."
env['INSTALLSTR'] = " Installing $TARGET ..."
def createConvenienceLibBuilder(env):
@@ -156,7 +157,8 @@ def createCodeGenerateMethod(env):
def generate(env):
"""Common environment generation code"""
if env.get('quiet', True):
verbose = env.get('verbose', False) or not env.get('quiet', True)
if not verbose:
quietCommandLines(env)
# Custom builders and methods

View File

@@ -74,7 +74,7 @@ def install_shared_library(env, sources, version = ()):
while len(version):
version = version[:-1]
target_name = '.'.join((str(source),) + version)
action = SCons.Action.Action(symlink, "$TARGET -> $SOURCE")
action = SCons.Action.Action(symlink, " Symlinking $TARGET ...")
last = env.Command(os.path.join(target_dir, target_name), last, action)
targets += last
return targets
@@ -247,6 +247,8 @@ def generate(env):
# configuration. See also http://www.scons.org/wiki/AdvancedBuildExample
build_topdir = 'build'
build_subdir = env['platform']
if env['embedded']:
build_subdir = 'embedded-' + build_subdir
if env['machine'] != 'generic':
build_subdir += '-' + env['machine']
if env['build'] != 'release':
@@ -277,6 +279,18 @@ def generate(env):
cppdefines += ['NDEBUG']
if env['build'] == 'profile':
cppdefines += ['PROFILE']
if env['platform'] in ('posix', 'linux', 'freebsd', 'darwin'):
cppdefines += [
'_POSIX_SOURCE',
('_POSIX_C_SOURCE', '199309L'),
'_SVID_SOURCE',
'_BSD_SOURCE',
'_GNU_SOURCE',
'PTHREADS',
'HAVE_POSIX_MEMALIGN',
]
if env['platform'] == 'darwin':
cppdefines += ['_DARWIN_C_SOURCE']
if platform == 'windows':
cppdefines += [
'WIN32',
@@ -349,8 +363,8 @@ def generate(env):
if platform == 'wince':
cppdefines += ['PIPE_SUBSYSTEM_WINDOWS_CE']
cppdefines += ['PIPE_SUBSYSTEM_WINDOWS_CE_OGL']
if platform == 'embedded':
cppdefines += ['PIPE_OS_EMBEDDED']
if env['embedded']:
cppdefines += ['PIPE_SUBSYSTEM_EMBEDDED']
env.Append(CPPDEFINES = cppdefines)
# C compiler options
@@ -403,6 +417,8 @@ def generate(env):
ccflags += ['-m64']
if platform == 'darwin':
ccflags += ['-fno-common']
if env['platform'] != 'windows':
ccflags += ['-fvisibility=hidden']
# See also:
# - http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
ccflags += [
@@ -595,7 +611,10 @@ def generate(env):
env['LINK'] = env['CXX']
# Default libs
env.Append(LIBS = [])
libs = []
if env['platform'] in ('posix', 'linux', 'freebsd', 'darwin'):
libs += ['m', 'pthread', 'dl']
env.Append(LIBS = libs)
# Load tools
env.Tool('lex')

View File

@@ -23,6 +23,7 @@ SConscript('mapi/vgapi/SConscript')
if env['platform'] != 'embedded':
SConscript('egl/main/SConscript')
SConscript('glu/sgi/SConscript')
SConscript('glut/glx/SConscript')
if env['gles']:

View File

@@ -4,18 +4,19 @@ TOP = ../../../..
include $(TOP)/configs/current
EGL_DRIVER = egl_dri2
EGL_SOURCES = egl_dri2.c platform_x11.c platform_drm.c
EGL_SOURCES = egl_dri2.c common.c
EGL_INCLUDES = \
-I$(TOP)/include \
-I$(TOP)/src/egl/main \
-I$(TOP)/src/mapi \
-I$(TOP)/src/gbm/main \
-I$(TOP)/src/gbm/backends/dri \
-DDEFAULT_DRIVER_DIR=\"$(DRI_DRIVER_SEARCH_DIR)\" \
$(XCB_DRI2_CFLAGS) \
$(LIBUDEV_CFLAGS) \
$(LIBDRM_CFLAGS)
EGL_LIBS = $(XCB_DRI2_LIBS) $(LIBUDEV_LIBS) $(DLOPEN_LIBS) $(LIBDRM_LIB)
EGL_LIBS = $(LIBUDEV_LIBS) $(DLOPEN_LIBS) $(LIBDRM_LIB)
EGL_CFLAGS = -D_EGL_MAIN=_eglBuiltInDriverDRI2
EGL_BUILTIN = true
@@ -24,6 +25,17 @@ ifeq ($(SHARED_GLAPI),1)
EGL_CFLAGS += -DHAVE_SHARED_GLAPI
endif
ifneq ($(findstring x11, $(EGL_PLATFORMS)),)
EGL_SOURCES += platform_x11.c
EGL_INCLUDES += -DHAVE_X11_PLATFORM $(XCB_DRI2_CFLAGS)
EGL_LIBS += $(XCB_DRI2_LIBS)
endif
ifneq ($(findstring drm, $(EGL_PLATFORMS)),)
EGL_SOURCES += platform_drm.c
EGL_INCLUDES += -DHAVE_DRM_PLATFORM
endif
ifneq ($(findstring wayland, $(EGL_PLATFORMS)),)
EGL_SOURCES += platform_wayland.c
EGL_INCLUDES += -DHAVE_WAYLAND_PLATFORM $(WAYLAND_CFLAGS) \

View File

@@ -0,0 +1,144 @@
/*
* Copyright © 2011 Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
* Authors:
* Kristian Høgsberg <krh@bitplanet.net>
* Benjamin Franzke <benjaminfranzke@googlemail.com>
*/
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include "egl_dri2.h"
#ifdef HAVE_LIBUDEV
#define DRIVER_MAP_DRI2_ONLY
#include "pci_ids/pci_id_driver_map.h"
#include <libudev.h>
static struct udev_device *
dri2_udev_device_new_from_fd(struct udev *udev, int fd)
{
struct udev_device *device;
struct stat buf;
if (fstat(fd, &buf) < 0) {
_eglLog(_EGL_WARNING, "EGL-DRI2: failed to stat fd %d", fd);
return NULL;
}
device = udev_device_new_from_devnum(udev, 'c', buf.st_rdev);
if (device == NULL) {
_eglLog(_EGL_WARNING,
"EGL-DRI2: could not create udev device for fd %d", fd);
return NULL;
}
return device;
}
char *
dri2_get_device_name_for_fd(int fd)
{
struct udev *udev;
struct udev_device *device;
const char *const_device_name;
char *device_name = NULL;
udev = udev_new();
device = dri2_udev_device_new_from_fd(udev, fd);
if (device == NULL)
return NULL;
const_device_name = udev_device_get_devnode(device);
if (!const_device_name)
goto out;
device_name = strdup(const_device_name);
out:
udev_device_unref(device);
udev_unref(udev);
return device_name;
}
char *
dri2_get_driver_for_fd(int fd)
{
struct udev *udev;
struct udev_device *device, *parent;
const char *pci_id;
char *driver = NULL;
int vendor_id, chip_id, i, j;
udev = udev_new();
device = dri2_udev_device_new_from_fd(udev, fd);
if (device == NULL)
return NULL;
parent = udev_device_get_parent(device);
if (parent == NULL) {
_eglLog(_EGL_WARNING, "DRI2: could not get parent device");
goto out;
}
pci_id = udev_device_get_property_value(parent, "PCI_ID");
if (pci_id == NULL ||
sscanf(pci_id, "%x:%x", &vendor_id, &chip_id) != 2) {
_eglLog(_EGL_WARNING, "EGL-DRI2: malformed or no PCI ID");
goto out;
}
for (i = 0; driver_map[i].driver; i++) {
if (vendor_id != driver_map[i].vendor_id)
continue;
if (driver_map[i].num_chips_ids == -1) {
driver = strdup(driver_map[i].driver);
_eglLog(_EGL_DEBUG, "pci id for %d: %04x:%04x, driver %s",
fd, vendor_id, chip_id, driver);
goto out;
}
for (j = 0; j < driver_map[i].num_chips_ids; j++)
if (driver_map[i].chip_ids[j] == chip_id) {
driver = strdup(driver_map[i].driver);
_eglLog(_EGL_DEBUG, "pci id for %d: %04x:%04x, driver %s",
fd, vendor_id, chip_id, driver);
goto out;
}
}
out:
udev_device_unref(device);
udev_unref(udev);
return driver;
}
#endif /* HAVE_LIBUDEV */

View File

@@ -97,6 +97,18 @@ EGLint dri2_to_egl_attribute_map[] = {
0, /* __DRI_ATTRIB_FRAMEBUFFER_SRGB_CAPABLE */
};
static EGLBoolean
dri2_match_config(const _EGLConfig *conf, const _EGLConfig *criteria)
{
if (_eglCompareConfigs(conf, criteria, NULL, EGL_FALSE) != 0)
return EGL_FALSE;
if (!_eglMatchConfig(conf, criteria))
return EGL_FALSE;
return EGL_TRUE;
}
struct dri2_egl_config *
dri2_add_config(_EGLDisplay *disp, const __DRIconfig *dri_config, int id,
int depth, EGLint surface_type, const EGLint *attr_list)
@@ -190,7 +202,7 @@ dri2_add_config(_EGLDisplay *disp, const __DRIconfig *dri_config, int id,
base.ConfigID = EGL_DONT_CARE;
base.SurfaceType = EGL_DONT_CARE;
num_configs = _eglFilterArray(disp->Configs, (void **) &matching_config, 1,
(_EGLArrayForEach) _eglMatchConfig, &base);
(_EGLArrayForEach) dri2_match_config, &base);
if (num_configs == 1) {
conf = (struct dri2_egl_config *) matching_config;
@@ -200,13 +212,10 @@ dri2_add_config(_EGLDisplay *disp, const __DRIconfig *dri_config, int id,
else if (!double_buffer && !conf->dri_single_config)
conf->dri_single_config = dri_config;
else
/* a similar config type is already added
* => attach it as new config
*/
num_configs = 0;
/* a similar config type is already added (unlikely) => discard */
return NULL;
}
if (num_configs == 0) {
else if (num_configs == 0) {
conf = malloc(sizeof *conf);
if (conf == NULL)
return NULL;
@@ -224,6 +233,10 @@ dri2_add_config(_EGLDisplay *disp, const __DRIconfig *dri_config, int id,
_eglLinkConfig(&conf->base);
}
else {
assert(0);
return NULL;
}
conf->base.SurfaceType |= surface_type & (!double_buffer ? EGL_PIXMAP_BIT:
(EGL_WINDOW_BIT | EGL_PBUFFER_BIT | EGL_SWAP_BEHAVIOR_PRESERVED_BIT));
@@ -231,7 +244,7 @@ dri2_add_config(_EGLDisplay *disp, const __DRIconfig *dri_config, int id,
return conf;
}
static __DRIimage *
__DRIimage *
dri2_lookup_egl_image(__DRIscreen *screen, void *image, void *data)
{
_EGLDisplay *disp = data;
@@ -321,8 +334,8 @@ dri2_bind_extensions(struct dri2_egl_display *dri2_dpy,
return ret;
}
EGLBoolean
dri2_load_driver(_EGLDisplay *disp)
static const __DRIextension **
dri2_open_driver(_EGLDisplay *disp)
{
struct dri2_egl_display *dri2_dpy = disp->DriverData;
const __DRIextension **extensions;
@@ -361,9 +374,9 @@ dri2_load_driver(_EGLDisplay *disp)
if (dri2_dpy->driver == NULL) {
_eglLog(_EGL_WARNING,
"DRI2: failed to open any driver (search paths %s)",
search_paths);
return EGL_FALSE;
"DRI2: failed to open %s (search paths %s)",
dri2_dpy->driver_name, search_paths);
return NULL;
}
_eglLog(_EGL_DEBUG, "DRI2: dlopen(%s)", path);
@@ -372,59 +385,59 @@ dri2_load_driver(_EGLDisplay *disp)
_eglLog(_EGL_WARNING,
"DRI2: driver exports no extensions (%s)", dlerror());
dlclose(dri2_dpy->driver);
return EGL_FALSE;
}
if (strcmp(dri2_dpy->driver_name, "swrast") == 0) {
if (!dri2_bind_extensions(dri2_dpy, swrast_driver_extensions, extensions)) {
dlclose(dri2_dpy->driver);
return EGL_FALSE;
}
} else {
if (!dri2_bind_extensions(dri2_dpy, dri2_driver_extensions, extensions)) {
dlclose(dri2_dpy->driver);
return EGL_FALSE;
}
}
return extensions;
}
EGLBoolean
dri2_load_driver(_EGLDisplay *disp)
{
struct dri2_egl_display *dri2_dpy = disp->DriverData;
const __DRIextension **extensions;
extensions = dri2_open_driver(disp);
if (!extensions)
return EGL_FALSE;
if (!dri2_bind_extensions(dri2_dpy, dri2_driver_extensions, extensions)) {
dlclose(dri2_dpy->driver);
return EGL_FALSE;
}
return EGL_TRUE;
}
EGLBoolean
dri2_create_screen(_EGLDisplay *disp)
dri2_load_driver_swrast(_EGLDisplay *disp)
{
struct dri2_egl_display *dri2_dpy = disp->DriverData;
const __DRIextension **extensions;
struct dri2_egl_display *dri2_dpy;
unsigned int api_mask;
dri2_dpy = disp->DriverData;
if (dri2_dpy->dri2) {
dri2_dpy->dri_screen =
dri2_dpy->dri2->createNewScreen(0, dri2_dpy->fd, dri2_dpy->extensions,
&dri2_dpy->driver_configs, disp);
} else {
assert(dri2_dpy->swrast);
dri2_dpy->dri_screen =
dri2_dpy->swrast->createNewScreen(0, dri2_dpy->extensions,
&dri2_dpy->driver_configs, disp);
dri2_dpy->driver_name = "swrast";
extensions = dri2_open_driver(disp);
if (!extensions) {
/* try again with swrastg */
dri2_dpy->driver_name = "swrastg";
extensions = dri2_open_driver(disp);
}
if (dri2_dpy->dri_screen == NULL) {
_eglLog(_EGL_WARNING, "DRI2: failed to create dri screen");
if (!extensions)
return EGL_FALSE;
if (!dri2_bind_extensions(dri2_dpy, swrast_driver_extensions, extensions)) {
dlclose(dri2_dpy->driver);
return EGL_FALSE;
}
extensions = dri2_dpy->core->getExtensions(dri2_dpy->dri_screen);
if (dri2_dpy->dri2) {
if (!dri2_bind_extensions(dri2_dpy, dri2_core_extensions, extensions))
goto cleanup_dri_screen;
} else {
assert(dri2_dpy->swrast);
if (!dri2_bind_extensions(dri2_dpy, swrast_core_extensions, extensions))
goto cleanup_dri_screen;
}
return EGL_TRUE;
}
void
dri2_setup_screen(_EGLDisplay *disp)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
unsigned int api_mask;
if (dri2_dpy->dri2) {
if (dri2_dpy->dri2->base.version >= 2)
@@ -467,6 +480,46 @@ dri2_create_screen(_EGLDisplay *disp)
disp->Extensions.KHR_image_base = EGL_TRUE;
disp->Extensions.KHR_gl_renderbuffer_image = EGL_TRUE;
}
}
EGLBoolean
dri2_create_screen(_EGLDisplay *disp)
{
const __DRIextension **extensions;
struct dri2_egl_display *dri2_dpy;
dri2_dpy = disp->DriverData;
if (dri2_dpy->dri2) {
dri2_dpy->dri_screen =
dri2_dpy->dri2->createNewScreen(0, dri2_dpy->fd, dri2_dpy->extensions,
&dri2_dpy->driver_configs, disp);
} else {
assert(dri2_dpy->swrast);
dri2_dpy->dri_screen =
dri2_dpy->swrast->createNewScreen(0, dri2_dpy->extensions,
&dri2_dpy->driver_configs, disp);
}
if (dri2_dpy->dri_screen == NULL) {
_eglLog(_EGL_WARNING, "DRI2: failed to create dri screen");
return EGL_FALSE;
}
dri2_dpy->own_dri_screen = 1;
extensions = dri2_dpy->core->getExtensions(dri2_dpy->dri_screen);
if (dri2_dpy->dri2) {
if (!dri2_bind_extensions(dri2_dpy, dri2_core_extensions, extensions))
goto cleanup_dri_screen;
} else {
assert(dri2_dpy->swrast);
if (!dri2_bind_extensions(dri2_dpy, swrast_core_extensions, extensions))
goto cleanup_dri_screen;
}
dri2_setup_screen(disp);
return EGL_TRUE;
@@ -487,16 +540,20 @@ dri2_initialize(_EGLDriver *drv, _EGLDisplay *disp)
return EGL_FALSE;
switch (disp->Platform) {
#ifdef HAVE_X11_PLATFORM
case _EGL_PLATFORM_X11:
if (disp->Options.TestOnly)
return EGL_TRUE;
return dri2_initialize_x11(drv, disp);
#endif
#ifdef HAVE_LIBUDEV
#ifdef HAVE_DRM_PLATFORM
case _EGL_PLATFORM_DRM:
if (disp->Options.TestOnly)
return EGL_TRUE;
return dri2_initialize_drm(drv, disp);
#endif
#ifdef HAVE_WAYLAND_PLATFORM
case _EGL_PLATFORM_WAYLAND:
if (disp->Options.TestOnly)
@@ -521,12 +578,30 @@ dri2_terminate(_EGLDriver *drv, _EGLDisplay *disp)
_eglReleaseDisplayResources(drv, disp);
_eglCleanupDisplay(disp);
dri2_dpy->core->destroyScreen(dri2_dpy->dri_screen);
if (dri2_dpy->own_dri_screen)
dri2_dpy->core->destroyScreen(dri2_dpy->dri_screen);
if (dri2_dpy->fd)
close(dri2_dpy->fd);
dlclose(dri2_dpy->driver);
if (disp->PlatformDisplay == NULL)
xcb_disconnect(dri2_dpy->conn);
if (dri2_dpy->driver)
dlclose(dri2_dpy->driver);
if (disp->PlatformDisplay == NULL) {
switch (disp->Platform) {
#ifdef HAVE_X11_PLATFORM
case _EGL_PLATFORM_X11:
xcb_disconnect(dri2_dpy->conn);
break;
#endif
#ifdef HAVE_WAYLAND_PLATFORM
case _EGL_PLATFORM_WAYLAND:
wl_display_destroy(dri2_dpy->wl_dpy);
break;
#endif
default:
break;
}
}
free(dri2_dpy);
disp->DriverData = NULL;
@@ -835,7 +910,7 @@ dri2_create_image_khr_renderbuffer(_EGLDisplay *disp, _EGLContext *ctx,
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;
GLuint renderbuffer = (GLuint) buffer;
GLuint renderbuffer = (GLuint) (uintptr_t) buffer;
if (renderbuffer == 0) {
_eglError(EGL_BAD_PARAMETER, "dri2_create_image_khr");
@@ -870,7 +945,7 @@ dri2_create_image_mesa_drm_buffer(_EGLDisplay *disp, _EGLContext *ctx,
(void) ctx;
name = (EGLint) buffer;
name = (EGLint) (uintptr_t) buffer;
err = _eglParseImageAttribList(&attrs, disp, attr_list);
if (err != EGL_SUCCESS)
@@ -922,14 +997,12 @@ dri2_create_image_mesa_drm_buffer(_EGLDisplay *disp, _EGLContext *ctx,
return &dri2_img->base;
}
static EGLBoolean
dri2_export_drm_image_mesa(_EGLDriver *drv, _EGLDisplay *disp, _EGLImage *img,
EGLint *name, EGLint *handle, EGLint *stride);
#ifdef HAVE_WAYLAND_PLATFORM
static _EGLImage *
dri2_reference_drm_image(_EGLDisplay *disp, _EGLContext *ctx,
_EGLImage *image, EGLint width, EGLint height)
__DRIimage *dri_image, EGLint width, EGLint height)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
EGLint attr_list[] = {
EGL_WIDTH, 0,
EGL_HEIGHT, 0,
@@ -939,8 +1012,8 @@ dri2_reference_drm_image(_EGLDisplay *disp, _EGLContext *ctx,
};
EGLint name, stride;
dri2_export_drm_image_mesa(disp->Driver, disp, image,
&name, NULL, &stride);
dri2_dpy->image->queryImage(dri_image, __DRI_IMAGE_ATTRIB_NAME, &name);
dri2_dpy->image->queryImage(dri_image, __DRI_IMAGE_ATTRIB_STRIDE, &stride);
attr_list[1] = width;
attr_list[3] = height;
@@ -951,19 +1024,21 @@ dri2_reference_drm_image(_EGLDisplay *disp, _EGLContext *ctx,
attr_list);
}
#ifdef HAVE_WAYLAND_PLATFORM
static _EGLImage *
dri2_create_image_wayland_wl_buffer(_EGLDisplay *disp, _EGLContext *ctx,
EGLClientBuffer buffer,
EGLClientBuffer _buffer,
const EGLint *attr_list)
{
struct wl_drm_buffer *wl_drm_buffer = (struct wl_drm_buffer *) buffer;
struct wl_buffer *buffer = (struct wl_buffer *) _buffer;
(void) attr_list;
(void) attr_list;
if (!wayland_buffer_is_drm(buffer))
return NULL;
return dri2_reference_drm_image(disp, ctx, wl_drm_buffer->image,
wl_drm_buffer->buffer.width,
wl_drm_buffer->buffer.height);
return dri2_reference_drm_image(disp, ctx,
wayland_drm_buffer_get_buffer(buffer),
buffer->width,
buffer->height);
}
#endif
@@ -1054,7 +1129,8 @@ dri2_create_drm_image_mesa(_EGLDriver *drv, _EGLDisplay *disp,
valid_mask =
EGL_DRM_BUFFER_USE_SCANOUT_MESA |
EGL_DRM_BUFFER_USE_SHARE_MESA;
EGL_DRM_BUFFER_USE_SHARE_MESA |
EGL_DRM_BUFFER_USE_CURSOR_MESA;
if (attrs.DRMBufferUseMESA & ~valid_mask) {
_eglLog(_EGL_WARNING, "bad image use bit 0x%04x",
attrs.DRMBufferUseMESA & ~valid_mask);
@@ -1066,6 +1142,8 @@ dri2_create_drm_image_mesa(_EGLDriver *drv, _EGLDisplay *disp,
dri_use |= __DRI_IMAGE_USE_SHARE;
if (attrs.DRMBufferUseMESA & EGL_DRM_BUFFER_USE_SCANOUT_MESA)
dri_use |= __DRI_IMAGE_USE_SCANOUT;
if (attrs.DRMBufferUseMESA & EGL_DRM_BUFFER_USE_CURSOR_MESA)
dri_use |= __DRI_IMAGE_USE_CURSOR;
dri2_img->dri_image =
dri2_dpy->image->createImage(dri2_dpy->dri_screen,
@@ -1112,6 +1190,41 @@ dri2_export_drm_image_mesa(_EGLDriver *drv, _EGLDisplay *disp, _EGLImage *img,
}
#ifdef HAVE_WAYLAND_PLATFORM
static void *
dri2_wl_reference_buffer(void *user_data, uint32_t name,
int32_t width, int32_t height,
uint32_t stride, struct wl_visual *visual)
{
_EGLDisplay *disp = user_data;
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
__DRIimage *image;
image = dri2_dpy->image->createImageFromName(dri2_dpy->dri_screen,
width, height,
__DRI_IMAGE_FORMAT_ARGB8888,
name, stride / 4,
NULL);
return image;
}
static void
dri2_wl_release_buffer(void *user_data, void *buffer)
{
_EGLDisplay *disp = user_data;
__DRIimage *image = buffer;
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
dri2_dpy->image->destroyImage(image);
}
static struct wayland_drm_callbacks wl_drm_callbacks = {
.authenticate = NULL,
.reference_buffer = dri2_wl_reference_buffer,
.release_buffer = dri2_wl_release_buffer
};
static EGLBoolean
dri2_bind_wayland_display_wl(_EGLDriver *drv, _EGLDisplay *disp,
struct wl_display *wl_dpy)
@@ -1123,10 +1236,12 @@ dri2_bind_wayland_display_wl(_EGLDriver *drv, _EGLDisplay *disp,
if (dri2_dpy->wl_server_drm)
return EGL_FALSE;
wl_drm_callbacks.authenticate =
(int(*)(void *, uint32_t)) dri2_dpy->authenticate;
dri2_dpy->wl_server_drm =
wayland_drm_init(wl_dpy, disp,
dri2_dpy->authenticate,
dri2_dpy->device_name);
wayland_drm_init(wl_dpy, dri2_dpy->device_name,
&wl_drm_callbacks, disp);
if (!dri2_dpy->wl_server_drm)
return EGL_FALSE;
@@ -1145,7 +1260,7 @@ dri2_unbind_wayland_display_wl(_EGLDriver *drv, _EGLDisplay *disp,
if (!dri2_dpy->wl_server_drm)
return EGL_FALSE;
wayland_drm_destroy(dri2_dpy->wl_server_drm);
wayland_drm_uninit(dri2_dpy->wl_server_drm);
dri2_dpy->wl_server_drm = NULL;
return EGL_TRUE;

View File

@@ -28,10 +28,12 @@
#ifndef EGL_DRI2_INCLUDED
#define EGL_DRI2_INCLUDED
#ifdef HAVE_X11_PLATFORM
#include <xcb/xcb.h>
#include <xcb/dri2.h>
#include <xcb/xfixes.h>
#include <X11/Xlib-xcb.h>
#endif
#ifdef HAVE_WAYLAND_PLATFORM
#include <wayland-client.h>
@@ -42,6 +44,10 @@
#include <GL/gl.h>
#include <GL/internal/dri_interface.h>
#ifdef HAVE_DRM_PLATFORM
#include <gbm_driint.h>
#endif
#include "eglconfig.h"
#include "eglcontext.h"
#include "egldisplay.h"
@@ -64,10 +70,10 @@ struct dri2_egl_driver
struct dri2_egl_display
{
xcb_connection_t *conn;
int dri2_major;
int dri2_minor;
__DRIscreen *dri_screen;
int own_dri_screen;
const __DRIconfig **driver_configs;
void *driver;
__DRIcoreExtension *core;
@@ -78,15 +84,26 @@ struct dri2_egl_display
__DRIimageExtension *image;
int fd;
#ifdef HAVE_DRM_PLATFORM
struct gbm_dri_device *gbm_dri;
#endif
char *device_name;
char *driver_name;
__DRIdri2LoaderExtension dri2_loader_extension;
__DRIswrastLoaderExtension swrast_loader_extension;
const __DRIextension *extensions[3];
const __DRIextension *extensions[4];
#ifdef HAVE_X11_PLATFORM
xcb_connection_t *conn;
#endif
#ifdef HAVE_WAYLAND_PLATFORM
struct wl_egl_display *wl_dpy;
struct wl_display *wl_dpy;
struct wl_drm *wl_server_drm;
struct wl_drm *wl_drm;
int authenticated;
#endif
int (*authenticate) (_EGLDisplay *disp, uint32_t id);
@@ -102,6 +119,7 @@ struct dri2_egl_context
enum wayland_buffer_type {
WL_BUFFER_FRONT,
WL_BUFFER_BACK,
WL_BUFFER_THIRD,
WL_BUFFER_COUNT
};
@@ -118,26 +136,30 @@ struct dri2_egl_surface
{
_EGLSurface base;
__DRIdrawable *dri_drawable;
xcb_drawable_t drawable;
__DRIbuffer buffers[5];
int buffer_count;
xcb_xfixes_region_t region;
int have_fake_front;
int swap_interval;
#ifdef HAVE_X11_PLATFORM
xcb_drawable_t drawable;
xcb_xfixes_region_t region;
int depth;
int bytes_per_pixel;
xcb_gcontext_t gc;
xcb_gcontext_t swapgc;
#endif
enum dri2_surface_type type;
#ifdef HAVE_WAYLAND_PLATFORM
struct wl_egl_window *wl_win;
struct wl_egl_pixmap *wl_pix;
struct wl_buffer *wl_drm_buffer[WL_BUFFER_COUNT];
int wl_buffer_lock[WL_BUFFER_COUNT];
int dx;
int dy;
__DRIbuffer *dri_buffers[__DRI_BUFFER_COUNT];
__DRIbuffer *third_buffer;
__DRIbuffer *pending_buffer;
EGLBoolean block_swap_buffers;
#endif
@@ -172,9 +194,19 @@ extern const __DRIuseInvalidateExtension use_invalidate;
EGLBoolean
dri2_load_driver(_EGLDisplay *disp);
/* Helper for platforms not using dri2_create_screen */
void
dri2_setup_screen(_EGLDisplay *disp);
EGLBoolean
dri2_load_driver_swrast(_EGLDisplay *disp);
EGLBoolean
dri2_create_screen(_EGLDisplay *disp);
__DRIimage *
dri2_lookup_egl_image(__DRIscreen *screen, void *image, void *data);
struct dri2_egl_config *
dri2_add_config(_EGLDisplay *disp, const __DRIconfig *dri_config, int id,
int depth, EGLint surface_type, const EGLint *attr_list);
@@ -195,5 +227,7 @@ dri2_initialize_wayland(_EGLDriver *drv, _EGLDisplay *disp);
char *
dri2_get_driver_for_fd(int fd);
char *
dri2_get_device_name_for_fd(int fd);
#endif /* EGL_DRI2_INCLUDED */

View File

@@ -26,640 +26,55 @@
*/
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <limits.h>
#include <dlfcn.h>
#include <fcntl.h>
#include <errno.h>
#include <unistd.h>
#include <string.h>
#include <xf86drm.h>
#include <sys/types.h>
#include <sys/stat.h>
#ifdef HAVE_LIBUDEV
#include <libudev.h>
#endif
#include <dlfcn.h>
#include "egl_dri2.h"
#ifdef HAVE_LIBUDEV
struct dri2_driver_map {
int vendor_id;
const char *driver;
const int *chip_ids;
int num_chips_ids;
};
const int i915_chip_ids[] = {
0x3577, /* PCI_CHIP_I830_M */
0x2562, /* PCI_CHIP_845_G */
0x3582, /* PCI_CHIP_I855_GM */
0x2572, /* PCI_CHIP_I865_G */
0x2582, /* PCI_CHIP_I915_G */
0x258a, /* PCI_CHIP_E7221_G */
0x2592, /* PCI_CHIP_I915_GM */
0x2772, /* PCI_CHIP_I945_G */
0x27a2, /* PCI_CHIP_I945_GM */
0x27ae, /* PCI_CHIP_I945_GME */
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 */
0x2972, /* PCI_CHIP_I946_GZ */
0x2a02, /* PCI_CHIP_I965_GM */
0x2a12, /* PCI_CHIP_I965_GME */
0x2a42, /* PCI_CHIP_GM45_GM */
0x2e02, /* PCI_CHIP_IGD_E_G */
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 int r100_chip_ids[] = {
0x4C57, /* PCI_CHIP_RADEON_LW */
0x4C58, /* PCI_CHIP_RADEON_LX */
0x4C59, /* PCI_CHIP_RADEON_LY */
0x4C5A, /* PCI_CHIP_RADEON_LZ */
0x5144, /* PCI_CHIP_RADEON_QD */
0x5145, /* PCI_CHIP_RADEON_QE */
0x5146, /* PCI_CHIP_RADEON_QF */
0x5147, /* PCI_CHIP_RADEON_QG */
0x5159, /* PCI_CHIP_RADEON_QY */
0x515A, /* PCI_CHIP_RADEON_QZ */
0x5157, /* PCI_CHIP_RV200_QW */
0x5158, /* PCI_CHIP_RV200_QX */
0x515E, /* PCI_CHIP_RN50_515E */
0x5969, /* PCI_CHIP_RN50_5969 */
0x4136, /* PCI_CHIP_RS100_4136 */
0x4336, /* PCI_CHIP_RS100_4336 */
0x4137, /* PCI_CHIP_RS200_4137 */
0x4337, /* PCI_CHIP_RS200_4337 */
0x4237, /* PCI_CHIP_RS250_4237 */
0x4437, /* PCI_CHIP_RS250_4437 */
};
const int r200_chip_ids[] = {
0x5148, /* PCI_CHIP_R200_QH */
0x514C, /* PCI_CHIP_R200_QL */
0x514D, /* PCI_CHIP_R200_QM */
0x4242, /* PCI_CHIP_R200_BB */
0x4966, /* PCI_CHIP_RV250_If */
0x4967, /* PCI_CHIP_RV250_Ig */
0x4C64, /* PCI_CHIP_RV250_Ld */
0x4C66, /* PCI_CHIP_RV250_Lf */
0x4C67, /* PCI_CHIP_RV250_Lg */
0x5960, /* PCI_CHIP_RV280_5960 */
0x5961, /* PCI_CHIP_RV280_5961 */
0x5962, /* PCI_CHIP_RV280_5962 */
0x5964, /* PCI_CHIP_RV280_5964 */
0x5965, /* PCI_CHIP_RV280_5965 */
0x5C61, /* PCI_CHIP_RV280_5C61 */
0x5C63, /* PCI_CHIP_RV280_5C63 */
0x5834, /* PCI_CHIP_RS300_5834 */
0x5835, /* PCI_CHIP_RS300_5835 */
0x7834, /* PCI_CHIP_RS350_7834 */
0x7835, /* PCI_CHIP_RS350_7835 */
};
const int r300_chip_ids[] = {
0x4144, /* PCI_CHIP_R300_AD */
0x4145, /* PCI_CHIP_R300_AE */
0x4146, /* PCI_CHIP_R300_AF */
0x4147, /* PCI_CHIP_R300_AG */
0x4E44, /* PCI_CHIP_R300_ND */
0x4E45, /* PCI_CHIP_R300_NE */
0x4E46, /* PCI_CHIP_R300_NF */
0x4E47, /* PCI_CHIP_R300_NG */
0x4E48, /* PCI_CHIP_R350_NH */
0x4E49, /* PCI_CHIP_R350_NI */
0x4E4B, /* PCI_CHIP_R350_NK */
0x4148, /* PCI_CHIP_R350_AH */
0x4149, /* PCI_CHIP_R350_AI */
0x414A, /* PCI_CHIP_R350_AJ */
0x414B, /* PCI_CHIP_R350_AK */
0x4E4A, /* PCI_CHIP_R360_NJ */
0x4150, /* PCI_CHIP_RV350_AP */
0x4151, /* PCI_CHIP_RV350_AQ */
0x4152, /* PCI_CHIP_RV350_AR */
0x4153, /* PCI_CHIP_RV350_AS */
0x4154, /* PCI_CHIP_RV350_AT */
0x4155, /* PCI_CHIP_RV350_AU */
0x4156, /* PCI_CHIP_RV350_AV */
0x4E50, /* PCI_CHIP_RV350_NP */
0x4E51, /* PCI_CHIP_RV350_NQ */
0x4E52, /* PCI_CHIP_RV350_NR */
0x4E53, /* PCI_CHIP_RV350_NS */
0x4E54, /* PCI_CHIP_RV350_NT */
0x4E56, /* PCI_CHIP_RV350_NV */
0x5460, /* PCI_CHIP_RV370_5460 */
0x5462, /* PCI_CHIP_RV370_5462 */
0x5464, /* PCI_CHIP_RV370_5464 */
0x5B60, /* PCI_CHIP_RV370_5B60 */
0x5B62, /* PCI_CHIP_RV370_5B62 */
0x5B63, /* PCI_CHIP_RV370_5B63 */
0x5B64, /* PCI_CHIP_RV370_5B64 */
0x5B65, /* PCI_CHIP_RV370_5B65 */
0x3150, /* PCI_CHIP_RV380_3150 */
0x3152, /* PCI_CHIP_RV380_3152 */
0x3154, /* PCI_CHIP_RV380_3154 */
0x3155, /* PCI_CHIP_RV380_3155 */
0x3E50, /* PCI_CHIP_RV380_3E50 */
0x3E54, /* PCI_CHIP_RV380_3E54 */
0x4A48, /* PCI_CHIP_R420_JH */
0x4A49, /* PCI_CHIP_R420_JI */
0x4A4A, /* PCI_CHIP_R420_JJ */
0x4A4B, /* PCI_CHIP_R420_JK */
0x4A4C, /* PCI_CHIP_R420_JL */
0x4A4D, /* PCI_CHIP_R420_JM */
0x4A4E, /* PCI_CHIP_R420_JN */
0x4A4F, /* PCI_CHIP_R420_JO */
0x4A50, /* PCI_CHIP_R420_JP */
0x4A54, /* PCI_CHIP_R420_JT */
0x5548, /* PCI_CHIP_R423_UH */
0x5549, /* PCI_CHIP_R423_UI */
0x554A, /* PCI_CHIP_R423_UJ */
0x554B, /* PCI_CHIP_R423_UK */
0x5550, /* PCI_CHIP_R423_5550 */
0x5551, /* PCI_CHIP_R423_UQ */
0x5552, /* PCI_CHIP_R423_UR */
0x5554, /* PCI_CHIP_R423_UT */
0x5D57, /* PCI_CHIP_R423_5D57 */
0x554C, /* PCI_CHIP_R430_554C */
0x554D, /* PCI_CHIP_R430_554D */
0x554E, /* PCI_CHIP_R430_554E */
0x554F, /* PCI_CHIP_R430_554F */
0x5D48, /* PCI_CHIP_R430_5D48 */
0x5D49, /* PCI_CHIP_R430_5D49 */
0x5D4A, /* PCI_CHIP_R430_5D4A */
0x5D4C, /* PCI_CHIP_R480_5D4C */
0x5D4D, /* PCI_CHIP_R480_5D4D */
0x5D4E, /* PCI_CHIP_R480_5D4E */
0x5D4F, /* PCI_CHIP_R480_5D4F */
0x5D50, /* PCI_CHIP_R480_5D50 */
0x5D52, /* PCI_CHIP_R480_5D52 */
0x4B49, /* PCI_CHIP_R481_4B49 */
0x4B4A, /* PCI_CHIP_R481_4B4A */
0x4B4B, /* PCI_CHIP_R481_4B4B */
0x4B4C, /* PCI_CHIP_R481_4B4C */
0x564A, /* PCI_CHIP_RV410_564A */
0x564B, /* PCI_CHIP_RV410_564B */
0x564F, /* PCI_CHIP_RV410_564F */
0x5652, /* PCI_CHIP_RV410_5652 */
0x5653, /* PCI_CHIP_RV410_5653 */
0x5657, /* PCI_CHIP_RV410_5657 */
0x5E48, /* PCI_CHIP_RV410_5E48 */
0x5E4A, /* PCI_CHIP_RV410_5E4A */
0x5E4B, /* PCI_CHIP_RV410_5E4B */
0x5E4C, /* PCI_CHIP_RV410_5E4C */
0x5E4D, /* PCI_CHIP_RV410_5E4D */
0x5E4F, /* PCI_CHIP_RV410_5E4F */
0x5A41, /* PCI_CHIP_RS400_5A41 */
0x5A42, /* PCI_CHIP_RS400_5A42 */
0x5A61, /* PCI_CHIP_RC410_5A61 */
0x5A62, /* PCI_CHIP_RC410_5A62 */
0x5954, /* PCI_CHIP_RS480_5954 */
0x5955, /* PCI_CHIP_RS480_5955 */
0x5974, /* PCI_CHIP_RS482_5974 */
0x5975, /* PCI_CHIP_RS482_5975 */
0x7100, /* PCI_CHIP_R520_7100 */
0x7101, /* PCI_CHIP_R520_7101 */
0x7102, /* PCI_CHIP_R520_7102 */
0x7103, /* PCI_CHIP_R520_7103 */
0x7104, /* PCI_CHIP_R520_7104 */
0x7105, /* PCI_CHIP_R520_7105 */
0x7106, /* PCI_CHIP_R520_7106 */
0x7108, /* PCI_CHIP_R520_7108 */
0x7109, /* PCI_CHIP_R520_7109 */
0x710A, /* PCI_CHIP_R520_710A */
0x710B, /* PCI_CHIP_R520_710B */
0x710C, /* PCI_CHIP_R520_710C */
0x710E, /* PCI_CHIP_R520_710E */
0x710F, /* PCI_CHIP_R520_710F */
0x7140, /* PCI_CHIP_RV515_7140 */
0x7141, /* PCI_CHIP_RV515_7141 */
0x7142, /* PCI_CHIP_RV515_7142 */
0x7143, /* PCI_CHIP_RV515_7143 */
0x7144, /* PCI_CHIP_RV515_7144 */
0x7145, /* PCI_CHIP_RV515_7145 */
0x7146, /* PCI_CHIP_RV515_7146 */
0x7147, /* PCI_CHIP_RV515_7147 */
0x7149, /* PCI_CHIP_RV515_7149 */
0x714A, /* PCI_CHIP_RV515_714A */
0x714B, /* PCI_CHIP_RV515_714B */
0x714C, /* PCI_CHIP_RV515_714C */
0x714D, /* PCI_CHIP_RV515_714D */
0x714E, /* PCI_CHIP_RV515_714E */
0x714F, /* PCI_CHIP_RV515_714F */
0x7151, /* PCI_CHIP_RV515_7151 */
0x7152, /* PCI_CHIP_RV515_7152 */
0x7153, /* PCI_CHIP_RV515_7153 */
0x715E, /* PCI_CHIP_RV515_715E */
0x715F, /* PCI_CHIP_RV515_715F */
0x7180, /* PCI_CHIP_RV515_7180 */
0x7181, /* PCI_CHIP_RV515_7181 */
0x7183, /* PCI_CHIP_RV515_7183 */
0x7186, /* PCI_CHIP_RV515_7186 */
0x7187, /* PCI_CHIP_RV515_7187 */
0x7188, /* PCI_CHIP_RV515_7188 */
0x718A, /* PCI_CHIP_RV515_718A */
0x718B, /* PCI_CHIP_RV515_718B */
0x718C, /* PCI_CHIP_RV515_718C */
0x718D, /* PCI_CHIP_RV515_718D */
0x718F, /* PCI_CHIP_RV515_718F */
0x7193, /* PCI_CHIP_RV515_7193 */
0x7196, /* PCI_CHIP_RV515_7196 */
0x719B, /* PCI_CHIP_RV515_719B */
0x719F, /* PCI_CHIP_RV515_719F */
0x7200, /* PCI_CHIP_RV515_7200 */
0x7210, /* PCI_CHIP_RV515_7210 */
0x7211, /* PCI_CHIP_RV515_7211 */
0x71C0, /* PCI_CHIP_RV530_71C0 */
0x71C1, /* PCI_CHIP_RV530_71C1 */
0x71C2, /* PCI_CHIP_RV530_71C2 */
0x71C3, /* PCI_CHIP_RV530_71C3 */
0x71C4, /* PCI_CHIP_RV530_71C4 */
0x71C5, /* PCI_CHIP_RV530_71C5 */
0x71C6, /* PCI_CHIP_RV530_71C6 */
0x71C7, /* PCI_CHIP_RV530_71C7 */
0x71CD, /* PCI_CHIP_RV530_71CD */
0x71CE, /* PCI_CHIP_RV530_71CE */
0x71D2, /* PCI_CHIP_RV530_71D2 */
0x71D4, /* PCI_CHIP_RV530_71D4 */
0x71D5, /* PCI_CHIP_RV530_71D5 */
0x71D6, /* PCI_CHIP_RV530_71D6 */
0x71DA, /* PCI_CHIP_RV530_71DA */
0x71DE, /* PCI_CHIP_RV530_71DE */
0x7281, /* PCI_CHIP_RV560_7281 */
0x7283, /* PCI_CHIP_RV560_7283 */
0x7287, /* PCI_CHIP_RV560_7287 */
0x7290, /* PCI_CHIP_RV560_7290 */
0x7291, /* PCI_CHIP_RV560_7291 */
0x7293, /* PCI_CHIP_RV560_7293 */
0x7297, /* PCI_CHIP_RV560_7297 */
0x7280, /* PCI_CHIP_RV570_7280 */
0x7288, /* PCI_CHIP_RV570_7288 */
0x7289, /* PCI_CHIP_RV570_7289 */
0x728B, /* PCI_CHIP_RV570_728B */
0x728C, /* PCI_CHIP_RV570_728C */
0x7240, /* PCI_CHIP_R580_7240 */
0x7243, /* PCI_CHIP_R580_7243 */
0x7244, /* PCI_CHIP_R580_7244 */
0x7245, /* PCI_CHIP_R580_7245 */
0x7246, /* PCI_CHIP_R580_7246 */
0x7247, /* PCI_CHIP_R580_7247 */
0x7248, /* PCI_CHIP_R580_7248 */
0x7249, /* PCI_CHIP_R580_7249 */
0x724A, /* PCI_CHIP_R580_724A */
0x724B, /* PCI_CHIP_R580_724B */
0x724C, /* PCI_CHIP_R580_724C */
0x724D, /* PCI_CHIP_R580_724D */
0x724E, /* PCI_CHIP_R580_724E */
0x724F, /* PCI_CHIP_R580_724F */
0x7284, /* PCI_CHIP_R580_7284 */
0x793F, /* PCI_CHIP_RS600_793F */
0x7941, /* PCI_CHIP_RS600_7941 */
0x7942, /* PCI_CHIP_RS600_7942 */
0x791E, /* PCI_CHIP_RS690_791E */
0x791F, /* PCI_CHIP_RS690_791F */
0x796C, /* PCI_CHIP_RS740_796C */
0x796D, /* PCI_CHIP_RS740_796D */
0x796E, /* PCI_CHIP_RS740_796E */
0x796F, /* PCI_CHIP_RS740_796F */
};
const int r600_chip_ids[] = {
0x9400, /* PCI_CHIP_R600_9400 */
0x9401, /* PCI_CHIP_R600_9401 */
0x9402, /* PCI_CHIP_R600_9402 */
0x9403, /* PCI_CHIP_R600_9403 */
0x9405, /* PCI_CHIP_R600_9405 */
0x940A, /* PCI_CHIP_R600_940A */
0x940B, /* PCI_CHIP_R600_940B */
0x940F, /* PCI_CHIP_R600_940F */
0x94C0, /* PCI_CHIP_RV610_94C0 */
0x94C1, /* PCI_CHIP_RV610_94C1 */
0x94C3, /* PCI_CHIP_RV610_94C3 */
0x94C4, /* PCI_CHIP_RV610_94C4 */
0x94C5, /* PCI_CHIP_RV610_94C5 */
0x94C6, /* PCI_CHIP_RV610_94C6 */
0x94C7, /* PCI_CHIP_RV610_94C7 */
0x94C8, /* PCI_CHIP_RV610_94C8 */
0x94C9, /* PCI_CHIP_RV610_94C9 */
0x94CB, /* PCI_CHIP_RV610_94CB */
0x94CC, /* PCI_CHIP_RV610_94CC */
0x94CD, /* PCI_CHIP_RV610_94CD */
0x9580, /* PCI_CHIP_RV630_9580 */
0x9581, /* PCI_CHIP_RV630_9581 */
0x9583, /* PCI_CHIP_RV630_9583 */
0x9586, /* PCI_CHIP_RV630_9586 */
0x9587, /* PCI_CHIP_RV630_9587 */
0x9588, /* PCI_CHIP_RV630_9588 */
0x9589, /* PCI_CHIP_RV630_9589 */
0x958A, /* PCI_CHIP_RV630_958A */
0x958B, /* PCI_CHIP_RV630_958B */
0x958C, /* PCI_CHIP_RV630_958C */
0x958D, /* PCI_CHIP_RV630_958D */
0x958E, /* PCI_CHIP_RV630_958E */
0x958F, /* PCI_CHIP_RV630_958F */
0x9500, /* PCI_CHIP_RV670_9500 */
0x9501, /* PCI_CHIP_RV670_9501 */
0x9504, /* PCI_CHIP_RV670_9504 */
0x9505, /* PCI_CHIP_RV670_9505 */
0x9506, /* PCI_CHIP_RV670_9506 */
0x9507, /* PCI_CHIP_RV670_9507 */
0x9508, /* PCI_CHIP_RV670_9508 */
0x9509, /* PCI_CHIP_RV670_9509 */
0x950F, /* PCI_CHIP_RV670_950F */
0x9511, /* PCI_CHIP_RV670_9511 */
0x9515, /* PCI_CHIP_RV670_9515 */
0x9517, /* PCI_CHIP_RV670_9517 */
0x9519, /* PCI_CHIP_RV670_9519 */
0x95C0, /* PCI_CHIP_RV620_95C0 */
0x95C2, /* PCI_CHIP_RV620_95C2 */
0x95C4, /* PCI_CHIP_RV620_95C4 */
0x95C5, /* PCI_CHIP_RV620_95C5 */
0x95C6, /* PCI_CHIP_RV620_95C6 */
0x95C7, /* PCI_CHIP_RV620_95C7 */
0x95C9, /* PCI_CHIP_RV620_95C9 */
0x95CC, /* PCI_CHIP_RV620_95CC */
0x95CD, /* PCI_CHIP_RV620_95CD */
0x95CE, /* PCI_CHIP_RV620_95CE */
0x95CF, /* PCI_CHIP_RV620_95CF */
0x9590, /* PCI_CHIP_RV635_9590 */
0x9591, /* PCI_CHIP_RV635_9591 */
0x9593, /* PCI_CHIP_RV635_9593 */
0x9595, /* PCI_CHIP_RV635_9595 */
0x9596, /* PCI_CHIP_RV635_9596 */
0x9597, /* PCI_CHIP_RV635_9597 */
0x9598, /* PCI_CHIP_RV635_9598 */
0x9599, /* PCI_CHIP_RV635_9599 */
0x959B, /* PCI_CHIP_RV635_959B */
0x9610, /* PCI_CHIP_RS780_9610 */
0x9611, /* PCI_CHIP_RS780_9611 */
0x9612, /* PCI_CHIP_RS780_9612 */
0x9613, /* PCI_CHIP_RS780_9613 */
0x9614, /* PCI_CHIP_RS780_9614 */
0x9615, /* PCI_CHIP_RS780_9615 */
0x9616, /* PCI_CHIP_RS780_9616 */
0x9710, /* PCI_CHIP_RS880_9710 */
0x9711, /* PCI_CHIP_RS880_9711 */
0x9712, /* PCI_CHIP_RS880_9712 */
0x9713, /* PCI_CHIP_RS880_9713 */
0x9714, /* PCI_CHIP_RS880_9714 */
0x9715, /* PCI_CHIP_RS880_9715 */
0x9440, /* PCI_CHIP_RV770_9440 */
0x9441, /* PCI_CHIP_RV770_9441 */
0x9442, /* PCI_CHIP_RV770_9442 */
0x9443, /* PCI_CHIP_RV770_9443 */
0x9444, /* PCI_CHIP_RV770_9444 */
0x9446, /* PCI_CHIP_RV770_9446 */
0x944A, /* PCI_CHIP_RV770_944A */
0x944B, /* PCI_CHIP_RV770_944B */
0x944C, /* PCI_CHIP_RV770_944C */
0x944E, /* PCI_CHIP_RV770_944E */
0x9450, /* PCI_CHIP_RV770_9450 */
0x9452, /* PCI_CHIP_RV770_9452 */
0x9456, /* PCI_CHIP_RV770_9456 */
0x945A, /* PCI_CHIP_RV770_945A */
0x945B, /* PCI_CHIP_RV770_945B */
0x945E, /* PCI_CHIP_RV770_945E */
0x9460, /* PCI_CHIP_RV790_9460 */
0x9462, /* PCI_CHIP_RV790_9462 */
0x946A, /* PCI_CHIP_RV770_946A */
0x946B, /* PCI_CHIP_RV770_946B */
0x947A, /* PCI_CHIP_RV770_947A */
0x947B, /* PCI_CHIP_RV770_947B */
0x9480, /* PCI_CHIP_RV730_9480 */
0x9487, /* PCI_CHIP_RV730_9487 */
0x9488, /* PCI_CHIP_RV730_9488 */
0x9489, /* PCI_CHIP_RV730_9489 */
0x948A, /* PCI_CHIP_RV730_948A */
0x948F, /* PCI_CHIP_RV730_948F */
0x9490, /* PCI_CHIP_RV730_9490 */
0x9491, /* PCI_CHIP_RV730_9491 */
0x9495, /* PCI_CHIP_RV730_9495 */
0x9498, /* PCI_CHIP_RV730_9498 */
0x949C, /* PCI_CHIP_RV730_949C */
0x949E, /* PCI_CHIP_RV730_949E */
0x949F, /* PCI_CHIP_RV730_949F */
0x9540, /* PCI_CHIP_RV710_9540 */
0x9541, /* PCI_CHIP_RV710_9541 */
0x9542, /* PCI_CHIP_RV710_9542 */
0x954E, /* PCI_CHIP_RV710_954E */
0x954F, /* PCI_CHIP_RV710_954F */
0x9552, /* PCI_CHIP_RV710_9552 */
0x9553, /* PCI_CHIP_RV710_9553 */
0x9555, /* PCI_CHIP_RV710_9555 */
0x9557, /* PCI_CHIP_RV710_9557 */
0x955F, /* PCI_CHIP_RV710_955F */
0x94A0, /* PCI_CHIP_RV740_94A0 */
0x94A1, /* PCI_CHIP_RV740_94A1 */
0x94A3, /* PCI_CHIP_RV740_94A3 */
0x94B1, /* PCI_CHIP_RV740_94B1 */
0x94B3, /* PCI_CHIP_RV740_94B3 */
0x94B4, /* PCI_CHIP_RV740_94B4 */
0x94B5, /* PCI_CHIP_RV740_94B5 */
0x94B9, /* PCI_CHIP_RV740_94B9 */
0x68E0, /* PCI_CHIP_CEDAR_68E0 */
0x68E1, /* PCI_CHIP_CEDAR_68E1 */
0x68E4, /* PCI_CHIP_CEDAR_68E4 */
0x68E5, /* PCI_CHIP_CEDAR_68E5 */
0x68E8, /* PCI_CHIP_CEDAR_68E8 */
0x68E9, /* PCI_CHIP_CEDAR_68E9 */
0x68F1, /* PCI_CHIP_CEDAR_68F1 */
0x68F8, /* PCI_CHIP_CEDAR_68F8 */
0x68F9, /* PCI_CHIP_CEDAR_68F9 */
0x68FE, /* PCI_CHIP_CEDAR_68FE */
0x68C0, /* PCI_CHIP_REDWOOD_68C0 */
0x68C1, /* PCI_CHIP_REDWOOD_68C1 */
0x68C8, /* PCI_CHIP_REDWOOD_68C8 */
0x68C9, /* PCI_CHIP_REDWOOD_68C9 */
0x68D8, /* PCI_CHIP_REDWOOD_68D8 */
0x68D9, /* PCI_CHIP_REDWOOD_68D9 */
0x68DA, /* PCI_CHIP_REDWOOD_68DA */
0x68DE, /* PCI_CHIP_REDWOOD_68DE */
0x68A0, /* PCI_CHIP_JUNIPER_68A0 */
0x68A1, /* PCI_CHIP_JUNIPER_68A1 */
0x68A8, /* PCI_CHIP_JUNIPER_68A8 */
0x68A9, /* PCI_CHIP_JUNIPER_68A9 */
0x68B0, /* PCI_CHIP_JUNIPER_68B0 */
0x68B8, /* PCI_CHIP_JUNIPER_68B8 */
0x68B9, /* PCI_CHIP_JUNIPER_68B9 */
0x68BE, /* PCI_CHIP_JUNIPER_68BE */
0x6880, /* PCI_CHIP_CYPRESS_6880 */
0x6888, /* PCI_CHIP_CYPRESS_6888 */
0x6889, /* PCI_CHIP_CYPRESS_6889 */
0x688A, /* PCI_CHIP_CYPRESS_688A */
0x6898, /* PCI_CHIP_CYPRESS_6898 */
0x6899, /* PCI_CHIP_CYPRESS_6899 */
0x689E, /* PCI_CHIP_CYPRESS_689E */
0x689C, /* PCI_CHIP_HEMLOCK_689C */
0x689D, /* PCI_CHIP_HEMLOCK_689D */
0x9802, /* PCI_CHIP_PALM_9802 */
0x9803, /* PCI_CHIP_PALM_9803 */
0x9804, /* PCI_CHIP_PALM_9804 */
0x9805, /* PCI_CHIP_PALM_9805 */
0x6720, /* PCI_CHIP_BARTS_6720 */
0x6721, /* PCI_CHIP_BARTS_6721 */
0x6722, /* PCI_CHIP_BARTS_6722 */
0x6723, /* PCI_CHIP_BARTS_6723 */
0x6724, /* PCI_CHIP_BARTS_6724 */
0x6725, /* PCI_CHIP_BARTS_6725 */
0x6726, /* PCI_CHIP_BARTS_6726 */
0x6727, /* PCI_CHIP_BARTS_6727 */
0x6728, /* PCI_CHIP_BARTS_6728 */
0x6729, /* PCI_CHIP_BARTS_6729 */
0x6738, /* PCI_CHIP_BARTS_6738 */
0x6739, /* PCI_CHIP_BARTS_6738 */
0x6740, /* PCI_CHIP_TURKS_6740 */
0x6741, /* PCI_CHIP_TURKS_6741 */
0x6742, /* PCI_CHIP_TURKS_6742 */
0x6743, /* PCI_CHIP_TURKS_6743 */
0x6744, /* PCI_CHIP_TURKS_6744 */
0x6745, /* PCI_CHIP_TURKS_6745 */
0x6746, /* PCI_CHIP_TURKS_6746 */
0x6747, /* PCI_CHIP_TURKS_6747 */
0x6748, /* PCI_CHIP_TURKS_6748 */
0x6749, /* PCI_CHIP_TURKS_6749 */
0x6750, /* PCI_CHIP_TURKS_6750 */
0x6758, /* PCI_CHIP_TURKS_6758 */
0x6759, /* PCI_CHIP_TURKS_6759 */
0x6760, /* PCI_CHIP_CAICOS_6760 */
0x6761, /* PCI_CHIP_CAICOS_6761 */
0x6762, /* PCI_CHIP_CAICOS_6762 */
0x6763, /* PCI_CHIP_CAICOS_6763 */
0x6764, /* PCI_CHIP_CAICOS_6764 */
0x6765, /* PCI_CHIP_CAICOS_6765 */
0x6766, /* PCI_CHIP_CAICOS_6766 */
0x6767, /* PCI_CHIP_CAICOS_6767 */
0x6768, /* PCI_CHIP_CAICOS_6768 */
0x6770, /* PCI_CHIP_CAICOS_6770 */
0x6779, /* PCI_CHIP_CAICOS_6779 */
};
const struct dri2_driver_map driver_map[] = {
{ 0x8086, "i915", i915_chip_ids, ARRAY_SIZE(i915_chip_ids) },
{ 0x8086, "i965", i965_chip_ids, ARRAY_SIZE(i965_chip_ids) },
{ 0x1002, "radeon", r100_chip_ids, ARRAY_SIZE(r100_chip_ids) },
{ 0x1002, "r200", r200_chip_ids, ARRAY_SIZE(r200_chip_ids) },
{ 0x1002, "r300", r300_chip_ids, ARRAY_SIZE(r300_chip_ids) },
{ 0x1002, "r600", r600_chip_ids, ARRAY_SIZE(r600_chip_ids) },
{ 0x10de, "nouveau", NULL, -1 },
};
static char *
dri2_get_device_name(int fd)
static _EGLImage *
dri2_create_image_khr_pixmap(_EGLDisplay *disp, _EGLContext *ctx,
EGLClientBuffer buffer, const EGLint *attr_list)
{
struct udev *udev;
struct udev_device *device;
struct stat buf;
char *device_name;
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct gbm_dri_bo *dri_bo = gbm_dri_bo((struct gbm_bo *) buffer);
struct dri2_egl_image *dri2_img;
udev = udev_new();
if (fstat(fd, &buf) < 0) {
_eglLog(_EGL_WARNING, "EGL-DRI2: failed to stat fd %d", fd);
goto out;
dri2_img = malloc(sizeof *dri2_img);
if (!dri2_img) {
_eglError(EGL_BAD_ALLOC, "dri2_create_image_khr_pixmap");
return NULL;
}
device = udev_device_new_from_devnum(udev, 'c', buf.st_rdev);
if (device == NULL) {
_eglLog(_EGL_WARNING,
"EGL-DRI2: could not create udev device for fd %d", fd);
goto out;
if (!_eglInitImage(&dri2_img->base, disp)) {
free(dri2_img);
return NULL;
}
device_name = udev_device_get_devnode(device);
if (!device_name)
goto out;
device_name = strdup(device_name);
dri2_img->dri_image = dri2_dpy->image->dupImage(dri_bo->image, dri2_img);
if (dri2_img->dri_image == NULL) {
free(dri2_img);
_eglError(EGL_BAD_ALLOC, "dri2_create_image_khr_pixmap");
return NULL;
}
out:
udev_device_unref(device);
udev_unref(udev);
return device_name;
return &dri2_img->base;
}
char *
dri2_get_driver_for_fd(int fd)
static _EGLImage *
dri2_drm_create_image_khr(_EGLDriver *drv, _EGLDisplay *disp,
_EGLContext *ctx, EGLenum target,
EGLClientBuffer buffer, const EGLint *attr_list)
{
struct udev *udev;
struct udev_device *device, *parent;
struct stat buf;
const char *pci_id;
char *driver = NULL;
int vendor_id, chip_id, i, j;
(void) drv;
udev = udev_new();
if (fstat(fd, &buf) < 0) {
_eglLog(_EGL_WARNING, "EGL-DRI2: failed to stat fd %d", fd);
goto out;
switch (target) {
case EGL_NATIVE_PIXMAP_KHR:
return dri2_create_image_khr_pixmap(disp, ctx, buffer, attr_list);
default:
return dri2_create_image_khr(drv, disp, ctx, target, buffer, attr_list);
}
device = udev_device_new_from_devnum(udev, 'c', buf.st_rdev);
if (device == NULL) {
_eglLog(_EGL_WARNING,
"EGL-DRI2: could not create udev device for fd %d", fd);
goto out;
}
parent = udev_device_get_parent(device);
if (parent == NULL) {
_eglLog(_EGL_WARNING, "DRI2: could not get parent device");
goto out;
}
pci_id = udev_device_get_property_value(parent, "PCI_ID");
if (pci_id == NULL || sscanf(pci_id, "%x:%x", &vendor_id, &chip_id) != 2) {
_eglLog(_EGL_WARNING, "EGL-DRI2: malformed or no PCI ID");
goto out;
}
for (i = 0; i < ARRAY_SIZE(driver_map); i++) {
if (vendor_id != driver_map[i].vendor_id)
continue;
if (driver_map[i].num_chips_ids == -1) {
driver = strdup(driver_map[i].driver);
_eglLog(_EGL_DEBUG, "pci id for %d: %04x:%04x, driver %s",
fd, vendor_id, chip_id, driver);
goto out;
}
for (j = 0; j < driver_map[i].num_chips_ids; j++)
if (driver_map[i].chip_ids[j] == chip_id) {
driver = strdup(driver_map[i].driver);
_eglLog(_EGL_DEBUG, "pci id for %d: %04x:%04x, driver %s",
fd, vendor_id, chip_id, driver);
goto out;
}
}
out:
udev_device_unref(device);
udev_unref(udev);
return driver;
}
static int
@@ -674,59 +89,58 @@ EGLBoolean
dri2_initialize_drm(_EGLDriver *drv, _EGLDisplay *disp)
{
struct dri2_egl_display *dri2_dpy;
struct gbm_device *gbm;
int i;
dri2_dpy = malloc(sizeof *dri2_dpy);
if (!dri2_dpy)
return _eglError(EGL_BAD_ALLOC, "eglInitialize");
memset(dri2_dpy, 0, sizeof *dri2_dpy);
disp->DriverData = (void *) dri2_dpy;
dri2_dpy->fd = (int) disp->PlatformDisplay;
dri2_dpy->driver_name = dri2_get_driver_for_fd(dri2_dpy->fd);
if (dri2_dpy->driver_name == NULL)
return _eglError(EGL_BAD_ALLOC, "DRI2: failed to get driver name");
dri2_dpy->device_name = dri2_get_device_name(dri2_dpy->fd);
if (dri2_dpy->device_name == NULL) {
_eglError(EGL_BAD_ALLOC, "DRI2: failed to get device name");
goto cleanup_driver_name;
gbm = (struct gbm_device *) disp->PlatformDisplay;
if (strcmp(gbm_device_get_backend_name(gbm), "drm") != 0) {
free(dri2_dpy);
return EGL_FALSE;
}
if (!dri2_load_driver(disp))
goto cleanup_device_name;
dri2_dpy->gbm_dri = gbm_dri_device(gbm);
if (dri2_dpy->gbm_dri->base.type != GBM_DRM_DRIVER_TYPE_DRI) {
free(dri2_dpy);
return EGL_FALSE;
}
dri2_dpy->extensions[0] = &image_lookup_extension.base;
dri2_dpy->extensions[1] = &use_invalidate.base;
dri2_dpy->extensions[2] = NULL;
dri2_dpy->fd = gbm_device_get_fd(gbm);
dri2_dpy->device_name = dri2_get_device_name_for_fd(dri2_dpy->fd);
dri2_dpy->driver_name = dri2_dpy->gbm_dri->base.driver_name;
if (!dri2_create_screen(disp))
goto cleanup_driver;
dri2_dpy->dri_screen = dri2_dpy->gbm_dri->screen;
dri2_dpy->core = dri2_dpy->gbm_dri->core;
dri2_dpy->dri2 = dri2_dpy->gbm_dri->dri2;
dri2_dpy->image = dri2_dpy->gbm_dri->image;
dri2_dpy->driver_configs = dri2_dpy->gbm_dri->driver_configs;
dri2_dpy->gbm_dri->lookup_image = dri2_lookup_egl_image;
dri2_dpy->gbm_dri->lookup_user_data = disp;
dri2_setup_screen(disp);
for (i = 0; dri2_dpy->driver_configs[i]; i++)
dri2_add_config(disp, dri2_dpy->driver_configs[i], i + 1, 0, 0, NULL);
dri2_add_config(disp, dri2_dpy->driver_configs[i],
i + 1, 0, 0, NULL);
drv->API.CreateImageKHR = dri2_drm_create_image_khr;
#ifdef HAVE_WAYLAND_PLATFORM
disp->Extensions.WL_bind_wayland_display = EGL_TRUE;
#endif
dri2_dpy->authenticate = dri2_drm_authenticate;
/* we're supporting EGL 1.4 */
disp->VersionMajor = 1;
disp->VersionMinor = 4;
return EGL_TRUE;
cleanup_driver:
dlclose(dri2_dpy->driver);
cleanup_device_name:
free(dri2_dpy->device_name);
cleanup_driver_name:
free(dri2_dpy->driver_name);
return EGL_FALSE;
}
#endif

View File

@@ -32,6 +32,8 @@
#include <dlfcn.h>
#include <errno.h>
#include <unistd.h>
#include <fcntl.h>
#include <xf86drm.h>
#include "egl_dri2.h"
@@ -57,6 +59,29 @@ force_roundtrip(struct wl_display *display)
wl_display_iterate(display, WL_DISPLAY_READABLE);
}
static void
wl_buffer_release(void *data, struct wl_buffer *buffer)
{
struct dri2_egl_surface *dri2_surf = data;
int i;
for (i = 0; i < WL_BUFFER_COUNT; ++i)
if (dri2_surf->wl_drm_buffer[i] == buffer)
break;
assert(i <= WL_BUFFER_COUNT);
/* not found? */
if (i == WL_BUFFER_COUNT)
return;
dri2_surf->wl_buffer_lock[i] = 0;
}
static struct wl_buffer_listener wl_buffer_listener = {
wl_buffer_release
};
/**
* Called via eglCreateWindowSurface(), drv->API.CreateWindowSurface().
@@ -83,13 +108,16 @@ dri2_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
if (!_eglInitSurface(&dri2_surf->base, disp, type, conf, attrib_list))
goto cleanup_surf;
for (i = 0; i < WL_BUFFER_COUNT; ++i)
for (i = 0; i < WL_BUFFER_COUNT; ++i) {
dri2_surf->wl_drm_buffer[i] = NULL;
dri2_surf->wl_buffer_lock[i] = 0;
}
for (i = 0; i < __DRI_BUFFER_COUNT; ++i)
dri2_surf->dri_buffers[i] = NULL;
dri2_surf->pending_buffer = NULL;
dri2_surf->third_buffer = NULL;
dri2_surf->block_swap_buffers = EGL_FALSE;
switch (type) {
@@ -107,7 +135,7 @@ dri2_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
dri2_surf->base.Width = dri2_surf->wl_pix->width;
dri2_surf->base.Height = dri2_surf->wl_pix->height;
if (dri2_surf->wl_pix->name > 0) {
if (dri2_surf->wl_pix->driver_private) {
dri2_buf = dri2_surf->wl_pix->driver_private;
dri2_surf->dri_buffers[__DRI_BUFFER_FRONT_LEFT] = dri2_buf->dri_buffer;
}
@@ -185,6 +213,11 @@ dri2_destroy_surface(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf)
dri2_dpy->dri2->releaseBuffer(dri2_dpy->dri_screen,
dri2_surf->dri_buffers[i]);
if (dri2_surf->third_buffer) {
dri2_dpy->dri2->releaseBuffer(dri2_dpy->dri_screen,
dri2_surf->third_buffer);
}
free(surf);
return EGL_TRUE;
@@ -204,7 +237,23 @@ dri2_wl_egl_pixmap_destroy(struct wl_egl_pixmap *egl_pixmap)
egl_pixmap->driver_private = NULL;
egl_pixmap->destroy = NULL;
egl_pixmap->name = 0;
}
static struct wl_buffer *
wayland_create_buffer(struct dri2_egl_surface *dri2_surf,
__DRIbuffer *buffer,
struct wl_visual *visual)
{
struct dri2_egl_display *dri2_dpy =
dri2_egl_display(dri2_surf->base.Resource.Display);
struct wl_buffer *buf;
buf = wl_drm_create_buffer(dri2_dpy->wl_drm, buffer->name,
dri2_surf->base.Width, dri2_surf->base.Height,
buffer->pitch, visual);
wl_buffer_add_listener(buf, &wl_buffer_listener, dri2_surf);
return buf;
}
static void
@@ -218,6 +267,8 @@ dri2_process_back_buffer(struct dri2_egl_surface *dri2_surf, unsigned format)
switch (dri2_surf->type) {
case DRI2_WINDOW_SURFACE:
/* allocate a front buffer for our double-buffered window*/
if (dri2_surf->dri_buffers[__DRI_BUFFER_FRONT_LEFT] != NULL)
break;
dri2_surf->dri_buffers[__DRI_BUFFER_FRONT_LEFT] =
dri2_dpy->dri2->allocateBuffer(dri2_dpy->dri_screen,
__DRI_BUFFER_FRONT_LEFT, format,
@@ -244,8 +295,6 @@ dri2_process_front_buffer(struct dri2_egl_surface *dri2_surf, unsigned format)
dri2_buf->dri_buffer = dri2_surf->dri_buffers[__DRI_BUFFER_FRONT_LEFT];
dri2_buf->dri2_dpy = dri2_dpy;
dri2_surf->wl_pix->name = dri2_buf->dri_buffer->name;
dri2_surf->wl_pix->stride = dri2_buf->dri_buffer->pitch;
dri2_surf->wl_pix->driver_private = dri2_buf;
dri2_surf->wl_pix->destroy = dri2_wl_egl_pixmap_destroy;
break;
@@ -277,14 +326,20 @@ dri2_release_buffers(struct dri2_egl_surface *dri2_surf)
dri2_egl_display(dri2_surf->base.Resource.Display);
int i;
if (dri2_surf->third_buffer) {
dri2_dpy->dri2->releaseBuffer(dri2_dpy->dri_screen,
dri2_surf->third_buffer);
dri2_surf->third_buffer = NULL;
}
for (i = 0; i < __DRI_BUFFER_COUNT; ++i) {
if (dri2_surf->dri_buffers[i]) {
switch (i) {
case __DRI_BUFFER_FRONT_LEFT:
if (dri2_surf->pending_buffer)
force_roundtrip(dri2_dpy->wl_dpy->display);
force_roundtrip(dri2_dpy->wl_dpy);
dri2_surf->pending_buffer = dri2_surf->dri_buffers[i];
wl_display_sync_callback(dri2_dpy->wl_dpy->display,
wl_display_sync_callback(dri2_dpy->wl_dpy,
dri2_release_pending_buffer, dri2_surf);
break;
default:
@@ -297,6 +352,76 @@ dri2_release_buffers(struct dri2_egl_surface *dri2_surf)
}
}
static inline void
pointer_swap(const void **p1, const void **p2)
{
const void *tmp = *p1;
*p1 = *p2;
*p2 = tmp;
}
static void
destroy_third_buffer(struct dri2_egl_surface *dri2_surf)
{
struct dri2_egl_display *dri2_dpy =
dri2_egl_display(dri2_surf->base.Resource.Display);
if (dri2_surf->third_buffer == NULL)
return;
dri2_dpy->dri2->releaseBuffer(dri2_dpy->dri_screen,
dri2_surf->third_buffer);
dri2_surf->third_buffer = NULL;
if (dri2_surf->wl_drm_buffer[WL_BUFFER_THIRD])
wl_buffer_destroy(dri2_surf->wl_drm_buffer[WL_BUFFER_THIRD]);
dri2_surf->wl_drm_buffer[WL_BUFFER_THIRD] = NULL;
dri2_surf->wl_buffer_lock[WL_BUFFER_THIRD] = 0;
}
static void
swap_wl_buffers(struct dri2_egl_surface *dri2_surf,
enum wayland_buffer_type a, enum wayland_buffer_type b)
{
int tmp;
tmp = dri2_surf->wl_buffer_lock[a];
dri2_surf->wl_buffer_lock[a] = dri2_surf->wl_buffer_lock[b];
dri2_surf->wl_buffer_lock[b] = tmp;
pointer_swap((const void **) &dri2_surf->wl_drm_buffer[a],
(const void **) &dri2_surf->wl_drm_buffer[b]);
}
static void
swap_back_and_third(struct dri2_egl_surface *dri2_surf)
{
if (dri2_surf->wl_buffer_lock[WL_BUFFER_THIRD])
destroy_third_buffer(dri2_surf);
pointer_swap((const void **) &dri2_surf->dri_buffers[__DRI_BUFFER_BACK_LEFT],
(const void **) &dri2_surf->third_buffer);
swap_wl_buffers(dri2_surf, WL_BUFFER_BACK, WL_BUFFER_THIRD);
}
static void
dri2_prior_buffer_creation(struct dri2_egl_surface *dri2_surf,
unsigned int type)
{
switch (type) {
case __DRI_BUFFER_BACK_LEFT:
if (dri2_surf->wl_buffer_lock[WL_BUFFER_BACK])
swap_back_and_third(dri2_surf);
else if (dri2_surf->third_buffer)
destroy_third_buffer(dri2_surf);
break;
default:
break;
}
}
static __DRIbuffer *
dri2_get_buffers_with_format(__DRIdrawable * driDrawable,
int *width, int *height,
@@ -323,6 +448,7 @@ dri2_get_buffers_with_format(__DRIdrawable * driDrawable,
if (dri2_surf->wl_drm_buffer[i])
wl_buffer_destroy(dri2_surf->wl_drm_buffer[i]);
dri2_surf->wl_drm_buffer[i] = NULL;
dri2_surf->wl_buffer_lock[i] = 0;
}
}
@@ -331,6 +457,8 @@ dri2_get_buffers_with_format(__DRIdrawable * driDrawable,
assert(attachments[i] < __DRI_BUFFER_COUNT);
assert(dri2_surf->buffer_count < 5);
dri2_prior_buffer_creation(dri2_surf, attachments[i]);
if (dri2_surf->dri_buffers[attachments[i]] == NULL) {
dri2_surf->dri_buffers[attachments[i]] =
@@ -357,6 +485,12 @@ dri2_get_buffers_with_format(__DRIdrawable * driDrawable,
assert(dri2_surf->type == DRI2_PIXMAP_SURFACE ||
dri2_surf->dri_buffers[__DRI_BUFFER_BACK_LEFT]);
if (dri2_surf->type == DRI2_PIXMAP_SURFACE && !dri2_surf->wl_pix->buffer)
dri2_surf->wl_pix->buffer =
wayland_create_buffer(dri2_surf,
dri2_surf->dri_buffers[__DRI_BUFFER_FRONT_LEFT],
dri2_surf->wl_pix->visual);
*out_count = dri2_surf->buffer_count;
if (dri2_surf->buffer_count == 0)
return NULL;
@@ -417,17 +551,6 @@ dri2_flush_front_buffer(__DRIdrawable * driDrawable, void *loaderPrivate)
#endif
}
static struct wl_buffer *
wayland_create_buffer(struct dri2_egl_surface *dri2_surf, __DRIbuffer *buffer)
{
struct dri2_egl_display *dri2_dpy =
dri2_egl_display(dri2_surf->base.Resource.Display);
return wl_drm_create_buffer(dri2_dpy->wl_dpy->drm, buffer->name,
dri2_surf->base.Width, dri2_surf->base.Height,
buffer->pitch, dri2_surf->wl_win->visual);
}
static void
wayland_frame_callback(struct wl_surface *surface, void *data, uint32_t time)
{
@@ -436,14 +559,6 @@ wayland_frame_callback(struct wl_surface *surface, void *data, uint32_t time)
dri2_surf->block_swap_buffers = EGL_FALSE;
}
static inline void
pointer_swap(const void **p1, const void **p2)
{
const void *tmp = *p1;
*p1 = *p2;
*p2 = tmp;
}
/**
* Called via eglSwapBuffers(), drv->API.SwapBuffers().
*/
@@ -455,12 +570,12 @@ dri2_swap_buffers(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw)
struct dri2_egl_driver *dri2_drv = dri2_egl_driver(drv);
while (dri2_surf->block_swap_buffers)
wl_display_iterate(dri2_dpy->wl_dpy->display, WL_DISPLAY_READABLE);
wl_display_iterate(dri2_dpy->wl_dpy, WL_DISPLAY_READABLE);
dri2_surf->block_swap_buffers = EGL_TRUE;
wl_display_frame_callback(dri2_dpy->wl_dpy->display,
dri2_surf->wl_win->surface,
wayland_frame_callback, dri2_surf);
wl_display_frame_callback(dri2_dpy->wl_dpy,
dri2_surf->wl_win->surface,
wayland_frame_callback, dri2_surf);
if (dri2_surf->type == DRI2_WINDOW_SURFACE) {
pointer_swap(
@@ -472,17 +587,20 @@ dri2_swap_buffers(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw)
dri2_surf->dri_buffers[__DRI_BUFFER_BACK_LEFT]->attachment =
__DRI_BUFFER_BACK_LEFT;
pointer_swap((const void **) &dri2_surf->wl_drm_buffer[WL_BUFFER_FRONT],
(const void **) &dri2_surf->wl_drm_buffer[WL_BUFFER_BACK]);
swap_wl_buffers(dri2_surf, WL_BUFFER_FRONT, WL_BUFFER_BACK);
if (!dri2_surf->wl_drm_buffer[WL_BUFFER_FRONT])
dri2_surf->wl_drm_buffer[WL_BUFFER_FRONT] =
wayland_create_buffer(dri2_surf,
dri2_surf->dri_buffers[__DRI_BUFFER_FRONT_LEFT]);
dri2_surf->dri_buffers[__DRI_BUFFER_FRONT_LEFT],
dri2_surf->wl_win->visual);
wl_buffer_damage(dri2_surf->wl_drm_buffer[WL_BUFFER_FRONT], 0, 0,
dri2_surf->base.Width, dri2_surf->base.Height);
wl_surface_attach(dri2_surf->wl_win->surface,
dri2_surf->wl_drm_buffer[WL_BUFFER_FRONT],
dri2_surf->dx, dri2_surf->dy);
dri2_surf->wl_buffer_lock[WL_BUFFER_FRONT] = 1;
dri2_surf->wl_win->attached_width = dri2_surf->base.Width;
dri2_surf->wl_win->attached_height = dri2_surf->base.Height;
@@ -536,18 +654,23 @@ dri2_create_image_khr_pixmap(_EGLDisplay *disp, _EGLContext *ctx,
wl_egl_pixmap->width,
wl_egl_pixmap->height);
wl_egl_pixmap->name = dri2_buf->dri_buffer->name;
wl_egl_pixmap->stride = dri2_buf->dri_buffer->pitch;
wl_egl_pixmap->destroy = dri2_wl_egl_pixmap_destroy;
wl_egl_pixmap->driver_private = dri2_buf;
wl_egl_pixmap->buffer =
wl_drm_create_buffer(dri2_dpy->wl_drm,
dri2_buf->dri_buffer->name,
wl_egl_pixmap->width,
wl_egl_pixmap->height,
dri2_buf->dri_buffer->pitch,
wl_egl_pixmap->visual);
wl_attr_list[1] = wl_egl_pixmap->width;
wl_attr_list[3] = wl_egl_pixmap->height;
wl_attr_list[5] = wl_egl_pixmap->stride / 4;
wl_attr_list[5] = dri2_buf->dri_buffer->pitch / 4;
return dri2_create_image_khr(disp->Driver, disp, ctx, EGL_DRM_BUFFER_MESA,
(EGLClientBuffer)(intptr_t) wl_egl_pixmap->name, wl_attr_list);
(EGLClientBuffer)(intptr_t) dri2_buf->dri_buffer->name, wl_attr_list);
}
static _EGLImage *
@@ -571,16 +694,16 @@ dri2_wayland_authenticate(_EGLDisplay *disp, uint32_t id)
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
int ret = 0;
dri2_dpy->wl_dpy->authenticated = false;
dri2_dpy->authenticated = 0;
wl_drm_authenticate(dri2_dpy->wl_dpy->drm, id);
force_roundtrip(dri2_dpy->wl_dpy->display);
wl_drm_authenticate(dri2_dpy->wl_drm, id);
force_roundtrip(dri2_dpy->wl_dpy);
if (!dri2_dpy->wl_dpy->authenticated)
if (!dri2_dpy->authenticated)
ret = -1;
/* reset authenticated */
dri2_dpy->wl_dpy->authenticated = true;
dri2_dpy->authenticated = 1;
return ret;
}
@@ -606,10 +729,45 @@ dri2_terminate(_EGLDriver *drv, _EGLDisplay *disp)
return EGL_TRUE;
}
static void
drm_handle_device(void *data, struct wl_drm *drm, const char *device)
{
struct dri2_egl_display *dri2_dpy = data;
drm_magic_t magic;
dri2_dpy->device_name = strdup(device);
if (!dri2_dpy->device_name)
return;
dri2_dpy->fd = open(dri2_dpy->device_name, O_RDWR);
if (dri2_dpy->fd == -1) {
_eglLog(_EGL_WARNING, "wayland-egl: could not open %s (%s)",
dri2_dpy->device_name, strerror(errno));
return;
}
drmGetMagic(dri2_dpy->fd, &magic);
wl_drm_authenticate(dri2_dpy->wl_drm, magic);
}
static void
drm_handle_authenticated(void *data, struct wl_drm *drm)
{
struct dri2_egl_display *dri2_dpy = data;
dri2_dpy->authenticated = 1;
}
static const struct wl_drm_listener drm_listener = {
drm_handle_device,
drm_handle_authenticated
};
EGLBoolean
dri2_initialize_wayland(_EGLDriver *drv, _EGLDisplay *disp)
{
struct dri2_egl_display *dri2_dpy;
uint32_t id;
int i;
drv->API.CreateWindowSurface = dri2_create_window_surface;
@@ -626,23 +784,31 @@ dri2_initialize_wayland(_EGLDriver *drv, _EGLDisplay *disp)
memset(dri2_dpy, 0, sizeof *dri2_dpy);
disp->DriverData = (void *) dri2_dpy;
dri2_dpy->wl_dpy = disp->PlatformDisplay;
if (dri2_dpy->wl_dpy->fd == -1)
force_roundtrip(dri2_dpy->wl_dpy->display);
if (dri2_dpy->wl_dpy->fd == -1)
goto cleanup_dpy;
dri2_dpy->fd = dup(dri2_dpy->wl_dpy->fd);
if (dri2_dpy->fd < 0) {
_eglError(EGL_BAD_ALLOC, "DRI2: failed to dup fd");
goto cleanup_dpy;
if (disp->PlatformDisplay == NULL) {
dri2_dpy->wl_dpy = wl_display_connect(NULL);
if (dri2_dpy->wl_dpy == NULL)
goto cleanup_dpy;
} else {
dri2_dpy->wl_dpy = disp->PlatformDisplay;
}
if (!dri2_dpy->wl_dpy->authenticated)
force_roundtrip(dri2_dpy->wl_dpy->display);
if (!dri2_dpy->wl_dpy->authenticated)
id = wl_display_get_global(dri2_dpy->wl_dpy, "wl_drm", 1);
if (id == 0)
force_roundtrip(dri2_dpy->wl_dpy);
id = wl_display_get_global(dri2_dpy->wl_dpy, "wl_drm", 1);
if (id == 0)
goto cleanup_dpy;
dri2_dpy->wl_drm = wl_drm_create(dri2_dpy->wl_dpy, id, 1);
if (!dri2_dpy->wl_drm)
goto cleanup_dpy;
wl_drm_add_listener(dri2_dpy->wl_drm, &drm_listener, dri2_dpy);
force_roundtrip(dri2_dpy->wl_dpy);
if (dri2_dpy->fd == -1)
goto cleanup_drm;
force_roundtrip(dri2_dpy->wl_dpy);
if (!dri2_dpy->authenticated)
goto cleanup_fd;
dri2_dpy->driver_name = dri2_get_driver_for_fd(dri2_dpy->fd);
if (dri2_dpy->driver_name == NULL) {
@@ -650,14 +816,8 @@ dri2_initialize_wayland(_EGLDriver *drv, _EGLDisplay *disp)
goto cleanup_fd;
}
dri2_dpy->device_name = strdup(dri2_dpy->wl_dpy->device_name);
if (dri2_dpy->device_name == NULL) {
_eglError(EGL_BAD_ALLOC, "DRI2: failed to get device name");
goto cleanup_driver_name;
}
if (!dri2_load_driver(disp))
goto cleanup_device_name;
goto cleanup_driver_name;
dri2_dpy->dri2_loader_extension.base.name = __DRI_DRI2_LOADER;
dri2_dpy->dri2_loader_extension.base.version = 3;
@@ -668,7 +828,8 @@ dri2_initialize_wayland(_EGLDriver *drv, _EGLDisplay *disp)
dri2_dpy->extensions[0] = &dri2_dpy->dri2_loader_extension.base;
dri2_dpy->extensions[1] = &image_lookup_extension.base;
dri2_dpy->extensions[2] = NULL;
dri2_dpy->extensions[2] = &use_invalidate.base;
dri2_dpy->extensions[3] = NULL;
if (!dri2_create_screen(disp))
goto cleanup_driver;
@@ -691,12 +852,13 @@ dri2_initialize_wayland(_EGLDriver *drv, _EGLDisplay *disp)
cleanup_driver:
dlclose(dri2_dpy->driver);
cleanup_device_name:
free(dri2_dpy->device_name);
cleanup_driver_name:
free(dri2_dpy->driver_name);
cleanup_fd:
close(dri2_dpy->fd);
cleanup_drm:
free(dri2_dpy->device_name);
wl_drm_destroy(dri2_dpy->wl_drm);
cleanup_dpy:
free(dri2_dpy);

View File

@@ -479,10 +479,19 @@ dri2_connect(struct dri2_egl_display *dri2_dpy)
xcb_generic_error_t *error;
xcb_screen_iterator_t s;
char *driver_name, *device_name;
const xcb_query_extension_reply_t *extension;
xcb_prefetch_extension_data (dri2_dpy->conn, &xcb_xfixes_id);
xcb_prefetch_extension_data (dri2_dpy->conn, &xcb_dri2_id);
extension = xcb_get_extension_data(dri2_dpy->conn, &xcb_xfixes_id);
if (!(extension && extension->present))
return EGL_FALSE;
extension = xcb_get_extension_data(dri2_dpy->conn, &xcb_dri2_id);
if (!(extension && extension->present))
return EGL_FALSE;
xfixes_query_cookie = xcb_xfixes_query_version(dri2_dpy->conn,
XCB_XFIXES_MAJOR_VERSION,
XCB_XFIXES_MINOR_VERSION);
@@ -784,7 +793,7 @@ dri2_create_image_khr_pixmap(_EGLDisplay *disp, _EGLContext *ctx,
(void) ctx;
drawable = (xcb_drawable_t) buffer;
drawable = (xcb_drawable_t) (uintptr_t) buffer;
xcb_dri2_create_drawable (dri2_dpy->conn, drawable);
attachments[0] = XCB_DRI2_ATTACHMENT_BUFFER_FRONT_LEFT;
buffers_cookie =
@@ -906,9 +915,7 @@ dri2_initialize_x11_swrast(_EGLDriver *drv, _EGLDisplay *disp)
goto cleanup_dpy;
}
dri2_dpy->driver_name = dri2_strndup("swrast", strlen("swrast"));
if (!dri2_load_driver(disp))
if (!dri2_load_driver_swrast(disp))
goto cleanup_conn;
dri2_dpy->swrast_loader_extension.base.name = __DRI_SWRAST_LOADER;

View File

@@ -1,8 +1,10 @@
/**************************************************************************
*
*
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
* Copyright 2010-2011 LunarG, Inc.
* All Rights Reserved.
*
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
@@ -10,19 +12,19 @@
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
* IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
**************************************************************************/

View File

@@ -58,11 +58,20 @@ LOCAL_LIBS =
ifeq ($(filter dri2, $(EGL_DRIVERS_DIRS)),dri2)
LOCAL_CFLAGS += -D_EGL_BUILT_IN_DRIVER_DRI2
LOCAL_LIBS += $(TOP)/src/egl/drivers/dri2/libegl_dri2.a
ifneq ($(findstring x11, $(EGL_PLATFORMS)),)
EGL_LIB_DEPS += $(XCB_DRI2_LIBS)
endif
ifneq ($(findstring drm, $(EGL_PLATFORMS)),)
EGL_LIB_DEPS += -lgbm
endif
EGL_LIB_DEPS += $(LIBUDEV_LIBS) $(DLOPEN_LIBS) $(LIBDRM_LIB) $(WAYLAND_LIBS)
endif
ifneq ($(findstring wayland, $(EGL_PLATFORMS)),)
LOCAL_LIBS += $(TOP)/src/egl/wayland/wayland-drm/libwayland-drm.a
endif
EGL_LIB_DEPS += $(XCB_DRI2_LIBS) $(LIBUDEV_LIBS) $(DLOPEN_LIBS) $(LIBDRM_LIB) $(WAYLAND_LIBS)
endif
ifeq ($(filter glx, $(EGL_DRIVERS_DIRS)),glx)
LOCAL_CFLAGS += -D_EGL_BUILT_IN_DRIVER_GLX
LOCAL_LIBS += $(TOP)/src/egl/drivers/glx/libegl_glx.a

View File

@@ -1,3 +1,33 @@
/**************************************************************************
*
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
* Copyright 2010-2011 LunarG, Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
/**
* Public EGL API entrypoints
*
@@ -914,7 +944,7 @@ eglGetProcAddress(const char *procname)
{ "eglCreateDRMImageMESA", (_EGLProc) eglCreateDRMImageMESA },
{ "eglExportDRMImageMESA", (_EGLProc) eglExportDRMImageMESA },
#endif
#ifdef EGL_WL_bind_display
#ifdef EGL_WL_bind_wayland_display
{ "eglBindWaylandDisplayWL", (_EGLProc) eglBindWaylandDisplayWL },
{ "eglUnbindWaylandDisplayWL", (_EGLProc) eglUnbindWaylandDisplayWL },
#endif
@@ -1168,7 +1198,7 @@ eglQueryModeStringMESA(EGLDisplay dpy, EGLModeMESA mode)
EGLDisplay EGLAPIENTRY
eglGetDRMDisplayMESA(int fd)
{
_EGLDisplay *dpy = _eglFindDisplay(_EGL_PLATFORM_DRM, (void *) fd);
_EGLDisplay *dpy = _eglFindDisplay(_EGL_PLATFORM_DRM, (void *) (intptr_t) fd);
return _eglGetDisplayHandle(dpy);
}

View File

@@ -1,3 +1,33 @@
/**************************************************************************
*
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
* Copyright 2010-2011 LunarG, Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
#ifndef EGLAPI_INCLUDED
#define EGLAPI_INCLUDED

View File

@@ -1,3 +1,31 @@
/**************************************************************************
*
* Copyright 2010 LunarG, Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
#include <stdlib.h>
#include <string.h>

View File

@@ -1,3 +1,31 @@
/**************************************************************************
*
* Copyright 2010 LunarG, Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
#ifndef EGLARRAY_INCLUDED
#define EGLARRAY_INCLUDED

View File

@@ -1,3 +1,32 @@
/**************************************************************************
*
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
* Copyright 2010 LunarG, Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
#ifndef EGLCOMPILER_INCLUDED
#define EGLCOMPILER_INCLUDED

View File

@@ -1,3 +1,33 @@
/**************************************************************************
*
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
* Copyright 2010-2011 LunarG, Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
/**
* EGL Configuration (pixel format) functions.
*/
@@ -456,8 +486,6 @@ _eglIsConfigAttribValid(_EGLConfig *conf, EGLint attr)
return EGL_FALSE;
switch (attr) {
case EGL_MATCH_NATIVE_PIXMAP:
return EGL_FALSE;
case EGL_Y_INVERTED_NOK:
return conf->Display->Extensions.NOK_texture_from_pixmap;
default:
@@ -739,6 +767,16 @@ _eglGetConfigAttrib(_EGLDriver *drv, _EGLDisplay *dpy, _EGLConfig *conf,
{
if (!_eglIsConfigAttribValid(conf, attribute))
return _eglError(EGL_BAD_ATTRIBUTE, "eglGetConfigAttrib");
/* nonqueryable attributes */
switch (attribute) {
case EGL_MATCH_NATIVE_PIXMAP:
return _eglError(EGL_BAD_ATTRIBUTE, "eglGetConfigAttrib");
break;
default:
break;
}
if (!value)
return _eglError(EGL_BAD_PARAMETER, "eglGetConfigAttrib");

View File

@@ -1,3 +1,33 @@
/**************************************************************************
*
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
* Copyright 2010-2011 LunarG, Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
#ifndef EGLCONFIG_INCLUDED
#define EGLCONFIG_INCLUDED

View File

@@ -1,3 +1,33 @@
/**************************************************************************
*
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
* Copyright 2010-2011 LunarG, Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
#include <assert.h>
#include <stdlib.h>
#include <string.h>

View File

@@ -1,3 +1,33 @@
/**************************************************************************
*
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
* Copyright 2010-2011 LunarG, Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
#ifndef EGLCONTEXT_INCLUDED
#define EGLCONTEXT_INCLUDED

View File

@@ -1,3 +1,31 @@
/**************************************************************************
*
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
#include <stdlib.h>
#include <string.h>
#include "egllog.h"

View File

@@ -1,3 +1,31 @@
/**************************************************************************
*
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
#ifndef EGLCURRENT_INCLUDED
#define EGLCURRENT_INCLUDED

View File

@@ -1,8 +1,8 @@
/**************************************************************************
*
*
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
* All Rights Reserved.
*
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
@@ -10,23 +10,22 @@
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
* IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
/**
* Internal EGL defines
*/

View File

@@ -1,3 +1,33 @@
/**************************************************************************
*
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
* Copyright 2010-2011 LunarG, Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
/**
* Functions related to EGLDisplay.
*/

View File

@@ -1,3 +1,33 @@
/**************************************************************************
*
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
* Copyright 2010-2011 LunarG, Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
#ifndef EGLDISPLAY_INCLUDED
#define EGLDISPLAY_INCLUDED

View File

@@ -1,3 +1,33 @@
/**************************************************************************
*
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
* Copyright 2010-2011 LunarG, Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
/**
* Functions for choosing and opening/loading device drivers.
*/

View File

@@ -1,3 +1,33 @@
/**************************************************************************
*
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
* Copyright 2010-2011 LunarG, Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
#ifndef EGLDRIVER_INCLUDED
#define EGLDRIVER_INCLUDED

View File

@@ -1,3 +1,31 @@
/**************************************************************************
*
* Copyright 2010 LunarG, Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
#include <string.h>
#include "egltypedefs.h"
#include "egldriver.h"

View File

@@ -1,3 +1,33 @@
/**************************************************************************
*
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
* Copyright 2010-2011 LunarG, Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
#include <stdlib.h>
#include <assert.h>
#include "eglglobals.h"

View File

@@ -1,3 +1,33 @@
/**************************************************************************
*
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
* Copyright 2010-2011 LunarG, Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
#ifndef EGLGLOBALS_INCLUDED
#define EGLGLOBALS_INCLUDED

View File

@@ -1,3 +1,32 @@
/**************************************************************************
*
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
* Copyright 2010-2011 LunarG, Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
#include <assert.h>
#include <string.h>

View File

@@ -1,3 +1,32 @@
/**************************************************************************
*
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
* Copyright 2010-2011 LunarG, Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
#ifndef EGLIMAGE_INCLUDED
#define EGLIMAGE_INCLUDED

View File

@@ -1,3 +1,33 @@
/**************************************************************************
*
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
* Copyright 2010 LunarG, Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
/**
* Logging facility for debug/info messages.
* _EGL_FATAL messages are printed to stderr

View File

@@ -1,3 +1,32 @@
/**************************************************************************
*
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
#ifndef EGLLOG_INCLUDED
#define EGLLOG_INCLUDED

View File

@@ -1,8 +1,10 @@
/**************************************************************************
*
*
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
* Copyright 2010-2011 LunarG, Inc.
* All Rights Reserved.
*
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
@@ -10,19 +12,19 @@
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
* IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
**************************************************************************/

View File

@@ -1,8 +1,10 @@
/**************************************************************************
*
*
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
* Copyright 2010-2011 LunarG, Inc.
* All Rights Reserved.
*
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
@@ -10,19 +12,19 @@
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
* IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
**************************************************************************/

View File

@@ -1,3 +1,33 @@
/**************************************************************************
*
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
* Copyright 2010 LunarG, Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
#include <assert.h>
#include <stdlib.h>
#include <string.h>

View File

@@ -1,3 +1,33 @@
/**************************************************************************
*
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
* Copyright 2010 LunarG, Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
#ifndef EGLMODE_INCLUDED
#define EGLMODE_INCLUDED

View File

@@ -1,3 +1,31 @@
/**************************************************************************
*
* Copyright 2009 Chia-I Wu <olvaffe@gmail.com>
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
#ifndef EGLMUTEX_INCLUDED
#define EGLMUTEX_INCLUDED

View File

@@ -1,3 +1,33 @@
/**************************************************************************
*
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
* Copyright 2010 LunarG, Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
/*
* Ideas for screen management extension to EGL.
*

View File

@@ -1,3 +1,33 @@
/**************************************************************************
*
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
* Copyright 2010 LunarG, Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
#ifndef EGLSCREEN_INCLUDED
#define EGLSCREEN_INCLUDED

View File

@@ -1,3 +1,33 @@
/**************************************************************************
*
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
* Copyright 2010-2011 LunarG, Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
/**
* String utils.
*/

View File

@@ -1,3 +1,33 @@
/**************************************************************************
*
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
* Copyright 2010-2011 LunarG, Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
#ifndef EGLSTRING_INCLUDED
#define EGLSTRING_INCLUDED

View File

@@ -1,3 +1,33 @@
/**************************************************************************
*
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
* Copyright 2010 LunarG, Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
/**
* Surface-related functions.
*/

View File

@@ -1,3 +1,33 @@
/**************************************************************************
*
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
* Copyright 2010 LunarG, Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
#ifndef EGLSURFACE_INCLUDED
#define EGLSURFACE_INCLUDED

View File

@@ -1,3 +1,31 @@
/**************************************************************************
*
* Copyright 2010 LunarG, Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
#include <string.h>
#include "eglsync.h"

View File

@@ -1,3 +1,31 @@
/**************************************************************************
*
* Copyright 2010 LunarG, Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
#ifndef EGLSYNC_INCLUDED
#define EGLSYNC_INCLUDED

View File

@@ -1,3 +1,33 @@
/**************************************************************************
*
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
* Copyright 2010 LunarG, Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
#ifndef EGLTYPEDEFS_INCLUDED
#define EGLTYPEDEFS_INCLUDED

View File

@@ -34,6 +34,7 @@ depend:
clean:
rm -rf libwayland-drm.a $(wayland_drm_OBJECTS) \
$(GEN_SOURCES) $(GEN_HEADERS)
rm -f depend depend.bak
install:
@echo -n ""

View File

@@ -1,8 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<protocol name="drm">
<copyright>
Copyright © 2008-2011 Kristian Høgsberg
Copyright © 2010-2011 Intel Corporation
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
without fee, provided that\n the above copyright notice appear in
all copies and that both that copyright notice and this permission
notice appear in supporting documentation, and that the name of
the copyright holders not be used in advertising or publicity
pertaining to distribution of the software without specific,
written prior permission. The copyright holders make no
representations about the suitability of this software for any
purpose. It is provided "as is" without express or implied
warranty.
THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
THIS SOFTWARE.
</copyright>
<!-- drm support. This object is created by the server and published
using the display's global event. -->
<interface name="drm" version="1">
<interface name="wl_drm" version="1">
<enum name="error">
<entry name="authenticate_fail" value="0"/>
<entry name="invalid_visual" value="1"/>
<entry name="invalid_name" value="2"/>
</enum>
<!-- Call this request with the magic received from drmGetMagic().
It will be passed on to the drmAuthMagic() or
DRIAuthConnection() call. This authentication must be
@@ -14,12 +47,12 @@
<!-- Create a wayland buffer for the named DRM buffer. The DRM
surface must have a name using the flink ioctl -->
<request name="create_buffer">
<arg name="id" type="new_id" interface="buffer"/>
<arg name="id" type="new_id" interface="wl_buffer"/>
<arg name="name" type="uint"/>
<arg name="width" type="int"/>
<arg name="height" type="int"/>
<arg name="stride" type="uint"/>
<arg name="visual" type="object" interface="visual"/>
<arg name="visual" type="object" interface="wl_visual"/>
</request>
<!-- Notification of the path of the drm device which is used by

View File

@@ -1,5 +1,6 @@
/*
* Copyright © 2011 Kristian Høgsberg
* Copyright © 2011 Benjamin Franzke
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -35,25 +36,26 @@
#include "wayland-drm.h"
#include "wayland-drm-server-protocol.h"
#include "egldisplay.h"
#include "egldriver.h"
#include "eglimage.h"
#include "egltypedefs.h"
struct wl_drm {
struct wl_object object;
struct wl_display *display;
_EGLDisplay *edisp;
void *user_data;
char *device_name;
authenticate_t authenticate;
struct wayland_drm_callbacks *callbacks;
};
struct wl_drm_buffer {
struct wl_buffer buffer;
struct wl_drm *drm;
void *driver_buffer;
};
static void
drm_buffer_damage(struct wl_buffer *buffer_base,
struct wl_surface *surface,
int32_t x, int32_t y, int32_t width, int32_t height)
buffer_damage(struct wl_client *client, struct wl_buffer *buffer,
int32_t x, int32_t y, int32_t width, int32_t height)
{
}
@@ -61,19 +63,21 @@ static void
destroy_buffer(struct wl_resource *resource, struct wl_client *client)
{
struct wl_drm_buffer *buffer = (struct wl_drm_buffer *) resource;
_EGLDriver *drv = buffer->drm->edisp->Driver;
struct wl_drm *drm = buffer->drm;
drv->API.DestroyImageKHR(drv, buffer->drm->edisp, buffer->image);
drm->callbacks->release_buffer(drm->user_data,
buffer->driver_buffer);
free(buffer);
}
static void
buffer_destroy(struct wl_client *client, struct wl_buffer *buffer)
{
wl_resource_destroy(&buffer->resource, client);
wl_resource_destroy(&buffer->resource, client, 0);
}
const static struct wl_buffer_interface buffer_interface = {
const static struct wl_buffer_interface drm_buffer_interface = {
buffer_damage,
buffer_destroy
};
@@ -83,62 +87,42 @@ drm_create_buffer(struct wl_client *client, struct wl_drm *drm,
uint32_t stride, struct wl_visual *visual)
{
struct wl_drm_buffer *buffer;
EGLint attribs[] = {
EGL_WIDTH, 0,
EGL_HEIGHT, 0,
EGL_DRM_BUFFER_STRIDE_MESA, 0,
EGL_DRM_BUFFER_FORMAT_MESA, EGL_DRM_BUFFER_FORMAT_ARGB32_MESA,
EGL_NONE
};
_EGLDriver *drv = drm->edisp->Driver;
buffer = malloc(sizeof *buffer);
buffer = calloc(1, sizeof *buffer);
if (buffer == NULL) {
wl_client_post_no_memory(client);
return;
}
buffer->drm = drm;
buffer->buffer.compositor = NULL;
buffer->buffer.width = width;
buffer->buffer.height = height;
buffer->buffer.visual = visual;
buffer->buffer.attach = NULL;
buffer->buffer.damage = drm_buffer_damage;
buffer->buffer.client = client;
if (visual->object.interface != &wl_visual_interface) {
/* FIXME: Define a real exception event instead of
* abusing this one */
wl_client_post_event(client,
(struct wl_object *) drm->display,
WL_DISPLAY_INVALID_OBJECT, 0);
fprintf(stderr, "invalid visual in create_buffer\n");
if (!visual || visual->object.interface != &wl_visual_interface) {
wl_client_post_error(client, &drm->object,
WL_DRM_ERROR_INVALID_VISUAL,
"invalid visual");
return;
}
attribs[1] = width;
attribs[3] = height;
attribs[5] = stride / 4;
buffer->image = drv->API.CreateImageKHR(drv, drm->edisp,
EGL_NO_CONTEXT,
EGL_DRM_BUFFER_MESA,
(EGLClientBuffer) (intptr_t) name,
attribs);
buffer->driver_buffer =
drm->callbacks->reference_buffer(drm->user_data, name,
width, height,
stride, visual);
if (buffer->image == NULL) {
/* FIXME: Define a real exception event instead of
* abusing this one */
wl_client_post_event(client,
(struct wl_object *) drm->display,
WL_DISPLAY_INVALID_OBJECT, 0);
fprintf(stderr, "failed to create image for name %d\n", name);
if (buffer->driver_buffer == NULL) {
wl_client_post_error(client, &drm->object,
WL_DRM_ERROR_INVALID_NAME,
"invalid name");
return;
}
buffer->buffer.resource.object.id = id;
buffer->buffer.resource.object.interface = &wl_buffer_interface;
buffer->buffer.resource.object.implementation = (void (**)(void))
&buffer_interface;
&drm_buffer_interface;
buffer->buffer.resource.destroy = destroy_buffer;
@@ -149,10 +133,10 @@ static void
drm_authenticate(struct wl_client *client,
struct wl_drm *drm, uint32_t id)
{
if (drm->authenticate(drm->edisp, id) < 0)
wl_client_post_event(client,
(struct wl_object *) drm->display,
WL_DISPLAY_INVALID_OBJECT, 0);
if (drm->callbacks->authenticate(drm->user_data, id) < 0)
wl_client_post_error(client, &drm->object,
WL_DRM_ERROR_AUTHENTICATE_FAIL,
"authenicate failed");
else
wl_client_post_event(client, &drm->object,
WL_DRM_AUTHENTICATED);
@@ -164,7 +148,8 @@ const static struct wl_drm_interface drm_interface = {
};
static void
post_drm_device(struct wl_client *client, struct wl_object *global)
post_drm_device(struct wl_client *client,
struct wl_object *global, uint32_t version)
{
struct wl_drm *drm = (struct wl_drm *) global;
@@ -172,17 +157,17 @@ post_drm_device(struct wl_client *client, struct wl_object *global)
}
struct wl_drm *
wayland_drm_init(struct wl_display *display, _EGLDisplay *disp,
authenticate_t authenticate, char *device_name)
wayland_drm_init(struct wl_display *display, char *device_name,
struct wayland_drm_callbacks *callbacks, void *user_data)
{
struct wl_drm *drm;
drm = malloc(sizeof *drm);
drm->display = display;
drm->edisp = disp;
drm->authenticate = authenticate;
drm->device_name = strdup(device_name);
drm->callbacks = callbacks;
drm->user_data = user_data;
drm->object.interface = &wl_drm_interface;
drm->object.implementation = (void (**)(void)) &drm_interface;
@@ -193,7 +178,7 @@ wayland_drm_init(struct wl_display *display, _EGLDisplay *disp,
}
void
wayland_drm_destroy(struct wl_drm *drm)
wayland_drm_uninit(struct wl_drm *drm)
{
free(drm->device_name);
@@ -201,3 +186,18 @@ wayland_drm_destroy(struct wl_drm *drm)
free(drm);
}
int
wayland_buffer_is_drm(struct wl_buffer *buffer)
{
return buffer->resource.object.implementation ==
(void (**)(void)) &drm_buffer_interface;
}
void *
wayland_drm_buffer_get_buffer(struct wl_buffer *buffer_base)
{
struct wl_drm_buffer *buffer = (struct wl_drm_buffer *) buffer_base;
return buffer->driver_buffer;
}

View File

@@ -8,19 +8,27 @@
struct wl_drm;
typedef int (*authenticate_t) (_EGLDisplay *disp, uint32_t id);
struct wayland_drm_callbacks {
int (*authenticate)(void *user_data, uint32_t id);
struct wl_drm_buffer {
struct wl_buffer buffer;
struct wl_drm *drm;
_EGLImage *image;
void *(*reference_buffer)(void *user_data, uint32_t name,
int32_t width, int32_t height,
uint32_t stride, struct wl_visual *visual);
void (*release_buffer)(void *user_data, void *buffer);
};
struct wl_drm *
wayland_drm_init(struct wl_display *display, _EGLDisplay *disp,
authenticate_t authenticate, char *device_name);
wayland_drm_init(struct wl_display *display, char *device_name,
struct wayland_drm_callbacks *callbacks, void *user_data);
void
wayland_drm_destroy(struct wl_drm *drm);
wayland_drm_uninit(struct wl_drm *drm);
int
wayland_buffer_is_drm(struct wl_buffer *buffer);
void *
wayland_drm_buffer_get_buffer(struct wl_buffer *buffer);
#endif

View File

@@ -12,20 +12,8 @@ extern "C" {
#define WL_EGL_EXPORT
#endif
#include <stdbool.h>
#include <wayland-client.h>
struct wl_egl_display {
struct wl_display *display;
struct wl_drm *drm;
int fd;
char *device_name;
bool authenticated;
void (*glFlush)(void);
};
struct wl_egl_window {
struct wl_surface *surface;
struct wl_visual *visual;
@@ -40,13 +28,11 @@ struct wl_egl_window {
};
struct wl_egl_pixmap {
struct wl_egl_display *display;
struct wl_visual *visual;
struct wl_visual *visual;
struct wl_buffer *buffer;
int name;
int width;
int height;
int stride;
void (*destroy) (struct wl_egl_pixmap *egl_pixmap);

View File

@@ -1,130 +1,8 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <dlfcn.h>
#include <wayland-client.h>
#include "wayland-egl.h"
#include "wayland-egl-priv.h"
#include "wayland-drm-client-protocol.h"
#include <xf86drm.h>
static void
drm_handle_device(void *data, struct wl_drm *drm, const char *device)
{
struct wl_egl_display *egl_display = data;
drm_magic_t magic;
egl_display->device_name = strdup(device);
egl_display->fd = open(egl_display->device_name, O_RDWR);
if (egl_display->fd == -1) {
fprintf(stderr, "wayland-egl: could not open %s (%s)",
egl_display->device_name, strerror(errno));
return;
}
drmGetMagic(egl_display->fd, &magic);
wl_drm_authenticate(egl_display->drm, magic);
}
static void
drm_handle_authenticated(void *data, struct wl_drm *drm)
{
struct wl_egl_display *egl_display = data;
egl_display->authenticated = true;
}
static const struct wl_drm_listener drm_listener = {
drm_handle_device,
drm_handle_authenticated
};
static void
wl_display_handle_global(struct wl_display *display, uint32_t id,
const char *interface, uint32_t version, void *data)
{
struct wl_egl_display *egl_display = data;
if (strcmp(interface, "drm") == 0) {
egl_display->drm = wl_drm_create(display, id);
wl_drm_add_listener(egl_display->drm, &drm_listener,
egl_display);
}
}
/* stolen from egl_dri2:dri2_load() */
static void *
get_flush_address() {
void *handle;
void *(*get_proc_address)(const char *procname);
handle = dlopen(NULL, RTLD_LAZY | RTLD_GLOBAL);
if (handle) {
get_proc_address = (void* (*)(const char *))
dlsym(handle, "_glapi_get_proc_address");
/* no need to keep a reference */
dlclose(handle);
}
/*
* If glapi is not available, loading DRI drivers will fail. Ideally, we
* should load one of libGL, libGLESv1_CM, or libGLESv2 and go on. But if
* the app has loaded another one of them with RTLD_LOCAL, there may be
* unexpected behaviors later because there will be two copies of glapi
* (with global variables of the same names!) in the memory.
*/
if (!get_proc_address) {
fprintf(stderr, "failed to find _glapi_get_proc_address");
return NULL;
}
return get_proc_address("glFlush");
}
WL_EGL_EXPORT struct wl_egl_display *
wl_egl_display_create(struct wl_display *display)
{
struct wl_egl_display *egl_display;
egl_display = malloc(sizeof *egl_display);
if (!egl_display)
return NULL;
egl_display->display = display;
egl_display->drm = NULL;
egl_display->fd = -1;
egl_display->device_name = NULL;
egl_display->authenticated = false;
egl_display->glFlush = (void (*)(void)) get_flush_address();
wl_display_add_global_listener(display, wl_display_handle_global,
egl_display);
return egl_display;
}
WL_EGL_EXPORT void
wl_egl_display_destroy(struct wl_egl_display *egl_display)
{
free(egl_display->device_name);
close(egl_display->fd);
wl_drm_destroy(egl_display->drm);
free(egl_display);
}
WL_EGL_EXPORT void
wl_egl_window_resize(struct wl_egl_window *egl_window,
@@ -138,8 +16,7 @@ wl_egl_window_resize(struct wl_egl_window *egl_window,
}
WL_EGL_EXPORT struct wl_egl_window *
wl_egl_window_create(struct wl_egl_display *egl_display,
struct wl_surface *surface,
wl_egl_window_create(struct wl_surface *surface,
int width, int height,
struct wl_visual *visual)
{
@@ -175,8 +52,7 @@ wl_egl_window_get_attached_size(struct wl_egl_window *egl_window,
}
WL_EGL_EXPORT struct wl_egl_pixmap *
wl_egl_pixmap_create(struct wl_egl_display *egl_display,
int width, int height,
wl_egl_pixmap_create(int width, int height,
struct wl_visual *visual, uint32_t flags)
{
struct wl_egl_pixmap *egl_pixmap;
@@ -185,14 +61,13 @@ wl_egl_pixmap_create(struct wl_egl_display *egl_display,
if (egl_pixmap == NULL)
return NULL;
egl_pixmap->display = egl_display;
egl_pixmap->width = width;
egl_pixmap->height = height;
egl_pixmap->visual = visual;
egl_pixmap->name = 0;
egl_pixmap->stride = 0;
egl_pixmap->destroy = NULL;
egl_pixmap->buffer = NULL;
egl_pixmap->driver_private = NULL;
return egl_pixmap;
}
@@ -206,21 +81,7 @@ wl_egl_pixmap_destroy(struct wl_egl_pixmap *egl_pixmap)
}
WL_EGL_EXPORT struct wl_buffer *
wl_egl_pixmap_create_buffer(struct wl_egl_display *egl_display,
struct wl_egl_pixmap *egl_pixmap)
wl_egl_pixmap_create_buffer(struct wl_egl_pixmap *egl_pixmap)
{
if (egl_pixmap->name == 0)
return NULL;
return wl_drm_create_buffer(egl_display->drm, egl_pixmap->name,
egl_pixmap->width, egl_pixmap->height,
egl_pixmap->stride, egl_pixmap->visual);
}
WL_EGL_EXPORT void
wl_egl_pixmap_flush(struct wl_egl_display *egl_display,
struct wl_egl_pixmap *egl_pixmap)
{
if (egl_display->glFlush)
egl_display->glFlush();
return egl_pixmap->buffer;
}

View File

@@ -53,7 +53,7 @@ if env['drm']:
# Needed by some state trackers
SConscript('winsys/sw/null/SConscript')
if env['platform'] != 'embedded':
if not env['embedded']:
SConscript('state_trackers/vega/SConscript')
SConscript('state_trackers/egl/SConscript')
@@ -66,8 +66,8 @@ if env['platform'] != 'embedded':
if env['dri'] and env['xorg']:
SConscript('state_trackers/xorg/SConscript')
if env['platform'] == 'windows':
SConscript('state_trackers/wgl/SConscript')
if env['platform'] == 'windows':
SConscript('state_trackers/wgl/SConscript')
#
# Winsys
@@ -83,55 +83,55 @@ SConscript([
'targets/graw-null/SConscript',
])
if env['platform'] != 'embedded':
if not env['embedded']:
SConscript([
'targets/egl-static/SConscript'
])
if env['x11']:
SConscript([
'targets/graw-xlib/SConscript',
'targets/libgl-xlib/SConscript',
])
if env['platform'] == 'windows':
SConscript([
'targets/graw-gdi/SConscript',
'targets/libgl-gdi/SConscript',
])
if env['dri']:
SConscript([
'targets/SConscript.dri',
'targets/dri-swrast/SConscript',
'targets/dri-vmwgfx/SConscript',
#'targets/dri-nouveau/SConscript',
])
if env['drm_intel']:
if env['x11']:
SConscript([
'targets/dri-i915/SConscript',
'targets/dri-i965/SConscript',
])
if env['drm_radeon']:
SConscript([
'targets/dri-r300/SConscript',
'targets/dri-r600/SConscript',
'targets/graw-xlib/SConscript',
'targets/libgl-xlib/SConscript',
])
if env['xorg'] and env['drm']:
SConscript([
#'targets/xorg-i915/SConscript',
#'targets/xorg-i965/SConscript',
#'targets/xorg-nouveau/SConscript',
#'targets/xorg-radeon/SConscript',
'targets/xorg-vmwgfx/SConscript',
])
if env['platform'] == 'windows':
SConscript([
'targets/graw-gdi/SConscript',
'targets/libgl-gdi/SConscript',
])
if env['dri']:
SConscript([
'targets/SConscript.dri',
'targets/dri-swrast/SConscript',
'targets/dri-vmwgfx/SConscript',
#'targets/dri-nouveau/SConscript',
])
if env['drm_intel']:
SConscript([
'targets/dri-i915/SConscript',
'targets/dri-i965/SConscript',
])
if env['drm_radeon']:
SConscript([
'targets/dri-r300/SConscript',
'targets/dri-r600/SConscript',
])
if env['xorg'] and env['drm']:
SConscript([
#'targets/xorg-i915/SConscript',
#'targets/xorg-i965/SConscript',
#'targets/xorg-nouveau/SConscript',
#'targets/xorg-radeon/SConscript',
'targets/xorg-vmwgfx/SConscript',
])
#
# Unit tests & tools
#
if env['platform'] != 'embedded':
if not env['embedded']:
SConscript('tests/unit/SConscript')
SConscript('tests/graw/SConscript')

View File

@@ -44,7 +44,7 @@ C_SOURCES = \
draw/draw_vs_exec.c \
draw/draw_vs_ppc.c \
draw/draw_vs_sse.c \
draw/draw_vs_varient.c \
draw/draw_vs_variant.c \
indices/u_indices_gen.c \
indices/u_unfilled_gen.c \
os/os_misc.c \

View File

@@ -88,7 +88,7 @@ source = [
'draw/draw_vs_exec.c',
'draw/draw_vs_ppc.c',
'draw/draw_vs_sse.c',
'draw/draw_vs_varient.c',
'draw/draw_vs_variant.c',
#'indices/u_indices.c',
#'indices/u_unfilled_indices.c',
'indices/u_indices_gen.c',

View File

@@ -37,13 +37,7 @@
struct cso_cache {
struct cso_hash *blend_hash;
struct cso_hash *depth_stencil_hash;
struct cso_hash *fs_hash;
struct cso_hash *vs_hash;
struct cso_hash *rasterizer_hash;
struct cso_hash *sampler_hash;
struct cso_hash *velements_hash;
struct cso_hash *hashes[CSO_CACHE_MAX];
int max_size;
cso_sanitize_callback sanitize_cb;
@@ -86,34 +80,10 @@ unsigned cso_construct_key(void *item, int item_size)
return hash_key((item), item_size);
}
static struct cso_hash *_cso_hash_for_type(struct cso_cache *sc, enum cso_cache_type type)
static INLINE struct cso_hash *_cso_hash_for_type(struct cso_cache *sc, enum cso_cache_type type)
{
struct cso_hash *hash = 0;
switch(type) {
case CSO_BLEND:
hash = sc->blend_hash;
break;
case CSO_SAMPLER:
hash = sc->sampler_hash;
break;
case CSO_DEPTH_STENCIL_ALPHA:
hash = sc->depth_stencil_hash;
break;
case CSO_RASTERIZER:
hash = sc->rasterizer_hash;
break;
case CSO_FRAGMENT_SHADER:
hash = sc->fs_hash;
break;
case CSO_VERTEX_SHADER:
hash = sc->vs_hash;
break;
case CSO_VELEMENTS:
hash = sc->velements_hash;
break;
}
struct cso_hash *hash;
hash = sc->hashes[type];
return hash;
}
@@ -298,17 +268,14 @@ void * cso_take_state(struct cso_cache *sc,
struct cso_cache *cso_cache_create(void)
{
struct cso_cache *sc = MALLOC_STRUCT(cso_cache);
int i;
if (sc == NULL)
return NULL;
sc->max_size = 4096;
sc->blend_hash = cso_hash_create();
sc->sampler_hash = cso_hash_create();
sc->depth_stencil_hash = cso_hash_create();
sc->rasterizer_hash = cso_hash_create();
sc->fs_hash = cso_hash_create();
sc->vs_hash = cso_hash_create();
sc->velements_hash = cso_hash_create();
for (i = 0; i < CSO_CACHE_MAX; i++)
sc->hashes[i] = cso_hash_create();
sc->sanitize_cb = sanitize_cb;
sc->sanitize_data = 0;
@@ -318,33 +285,9 @@ struct cso_cache *cso_cache_create(void)
void cso_for_each_state(struct cso_cache *sc, enum cso_cache_type type,
cso_state_callback func, void *user_data)
{
struct cso_hash *hash = 0;
struct cso_hash *hash = _cso_hash_for_type(sc, type);
struct cso_hash_iter iter;
switch (type) {
case CSO_BLEND:
hash = sc->blend_hash;
break;
case CSO_SAMPLER:
hash = sc->sampler_hash;
break;
case CSO_DEPTH_STENCIL_ALPHA:
hash = sc->depth_stencil_hash;
break;
case CSO_RASTERIZER:
hash = sc->rasterizer_hash;
break;
case CSO_FRAGMENT_SHADER:
hash = sc->fs_hash;
break;
case CSO_VERTEX_SHADER:
hash = sc->vs_hash;
break;
case CSO_VELEMENTS:
hash = sc->velements_hash;
break;
}
iter = cso_hash_first_node(hash);
while (!cso_hash_iter_is_null(iter)) {
void *state = cso_hash_iter_data(iter);
@@ -357,6 +300,7 @@ void cso_for_each_state(struct cso_cache *sc, enum cso_cache_type type,
void cso_cache_delete(struct cso_cache *sc)
{
int i;
assert(sc);
if (!sc)
@@ -371,28 +315,20 @@ void cso_cache_delete(struct cso_cache *sc)
cso_for_each_state(sc, CSO_SAMPLER, delete_sampler_state, 0);
cso_for_each_state(sc, CSO_VELEMENTS, delete_velements, 0);
cso_hash_delete(sc->blend_hash);
cso_hash_delete(sc->sampler_hash);
cso_hash_delete(sc->depth_stencil_hash);
cso_hash_delete(sc->rasterizer_hash);
cso_hash_delete(sc->fs_hash);
cso_hash_delete(sc->vs_hash);
cso_hash_delete(sc->velements_hash);
for (i = 0; i < CSO_CACHE_MAX; i++)
cso_hash_delete(sc->hashes[i]);
FREE(sc);
}
void cso_set_maximum_cache_size(struct cso_cache *sc, int number)
{
int i;
sc->max_size = number;
sanitize_hash(sc, sc->blend_hash, CSO_BLEND, sc->max_size);
sanitize_hash(sc, sc->depth_stencil_hash, CSO_DEPTH_STENCIL_ALPHA,
sc->max_size);
sanitize_hash(sc, sc->fs_hash, CSO_FRAGMENT_SHADER, sc->max_size);
sanitize_hash(sc, sc->vs_hash, CSO_VERTEX_SHADER, sc->max_size);
sanitize_hash(sc, sc->rasterizer_hash, CSO_RASTERIZER, sc->max_size);
sanitize_hash(sc, sc->sampler_hash, CSO_SAMPLER, sc->max_size);
sanitize_hash(sc, sc->velements_hash, CSO_VELEMENTS, sc->max_size);
for (i = 0; i < CSO_CACHE_MAX; i++)
sanitize_hash(sc, sc->hashes[i], i, sc->max_size);
}
int cso_maximum_cache_size(const struct cso_cache *sc)

View File

@@ -86,13 +86,14 @@ extern "C" {
#endif
enum cso_cache_type {
CSO_BLEND,
CSO_SAMPLER,
CSO_DEPTH_STENCIL_ALPHA,
CSO_RASTERIZER,
CSO_BLEND,
CSO_DEPTH_STENCIL_ALPHA,
CSO_FRAGMENT_SHADER,
CSO_VERTEX_SHADER,
CSO_VELEMENTS
CSO_SAMPLER,
CSO_VELEMENTS,
CSO_CACHE_MAX,
};
typedef void (*cso_state_callback)(void *ctx, void *obj);

View File

@@ -128,8 +128,8 @@ boolean draw_init(struct draw_context *draw)
ASSIGN_4V( draw->plane[4], 0, 0, 1, 1 ); /* yes these are correct */
ASSIGN_4V( draw->plane[5], 0, 0, -1, 1 ); /* mesa's a bit wonky */
draw->nr_planes = 6;
draw->clip_xy = 1;
draw->clip_z = 1;
draw->clip_xy = TRUE;
draw->clip_z = TRUE;
draw->reduced_prim = ~0; /* != any of PIPE_PRIM_x */

View File

@@ -243,7 +243,7 @@ boolean draw_need_pipeline(const struct draw_context *draw,
unsigned prim );
static INLINE int
draw_get_shader_param(unsigned shader, enum pipe_cap param)
draw_get_shader_param(unsigned shader, enum pipe_shader_cap param)
{
switch(shader) {
case PIPE_SHADER_VERTEX:

View File

@@ -435,6 +435,7 @@ draw_llvm_create_variant(struct draw_llvm *llvm,
return variant;
}
static void
generate_vs(struct draw_llvm *llvm,
LLVMBuilderRef builder,
@@ -464,8 +465,7 @@ generate_vs(struct draw_llvm *llvm,
tgsi_dump(tokens, 0);
}
if (llvm->draw->num_sampler_views &&
llvm->draw->num_samplers)
if (llvm->draw->num_sampler_views && llvm->draw->num_samplers)
sampler = draw_sampler;
lp_build_tgsi_soa(llvm->gallivm,
@@ -480,8 +480,7 @@ generate_vs(struct draw_llvm *llvm,
sampler,
&llvm->draw->vs.vertex_shader->info);
if(clamp_vertex_color)
{
if (clamp_vertex_color) {
LLVMValueRef out;
unsigned chan, attrib;
struct lp_build_context bld;
@@ -489,8 +488,8 @@ generate_vs(struct draw_llvm *llvm,
lp_build_context_init(&bld, llvm->gallivm, vs_type);
for (attrib = 0; attrib < info->num_outputs; ++attrib) {
for(chan = 0; chan < NUM_CHANNELS; ++chan) {
if(outputs[attrib][chan]) {
for (chan = 0; chan < NUM_CHANNELS; ++chan) {
if (outputs[attrib][chan]) {
switch (info->output_semantic_name[attrib]) {
case TGSI_SEMANTIC_COLOR:
case TGSI_SEMANTIC_BCOLOR:
@@ -505,6 +504,7 @@ generate_vs(struct draw_llvm *llvm,
}
}
#if DEBUG_STORE
static void print_vectorf(LLVMBuilderRef builder,
LLVMValueRef vec)
@@ -523,6 +523,7 @@ static void print_vectorf(LLVMBuilderRef builder,
}
#endif
static void
generate_fetch(struct gallivm_state *gallivm,
LLVMValueRef vbuffers_ptr,
@@ -566,6 +567,7 @@ generate_fetch(struct gallivm_state *gallivm,
*res = draw_llvm_translate_from(gallivm, vbuffer_ptr, velem->src_format);
}
static LLVMValueRef
aos_to_soa(struct gallivm_state *gallivm,
LLVMValueRef val0,
@@ -609,6 +611,7 @@ aos_to_soa(struct gallivm_state *gallivm,
return res;
}
static void
soa_to_aos(struct gallivm_state *gallivm,
LLVMValueRef soa[NUM_CHANNELS],
@@ -645,6 +648,7 @@ soa_to_aos(struct gallivm_state *gallivm,
}
}
static void
convert_to_soa(struct gallivm_state *gallivm,
LLVMValueRef (*aos)[NUM_CHANNELS],
@@ -672,6 +676,7 @@ convert_to_soa(struct gallivm_state *gallivm,
}
}
static void
store_aos(struct gallivm_state *gallivm,
LLVMValueRef io_ptr,
@@ -748,6 +753,7 @@ store_aos(struct gallivm_state *gallivm,
#endif
}
static void
store_aos_array(struct gallivm_state *gallivm,
LLVMValueRef io_ptr,
@@ -796,6 +802,7 @@ store_aos_array(struct gallivm_state *gallivm,
store_aos(gallivm, io3_ptr, attr_index, aos[3], clipmask3);
}
static void
convert_to_aos(struct gallivm_state *gallivm,
LLVMValueRef io,
@@ -813,8 +820,8 @@ convert_to_aos(struct gallivm_state *gallivm,
for (attrib = 0; attrib < num_outputs; ++attrib) {
LLVMValueRef soa[4];
LLVMValueRef aos[4];
for(chan = 0; chan < NUM_CHANNELS; ++chan) {
if(outputs[attrib][chan]) {
for (chan = 0; chan < NUM_CHANNELS; ++chan) {
if (outputs[attrib][chan]) {
LLVMValueRef out = LLVMBuildLoad(builder, outputs[attrib][chan], "");
lp_build_name(out, "output%u.%c", attrib, "xyzw"[chan]);
/*lp_build_printf(builder, "output %d : %d ",
@@ -822,8 +829,10 @@ convert_to_aos(struct gallivm_state *gallivm,
LLVMConstInt(LLVMInt32Type(), chan, 0));
print_vectorf(builder, out);*/
soa[chan] = out;
} else
}
else {
soa[chan] = 0;
}
}
soa_to_aos(gallivm, soa, aos);
store_aos_array(gallivm,
@@ -838,7 +847,8 @@ convert_to_aos(struct gallivm_state *gallivm,
#endif
}
/*
/**
* Stores original vertex positions in clip coordinates
* There is probably a more efficient way to do this, 4 floats at once
* rather than extracting each element one by one.
@@ -880,7 +890,7 @@ store_clip(struct gallivm_state *gallivm,
clip_ptr2 = draw_jit_header_clip(gallivm, io2_ptr);
clip_ptr3 = draw_jit_header_clip(gallivm, io3_ptr);
for (i = 0; i<4; i++){
for (i = 0; i<4; i++) {
clip0_ptr = LLVMBuildGEP(builder, clip_ptr0, indices, 2, ""); /* x0 */
clip1_ptr = LLVMBuildGEP(builder, clip_ptr1, indices, 2, ""); /* x1 */
clip2_ptr = LLVMBuildGEP(builder, clip_ptr2, indices, 2, ""); /* x2 */
@@ -901,7 +911,9 @@ store_clip(struct gallivm_state *gallivm,
}
/* Equivalent of _mm_set1_ps(a)
/**
* Equivalent of _mm_set1_ps(a)
*/
static LLVMValueRef
vec4f_from_scalar(struct gallivm_state *gallivm,
@@ -912,7 +924,7 @@ vec4f_from_scalar(struct gallivm_state *gallivm,
LLVMValueRef res = LLVMGetUndef(LLVMVectorType(float_type, 4));
int i;
for(i = 0; i < 4; ++i) {
for (i = 0; i < 4; ++i) {
LLVMValueRef index = lp_build_const_int32(gallivm, i);
res = LLVMBuildInsertElement(gallivm->builder, res, a,
index, i == 3 ? name : "");
@@ -921,7 +933,8 @@ vec4f_from_scalar(struct gallivm_state *gallivm,
return res;
}
/*
/**
* Transforms the outputs for viewport mapping
*/
static void
@@ -942,7 +955,7 @@ generate_viewport(struct draw_llvm *llvm,
LLVMBuildStore(builder, out3, outputs[0][3]);
/* Viewport Mapping */
for (i=0; i<3; i++){
for (i=0; i<3; i++) {
LLVMValueRef out = LLVMBuildLoad(builder, outputs[0][i], ""); /*x0 x1 x2 x3*/
LLVMValueRef scale;
LLVMValueRef trans;
@@ -973,7 +986,7 @@ generate_viewport(struct draw_llvm *llvm,
}
/*
/**
* Returns clipmask as 4xi32 bitmask for the 4 vertices
*/
static LLVMValueRef
@@ -992,9 +1005,7 @@ generate_clipmask(struct gallivm_state *gallivm,
LLVMValueRef zero, shift;
LLVMValueRef pos_x, pos_y, pos_z, pos_w;
LLVMValueRef plane1, planes, plane_ptr, sum;
unsigned i;
struct lp_type f32_type = lp_type_float_vec(32);
mask = lp_build_const_int_vec(gallivm, lp_type_int_vec(32), 0);
@@ -1009,7 +1020,7 @@ generate_clipmask(struct gallivm_state *gallivm,
pos_w = LLVMBuildLoad(builder, outputs[0][3], ""); /*w0 w1 w2 w3*/
/* Cliptest, for hardwired planes */
if (clip_xy){
if (clip_xy) {
/* plane 1 */
test = lp_build_compare(gallivm, f32_type, PIPE_FUNC_GREATER, pos_x , pos_w);
temp = shift;
@@ -1037,15 +1048,15 @@ generate_clipmask(struct gallivm_state *gallivm,
mask = LLVMBuildOr(builder, mask, test, "");
}
if (clip_z){
if (clip_z) {
temp = lp_build_const_int_vec(gallivm, lp_type_int_vec(32), 16);
if (clip_halfz){
if (clip_halfz) {
/* plane 5 */
test = lp_build_compare(gallivm, f32_type, PIPE_FUNC_GREATER, zero, pos_z);
test = LLVMBuildAnd(builder, test, temp, "");
mask = LLVMBuildOr(builder, mask, test, "");
}
else{
else {
/* plane 5 */
test = LLVMBuildFAdd(builder, pos_z, pos_w, "");
test = lp_build_compare(gallivm, f32_type, PIPE_FUNC_GREATER, zero, test);
@@ -1059,7 +1070,7 @@ generate_clipmask(struct gallivm_state *gallivm,
mask = LLVMBuildOr(builder, mask, test, "");
}
if (clip_user){
if (clip_user) {
LLVMValueRef planes_ptr = draw_jit_context_planes(gallivm, context_ptr);
LLVMValueRef indices[3];
temp = lp_build_const_int_vec(gallivm, lp_type_int_vec(32), 32);
@@ -1105,7 +1116,8 @@ generate_clipmask(struct gallivm_state *gallivm,
return mask;
}
/*
/**
* Returns boolean if any clipping has occurred
* Used zero/non-zero i32 value to represent boolean
*/
@@ -1119,7 +1131,7 @@ clipmask_bool(struct gallivm_state *gallivm,
LLVMValueRef temp;
int i;
for (i=0; i<4; i++){
for (i=0; i<4; i++) {
temp = LLVMBuildExtractElement(builder, clipmask,
lp_build_const_int32(gallivm, i) , "");
ret = LLVMBuildOr(builder, ret, temp, "");
@@ -1128,6 +1140,7 @@ clipmask_bool(struct gallivm_state *gallivm,
LLVMBuildStore(builder, ret, ret_ptr);
}
static void
draw_llvm_generate(struct draw_llvm *llvm, struct draw_llvm_variant *variant)
{
@@ -1172,8 +1185,8 @@ draw_llvm_generate(struct draw_llvm *llvm, struct draw_llvm_variant *variant)
variant->function = LLVMAddFunction(gallivm->module, "draw_llvm_shader",
func_type);
LLVMSetFunctionCallConv(variant->function, LLVMCCallConv);
for(i = 0; i < Elements(arg_types); ++i)
if(LLVMGetTypeKind(arg_types[i]) == LLVMPointerTypeKind)
for (i = 0; i < Elements(arg_types); ++i)
if (LLVMGetTypeKind(arg_types[i]) == LLVMPointerTypeKind)
LLVMAddAttribute(LLVMGetParam(variant->function, i), LLVMNoAliasAttribute);
context_ptr = LLVMGetParam(variant->function, 0);
@@ -1271,7 +1284,7 @@ draw_llvm_generate(struct draw_llvm *llvm, struct draw_llvm_variant *variant)
store_clip(gallivm, io, outputs);
/* do cliptest */
if (enable_cliptest){
if (enable_cliptest) {
/* allocate clipmask, assign it integer type */
clipmask = generate_clipmask(gallivm, outputs,
variant->key.clip_xy,
@@ -1283,12 +1296,12 @@ draw_llvm_generate(struct draw_llvm *llvm, struct draw_llvm_variant *variant)
/* return clipping boolean value for function */
clipmask_bool(gallivm, clipmask, ret_ptr);
}
else{
else {
clipmask = lp_build_const_int_vec(gallivm, lp_type_int_vec(32), 0);
}
/* do viewport mapping */
if (!bypass_viewport){
if (!bypass_viewport) {
generate_viewport(llvm, builder, outputs, context_ptr);
}
@@ -1308,7 +1321,7 @@ draw_llvm_generate(struct draw_llvm *llvm, struct draw_llvm_variant *variant)
* Translate the LLVM IR into machine code.
*/
#ifdef DEBUG
if(LLVMVerifyFunction(variant->function, LLVMPrintMessageAction)) {
if (LLVMVerifyFunction(variant->function, LLVMPrintMessageAction)) {
lp_debug_dump_value(variant->function);
assert(0);
}
@@ -1375,8 +1388,8 @@ draw_llvm_generate_elts(struct draw_llvm *llvm, struct draw_llvm_variant *varian
variant->function_elts = LLVMAddFunction(gallivm->module, "draw_llvm_shader_elts", func_type);
LLVMSetFunctionCallConv(variant->function_elts, LLVMCCallConv);
for(i = 0; i < Elements(arg_types); ++i)
if(LLVMGetTypeKind(arg_types[i]) == LLVMPointerTypeKind)
for (i = 0; i < Elements(arg_types); ++i)
if (LLVMGetTypeKind(arg_types[i]) == LLVMPointerTypeKind)
LLVMAddAttribute(LLVMGetParam(variant->function_elts, i),
LLVMNoAliasAttribute);
@@ -1483,7 +1496,7 @@ draw_llvm_generate_elts(struct draw_llvm *llvm, struct draw_llvm_variant *varian
store_clip(gallivm, io, outputs);
/* do cliptest */
if (enable_cliptest){
if (enable_cliptest) {
/* allocate clipmask, assign it integer type */
clipmask = generate_clipmask(gallivm, outputs,
variant->key.clip_xy,
@@ -1495,12 +1508,12 @@ draw_llvm_generate_elts(struct draw_llvm *llvm, struct draw_llvm_variant *varian
/* return clipping boolean value for function */
clipmask_bool(gallivm, clipmask, ret_ptr);
}
else{
else {
clipmask = lp_build_const_int_vec(gallivm, lp_type_int_vec(32), 0);
}
/* do viewport mapping */
if (!bypass_viewport){
if (!bypass_viewport) {
generate_viewport(llvm, builder, outputs, context_ptr);
}
@@ -1523,7 +1536,7 @@ draw_llvm_generate_elts(struct draw_llvm *llvm, struct draw_llvm_variant *varian
* Translate the LLVM IR into machine code.
*/
#ifdef DEBUG
if(LLVMVerifyFunction(variant->function_elts, LLVMPrintMessageAction)) {
if (LLVMVerifyFunction(variant->function_elts, LLVMPrintMessageAction)) {
lp_debug_dump_value(variant->function_elts);
assert(0);
}
@@ -1595,6 +1608,7 @@ draw_llvm_make_variant_key(struct draw_llvm *llvm, char *store)
return key;
}
void
draw_llvm_set_mapped_texture(struct draw_context *draw,
unsigned sampler_idx,
@@ -1609,7 +1623,6 @@ draw_llvm_set_mapped_texture(struct draw_context *draw,
assert(sampler_idx < PIPE_MAX_VERTEX_SAMPLERS);
jit_tex = &draw->llvm->jit_context.textures[sampler_idx];
jit_tex->width = width;

View File

@@ -163,6 +163,7 @@ static void interp( const struct clip_stage *clip,
*/
static void emit_poly( struct draw_stage *stage,
struct vertex_header **inlist,
const boolean *edgeflags,
unsigned n,
const struct prim_header *origPrim)
{
@@ -181,6 +182,9 @@ static void emit_poly( struct draw_stage *stage,
edge_last = DRAW_PIPE_EDGE_FLAG_1;
}
if (!edgeflags[0])
edge_first = 0;
/* later stages may need the determinant, but only the sign matters */
header.det = origPrim->det;
header.flags = DRAW_PIPE_RESET_STIPPLE | edge_first | edge_middle;
@@ -199,7 +203,11 @@ static void emit_poly( struct draw_stage *stage,
header.v[2] = inlist[0]; /* the provoking vertex */
}
if (i == n-1)
if (!edgeflags[i-1]) {
header.flags &= ~edge_middle;
}
if (i == n - 1 && edgeflags[i])
header.flags |= edge_last;
if (0) {
@@ -248,15 +256,33 @@ do_clip_tri( struct draw_stage *stage,
unsigned tmpnr = 0;
unsigned n = 3;
unsigned i;
boolean aEdges[MAX_CLIPPED_VERTICES];
boolean bEdges[MAX_CLIPPED_VERTICES];
boolean *inEdges = aEdges;
boolean *outEdges = bEdges;
inlist[0] = header->v[0];
inlist[1] = header->v[1];
inlist[2] = header->v[2];
/*
* Note: at this point we can't just use the per-vertex edge flags.
* We have to observe the edge flag bits set in header->flags which
* were set during primitive decomposition. Put those flags into
* an edge flags array which parallels the vertex array.
* Later, in the 'unfilled' pipeline stage we'll draw the edge if both
* the header.flags bit is set AND the per-vertex edgeflag field is set.
*/
inEdges[0] = !!(header->flags & DRAW_PIPE_EDGE_FLAG_0);
inEdges[1] = !!(header->flags & DRAW_PIPE_EDGE_FLAG_1);
inEdges[2] = !!(header->flags & DRAW_PIPE_EDGE_FLAG_2);
while (clipmask && n >= 3) {
const unsigned plane_idx = ffs(clipmask)-1;
const boolean is_user_clip_plane = plane_idx >= 6;
const float *plane = clipper->plane[plane_idx];
struct vertex_header *vert_prev = inlist[0];
boolean *edge_prev = &inEdges[0];
float dp_prev = dot4( vert_prev->clip, plane );
unsigned outcount = 0;
@@ -266,9 +292,11 @@ do_clip_tri( struct draw_stage *stage,
if (n >= MAX_CLIPPED_VERTICES)
return;
inlist[n] = inlist[0]; /* prevent rotation of vertices */
inEdges[n] = inEdges[0];
for (i = 1; i <= n; i++) {
struct vertex_header *vert = inlist[i];
boolean *edge = &inEdges[i];
float dp = dot4( vert->clip, plane );
@@ -276,11 +304,13 @@ do_clip_tri( struct draw_stage *stage,
assert(outcount < MAX_CLIPPED_VERTICES);
if (outcount >= MAX_CLIPPED_VERTICES)
return;
outEdges[outcount] = *edge_prev;
outlist[outcount++] = vert_prev;
}
if (DIFFERENT_SIGNS(dp, dp_prev)) {
struct vertex_header *new_vert;
boolean *new_edge;
assert(tmpnr < MAX_CLIPPED_VERTICES + 1);
if (tmpnr >= MAX_CLIPPED_VERTICES + 1)
@@ -290,6 +320,8 @@ do_clip_tri( struct draw_stage *stage,
assert(outcount < MAX_CLIPPED_VERTICES);
if (outcount >= MAX_CLIPPED_VERTICES)
return;
new_edge = &outEdges[outcount];
outlist[outcount++] = new_vert;
if (IS_NEGATIVE(dp)) {
@@ -299,10 +331,22 @@ do_clip_tri( struct draw_stage *stage,
float t = dp / (dp - dp_prev);
interp( clipper, new_vert, t, vert, vert_prev );
/* Force edgeflag true in this case:
/* Whether or not to set edge flag for the new vert depends
* on whether it's a user-defined clipping plane. We're
* copying NVIDIA's behaviour here.
*/
new_vert->edgeflag = 1;
} else {
if (is_user_clip_plane) {
/* we want to see an edge along the clip plane */
*new_edge = TRUE;
new_vert->edgeflag = TRUE;
}
else {
/* we don't want to see an edge along the frustum clip plane */
*new_edge = *edge_prev;
new_vert->edgeflag = FALSE;
}
}
else {
/* Coming back in.
*/
float t = dp_prev / (dp_prev - dp);
@@ -311,10 +355,12 @@ do_clip_tri( struct draw_stage *stage,
/* Copy starting vert's edgeflag:
*/
new_vert->edgeflag = vert_prev->edgeflag;
*new_edge = *edge_prev;
}
}
vert_prev = vert;
edge_prev = edge;
dp_prev = dp;
}
@@ -325,6 +371,12 @@ do_clip_tri( struct draw_stage *stage,
outlist = tmp;
n = outcount;
}
{
boolean *tmp = inEdges;
inEdges = outEdges;
outEdges = tmp;
}
}
/* If flat-shading, copy provoking vertex color to polygon vertex[0]
@@ -353,7 +405,7 @@ do_clip_tri( struct draw_stage *stage,
/* Emit the polygon as triangles to the setup stage:
*/
emit_poly( stage, inlist, n, header );
emit_poly( stage, inlist, inEdges, n, header );
}
}

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