aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nouveau/nouveau_buffer.c
Commit message (Collapse)AuthorAgeFilesLines
* nouveau: use the buffer usage to determine placement when no bindingIlia Mirkin2015-11-221-2/+6
| | | | | | | | | | | With ARB_direct_state_access, buffers can be created without any binding hints at all. We still need to allocate these buffers to VRAM or GART, as we don't have logic down the line to place them into GPU-mappable space. Ideally we'd be able to shift these things around based on usage. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92438 Signed-off-by: Ilia Mirkin <[email protected]> Cc: "11.0 11.1" <[email protected]>
* nouveau: send back a debug message when waiting for a fence to completeIlia Mirkin2015-11-051-6/+7
| | | | Signed-off-by: Ilia Mirkin <[email protected]>
* nouveau: wait to unref the transfer's bo until it's no longer usedIlia Mirkin2015-09-281-2/+3
| | | | | | | | | | The bo will often come from a slab in which case it doesn't matter. But for larger allocations this will be in its own bo, and we have to make sure to wait until it's no longer used in order for it to be freed. Signed-off-by: Ilia Mirkin <[email protected]> Cc: [email protected] Tested-by: Marcin Ślusarz <[email protected]>
* nouveau: delay deleting buffer with unflushed fenceIlia Mirkin2015-09-281-1/+6
| | | | | | | | | | | If there is an unflushed fence on the bo, then the resource may still be used in commands built up in the local pushbuf. Flushing can cause all sorts of unwanted effects, so just free the bo when the relevant fence is hit. Signed-off-by: Ilia Mirkin <[email protected]> Cc: [email protected] Tested-by: Marcin Ślusarz <[email protected]>
* nvc0: keep track of cb bindings per buffer, use for upload settingsIlia Mirkin2015-09-091-2/+2
| | | | | | | | | | | | | | | | | | | CB updates to bound buffers need to go through the CB_DATA endpoints, otherwise the shader may not notice that the updates happened. Furthermore, these updates have to go in to the same address as the bound buffer, otherwise, again, the shader may not notice updates. So we keep track of all the places where a constbuf is bound, and iterate over all of them when updating data. If a binding is found that encompasses the region to be updated, then we use the settings of that binding for the upload. Otherwise we upload as a regular data update. This fixes piglit 'arb_uniform_buffer_object-rendering offset' as well as blurriness in Witcher2. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91890 Signed-off-by: Ilia Mirkin <[email protected]> Cc: "11.0" <[email protected]>
* nouveau: don't mark full range as used on unmap with explicit flushIlia Mirkin2015-09-051-5/+7
| | | | | Signed-off-by: Ilia Mirkin <[email protected]> Cc: [email protected]
* gallium: replace INLINE with inlineIlia Mirkin2015-07-211-15/+15
| | | | | | | | | | | | | | | | Generated by running: git grep -l INLINE src/gallium/ | xargs sed -i 's/\bINLINE\b/inline/g' git grep -l INLINE src/mesa/state_tracker/ | xargs sed -i 's/\bINLINE\b/inline/g' git checkout src/gallium/state_trackers/clover/Doxyfile and manual edits to src/gallium/include/pipe/p_compiler.h src/gallium/README.portability to remove mentions of the inline define. Signed-off-by: Ilia Mirkin <[email protected]> Acked-by: Marek Olšák <[email protected]>
* nouveau: use bool instead of booleanSamuel Pitoiset2015-07-211-59/+59
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Acked-by: Ilia Mirkin <[email protected]>
* nouveau: always align buffers to 0x100Samuel Pitoiset2015-07-201-7/+1
| | | | | | | | | | | | | | Only constbufs must be aligned to 0x100, but since all buffers can be rebinded as constant buffers they must be also aligned. This patch prevents this behaviour by aligning everything to 256-byte increments at buffer creation. This fixes dmesg fails for the following piglit test: ext_transform_feedback-immediate-reuse-uniform-buffer -auto -fbo Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
* gallium: add BIND flags for R/W buffers and imagesMarek Olšák2015-07-161-1/+2
| | | | | | | | | | | | | | | | | PIPE_CAPs and TGSI support will be added later. The TGSI support should be straightforward. We only need to split TGSI_FILE_RESOURCE into TGSI_FILE_IMAGE and TGSI_FILE_BUFFER, though duplicating all opcodes shouldn't be necessary. The idea is: * ARB_shader_image_load_store should use set_shader_images. * ARB_shader_storage_buffer_object should use set_shader_buffers(slots 0..M-1) if M shader storage buffers are supported. * ARB_shader_atomic_counters should use set_shader_buffers(slots M..N) if N-M+1 atomic counter buffers are supported. PIPE_CAPs can describe various constraints for early DX11 hardware. Reviewed-by: Ilia Mirkin <[email protected]>
* nvc0: use NV_VRAM_DOMAIN() macroAlexandre Courbot2015-06-221-3/+3
| | | | | | | | | Use the newly-introduced NV_VRAM_DOMAIN() macro to support alternative VRAM domains for chips that do not have dedicated video memory. Signed-off-by: Alexandre Courbot <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Martin Peres <[email protected]>
* nouveau: synchronize "scratch runout" destruction with the command streamMarcin Ślusarz2015-03-311-16/+32
| | | | | | | | | | | | | | | | | | | | | When nvc0_push_vbo calls nouveau_scratch_done it does not mean scratch buffers can be freed immediately. It means "when hardware advances to this place in the command stream the scratch buffers can be freed". To fix it, just postpone scratch runout destruction after current fence is signalled. The bug existed for a very long time. Nobody noticed, because "scratch runout" code path is rarely executed. Fixes hang at the very beginning of first mission in "Serious Sam 3" on nve7/gk107. It manifested as: nouveau E[ PFIFO][0000:01:00.0] read fault at 0x000a9e0000 [PTE] from GR/GPC0/PE_2 on channel 0x007f853000 [Sam3[17056]] Cc: "10.4 10.5" <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
* nouveau: add ARB_buffer_storage supportIlia Mirkin2014-05-021-2/+10
| | | | Signed-off-by: Ilia Mirkin <[email protected]>
* nouveau: remove cb_dirty, it's never usedIlia Mirkin2014-05-021-3/+1
| | | | Signed-off-by: Ilia Mirkin <[email protected]>
* nouveau: add valid range tracking to nouveau_bufferIlia Mirkin2014-03-091-0/+31
| | | | | | | | | This logic is borrowed from the radeon code. The transfer logic will only get called for PIPE_BUFFER resources, so it shouldn't be necessary to worry about them becoming render targets. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Christoph Bumiller <[email protected]>
* gallium: remove PIPE_USAGE_STATICMarek Olšák2014-02-061-1/+0
| | | | Reviewed-by: Brian Paul <[email protected]>
* nouveau: Add lots of comments to the buffer transfer logicIlia Mirkin2013-12-041-2/+69
| | | | Signed-off-by: Ilia Mirkin <[email protected]>
* nv50: wait on the buf's fence before sticking it into pushbufIlia Mirkin2013-12-041-0/+3
| | | | | | | | This resolves some rendering issues in source games. See https://bugs.freedesktop.org/show_bug.cgi?id=64323 Signed-off-by: Ilia Mirkin <[email protected]> Cc: "9.2 10.0" <[email protected]>
* nouveau: initialise the nouveau_transfer mapsEmil Velikov2013-09-011-0/+2
| | | | | Cc: "9.2 and 9.1" <[email protected]> Signed-off-by: Emil Velikov <[email protected]>
* nouveau: accelerate buffer copies in resource_copy_regionChristoph Bumiller2013-04-031-0/+34
|
* nvc0: add some driver statistics queriesChristoph Bumiller2013-04-031-0/+30
|
* nouveau: align PIPE_BIND_SHADER,COMPUTE_RESOURCEs to 256 bytesChristoph Bumiller2013-03-121-1/+3
|
* nouveau: don't try to use push_data if it's not implementedChristoph Bumiller2013-01-271-0/+3
|
* nouveau: improve buffer transfersChristoph Bumiller2013-01-081-131/+268
| | | | | | Save double memcpy on uploads to VRAM in most cases. Properly handle FLUSH_EXPLICIT. Reallocate on DISCARD_WHOLE_RESOURCE to avoid sync.
* nv50,nvc0: expose ARB_map_buffer_alignmentLucas Stach2012-11-041-3/+3
| | | | | | All HW buffers (also suballocated ones) are already aligned. Just make sure that also the initial sysram buffers have proper alignment.
* nouveau: fix offset in nouveau_buffer_transfer_mapChristoph Bumiller2012-10-141-1/+1
| | | | | Before 369e46888904c6d379b8b477d9242cff1608e30e, the transfer was initialized before the call to map and had the correct value already.
* gallium: unify transfer functionsMarek Olšák2012-10-111-56/+46
| | | | | | | | | | | | | | "get_transfer + transfer_map" becomes "transfer_map". "transfer_unmap + transfer_destroy" becomes "transfer_unmap". transfer_map must create and return the transfer object and transfer_unmap must destroy it. transfer_map is successful if the returned buffer pointer is not NULL. If transfer_map fails, the pointer to the transfer object remains unchanged (i.e. doesn't have to be NULL). Acked-by: Brian Paul <[email protected]>
* nouveau: unreference fences on resource destructionChristoph Bumiller2012-05-291-0/+3
|
* nouveau: place static buffers in VRAM if preferred by the driverChristoph Bumiller2012-05-171-4/+25
|
* nv50,nvc0: handle user vertex buffersChristoph Bumiller2012-05-171-11/+9
| | | | And restructure VBO validation a little in the process.
* Merge branch 'gallium-userbuf'Marek Olšák2012-05-111-1/+0
|\ | | | | | | | | | | | | | | Conflicts: src/gallium/docs/source/screen.rst src/gallium/drivers/nv50/nv50_state.c src/gallium/include/pipe/p_defines.h src/mesa/state_tracker/st_draw.c
| * gallium: remove pipe_resource::user_ptrMarek Olšák2012-04-301-1/+0
| | | | | | | | It's unused now.
* | nouveau: fix nouveau_scratch_runout_release bo count underflowChristoph Bumiller2012-05-061-1/+3
|/
* gallium: add user_ptr in pipe_resourceMarek Olšák2012-04-241-0/+1
| | | | I need to access the pointer in st/mesa when I only have pipe_resource.
* nouveau: add new shared scratch buffersChristoph Bumiller2012-04-141-0/+141
|
* nv30: import new driver for GeForce FX/6/7 chipsets, and Quadro variantsBen Skeggs2012-04-141-1/+1
| | | | | | | | | | | | | | | | | | The primary motivation for this rewrite was to have a maintainable driver going forward, as nvfx was quite horrible in a lot of ways. The driver is heavily based on the design of the nv50/nvc0 3d drivers we already have, and uses the same common buffer/fence code. It also passes a HEAP more piglit tests than nvfx did, supports a couple more features, and a few more to come still probably. The CPU footprint of this driver is far far less than nvfx, and translates into far greater framerates in a lot of applications (unless you're using a CPU that's way way newer than the GPUs of these generations....) Basically, we once again have a maintained driver for these chipsets \o/ Feel free to report bugs now!
* nouveau: switch to libdrm_nouveau-2.0Christoph Bumiller2012-04-141-37/+53
|
* nouveau: remove automatic buffer migration heuristicsChristoph Bumiller2012-04-141-5/+0
|
* Revert "gallium: add flag PIPE_TRANSFER_MAP_PERMANENTLY"Marek Olšák2012-03-051-7/+1
| | | | | | | This reverts commit 0950086376b1c8b7fb89eda81ed7f2f06dee58bc. It was decided to refactor the transfer API instead of adding workarounds to address the performance issues.
* gallium: add flag PIPE_TRANSFER_MAP_PERMANENTLYMarek Olšák2012-01-051-1/+7
| | | | | | | | | | | Please see the diff for further info. This paves the way for moving user buffer uploads out of drivers and should allow to clean up the mess in u_upload_mgr in the meantime. For now only allowed for buffers on r300 and r600. Acked-by: Christian König <[email protected]>
* nouveau,nvc0: fix/improve handling of multiple constant buffersChristoph Bumiller2011-10-211-4/+13
|
* nouveau: hide some debugging messages behind environment variableMarcin Slusarz2011-10-091-1/+2
| | | | | They spam console, but are not very useful - hide them behind NOUVEAU_MESA_DEBUG environment variable.
* gallium: kill is_resource_referencedMarek Olšák2011-03-111-1/+0
| | | | Only st/xorg used it and even incorrectly with regards to pipelined transfers.
* nouveau: allow pipe driver to define which buffers should start in sysmemBen Skeggs2011-03-031-1/+1
| | | | | | | PIPE_BIND_CONSTANT_BUFFER alone was OK for nv50/nvc0, but nv30 will need to be able to set others on certain chipsets. Signed-off-by: Ben Skeggs <[email protected]>
* nouveau: ensure vbo_dirty is set when buffer write transfer completeBen Skeggs2011-03-011-24/+23
| | | | | | This introduces a shared nouveau_context struct to track such things. Signed-off-by: Ben Skeggs <[email protected]>
* nv50: sync textures with render targets ourselvesBen Skeggs2011-03-011-3/+3
| | | | | | Port of the nvc0 commit doing the same. Signed-off-by: Ben Skeggs <[email protected]>
* nouveau: common linear buffer manager, ported from nv50/nvc0 driversBen Skeggs2011-03-011-0/+489
nv50_resource is being called nv04_resource now temporarily, to avoid a naming conflict with nouveau_resource from libdrm. Signed-off-by: Ben Skeggs <[email protected]>