r600g/compute: Add a function for moving items in the pool

This function will be used in the future by compute_memory_defrag
to move items forward in the pool.

It does so by first checking for overlaping ranges, if the ranges
don't overlap it will copy the contents directly. If they overlap
it will try first to make a temporary buffer, if this buffer fails
to allocate, it will finally fall back to a mapping.

Note that it will only be needed to move items forward, it only
checks for overlapping ranges in that case. If needed, it can
easily be added by changing the first if.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
r600g/compute: Add a function for defragmenting the pool

This new function will move items forward in the pool, so that
there's no gap between them, effectively defragmenting the pool.

For now this function is a bit dumb as it just moves items
forward without trying to see if other items in the pool could
fit in the gaps.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
r600g/compute: Defrag the pool if it's necesary

This patch adds a new member to the pool to track its status.
For now it is used only for the 'fragmented' status, but if
needed it could be used for more statuses.

The pool will be considered fragmented if: An item that isn't
the last is freed or demoted.

This 'strategy' has a problem, although it shouldn't cause any bug.
If for example we have two items, A and B. We choose to free A first,
now the pool will have the 'fragmented' status. If we now free B,
the pool will retain its 'fragmented' status even if it isn't
fragmented.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
r600g/compute: Quick exit if there's nothing to add to the pool

This way we can avoid defragmenting the pool, even if it is needed
to defragment it, and looping again through the list of unallocated
items.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
r600g/compute: Remove unneeded code from compute_memory_promote_item

Now that we know that the pool is defragmented, we positively know
that allocated + unallocated will be the total size of the
current pool plus all the items that will be promoted. So we only
need to grow the pool once.

This will allow us to just add the new items to the end of the
item_list without the need of looking for a place to the new item.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
r600g: Use hardware sqrt instruction

Piglit quick tests including sqrt pass, no other regressions,
tested on radeon 6670.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
r600g/compute: Fix warnings
radeon/llvm: enable unsafe math for graphics shaders

Accuracy of some operations was recently improved in the R600 backend,
at the cost of slower code. This is required for compute shaders,
but not for graphics shaders. Add unsafe-fp-math hint to make LLVM
generate faster but possibly less accurate code.

Piglit didn't indicate any regressions.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
radeon/llvm: fix formatting

Use K&R and same indent as most other code. No functional change
intended.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
tgsi/ureg: add ureg_UARL shortcut
mesa,gallium: API settings / rasterization rules
gallium,drivers: use API settings / rasterization rules
nv50,nvc0: handle TGSI_PROPERTY_VS_WINDOW_SPACE_POSITION
nv50,nvc0: handle NULL vertex elements without fallback
nv50/ir/tgsi: implement TGSI_OPCODE_NRM,DP2A

Used by d3d9 st.
nv50: don't emit buffer for skipped vertex elements

Grr, should forbid that and insert dummy elements in nine.
nvc0: avoid fault in get_query_result if there was no begin_query
gallium,drivers: add PIPE_CAP_DEVICE_MEMORY_SIZE

Signed-off-by: David Heidelberger <david.heidelberger@ixit.cz>
winsys/sw/wrapper: hook up is_displaytarget_format_supported

Looks like no one's using this thing.
gallium/draw: support hack to disable clipping