summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/ilo/ilo_3d.c
Commit message (Collapse)AuthorAgeFilesLines
* ilo: rename ilo_3d.[ch] to ilo_draw.[ch]Chia-I Wu2014-09-261-701/+0
| | | | | | | There is not much left in struct ilo_3d. We want to kill it and ilo_3d.[ch] will be bad names. Signed-off-by: Chia-I Wu <[email protected]>
* ilo: clean up fallback path for primitive restartChia-I Wu2014-09-221-160/+74
| | | | | | | We should be able to draw with the index buffer mapped. That simplifies things a lot. Signed-off-by: Chia-I Wu <[email protected]>
* ilo: handle conditional rendering in the contextChia-I Wu2014-09-221-46/+1
| | | | | | Conditional rendering is not limited to draw_vbo(). Move the support to ilo_context, and replace ilo_3d_pass_render_condition() by ilo_skip_rendering().
* ilo: create the pipeline from the builderChia-I Wu2014-09-221-1/+1
| | | | The pipeline needs just the builder to build commands. It does not need CP.
* ilo: move aperture checks out of pipelineChia-I Wu2014-09-221-5/+63
| | | | | They can be done outside of the pipeline. Move them and let the pipeline focus on building commands.
* ilo: flush before setting SOL_RESETChia-I Wu2014-09-221-0/+8
| | | | | | | SOL_RESET happens before bo execution. It should not be observed by the commands that are already in the bo. Move the code out of the pipeline now that it submits.
* ilo: move size estimation check out of pipelineChia-I Wu2014-09-221-2/+10
| | | | It can be done outside of the pipeline. Let's move it.
* ilo: use a single list for queriesChia-I Wu2014-09-211-64/+7
| | | | | | | | We used different lists for different types of queries because we wanted to update software queries quickly. Now that there is no software queries, we are fine with a single list. Signed-off-by: Chia-I Wu <[email protected]>
* ilo: replace software queries by hardware onesChia-I Wu2014-09-211-45/+39
| | | | | | | | Read PIPE_QUERY_PRIMITIVES_GENERATED and PIPE_QUERY_PRIMITIVES_EMITTED from hardware registers. Because all queries now have a bo, remove unnecessary checks for q->bo. Signed-off-by: Chia-I Wu <[email protected]>
* ilo: add ilo_3d_pipeline_emit_query()Chia-I Wu2014-09-211-48/+7
| | | | | | | | | | It replaces ilo_3d_pipeline_emit_write_timestamp(), ilo_3d_pipeline_emit_write_depth_count(), and ilo_3d_pipeline_emit_write_statistics(). Signed-off-by: Chia-I Wu <[email protected]>
* ilo: rework query supportChia-I Wu2014-09-211-260/+237
| | | | | | | This fixes some corner cases, but more importantly, the new code should be easier to reason about. Signed-off-by: Chia-I Wu <[email protected]>
* ilo: clarify cp owning/releasingChia-I Wu2014-09-211-0/+8
| | | | | | | Make it own()'s responsibility to make room for release() and itself. To be able to do that, allow ilo_cp_submit() in own(). Signed-off-by: Chia-I Wu <[email protected]>
* ilo: add a helper for RECTLIST blitterChia-I Wu2014-09-201-1/+40
| | | | Add ilo_3d_draw_rectlist() for use by RECTLIST blitter.
* ilo: add a new struct for context statesChia-I Wu2014-09-201-17/+18
| | | | | | | | | | Move pipe states in ilo_context to the new ilo_state_vector. The motivation is that ilo_context consists of several loosely related things. When we need an ilo_context somewhere, we usually need only one or two of the things in it. This change makes ilo_state_vector one such thing. An immediate result is that we no longer need ilo_context in 3D pipelines, something we have planned for since early days.
* ilo: rename ILO_DEBUG=3dChia-I Wu2014-09-191-3/+0
| | | | | | It has been a bad name since we added the builder. Rename it to ILO_DEBUG=batch to match i965, and call ilo_builder_decode() from ilo_cp_submit_internal().
* ilo: rename ilo_cp_flush()Chia-I Wu2014-09-191-4/+4
| | | | | | "Flush" is used for too many things already: pipe resource flush, pipe context flush, pipe transfer region flush, and hardware pipeline flush. Rename it to ilo_cp_submit(). As such, ILO_DEBUG=flush is renamed to ILO_DEBUG=submit.
* ilo: simplify ilo_cp_set_owner()Chia-I Wu2014-09-191-54/+47
| | | | | | The simplification allows us to get rid of ilo_cp_set_ring() and ilo_cp_implicit_flush(). The 3D query code is refactored for the simplification.
* ilo: use an accessor for dev->genChia-I Wu2014-09-121-3/+3
| | | | | It should enable us to do specialized builds by making the accessor return a constant.
* ilo: convert GPE GEN7 command functions to use ilo_builderChia-I Wu2014-09-091-0/+15
| | | | | | | | | | Make these changes ilo_cp_begin() -> ilo_builder_batch_pointer() ilo_cp_write() -> direct memory set ilo_cp_write_bo() -> ilo_builder_batch_reloc() and use this chance to drop the "_emit_" infix.
* ilo: use ilo_builder for kernels and STATE_BASE_ADDRESSChia-I Wu2014-09-091-67/+3
| | | | | | Remove instruction buffer management from ilo_3d and adapt ilo_shader_cache to upload kernels to ilo_builder. To be able to do that, we also let ilo_builder manage STATE_BASE_ADDRESS.
* ilo: make ilo_cp based on ilo_builderChia-I Wu2014-09-091-1/+1
| | | | | This makes ilo_cp use the builder to manage batch buffers, and use ilo_builder_decode() to replace ilo_3d_pipeline_dump().
* ilo: replace domains by reloc flagsChia-I Wu2014-08-261-1/+1
| | | | | It is simpler and is supported by the kernel. It cannot be used with libdrm_intel yet though.
* ilo: add support for PIPE_QUERY_PIPELINE_STATISTICSChia-I Wu2014-03-101-0/+88
|
* ilo: require hardware logical context supportChia-I Wu2014-03-101-4/+0
| | | | The code paths are not tested for a while, and have some known issues.
* ilo: move ring types to winsysChia-I Wu2014-03-101-2/+2
| | | | | It results in less code despite that i915_drm.h specifies the ring type as part of the execution flags.
* ilo: replace bo alloc flags by initial domainsChia-I Wu2014-03-101-1/+1
| | | | | | The only alloc flag is INTEL_ALLOC_FOR_RENDER, which can as well be expressed by specifying the initial write domain. The change makes it obvious that we failed to set INTEL_ALLOC_FOR_RENDER in several places.
* ilo: remove intel_bo_get_virtual()Chia-I Wu2014-03-101-6/+3
| | | | Make the map functions return the pointer directly.
* ilo: resolve Z/HiZ correctlyChia-I Wu2014-01-081-0/+3
| | | | | | When the depth buffer is to be read, perform a Depth Buffer Resolve if it has been rendered. When the depth buffer is to be rendered, perform a HiZ Buffer Resolve when the depth buffer is modified externally.
* ilo: add HiZ op support to the pipelinesChia-I Wu2014-01-081-1/+1
| | | | | | Add blitter functions to perform Depth Buffer Clear, Depth Buffer Resolve, and Hierarchical Depth Buffer Resolve. Those functions set ilo_blitter up and pass it to the pipelines to emit the commands.
* ilo: add ILO_DEBUG=flushChia-I Wu2013-08-201-2/+2
| | | | | | | | When specified, ilo will print a line similar to cp flushed for render with 949+888 DWords (22.4%) because of frame end for every ilo_cp_flush() call.
* ilo: add ILO_DEBUG=drawChia-I Wu2013-08-201-0/+16
| | | | It can print out pipe_draw_info and the dirty bits set, useful for debugging.
* ilo: skip 3DSTATE_INDEX_BUFFER when possibleChia-I Wu2013-07-141-7/+7
| | | | | | When only the offset to the index buffer is changed, we can skip the 3DSTATE_INDEX_BUFFER if we always use 0 for the offset, and add (offset / index_size) to Start Vertex Location in 3DPRIMITIVE.
* ilo: use shorter names for dirty flagsChia-I Wu2013-06-281-2/+2
| | | | | The new names match those of ilo_context's members respectively, and are shorter.
* ilo: avoid potential dangling pointer dereferenceChia-I Wu2013-06-281-0/+3
| | | | Set pipe_draw_info to NULL after draw_vbo().
* ilo: support PIPE_CAP_USER_INDEX_BUFFERSChia-I Wu2013-06-261-7/+14
| | | | | | | | We want to access the user buffer, if available, when primitive restart is enabled and the restart index/primitive type is not natively supported. And since we are handling index buffer uploads in the driver with this change, we can also work around misalignment of index buffer offsets.
* ilo: make pipe_draw_info a context stateChia-I Wu2013-06-261-14/+11
| | | | | | Rename ilo_finalize_states() to ilo_finalize_3d_states(), and bind pipe_draw_info to the context when it is called. This saves us from having to pass pipe_draw_info around in several places.
* ilo: honor render condition in blitterChia-I Wu2013-06-251-8/+7
| | | | | | Make pass_render_condition() available for blitter, and check for render condition in (and only in) clear(), clear_render_target(), and clear_depth_stencil().
* ilo: rework shader cacheChia-I Wu2013-06-191-10/+66
| | | | | | | | | The new code makes the shader cache manages all shaders and be able to upload all of them to a caller-provided bo as a whole. Previously, we uploaded only the bound shaders. When a different set of shaders is bound, we had to allocate a new kernel bo to upload if the current one is busy.
* gallium: add condition parameter to render_conditionRoland Scheidegger2013-06-181-1/+3
| | | | | | | | | | | | | 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]>
* ilo: mapping a resource may make some states dirtyChia-I Wu2013-06-131-7/+0
| | | | | | | | | When a resource is busy and is mapped with PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE, the underlying bo is replaced. We need to mark states affected by the resource dirty. With this change, we no longer have to emit vertex buffers and index buffer unconditionally.
* ilo: get rid of function tables in winsysChia-I Wu2013-06-121-9/+9
| | | | | We are moving toward making struct intel_bo alias drm_intel_bo. As a first step, we cannot have function tables.
* ilo: switch to ilo states for VF stageChia-I Wu2013-06-071-10/+6
| | | | | | | | | | Define and use struct ilo_vb_state; struct ilo_ve_state; struct ilo_ib_state; in ilo_context.
* ilo: Initialize need_flush in draw_vbo.Vinson Lee2013-05-231-1/+1
| | | | | | | | | need_flush was uninitialized if hw3d->new_batch was true. Fixes "Uninitialized scalar variable" defect reported by Coverity. Signed-off-by: Vinson Lee <[email protected]> Reviewed-by: Chia-I Wu <[email protected]>
* ilo: avoid unnecessary emission of SO statesChia-I Wu2013-05-221-7/+12
| | | | | | No need to emit 3DSTATE_SO_BUFFER and 3DSTATE_SO_DECL_LIST when SO is disabled. As the implicit flush done by the commands is also gone, emit an explicit flush.
* ilo: replace cp hooks by cp owner and flush callbackChia-I Wu2013-05-211-129/+147
| | | | | | | | | | | | | | | The problem with cp hooks is that when we switch from 3D ring to 2D ring, and when there are active queries, we will emit 3D commands to 2D ring because the new-batch hook is called. This commit introduces the idea of cp owner. When the cp is flushed, or when another owner takes place, the current owner is notified, giving it a chance to emit whatever commands there need to be. With this mechanism, we can resume queries when the 3D pipeline owns the cp, and pause queries when it loses the cp. Ring switch will just work. As we still need to know when the cp bo is reallocated, a flush callback is added.
* ilo: harware contexts are only for the render ringChia-I Wu2013-05-211-1/+1
| | | | | The hardware context should not be passed for bo execution when the ring is not the render ring. Rename hw_ctx to render_ctx for clarity.
* ilo: Add support for HW primitive restart.Courtney Goeltzenleuchter2013-05-101-0/+192
| | | | | | | | | Now tells Gallium that ilo supports primitive restart. Updated ilo_draw_vbo to be able to check that the indexed primitive being rendered can actually be supported in HW. If not, will break up into individual prims similar to what Mesa does. [olv: a minor fix after rebasing and formatting]
* ilo: use ilo_dev_info in GPE and 3D pipelineChia-I Wu2013-05-011-2/+2
| | | | | We need only dev->gen and dev->gt, but it makes sense to expose other information to the pipeline.
* ilo: add ilo_dev_info shared by the screen and contextsChia-I Wu2013-05-011-1/+1
| | | | | The struct is used to describe the device information, such as PCI ID, GEN, GT, and etc.
* ilo: add support for time/occlusion/primitive queriesChia-I Wu2013-04-261-0/+257
|