Compare commits

...

150 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
175 changed files with 4395 additions and 1534 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)
@@ -253,7 +253,6 @@ MAIN_FILES = \
$(DIRECTORY)/src/mesa/descrip.mms \
$(DIRECTORY)/src/mesa/gl.pc.in \
$(DIRECTORY)/src/mesa/osmesa.pc.in \
$(DIRECTORY)/src/mesa/depend \
$(MAIN_ES_FILES) \
$(DIRECTORY)/src/mesa/main/*.[chS] \
$(DIRECTORY)/src/mesa/main/*.cpp \
@@ -286,9 +285,6 @@ MAIN_FILES = \
$(DIRECTORY)/src/mesa/drivers/osmesa/descrip.mms \
$(DIRECTORY)/src/mesa/drivers/osmesa/osmesa.def \
$(DIRECTORY)/src/mesa/drivers/osmesa/*.[ch] \
$(DIRECTORY)/src/mesa/drivers/dri/r300/compiler/*.[ch] \
$(DIRECTORY)/src/mesa/drivers/dri/r300/compiler/Makefile \
$(DIRECTORY)/src/mesa/drivers/dri/r300/compiler/SConscript \
$(DIRECTORY)/src/mesa/drivers/windows/*/*.[ch] \
$(DIRECTORY)/src/mesa/drivers/windows/*/*.def \
$(DIRECTORY)/src/mesa/drivers/x11/Makefile \
@@ -394,6 +390,7 @@ DRI_FILES = \
$(DIRECTORY)/src/mesa/drivers/dri/*/*/*.[chS] \
$(DIRECTORY)/src/mesa/drivers/dri/*/Makefile \
$(DIRECTORY)/src/mesa/drivers/dri/*/*/Makefile \
$(DIRECTORY)/src/mesa/drivers/dri/*/*/SConscript \
$(DIRECTORY)/src/mesa/drivers/dri/*/Doxyfile
SGI_GLU_FILES = \
@@ -423,15 +420,13 @@ GLW_FILES = \
$(DIRECTORY)/src/glw/*.[ch] \
$(DIRECTORY)/src/glw/Makefile* \
$(DIRECTORY)/src/glw/README \
$(DIRECTORY)/src/glw/glw.pc.in \
$(DIRECTORY)/src/glw/depend
$(DIRECTORY)/src/glw/glw.pc.in
GLUT_FILES = \
$(DIRECTORY)/include/GL/glut.h \
$(DIRECTORY)/include/GL/glutf90.h \
$(DIRECTORY)/src/glut/glx/Makefile* \
$(DIRECTORY)/src/glut/glx/SConscript \
$(DIRECTORY)/src/glut/glx/depend \
$(DIRECTORY)/src/glut/glx/glut.pc.in \
$(DIRECTORY)/src/glut/glx/*def \
$(DIRECTORY)/src/glut/glx/*.[ch] \
@@ -439,13 +434,6 @@ GLUT_FILES = \
$(DIRECTORY)/src/glut/beos/*.cpp \
$(DIRECTORY)/src/glut/beos/Makefile
DEPEND_FILES = \
$(TOP)/src/mesa/depend \
$(TOP)/src/glx/depend \
$(TOP)/src/glw/depend \
$(TOP)/src/glut/glx/depend \
$(TOP)/src/glu/sgi/depend
LIB_FILES = \
$(MAIN_FILES) \
@@ -463,7 +451,7 @@ parsers: configure
-@touch $(TOP)/configs/current
$(MAKE) -C src/glsl glsl_parser.cpp glsl_parser.h glsl_lexer.cpp
$(MAKE) -C src/glsl/glcpp glcpp-lex.c glcpp-parse.c glcpp-parse.h
$(MAKE) -C src/mesa/program lex.yy.c program_parse.tab.c program_parse.tab.h
$(MAKE) -C src/mesa program/lex.yy.c program/program_parse.tab.c program/program_parse.tab.h
# Everything for new a Mesa release:
ARCHIVES = $(LIB_NAME).tar.gz \
@@ -483,27 +471,21 @@ AUTOCONF = autoconf
AC_FLAGS =
aclocal.m4: configure.ac acinclude.m4
$(ACLOCAL) $(ACLOCAL_FLAGS)
configure: rm_depend configure.ac aclocal.m4 acinclude.m4
configure: configure.ac aclocal.m4 acinclude.m4
$(AUTOCONF) $(AC_FLAGS)
rm_depend:
@for dep in $(DEPEND_FILES) ; do \
rm -f $$dep ; \
touch $$dep ; \
done
rm_config: parsers
rm -f configs/current
rm -f configs/autoconf
$(LIB_NAME).tar: rm_config
cd .. ; tar -cf $(DIRECTORY)/$(LIB_NAME).tar $(LIB_FILES)
cd .. ; tar --dereference -cf $(DIRECTORY)/$(LIB_NAME).tar $(LIB_FILES)
$(LIB_NAME).tar.gz: $(LIB_NAME).tar
gzip --stdout --best $(LIB_NAME).tar > $(LIB_NAME).tar.gz
$(GLUT_NAME).tar: rm_depend
cd .. ; tar -cf $(DIRECTORY)/$(GLUT_NAME).tar $(GLUT_FILES)
$(GLUT_NAME).tar:
cd .. ; tar --dereference -cf $(DIRECTORY)/$(GLUT_NAME).tar $(GLUT_FILES)
$(GLUT_NAME).tar.gz: $(GLUT_NAME).tar
gzip --stdout --best $(GLUT_NAME).tar > $(GLUT_NAME).tar.gz
@@ -534,4 +516,4 @@ md5: $(ARCHIVES)
@-md5sum $(GLUT_NAME).tar.bz2
@-md5sum $(GLUT_NAME).zip
.PHONY: tarballs rm_depend rm_config md5
.PHONY: tarballs rm_config md5

View File

@@ -563,9 +563,9 @@ AC_ARG_ENABLE([gallium_gbm],
[AS_HELP_STRING([--enable-gallium-gbm],
[enable optional gbm state tracker (not required for
gbm support in Gallium)
@<:@default=disable@:>@])],
@<:@default=auto@:>@])],
[enable_gallium_gbm="$enableval"],
[enable_gallium_gbm=no])
[enable_gallium_gbm=auto])
# Option for Gallium drivers
GALLIUM_DRIVERS_DEFAULT="r300,r600,swrast"
@@ -578,6 +578,13 @@ AC_ARG_WITH([gallium-drivers],
[with_gallium_drivers="$withval"],
[with_gallium_drivers="$GALLIUM_DRIVERS_DEFAULT"])
# Doing '--without-gallium-drivers' will set this variable to 'no'. Clear it
# here so that the script doesn't choke on an unknown driver name later.
case "$with_gallium_drivers" in
yes) with_gallium_drivers="$GALLIUM_DRIVERS_DEFAULT" ;;
no) with_gallium_drivers='' ;;
esac
if test "x$enable_opengl" = xno -a \
"x$enable_gles1" = xno -a \
"x$enable_gles2" = xno -a \
@@ -822,7 +829,7 @@ xlib)
GL_PC_LIB_PRIV="$GL_LIB_DEPS"
GL_PC_CFLAGS="$X11_INCLUDES"
fi
GL_LIB_DEPS="$GL_LIB_DEPS $SELINUX_LIBS -lm -lpthread"
GL_LIB_DEPS="$GL_LIB_DEPS $SELINUX_LIBS -lm -lpthread $DLOPEN_LIBS"
GL_PC_LIB_PRIV="$GL_PC_LIB_PRIV $SELINUX_LIBS -lm -lpthread"
# if static, move the external libraries to the programs
@@ -948,11 +955,6 @@ AC_SUBST([MESA_MODULES])
AC_SUBST([HAVE_XF86VIDMODE])
PKG_CHECK_MODULES([LIBDRM_RADEON],
[libdrm_radeon >= $LIBDRM_RADEON_REQUIRED],
HAVE_LIBDRM_RADEON=yes,
HAVE_LIBDRM_RADEON=no)
dnl
dnl More X11 setup
dnl
@@ -1139,6 +1141,11 @@ esac
case $DRI_DIRS in
*radeon*|*r200*|*r300*|*r600*)
PKG_CHECK_MODULES([LIBDRM_RADEON],
[libdrm_radeon >= $LIBDRM_RADEON_REQUIRED],
HAVE_LIBDRM_RADEON=yes,
HAVE_LIBDRM_RADEON=no)
if test "x$HAVE_LIBDRM_RADEON" = xyes; then
RADEON_CFLAGS="-DHAVE_LIBDRM_RADEON=1 $LIBDRM_RADEON_CFLAGS"
RADEON_LDFLAGS=$LIBDRM_RADEON_LIBS
@@ -1214,6 +1221,41 @@ AC_SUBST([OSMESA_MESA_DEPS])
AC_SUBST([OSMESA_PC_REQ])
AC_SUBST([OSMESA_PC_LIB_PRIV])
dnl
dnl gbm configuration
dnl
if test "x$enable_gbm" = xauto; then
case "$with_egl_platforms" in
*drm*)
enable_gbm=yes ;;
*)
enable_gbm=no ;;
esac
fi
if test "x$enable_gbm" = xyes; then
SRC_DIRS="$SRC_DIRS gbm"
GBM_BACKEND_DIRS=""
PKG_CHECK_MODULES([LIBUDEV], [libudev], [],
AC_MSG_ERROR([gbm needs udev]))
GBM_LIB_DEPS="$DLOPEN_LIBS $LIBUDEV_LIBS"
if test "$mesa_driver" = dri; then
GBM_BACKEND_DIRS="$GBM_BACKEND_DIRS dri"
if test "$SHARED_GLAPI" -eq 0; then
AC_MSG_ERROR([gbm_dri requires --enable-shared-glapi])
fi
fi
fi
AC_SUBST([GBM_LIB_DEPS])
AC_SUBST([GBM_BACKEND_DIRS])
GBM_PC_REQ_PRIV="libudev"
GBM_PC_LIB_PRIV="$DLOPEN_LIBS"
GBM_PC_CFLAGS=
AC_SUBST([GBM_PC_REQ_PRIV])
AC_SUBST([GBM_PC_LIB_PRIV])
AC_SUBST([GBM_PC_CFLAGS])
dnl
dnl EGL configuration
dnl
@@ -1260,41 +1302,6 @@ fi
AC_SUBST([EGL_LIB_DEPS])
AC_SUBST([EGL_DRIVERS_DIRS])
dnl
dnl gbm configuration
dnl
if test "x$enable_gbm" = xauto; then
case "$with_egl_platforms" in
*drm*)
enable_gbm=yes ;;
*)
enable_gbm=no ;;
esac
fi
if test "x$enable_gbm" = xyes; then
SRC_DIRS="$SRC_DIRS gbm"
GBM_BACKEND_DIRS=""
PKG_CHECK_MODULES([LIBUDEV], [libudev], [],
AC_MSG_ERROR([gbm needs udev]))
GBM_LIB_DEPS="$DLOPEN_LIBS $LIBUDEV_LIBS"
if test "$mesa_driver" = dri; then
GBM_BACKEND_DIRS="$GBM_BACKEND_DIRS dri"
if test "$SHARED_GLAPI" -eq 0; then
AC_MSG_ERROR([gbm_dri requires --enable-shared-glapi])
fi
fi
fi
AC_SUBST([GBM_LIB_DEPS])
AC_SUBST([GBM_BACKEND_DIRS])
GBM_PC_REQ_PRIV="libudev"
GBM_PC_LIB_PRIV="$DLOPEN_LIBS"
GBM_PC_CFLAGS=
AC_SUBST([GBM_PC_REQ_PRIV])
AC_SUBST([GBM_PC_LIB_PRIV])
AC_SUBST([GBM_PC_CFLAGS])
dnl
dnl EGL Gallium configuration
dnl
@@ -1314,6 +1321,14 @@ fi
dnl
dnl gbm Gallium configuration
dnl
if test "x$enable_gallium_gbm" = xauto; then
case "$enable_gbm$HAVE_ST_EGL$with_egl_platforms" in
yesyes*drm*)
enable_gallium_gbm=yes ;;
*)
enable_gallium_gbm=no ;;
esac
fi
if test "x$enable_gallium_gbm" = xyes; then
if test "x$with_gallium_drivers" = x; then
AC_MSG_ERROR([cannot enable gbm_gallium without Gallium])
@@ -1595,9 +1610,6 @@ dnl Gallium configuration
dnl
if test "x$with_gallium_drivers" != x; then
SRC_DIRS="$SRC_DIRS gallium gallium/winsys gallium/targets"
AC_PATH_PROG([LLVM_CONFIG], [llvm-config], [no])
else
LLVM_CONFIG=no
fi
AC_SUBST([LLVM_CFLAGS])
@@ -1650,9 +1662,13 @@ yes)
WAYLAND_EGL_LIB_DEPS="$WAYLAND_LIBS $LIBDRM_LIBS"
GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/wayland"
fi
if test "$plat" = "drm" && test "x$enable_gbm" = no; then
if test "$plat" = "drm" && test "x$enable_gbm" = "xno"; then
AC_MSG_ERROR([EGL platform drm needs gbm])
fi
case "$plat$have_libudev" in
waylandno|drmno)
AC_MSG_ERROR([cannot build $plat platfrom without udev]) ;;
esac
done
EGL_PLATFORMS="$egl_platforms"
;;
@@ -1715,6 +1731,8 @@ if test "x$enable_gallium_llvm" = xauto; then
esac
fi
if test "x$enable_gallium_llvm" = xyes; then
AC_PATH_PROG([LLVM_CONFIG], [llvm-config], [no])
if test "x$LLVM_CONFIG" != xno; then
LLVM_VERSION=`$LLVM_CONFIG --version`
LLVM_CFLAGS=`$LLVM_CONFIG --cppflags`
@@ -1767,9 +1785,11 @@ if test "x$with_gallium_drivers" != x; then
gallium_check_st "svga/drm" "dri-vmwgfx" "xorg-vmwgfx"
;;
xi915)
PKG_CHECK_MODULES([INTEL], [libdrm_intel >= $LIBDRM_INTEL_REQUIRED])
gallium_check_st "i915/drm" "dri-i915" "xorg-i915"
;;
xi965)
PKG_CHECK_MODULES([INTEL], [libdrm_intel >= $LIBDRM_INTEL_REQUIRED])
gallium_check_st "i965/drm" "dri-i965" "xorg-i965"
;;
xr300)
@@ -1781,6 +1801,7 @@ if test "x$with_gallium_drivers" != x; then
gallium_check_st "r600/drm" "dri-r600"
;;
xnouveau)
PKG_CHECK_MODULES([NOUVEAU], [libdrm_nouveau >= $LIBDRM_NOUVEAU_REQUIRED])
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS nouveau nvfx nv50 nvc0"
gallium_check_st "nouveau/drm" "dri-nouveau" "xorg-nouveau"
;;

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.
@@ -64,11 +64,263 @@ tbd
<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>
@@ -81,6 +333,11 @@ Building with SCons is an alternative.
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

@@ -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

@@ -249,6 +249,7 @@ CHIPSET(0x6749, TURKS_6749, TURKS)
CHIPSET(0x6750, TURKS_6750, TURKS)
CHIPSET(0x6758, TURKS_6758, TURKS)
CHIPSET(0x6759, TURKS_6759, TURKS)
CHIPSET(0x675F, TURKS_675F, TURKS)
CHIPSET(0x6760, CAICOS_6760, CAICOS)
CHIPSET(0x6761, CAICOS_6761, CAICOS)
@@ -260,4 +261,5 @@ CHIPSET(0x6766, CAICOS_6766, CAICOS)
CHIPSET(0x6767, CAICOS_6767, CAICOS)
CHIPSET(0x6768, CAICOS_6768, CAICOS)
CHIPSET(0x6770, CAICOS_6770, CAICOS)
CHIPSET(0x6778, CAICOS_6778, CAICOS)
CHIPSET(0x6779, CAICOS_6779, CAICOS)

View File

@@ -506,6 +506,8 @@ dri2_create_screen(_EGLDisplay *disp)
return EGL_FALSE;
}
dri2_dpy->own_dri_screen = 1;
extensions = dri2_dpy->core->getExtensions(dri2_dpy->dri_screen);
if (dri2_dpy->dri2) {
@@ -576,10 +578,12 @@ dri2_terminate(_EGLDriver *drv, _EGLDisplay *disp)
_eglReleaseDisplayResources(drv, disp);
_eglCleanupDisplay(disp);
dri2_dpy->core->destroyScreen(dri2_dpy->dri_screen);
if (dri2_dpy->own_dri_screen)
dri2_dpy->core->destroyScreen(dri2_dpy->dri_screen);
if (dri2_dpy->fd)
close(dri2_dpy->fd);
dlclose(dri2_dpy->driver);
if (dri2_dpy->driver)
dlclose(dri2_dpy->driver);
if (disp->PlatformDisplay == NULL) {
switch (disp->Platform) {

View File

@@ -44,7 +44,9 @@
#include <GL/gl.h>
#include <GL/internal/dri_interface.h>
#ifdef HAVE_DRM_PLATFORM
#include <gbm_driint.h>
#endif
#include "eglconfig.h"
#include "eglcontext.h"
@@ -71,6 +73,7 @@ struct dri2_egl_display
int dri2_major;
int dri2_minor;
__DRIscreen *dri_screen;
int own_dri_screen;
const __DRIconfig **driver_configs;
void *driver;
__DRIcoreExtension *core;
@@ -81,7 +84,9 @@ struct dri2_egl_display
__DRIimageExtension *image;
int fd;
#ifdef HAVE_DRM_PLATFORM
struct gbm_dri_device *gbm_dri;
#endif
char *device_name;
char *driver_name;

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-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
*

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

@@ -1,5 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<protocol name="drm">
<copyright>
Copyright © 2008-2011 Kristian Høgsberg
Copyright © 2010-2011 Intel Corporation
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
without fee, provided that\n the above copyright notice appear in
all copies and that both that copyright notice and this permission
notice appear in supporting documentation, and that the name of
the copyright holders not be used in advertising or publicity
pertaining to distribution of the software without specific,
written prior permission. The copyright holders make no
representations about the suitability of this software for any
purpose. It is provided "as is" without express or implied
warranty.
THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
THIS SOFTWARE.
</copyright>
<!-- drm support. This object is created by the server and published
using the display's global event. -->
<interface name="wl_drm" version="1">

View File

@@ -207,17 +207,13 @@ lp_disassemble(const void* func)
}
raw_debug_ostream Out;
TargetMachine *TM = T->createTargetMachine(Triple, "");
#if HAVE_LLVM >= 0x0300
unsigned int AsmPrinterVariant = AsmInfo->getAssemblerDialect();
#else
int AsmPrinterVariant = AsmInfo->getAssemblerDialect();
#endif
#if HAVE_LLVM >= 0x0300
OwningPtr<MCInstPrinter> Printer(
T->createMCInstPrinter(*TM, AsmPrinterVariant, *AsmInfo));
#elif HAVE_LLVM >= 0x0208
#if HAVE_LLVM >= 0x0208
OwningPtr<MCInstPrinter> Printer(
T->createMCInstPrinter(AsmPrinterVariant, *AsmInfo));
#else
@@ -229,6 +225,12 @@ lp_disassemble(const void* func)
return;
}
#if HAVE_LLVM >= 0x0300
TargetMachine *TM = T->createTargetMachine(Triple, sys::getHostCPUName(), "");
#else
TargetMachine *TM = T->createTargetMachine(Triple, "");
#endif
const TargetInstrInfo *TII = TM->getInstrInfo();
/*

View File

@@ -119,8 +119,15 @@ util_format_s3tc_init(void)
library = util_dl_open(DXTN_LIBNAME);
if (!library) {
debug_printf("couldn't open " DXTN_LIBNAME ", software DXTn "
"compression/decompression unavailable\n");
if (getenv("force_s3tc_enable") &&
!strcmp(getenv("force_s3tc_enable"), "true")) {
debug_printf("couldn't open " DXTN_LIBNAME ", enabling DXTn due to "
"force_s3tc_enable=true environment variable\n");
util_format_s3tc_enabled = TRUE;
} else {
debug_printf("couldn't open " DXTN_LIBNAME ", software DXTn "
"compression/decompression unavailable\n");
}
return;
}

View File

@@ -79,6 +79,8 @@ struct u_vbuf_mgr_priv {
void *saved_ve, *fallback_ve;
boolean ve_binding_lock;
unsigned saved_buffer_offset[PIPE_MAX_ATTRIBS];
boolean any_user_vbs;
boolean incompatible_vb_layout;
};
@@ -488,6 +490,7 @@ void u_vbuf_mgr_set_vertex_buffers(struct u_vbuf_mgr *mgrb,
pipe_resource_reference(&mgr->b.vertex_buffer[i].buffer, vb->buffer);
pipe_resource_reference(&mgr->b.real_vertex_buffer[i], NULL);
mgr->saved_buffer_offset[i] = vb->buffer_offset;
if (!vb->buffer) {
continue;
@@ -647,6 +650,13 @@ u_vbuf_mgr_draw_begin(struct u_vbuf_mgr *mgrb,
void u_vbuf_mgr_draw_end(struct u_vbuf_mgr *mgrb)
{
struct u_vbuf_mgr_priv *mgr = (struct u_vbuf_mgr_priv*)mgrb;
unsigned i;
/* buffer offsets were modified in u_vbuf_upload_buffers */
if (mgr->any_user_vbs) {
for (i = 0; i < mgr->b.nr_vertex_buffers; i++)
mgr->b.vertex_buffer[i].buffer_offset = mgr->saved_buffer_offset[i];
}
if (mgr->fallback_ve) {
u_vbuf_translate_end(mgr);

View File

@@ -29,6 +29,7 @@
#define I915_BATCH_H
#include "i915_batchbuffer.h"
#include "i915_context.h"
#define BEGIN_BATCH(dwords) \
@@ -49,11 +50,26 @@
#define FLUSH_BATCH(fence) \
i915_flush(i915, fence)
/************************************************************************
* i915_flush.c
*/
void i915_flush(struct i915_context *i915, struct pipe_fence_handle **fence);
/*
* Flush if the current color buf is idle and we have more than 256 vertices
* queued, or if the current color buf is busy and we have more than 4096
* vertices queued.
*/
static INLINE void i915_flush_heuristically(struct i915_context* i915,
int num_vertex)
{
struct i915_winsys *iws = i915->iws;
i915->vertices_since_last_flush += num_vertex;
if ( i915->vertices_since_last_flush > 4096
|| ( i915->vertices_since_last_flush > 256 &&
!iws->buffer_is_busy(iws, i915->current.cbuf_bo)) )
FLUSH_BATCH(NULL);
}
#endif

View File

@@ -120,6 +120,11 @@ i915_clear_emit(struct pipe_context *pipe, unsigned buffers, const float *rgba,
OUT_BATCH_F(desty + height);
OUT_BATCH_F(destx);
OUT_BATCH_F(desty);
/* Flush after clear, its expected to be a costly operation.
* This is not required, just a heuristic
*/
FLUSH_BATCH(NULL);
}
/**

View File

@@ -264,6 +264,8 @@ struct i915_context {
struct util_slab_mempool transfer_pool;
struct util_slab_mempool texture_transfer_pool;
int vertices_since_last_flush;
/** blitter/hw-clear */
struct blitter_context* blitter;

View File

@@ -77,4 +77,5 @@ void i915_flush(struct i915_context *i915, struct pipe_fence_handle **fence)
i915->static_dirty = ~0;
/* kernel emits flushes in between batchbuffers */
i915->flush_dirty = 0;
i915->vertices_since_last_flush = 0;
}

View File

@@ -166,6 +166,8 @@ emit_prim( struct draw_stage *stage,
for (i = 0; i < nr; i++)
emit_hw_vertex(i915, prim->v[i]);
i915_flush_heuristically(i915, nr);
}

View File

@@ -487,6 +487,7 @@ draw_arrays_fallback(struct vbuf_render *render,
draw_arrays_generate_indices(render, start, nr, i915_render->fallback);
i915_flush_heuristically(i915, nr_indices);
out:
return;
}
@@ -534,6 +535,7 @@ i915_vbuf_render_draw_arrays(struct vbuf_render *render,
nr);
OUT_BATCH(start); /* Beginning vertex index */
i915_flush_heuristically(i915, nr);
out:
return;
}
@@ -657,6 +659,7 @@ i915_vbuf_render_draw_elements(struct vbuf_render *render,
save_nr_indices,
i915_render->fallback);
i915_flush_heuristically(i915, nr_indices);
out:
return;
}

View File

@@ -243,7 +243,7 @@ i915_create_sampler_state(struct pipe_context *pipe,
/* Shadow:
*/
if (sampler->compare_mode == PIPE_TEX_COMPARE_R_TO_TEXTURE)
if (sampler->compare_mode == PIPE_TEX_COMPARE_R_TO_TEXTURE)
{
cso->state[0] |= (SS2_SHADOW_ENABLE |
i915_translate_compare_func(sampler->compare_func));

View File

@@ -349,25 +349,25 @@ static const struct
uint hw_swizzle;
} fixup_formats[] = {
{ PIPE_FORMAT_R8G8B8A8_UNORM, 0x21030000 /* BGRA */},
{ PIPE_FORMAT_L8_UNORM, 0x00000000 /* RRRR */},
{ PIPE_FORMAT_I8_UNORM, 0x00000000 /* RRRR */},
{ PIPE_FORMAT_L8_UNORM, 0x00030000 /* RRRA */},
{ PIPE_FORMAT_I8_UNORM, 0x00030000 /* RRRA */},
{ PIPE_FORMAT_A8_UNORM, 0x33330000 /* AAAA */},
{ PIPE_FORMAT_NONE, 0x00000000},
};
static boolean need_fixup(struct pipe_surface* p)
static uint need_target_fixup(struct pipe_surface* p)
{
enum pipe_format f;
/* if we don't have a surface bound yet, we don't need to fixup the shader */
if (!p)
return FALSE;
return 0;
f = p->format;
for(int i=0; fixup_formats[i].format != PIPE_FORMAT_NONE; i++)
if (fixup_formats[i].format == f)
return TRUE;
return 1;
return FALSE;
return 0;
}
static uint fixup_swizzle(enum pipe_format f)
@@ -383,29 +383,35 @@ static void
validate_program(struct i915_context *i915, unsigned *batch_space)
{
struct pipe_surface *cbuf_surface = i915->framebuffer.cbufs[0];
uint additional_size = need_target_fixup(cbuf_surface);
/* we need more batch space if we want to emulate rgba framebuffers */
*batch_space = i915->fs->program_len + (need_fixup(cbuf_surface) ? 3 : 0);
*batch_space = i915->fs->program_len + 3 * additional_size;
}
static void
emit_program(struct i915_context *i915)
{
struct pipe_surface *cbuf_surface = i915->framebuffer.cbufs[0];
boolean need_format_fixup = need_fixup(cbuf_surface);
uint target_fixup = need_target_fixup(cbuf_surface);
uint i;
/* we should always have, at least, a pass-through program */
assert(i915->fs->program_len > 0);
for (i = 0; i < i915->fs->program_len; i++) {
if ((i == 0) && need_format_fixup)
OUT_BATCH(i915->fs->program[i] + 3);
else
OUT_BATCH(i915->fs->program[i]);
{
/* first word has the size, we have to adjust that */
uint size = (i915->fs->program[0]);
size += target_fixup * 3;
OUT_BATCH(size);
}
/* output the declarations of the program */
for (i=1 ; i < i915->fs->program_len; i++)
OUT_BATCH(i915->fs->program[i]);
/* we emit an additional mov with swizzle to fake RGBA framebuffers */
if (need_format_fixup) {
if (target_fixup) {
/* mov out_color, out_color.zyxw */
OUT_BATCH(A0_MOV |
(REG_TYPE_OC << A0_DEST_TYPE_SHIFT) |

View File

@@ -207,6 +207,12 @@ struct i915_winsys {
void (*buffer_destroy)(struct i915_winsys *iws,
struct i915_winsys_buffer *buffer);
/**
* Check if a buffer is busy.
*/
boolean (*buffer_is_busy)(struct i915_winsys *iws,
struct i915_winsys_buffer *buffer);
/*@}*/

View File

@@ -284,7 +284,7 @@ const struct nv50_format nv50_format_table[PIPE_FORMAT_COUNT] =
[PIPE_FORMAT_R16G16B16_FLOAT] = { NV50_SURFACE_FORMAT_R16G16B16X16_FLOAT,
A_(C0, C1, C2, ONE_FLOAT, FLOAT, FLOAT, FLOAT, FLOAT, 16_16_16, 0),
VERTEX_BUFFER | SAMPLER_VIEW | RENDER_TARGET },
VERTEX_BUFFER },
[PIPE_FORMAT_R16G16_FLOAT] = { NV50_SURFACE_FORMAT_R16G16_FLOAT,
A_(C0, C1, ZERO, ONE_FLOAT, FLOAT, FLOAT, FLOAT, FLOAT, 16_16, 0),
@@ -302,7 +302,7 @@ const struct nv50_format nv50_format_table[PIPE_FORMAT_COUNT] =
[PIPE_FORMAT_R32G32B32_FLOAT] = { NV50_SURFACE_FORMAT_R32G32B32X32_FLOAT,
A_(C0, C1, C2, ONE_FLOAT, FLOAT, FLOAT, FLOAT, FLOAT, 32_32_32, 0),
VERTEX_BUFFER | SAMPLER_VIEW | RENDER_TARGET },
VERTEX_BUFFER },
[PIPE_FORMAT_R32G32_FLOAT] = { NV50_SURFACE_FORMAT_R32G32_FLOAT,
A_(C0, C1, ZERO, ONE_FLOAT, FLOAT, FLOAT, FLOAT, FLOAT, 32_32, 0),
@@ -330,7 +330,7 @@ const struct nv50_format nv50_format_table[PIPE_FORMAT_COUNT] =
[PIPE_FORMAT_R32G32B32_SNORM] = { 0,
A_(C0, C1, C2, ONE_FLOAT, SNORM, SNORM, SNORM, SNORM, 32_32_32, 0),
VERTEX_BUFFER | SAMPLER_VIEW },
VERTEX_BUFFER },
[PIPE_FORMAT_R32G32_SNORM] = { 0,
A_(C0, C1, ZERO, ONE_FLOAT, SNORM, SNORM, SNORM, SNORM, 32_32, 0),
@@ -348,7 +348,7 @@ const struct nv50_format nv50_format_table[PIPE_FORMAT_COUNT] =
[PIPE_FORMAT_R32G32B32_UNORM] = { 0,
A_(C0, C1, C2, ONE_FLOAT, UNORM, UNORM, UNORM, UNORM, 32_32_32, 0),
VERTEX_BUFFER | SAMPLER_VIEW },
VERTEX_BUFFER },
[PIPE_FORMAT_R32G32_UNORM] = { 0,
A_(C0, C1, ZERO, ONE_FLOAT, UNORM, UNORM, UNORM, UNORM, 32_32, 0),
@@ -366,7 +366,7 @@ const struct nv50_format nv50_format_table[PIPE_FORMAT_COUNT] =
[PIPE_FORMAT_R16G16B16_SNORM] = { 0,
A_(C0, C1, C2, ONE_FLOAT, SNORM, SNORM, SNORM, SNORM, 16_16_16, 0),
VERTEX_BUFFER | SAMPLER_VIEW },
VERTEX_BUFFER },
[PIPE_FORMAT_R16G16_SNORM] = { NV50_SURFACE_FORMAT_R16G16_SNORM,
A_(C0, C1, ZERO, ONE_FLOAT, SNORM, SNORM, SNORM, SNORM, 16_16, 0),
@@ -384,7 +384,7 @@ const struct nv50_format nv50_format_table[PIPE_FORMAT_COUNT] =
[PIPE_FORMAT_R16G16B16_UNORM] = { 0,
A_(C0, C1, C2, ONE_FLOAT, UNORM, UNORM, UNORM, UNORM, 16_16_16, 0),
VERTEX_BUFFER | SAMPLER_VIEW },
VERTEX_BUFFER },
[PIPE_FORMAT_R16G16_UNORM] = { NV50_SURFACE_FORMAT_R16G16_UNORM,
A_(C0, C1, ZERO, ONE_FLOAT, UNORM, UNORM, UNORM, UNORM, 16_16, 0),
@@ -402,7 +402,7 @@ const struct nv50_format nv50_format_table[PIPE_FORMAT_COUNT] =
[PIPE_FORMAT_R8G8B8_SNORM] = { 0,
A_(C0, C1, C2, ONE_FLOAT, SNORM, SNORM, SNORM, SNORM, 8_8_8, 0),
VERTEX_BUFFER | SAMPLER_VIEW },
VERTEX_BUFFER },
[PIPE_FORMAT_R8G8_SNORM] = { NV50_SURFACE_FORMAT_R8G8_SNORM,
A_(C0, C1, ZERO, ONE_FLOAT, SNORM, SNORM, SNORM, SNORM, 8_8, 0),
@@ -422,13 +422,13 @@ const struct nv50_format nv50_format_table[PIPE_FORMAT_COUNT] =
A_(C0, C1, C2, C3, UNORM, UNORM, UNORM, UNORM, 8_8_8_8, 0),
SAMPLER_VIEW | RENDER_TARGET },
[PIPE_FORMAT_R8G8B8X8_UNORM] = { NV50_SURFACE_FORMAT_X8B8G8R8_UNORM,
B_(C0, C1, C2, ONE_FLOAT, UNORM, UNORM, UNORM, UNORM, 8_8_8_8, 0),
SAMPLER_VIEW | RENDER_TARGET },
[PIPE_FORMAT_R8G8B8_UNORM] = { NV50_SURFACE_FORMAT_X8B8G8R8_UNORM,
A_(C0, C1, C2, ONE_FLOAT, UNORM, UNORM, UNORM, UNORM, 8_8_8, 0),
VERTEX_BUFFER | SAMPLER_VIEW | RENDER_TARGET },
[PIPE_FORMAT_R8G8B8_SRGB] = { NV50_SURFACE_FORMAT_X8B8G8R8_SRGB,
A_(C0, C1, C2, ONE_FLOAT, UNORM, UNORM, UNORM, UNORM, 8_8_8, 0),
SAMPLER_VIEW | RENDER_TARGET },
VERTEX_BUFFER },
[PIPE_FORMAT_R8G8_UNORM] = { NV50_SURFACE_FORMAT_R8G8_UNORM,
A_(C0, C1, ZERO, ONE_FLOAT, UNORM, UNORM, UNORM, UNORM, 8_8, 0),

View File

@@ -154,6 +154,9 @@ nv50_miptree_create(struct pipe_screen *pscreen,
case PIPE_FORMAT_R32G32B32_FLOAT:
tile_flags = 0x7400;
break;
case PIPE_FORMAT_Z32_FLOAT:
tile_flags = 0x4000;
break;
case PIPE_FORMAT_Z32_FLOAT_S8X24_USCALED:
tile_flags = 0x6000;
break;

View File

@@ -289,7 +289,7 @@ const struct nvc0_format nvc0_format_table[PIPE_FORMAT_COUNT] =
[PIPE_FORMAT_R16G16B16_FLOAT] = { NV50_SURFACE_FORMAT_R16G16B16X16_FLOAT,
A_(C0, C1, C2, ONE_FLOAT, FLOAT, FLOAT, FLOAT, FLOAT, 16_16_16, 0),
VERTEX_BUFFER | SAMPLER_VIEW | RENDER_TARGET },
VERTEX_BUFFER },
[PIPE_FORMAT_R16G16_FLOAT] = { NV50_SURFACE_FORMAT_R16G16_FLOAT,
A_(C0, C1, ZERO, ONE_FLOAT, FLOAT, FLOAT, FLOAT, FLOAT, 16_16, 0),
@@ -307,7 +307,7 @@ const struct nvc0_format nvc0_format_table[PIPE_FORMAT_COUNT] =
[PIPE_FORMAT_R32G32B32_FLOAT] = { NV50_SURFACE_FORMAT_R32G32B32X32_FLOAT,
A_(C0, C1, C2, ONE_FLOAT, FLOAT, FLOAT, FLOAT, FLOAT, 32_32_32, 0),
VERTEX_BUFFER | SAMPLER_VIEW | RENDER_TARGET },
VERTEX_BUFFER },
[PIPE_FORMAT_R32G32_FLOAT] = { NV50_SURFACE_FORMAT_R32G32_FLOAT,
A_(C0, C1, ZERO, ONE_FLOAT, FLOAT, FLOAT, FLOAT, FLOAT, 32_32, 0),
@@ -335,7 +335,7 @@ const struct nvc0_format nvc0_format_table[PIPE_FORMAT_COUNT] =
[PIPE_FORMAT_R32G32B32_SNORM] = { 0,
A_(C0, C1, C2, ONE_FLOAT, SNORM, SNORM, SNORM, SNORM, 32_32_32, 0),
VERTEX_BUFFER | SAMPLER_VIEW },
VERTEX_BUFFER },
[PIPE_FORMAT_R32G32_SNORM] = { 0,
A_(C0, C1, ZERO, ONE_FLOAT, SNORM, SNORM, SNORM, SNORM, 32_32, 0),
@@ -353,7 +353,7 @@ const struct nvc0_format nvc0_format_table[PIPE_FORMAT_COUNT] =
[PIPE_FORMAT_R32G32B32_UNORM] = { 0,
A_(C0, C1, C2, ONE_FLOAT, UNORM, UNORM, UNORM, UNORM, 32_32_32, 0),
VERTEX_BUFFER | SAMPLER_VIEW },
VERTEX_BUFFER },
[PIPE_FORMAT_R32G32_UNORM] = { 0,
A_(C0, C1, ZERO, ONE_FLOAT, UNORM, UNORM, UNORM, UNORM, 32_32, 0),
@@ -371,7 +371,7 @@ const struct nvc0_format nvc0_format_table[PIPE_FORMAT_COUNT] =
[PIPE_FORMAT_R16G16B16_SNORM] = { 0,
A_(C0, C1, C2, ONE_FLOAT, SNORM, SNORM, SNORM, SNORM, 16_16_16, 0),
VERTEX_BUFFER | SAMPLER_VIEW },
VERTEX_BUFFER },
[PIPE_FORMAT_R16G16_SNORM] = { NV50_SURFACE_FORMAT_R16G16_SNORM,
A_(C0, C1, ZERO, ONE_FLOAT, SNORM, SNORM, SNORM, SNORM, 16_16, 0),
@@ -389,7 +389,7 @@ const struct nvc0_format nvc0_format_table[PIPE_FORMAT_COUNT] =
[PIPE_FORMAT_R16G16B16_UNORM] = { 0,
A_(C0, C1, C2, ONE_FLOAT, UNORM, UNORM, UNORM, UNORM, 16_16_16, 0),
VERTEX_BUFFER | SAMPLER_VIEW },
VERTEX_BUFFER },
[PIPE_FORMAT_R16G16_UNORM] = { NV50_SURFACE_FORMAT_R16G16_UNORM,
A_(C0, C1, ZERO, ONE_FLOAT, UNORM, UNORM, UNORM, UNORM, 16_16, 0),
@@ -407,7 +407,7 @@ const struct nvc0_format nvc0_format_table[PIPE_FORMAT_COUNT] =
[PIPE_FORMAT_R8G8B8_SNORM] = { 0,
A_(C0, C1, C2, ONE_FLOAT, SNORM, SNORM, SNORM, SNORM, 8_8_8, 0),
VERTEX_BUFFER | SAMPLER_VIEW },
VERTEX_BUFFER },
[PIPE_FORMAT_R8G8_SNORM] = { NV50_SURFACE_FORMAT_R8G8_SNORM,
A_(C0, C1, ZERO, ONE_FLOAT, SNORM, SNORM, SNORM, SNORM, 8_8, 0),
@@ -427,13 +427,13 @@ const struct nvc0_format nvc0_format_table[PIPE_FORMAT_COUNT] =
A_(C0, C1, C2, C3, UNORM, UNORM, UNORM, UNORM, 8_8_8_8, 0),
SAMPLER_VIEW | RENDER_TARGET },
[PIPE_FORMAT_R8G8B8X8_UNORM] = { NV50_SURFACE_FORMAT_X8B8G8R8_UNORM,
B_(C0, C1, C2, ONE_FLOAT, UNORM, UNORM, UNORM, UNORM, 8_8_8_8, 0),
SAMPLER_VIEW | RENDER_TARGET },
[PIPE_FORMAT_R8G8B8_UNORM] = { NV50_SURFACE_FORMAT_X8B8G8R8_UNORM,
A_(C0, C1, C2, ONE_FLOAT, UNORM, UNORM, UNORM, UNORM, 8_8_8, 0),
VERTEX_BUFFER | SAMPLER_VIEW | RENDER_TARGET },
[PIPE_FORMAT_R8G8B8_SRGB] = { NV50_SURFACE_FORMAT_X8B8G8R8_SRGB,
A_(C0, C1, C2, ONE_FLOAT, UNORM, UNORM, UNORM, UNORM, 8_8_8, 0),
SAMPLER_VIEW | RENDER_TARGET },
VERTEX_BUFFER },
[PIPE_FORMAT_R8G8_UNORM] = { NV50_SURFACE_FORMAT_R8G8_UNORM,
A_(C0, C1, ZERO, ONE_FLOAT, UNORM, UNORM, UNORM, UNORM, 8_8, 0),

View File

@@ -168,6 +168,9 @@ nvc0_miptree_create(struct pipe_screen *pscreen,
tile_flags = 0xf900; /* MSAA 4 */
tile_flags = 0xfe00; /* NORMAL */
break;
case PIPE_FORMAT_Z32_FLOAT:
tile_flags = 0x7b00;
break;
case PIPE_FORMAT_Z32_FLOAT_S8X24_USCALED:
tile_flags = 0xce00; /* COMPRESSED */
tile_flags = 0xcf00; /* MSAA 2, COMPRESSED */

View File

@@ -33,6 +33,9 @@ nvfx_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
return 1;
case PIPE_CAP_GLSL:
return 1;
case PIPE_CAP_SM3:
/* TODO: >= nv4x support Shader Model 3.0 */
return 0;
case PIPE_CAP_ANISOTROPIC_FILTER:
return 1;
case PIPE_CAP_POINT_SPRITE:

View File

@@ -447,16 +447,8 @@ static uint32_t r300_translate_colorformat(enum pipe_format format)
/*case PIPE_FORMAT_B8G8R8A8_SNORM:*/
case PIPE_FORMAT_B8G8R8X8_UNORM:
/*case PIPE_FORMAT_B8G8R8X8_SNORM:*/
case PIPE_FORMAT_A8R8G8B8_UNORM:
/*case PIPE_FORMAT_A8R8G8B8_SNORM:*/
case PIPE_FORMAT_X8R8G8B8_UNORM:
/*case PIPE_FORMAT_X8R8G8B8_SNORM:*/
case PIPE_FORMAT_A8B8G8R8_UNORM:
/*case PIPE_FORMAT_A8B8G8R8_SNORM:*/
case PIPE_FORMAT_R8G8B8A8_UNORM:
case PIPE_FORMAT_R8G8B8A8_SNORM:
case PIPE_FORMAT_X8B8G8R8_UNORM:
/*case PIPE_FORMAT_X8B8G8R8_SNORM:*/
case PIPE_FORMAT_R8G8B8X8_UNORM:
/*case PIPE_FORMAT_R8G8B8X8_SNORM:*/
/* These formats work fine with ARGB8888 if US_OUT_FMT is set
@@ -662,10 +654,6 @@ static uint32_t r300_translate_out_fmt(enum pipe_format format)
R300_C2_SEL_R | R300_C3_SEL_A;
/* ARGB outputs. */
case PIPE_FORMAT_A8R8G8B8_UNORM:
/*case PIPE_FORMAT_A8R8G8B8_SNORM:*/
case PIPE_FORMAT_X8R8G8B8_UNORM:
/*case PIPE_FORMAT_X8R8G8B8_SNORM:*/
case PIPE_FORMAT_A16_UNORM:
case PIPE_FORMAT_A16_SNORM:
case PIPE_FORMAT_A16_FLOAT:
@@ -674,15 +662,6 @@ static uint32_t r300_translate_out_fmt(enum pipe_format format)
R300_C0_SEL_A | R300_C1_SEL_R |
R300_C2_SEL_G | R300_C3_SEL_B;
/* ABGR outputs. */
case PIPE_FORMAT_A8B8G8R8_UNORM:
/*case PIPE_FORMAT_A8B8G8R8_SNORM:*/
case PIPE_FORMAT_X8B8G8R8_UNORM:
/*case PIPE_FORMAT_X8B8G8R8_SNORM:*/
return modifier |
R300_C0_SEL_A | R300_C1_SEL_B |
R300_C2_SEL_G | R300_C3_SEL_R;
/* RGBA outputs. */
case PIPE_FORMAT_R8G8B8X8_UNORM:
/*case PIPE_FORMAT_R8G8B8X8_SNORM:*/

View File

@@ -1454,6 +1454,11 @@ void evergreen_init_config(struct r600_pipe_context *rctx)
tmp |= S_008C28_NUM_LS_STACK_ENTRIES(num_ls_stack_entries);
r600_pipe_state_add_reg(rstate, R_008C28_SQ_STACK_RESOURCE_MGMT_3, tmp, 0xFFFFFFFF, NULL);
tmp = 0;
tmp |= S_008E2C_NUM_PS_LDS(0x1000);
tmp |= S_008E2C_NUM_LS_LDS(0x1000);
r600_pipe_state_add_reg(rstate, R_008E2C_SQ_LDS_RESOURCE_MGMT, tmp, 0xFFFFFFFF, NULL);
r600_pipe_state_add_reg(rstate, R_009100_SPI_CONFIG_CNTL, 0x0, 0xFFFFFFFF, NULL);
r600_pipe_state_add_reg(rstate, R_00913C_SPI_CONFIG_CNTL_1, S_00913C_VTX_DONE_DELAY(4), 0xFFFFFFFF, NULL);
@@ -1742,7 +1747,7 @@ void evergreen_pipe_shader_vs(struct pipe_context *ctx, struct r600_pipe_shader
r600_pipe_state_add_reg(rstate,
R_0286C4_SPI_VS_OUT_CONFIG,
S_0286C4_VS_EXPORT_COUNT(rshader->noutput - 2),
S_0286C4_VS_EXPORT_COUNT(rshader->noutput - 1),
0xFFFFFFFF, NULL);
r600_pipe_state_add_reg(rstate,
R_028860_SQ_PGM_RESOURCES_VS,

View File

@@ -216,6 +216,13 @@
#define S_008C28_NUM_LS_STACK_ENTRIES(x) (((x) & 0xFFF) << 16)
#define G_008C28_NUM_LS_STACK_ENTRIES(x) (((x) >> 16) & 0xFFF)
#define C_008C28_NUM_LS_STACK_ENTRIES(x) 0xF000FFFF
#define R_008E2C_SQ_LDS_RESOURCE_MGMT 0x00008E2C
#define S_008E2C_NUM_PS_LDS(x) (((x) & 0xFFFF) << 0)
#define G_008E2C_NUM_PS_LDS(x) (((x) >> 0) & 0xFFFF)
#define C_008E2C_NUM_PS_LDS(x) 0x0000FFFF
#define S_008E2C_NUM_LS_LDS(x) (((x) & 0xFFFF) << 16)
#define G_008E2C_NUM_LS_LDS(x) (((x) >> 16) & 0xFFFF)
#define C_008E2C_NUM_LS_LDS(x) 0xFFFF0000
#define R_008CF0_SQ_MS_FIFO_SIZES 0x00008CF0
#define S_008CF0_CACHE_FIFO_SIZE(x) (((x) & 0xFF) << 0)

View File

@@ -211,14 +211,21 @@ struct r600_reloc {
*/
struct r600_query {
u64 result;
/* The kind of query. Currently only OQ is supported. */
/* The kind of query */
unsigned type;
/* How many results have been written, in dwords. It's incremented
* after end_query and flush. */
unsigned num_results;
/* if we've flushed the query */
/* Offset of the first result for current query */
unsigned results_start;
/* Offset of the next free result after current query data */
unsigned results_end;
/* Size of the result */
unsigned result_size;
/* Count of new queries started in one stream without flushing */
unsigned queries_emitted;
/* State flags */
unsigned state;
/* The buffer where query results are stored. */
/* The buffer where query results are stored. It's used as a ring,
* data blocks for current query are stored sequentially from
* results_start to results_end, with wrapping on the buffer end */
struct r600_bo *buffer;
unsigned buffer_size;
/* linked list of queries */
@@ -228,6 +235,7 @@ struct r600_query {
#define R600_QUERY_STATE_STARTED (1 << 0)
#define R600_QUERY_STATE_ENDED (1 << 1)
#define R600_QUERY_STATE_SUSPENDED (1 << 2)
#define R600_QUERY_STATE_FLUSHED (1 << 3)
#define R600_CONTEXT_DRAW_PENDING (1 << 0)
#define R600_CONTEXT_DST_CACHES_DIRTY (1 << 1)
@@ -245,6 +253,7 @@ struct r600_context {
unsigned pm4_cdwords;
unsigned pm4_dirty_cdwords;
unsigned ctx_pm4_ndwords;
unsigned init_dwords;
unsigned nreloc;
unsigned creloc;
struct r600_reloc *reloc;
@@ -293,7 +302,7 @@ boolean r600_context_query_result(struct r600_context *ctx,
void r600_query_begin(struct r600_context *ctx, struct r600_query *query);
void r600_query_end(struct r600_context *ctx, struct r600_query *query);
void r600_context_queries_suspend(struct r600_context *ctx);
void r600_context_queries_resume(struct r600_context *ctx);
void r600_context_queries_resume(struct r600_context *ctx, boolean flushed);
void r600_query_predication(struct r600_context *ctx, struct r600_query *query, int operation,
int flag_wait);
void r600_context_emit_fence(struct r600_context *ctx, struct r600_bo *fence,

View File

@@ -97,7 +97,7 @@ static void r600_blitter_end(struct pipe_context *ctx)
rctx->saved_render_cond_mode);
rctx->saved_render_cond = NULL;
}
r600_context_queries_resume(&rctx->ctx);
r600_context_queries_resume(&rctx->ctx, FALSE);
rctx->blit = false;
}

View File

@@ -126,9 +126,6 @@ static void r600_flush(struct pipe_context *ctx,
if (rfence)
*rfence = r600_create_fence(rctx);
if (!rctx->ctx.pm4_cdwords)
return;
#if 0
sprintf(dname, "gallium-%08d.bof", dc);
if (dc < 20) {

View File

@@ -43,7 +43,7 @@ static void r600_begin_query(struct pipe_context *ctx, struct pipe_query *query)
struct r600_query *rquery = (struct r600_query *)query;
rquery->result = 0;
rquery->num_results = 0;
rquery->results_start = rquery->results_end;
r600_query_begin(&rctx->ctx, (struct r600_query *)query);
}
@@ -61,10 +61,7 @@ static boolean r600_get_query_result(struct pipe_context *ctx,
struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
struct r600_query *rquery = (struct r600_query *)query;
if (rquery->num_results) {
ctx->flush(ctx, NULL);
}
return r600_context_query_result(&rctx->ctx, (struct r600_query *)query, wait, vresult);
return r600_context_query_result(&rctx->ctx, rquery, wait, vresult);
}
static void r600_render_condition(struct pipe_context *ctx,
@@ -75,12 +72,18 @@ static void r600_render_condition(struct pipe_context *ctx,
struct r600_query *rquery = (struct r600_query *)query;
int wait_flag = 0;
/* If we already have nonzero result, render unconditionally */
if (query != NULL && rquery->result != 0)
return;
rctx->current_render_cond = query;
rctx->current_render_cond_mode = mode;
if (!query) {
rctx->ctx.predicate_drawing = false;
r600_query_predication(&rctx->ctx, NULL, PREDICATION_OP_CLEAR, 1);
if (query == NULL) {
if (rctx->ctx.predicate_drawing) {
rctx->ctx.predicate_drawing = false;
r600_query_predication(&rctx->ctx, NULL, PREDICATION_OP_CLEAR, 1);
}
return;
}
@@ -91,7 +94,6 @@ static void r600_render_condition(struct pipe_context *ctx,
rctx->ctx.predicate_drawing = true;
r600_query_predication(&rctx->ctx, rquery, PREDICATION_OP_ZPASS, wait_flag);
}
void r600_init_query_functions(struct r600_pipe_context *rctx)

View File

@@ -939,6 +939,17 @@ static void r600_bc_src(struct r600_bc_alu_src *bc_src,
bc_src->value = shader_src->value[bc_src->chan];
}
static void r600_bc_src_set_abs(struct r600_bc_alu_src *bc_src)
{
bc_src->abs = 1;
bc_src->neg = 0;
}
static void r600_bc_src_toggle_neg(struct r600_bc_alu_src *bc_src)
{
bc_src->neg = !bc_src->neg;
}
static void tgsi_dst(struct r600_shader_ctx *ctx,
const struct tgsi_full_dst_register *tgsi_dst,
unsigned swizzle,
@@ -995,12 +1006,10 @@ static int tgsi_op2_s(struct r600_shader_ctx *ctx, int swap)
/* handle some special cases */
switch (ctx->inst_info->tgsi_opcode) {
case TGSI_OPCODE_SUB:
alu.src[1].neg = 1;
r600_bc_src_toggle_neg(&alu.src[1]);
break;
case TGSI_OPCODE_ABS:
alu.src[0].abs = 1;
if (alu.src[0].neg)
alu.src[0].neg = 0;
r600_bc_src_set_abs(&alu.src[0]);
break;
default:
break;
@@ -1364,6 +1373,22 @@ static int tgsi_lit(struct r600_shader_ctx *ctx)
struct r600_bc_alu alu;
int r;
/* tmp.x = max(src.y, 0.0) */
memset(&alu, 0, sizeof(struct r600_bc_alu));
alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MAX);
r600_bc_src(&alu.src[0], &ctx->src[0], 1);
alu.src[1].sel = V_SQ_ALU_SRC_0; /*0.0*/
alu.src[1].chan = 1;
alu.dst.sel = ctx->temp_reg;
alu.dst.chan = 0;
alu.dst.write = 1;
alu.last = 1;
r = r600_bc_add_alu(ctx->bc, &alu);
if (r)
return r;
if (inst->Dst[0].Register.WriteMask & (1 << 2))
{
int chan;
@@ -1372,11 +1397,13 @@ static int tgsi_lit(struct r600_shader_ctx *ctx)
if (ctx->bc->chiprev == CHIPREV_CAYMAN) {
for (i = 0; i < 3; i++) {
/* dst.z = log(src.y) */
/* tmp.z = log(tmp.x) */
memset(&alu, 0, sizeof(struct r600_bc_alu));
alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_LOG_CLAMPED);
r600_bc_src(&alu.src[0], &ctx->src[0], 1);
tgsi_dst(ctx, &inst->Dst[0], i, &alu.dst);
alu.src[0].sel = ctx->temp_reg;
alu.src[0].chan = 0;
alu.dst.sel = ctx->temp_reg;
alu.dst.chan = i;
if (i == 2) {
alu.dst.write = 1;
alu.last = 1;
@@ -1388,10 +1415,11 @@ static int tgsi_lit(struct r600_shader_ctx *ctx)
return r;
}
} else {
/* dst.z = log(src.y) */
/* tmp.z = log(tmp.x) */
memset(&alu, 0, sizeof(struct r600_bc_alu));
alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_LOG_CLAMPED);
r600_bc_src(&alu.src[0], &ctx->src[0], 1);
alu.src[0].sel = ctx->temp_reg;
alu.src[0].chan = 0;
alu.dst.sel = ctx->temp_reg;
alu.dst.chan = 2;
alu.dst.write = 1;
@@ -1404,13 +1432,12 @@ static int tgsi_lit(struct r600_shader_ctx *ctx)
chan = alu.dst.chan;
sel = alu.dst.sel;
/* tmp.x = amd MUL_LIT(src.w, dst.z, src.x ) */
/* tmp.x = amd MUL_LIT(tmp.z, src.w, src.x ) */
memset(&alu, 0, sizeof(struct r600_bc_alu));
alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP3_SQ_OP3_INST_MUL_LIT);
r600_bc_src(&alu.src[0], &ctx->src[0], 3);
alu.src[1].sel = sel;
alu.src[1].chan = chan;
alu.src[0].sel = sel;
alu.src[0].chan = chan;
r600_bc_src(&alu.src[1], &ctx->src[0], 3);
r600_bc_src(&alu.src[2], &ctx->src[0], 0);
alu.dst.sel = ctx->temp_reg;
alu.dst.chan = 0;
@@ -1506,7 +1533,7 @@ static int tgsi_rsq(struct r600_shader_ctx *ctx)
for (i = 0; i < inst->Instruction.NumSrcRegs; i++) {
r600_bc_src(&alu.src[i], &ctx->src[i], 0);
alu.src[i].abs = 1;
r600_bc_src_set_abs(&alu.src[i]);
}
alu.dst.sel = ctx->temp_reg;
alu.dst.write = 1;
@@ -2192,7 +2219,7 @@ static int tgsi_lrp(struct r600_shader_ctx *ctx)
alu.src[0].sel = V_SQ_ALU_SRC_1;
alu.src[0].chan = 0;
r600_bc_src(&alu.src[1], &ctx->src[0], i);
alu.src[1].neg = 1;
r600_bc_src_toggle_neg(&alu.src[1]);
alu.dst.sel = ctx->temp_reg;
alu.dst.chan = i;
if (i == lasti) {
@@ -2489,7 +2516,7 @@ static int tgsi_log(struct r600_shader_ctx *ctx)
int r;
int i;
/* result.x = floor(log2(src)); */
/* result.x = floor(log2(|src|)); */
if (inst->Dst[0].Register.WriteMask & 1) {
if (ctx->bc->chiprev == CHIPREV_CAYMAN) {
for (i = 0; i < 3; i++) {
@@ -2497,6 +2524,7 @@ static int tgsi_log(struct r600_shader_ctx *ctx)
alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_LOG_IEEE);
r600_bc_src(&alu.src[0], &ctx->src[0], 0);
r600_bc_src_set_abs(&alu.src[0]);
alu.dst.sel = ctx->temp_reg;
alu.dst.chan = i;
@@ -2514,6 +2542,7 @@ static int tgsi_log(struct r600_shader_ctx *ctx)
alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_LOG_IEEE);
r600_bc_src(&alu.src[0], &ctx->src[0], 0);
r600_bc_src_set_abs(&alu.src[0]);
alu.dst.sel = ctx->temp_reg;
alu.dst.chan = 0;
@@ -2538,7 +2567,7 @@ static int tgsi_log(struct r600_shader_ctx *ctx)
return r;
}
/* result.y = src.x / (2 ^ floor(log2(src.x))); */
/* result.y = |src.x| / (2 ^ floor(log2(|src.x|))); */
if ((inst->Dst[0].Register.WriteMask >> 1) & 1) {
if (ctx->bc->chiprev == CHIPREV_CAYMAN) {
@@ -2547,6 +2576,7 @@ static int tgsi_log(struct r600_shader_ctx *ctx)
alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_LOG_IEEE);
r600_bc_src(&alu.src[0], &ctx->src[0], 0);
r600_bc_src_set_abs(&alu.src[0]);
alu.dst.sel = ctx->temp_reg;
alu.dst.chan = i;
@@ -2564,6 +2594,7 @@ static int tgsi_log(struct r600_shader_ctx *ctx)
alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_LOG_IEEE);
r600_bc_src(&alu.src[0], &ctx->src[0], 0);
r600_bc_src_set_abs(&alu.src[0]);
alu.dst.sel = ctx->temp_reg;
alu.dst.chan = 1;
@@ -2663,6 +2694,7 @@ static int tgsi_log(struct r600_shader_ctx *ctx)
alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MUL);
r600_bc_src(&alu.src[0], &ctx->src[0], 0);
r600_bc_src_set_abs(&alu.src[0]);
alu.src[1].sel = ctx->temp_reg;
alu.src[1].chan = 1;
@@ -2677,7 +2709,7 @@ static int tgsi_log(struct r600_shader_ctx *ctx)
return r;
}
/* result.z = log2(src);*/
/* result.z = log2(|src|);*/
if ((inst->Dst[0].Register.WriteMask >> 2) & 1) {
if (ctx->bc->chiprev == CHIPREV_CAYMAN) {
for (i = 0; i < 3; i++) {
@@ -2685,6 +2717,7 @@ static int tgsi_log(struct r600_shader_ctx *ctx)
alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_LOG_IEEE);
r600_bc_src(&alu.src[0], &ctx->src[0], 0);
r600_bc_src_set_abs(&alu.src[0]);
alu.dst.sel = ctx->temp_reg;
if (i == 2)
@@ -2702,6 +2735,7 @@ static int tgsi_log(struct r600_shader_ctx *ctx)
alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_LOG_IEEE);
r600_bc_src(&alu.src[0], &ctx->src[0], 0);
r600_bc_src_set_abs(&alu.src[0]);
alu.dst.sel = ctx->temp_reg;
alu.dst.write = 1;

View File

@@ -1505,7 +1505,7 @@ void r600_pipe_shader_vs(struct pipe_context *ctx, struct r600_pipe_shader *shad
r600_pipe_state_add_reg(rstate,
R_0286C4_SPI_VS_OUT_CONFIG,
S_0286C4_VS_EXPORT_COUNT(rshader->noutput - 2),
S_0286C4_VS_EXPORT_COUNT(rshader->noutput - 1),
0xFFFFFFFF, NULL);
r600_pipe_state_add_reg(rstate,
R_028868_SQ_PGM_RESOURCES_VS,

View File

@@ -99,9 +99,9 @@
#endif
#endif
#if defined(__PPC__)
#if defined(__ppc__) || defined(__ppc64__) || defined(__PPC__)
#define PIPE_ARCH_PPC
#if defined(__PPC64__)
#if defined(__ppc64__) || defined(__PPC64__)
#define PIPE_ARCH_PPC_64
#endif
#endif
@@ -120,6 +120,15 @@
# define PIPE_ARCH_BIG_ENDIAN
#endif
#elif defined(__APPLE__)
#include <machine/endian.h>
#if __DARWIN_BYTE_ORDER == __DARWIN_LITTLE_ENDIAN
# define PIPE_ARCH_LITTLE_ENDIAN
#elif __DARWIN_BYTE_ORDER == __DARWIN_BIG_ENDIAN
# define PIPE_ARCH_BIG_ENDIAN
#endif
#else
#if defined(PIPE_ARCH_X86) || defined(PIPE_ARCH_X86_64)

View File

@@ -250,21 +250,21 @@ struct GalliumDXGIAdapter
DXGI_ADAPTER_DESC1 desc;
std::vector<ComPtr<IDXGIOutput> > outputs;
int num_outputs;
struct native_event_handler handler;
GalliumDXGIAdapter(GalliumDXGIFactory* factory, const struct native_platform* platform, void* dpy)
{
this->parent = factory;
/* FIXME handler should be static */
handler.invalid_surface = handle_invalid_surface;
handler.new_drm_screen = dxgi_loader_create_drm_screen;
handler.new_sw_screen = dxgi_loader_create_sw_screen;
platform->set_event_handler(&handler);
display = platform->create_display(dpy, FALSE, this);
display = platform->create_display(dpy, FALSE);
if(!display)
display = platform->create_display(dpy, TRUE, this);
display = platform->create_display(dpy, TRUE);
if (display) {
display->user_data = this;
if (!display->init_screen(display)) {
display->destroy(display);
display = NULL;
}
}
if(!display)
throw E_FAIL;
memset(&desc, 0, sizeof(desc));
@@ -1413,6 +1413,11 @@ struct dxgi_binding
static dxgi_binding dxgi_default_binding;
static __thread dxgi_binding dxgi_thread_binding;
static const struct native_event_handler dxgi_event_handler = {
GalliumDXGIAdapter::handle_invalid_surface,
dxgi_loader_create_drm_screen,
dxgi_loader_create_sw_screen
};
void STDMETHODCALLTYPE GalliumDXGIUseNothing()
{
@@ -1427,7 +1432,7 @@ void STDMETHODCALLTYPE GalliumDXGIUseNothing()
void STDMETHODCALLTYPE GalliumDXGIUseX11Display(Display* dpy, IGalliumDXGIBackend* backend)
{
GalliumDXGIUseNothing();
dxgi_thread_binding.platform = native_get_x11_platform();
dxgi_thread_binding.platform = native_get_x11_platform(&dxgi_event_handler);
dxgi_thread_binding.display = dpy;
if(backend)
@@ -1443,7 +1448,7 @@ void STDMETHODCALLTYPE GalliumDXGIUseX11Display(Display* dpy, IGalliumDXGIBacken
void STDMETHODCALLTYPE GalliumDXGIUseDRMCard(int fd)
{
GalliumDXGIUseNothing();
dxgi_thread_binding.platform = native_get_drm_platform();
dxgi_thread_binding.platform = native_get_drm_platform(&dxgi_event_handler);
dxgi_thread_binding.display = (void*)fd;
dxgi_thread_binding.backend = 0;
}
@@ -1453,7 +1458,7 @@ void STDMETHODCALLTYPE GalliumDXGIUseDRMCard(int fd)
void STDMETHODCALLTYPE GalliumDXGIUseFBDev(int fd)
{
GalliumDXGIUseNothing();
dxgi_thread_binding.platform = native_get_fbdev_platform();
dxgi_thread_binding.platform = native_get_fbdev_platform(&dxgi_event_handler);
dxgi_thread_binding.display = (void*)fd;
dxgi_thread_binding.backend = 0;
}
@@ -1463,7 +1468,7 @@ void STDMETHODCALLTYPE GalliumDXGIUseFBDev(int fd)
void STDMETHODCALLTYPE GalliumDXGIUseHDC(HDC hdc, PFNHWNDRESOLVER resolver, void* resolver_cookie)
{
GalliumDXGIUseNothing();
dxgi_thread_binding.platform = native_get_gdi_platform();
dxgi_thread_binding.platform = native_get_gdi_platform(&dxgi_event_handler);
dxgi_thread_binding.display = (void*)hdc;
dxgi_thread_binding.backend = 0;
}
@@ -1493,7 +1498,7 @@ void STDMETHODCALLTYPE GalliumDXGIMakeDefault()
else if(dxgi_default_binding.platform)
factory = new GalliumDXGIFactory(dxgi_default_binding.platform, dxgi_default_binding.display, dxgi_default_binding.backend);
else
factory = new GalliumDXGIFactory(native_get_x11_platform(), NULL, NULL);
factory = new GalliumDXGIFactory(native_get_x11_platform(&dxgi_event_handler), NULL, NULL);
HRESULT hres = factory->QueryInterface(riid, out_factory);
factory->Release();
return hres;

View File

@@ -87,7 +87,7 @@ egl_g3d_lookup_egl_image(struct native_display *ndpy, void *egl_image)
return resource;
}
static struct native_event_handler egl_g3d_native_event_handler = {
static const struct native_event_handler egl_g3d_native_event_handler = {
egl_g3d_invalid_surface,
egl_g3d_new_drm_screen,
egl_g3d_new_sw_screen,
@@ -110,40 +110,38 @@ egl_g3d_get_platform(_EGLDriver *drv, _EGLPlatformType plat)
case _EGL_PLATFORM_WINDOWS:
plat_name = "Windows";
#ifdef HAVE_GDI_BACKEND
nplat = native_get_gdi_platform();
nplat = native_get_gdi_platform(&egl_g3d_native_event_handler);
#endif
break;
case _EGL_PLATFORM_X11:
plat_name = "X11";
#ifdef HAVE_X11_BACKEND
nplat = native_get_x11_platform();
nplat = native_get_x11_platform(&egl_g3d_native_event_handler);
#endif
break;
case _EGL_PLATFORM_WAYLAND:
plat_name = "wayland";
#ifdef HAVE_WAYLAND_BACKEND
nplat = native_get_wayland_platform();
nplat = native_get_wayland_platform(&egl_g3d_native_event_handler);
#endif
break;
case _EGL_PLATFORM_DRM:
plat_name = "DRM";
#ifdef HAVE_DRM_BACKEND
nplat = native_get_drm_platform();
nplat = native_get_drm_platform(&egl_g3d_native_event_handler);
#endif
break;
case _EGL_PLATFORM_FBDEV:
plat_name = "FBDEV";
#ifdef HAVE_FBDEV_BACKEND
nplat = native_get_fbdev_platform();
nplat = native_get_fbdev_platform(&egl_g3d_native_event_handler);
#endif
break;
default:
break;
}
if (nplat)
nplat->set_event_handler(&egl_g3d_native_event_handler);
else
if (!nplat)
_eglLog(_EGL_WARNING, "unsupported platform %s", plat_name);
gdrv->platforms[plat] = nplat;
@@ -520,13 +518,20 @@ egl_g3d_initialize(_EGLDriver *drv, _EGLDisplay *dpy)
gdpy->loader = gdrv->loader;
dpy->DriverData = gdpy;
_eglLog(_EGL_INFO, "use %s for display %p", nplat->name, dpy->PlatformDisplay);
gdpy->native = nplat->create_display(dpy->PlatformDisplay,
dpy->Options.UseFallback, (void *) dpy);
_eglLog(_EGL_INFO, "use %s for display %p",
nplat->name, dpy->PlatformDisplay);
gdpy->native =
nplat->create_display(dpy->PlatformDisplay, dpy->Options.UseFallback);
if (!gdpy->native) {
_eglError(EGL_NOT_INITIALIZED, "eglInitialize(no usable display)");
goto fail;
}
gdpy->native->user_data = (void *) dpy;
if (!gdpy->native->init_screen(gdpy->native)) {
_eglError(EGL_NOT_INITIALIZED,
"eglInitialize(failed to initialize screen)");
goto fail;
}
if (gdpy->loader->profile_masks[ST_API_OPENGL] & ST_PROFILE_DEFAULT_MASK)
dpy->ClientAPIs |= EGL_OPENGL_BIT;

View File

@@ -152,6 +152,11 @@ struct native_display {
*/
void *user_data;
/**
* Initialize and create the pipe screen.
*/
boolean (*init_screen)(struct native_display *ndpy);
void (*destroy)(struct native_display *ndpy);
/**
@@ -259,26 +264,29 @@ ndpy_uninit(struct native_display *ndpy)
struct native_platform {
const char *name;
void (*set_event_handler)(struct native_event_handler *handler);
struct native_display *(*create_display)(void *dpy,
boolean use_sw,
void *user_data);
/**
* Create the native display and usually establish a connection to the
* display server.
*
* No event should be generated at this stage.
*/
struct native_display *(*create_display)(void *dpy, boolean use_sw);
};
const struct native_platform *
native_get_gdi_platform(void);
native_get_gdi_platform(const struct native_event_handler *event_handler);
const struct native_platform *
native_get_x11_platform(void);
native_get_x11_platform(const struct native_event_handler *event_handler);
const struct native_platform *
native_get_wayland_platform(void);
native_get_wayland_platform(const struct native_event_handler *event_handler);
const struct native_platform *
native_get_drm_platform(void);
native_get_drm_platform(const struct native_event_handler *event_handler);
const struct native_platform *
native_get_fbdev_platform(void);
native_get_fbdev_platform(const struct native_event_handler *event_handler);
#ifdef __cplusplus
}

View File

@@ -127,6 +127,8 @@ drm_display_destroy(struct native_display *ndpy)
drm_display_fini_modeset(&drmdpy->base);
/* gbm owns screen */
ndpy->screen = NULL;
ndpy_uninit(ndpy);
if (drmdpy->device_name)
@@ -249,9 +251,15 @@ drm_create_pixmap_surface(struct native_display *ndpy,
return drm_display_create_surface_from_resource(ndpy, bo->resource);
}
static boolean
drm_display_init_screen(struct native_display *ndpy)
{
return TRUE;
}
static struct native_display *
drm_create_display(struct gbm_gallium_drm_device *gbmdrm,
struct native_event_handler *event_handler, void *user_data)
const struct native_event_handler *event_handler)
{
struct drm_display *drmdpy;
@@ -267,10 +275,10 @@ drm_create_display(struct gbm_gallium_drm_device *gbmdrm,
gbmdrm->lookup_egl_image_data = &drmdpy->base;
drmdpy->event_handler = event_handler;
drmdpy->base.user_data = user_data;
drmdpy->base.screen = gbmdrm->screen;
drmdpy->base.init_screen = drm_display_init_screen;
drmdpy->base.destroy = drm_display_destroy;
drmdpy->base.get_param = drm_display_get_param;
drmdpy->base.get_configs = drm_display_get_configs;
@@ -287,16 +295,10 @@ drm_create_display(struct gbm_gallium_drm_device *gbmdrm,
return &drmdpy->base;
}
static struct native_event_handler *drm_event_handler;
static void
native_set_event_handler(struct native_event_handler *event_handler)
{
drm_event_handler = event_handler;
}
static const struct native_event_handler *drm_event_handler;
static struct native_display *
native_create_display(void *dpy, boolean use_sw, void *user_data)
native_create_display(void *dpy, boolean use_sw)
{
struct gbm_gallium_drm_device *gbm;
int fd;
@@ -315,17 +317,17 @@ native_create_display(void *dpy, boolean use_sw, void *user_data)
gbm->base.type != GBM_DRM_DRIVER_TYPE_GALLIUM)
return NULL;
return drm_create_display(gbm, drm_event_handler, user_data);
return drm_create_display(gbm, drm_event_handler);
}
static const struct native_platform drm_platform = {
"DRM", /* name */
native_set_event_handler,
native_create_display
};
const struct native_platform *
native_get_drm_platform(void)
native_get_drm_platform(const struct native_event_handler *event_handler)
{
drm_event_handler = event_handler;
return &drm_platform;
}

View File

@@ -50,7 +50,7 @@ struct drm_surface;
struct drm_display {
struct native_display base;
struct native_event_handler *event_handler;
const struct native_event_handler *event_handler;
int fd;
char *device_name;

View File

@@ -26,6 +26,21 @@
* Chia-I Wu <olv@lunarg.com>
*/
/**
* Considering fbdev as an in-kernel window system,
*
* - opening a device opens a connection
* - there is only one window: the framebuffer
* - fb_var_screeninfo decides window position, size, and even color format
* - there is no pixmap
*
* Now EGL is built on top of this window system. So we should have
*
* - the fd as the handle of the native display
* - reject all but one native window: NULL
* - no pixmap support
*/
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/stat.h>
@@ -45,16 +60,13 @@ struct fbdev_display {
struct native_display base;
int fd;
struct native_event_handler *event_handler;
const struct native_event_handler *event_handler;
struct fb_fix_screeninfo finfo;
struct fb_var_screeninfo vinfo;
struct fb_var_screeninfo config_vinfo;
struct native_config config;
struct native_connector connector;
struct native_mode mode;
struct fbdev_surface *current_surface;
boolean assume_fixed_vinfo;
};
struct fbdev_surface {
@@ -66,7 +78,7 @@ struct fbdev_surface {
unsigned int sequence_number;
boolean is_current;
struct fbdev_sw_drawable drawable;
};
static INLINE struct fbdev_display *
@@ -103,38 +115,70 @@ fbdev_surface_validate(struct native_surface *nsurf, uint attachment_mask,
return TRUE;
}
static boolean
fbdev_surface_flush_frontbuffer(struct native_surface *nsurf)
static enum pipe_format
vinfo_to_format(const struct fb_var_screeninfo *vinfo)
{
struct fbdev_surface *fbsurf = fbdev_surface(nsurf);
enum pipe_format format = PIPE_FORMAT_NONE;
if (!fbsurf->is_current)
return TRUE;
/* should also check channel offsets... */
switch (vinfo->bits_per_pixel) {
case 32:
if (vinfo->red.length == 8 &&
vinfo->green.length == 8 &&
vinfo->blue.length == 8) {
format = (vinfo->transp.length == 8) ?
PIPE_FORMAT_B8G8R8A8_UNORM : PIPE_FORMAT_B8G8R8X8_UNORM;
}
break;
case 16:
if (vinfo->red.length == 5 &&
vinfo->green.length == 6 &&
vinfo->blue.length == 5 &&
vinfo->transp.length == 0)
format = PIPE_FORMAT_B5G6R5_UNORM;
break;
default:
break;
}
return resource_surface_present(fbsurf->rsurf,
NATIVE_ATTACHMENT_FRONT_LEFT, NULL);
return format;
}
static boolean
fbdev_surface_swap_buffers(struct native_surface *nsurf)
fbdev_surface_update_drawable(struct native_surface *nsurf,
const struct fb_var_screeninfo *vinfo)
{
struct fbdev_surface *fbsurf = fbdev_surface(nsurf);
struct fbdev_display *fbdpy = fbsurf->fbdpy;
boolean ret = TRUE;
unsigned x, y, width, height;
if (fbsurf->is_current) {
ret = resource_surface_present(fbsurf->rsurf,
NATIVE_ATTACHMENT_BACK_LEFT, NULL);
x = vinfo->xoffset;
y = vinfo->yoffset;
width = MIN2(vinfo->xres, fbsurf->width);
height = MIN2(vinfo->yres, fbsurf->height);
/* sanitize the values */
if (x + width > vinfo->xres_virtual) {
if (x > vinfo->xres_virtual)
width = 0;
else
width = vinfo->xres_virtual - x;
}
if (y + height > vinfo->yres_virtual) {
if (y > vinfo->yres_virtual)
height = 0;
else
height = vinfo->yres_virtual - y;
}
resource_surface_swap_buffers(fbsurf->rsurf,
NATIVE_ATTACHMENT_FRONT_LEFT, NATIVE_ATTACHMENT_BACK_LEFT, TRUE);
/* the front/back textures are swapped */
fbsurf->sequence_number++;
fbdpy->event_handler->invalid_surface(&fbdpy->base,
&fbsurf->base, fbsurf->sequence_number);
fbsurf->drawable.format = vinfo_to_format(vinfo);
fbsurf->drawable.x = vinfo->xoffset;
fbsurf->drawable.y = vinfo->yoffset;
fbsurf->drawable.width = vinfo->xres;
fbsurf->drawable.height = vinfo->yres;
return ret;
return (fbsurf->drawable.format != PIPE_FORMAT_NONE &&
fbsurf->drawable.width &&
fbsurf->drawable.height);
}
static boolean
@@ -143,21 +187,43 @@ fbdev_surface_present(struct native_surface *nsurf,
boolean preserve,
uint swap_interval)
{
boolean ret;
struct fbdev_surface *fbsurf = fbdev_surface(nsurf);
struct fbdev_display *fbdpy = fbsurf->fbdpy;
boolean ret = FALSE;
if (preserve || swap_interval)
if (swap_interval)
return FALSE;
if (natt != NATIVE_ATTACHMENT_BACK_LEFT)
return FALSE;
switch (natt) {
case NATIVE_ATTACHMENT_FRONT_LEFT:
ret = fbdev_surface_flush_frontbuffer(nsurf);
break;
case NATIVE_ATTACHMENT_BACK_LEFT:
ret = fbdev_surface_swap_buffers(nsurf);
break;
default:
ret = FALSE;
break;
if (!fbdpy->assume_fixed_vinfo) {
struct fb_var_screeninfo vinfo;
memset(&vinfo, 0, sizeof(vinfo));
if (ioctl(fbdpy->fd, FBIOGET_VSCREENINFO, &vinfo))
return FALSE;
/* present the surface */
if (fbdev_surface_update_drawable(&fbsurf->base, &vinfo)) {
ret = resource_surface_present(fbsurf->rsurf,
natt, (void *) &fbsurf->drawable);
}
fbsurf->width = vinfo.xres;
fbsurf->height = vinfo.yres;
if (resource_surface_set_size(fbsurf->rsurf,
fbsurf->width, fbsurf->height)) {
/* surface resized */
fbsurf->sequence_number++;
fbdpy->event_handler->invalid_surface(&fbdpy->base,
&fbsurf->base, fbsurf->sequence_number);
}
}
else {
/* the drawable never changes */
ret = resource_surface_present(fbsurf->rsurf,
natt, (void *) &fbsurf->drawable);
}
return ret;
@@ -179,26 +245,48 @@ fbdev_surface_destroy(struct native_surface *nsurf)
}
static struct native_surface *
fbdev_display_create_scanout_surface(struct native_display *ndpy,
const struct native_config *nconf,
uint width, uint height)
fbdev_display_create_window_surface(struct native_display *ndpy,
EGLNativeWindowType win,
const struct native_config *nconf)
{
struct fbdev_display *fbdpy = fbdev_display(ndpy);
struct fbdev_surface *fbsurf;
struct fb_var_screeninfo vinfo;
/* there is only one native window: NULL */
if (win)
return NULL;
fbsurf = CALLOC_STRUCT(fbdev_surface);
if (!fbsurf)
return NULL;
fbsurf->fbdpy = fbdpy;
fbsurf->width = width;
fbsurf->height = height;
/* get current vinfo */
if (fbdpy->assume_fixed_vinfo) {
vinfo = fbdpy->config_vinfo;
}
else {
memset(&vinfo, 0, sizeof(vinfo));
if (ioctl(fbdpy->fd, FBIOGET_VSCREENINFO, &vinfo)) {
FREE(fbsurf);
return NULL;
}
}
fbsurf->width = vinfo.xres;
fbsurf->height = vinfo.yres;
if (!fbdev_surface_update_drawable(&fbsurf->base, &vinfo)) {
FREE(fbsurf);
return NULL;
}
fbsurf->rsurf = resource_surface_create(fbdpy->base.screen,
nconf->color_format,
PIPE_BIND_RENDER_TARGET |
PIPE_BIND_DISPLAY_TARGET |
PIPE_BIND_SCANOUT);
PIPE_BIND_DISPLAY_TARGET);
if (!fbsurf->rsurf) {
FREE(fbsurf);
return NULL;
@@ -214,42 +302,43 @@ fbdev_display_create_scanout_surface(struct native_display *ndpy,
return &fbsurf->base;
}
static struct native_surface *
fbdev_display_create_scanout_surface(struct native_display *ndpy,
const struct native_config *nconf,
uint width, uint height)
{
return fbdev_display_create_window_surface(ndpy,
(EGLNativeWindowType) NULL, nconf);
}
static boolean
fbdev_display_program(struct native_display *ndpy, int crtc_idx,
struct native_surface *nsurf, uint x, uint y,
const struct native_connector **nconns, int num_nconns,
const struct native_mode *nmode)
{
struct fbdev_display *fbdpy = fbdev_display(ndpy);
struct fbdev_surface *fbsurf = fbdev_surface(nsurf);
if (x || y)
return FALSE;
if (fbdpy->current_surface) {
if (fbdpy->current_surface == fbsurf)
return TRUE;
fbdpy->current_surface->is_current = FALSE;
}
if (fbsurf)
fbsurf->is_current = TRUE;
fbdpy->current_surface = fbsurf;
return TRUE;
}
static const struct native_mode **
fbdev_display_get_modes(struct native_display *ndpy,
const struct native_connector *nconn,
int *num_modes)
const struct native_connector *nconn,
int *num_modes)
{
struct fbdev_display *fbdpy = fbdev_display(ndpy);
static struct native_mode mode;
const struct native_mode **modes;
if (!mode.desc) {
struct fbdev_display *fbdpy = fbdev_display(ndpy);
mode.desc = "Current Mode";
mode.width = fbdpy->config_vinfo.xres;
mode.height = fbdpy->config_vinfo.yres;
mode.refresh_rate = 60 * 1000; /* dummy */
}
modes = MALLOC(sizeof(*modes));
if (modes) {
modes[0] = &fbdpy->mode;
modes[0] = &mode;
if (num_modes)
*num_modes = 1;
}
@@ -261,12 +350,12 @@ static const struct native_connector **
fbdev_display_get_connectors(struct native_display *ndpy, int *num_connectors,
int *num_crtc)
{
struct fbdev_display *fbdpy = fbdev_display(ndpy);
static struct native_connector connector;
const struct native_connector **connectors;
connectors = MALLOC(sizeof(*connectors));
if (connectors) {
connectors[0] = &fbdpy->connector;
connectors[0] = &connector;
if (num_connectors)
*num_connectors = 1;
}
@@ -274,7 +363,8 @@ fbdev_display_get_connectors(struct native_display *ndpy, int *num_connectors,
return connectors;
}
static struct native_display_modeset fbdev_display_modeset = {
/* remove modeset support one day! */
static const struct native_display_modeset fbdev_display_modeset = {
.get_connectors = fbdev_display_get_connectors,
.get_modes = fbdev_display_get_modes,
.create_scanout_surface = fbdev_display_create_scanout_surface,
@@ -304,8 +394,10 @@ fbdev_display_get_param(struct native_display *ndpy,
int val;
switch (param) {
case NATIVE_PARAM_USE_NATIVE_BUFFER:
case NATIVE_PARAM_PRESERVE_BUFFER:
val = 1;
break;
case NATIVE_PARAM_USE_NATIVE_BUFFER:
case NATIVE_PARAM_MAX_SWAP_INTERVAL:
default:
val = 0;
@@ -326,114 +418,55 @@ fbdev_display_destroy(struct native_display *ndpy)
}
static boolean
fbdev_display_init_modes(struct native_display *ndpy)
{
struct fbdev_display *fbdpy = fbdev_display(ndpy);
struct native_mode *nmode = &fbdpy->mode;
nmode->desc = "Current Mode";
nmode->width = fbdpy->vinfo.xres;
nmode->height = fbdpy->vinfo.yres;
nmode->refresh_rate = 60 * 1000; /* dummy */
return TRUE;
}
static boolean
fbdev_display_init_connectors(struct native_display *ndpy)
{
return TRUE;
}
static enum pipe_format
vinfo_to_format(const struct fb_var_screeninfo *vinfo)
{
enum pipe_format format = PIPE_FORMAT_NONE;
switch (vinfo->bits_per_pixel) {
case 32:
if (vinfo->red.length == 8 &&
vinfo->green.length == 8 &&
vinfo->blue.length == 8) {
format = (vinfo->transp.length == 8) ?
PIPE_FORMAT_B8G8R8A8_UNORM : PIPE_FORMAT_B8G8R8X8_UNORM;
}
break;
case 16:
if (vinfo->red.length == 5 &&
vinfo->green.length == 6 &&
vinfo->blue.length == 5 &&
vinfo->transp.length == 0)
format = PIPE_FORMAT_B5G6R5_UNORM;
break;
default:
break;
}
return format;
}
static boolean
fbdev_display_init_configs(struct native_display *ndpy)
{
struct fbdev_display *fbdpy = fbdev_display(ndpy);
struct native_config *nconf = &fbdpy->config;
nconf->color_format = vinfo_to_format(&fbdpy->vinfo);
if (nconf->color_format == PIPE_FORMAT_NONE)
return FALSE;
nconf->buffer_mask =
(1 << NATIVE_ATTACHMENT_FRONT_LEFT) |
(1 << NATIVE_ATTACHMENT_BACK_LEFT);
nconf->scanout_bit = TRUE;
return TRUE;
}
static boolean
fbdev_display_init(struct native_display *ndpy)
fbdev_display_init_screen(struct native_display *ndpy)
{
struct fbdev_display *fbdpy = fbdev_display(ndpy);
struct sw_winsys *ws;
if (ioctl(fbdpy->fd, FBIOGET_FSCREENINFO, &fbdpy->finfo))
ws = fbdev_create_sw_winsys(fbdpy->fd);
if (!ws)
return FALSE;
if (ioctl(fbdpy->fd, FBIOGET_VSCREENINFO, &fbdpy->vinfo))
fbdpy->base.screen = fbdpy->event_handler->new_sw_screen(&fbdpy->base, ws);
if (!fbdpy->base.screen) {
if (ws->destroy)
ws->destroy(ws);
return FALSE;
if (fbdpy->finfo.visual != FB_VISUAL_TRUECOLOR ||
fbdpy->finfo.type != FB_TYPE_PACKED_PIXELS)
return FALSE;
if (!fbdev_display_init_configs(&fbdpy->base) ||
!fbdev_display_init_connectors(&fbdpy->base) ||
!fbdev_display_init_modes(&fbdpy->base))
return FALSE;
ws = fbdev_create_sw_winsys(fbdpy->fd, fbdpy->config.color_format);
if (ws) {
fbdpy->base.screen =
fbdpy->event_handler->new_sw_screen(&fbdpy->base, ws);
}
if (fbdpy->base.screen) {
if (!fbdpy->base.screen->is_format_supported(fbdpy->base.screen,
fbdpy->config.color_format, PIPE_TEXTURE_2D, 0,
PIPE_BIND_RENDER_TARGET)) {
fbdpy->base.screen->destroy(fbdpy->base.screen);
fbdpy->base.screen = NULL;
}
if (!fbdpy->base.screen->is_format_supported(fbdpy->base.screen,
fbdpy->config.color_format, PIPE_TEXTURE_2D, 0,
PIPE_BIND_RENDER_TARGET)) {
fbdpy->base.screen->destroy(fbdpy->base.screen);
fbdpy->base.screen = NULL;
return FALSE;
}
return (fbdpy->base.screen != NULL);
return TRUE;
}
static boolean
fbdev_display_init_config(struct native_display *ndpy)
{
struct fbdev_display *fbdpy = fbdev_display(ndpy);
struct native_config *nconf = &fbdpy->config;
if (ioctl(fbdpy->fd, FBIOGET_VSCREENINFO, &fbdpy->config_vinfo))
return FALSE;
nconf->color_format = vinfo_to_format(&fbdpy->config_vinfo);
if (nconf->color_format == PIPE_FORMAT_NONE)
return FALSE;
nconf->buffer_mask = (1 << NATIVE_ATTACHMENT_BACK_LEFT);
nconf->window_bit = TRUE;
return TRUE;
}
static struct native_display *
fbdev_display_create(int fd, struct native_event_handler *event_handler,
void *user_data)
fbdev_display_create(int fd, const struct native_event_handler *event_handler)
{
struct fbdev_display *fbdpy;
@@ -443,32 +476,41 @@ fbdev_display_create(int fd, struct native_event_handler *event_handler,
fbdpy->fd = fd;
fbdpy->event_handler = event_handler;
fbdpy->base.user_data = user_data;
if (!fbdev_display_init(&fbdpy->base)) {
FREE(fbdpy);
return NULL;
}
if (ioctl(fbdpy->fd, FBIOGET_FSCREENINFO, &fbdpy->finfo))
goto fail;
if (fbdpy->finfo.visual != FB_VISUAL_TRUECOLOR ||
fbdpy->finfo.type != FB_TYPE_PACKED_PIXELS)
goto fail;
if (!fbdev_display_init_config(&fbdpy->base))
goto fail;
fbdpy->assume_fixed_vinfo = TRUE;
fbdpy->base.init_screen = fbdev_display_init_screen;
fbdpy->base.destroy = fbdev_display_destroy;
fbdpy->base.get_param = fbdev_display_get_param;
fbdpy->base.get_configs = fbdev_display_get_configs;
fbdpy->base.create_window_surface = fbdev_display_create_window_surface;
/* we'd like to remove modeset support one day */
fbdpy->config.scanout_bit = TRUE;
fbdpy->base.modeset = &fbdev_display_modeset;
return &fbdpy->base;
fail:
FREE(fbdpy);
return NULL;
}
static struct native_event_handler *fbdev_event_handler;
static void
native_set_event_handler(struct native_event_handler *event_handler)
{
fbdev_event_handler = event_handler;
}
static const struct native_event_handler *fbdev_event_handler;
static struct native_display *
native_create_display(void *dpy, boolean use_sw, void *user_data)
native_create_display(void *dpy, boolean use_sw)
{
struct native_display *ndpy;
int fd;
@@ -483,7 +525,7 @@ native_create_display(void *dpy, boolean use_sw, void *user_data)
if (fd < 0)
return NULL;
ndpy = fbdev_display_create(fd, fbdev_event_handler, user_data);
ndpy = fbdev_display_create(fd, fbdev_event_handler);
if (!ndpy)
close(fd);
@@ -492,12 +534,12 @@ native_create_display(void *dpy, boolean use_sw, void *user_data)
static const struct native_platform fbdev_platform = {
"FBDEV", /* name */
native_set_event_handler,
native_create_display
};
const struct native_platform *
native_get_fbdev_platform(void)
native_get_fbdev_platform(const struct native_event_handler *event_handler)
{
fbdev_event_handler = event_handler;
return &fbdev_platform;
}

View File

@@ -41,7 +41,7 @@ struct gdi_display {
struct native_display base;
HDC hDC;
struct native_event_handler *event_handler;
const struct native_event_handler *event_handler;
struct native_config *configs;
int num_configs;
@@ -368,12 +368,30 @@ gdi_display_destroy(struct native_display *ndpy)
FREE(gdpy);
}
static boolean
gdi_display_init_screen(struct native_display *ndpy)
{
struct gdi_display *gdpy = gdi_display(ndpy);
struct sw_winsys *winsys;
winsys = gdi_create_sw_winsys();
if (!winsys)
return FALSE;
gdpy->base.screen = gdpy->event_handler->new_sw_screen(&gdpy->base, winsys);
if (!gdpy->base.screen) {
if (winsys->destroy)
winsys->destroy(winsys);
return FALSE;
}
return TRUE;
}
static struct native_display *
gdi_create_display(HDC hDC, struct native_event_handler *event_handler,
void *user_data)
gdi_create_display(HDC hDC, const struct native_event_handler *event_handler)
{
struct gdi_display *gdpy;
struct sw_winsys *winsys;
gdpy = CALLOC_STRUCT(gdi_display);
if (!gdpy)
@@ -381,22 +399,8 @@ gdi_create_display(HDC hDC, struct native_event_handler *event_handler,
gdpy->hDC = hDC;
gdpy->event_handler = event_handler;
gdpy->base.user_data = user_data;
winsys = gdi_create_sw_winsys();
if (!winsys) {
FREE(gdpy);
return NULL;
}
gdpy->base.screen = gdpy->event_handler->new_sw_screen(&gdpy->base, winsys);
if (!gdpy->base.screen) {
if (winsys->destroy)
winsys->destroy(winsys);
FREE(gdpy);
return NULL;
}
gdpy->base.init_screen = gdi_display_init_screen;
gdpy->base.destroy = gdi_display_destroy;
gdpy->base.get_param = gdi_display_get_param;
@@ -406,28 +410,22 @@ gdi_create_display(HDC hDC, struct native_event_handler *event_handler,
return &gdpy->base;
}
static struct native_event_handler *gdi_event_handler;
static void
native_set_event_handler(struct native_event_handler *event_handler)
{
gdi_event_handler = event_handler;
}
static const struct native_event_handler *gdi_event_handler;
static struct native_display *
native_create_display(void *dpy, boolean use_sw, void *user_data)
native_create_display(void *dpy, boolean use_sw)
{
return gdi_create_display((HDC) dpy, gdi_event_handler, user_data);
return gdi_create_display((HDC) dpy, gdi_event_handler);
}
static const struct native_platform gdi_platform = {
"GDI", /* name */
native_set_event_handler,
native_create_display
};
const struct native_platform *
native_get_gdi_platform(void)
native_get_gdi_platform(const struct native_event_handler *event_handler)
{
gdi_event_handler = event_handler;
return &gdi_platform;
}

View File

@@ -51,7 +51,7 @@
struct wayland_drm_display {
struct wayland_display base;
struct native_event_handler *event_handler;
const struct native_event_handler *event_handler;
struct wl_drm *wl_drm;
struct wl_drm *wl_server_drm; /* for EGL_WL_bind_wayland_display */
@@ -285,8 +285,7 @@ static struct native_display_wayland_bufmgr wayland_drm_display_wayland_bufmgr =
struct wayland_display *
wayland_create_drm_display(struct wl_display *dpy,
struct native_event_handler *event_handler,
void *user_data)
const struct native_event_handler *event_handler)
{
struct wayland_drm_display *drmdpy;
@@ -295,7 +294,6 @@ wayland_create_drm_display(struct wl_display *dpy,
return NULL;
drmdpy->event_handler = event_handler;
drmdpy->base.base.user_data = user_data;
drmdpy->base.dpy = dpy;
if (!drmdpy->base.dpy) {
@@ -303,10 +301,7 @@ wayland_create_drm_display(struct wl_display *dpy,
return NULL;
}
if (!wayland_drm_display_init_screen(&drmdpy->base.base)) {
wayland_drm_display_destroy(&drmdpy->base.base);
return NULL;
}
drmdpy->base.base.init_screen = wayland_drm_display_init_screen;
drmdpy->base.base.destroy = wayland_drm_display_destroy;
drmdpy->base.base.buffer = &wayland_drm_display_buffer;
drmdpy->base.base.wayland_bufmgr = &wayland_drm_display_wayland_bufmgr;

View File

@@ -47,7 +47,7 @@
struct wayland_shm_display {
struct wayland_display base;
struct native_event_handler *event_handler;
const struct native_event_handler *event_handler;
struct wl_shm *wl_shm;
};
@@ -144,8 +144,7 @@ wayland_shm_display_init_screen(struct native_display *ndpy)
struct wayland_display *
wayland_create_shm_display(struct wl_display *dpy,
struct native_event_handler *event_handler,
void *user_data)
const struct native_event_handler *event_handler)
{
struct wayland_shm_display *shmdpy;
@@ -154,7 +153,6 @@ wayland_create_shm_display(struct wl_display *dpy,
return NULL;
shmdpy->event_handler = event_handler;
shmdpy->base.base.user_data = user_data;
shmdpy->base.dpy = dpy;
if (!shmdpy->base.dpy) {
@@ -162,11 +160,7 @@ wayland_create_shm_display(struct wl_display *dpy,
return NULL;
}
if (!wayland_shm_display_init_screen(&shmdpy->base.base)) {
wayland_shm_display_destroy(&shmdpy->base.base);
return NULL;
}
shmdpy->base.base.init_screen = wayland_shm_display_init_screen;
shmdpy->base.base.destroy = wayland_shm_display_destroy;
shmdpy->base.create_buffer = wayland_create_shm_buffer;

View File

@@ -35,7 +35,7 @@
#include "native_wayland.h"
static struct native_event_handler *wayland_event_handler;
static const struct native_event_handler *wayland_event_handler;
static void
sync_callback(void *data)
@@ -447,14 +447,8 @@ wayland_create_window_surface(struct native_display *ndpy,
return &surface->base;
}
static void
native_set_event_handler(struct native_event_handler *event_handler)
{
wayland_event_handler = event_handler;
}
static struct native_display *
native_create_display(void *dpy, boolean use_sw, void *user_data)
native_create_display(void *dpy, boolean use_sw)
{
struct wayland_display *display = NULL;
boolean own_dpy = FALSE;
@@ -471,12 +465,10 @@ native_create_display(void *dpy, boolean use_sw, void *user_data)
if (use_sw) {
_eglLog(_EGL_INFO, "use software fallback");
display = wayland_create_shm_display((struct wl_display *) dpy,
wayland_event_handler,
user_data);
wayland_event_handler);
} else {
display = wayland_create_drm_display((struct wl_display *) dpy,
wayland_event_handler,
user_data);
wayland_event_handler);
}
if (!display)
@@ -495,13 +487,13 @@ native_create_display(void *dpy, boolean use_sw, void *user_data)
static const struct native_platform wayland_platform = {
"wayland", /* name */
native_set_event_handler,
native_create_display
};
const struct native_platform *
native_get_wayland_platform(void)
native_get_wayland_platform(const struct native_event_handler *event_handler)
{
wayland_event_handler = event_handler;
return &wayland_platform;
}

View File

@@ -103,11 +103,10 @@ wayland_config(const struct native_config *nconf)
struct wayland_display *
wayland_create_shm_display(struct wl_display *display,
struct native_event_handler *event_handler,
void *user_data);
const struct native_event_handler *event_handler);
struct wayland_display *
wayland_create_drm_display(struct wl_display *display,
struct native_event_handler *event_handler,
void *user_data);
const struct native_event_handler *event_handler);
#endif /* _NATIVE_WAYLAND_H_ */

View File

@@ -49,7 +49,7 @@ struct dri2_display {
Display *dpy;
boolean own_dpy;
struct native_event_handler *event_handler;
const struct native_event_handler *event_handler;
struct x11_screen *xscr;
int xscr_number;
@@ -870,8 +870,7 @@ static struct native_display_wayland_bufmgr dri2_display_wayland_bufmgr = {
struct native_display *
x11_create_dri2_display(Display *dpy,
struct native_event_handler *event_handler,
void *user_data)
const struct native_event_handler *event_handler)
{
struct dri2_display *dri2dpy;
@@ -880,7 +879,6 @@ x11_create_dri2_display(Display *dpy,
return NULL;
dri2dpy->event_handler = event_handler;
dri2dpy->base.user_data = user_data;
dri2dpy->dpy = dpy;
if (!dri2dpy->dpy) {
@@ -899,11 +897,6 @@ x11_create_dri2_display(Display *dpy,
return NULL;
}
if (!dri2_display_init_screen(&dri2dpy->base)) {
dri2_display_destroy(&dri2dpy->base);
return NULL;
}
dri2dpy->surfaces = util_hash_table_create(dri2_display_hash_table_hash,
dri2_display_hash_table_compare);
if (!dri2dpy->surfaces) {
@@ -911,6 +904,7 @@ x11_create_dri2_display(Display *dpy,
return NULL;
}
dri2dpy->base.init_screen = dri2_display_init_screen;
dri2dpy->base.destroy = dri2_display_destroy;
dri2dpy->base.get_param = dri2_display_get_param;
dri2dpy->base.get_configs = dri2_display_get_configs;
@@ -928,8 +922,7 @@ x11_create_dri2_display(Display *dpy,
struct native_display *
x11_create_dri2_display(Display *dpy,
struct native_event_handler *event_handler,
void *user_data)
const struct native_event_handler *event_handler)
{
return NULL;
}

View File

@@ -30,16 +30,10 @@
#include "native_x11.h"
static struct native_event_handler *x11_event_handler;
static void
native_set_event_handler(struct native_event_handler *event_handler)
{
x11_event_handler = event_handler;
}
static const struct native_event_handler *x11_event_handler;
static struct native_display *
native_create_display(void *dpy, boolean use_sw, void *user_data)
native_create_display(void *dpy, boolean use_sw)
{
struct native_display *ndpy = NULL;
boolean force_sw;
@@ -48,12 +42,10 @@ native_create_display(void *dpy, boolean use_sw, void *user_data)
if (force_sw || use_sw) {
_eglLog(_EGL_INFO, "use software fallback");
ndpy = x11_create_ximage_display((Display *) dpy,
x11_event_handler, user_data);
ndpy = x11_create_ximage_display((Display *) dpy, x11_event_handler);
}
else {
ndpy = x11_create_dri2_display((Display *) dpy,
x11_event_handler, user_data);
ndpy = x11_create_dri2_display((Display *) dpy, x11_event_handler);
}
return ndpy;
@@ -61,12 +53,12 @@ native_create_display(void *dpy, boolean use_sw, void *user_data)
static const struct native_platform x11_platform = {
"X11", /* name */
native_set_event_handler,
native_create_display
};
const struct native_platform *
native_get_x11_platform(void)
native_get_x11_platform(const struct native_event_handler *event_handler)
{
x11_event_handler = event_handler;
return &x11_platform;
}

View File

@@ -31,12 +31,10 @@
struct native_display *
x11_create_ximage_display(Display *dpy,
struct native_event_handler *event_handler,
void *user_data);
const struct native_event_handler *event_handler);
struct native_display *
x11_create_dri2_display(Display *dpy,
struct native_event_handler *event_handler,
void *user_data);
const struct native_event_handler *event_handler);
#endif /* _NATIVE_X11_H_ */

View File

@@ -43,7 +43,7 @@ struct ximage_display {
Display *dpy;
boolean own_dpy;
struct native_event_handler *event_handler;
const struct native_event_handler *event_handler;
struct x11_screen *xscr;
int xscr_number;
@@ -484,13 +484,32 @@ ximage_display_destroy(struct native_display *ndpy)
FREE(xdpy);
}
static boolean
ximage_display_init_screen(struct native_display *ndpy)
{
struct ximage_display *xdpy = ximage_display(ndpy);
struct sw_winsys *winsys;
winsys = xlib_create_sw_winsys(xdpy->dpy);
if (!winsys)
return FALSE;
xdpy->base.screen =
xdpy->event_handler->new_sw_screen(&xdpy->base, winsys);
if (!xdpy->base.screen) {
if (winsys->destroy)
winsys->destroy(winsys);
return FALSE;
}
return TRUE;
}
struct native_display *
x11_create_ximage_display(Display *dpy,
struct native_event_handler *event_handler,
void *user_data)
const struct native_event_handler *event_handler)
{
struct ximage_display *xdpy;
struct sw_winsys *winsys = NULL;
xdpy = CALLOC_STRUCT(ximage_display);
if (!xdpy)
@@ -507,22 +526,17 @@ x11_create_ximage_display(Display *dpy,
}
xdpy->event_handler = event_handler;
xdpy->base.user_data = user_data;
xdpy->xscr_number = DefaultScreen(xdpy->dpy);
xdpy->xscr = x11_screen_create(xdpy->dpy, xdpy->xscr_number);
if (!xdpy->xscr)
goto fail;
winsys = xlib_create_sw_winsys(xdpy->dpy);
if (!winsys)
goto fail;
xdpy->base.screen =
xdpy->event_handler->new_sw_screen(&xdpy->base, winsys);
if (!xdpy->base.screen)
goto fail;
if (!xdpy->xscr) {
if (xdpy->own_dpy)
XCloseDisplay(xdpy->dpy);
FREE(xdpy);
return NULL;
}
xdpy->base.init_screen = ximage_display_init_screen;
xdpy->base.destroy = ximage_display_destroy;
xdpy->base.get_param = ximage_display_get_param;
@@ -532,14 +546,4 @@ x11_create_ximage_display(Display *dpy,
xdpy->base.create_pixmap_surface = ximage_display_create_pixmap_surface;
return &xdpy->base;
fail:
if (winsys && winsys->destroy)
winsys->destroy(winsys);
if (xdpy->xscr)
x11_screen_destroy(xdpy->xscr);
if (xdpy->dpy && xdpy->own_dpy)
XCloseDisplay(xdpy->dpy);
FREE(xdpy);
return NULL;
}

View File

@@ -864,16 +864,19 @@ choose_visual( Display *dpy, int screen, const int *list, GLboolean fbConfig )
parselist++;
break;
case GLX_FBCONFIG_ID:
case GLX_VISUAL_ID:
if (!fbConfig)
return NULL;
parselist++;
desiredVisualID = *parselist++;
break;
case GLX_X_RENDERABLE:
case GLX_MAX_PBUFFER_WIDTH:
case GLX_MAX_PBUFFER_HEIGHT:
case GLX_MAX_PBUFFER_PIXELS:
if (!fbConfig)
return NULL;
parselist += 2;
/* ignore */
return NULL; /* invalid config option */
parselist += 2; /* ignore the parameter */
break;
#ifdef GLX_EXT_texture_from_pixmap

View File

@@ -42,7 +42,7 @@ egl_CPPFLAGS += \
-I$(TOP)/src/egl/main \
-D_EGL_MAIN=_eglMain
egl_LIBS += $(TOP)/src/gallium/state_trackers/egl/libegl.a
egl_SYS += $(LIBUDEV_LIBS) -lEGL -lm
egl_SYS += $(LIBUDEV_LIBS) $(DLOPEN_LIBS) -lEGL -lm -lpthread
# EGL platforms
ifneq ($(findstring x11, $(EGL_PLATFORMS)),)
@@ -70,7 +70,7 @@ egl_CPPFLAGS += -I$(TOP)/src/mesa $(API_DEFINES)
# make st/mesa built-in when there is a single glapi provider
ifeq ($(SHARED_GLAPI),1)
egl_LIBS += $(TOP)/src/mesa/libmesagallium.a
egl_SYS += $(DRI_LIB_DEPS) -l$(GLAPI_LIB)
egl_SYS += -lm -lpthread $(DLOPEN_LIBS) -l$(GLAPI_LIB)
else
egl_CPPFLAGS += -D_EGL_EXTERNAL_GL=1
OUTPUTS += st_GL
@@ -141,10 +141,18 @@ egl_LIBS += \
$(TOP)/src/gallium/drivers/svga/libsvga.a
endif
# swrast
# softpipe
ifneq ($(findstring softpipe,$(GALLIUM_DRIVERS_DIRS)),)
egl_CPPFLAGS += -DGALLIUM_SOFTPIPE -DGALLIUM_RBUG -DGALLIUM_TRACE
egl_LIBS += $(TOP)/src/gallium/drivers/softpipe/libsoftpipe.a
egl_SYS += -lm
endif
# llvmpipe
ifneq ($(findstring llvmpipe,$(GALLIUM_DRIVERS_DIRS)),)
egl_CPPFLAGS += -DGALLIUM_LLVMPIPE
egl_LIBS += $(TOP)/src/gallium/drivers/llvmpipe/libllvmpipe.a
endif
# sort to remove duplicates
egl_CPPFLAGS := $(sort $(egl_CPPFLAGS))
@@ -154,12 +162,10 @@ egl_SYS := $(sort $(egl_SYS))
# st_GL, built only when shared glapi is not enabled
st_GL_CPPFLAGS := -I $(TOP)/src/mesa -I$(TOP)/src/gallium/include
st_GL_LIBS := $(TOP)/src/mesa/libmesagallium.a $(GALLIUM_AUXILIARIES)
st_GL_SYS := $(DRI_LIB_DEPS)
st_GL_SYS := -lm -lpthread $(DLOPEN_LIBS)
# LLVM
ifeq ($(MESA_LLVM),1)
egl_CPPFLAGS += -DGALLIUM_LLVMPIPE
egl_LIBS += $(TOP)/src/gallium/drivers/llvmpipe/libllvmpipe.a
egl_SYS += $(LLVM_LIBS)
LDFLAGS += $(LLVM_LDFLAGS)
@@ -173,14 +179,14 @@ default: $(OUTPUTS)
$(OUTPUT_PATH)/egl_gallium.so: $(egl_OBJECTS) $(egl_LIBS)
$(MKLIB) -o $(notdir $@) -noprefix -linker '$(CXX)' \
-L$(TOP)/$(LIB_DIR) -ldflags '-Wl,--no-undefined $(LDFLAGS)' \
-ldflags '-L$(TOP)/$(LIB_DIR) -Wl,--no-undefined $(LDFLAGS)' \
-cplusplus -install $(OUTPUT_PATH) $(MKLIB_OPTIONS) \
$(egl_OBJECTS) -Wl,--start-group $(egl_LIBS) -Wl,--end-group \
$(egl_SYS)
$(OUTPUT_PATH)/st_GL.so: st_GL.o $(st_GL_LIBS)
$(MKLIB) -o $(notdir $@) -noprefix -linker '$(CXX)' \
-L$(TOP)/$(LIB_DIR) -ldflags '$(LDFLAGS)' \
-ldflags '-L$(TOP)/$(LIB_DIR) $(LDFLAGS)' \
-cplusplus -install $(OUTPUT_PATH) $(MKLIB_OPTIONS) \
$< -Wl,--start-group $(st_GL_LIBS) -Wl,--end-group \
$(st_GL_SYS)

View File

@@ -29,6 +29,9 @@
#include "pipe/p_compiler.h"
PUBLIC struct st_api *
st_api_create_OpenGL(void);
struct st_api *
st_api_create_OpenGL(void)
{
return st_gl_api_create();

View File

@@ -18,6 +18,7 @@ GBM_INCLUDES = \
GBM_LIBS = $(LIBUDEV_LIBS) $(LIBDRM_LIB) \
$(TOP)/src/gallium/state_trackers/gbm/libgbm.a \
$(TOP)/src/gallium/drivers/identity/libidentity.a \
$(TOP)/src/gallium/drivers/galahad/libgalahad.a \
$(TOP)/src/gallium/drivers/trace/libtrace.a \
$(TOP)/src/gallium/drivers/rbug/librbug.a \
$(GALLIUM_AUXILIARIES)
@@ -37,44 +38,54 @@ pipe_INCLUDES = \
-I$(TOP)/src/gallium/include \
-I$(TOP)/src/gallium/winsys
pipe_LIBS = $(LIBDRM_LIB) \
pipe_LIBS = \
$(TOP)/src/gallium/drivers/identity/libidentity.a \
$(TOP)/src/gallium/drivers/trace/libtrace.a \
$(TOP)/src/gallium/drivers/rbug/librbug.a \
$(GALLIUM_AUXILIARIES)
pipe_CLFLAGS = $(LIBDRM_CFLAGS)
# as if we are DRI modules
pipe_SYS = $(DRI_LIB_DEPS)
pipe_CLFLAGS = \
-DGALLIUM_RBUG -DGALLIUM_TRACE -DGALLIUM_GALAHAD \
$(LIBDRM_CFLAGS)
pipe_LDFLAGS = -Wl,--no-undefined
# i915 pipe driver
i915_LIBS = -ldrm_intel \
i915_LIBS = \
$(TOP)/src/gallium/winsys/i915/drm/libi915drm.a \
$(TOP)/src/gallium/drivers/i915/libi915.a
i915_SYS = -ldrm_intel
# i965 pipe driver
i965_LIBS = -ldrm_intel \
i965_LIBS = \
$(TOP)/src/gallium/winsys/i965/drm/libi965drm.a \
$(TOP)/src/gallium/drivers/i965/libi965.a \
$(TOP)/src/gallium/winsys/sw/wrapper/libwsw.a
i965_SYS = -ldrm_intel
# nouveau pipe driver
nouveau_LIBS = -ldrm_nouveau \
nouveau_LIBS = \
$(TOP)/src/gallium/winsys/nouveau/drm/libnouveaudrm.a \
$(TOP)/src/gallium/drivers/nvfx/libnvfx.a \
$(TOP)/src/gallium/drivers/nv50/libnv50.a \
$(TOP)/src/gallium/drivers/nvc0/libnvc0.a \
$(TOP)/src/gallium/drivers/nouveau/libnouveau.a
nouveau_SYS = -ldrm_nouveau
# r300 pipe driver
r300_LIBS = -ldrm \
r300_LIBS = \
$(TOP)/src/gallium/winsys/radeon/drm/libradeonwinsys.a \
$(TOP)/src/gallium/drivers/r300/libr300.a
r300_SYS = -ldrm_radeon
# r600 pipe driver
r600_LIBS = -ldrm -ldrm_radeon \
r600_LIBS = \
$(TOP)/src/gallium/winsys/r600/drm/libr600winsys.a \
$(TOP)/src/gallium/drivers/r600/libr600.a
r600_SYS = -ldrm_radeon
# vmwgfx pipe driver
vmwgfx_LIBS = \
@@ -83,7 +94,8 @@ vmwgfx_LIBS = \
# LLVM
ifeq ($(MESA_LLVM),1)
pipe_LIBS += $(LLVM_LIBS)
pipe_LIBS += $(TOP)/src/gallium/drivers/llvmpipe/libllvmpipe.a
pipe_SYS += $(LLVM_LIBS)
pipe_LDFLAGS += $(LLVM_LDFLAGS)
endif
@@ -140,7 +152,8 @@ $(pipe_TARGETS): $(PIPE_PREFIX)%.so: pipe_%.o
$(MKLIB) -o $@ -noprefix -linker '$(CC)' \
-ldflags '-L$(TOP)/$(LIB_DIR) $(pipe_LDFLAGS) $(LDFLAGS)' \
$(MKLIB_OPTIONS) $< \
-Wl,--start-group $($*_LIBS) $(pipe_LIBS) -Wl,--end-group
-Wl,--start-group $(pipe_LIBS) $($*_LIBS) -Wl,--end-group \
$(pipe_SYS) $($*_SYS)
$(pipe_OBJECTS): %.o: %.c
$(CC) -c -o $@ $< $(pipe_INCLUDES) $(pipe_CFLAGS) $(CFLAGS)

View File

@@ -213,6 +213,17 @@ i915_drm_buffer_destroy(struct i915_winsys *iws,
FREE(buffer);
}
static boolean
i915_drm_buffer_is_busy(struct i915_winsys *iws,
struct i915_winsys_buffer *buffer)
{
struct i915_drm_buffer* i915_buffer = i915_drm_buffer(buffer);
if (!i915_buffer)
return FALSE;
return drm_intel_bo_busy(i915_buffer->bo);
}
void
i915_drm_winsys_init_buffer_functions(struct i915_drm_winsys *idws)
{
@@ -224,4 +235,5 @@ i915_drm_winsys_init_buffer_functions(struct i915_drm_winsys *idws)
idws->base.buffer_unmap = i915_drm_buffer_unmap;
idws->base.buffer_write = i915_drm_buffer_write;
idws->base.buffer_destroy = i915_drm_buffer_destroy;
idws->base.buffer_is_busy = i915_drm_buffer_is_busy;
}

View File

@@ -55,6 +55,7 @@ static const struct r600_reg evergreen_config_reg_list[] = {
{R_008C24_SQ_STACK_RESOURCE_MGMT_2, REG_FLAG_ENABLE_ALWAYS | REG_FLAG_FLUSH_CHANGE, 0, 0},
{R_008C28_SQ_STACK_RESOURCE_MGMT_3, REG_FLAG_ENABLE_ALWAYS | REG_FLAG_FLUSH_CHANGE, 0, 0},
{R_008D8C_SQ_DYN_GPR_CNTL_PS_FLUSH_REQ, REG_FLAG_ENABLE_ALWAYS | REG_FLAG_FLUSH_CHANGE, 0, 0},
{R_008E2C_SQ_LDS_RESOURCE_MGMT, REG_FLAG_ENABLE_ALWAYS | REG_FLAG_FLUSH_CHANGE, 0, 0},
{R_009100_SPI_CONFIG_CNTL, REG_FLAG_ENABLE_ALWAYS | REG_FLAG_FLUSH_CHANGE, 0, 0},
{R_00913C_SPI_CONFIG_CNTL_1, REG_FLAG_ENABLE_ALWAYS | REG_FLAG_FLUSH_CHANGE, 0, 0},
};

View File

@@ -186,7 +186,7 @@ static int eg_interpret_tiling(struct radeon *radeon, uint32_t tiling_config)
static int radeon_drm_get_tiling(struct radeon *radeon)
{
struct drm_radeon_info info;
struct drm_radeon_info info = {};
int r;
uint32_t tiling_config = 0;
@@ -208,8 +208,8 @@ static int radeon_drm_get_tiling(struct radeon *radeon)
static int radeon_get_clock_crystal_freq(struct radeon *radeon)
{
struct drm_radeon_info info;
uint32_t clock_crystal_freq;
struct drm_radeon_info info = {};
uint32_t clock_crystal_freq = 0;
int r;
info.request = RADEON_INFO_CLOCK_CRYSTAL_FREQ;
@@ -226,8 +226,8 @@ static int radeon_get_clock_crystal_freq(struct radeon *radeon)
static int radeon_get_num_backends(struct radeon *radeon)
{
struct drm_radeon_info info;
uint32_t num_backends;
struct drm_radeon_info info = {};
uint32_t num_backends = 0;
int r;
info.request = RADEON_INFO_NUM_BACKENDS;

View File

@@ -62,6 +62,8 @@ void r600_init_cs(struct r600_context *ctx)
ctx->pm4[ctx->pm4_cdwords++] = PKT3(PKT3_CONTEXT_CONTROL, 1, 0);
ctx->pm4[ctx->pm4_cdwords++] = 0x80000000;
ctx->pm4[ctx->pm4_cdwords++] = 0x80000000;
ctx->init_dwords = ctx->pm4_cdwords;
}
static void INLINE r600_context_update_fenced_list(struct r600_context *ctx)
@@ -1496,7 +1498,7 @@ void r600_context_flush(struct r600_context *ctx)
int r;
struct r600_block *enable_block = NULL;
if (!ctx->pm4_cdwords)
if (ctx->pm4_cdwords == ctx->init_dwords)
return;
/* suspend queries */
@@ -1563,7 +1565,7 @@ void r600_context_flush(struct r600_context *ctx)
r600_init_cs(ctx);
/* resume queries */
r600_context_queries_resume(ctx);
r600_context_queries_resume(ctx, TRUE);
/* set all valid group as dirty so they get reemited on
* next draw command
@@ -1693,10 +1695,9 @@ out_err:
static boolean r600_query_result(struct r600_context *ctx, struct r600_query *query, boolean wait)
{
unsigned results_base = query->results_start;
u64 start, end;
u32 *results;
int i;
int size;
u32 *results, *current_result;
if (wait)
results = r600_bo_map(ctx->radeon, query->buffer, PB_USAGE_CPU_READ, NULL);
@@ -1705,25 +1706,31 @@ static boolean r600_query_result(struct r600_context *ctx, struct r600_query *qu
if (!results)
return FALSE;
/* query->num_results contains how many dwords were used for the query */
size = query->num_results;
for (i = 0; i < size; i += 4) {
start = (u64)results[i] | (u64)results[i + 1] << 32;
end = (u64)results[i + 2] | (u64)results[i + 3] << 32;
/* count all results across all data blocks */
while (results_base != query->results_end) {
current_result = (u32*)((char*)results + results_base);
start = (u64)current_result[0] | (u64)current_result[1] << 32;
end = (u64)current_result[2] | (u64)current_result[3] << 32;
if (((start & 0x8000000000000000UL) && (end & 0x8000000000000000UL))
|| query->type == PIPE_QUERY_TIME_ELAPSED) {
query->result += end - start;
}
}
r600_bo_unmap(ctx->radeon, query->buffer);
query->num_results = 0;
results_base += 4 * 4;
if (results_base >= query->buffer_size)
results_base = 0;
}
query->results_start = query->results_end;
r600_bo_unmap(ctx->radeon, query->buffer);
return TRUE;
}
void r600_query_begin(struct r600_context *ctx, struct r600_query *query)
{
unsigned required_space;
unsigned required_space, new_results_end;
int num_backends = r600_get_num_backends(ctx->radeon);
/* query request needs 6/8 dwords for begin + 6/8 dwords for end */
@@ -1737,22 +1744,39 @@ void r600_query_begin(struct r600_context *ctx, struct r600_query *query)
r600_context_flush(ctx);
}
/* if query buffer is full force a flush */
if (query->num_results*4 >= query->buffer_size - 16) {
r600_context_flush(ctx);
if (query->type == PIPE_QUERY_OCCLUSION_COUNTER) {
/* Count queries emitted without flushes, and flush if more than
* half of buffer used, to avoid overwriting results which may be
* still in use. */
if (query->state & R600_QUERY_STATE_FLUSHED) {
query->queries_emitted = 1;
} else {
if (++query->queries_emitted > query->buffer_size / query->result_size / 2)
r600_context_flush(ctx);
}
}
new_results_end = query->results_end + query->result_size;
if (new_results_end >= query->buffer_size)
new_results_end = 0;
/* collect current results if query buffer is full */
if (new_results_end == query->results_start) {
if (!(query->state & R600_QUERY_STATE_FLUSHED))
r600_context_flush(ctx);
r600_query_result(ctx, query, TRUE);
}
if (query->type == PIPE_QUERY_OCCLUSION_COUNTER &&
num_backends > 0) {
/* as per info on ZPASS the driver must set the unusued DB top bits */
if (query->type == PIPE_QUERY_OCCLUSION_COUNTER) {
u32 *results;
int i;
results = r600_bo_map(ctx->radeon, query->buffer, PB_USAGE_DONTBLOCK | PB_USAGE_CPU_WRITE, NULL);
results = r600_bo_map(ctx->radeon, query->buffer, PB_USAGE_CPU_WRITE, NULL);
if (results) {
memset(results + (query->num_results * 4), 0, ctx->max_db * 4 * 4);
results = (u32*)((char*)results + query->results_end);
memset(results, 0, query->result_size);
/* Set top bits for unused backends */
for (i = num_backends; i < ctx->max_db; i++) {
results[(i * 4)+1] = 0x80000000;
results[(i * 4)+3] = 0x80000000;
@@ -1765,14 +1789,14 @@ void r600_query_begin(struct r600_context *ctx, struct r600_query *query)
if (query->type == PIPE_QUERY_TIME_ELAPSED) {
ctx->pm4[ctx->pm4_cdwords++] = PKT3(PKT3_EVENT_WRITE_EOP, 4, 0);
ctx->pm4[ctx->pm4_cdwords++] = EVENT_TYPE(EVENT_TYPE_CACHE_FLUSH_AND_INV_TS_EVENT) | EVENT_INDEX(5);
ctx->pm4[ctx->pm4_cdwords++] = query->num_results*4 + r600_bo_offset(query->buffer);
ctx->pm4[ctx->pm4_cdwords++] = query->results_end + r600_bo_offset(query->buffer);
ctx->pm4[ctx->pm4_cdwords++] = (3 << 29);
ctx->pm4[ctx->pm4_cdwords++] = 0;
ctx->pm4[ctx->pm4_cdwords++] = 0;
} else {
ctx->pm4[ctx->pm4_cdwords++] = PKT3(PKT3_EVENT_WRITE, 2, 0);
ctx->pm4[ctx->pm4_cdwords++] = EVENT_TYPE(EVENT_TYPE_ZPASS_DONE) | EVENT_INDEX(1);
ctx->pm4[ctx->pm4_cdwords++] = query->num_results*4 + r600_bo_offset(query->buffer);
ctx->pm4[ctx->pm4_cdwords++] = query->results_end + r600_bo_offset(query->buffer);
ctx->pm4[ctx->pm4_cdwords++] = 0;
}
ctx->pm4[ctx->pm4_cdwords++] = PKT3(PKT3_NOP, 0, 0);
@@ -1786,49 +1810,75 @@ void r600_query_begin(struct r600_context *ctx, struct r600_query *query)
void r600_query_end(struct r600_context *ctx, struct r600_query *query)
{
/* emit begin query */
/* emit end query */
if (query->type == PIPE_QUERY_TIME_ELAPSED) {
ctx->pm4[ctx->pm4_cdwords++] = PKT3(PKT3_EVENT_WRITE_EOP, 4, 0);
ctx->pm4[ctx->pm4_cdwords++] = EVENT_TYPE(EVENT_TYPE_CACHE_FLUSH_AND_INV_TS_EVENT) | EVENT_INDEX(5);
ctx->pm4[ctx->pm4_cdwords++] = query->num_results*4 + 8 + r600_bo_offset(query->buffer);
ctx->pm4[ctx->pm4_cdwords++] = query->results_end + 8 + r600_bo_offset(query->buffer);
ctx->pm4[ctx->pm4_cdwords++] = (3 << 29);
ctx->pm4[ctx->pm4_cdwords++] = 0;
ctx->pm4[ctx->pm4_cdwords++] = 0;
} else {
ctx->pm4[ctx->pm4_cdwords++] = PKT3(PKT3_EVENT_WRITE, 2, 0);
ctx->pm4[ctx->pm4_cdwords++] = EVENT_TYPE(EVENT_TYPE_ZPASS_DONE) | EVENT_INDEX(1);
ctx->pm4[ctx->pm4_cdwords++] = query->num_results*4 + 8 + r600_bo_offset(query->buffer);
ctx->pm4[ctx->pm4_cdwords++] = query->results_end + 8 + r600_bo_offset(query->buffer);
ctx->pm4[ctx->pm4_cdwords++] = 0;
}
ctx->pm4[ctx->pm4_cdwords++] = PKT3(PKT3_NOP, 0, 0);
ctx->pm4[ctx->pm4_cdwords++] = 0;
r600_context_bo_reloc(ctx, &ctx->pm4[ctx->pm4_cdwords - 1], query->buffer);
query->num_results += 4 * (query->type == PIPE_QUERY_OCCLUSION_COUNTER ? ctx->max_db : 1);
query->results_end += query->result_size;
if (query->results_end >= query->buffer_size)
query->results_end = 0;
query->state ^= R600_QUERY_STATE_STARTED;
query->state |= R600_QUERY_STATE_ENDED;
query->state &= ~R600_QUERY_STATE_FLUSHED;
ctx->num_query_running--;
}
void r600_query_predication(struct r600_context *ctx, struct r600_query *query, int operation,
int flag_wait)
{
ctx->pm4[ctx->pm4_cdwords++] = PKT3(PKT3_SET_PREDICATION, 1, 0);
if (operation == PREDICATION_OP_CLEAR) {
if (ctx->pm4_cdwords + 3 > ctx->pm4_ndwords)
r600_context_flush(ctx);
ctx->pm4[ctx->pm4_cdwords++] = PKT3(PKT3_SET_PREDICATION, 1, 0);
ctx->pm4[ctx->pm4_cdwords++] = 0;
ctx->pm4[ctx->pm4_cdwords++] = PRED_OP(PREDICATION_OP_CLEAR);
} else {
int results_base = query->num_results - (4 * ctx->max_db);
unsigned results_base = query->results_start;
unsigned count;
u32 op;
if (results_base < 0)
results_base = 0;
/* find count of the query data blocks */
count = query->buffer_size + query->results_end - query->results_start;
if (count >= query->buffer_size) count-=query->buffer_size;
count /= query->result_size;
ctx->pm4[ctx->pm4_cdwords++] = results_base*4 + r600_bo_offset(query->buffer);
ctx->pm4[ctx->pm4_cdwords++] = PRED_OP(operation) | (flag_wait ? PREDICATION_HINT_WAIT : PREDICATION_HINT_NOWAIT_DRAW) | PREDICATION_DRAW_VISIBLE;
ctx->pm4[ctx->pm4_cdwords++] = PKT3(PKT3_NOP, 0, 0);
ctx->pm4[ctx->pm4_cdwords++] = 0;
r600_context_bo_reloc(ctx, &ctx->pm4[ctx->pm4_cdwords - 1], query->buffer);
if (ctx->pm4_cdwords + 5 * count > ctx->pm4_ndwords)
r600_context_flush(ctx);
op = PRED_OP(operation) | PREDICATION_DRAW_VISIBLE |
(flag_wait ? PREDICATION_HINT_WAIT : PREDICATION_HINT_NOWAIT_DRAW);
/* emit predicate packets for all data blocks */
while (results_base != query->results_end) {
ctx->pm4[ctx->pm4_cdwords++] = PKT3(PKT3_SET_PREDICATION, 1, 0);
ctx->pm4[ctx->pm4_cdwords++] = results_base + r600_bo_offset(query->buffer);
ctx->pm4[ctx->pm4_cdwords++] = op;
ctx->pm4[ctx->pm4_cdwords++] = PKT3(PKT3_NOP, 0, 0);
ctx->pm4[ctx->pm4_cdwords++] = 0;
r600_context_bo_reloc(ctx, &ctx->pm4[ctx->pm4_cdwords - 1], query->buffer);
results_base += query->result_size;
if (results_base >= query->buffer_size)
results_base = 0;
/* set CONTINUE bit for all packets except the first */
op |= PREDICATION_CONTINUE;
}
}
}
@@ -1846,6 +1896,14 @@ struct r600_query *r600_context_query_create(struct r600_context *ctx, unsigned
query->type = query_type;
query->buffer_size = 4096;
if (query_type == PIPE_QUERY_OCCLUSION_COUNTER)
query->result_size = 4 * 4 * ctx->max_db;
else
query->result_size = 4 * 4;
/* adjust buffer size to simplify offsets wrapping math */
query->buffer_size -= query->buffer_size % query->result_size;
/* As of GL4, query buffers are normally read by the CPU after
* being written by the gpu, hence staging is probably a good
* usage pattern.
@@ -1875,7 +1933,7 @@ boolean r600_context_query_result(struct r600_context *ctx,
{
uint64_t *result = (uint64_t*)vresult;
if (query->num_results) {
if (!(query->state & R600_QUERY_STATE_FLUSHED)) {
r600_context_flush(ctx);
}
if (!r600_query_result(ctx, query, wait))
@@ -1900,11 +1958,14 @@ void r600_context_queries_suspend(struct r600_context *ctx)
}
}
void r600_context_queries_resume(struct r600_context *ctx)
void r600_context_queries_resume(struct r600_context *ctx, boolean flushed)
{
struct r600_query *query;
LIST_FOR_EACH_ENTRY(query, &ctx->query_list, list) {
if (flushed)
query->state |= R600_QUERY_STATE_FLUSHED;
if (query->state & R600_QUERY_STATE_SUSPENDED) {
r600_query_begin(ctx, query);
query->state ^= R600_QUERY_STATE_SUSPENDED;

View File

@@ -114,6 +114,8 @@
#define PRED_OP(x) ((x) << 16)
#define PREDICATION_CONTINUE (1 << 31)
#define PREDICATION_HINT_WAIT (0 << 12)
#define PREDICATION_HINT_NOWAIT_DRAW (1 << 12)

View File

@@ -54,10 +54,8 @@ struct fbdev_sw_winsys
struct sw_winsys base;
int fd;
enum pipe_format format;
struct fb_fix_screeninfo finfo;
void *fbmem;
unsigned rows;
unsigned stride;
};
@@ -77,22 +75,53 @@ fbdev_sw_winsys(struct sw_winsys *ws)
static void
fbdev_displaytarget_display(struct sw_winsys *ws,
struct sw_displaytarget *dt,
void *context_private)
void *winsys_private)
{
struct fbdev_sw_winsys *fbdev = fbdev_sw_winsys(ws);
struct fbdev_sw_displaytarget *fbdt = fbdev_sw_displaytarget(dt);
unsigned rows, len, i;
struct fbdev_sw_displaytarget *src = fbdev_sw_displaytarget(dt);
const struct fbdev_sw_drawable *dst =
(const struct fbdev_sw_drawable *) winsys_private;
unsigned height, row_offset, row_len, i;
void *fbmem;
rows = MIN2(fbdt->height, fbdev->rows);
len = util_format_get_stride(fbdt->format, fbdt->width);
len = MIN2(len, fbdev->stride);
for (i = 0; i < rows; i++) {
void *dst = fbdev->fbmem + fbdev->stride * i;
void *src = fbdt->data + fbdt->stride * i;
memcpy(dst, src, len);
/* FIXME format conversion */
if (dst->format != src->format) {
assert(0);
return;
}
height = dst->height;
if (dst->y + dst->height > fbdev->rows) {
/* nothing to copy */
if (dst->y >= fbdev->rows)
return;
height = fbdev->rows - dst->y;
}
row_offset = util_format_get_stride(dst->format, dst->x);
row_len = util_format_get_stride(dst->format, dst->width);
if (row_offset + row_len > fbdev->stride) {
/* nothing to copy */
if (row_offset >= fbdev->stride)
return;
row_len = fbdev->stride - row_offset;
}
fbmem = mmap(0, fbdev->finfo.smem_len,
PROT_WRITE, MAP_SHARED, fbdev->fd, 0);
if (fbmem == MAP_FAILED)
return;
for (i = 0; i < height; i++) {
char *from = (char *) src->data + src->stride * i;
char *to = (char *) fbmem + fbdev->stride * (dst->y + i) + row_offset;
memcpy(to, from, row_len);
}
munmap(fbmem, fbdev->finfo.smem_len);
}
static void
@@ -133,13 +162,9 @@ fbdev_displaytarget_create(struct sw_winsys *ws,
unsigned alignment,
unsigned *stride)
{
struct fbdev_sw_winsys *fbdev = fbdev_sw_winsys(ws);
struct fbdev_sw_displaytarget *fbdt;
unsigned nblocksy, size, format_stride;
if (fbdev->format != format)
return NULL;
fbdt = CALLOC_STRUCT(fbdev_sw_displaytarget);
if (!fbdt)
return NULL;
@@ -170,8 +195,7 @@ fbdev_is_displaytarget_format_supported(struct sw_winsys *ws,
unsigned tex_usage,
enum pipe_format format)
{
struct fbdev_sw_winsys *fbdev = fbdev_sw_winsys(ws);
return (fbdev->format == format);
return TRUE;
}
static void
@@ -179,12 +203,11 @@ fbdev_destroy(struct sw_winsys *ws)
{
struct fbdev_sw_winsys *fbdev = fbdev_sw_winsys(ws);
munmap(fbdev->fbmem, fbdev->finfo.smem_len);
FREE(fbdev);
}
struct sw_winsys *
fbdev_create_sw_winsys(int fd, enum pipe_format format)
fbdev_create_sw_winsys(int fd)
{
struct fbdev_sw_winsys *fbdev;
@@ -193,19 +216,11 @@ fbdev_create_sw_winsys(int fd, enum pipe_format format)
return NULL;
fbdev->fd = fd;
fbdev->format = format;
if (ioctl(fbdev->fd, FBIOGET_FSCREENINFO, &fbdev->finfo)) {
FREE(fbdev);
return NULL;
}
fbdev->fbmem = mmap(0, fbdev->finfo.smem_len,
PROT_WRITE, MAP_SHARED, fbdev->fd, 0);
if (fbdev->fbmem == MAP_FAILED) {
FREE(fbdev);
return NULL;
}
fbdev->rows = fbdev->finfo.smem_len / fbdev->finfo.line_length;
fbdev->stride = fbdev->finfo.line_length;

View File

@@ -32,7 +32,14 @@
struct sw_winsys;
enum pipe_format;
/* for pipe_screen::flush_frontbuffer */
struct fbdev_sw_drawable {
enum pipe_format format;
unsigned x, y;
unsigned width, height;
};
struct sw_winsys *
fbdev_create_sw_winsys(int fd, enum pipe_format format);
fbdev_create_sw_winsys(int fd);
#endif /* FBDEV_SW_WINSYS */

View File

@@ -28,6 +28,11 @@
#ifndef _GBM_H_
#define _GBM_H_
#ifdef __cplusplus
extern "C" {
#endif
#define __GBM__ 1
#include <stdint.h>
@@ -97,4 +102,8 @@ gbm_bo_get_handle(struct gbm_bo *bo);
void
gbm_bo_destroy(struct gbm_bo *bo);
#ifdef __cplusplus
}
#endif
#endif

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