summaryrefslogtreecommitdiffstats
path: root/src/freedreno
Commit message (Collapse)AuthorAgeFilesLines
* turnip: Add tu6_control struct.Hyunjun Ko2020-03-122-10/+31
| | | | | | | | | | Follow the way that freedreno is doing so that we could see the whole layout of the scratch buffer. Signed-off-by: Hyunjun Ko <[email protected]> Reviewed-by: Jonathan Marek <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3942> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3942>
* turnip: Enable VK_EXT_transform_feedbackHyunjun Ko2020-03-122-1/+25
| | | | | | Signed-off-by: Hyunjun Ko <[email protected]> Reviewed-by: Jonathan Marek <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3942>
* turnip: Implement an empty function vkCmdDrawIndirectByteCountEXTHyunjun Ko2020-03-121-0/+28
| | | | | | | | TODO. We should implement this since indirect draw is enabled. Signed-off-by: Hyunjun Ko <[email protected]> Reviewed-by: Jonathan Marek <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3942>
* turnip: Implement stream-out emit and vkApis for transform feedbackHyunjun Ko2020-03-123-33/+148
| | | | | | | | | | | | | | | | | 1. Implement vkCmdBindTransformFeedbackBuffersEXT, vkCmdBeginTransformFeedbackEXT and vkCmdEndTransformFeedbackEXT. - Not handling counter buffers yet. 2. Implement streamout emit function, mostly taken from fd6_emit.c v2. Replace emit_pkt4 funcs with emit_regs. v3. Don't copy the state of stream-output from tu_pipeline. v4. Set zero to VPC_SO_CNTL/VPC_SO_BUF_CNTL in tu6_init_hw. Signed-off-by: Hyunjun Ko <[email protected]> Reviewed-by: Jonathan Marek <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3942>
* turnip: Setup stream-output when linking programHyunjun Ko2020-03-121-11/+143
| | | | | | | | | | | | | | | | Mostly taken from fd6_program.c. v2. Note that it forces to use full VS instead of binning pass VS if there's stream output as the binning pass VS will have outputs on other than position/psize stripped out, which is the same as freedreno. v3. fix indentation. v4. Use register index instead of location when setup streamout. Signed-off-by: Hyunjun Ko <[email protected]> Reviewed-by: Jonathan Marek <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3942>
* turnip: Define structs for transform feedbackHyunjun Ko2020-03-121-0/+22
| | | | | | | | | | | | | | Define new structures for streamout buffers and state. Most members of the state struct are taken from freedreno driver. v2. Use IR3_MAX_SO_* and avoid using magic values. v3. Remove the state of stream-output in tu_cmd_state and use one in tu_pipeline and split out reset and enabled fields. Signed-off-by: Hyunjun Ko <[email protected]> Reviewed-by: Jonathan Marek <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3942>
* turnip: Gather information for transform feedbackHyunjun Ko2020-03-122-1/+55
| | | | | | | | | | | | | | | | | | | | | | - Add one member to the existed ir3_stream_output so that we could assign location information from nir_xfb_info, rather than defining new struct. - Redefine maximum of so buffers, streams and outputs, which will be used for turnip. - Also enable caps for transform feedback for spirv_to_nir. v2. Remove redefined maximums and use IR3_MAX_SO_* and add IR3_MAX_SO_STREAMS. v3. Remove the newly added location field so that we could keep aligned with 32 bytes. Instead we create an array mapping between the location and consecutive index, which is GL driver is doing. Signed-off-by: Hyunjun Ko <[email protected]> Reviewed-by: Jonathan Marek <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3942>
* freedreno: Add ir3_cf.c and ir3_delay.c to Makefile.sourcesJohn Stultz2020-03-111-0/+2
| | | | | | | | | This patch adds missing ir3_cf.c and ir3_delay.c files to the Makefile.sources file to address build issues seen when trying to build mesa/master on AOSP Signed-off-by: John Stultz <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4141>
* freedreno/fdperf: set localeRob Clark2020-03-101-0/+3
| | | | | | | | | Set local to get numbers printed w/ commas.. much easier to read that way. Signed-off-by: Rob Clark <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4119> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4119>
* freedreno/computerator: add performance counter supportRob Clark2020-03-104-1/+236
| | | | | Signed-off-by: Rob Clark <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4119>
* freedreno/ir3: try to avoid syncsRob Clark2020-03-101-1/+55
| | | | | | | | | | Update postsched to be better aware of where costly (ss) syncs would result. Sometimes it is better to allow a nop or two, to avoid a sync quickly after an SFU. Signed-off-by: Rob Clark <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4071> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4071>
* freedreno/ir3: round-robin RARob Clark2020-03-101-4/+163
| | | | | | | | | | | | | | | | In the second (scalar pass) use the information about # of registers used in the first pass as the target max, and round-robin within that range. This generally gives the post-RA sched pass more opportunities to re-order instructions to remove nop's. Also, we can be a bit clever when assigning dest registers for SFU instructions, by picking the register used for it's src (if available and already assigned). This avoids some (ss) syncs caused by write after read hazards. (Ie. the SFU instruction will read it's own src before writing dest.) Signed-off-by: Rob Clark <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4071>
* freedreno/ir3: track register usage in first RA passRob Clark2020-03-101-0/+41
| | | | | | | | We'll use the feedback from the first pass to select a target register usage in the second pass. Signed-off-by: Rob Clark <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4071>
* freedreno/ir3: fix has_latency_to_hideRob Clark2020-03-101-1/+8
| | | | | | | | Also count tex-prefetch instructions. And only let the no-latency rule kick in for frag shaders. Signed-off-by: Rob Clark <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4071>
* freedreno/ir3: split out has_latency_to_hide()Rob Clark2020-03-102-25/+25
| | | | | Signed-off-by: Rob Clark <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4071>
* freedreno/ir3: add simplified stall estimationRob Clark2020-03-102-1/+14
| | | | | | | | | Doesn't take into account stalls that result from a register written in a different block, etc. But this should be more useful than just using number of (ss)'s by trying to estimate how costly a given sync is. Signed-off-by: Rob Clark <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4071>
* freedreno/ir3: remove extra nops inserted in schedulerRob Clark2020-03-102-25/+0
| | | | | | | | | They were inserting a nop between back to back SFU instrucions. But that doesn't actually appear to be required. And they get stripped out later anyways before legalize. Signed-off-by: Rob Clark <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4071>
* freedreno/computerator: add hrsq/hlog2/hexp2Rob Clark2020-03-102-0/+9
| | | | | Signed-off-by: Rob Clark <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4071>
* freedreno/ir3: also lower lowp frag outputsRob Clark2020-03-101-1/+2
| | | | | Signed-off-by: Rob Clark <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4071>
* freedreno/ir3: Don't fold conversions into signKristian H. Kristensen2020-03-091-0/+1
| | | | | | Not supported. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3929>
* turnip: fix tile->slot calculationJonathan Marek2020-03-051-1/+5
| | | | | | | | | Fixes HW binning cases when the horizontal number of tiles isn't divisible by the horizontal number of pipes (only happens with more than 32 tiles). Signed-off-by: Jonathan Marek <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3142> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3142>
* turnip: improve binning pipe layout configJonathan Marek2020-03-051-15/+10
| | | | | | | | | | | The old code looks the same as GL driver, but we get things like pipe_count = {32, 1}, which seems bad. This uses similar logic as for tiles which produces a balanced pipe_count width/height. Signed-off-by: Jonathan Marek <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3142>
* turnip: support indirect drawHyunjun Ko2020-03-041-6/+49
| | | | | Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3976> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3976>
* turnip: Execute main cs for secondary command buffersBrian Ho2020-03-031-10/+25
| | | | | | | | | | | | | Previously, we only added the secondary command buffer's draw and draw epilogue command streams to the primary command buffer on vkCmdExecuteCommands. However, we also need to merge the primary cs for non-draw operations like vkCmdCopyBuffer and vkCmdBeginQuery. Fixes dEQP-VK.memory.pipeline_barrier.host_write_transfer_src.* and various other tests in dEQP-VK.api.command_buffers.*. Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3988> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3988>
* turnip: Promote tu_cs_get_size/is_empty to headerBrian Ho2020-03-032-20/+20
| | | | | | These will be used in tu_cmd_buffer.c. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3988>
* freedreno/ir3: add assertRob Clark2020-02-281-0/+1
| | | | | | | | Catch problems earlier when inputs are not setup correctly. Signed-off-by: Rob Clark <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3989> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3989>
* freedreno/ir3: fix assert with getinfoRob Clark2020-02-281-2/+3
| | | | | | | | Fixes: dEQP-VK.glsl.texture_functions.query.texturesamples.sampler2dms_fixed_vertex Signed-off-by: Rob Clark <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3989>
* freedreno/ir3: don't precolor unassigned inputsRob Clark2020-02-281-0/+3
| | | | | | | | Fixes crash seen in: dEQP-VK.glsl.conversions.matrix_to_matrix.mat4_to_mat3x4_vertex Signed-off-by: Rob Clark <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3989>
* freedreno/ir3: fix crash with samgq workaroundRob Clark2020-02-281-1/+2
| | | | | | | | | Need to list_delinit() before we clone the instruction to split it into individual samgpN instructions, otherwise we get list corruption. Tested-by: Eduardo Lima Mitev <[email protected]> Signed-off-by: Rob Clark <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3989>
* freedreno/ir3: update SFU delayRob Clark2020-02-284-13/+19
| | | | | | | | | | 1) emperically, 10 seems like a more accurate # than 4 2) push "soft" delay handling into ir3_delayslots(), as we should also be using it to calculate the costs that the schedulers use Signed-off-by: Rob Clark <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3989>
* freedreno/ir3: track half-precision live valuesRob Clark2020-02-283-26/+43
| | | | | | | | | In schedule live value tracking, differentiate between half vs full precision. Half-precision live values are less costly than full precision. Signed-off-by: Rob Clark <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3989>
* freedreno/ir3: don't hide latency when there is none to hideRob Clark2020-02-281-5/+52
| | | | | | | | | Current scheduler thresholds try to ensure there are warps available to switch to when hiding texture fetch latency. But if there is none to hide, we should allow scheduler to use more registers to reduce nops. Signed-off-by: Rob Clark <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3989>
* freedreno/ir3: rewrite regmask to better support a6xx+Rob Clark2020-02-281-23/+53
| | | | | | | | | | | To avoid spurious sync flags, we want to, for a6xx+, operate in terms of half-regs, with a full precision register testing the corresponding two half-regs that it conflicts with. And while we are at it, stop open-coding BITSET Signed-off-by: Rob Clark <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3989>
* freedreno/ir3: remove regmask_set_if_not()Rob Clark2020-02-281-21/+0
| | | | | | | No longer used. Signed-off-by: Rob Clark <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3989>
* freedreno/ir3: remove from_tgsiRob Clark2020-02-281-3/+0
| | | | | | | | No longer used, other than in ir3 cmdline compiler, where it can be replaced with a local variable. Signed-off-by: Rob Clark <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3989>
* turnip: increase array sizes in tu_descriptor_mapJonathan Marek2020-02-281-4/+4
| | | | | | | | | | Pending the descriptor rework, this allows running the follow test: dEQP-VK.renderpass.suballocation.attachment_sparse_filling.input_attachment_127 Signed-off-by: Jonathan Marek <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3979> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3979>
* turnip: fall back to sysmem when attachments don't fit into gmemJonathan Marek2020-02-282-1/+10
| | | | | | Signed-off-by: Jonathan Marek <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3979>
* turnip: remove unnecessary fb size checkJonathan Marek2020-02-281-6/+2
| | | | | | | | Framebuffer with 0 width or height is not valid. Signed-off-by: Jonathan Marek <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3979>
* turnip: don't hardcode gmem base for input attachmentJonathan Marek2020-02-284-1/+19
| | | | | | | | | Newer a6xx no longer has programmable GMEM base, so we can't rely on the kernel driver setting it to 0x100000 (GMEM base is 0 on such GPUs). Signed-off-by: Jonathan Marek <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3979>
* turnip: fix srgb MRTJonathan Marek2020-02-281-2/+2
| | | | | | | | | | | Register packing macros makes this only set the first bit. Set to whole dword to fix srgb for color attachments >0. Fixes: 59f29fc8 ("turnip: Convert the rest of tu_cmd_buffer.c over to the new pack macros.") Signed-off-by: Jonathan Marek <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3979>
* turnip: fix hw binning + render_area offset interactionJonathan Marek2020-02-281-4/+6
| | | | | | Signed-off-by: Jonathan Marek <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3979>
* turnip: minify image_view extentJonathan Marek2020-02-281-6/+7
| | | | | | Signed-off-by: Jonathan Marek <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3979>
* turnip: remove unecessary MRT_CONTROL fillJonathan Marek2020-02-281-6/+0
| | | | | | | | Hardware won't use MRT_CONTROL after mrt_count Signed-off-by: Jonathan Marek <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3979>
* turnip: move some constant state to tu6_init_hwJonathan Marek2020-02-282-16/+5
| | | | | | | | Also remove duplicates. Signed-off-by: Jonathan Marek <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3979>
* turnip: check the right alignment requirement on shader iovaJonathan Marek2020-02-281-1/+5
| | | | | | | | | I had some trouble because I assumed this was right, tested that the alignment requirement is actually 16. Signed-off-by: Jonathan Marek <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3979>
* turnip: add r5g5b5a1_unorm/b5g5r5a1_unorm formatsJonathan Marek2020-02-282-3/+11
| | | | | | | | | | r5g5b5a1/b5g5r5a1 tiled/ubwc is the same as a1r5g5b5 (in memory), but linear is read as 1_5_5_5 and written with 5_5_5_1 with swap. Signed-off-by: Jonathan Marek <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3806> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3806>
* turnip: rework format table to support r5g5b5a1_unorm/b5g5r5a1_unormJonathan Marek2020-02-287-114/+138
| | | | | | | | | | | These formats are an exception that can't be modeled in the current format table. Switch to a table with only a single a6xx_format per vk format, and deal with the exceptions separately (currently the only exception is 10_10_10_2_UNORM which has a different color format). Signed-off-by: Jonathan Marek <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3806>
* nir: Drop nir_tex_instr::texture_array_sizeJason Ekstrand2020-02-261-2/+0
| | | | | | | | | | It's set by lots of things and we spend a lot of time maintaining it but no one actually uses the value for anything useful. Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3940> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3940>
* freedreno/computerator: Fix defined-but-not-used warnings from lex/yacc.Eric Anholt2020-02-262-0/+4
| | | | | Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3954> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3954>
* turnip: Fix compiler warning about casting a nondispatchable handle.Eric Anholt2020-02-261-1/+1
| | | | | | Fixes: 1c5d84fcae71 ("turnip: hook up cmdbuffer event set/wait") Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3916> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3916>