Commit graph

42583 commits

Author SHA1 Message Date
Chris Wilson
b4cbd2b312 i965: Reinstate max-index paranoia
Don't trust the applications not to reference beyond the end of the
vertex buffers.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-22 11:24:45 +00:00
Chris Wilson
3377faffcd i965: Zero the offset into the vbo when uploading non-interleaved
Fixes regression from 559435d915.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-22 11:24:34 +00:00
Jakob Bornecrantz
94ccc31ba4 st/dri: Track drawable context bindings
Needs to track this ourself since because we get into a race condition with
the dri_util.c code on make current when rendering to the front buffer.

This is what happens:
Old context is rendering to the front buffer.

App calls MakeCurrent with a new context. dri_util.c sets
drawable->driContextPriv to the new context and then calls the driver make
current. st/dri make current flushes the old context, which calls back into
st/dri via the flush frontbuffer hook. st/dri calls dri loader flush
frontbuffer, which calls invalidate buffer on the drawable into st/dri.

This is where things gets wrong. st/dri grabs the context from the dri
drawable (which now points to the new context) and calls invalidate
framebuffer to the new context which has not yet set the new drawable as its
framebuffers since we have not called make current yet, it asserts.
2011-02-20 16:31:48 +01:00
Eric Anholt
9e872a5865 i965: Fix VB packet reuse when offset for the new buffer isn't stride aligned.
Fixes regression in scissor-stencil-clear and 5 other tests.
2011-02-21 16:36:09 -08:00
Brian Paul
12f25eb6d5 Revert "mesa: convert macros to inline functions"
This reverts commit e9ff76aa81.

Need to use macros so __FUNCTION__ reports the caller.
2011-02-21 17:01:00 -07:00
Brian Paul
e2d108ec82 st/mesa: need to translate clear color according to surface's base format
When clearing a GL_LUMINANCE_ALPHA buffer, for example, we need to convert
the clear color (R,G,B,A) to (R,R,R,A).  We were doing this for texture border
colors but not renderbuffers.  Move the translation function to st_format.c
and share it.

This fixes the piglit fbo-clear-formats test.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-02-21 16:58:42 -07:00
Brian Paul
c966c6980c st/mesa: fix the default case in st_format_datatype()
Part of the fix for piglit fbo-clear-formats

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-02-21 16:58:42 -07:00
Daniel Vetter
55a3c35243 i915g: add some throttling
Intel classic drivers switched to this, too, so it must be good.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-02-21 23:42:54 +00:00
Daniel Vetter
1e966636d0 i915g: s/bool/boolean/ style-fixup in winsys
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-02-21 23:42:53 +00:00
Jakob Bornecrantz
593ba7b05b i915g: Fix warning 2011-02-21 23:42:53 +00:00
Jakob Bornecrantz
43e6fe5549 i915g: Add option to lie about caps 2011-02-21 23:42:53 +00:00
Jakob Bornecrantz
27b49e91c9 i915g: Move debug fields to screen 2011-02-21 23:42:53 +00:00
Jakob Bornecrantz
fe6800a1bb i915g: Use debug get once options 2011-02-21 23:42:53 +00:00
Jakob Bornecrantz
3c74ecf687 i915g: Rework texture tiling a bit 2011-02-21 23:42:53 +00:00
Jakob Bornecrantz
e7e1fd057e i915g: Anisotropic filtering works 2011-02-21 23:42:53 +00:00
Jakob Bornecrantz
a641766576 i915g: TODO about point sprites 2011-02-21 23:42:53 +00:00
Jakob Bornecrantz
e7cdcefbee i915g: TODO about untested code hidden behind caps
Should be fairly easy to test and fix since you can look at
the code in the classic driver.
2011-02-21 23:42:53 +00:00
Jakob Bornecrantz
e3c9bf1a67 i915g: Reorg caps 2011-02-21 23:42:53 +00:00
Brian Paul
7dbafea860 st/mesa: fix incorrect texture size allocation in st_finalize_texture()
If finalizing a non-POW mipmapped texture with an odd-sized base texture
image we were allocating the wrong size of gallium texture (off by one).
Need to be more careful about computing the base texture image size.

This fixes https://bugs.freedesktop.org/show_bug.cgi?id=34463
2011-02-21 15:15:53 -07:00
Brian Paul
4cdcec08d1 st/mesa: refactor guess_and_alloc_texture() code 2011-02-21 15:15:53 -07:00
Brian Paul
51f9713e39 st/mesa: fix mipmap generation for non-POW textures
This is part of the fix for https://bugs.freedesktop.org/show_bug.cgi?id=34463
2011-02-21 15:15:53 -07:00
Brian Paul
e9ff76aa81 mesa: convert macros to inline functions 2011-02-21 15:15:53 -07:00
Brian Paul
da9adb9613 vbo: more comments 2011-02-21 15:15:52 -07:00
Brian Paul
6f027ba20d vbo: make vbo_exec_FlushVertices_internal() static 2011-02-21 15:15:52 -07:00
Brian Paul
bbd756e824 vbo: remove old debug code, add comments 2011-02-21 15:15:52 -07:00
Brian Paul
7cba2df4a6 vbo: rename, document function params 2011-02-21 15:15:52 -07:00
Brian Paul
f0c8e7c327 vbo: comments 2011-02-21 15:15:52 -07:00
Brian Paul
0ba2810e47 vbo: replace assert(0) with proper assertions 2011-02-21 15:15:52 -07:00
Brian Paul
ae4b6e04cd vbo: rename some vars, add new comments, fix formatting, etc. 2011-02-21 15:15:52 -07:00
Brian Paul
8b2598d000 vbo: use ctx instead of exec->ctx 2011-02-21 15:15:52 -07:00
Brian Paul
f9e1542286 radeon: add default switch case to silence unhandled enum warning 2011-02-21 15:15:52 -07:00
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