summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r600/r600_query.c
Commit message (Collapse)AuthorAgeFilesLines
* r600: add ARB_query_buffer_object supportDave Airlie2018-01-291-22/+41
| | | | | | | | | | | | | | This uses a different shader than radeonsi, as we can't address non-256 aligned ssbos, which the radeonsi code does. This passes some extra offsets into the shader. It also contains a set of u64 instruction implementation that may or may not be complete (at least the u64div is definitely not something that works outside this use-case). If r600 grows 64-bit integers, it will use the GLSL lowering for divmod. Reviewed-by: Roland Scheidegger <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* r600: hack up num_render_backends on Juniper to 8Roland Scheidegger2018-01-101-2/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | Juniper really has a maximum of 4 RBEs (16 pixels). However, predication always locks up on my HD 5750, and through experiments it looks like if we're pretending it has a maximum of 8, with 4 disabled, it works correctly. My conclusion would be that there's a bug (likely firmware, not hw) which causes the predication logic to try to read 8 results out of the query buffer instead of just 4, and since of course noone ever writes the upper 4, the status bit is never set and hence it will wait for it forever. Ideally this would be fixed in firmware, but I'd guess chances of that happening are slim. This will double the size of (occlusion) query result buffers, write the status bit for the disabled rbs in these buffers, and will also add 8 results together instead of just 4 when reading them back. The latter is unnecessary, but it's probably not worth bothering - luckily num_render_backends isn't used outside of occlusion queries, so don't need separate value for the "real" maximum. Also print out the enabled_rb_mask if it changed from the pre-fixed value (which is already printed out), just in case there's some more problems with chips which have some rbs disabled... This fixes all the lockups with piglit nv_conditional_render tests on my HD 5750 (all pass). Reviewed-by: Dave Airlie <[email protected]>
* r600: fix enabled_rb_mask on eg/cmRoland Scheidegger2018-01-101-2/+9
| | | | | | | | | | | | | | | | | | | | | | For eg/cm, the r600_gb_backend_map will always be 0. This is a bug in the drm kernel driver, as it just just never fills the information in (it is now being fixed - the history shows it was being filled in when the query was brand new but got lost shortly thereafter with backend_map fixes). This causes r600_query_hw_prepare_buffer to write the "status bit" (just the highest bit of the occlusion query result) even for active rbes (all but the first). This doesn't make much sense, albeit I suppose it's mostly safe. According to the commit history, it's necessary to set these bits for inactive rbes since otherwise predication will lock up - presumably the hw just is waiting for the status bit to appear, which will never happen with inactive rbes. I'd guess potentially predication could be wrong (due to not waiting for the actual result if the status bit is already there) if this is set for active rbes. Discovered while trying to fix predication lockups on Juniper (needs another patch). Reviewed-by: Dave Airlie <[email protected]>
* r600: drop l2 related queriesDave Airlie2018-01-101-14/+0
| | | | | | radeonsi only. Signed-off-by: Dave Airlie <[email protected]>
* r600/query: drop rest of vi workaround code.Dave Airlie2017-11-101-33/+13
| | | | | | | | This isn't needed in r600 anymore. Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* util: move os_time.[ch] to src/utilNicolai Hähnle2017-11-091-1/+1
| | | | Reviewed-by: Marek Olšák <[email protected]>
* r600: drop tc_L2_dirty bit, this was SI only.Dave Airlie2017-10-111-1/+0
| | | | | | Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* r600: drop a bunch of post-cayman code. (v2)Dave Airlie2017-10-101-89/+13
| | | | | | | | | | | | | Now that Marek has split the two drivers apart, drop a bunch of unnecessary code from the r600 half. There is probably a bunch more hiding in the video code. No piglit regressions on caicos. v2: fix HAVE_LLVM protected code Acked-by: Nicolai Hähnle <[email protected]> Acked-by: Marek Olšák <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* r600: cleanup set_occlusion_query_stateNicolai Hähnle2017-09-291-1/+3
| | | | | | | | | | | This fixes a warning caused by the fork (note the change in the function signature): ../../../../../mesa-src/src/gallium/drivers/r600/r600_state_common.c: In function ‘r600_init_common_state_functions’: ../../../../../mesa-src/src/gallium/drivers/r600/r600_state_common.c:2974:36: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types] rctx->b.set_occlusion_query_state = r600_set_occlusion_query_state; Reviewed-by: Marek Olšák <[email protected]>
* r600: fork and import gallium/radeonMarek Olšák2017-09-261-0/+2201
| | | | | | | | | | | This marks the end of code sharing between r600 and radeonsi. It's getting difficult to work on radeonsi without breaking r600. A lot of functions had to be renamed to prevent linker conflicts. There are also minor cleanups. Acked-by: Dave Airlie <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* r600g: move queries to drivers/radeonMarek Olšák2014-01-281-745/+0
| | | | | Reviewed-by: Michel Dänzer <[email protected]> Reviewed-by: Tom Stellard <[email protected]>
* r600g: move the low-level buffer functions for multiple rings to drivers/radeonMarek Olšák2013-09-291-4/+4
| | | | Also slightly optimize r600_buffer_map_sync_with_rings.
* r600g: move streamout state to drivers/radeonMarek Olšák2013-08-311-29/+29
| | | | | | | | | | | | | | | | | | | | | | | | This streamout state code will be used by radeonsi. There are new structures r600_common_context and r600_common_screen. What is inherited by what is shown here: pipe_context -> r600_common_context -> r600_context pipe_screen -> r600_common_screen -> r600_screen The common structures reside in drivers/radeon. Currently they only contain enough functionality to be able to handle streamout. Eventually I'd like the whole pipe_screen implementation to be shared and some of the context stuff too. This is quite big, but most changes are because of the new structures and the fact r600_write_value is replaced by radeon_emit. Thanks to Tom Stellard for fixing the build for r600g/compute. Reviewed-by: Michel Dänzer <[email protected]> Reviewed-by: Christian König <[email protected]> Tested-by: Tom Stellard <[email protected]>
* gallium: add condition parameter to render_conditionRoland Scheidegger2013-06-181-0/+2
| | | | | | | | | | | | | For conditional rendering this makes it possible to skip rendering if either the predicate is true or false, as supported by d3d10 (in fact previously it was sort of implied skip rendering if predicate is false for occlusion predicate, and true for so_overflow predicate). There's no cap bit for this as presumably all drivers could do it trivially (but this patch does not implement it for the drivers using true hw predicates, nvxx, r600, radeonsi, no change is expected for OpenGL functionality). Reviewed-by: Jose Fonseca <[email protected]>
* r600g: implement pipeline statistics queryMarek Olšák2013-04-161-0/+95
|
* r600g: add a query returning the amount of time spent during bo_map sync.Marek Olšák2013-04-161-0/+9
|
* r600g: add a driver query returning the amount of requested VRAM and GTT memoryMarek Olšák2013-03-261-0/+16
|
* r600g: add a driver query returning the number of draw_vbo callsMarek Olšák2013-03-261-5/+39
| | | | between begin_query and end_query
* r600g: Use virtual address for PIPE_QUERY_SO* in r600_emit_query_endMartin Andersson2013-03-251-2/+3
| | | | | | | | | | | | Virtual address is used for PIPE_QUERY_SO* queries in r600_emit_query_begin, but not in r600_emit_query_end. This will trigger a GPU fault when one of those queries is made and virtual address is enabled. Note: this is a candidate for the 9.1 branch Signed-off-by: Alex Deucher <[email protected]>
* r600g: add multi ring support with dma as first second ring v4Jerome Glisse2013-01-281-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | We keep track of ring emission order in a stack, whenever we need to flush we empty the stack in a fifo order. There is few helpers function for bo mapping and other ring activities that will make sure that the ring stack is properly flush and submitted. v2: fix st flush path, and other flush path to properly flush all rings if necessary v3: - improve name of ring helpers - make sure that each time a cs is gona be written it endup at top of the stack to avoid any issue such as : STACK[0] = dma (withbo A,B) STACK[1] = gfx (withbo C,D) Now if code try to emit a dma command relative to bo C or D it will start writting cmd stream into the cs and once it reach the point where it adds relocation it will flush. At that point the cs will have cmd that don't have proper relocation into the relocation buffer and kernel will just refuse to run. v4: - Drop the stack idea as it turn out there is no way to use it or benefit from it. Any time the driver start command on other ring, it always need to flush the previous ring. So make code simpler by not using a stack. Signed-off-by: Jerome Glisse <[email protected]>
* r600g: don't suspend TIME_ELAPSED queries during flushingMarek Olšák2012-12-211-32/+4
| | | | | According to the GL spec, the result should be equivalent to comparing two timestamps.
* r600g: inline r600_atom_dirtyMarek Olšák2012-10-101-1/+1
| | | | Reviewed-by: Jerome Glisse <[email protected]>
* r600g: ensure PERFECT_ZPASS+NOOP_CULL_DISABLE are 0 for blits+decompressionMarek Olšák2012-10-061-23/+22
| | | | | | | | When an occlusion query was active, the derived DB state wasn't changed for u_blitter even though all the occlusion queries were suspended. It's fixed by moving the state update into the emit functions, which are called whenever queries are stopped or suspended.
* r600g: implement timestamp query and get_timestamp hookMarek Olšák2012-08-151-1/+16
| | | | Reviewed-by: Alex Deucher <[email protected]>
* winsys/radeon: simplify buffer map/unmap functionsMarek Olšák2012-04-291-6/+6
| | | | | The idea is not to use pb_map and pb_unmap wrappers, calling straight into the winsys.
* u_vbuf: remove u_vbuf_resourceMarek Olšák2012-04-241-2/+2
|
* r600g: cleanup after get_query_result changeMarek Olšák2012-03-301-29/+9
| | | | Finally, union r600_query_result can be removed.
* gallium: adapt to get_query_result interface changeMarek Olšák2012-03-301-1/+1
| | | | Reviewed-by: Brian Paul <[email protected]>
* r600g: replace atom_ prefix with _state and _cmd suffixesMarek Olšák2012-03-051-3/+3
|
* r600g: move r600_context_bo_reloc to r600_pipe.hMarek Olšák2012-03-051-1/+0
| | | | | so that we don't have to include r600_hw_context_priv.h outside of the *hw_context* files.
* winsys/radeon: add usage parameter to cs_is_buffer_referencedMarek Olšák2012-03-051-1/+1
| | | | | Reviewed-by: Alex Deucher <[email protected]> Reviewed-by: Christian König <[email protected]>
* r600g: correctly handle queries which don't need begin_queryMarek Olšák2012-03-051-6/+27
| | | | | Reviewed-by: Alex Deucher <[email protected]> Reviewed-by: Christian König <[email protected]>
* r600g: don't suspend timer queries for u_blitterMarek Olšák2012-03-051-9/+52
| | | | | | | | | | | | Timer queries should be able to measure the time spent in u_blitter as well. Queries are split into two groups: the timer ones and the others (streamout, occlusion), because we should only suspend non-timer queries for u_blitter, and later if the non-timer queries are suspended, the context flush should only suspend and resume the timer queries. Reviewed-by: Alex Deucher <[email protected]> Reviewed-by: Christian König <[email protected]>
* r600g: release query buffers in destroy_queryMarek Olšák2012-03-051-0/+9
| | | | | | | This fixes a memory leak introduced with the rework. Reviewed-by: Alex Deucher <[email protected]> Reviewed-by: Christian König <[email protected]>
* r600g: move all query code into r600_query.cMarek Olšák2012-03-051-27/+408
| | | | | | | | And rename or inline functions where appropriate. There is no reason to keep this stuff in r600_hw_context.c. Reviewed-by: Alex Deucher <[email protected]> Reviewed-by: Christian König <[email protected]>
* r600g: rework queriesMarek Olšák2012-02-231-11/+27
| | | | | | | | | | | | | | | | We always mapped the query buffer in begin_query, causing stalls if the buffer was busy. This commit reworks it such that the query buffer is only mapped in get_query_result as it's supposed to be. The query buffer is no longer treated as a ring buffer. Instead, the results are just appended and when the buffer is full, we create a new one. One query can have more than one query buffer, though that's a very rare case. Begin_query releases all query buffers. Reviewed-by: Jerome Glisse <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
* r600g: add a depth misc state which depends on occlusion queriesMarek Olšák2012-02-211-0/+23
| | | | | | | | | | | | | | | | This is a state which is derived from other states and is actually the first state which doesn't correspond to any gallium state. There are two state flags: bool occlusion_query_enabled bool flush_depthstencil_enabled Additional flags can be added later if needed, e.g. bool hiz_enabled. The emit function will have to figure out the register values by itself. It basically just emits the registers when the state changes. This commit also adds a few helper functions for writing registers directly into a command stream.
* r600g: merge r600_context with r600_pipe_contextMarek Olšák2012-01-311-19/+19
| | | | The split made no sense.
* r600g: implement transform feedbackMarek Olšák2011-12-171-1/+15
| | | | | | | | r600: DONE. r700: MOSTLY (done but locks up). Evergreen: MOSTLY (done but doesn't work for an unknown reason). The kernel support will come soon.
* r600g: the type of OCCLUSION_PREDICATE result should be booleanMarek Olšák2011-11-111-2/+2
|
* r600g: reset the render condition to NULL when rendering unconditionallyMarek Olšák2011-10-301-1/+5
|
* r600g: only maintain the list of active queriesMarek Olšák2011-10-281-1/+4
| | | | | | | | And not all existing queries. The only reason we have that list is to be able to suspend and resume the active ones. This reduces looping over queries when suspending and resuming. The queries no longer have to track some of their states.
* r600g: inline some of the winsys r600_get functionsMarek Olšák2011-09-121-1/+1
|
* r600g: fix queries and predicationVadim Girlin2011-07-151-5/+10
| | | | | | | Use all zpass data for predication instead of the last block only. Use query buffer as a ring instead of reusing the same area for each new BeginQuery. All query buffer offsets are in bytes to simplify offsets math.
* r600g: reduce flushes for queriesVadim Girlin2011-07-051-4/+1
|
* r600g: disable render condition for some blitter operationsMarek Olšák2011-06-151-0/+3
|
* gallium: remove flags from the flush functionMarek Olšák2011-03-111-1/+1
| | | | | | | | | | The drivers have been changed so that they behave as if all of the flags were set. This is already implicit in most hardware drivers and required for multiple contexts. Some state trackers were also abusing the PIPE_FLUSH_RENDER_CACHE flag to decide whether flush_frontbuffer should be called. New flag ST_FLUSH_FRONT has been added to st_api.h as a replacement.
* r600g: add NV_conditional_render support.Dave Airlie2011-03-011-0/+28
| | | | | | | | This is reliant on a drm patch that I posted on the list + a version bump. These will appear in drm-next today. Signed-off-by: Dave Airlie <[email protected]>
* r600g: more cleanupJerome Glisse2010-09-291-5/+1
| | | | Signed-off-by: Jerome Glisse <[email protected]>
* r600g: cleanupJerome Glisse2010-09-291-0/+80
| | | | Signed-off-by: Jerome Glisse <[email protected]>