Commit graph

42552 commits

Author SHA1 Message Date
Ian Romanick
497baf4e4a Use C-style system headers in C++ code to avoid issues with std:: namespace 2011-02-21 13:07:29 -08:00
Chris Wilson
5a1fbf0f70 intel: Fix insufficient integer width for upload buffer offset
I was being overly miserly and gave the offset of the buffer into the bo
insufficient bits, distracted by the adjacency of the buffer[4096].

Ref: https://bugs.freedesktop.org/show_bug.cgi?id=34541
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 20:58:09 +00:00
José Fonseca
dcb21d8b1c svga: Remove some remaining fake S3TC rendering support. 2011-02-21 18:36:51 +00:00
Chris Wilson
a43f20e069 i965: Remove spurious duplicate ADVANCE_BATCH
... a leftover from a bad merge.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 16:02:26 +00:00
Chris Wilson
2c6793fb6b i915: Emit a single relocation per vbo
Reducing the number of relocations has lots of nice knock-on effects,
not least including reducing batch buffer size, auxilliary array sizes
(vmalloced and copied into the kernel), processing of uncached
relocations etc.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 13:04:46 +00:00
Chris Wilson
298ebb78de i915: Suppress emission of redundant stencil updates
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 13:04:46 +00:00
Chris Wilson
7c97e288fb i915: Separate BLEND from general context state.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 13:04:46 +00:00
Chris Wilson
4f82585e27 i915: Only flag context changes if the actual state is changed
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 13:04:45 +00:00
Chris Wilson
0b0cad38c5 i915: suppress repeated sampler state emission
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 13:04:41 +00:00
Chris Wilson
87641cffd9 i915: Eliminate redundant CONSTANTS updates
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:37 +00:00
Chris Wilson
41260a9bf6 i965: Use compiler builtins when available
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:37 +00:00
Chris Wilson
8ea6e98c7b i965: Micro-optimise check_state
Replace the intermediate tests due to the logical or with the bitwise
or.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:37 +00:00
Chris Wilson
50ade6ea69 intel: use throttle ioctl for throttling
Rather than waiting on the first batch after the last swapbuffers to be
retired, call into the kernel to wait upon the retirement of any request
less than 20ms old. This has the twofold advantage of (a) not blocking
any other clients from utilizing the device whilst we wait and (b) we
attain higher throughput without overloading the system.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:37 +00:00
Chris Wilson
46131a824f i965: Remove unused 'next_free_page' member
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:36 +00:00
Chris Wilson
57ca0803b3 intel: Skip the flush before read-pixels via blit
As we will flush when reading the return values of the blit, we can forgo
the earlier flush.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:36 +00:00
Chris Wilson
c625aa19cb intel: extend current vertex buffers
If the next vertex arrays are a (discontiguous) continuation of the
current arrays, such that the new vertices are simply offset from the
start of the current vertex buffer definitions we can reuse those
defintions and avoid the overhead of relocations and invalidations.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:36 +00:00
Chris Wilson
a07e481179 intel: Use specified alignment for writes into the upload buffer
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:36 +00:00
Chris Wilson
d9e591391d i965: Clean up brw_prepare_vertices()
Use a temporary glarray variable to replace the numerous input->glarray.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:36 +00:00
Chris Wilson
3630d5b69a intel: combine short memcpy using a temporary allocated buffer
Using a temporary buffer for large discontiguous uploads into the common
buffer and a single buffered upload is faster than performing the
discontiguous copies through a mapping into the GTT.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:36 +00:00
Chris Wilson
dfc6c96e5c i965: upload normal arrays as interleaved
Upload the non-vbo arrays into a single interleaved buffer object, and
so need to just emit a single vertex buffer relocation.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:35 +00:00
Chris Wilson
94d73d700e i965: interleaved vbo
If the user passed in several arrays interleaved in the same vbo, only
emit a single vertex buffer and relocation.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:35 +00:00
Chris Wilson
559435d915 i965: emit one vb packet per vbo
Track reuse of the vertex buffer objects and so minimise the number of
vertex buffers used by the hardware (and their relocations).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:35 +00:00
Chris Wilson
abb5109756 i965: upload transient indices into the same discontiguous buffer
As we now pack the indices into a common upload buffer, we can reuse a
single CMD_INDEX_BUFFER packet and translate each invocation with a
start vertex offset.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:35 +00:00
Chris Wilson
60bb3e5614 i965: suppress repeat-emission of identical vertex elements
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:35 +00:00
Chris Wilson
aac120977d i965: Move repeat-instruction-suppression to batchbuffer core
Move the tracking of the last emitted instructions into the core
batchbuffer routines and take advantage of the shadow batch copy to
avoid extra memory allocations and copies.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:35 +00:00
Chris Wilson
8d68a90e22 intel: use pwrite for batch
It's faster. Not only is the memcpy more efficiently performed in the
kernel (making up for the system call overhead), but by not using mmap
we remove the greater overhead of tracking the vma of every batch.

And it means we can read back from the batch buffer without incurring
the cost of a uncached read through the GTT.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:35 +00:00
Chris Wilson
3f55683927 i965: drop state_bo references to batch_bo
As we use state relocations and we know that all the state belongs to
the same bo, we can drop the multiple references to the same bo.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:34 +00:00
Chris Wilson
1be3764dbe i965: directly write wm state to batch
As we write directly into the batch in system memory, we do not need to
write first to the stack (as was to avoid read back through the GTT)

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:34 +00:00
Chris Wilson
df156549e7 i965: write cc straight to batch
As we write directly into the batch in system memory, we do not need to
write first to the stack (as was to avoid read back through the GTT)

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:34 +00:00
Chris Wilson
f29606598e i965: switch gen6 to use its own cc state bo
In preparation for a greater change, use the color_calc_state_bo already
provisioned for this purpose.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:34 +00:00
Chris Wilson
8a9e67b8df intel: Buffered upload
Rather than performing lots of little writes to update the common bo
upon each update, write those into a static buffer and flush that when
full (or at the end of the batch). Doing so gives a dramatic performance
improvement over and above using mmaped access.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:34 +00:00
Chris Wilson
40ee15407a intel: Replace the bo for a complete update
Rather than performing a blit to completely overwrite a busy bo, simply
discard it and create a new one with the fresh data.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:34 +00:00
Chris Wilson
abb37861d9 i965: Combine vb upload buffer with the general upload buffer
Reuse the new common upload buffer for uploading temporary indices and
rebuilt vertex arrays.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:34 +00:00
Chris Wilson
e476e12220 intel: Pack dynamic draws together
Dynamic arrays have the tendency to be small and so allocating a bo for
each one is overkill and we can exploit many efficiency gains by packing
them together.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:34 +00:00
Chris Wilson
d0809d7b15 intel: Use system memory for DYNAMIC_DRAW source objects
Dynamic draw buffers are used by clients for temporary arrays and for
uploading normal vertex arrays. By keeping the data in memory, we can
avoid reusing active buffer objects and reallocate them as they are
changed. This is important for Sandybridge which can not issue blits
within a batch and so ends up flushing the batch upon every update, that
is each batch only contains a single draw operation (if using dynamic
arrays or regular arrays from system memory).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:34 +00:00
Chris Wilson
45ba7afbd1 i965: Trim the trailing NOOP from 3DSTATE_INDEX_BUFFER
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:33 +00:00
Chris Wilson
13bab58f04 i965: Fallback on encountering a NULL render buffer
Following a GPU hang, or other error, the render target is not likely to
have an allocated BO and so we must fallback to avoid using it.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=32534
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:33 +00:00
Vinson Lee
8033700814 i915g: s/__func__/__FUNCTION__/ 2011-02-20 21:23:45 -08:00
Daniel Vetter
c0122daf10 i915g: kill remnants of mmapped batchbuffer support
We're using bo_subdata.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-02-21 00:50:16 +01:00
Jakob Bornecrantz
fa186804a6 i915g: Add winsys/i915/sw to scons build 2011-02-21 00:50:16 +01:00
Jakob Bornecrantz
20ff6a2752 i915g: Fix void ptr arith 2011-02-21 00:50:16 +01:00
Jakob Bornecrantz
ec3c5ac592 i915g: Add dummy flush_frontbuffer 2011-02-21 00:50:16 +01:00
Jon TURNEY
aa6a5cf1d5 Fix --enable-shared-glapi configure option
Fix a typo which meant that --enable-shared-glapi didn't actually cause a shared glapi to be built

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2011-02-20 12:53:42 -07:00
Chia-I Wu
bf0c56522e egl_dri2: Return NULL when xcb_get_geometry_reply fails.
This should fix bug #33946.
2011-02-20 12:26:31 -07:00
José Fonseca
91ea60395e scons: Add aliases for the llvmpipe unit tests.
Now one can simply do

  scons lp_test_format
2011-02-19 10:56:05 +00:00
José Fonseca
57d4e922a6 gallivm: Use simple scaling plus casting in more unorm->float cases. 2011-02-19 10:56:05 +00:00
Kenneth Graunke
b1002e4aa5 glsl: Remove $(PWD) from Makefile in favor of .
Hopefully should fix bug #34468.
2011-02-19 00:06:00 -08:00
Marek Olšák
0b436cf511 r300g: fix a possible race when counting contexts
Atomics aren't sufficient here.
2011-02-19 00:17:27 +01:00
Marek Olšák
e9e5380f22 r300g: fix invalid dereference in winsys
radeon_bo_unref may destroy the buffer, so call it after p_atomic_dec, not before.
2011-02-19 00:06:52 +01:00
José Fonseca
e16e70610c svga: Fix NULL dereference.
Probably introduced with the surface view move from screen to context.
2011-02-18 19:03:43 +00:00