summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/i965/brw_draw_upload.c
AgeCommit message (Collapse)Author
2011-03-16i965c: Add support for GL_FIXED.Chia-I Wu
Quick and dirty..
2011-03-11i965: Use ffs() on a 32-bit int value instad of ffsll().Eric Anholt
2011-03-04i965: Fix extending VB packetsChris Wilson
Computation of the delta of this array from the last had a silly little bug and ignored any initial delta==0 causing grief in Nexuiz and friends. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-03-04i965: Align index to type size and flush if the type changesChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-03-04i965: Prevent using a zero sized (or of unknown type) vertex arrayChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-03-01i965: Use negative relocation deltas to minimse vertex uploadsChris Wilson
With relaxed relocation checking in the kernel, we can specify a negative delta (i.e. pointing outside of the target bo) in order to fake a range in a large buffer. We only then need to upload the elements used and adjust the buffer offset such that they correspond with the indices used in the DrawArrays. (Depends on libdrm 0209428b3918c4336018da9293cdcbf7f8fedfb6) Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-03-01i965: Undo 'continuation of vb packets'Chris Wilson
This breaks nexuiz for unknown reason; disable until a true fix can be found.
2011-03-01i965: Fix uploading of shortened vertex packetsChris Wilson
... handle all cases and not just the interleaved upload. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-03-01i965: Upload all vertices usedChris Wilson
... and take advantage of start_vertex_bias to trim to [min_index, max_index] where possible (i.e. when we need to upload all arrays). Fixes half_float_vertex(misc.fillmode.wireframe) Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34595 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-24intel: Reset the buffer offset after releasing reference to packed uploadChris Wilson
Fixes oglc/vbo(basic.bufferdata) Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34603 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-24i965: Unmap the correct pointer after discontiguous uploadChris Wilson
Fixes piglit/fbo-depth-sample-compare: ==14722== Invalid free() / delete / delete[] ==14722== at 0x4C240FD: free (vg_replace_malloc.c:366) ==14722== by 0x84FBBFD: intel_upload_unmap (intel_buffer_objects.c:695) ==14722== by 0x85205BC: brw_prepare_vertices (brw_draw_upload.c:457) ==14722== by 0x852F975: brw_validate_state (brw_state_upload.c:394) ==14722== by 0x851FA24: brw_draw_prims (brw_draw.c:365) ==14722== by 0x85F2221: vbo_exec_vtx_flush (vbo_exec_draw.c:389) ==14722== by 0x85EF443: vbo_exec_FlushVertices_internal (vbo_exec_api.c:543) ==14722== by 0x85EF49B: vbo_exec_FlushVertices (vbo_exec_api.c:973) ==14722== by 0x86D6A16: _mesa_set_enable (enable.c:351) ==14722== by 0x42CAD1: render_to_fbo (in /home/ickle/git/piglit/bin/fbo-depth-sample-compare) ==14722== by 0x42CEE3: piglit_display (in /home/ickle/git/piglit/bin/fbo-depth-sample-compare) ==14722== by 0x42F508: display (in /home/ickle/git/piglit/bin/fbo-depth-sample-compare) ==14722== Address 0xc606310 is 0 bytes after a block of size 18,720 alloc'd ==14722== at 0x4C244E8: malloc (vg_replace_malloc.c:236) ==14722== by 0x85202AB: copy_array_to_vbo_array (brw_draw_upload.c:256) ==14722== by 0x85205BC: brw_prepare_vertices (brw_draw_upload.c:457) ==14722== by 0x852F975: brw_validate_state (brw_state_upload.c:394) ==14722== by 0x851FA24: brw_draw_prims (brw_draw.c:365) ==14722== by 0x85F2221: vbo_exec_vtx_flush (vbo_exec_draw.c:389) ==14722== by 0x85EF443: vbo_exec_FlushVertices_internal (vbo_exec_api.c:543) ==14722== by 0x85EF49B: vbo_exec_FlushVertices (vbo_exec_api.c:973) ==14722== by 0x86D6A16: _mesa_set_enable (enable.c:351) ==14722== by 0x42CAD1: render_to_fbo (in /home/ickle/git/piglit/bin/fbo-depth-sample-compare) ==14722== by 0x42CEE3: piglit_display (in /home/ickle/git/piglit/bin/fbo-depth-sample-compare) ==14722== by 0x42F508: display (in /home/ickle/git/piglit/bin/fbo-depth-sample-compare) Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34604 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-22i965: Trim the interleaved upload to the minimum number of verticesChris Wilson
... should have no impact on a properly formatted draw operation. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-22i965: Reinstate max-index paranoiaChris Wilson
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-22i965: Zero the offset into the vbo when uploading non-interleavedChris Wilson
Fixes regression from 559435d9152acc7162e4e60aae6591c7c6c8274b. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21i965: Fix VB packet reuse when offset for the new buffer isn't stride aligned.Eric Anholt
Fixes regression in scissor-stencil-clear and 5 other tests.
2011-02-21i965: Remove spurious duplicate ADVANCE_BATCHChris Wilson
... a leftover from a bad merge. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21intel: extend current vertex buffersChris Wilson
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-21intel: Use specified alignment for writes into the upload bufferChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21i965: Clean up brw_prepare_vertices()Chris Wilson
Use a temporary glarray variable to replace the numerous input->glarray. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21intel: combine short memcpy using a temporary allocated bufferChris Wilson
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-21i965: upload normal arrays as interleavedChris Wilson
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-21i965: interleaved vboChris Wilson
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-21i965: emit one vb packet per vboChris Wilson
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-21i965: upload transient indices into the same discontiguous bufferChris Wilson
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-21i965: suppress repeat-emission of identical vertex elementsChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21intel: use pwrite for batchChris Wilson
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-21intel: Buffered uploadChris Wilson
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-21i965: Combine vb upload buffer with the general upload bufferChris Wilson
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-21intel: Pack dynamic draws togetherChris Wilson
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-21i965: Trim the trailing NOOP from 3DSTATE_INDEX_BUFFERChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-11-03intel: Annotate debug printout checks with unlikely().Eric Anholt
This provides the optimizer with hints about code hotness, which we're quite certain about for debug printouts (or, rather, while we developers often hit the checks for debug printouts, we don't care about performance while doing so).
2010-10-13Drop GLcontext typedef and use struct gl_context insteadKristian Høgsberg
2010-10-12i965: Don't rebase the index buffer to min 0 if any arrays are in VBOs.Eric Anholt
There was a check to only do the rebase if we didn't have everything in VBOs, but nexuiz apparently hands us a mix of VBOs and arrays, resulting in blocking on the GPU to do a rebase. Improves nexuiz 800x600, high-settings performance on my Ironlake 41% (+/- 1.3%), from 14.0fps to 19.7fps.
2010-08-22i965: Use intel->gen >= 6 instead of IS_GEN6.Eric Anholt
2010-06-08intel: Change dri_bo_* to drm_intel_bo* to consistently use new API.Eric Anholt
The slightly less mechanical change of converting the emit_reloc calls will follow.
2010-05-14i965: Use R16G16B16A16_FLOAT for 3-component half-float.Eric Anholt
The RGBX version isn't supported as a vertex input type, but since we force the last channel's value anyway, this should be fine. The only potential risk I see is in the limiter on VBO reads past the end of the buffer forcing the whole vertex to 0 when the A channel lands past the end. Fixes piglit draw-vertices-half-float.
2010-04-21intel: Clean up chipset name and gen num for IronlakeZhenyu Wang
Rename old IGDNG to Ironlake, and set 'gen' number for Ironlake as 5, so tracking the features with generation num instead of special is_ironlake flag. Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
2010-03-04intel: Remove non-kernel-exec-fencing support.Eric Anholt
Shaves 60k off the driver from removing the broken spans code. This means we now require 2.6.29, which seems fair given that it's a year old and we've removed support for non-KMS already in the last release of 2D.
2010-02-25i965: Fix up some Sandybridge define checks for the structure rebase.Eric Anholt
2010-02-25i965: Reconnect the index/vertex setup.Eric Anholt
2010-02-19Replace the _mesa_*printf() wrappers with the plain libc versionsKristian Høgsberg
2010-02-19Replace _mesa_malloc, _mesa_calloc and _mesa_free with plain libc versionsKristian Høgsberg
2010-01-25Merge branch 'mesa_7_7_branch'Brian Paul
Conflicts: src/mesa/drivers/dri/intel/intel_screen.c src/mesa/drivers/dri/intel/intel_swapbuffers.c src/mesa/drivers/dri/r300/r300_emit.c src/mesa/drivers/dri/r300/r300_ioctl.c src/mesa/drivers/dri/r300/r300_tex.c src/mesa/drivers/dri/r300/r300_texstate.c
2010-01-22i965: Remove unnecessary headers.Vinson Lee
2010-01-23i965: add support for ARB_half_float_vertexDave Airlie
enables the extension on i965 and adds support to the draw upload for the vertex format. Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-01-04intel: Drop batchbuffer cliprect_mode trackingKristian Høgsberg
2009-12-28intel: Silence compiler warnings.Vinson Lee
2009-12-22intel: Replace IS_IGDNG checks with intel->is_ironlake or needs_ff_sync.Eric Anholt
Saves ~480 bytes of code.
2009-11-19intel: Remove non-GEM support.Eric Anholt
This really isn't supported at this point. GEM's been in the kernel for a year, and the fake bufmgr never really worked.
2009-11-13Merge remote branch 'origin/mesa_7_6_branch'Eric Anholt