Commit Graph

70515 Commits

Author SHA1 Message Date
Chih-Wei Huang ac296aee58 android: Depend on gallium_dri from EGL, instead of linking in gallium.
The Android gallium build used to use gallium_egl, which was removed back
in March.  Instead, we will now use a normal Mesa libEGL loader with
dlopen()ing of a DRI module.

v2: add a clean step to rebuild all dri modules properly.
v3: Squish the 2 patches doing this together (change by anholt).

Signed-off-by: Chih-Wei Huang <cwhuang@linux.org.tw>
Reviewed-by: Eric Anholt <eric@anholt.net>
2015-06-09 11:38:45 -07:00
Chih-Wei Huang 933df3d335 android: add rules to build a gallium_dri.so
This single .so includes all of the enabled gallium drivers.

Signed-off-by: Chih-Wei Huang <cwhuang@linux.org.tw>
Reviewed-by: Eric Anholt <eric@anholt.net>
2015-06-09 11:38:45 -07:00
Chih-Wei Huang f4f609b27e android: add rules to build gallium/state_trackers/dri
Signed-off-by: Chih-Wei Huang <cwhuang@linux.org.tw>
Reviewed-by: Eric Anholt <eric@anholt.net>
2015-06-09 11:38:45 -07:00
Chih-Wei Huang 581aa208fa android: export more dirs from libmesa_dri_common
The include paths of libmesa_dri_common are also used by modules
that need libmesa_dri_common.

Signed-off-by: Chih-Wei Huang <cwhuang@linux.org.tw>
Reviewed-by: Eric Anholt <eric@anholt.net>
2015-06-09 11:38:44 -07:00
Chih-Wei Huang b8213bbe4c android: loader: export the path to be included
Signed-off-by: Chih-Wei Huang <cwhuang@linux.org.tw>
Reviewed-by: Eric Anholt <eric@anholt.net>
2015-06-09 11:38:44 -07:00
Ben Widawsky 30ba4faf5d i965/gen9: Use raw PS invocation count for queries
Previously the number needed to be divided by 4 to get the proper results. Now
the hardware does the right thing. Through experimentation it seems Braswell
(CHV) does also need the division by 4.

Fixes piglit test:
arb_pipeline_statistics_query-frag

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2015-06-09 11:17:37 -07:00
Brian Paul c10dc485f3 glsl: fix comment typo: s/accpet/accept/ 2015-06-09 10:49:35 -06:00
Brian Paul 37e0677870 mesa: remove some MAX_NV_FRAGMENT_PROGRAM_* macros
GL_NV_fragment_program support was removed a while ago.  This is just
some clean-up.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-06-09 10:49:35 -06:00
Jason Ekstrand 670862a506 fs/reg_allocate: Remove the MRF hack helpers from fs_visitor
These are helpers that only exist in this one file.  No reason to put them
in the visitor.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2015-06-09 09:22:56 -07:00
Jason Ekstrand 86e5afbfee i965/fs: Don't let the EOT send message interfere with the MRF hack
Previously, we just put the message for the EOT send as high in the file as
it would go.  This is because the register pre-filling hardware will stop
all over the early registers in the file in preparation for the next thread
while you're still sending the last message.  However, if something happens
to spill, then the MRF hack interferes with the EOT send message and, if
things aren't scheduled nicely, will stomp on it.

Cc: "10.5 10.6" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90520
Reviewed-by: Neil Roberts <neil@linux.intel.com>
2015-06-09 09:22:56 -07:00
Jose Fonseca 65bd4159b3 rtasm: Generalize executable memory allocator to all Unices.
We're only using fairly portable standard Unix calls here, so might as
well save ourselves future trouble by enabling on all Unices by default.

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

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2015-06-09 16:18:16 +01:00
Francisco Jerez 698c391521 i965/fs: Drop fs_inst::force_uncompressed.
This is now unused.  Saves a whole bit of memory per instruction.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-06-09 15:18:35 +03:00
Francisco Jerez 44928b799a i965/fs: Remove dead IR construction code from the visitor.
Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-06-09 15:18:35 +03:00
Francisco Jerez 51948085a2 i965/fs: Migrate test_fs_cmod_propagation to the IR builder.
v2: Use set_predicate/condmod.  Use fs_builder::OPCODE instead of
    ::emit.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-06-09 15:18:34 +03:00
Francisco Jerez 76c8142d0a i965/fs: Migrate test_fs_saturate_propagation to the IR builder.
v2: Use set_saturate.  Use fs_builder::OPCODE instead of ::emit.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-06-09 15:18:34 +03:00
Francisco Jerez bf83a1a219 i965/fs: Migrate translation of NIR texturing instructions to the IR builder.
v2: Don't remove assignments of base_ir just yet.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-06-09 15:18:34 +03:00
Francisco Jerez 979fe2ffee i965/fs: Migrate translation of NIR intrinsics to the IR builder.
v2: Use fs_builder::SEL instead of ::emit.  Use set_condmod().

Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-06-09 15:18:34 +03:00
Francisco Jerez fe88c7ae38 i965/fs: Migrate translation of NIR ALU instructions to the IR builder.
Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-06-09 15:18:34 +03:00
Francisco Jerez 3632c28bde i965/fs: Migrate translation of NIR control flow to the IR builder.
Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-06-09 15:18:34 +03:00
Francisco Jerez 9976731485 i965/fs: Migrate NIR variable handling to the IR builder.
Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-06-09 15:18:34 +03:00
Francisco Jerez 09733f220a i965/fs: Migrate NIR emit_percomp() to the IR builder.
Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-06-09 15:18:34 +03:00
Francisco Jerez d5cb2e5137 i965/fs: Migrate CS terminate message to the IR builder.
Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-06-09 15:18:34 +03:00
Francisco Jerez e522f12f03 i965/fs: Migrate VS output writes to the IR builder.
Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-06-09 15:18:33 +03:00
Francisco Jerez e32c16c47f i965/fs: Migrate FS framebuffer writes to the IR builder.
The explicit call to fs_builder::group() in emit_single_fb_write() is
required by the builder (otherwise the assertion in fs_builder::emit()
would fail) because the subsequent LOAD_PAYLOAD and FB_WRITE
instructions are in some cases emitted with a non-native execution
width.  The previous code would always use the channel enables for the
first quarter, which is dubious but probably worked in practice
because FB writes are never emitted inside non-uniform control flow
and we don't pass the kill-pixel mask via predication in the cases
where we have to fall-back to SIMD8 writes.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-06-09 15:18:33 +03:00
Francisco Jerez 840cbef416 i965/fs: Migrate FS alpha test to the IR builder.
Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-06-09 15:18:33 +03:00
Francisco Jerez ad68853f17 i965/fs: Migrate FS discard handling to the IR builder.
Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-06-09 15:18:33 +03:00
Francisco Jerez 46f264638a i965/fs: Migrate FS gl_SamplePosition/ID computation code to the IR builder.
v2: Use fs_builder::AND/SHR/MOV instead of ::emit.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-06-09 15:18:33 +03:00
Francisco Jerez 31477226ec i965/fs: Migrate FS interpolation code to the IR builder.
v2: Fix some preexisting trivial codestyle issues.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-06-09 15:18:33 +03:00
Francisco Jerez d3c10ad427 i965/fs: Migrate shader time to the IR builder.
v2: Change null register destination type to UD so it can be compacted.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-06-09 15:18:33 +03:00
Francisco Jerez 35e64f2a76 i965/fs: Migrate untyped surface read and atomic to the IR builder.
Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-06-09 15:18:33 +03:00
Francisco Jerez db83d9d2d0 i965/fs: Migrate texturing implementation to the IR builder.
v2: Remove tabs from modified lines.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-06-09 15:18:33 +03:00
Francisco Jerez 546839ef63 i965/fs: Migrate pull constant loads to the IR builder.
Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-06-09 15:18:32 +03:00
Francisco Jerez 8f626c1498 i965/fs: Migrate Gen4 send dependency workarounds to the IR builder.
v2: Change brw_null_reg() to bld.null_reg_f().

Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-06-09 15:18:32 +03:00
Francisco Jerez 4af4cfba9e i965/fs: Migrate lower_integer_multiplication to the IR builder.
Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-06-09 15:18:32 +03:00
Francisco Jerez efa60e49f2 i965/fs: Migrate lower_load_payload to the IR builder.
Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-06-09 15:18:32 +03:00
Francisco Jerez 8f8c6b7bda i965/fs: Migrate register spills and fills to the IR builder.
Yes, it's incorrect to use the 0-th channel enable group
unconditionally without considering the execution and regioning
controls of the instruction that uses the spilled value, but it
matches the previous behaviour exactly, the builder just makes the
preexisting problem more obvious because emitting an instruction of
non-native SIMD width without having called .group() or .exec_all()
explicitly would have led to an assertion failure.

I'll fix the problem in a follow-up series, as the solution is going
to be non-trivial.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-06-09 15:18:32 +03:00
Francisco Jerez 3e6ac0bced i965/fs: Migrate try_replace_with_sel to the IR builder.
Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-06-09 15:18:32 +03:00
Francisco Jerez 6114ba4dcc i965/fs: Migrate opt_sampler_eot to the IR builder.
Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-06-09 15:18:32 +03:00
Francisco Jerez a800ec04ad i965/fs: Migrate opt_peephole_sel to the IR builder.
Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-06-09 15:18:32 +03:00
Francisco Jerez 78f7c9edeb i965/fs: Create and emit instructions in one step in opt_peephole_sel.
This simplifies opt_peephole_sel() slightly by emitting the SEL
instructions immediately after they are created, what makes the
sel_inst and mov_imm_inst arrays unnecessary and will make it possible
to get rid of the explicit inserts when the pass is migrated to the IR
builder.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-06-09 15:18:32 +03:00
Francisco Jerez 74c2458ecf i965/fs: Migrate opt_cse to the IR builder.
Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-06-09 15:18:32 +03:00
Francisco Jerez e7069fbc70 i965/fs: Don't drop force_writemask_all and _sechalf when copying a CSE temporary.
LOAD_PAYLOAD instructions need the same treatment as any other
generator instructions, at least FB writes and typed surface messages
will need a payload built with non-zero execution controls.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-06-09 15:18:31 +03:00
Francisco Jerez 497d238ae7 i965/vec4: Take into account all instruction fields in CSE instructions_match().
Most of these fields affect the behaviour of the instruction, but
apparently we currently don't CSE the kind of instructions for which
these fields could make a difference in the VEC4 back-end.  That's
likely to change soon though when we start using send-from-GRF for
texture sampling and surface access messages.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-06-09 15:18:31 +03:00
Francisco Jerez 8013b8147a i965/fs: Take into account all instruction fields in CSE instructions_match().
Most of these fields affect the behaviour of the instruction so it
could actually break the program if we CSE a pair of otherwise
matching instructions with different values of these fields.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-06-09 15:18:31 +03:00
Francisco Jerez d86c2e6e53 i965/fs: Migrate opt_peephole_predicated_break to the IR builder.
Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-06-09 15:18:31 +03:00
Francisco Jerez 35e5f118a5 i965/fs: Migrate opt_combine_constants to the IR builder.
Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-06-09 15:18:31 +03:00
Francisco Jerez e04b4156a7 i965/fs: Allocate a common IR builder object in fs_visitor.
v2: Call fs_builder::at_end() to point the builder at the end of the
    program explicitly.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-06-09 15:18:31 +03:00
Francisco Jerez 8ea8f83c8f i965/fs: Introduce FS IR builder.
The purpose of this change is threefold: First, it improves the
modularity of the compiler back-end by separating the functionality
required to construct an i965 IR program from the rest of the visitor
god-object, what in turn will reduce the coupling between other
components and the visitor allowing a more modular design.  This patch
doesn't yet remove the equivalent functionality from the visitor
classes, as it involves major back-end surgery.

Second, it improves consistency between the scalar and vector
back-ends.  The FS and VEC4 builders can both be used to generate
scalar code with a compatible interface or they can be used to
generate natural vector width code -- 1 or 4 components respectively.

Third, the approach to IR construction is somewhat different to what
the visitor classes currently do.  All parameters affecting code
generation (execution size, half control, point in the program where
new instructions are inserted, etc.) are encapsulated in a stand-alone
object rather than being quasi-global state (yes, anything defined in
one of the visitor classes is effectively global due to the tight
coupling with virtually everything else in the compiler back-end).
This object is lightweight and can be copied, mutated and passed
around, making helper IR-building functions more flexible because they
can now simply take a builder object as argument and will inherit its
IR generation properties in exactly the same way that a discrete
instruction would from the same builder object.

The emit_typed_write() function from my image-load-store branch is an
example that illustrates the usefulness of the latter point: Due to
hardware limitations the function may have to split the untyped
surface message in 8-wide chunks.  That means that the several
functions called to help with the construction of the message payload
are themselves required to set the execution width and half control
correctly on the instructions they emit, and to allocate all registers
with half the default width.  With the previous approach this would
require the used helper functions to be aware of the parameters that
might differ from the default state and explicitly set the instruction
bits accordingly.  With the new approach they would get a modified
builder object as argument that would influence all instructions
emitted by the helper function as if it were the default state.

Another example is the fs_visitor::VARYING_PULL_CONSTANT_LOAD()
method.  It doesn't actually emit any instructions, they are simply
created and inserted into an exec_list which is returned for the
caller to emit at some location of the program.  This sort of two-step
emission becomes unnecessary with the builder interface because the
insertion point is one more of the code generation parameters which
are part of the builder object.  The caller can simply pass
VARYING_PULL_CONSTANT_LOAD() a modified builder object pointing at the
location of the program where the effect of the constant load is
desired.  This two-step emission (which pervades the compiler back-end
and is in most cases redundant) goes away: E.g. ADD() now actually
adds two registers rather than just creating an ADD instruction in
memory, emit(ADD()) is no longer necessary.

v2: Drop scalarizing VEC4 builder.
v3: Take a backend_shader as constructor argument.  Improve handling
    of debug annotations and execution control flags.
v4: Drop Gen6 IF with inline comparison.  Rename "instr" variable.
    Initialize cursor to NULL by default and add method to explicitly
    point the builder at the end of the program.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-06-09 15:07:18 +03:00
Francisco Jerez 6e04065729 i965: Define consistent interface to enable instruction result saturation.
v2: Use set_ prefix.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2015-06-09 13:56:06 +03:00
Francisco Jerez 7624f8410f i965: Define consistent interface to enable instruction conditional modifiers.
v2: Use set_ prefix.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2015-06-09 13:56:06 +03:00