summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/freedreno
Commit message (Collapse)AuthorAgeFilesLines
* gallium: remove PIPE_SHADER_CAP_SCALAR_ISAMarek Olšák2019-10-101-2/+0
| | | | | | Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Christian Gmeiner <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* gallium: add PIPE_RESOURCE_FLAG_SINGLE_THREAD_USE to skip util_range lockMarek Olšák2019-10-072-3/+3
| | | | | | | | | u_upload_mgr sets it, so that util_range_add can skip the lock. The time spent in tc_transfer_flush_region decreases from 0.8% to 0.2% in torcs on radeonsi. Reviewed-by: Kenneth Graunke <[email protected]>
* freedreno/a3xx: Mostly fix min-vs-mag filtering decisions on non-mipmap tex.Eric Anholt2019-09-261-5/+12
| | | | | | | | | This is based on the fix I used for the same problem on V3D. In this case, it fixes all but the the dEQP-GLES2.functional.texture.filtering.2d.*_npot cases of dEQP-GLES2.functional.texture.filtering.2d.*'s failures. Acked-by: Rob Clark <[email protected]>
* freedreno/a6xx: Move instrlen and obj_start writes to fd6_emit_shaderKristian H. Kristensen2019-09-251-32/+44
| | | | | | Consolidate a few more generic shaders setup regs in fd6_emit_shader. Signed-off-by: Kristian H. Kristensen <[email protected]>
* freedreno/a6xx: Emit const and texture state for HS/DS/GSKristian H. Kristensen2019-09-254-8/+74
| | | | Signed-off-by: Kristian H. Kristensen <[email protected]>
* freedreno/ir3: Add HS/DS/GS to shader key and cacheKristian H. Kristensen2019-09-252-6/+31
| | | | Signed-off-by: Kristian H. Kristensen <[email protected]>
* freedreno/a6xx: Add generic program stateobj support for HS/DS/GSKristian H. Kristensen2019-09-254-19/+75
| | | | | | | This add generic stage state setup for HS/DS/GS to the program state object. Signed-off-by: Kristian H. Kristensen <[email protected]>
* freedreno: Move fs functions after geometry pipeline stagesKristian H. Kristensen2019-09-251-10/+10
| | | | | | Let's try to always order the stages in the pipeline order. Signed-off-by: Kristian H. Kristensen <[email protected]>
* freedreno: Add state binding functions for HS/DS/GSKristian H. Kristensen2019-09-252-1/+31
| | | | Signed-off-by: Kristian H. Kristensen <[email protected]>
* freedreno: Rename vp and fp to vs and fs in fd_program_stateobjKristian H. Kristensen2019-09-2516-104/+104
| | | | | | | | We're using vs and fs now, and adding hs, ds and gs soon. It's confusing enough that we have both DS/TCS and HS/TES. At least for VS and FS there doesn't have to be multiple names. Signed-off-by: Kristian H. Kristensen <[email protected]>
* freedreno/a6xx: Factor out const state setupKristian H. Kristensen2019-09-251-27/+20
| | | | | | We'll be sharing this logic for new shader stages soon. Signed-off-by: Kristian H. Kristensen <[email protected]>
* freedreno/a6xx: do streamout only in binning passRob Clark2019-09-232-13/+16
| | | | | | | | | | Use VPC_SO_OVERRIDE to control whether we do streamout in binning or draw pass. Normally we want to do streamout in binning pass, except when there is a single tile and binning passed is skipped. Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]>
* freedreno/a6xx: fix binning pass vs. xfbRob Clark2019-09-231-3/+7
| | | | | | | | | | We could bit doing streamout from binning pass. In this case we want to use the full VS which doesn't have (potentially streamed out) varyings stripped out. Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]>
* freedreno/a6xx: un-open-code PC_PRIMITIVE_CNTL_1.PSIZERob Clark2019-09-231-1/+1
| | | | | | Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]>
* util/u_queue: track job size and limit the size of queue growthTimothy Arceri2019-09-191-1/+1
| | | | | | | | | | | | | | | | | | | | | When both UTIL_QUEUE_INIT_RESIZE_IF_FULL and UTIL_QUEUE_INIT_USE_MINIMUM_PRIORITY are set, we can get into a situation where the queue never executes and grows to a huge size due to all other threads being busy. This is the case with the shader cache when attempting to compile a huge number of shaders up front. If all threads are busy compiling shaders the cache queues memory use can climb into the many GBs very fast. The use of these two flags with the shader cache is intended to allow shaders compiled at runtime to be compiled as fast as possible. To avoid huge memory use but still allow the queue to perform optimally in the run time compilation case, we now add the ability to track memory consumed by the jobs in the queue and limit it to a hardcoded 256MB which should be more than enough. Reviewed-by: Marek Olšák <[email protected]>
* freedreno/a6xx: Write multiple regs for SP_VS_OUT_REG and SP_VS_VPC_DST_REGKristian H. Kristensen2019-09-181-6/+5
| | | | | | | Compute the number of writes up front. Signed-off-by: Kristian H. Kristensen <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* freedreno/a6xx: Share shader state constructor and destructorKristian H. Kristensen2019-09-186-190/+76
| | | | | | | Also, swap vs and fs constructor or so fs comes first. Signed-off-by: Kristian H. Kristensen <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* freedreno/a6xx: Track location of gl_Position out as we link itKristian H. Kristensen2019-09-181-3/+5
| | | | | | | | | | | | | | When using xfb and rasterizing, the fragment shader may have fewer inputs than the vertex shader outputs. We can't rely on gl_Position to be placed at fs->total_in, but have to instead remember where we add it in the link map and use that location. Fixes 100+ tesselation dEQPs under dEQP-GLES31.functional.tessellation.primitive_discard.* dEQP-GLES31.functional.tessellation.user_defined_io.* Reviewed-by: Eric Anholt <[email protected]>
* freedreno/a6xx: pre-calculate userconst stateobj sizeRob Clark2019-09-124-3/+44
| | | | | | | | The AnTuTu "garden" benchmark overflows the fixed size constbuffer stateobject, so lets be more clever and calculate (a potentially slightly pessimistic) actual size. Signed-off-by: Rob Clark <[email protected]>
* freedreno: fix compiler warningRob Clark2019-09-121-1/+1
| | | | | | | fd6_blitter.c:724:31: warning: passing argument 1 of ‘fd_resource_level_linear’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* freedreno/a6xx: fix 3d tex layoutRob Clark2019-09-101-3/+4
| | | | | | | Fixes dEQP-GLES3.functional.texture.specification.texstorage3d.size.3d_2x2x2_2_levels Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]>
* freedreno/a6xx: don't tile things that are too smallRob Clark2019-09-102-5/+11
| | | | | | | | | | | If the lowest (largest) mipmap level is too small to tile, then don't bother pretending. Note that this requires initializing pipe->screen before fd_resource_level_linear() is called. Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]>
* freedreno/a6xx: Implement primitive count queries on GPUKristian H. Kristensen2019-09-0613-18/+123
| | | | | | | | | | The driver can't determine PIPE_QUERY_PRIMITIVES_GENERATED or PIPE_QUERY_PRIMITIVES_EMITTED once we support geometry or tessellation, since these stages add primitives at runtime. Use the WRITE_PRIMITIVE_COUNTS event to write back the primitive counts and implement a hw query for this. Reviewed-by: Rob Clark <[email protected]>
* freedreno/a6xx: Let the GPU track streamout offsetsKristian H. Kristensen2019-09-064-19/+36
| | | | | | | | | | The GPU writes out streamout offsets as it goes to the FLUSH_BASE pointer. We use that value with CP_MEM_TO_REG when appending to the stream so that we don't have to track the offsets with the CPU in the driver. This ensures that streamout continues to work once we enable geometry and tessellation shader stages that add geometry. Reviewed-by: Rob Clark <[email protected]>
* freedreno/a2xx: formats updateJonathan Marek2019-09-064-247/+103
| | | | | | | | | | | | | | For render formats, update fd2_pipe2color to only work with HW supported render formats, and remove the format whitelist is_format_supported. This patch enables float render formats (which work). For vertex/texture formats, use a generic function which translates using the bitsize of the channels. Since we fake support for some vertex formats, check for these in is_format_supported to avoid enabling them as sampler formats. Signed-off-by: Jonathan Marek <[email protected]> Reviewed-by: Rob Clark <[email protected]>
* freedreno/a2xx: fix depth gmem restoreJonathan Marek2019-09-061-15/+12
| | | | | | | | | | | | | | Use fd_gmem_restore_format() to avoid trying to use unsupported Z24S8/Z16 render formats for gmem restore. Also apply this change to gmem2mem so it doesn't depend on fd2_pipe2color working with depth formats. gmem2mem/mem2gmem also doesn't need to use the swap/swizzle, since dst/src formats are the same. Signed-off-by: Jonathan Marek <[email protected]> Reviewed-by: Rob Clark <[email protected]>
* freedreno/a2xx: implement polygon offsetJonathan Marek2019-09-061-0/+12
| | | | | | | | | Fixes failures in the following deqp tests: dEQP-GLES2.functional.polygon_offset.* Signed-off-by: Jonathan Marek <[email protected]> Reviewed-by: Rob Clark <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* freedreno/a2xx: fix SRC_ALPHA_SATURATE for alpha blend functionJonathan Marek2019-09-061-1/+6
| | | | | | | | | Fixes failures in the following deqp tests: dEQP-GLES2.functional.fragment_ops.*src_alpha_saturate* Signed-off-by: Jonathan Marek <[email protected]> Reviewed-by: Rob Clark <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* freedreno/a2xx: ir2: update register state in scalar insertJonathan Marek2019-09-061-0/+6
| | | | | Signed-off-by: Jonathan Marek <[email protected]> Reviewed-by: Rob Clark <[email protected]>
* freedreno/a2xx: ir2: fix incorrect instruction reorderingJonathan Marek2019-09-061-0/+16
| | | | | Signed-off-by: Jonathan Marek <[email protected]> Reviewed-by: Rob Clark <[email protected]>
* freedreno/a2xx: ir2: check opcode on the right instruction in export cpJonathan Marek2019-09-061-1/+1
| | | | | | Signed-off-by: Jonathan Marek <[email protected]> Reviewed-by: Rob Clark <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* freedreno/a2xx: ir2: fix saturate in cpJonathan Marek2019-09-061-0/+4
| | | | | | Signed-off-by: Jonathan Marek <[email protected]> Reviewed-by: Rob Clark <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* freedreno/a2xx: ir2: set lower_fdphJonathan Marek2019-09-061-0/+1
| | | | | | | | The fdph opcode is not supported. Signed-off-by: Jonathan Marek <[email protected]> Reviewed-by: Rob Clark <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* freedreno/a2xx: ir2: remove pointcoord y invertJonathan Marek2019-09-061-4/+2
| | | | | | | | | Fixes the following deqp test: dEQP-GLES2.functional.shaders.builtin_variable.pointcoord Signed-off-by: Jonathan Marek <[email protected]> Reviewed-by: Rob Clark <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* freedreno/a2xx: ir2: fix lowering of instructions after float loweringJonathan Marek2019-09-061-3/+2
| | | | | | | | | | | Some instructions generated by int/bool float lowering need to be lowered by opt_algebraic. Fixes: 43dbd7d6 Signed-off-by: Jonathan Marek <[email protected]> Reviewed-by: Rob Clark <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* nir: allow specifying filter callback in lower_alu_to_scalarVasily Khoruzhick2019-09-061-11/+24
| | | | | | | | | | | | | Set of opcodes doesn't have enough flexibility in certain cases. E.g. Utgard PP has vector conditional select operation, but condition is always scalar. Lowering all the vector selects to scalar increases instruction number, so we need a way to filter only those ops that can't be handled in hardware. Reviewed-by: Qiang Yu <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Signed-off-by: Vasily Khoruzhick <[email protected]>
* freedreno: Fix the type of single-component scaled vertex attrs.Eric Anholt2019-09-034-12/+12
| | | | | | | | | | This looks like clear copy-and-pasteos, and fixes: dEQP-GLES2.functional.draw.random.40 (on A307 and A630, both tested in the new CI farm) Reviewed-by: Rob Clark <[email protected]>
* freedreno/a3xx: fix sysmem <-> gmem tiles transferKhaled Emara2019-08-302-2/+3
| | | | | | | Tiling mode was missing from fd3_emit_gmem_restore_tex(). emit_gmem2mem_surf() used LINEAR exclusiveley. Reviewed-by: Rob Clark <[email protected]>
* freedreno/a3xx: fix texture tiling parametersKhaled Emara2019-08-301-10/+21
| | | | | | | | * Fix 2D/2DArray/3D tiling parameters: There is a bottom threshold for width and height. * Renable tiling for Cubemap, after setting the right parameters. Reviewed-by: Rob Clark <[email protected]>
* freedreno/a6xx: Fix non-mipmap filtering selection.Eric Anholt2019-08-281-6/+6
| | | | | | | | | | We were clamping the LOD to force non-mipmap filtering, but that means that the HW doesn't get to select between the min and mag filters. Setting MIPFILTER_LINEAR_FAR appears to force non-mipmap filtering. Fixes all failures in dEQP-GLES2.functional.texture.filtering.2d.* Reviewed-by: Rob Clark <[email protected]>
* freedreno/a6xx: move SSBO/image consts to IBO stateobjRob Clark2019-08-131-13/+10
| | | | Signed-off-by: Rob Clark <[email protected]>
* freedreno/a6xx: move VS driverparams to it's own stateobjRob Clark2019-08-132-5/+15
| | | | | | | | | If driver-params are required, we really should emit it on every draw for correctness. And if not required, we should emit a DISABLE so that un-applied state updates from previous draws don't corrupt the const state. Signed-off-by: Rob Clark <[email protected]>
* freedreno/ir3+a6xx: same VBO state for draw/binningRob Clark2019-08-133-5/+9
| | | | | | Worth ~+20% on gl_driver2 Signed-off-by: Rob Clark <[email protected]>
* freedreno/a6xx: add fd_emit_take_group()Rob Clark2019-08-132-19/+17
| | | | | | | | | Which takes ownership of the stateobj. Useful for streaming state- objs, to avoid an extra ref/unref Worth ~5% at gl_driver2 Signed-off-by: Rob Clark <[email protected]>
* freedreno/ir3: track # of driver paramsRob Clark2019-08-131-1/+3
| | | | | | To avoid emitting unneeded const state. Signed-off-by: Rob Clark <[email protected]>
* freedreno/a6xx: move immediates to program stateobjRob Clark2019-08-132-6/+9
| | | | Signed-off-by: Rob Clark <[email protected]>
* freedreno/a6xx: stop using ir3_emit_{vs,fs}_consts()Rob Clark2019-08-133-17/+53
| | | | | | | Should be no functional change. Next step is to re-arrange various const state into different stateobjs. Signed-off-by: Rob Clark <[email protected]>
* freedreno/ir3: push ctx further up call chainRob Clark2019-08-131-21/+22
| | | | | | Move more of the code to deal just w/ screen, without requiring ctx. Signed-off-by: Rob Clark <[email protected]>
* freedreno/ir3: move ring_wfi() further up call chainRob Clark2019-08-131-10/+8
| | | | | | | | | | Hoist them out of code-paths that will eventually be called directly for various a6xx+ const related stateobjs. This ends up duplicating one constlen check in ir3_emit_vs_consts(), to avoid what could otherwise be an unnecessary WFI on older gens. Signed-off-by: Rob Clark <[email protected]>
* freedreno/all: move more emit helpers to screenRob Clark2019-08-139-24/+21
| | | | | | | framebuffer_barrier() still depends on the ctx, but the rest can move to screen. Signed-off-by: Rob Clark <[email protected]>