mesa.git
5 years agoiris: Destroy transfer helper on screen teardown
Kenneth Graunke [Wed, 28 Nov 2018 23:10:07 +0000 (15:10 -0800)]
iris: Destroy transfer helper on screen teardown

Plugs a 16 byte leak

5 years agoiris: Fix failed to compile TCS message
Kenneth Graunke [Wed, 28 Nov 2018 23:06:00 +0000 (15:06 -0800)]
iris: Fix failed to compile TCS message

5 years agoiris: Rework tiling/modifiers handling
Kenneth Graunke [Wed, 28 Nov 2018 10:30:42 +0000 (02:30 -0800)]
iris: Rework tiling/modifiers handling

We were being very picky about things being Y tiled.  But, not
everything can be - for example, > 16382 surfaces on SKL GT1-3
have to fall back to linear.

Instead, give ISL options and let it pick.

5 years agoiris: fix conditional compute, don't stomp predicate for pipelined queries
Kenneth Graunke [Tue, 27 Nov 2018 23:30:16 +0000 (15:30 -0800)]
iris: fix conditional compute, don't stomp predicate for pipelined queries

5 years agoiris: check query first
Kenneth Graunke [Tue, 27 Nov 2018 22:20:48 +0000 (14:20 -0800)]
iris: check query first

this lets us avoid the predicate bit in more cases, which is nice

5 years agoiris: for BLORP, only use the predicate enable bit when USE_BIT
Kenneth Graunke [Tue, 27 Nov 2018 04:55:59 +0000 (20:55 -0800)]
iris: for BLORP, only use the predicate enable bit when USE_BIT

5 years agoiris: add conditional render support
Dave Airlie [Mon, 26 Nov 2018 23:03:16 +0000 (09:03 +1000)]
iris: add conditional render support

5 years agoiris: drop key_size_for_cache
Kenneth Graunke [Tue, 27 Nov 2018 23:35:48 +0000 (15:35 -0800)]
iris: drop key_size_for_cache

dead since my program cache API rework.  we could still use it for one
function, but it's so trivial to pass the size, that it's probably not
worth the extra code

5 years agoiris: iris add load register reg32/64
Dave Airlie [Fri, 9 Nov 2018 02:13:17 +0000 (12:13 +1000)]
iris: iris add load register reg32/64

These will be needed for broadwell and conditional render

5 years agoiris: execute compute related query on compute batch.
Dave Airlie [Tue, 27 Nov 2018 03:42:58 +0000 (13:42 +1000)]
iris: execute compute related query on compute batch.

This only happens for the compute invocations query.

5 years agoiris: fix cube texture view
Dave Airlie [Tue, 27 Nov 2018 03:02:03 +0000 (13:02 +1000)]
iris: fix cube texture view

5 years agoiris: fix some SO overflow query bugs and tidy the code a bit
Kenneth Graunke [Mon, 26 Nov 2018 22:59:17 +0000 (14:59 -0800)]
iris: fix some SO overflow query bugs and tidy the code a bit

5 years agoiris: add initial transform feedback overflow query paths (V3)
Dave Airlie [Mon, 26 Nov 2018 05:22:48 +0000 (15:22 +1000)]
iris: add initial transform feedback overflow query paths (V3)

v2: fix cpu overflow calc
v3: use a struct

5 years agoiris: actually flush for storage images
Kenneth Graunke [Mon, 26 Nov 2018 03:03:43 +0000 (19:03 -0800)]
iris: actually flush for storage images

5 years agoiris: add an extra BT assert from Chris Wilson
Kenneth Graunke [Sat, 24 Nov 2018 10:55:40 +0000 (02:55 -0800)]
iris: add an extra BT assert from Chris Wilson

5 years agoiris: add assertions about binding table starts
Kenneth Graunke [Sat, 24 Nov 2018 03:12:36 +0000 (19:12 -0800)]
iris: add assertions about binding table starts

5 years agoiris: drop pull constant binding table entry
Kenneth Graunke [Fri, 23 Nov 2018 21:01:47 +0000 (13:01 -0800)]
iris: drop pull constant binding table entry

nothing uses this

5 years agoiris: Use program's num textures not the state tracker's bound
Kenneth Graunke [Fri, 23 Nov 2018 19:47:55 +0000 (11:47 -0800)]
iris: Use program's num textures not the state tracker's bound

the state tracker might bind more textures than the program is using.

5 years agoiris: Enable precompiles
Kenneth Graunke [Thu, 22 Nov 2018 10:55:27 +0000 (02:55 -0800)]
iris: Enable precompiles

5 years agoiris: rework program cache interface
Kenneth Graunke [Thu, 22 Nov 2018 02:15:28 +0000 (18:15 -0800)]
iris: rework program cache interface

This exposes iris_upload_shader() without having to bind it, which will
be useful for precompiles.  It also lets us examine the old programs and
flag dirty bits at a higher level, rather than cramming all that
knowledge into the cache layer.

5 years agoiris: Use wrappers for create_xs_state rather than a switch statement
Kenneth Graunke [Thu, 22 Nov 2018 01:02:02 +0000 (17:02 -0800)]
iris: Use wrappers for create_xs_state rather than a switch statement

5 years agoiris: fix comment location
Kenneth Graunke [Thu, 22 Nov 2018 00:53:09 +0000 (16:53 -0800)]
iris: fix comment location

5 years agoiris: export iris_upload_shader
Kenneth Graunke [Thu, 22 Nov 2018 00:45:14 +0000 (16:45 -0800)]
iris: export iris_upload_shader

5 years agoiris: fix prototype warning
Kenneth Graunke [Thu, 22 Nov 2018 00:45:35 +0000 (16:45 -0800)]
iris: fix prototype warning

5 years agoiris: Re-pin even if nothing is dirty
Kenneth Graunke [Wed, 21 Nov 2018 19:54:37 +0000 (11:54 -0800)]
iris: Re-pin even if nothing is dirty

5 years agoiris: Flush for history at various moments
Kenneth Graunke [Wed, 21 Nov 2018 09:03:48 +0000 (01:03 -0800)]
iris: Flush for history at various moments

When we blit, transfer, or copy_resource to a buffer, we need to flush
to ensure any stale data for that buffer is invalidated in the caches.

bind_history will inform us which caches need to be flushed.

Also, for any push constant buffers, we need to flag those dirty so
that we re-emit 3DSTATE_CONSTANT_*, causing the data to be re-pushed.

5 years agoiris: add iris_flush_and_dirty_for_history
Kenneth Graunke [Wed, 21 Nov 2018 08:52:25 +0000 (00:52 -0800)]
iris: add iris_flush_and_dirty_for_history

5 years agoiris: Track a binding history for buffer resources
Kenneth Graunke [Wed, 21 Nov 2018 08:38:49 +0000 (00:38 -0800)]
iris: Track a binding history for buffer resources

This will let us know what caches to flush / state to dirty when
altering the contents of a buffer.

5 years agoiris: drop long dead XXX comment
Kenneth Graunke [Wed, 21 Nov 2018 19:37:12 +0000 (11:37 -0800)]
iris: drop long dead XXX comment

5 years agoiris: Do the 48-bit vertex buffer address invalidation workaround
Kenneth Graunke [Wed, 21 Nov 2018 08:06:46 +0000 (00:06 -0800)]
iris: Do the 48-bit vertex buffer address invalidation workaround

5 years agoiris: Fix VIEWPORT/LAYER in stream output info
Kenneth Graunke [Wed, 21 Nov 2018 07:03:16 +0000 (23:03 -0800)]
iris: Fix VIEWPORT/LAYER in stream output info

Fixes glsl-1.50-transform-feedback-builtins and
ext_transform_feedback-builtin-varyings gl_PointSize

5 years agoiris: Fix buffer -> buffer copy_region
Kenneth Graunke [Wed, 21 Nov 2018 06:51:26 +0000 (22:51 -0800)]
iris: Fix buffer -> buffer copy_region

Size can be too large for a surf, blorp_buffer_copy chops things up
into segments we can actually handle

Fixes map_buffer_range_test and copy_buffer_coherency

5 years agoiris: Lie about indirects
Kenneth Graunke [Wed, 21 Nov 2018 02:16:02 +0000 (18:16 -0800)]
iris: Lie about indirects

fixes interpolateAt tests

5 years agoiris: Enable ctx->Const.UseSTD430AsDefaultPacking
Kenneth Graunke [Tue, 20 Nov 2018 21:42:31 +0000 (13:42 -0800)]
iris: Enable ctx->Const.UseSTD430AsDefaultPacking

hooray for obscurely named pipe caps with bizarre descriptions!

5 years agoiris: update comment
Kenneth Graunke [Tue, 20 Nov 2018 19:25:13 +0000 (11:25 -0800)]
iris: update comment

5 years agoiris: RT flush for memorybarrier with texture bit
Kenneth Graunke [Tue, 20 Nov 2018 19:20:27 +0000 (11:20 -0800)]
iris: RT flush for memorybarrier with texture bit

PIXEL_BUFFER_BARRIER_BIT turns into PIPE_BARRIER_TEXTURE and it ought
to trigger an RT flush, according to brw_memory_barrier

5 years agoiris: PIPE_CONTROL workarounds for GPGPU mode
Kenneth Graunke [Tue, 20 Nov 2018 17:12:54 +0000 (09:12 -0800)]
iris: PIPE_CONTROL workarounds for GPGPU mode

5 years agoiris: Put batches in an array
Kenneth Graunke [Tue, 20 Nov 2018 17:00:22 +0000 (09:00 -0800)]
iris: Put batches in an array

We keep re-making this array all over the place

5 years agoiris: put render batch first in fence code
Kenneth Graunke [Tue, 20 Nov 2018 17:00:43 +0000 (09:00 -0800)]
iris: put render batch first in fence code

this shouldn't matter, but it will make the next refactor easier

5 years agoiris: flush the compute batch too if border pool is redone
Kenneth Graunke [Tue, 20 Nov 2018 16:48:34 +0000 (08:48 -0800)]
iris: flush the compute batch too if border pool is redone

5 years agoiris: leave a TODO
Kenneth Graunke [Tue, 20 Nov 2018 08:11:18 +0000 (00:11 -0800)]
iris: leave a TODO

5 years agoiris: Add fence support using drm_syncobj
Chris Wilson [Wed, 7 Nov 2018 11:50:02 +0000 (11:50 +0000)]
iris: Add fence support using drm_syncobj

5 years agoiris: Add wait fences to properly sync between render/compute
Kenneth Graunke [Thu, 8 Nov 2018 22:51:16 +0000 (14:51 -0800)]
iris: Add wait fences to properly sync between render/compute

When flushing a batch due to a data dependency, we need to not only
kick off the other batch's work, but stall our execution until it
completes.  Just wait on last_syncpt after flushing it.

5 years agoiris: Hang on to the last batch's sync-point, so we can wait on it
Kenneth Graunke [Tue, 20 Nov 2018 04:41:26 +0000 (20:41 -0800)]
iris: Hang on to the last batch's sync-point, so we can wait on it

5 years agoiris: Tag each submitted batch with a syncobj
Chris Wilson [Fri, 9 Nov 2018 15:02:12 +0000 (15:02 +0000)]
iris: Tag each submitted batch with a syncobj

(adjusted by Ken to make the signalling sync object immediately on
batch reset, rather than batch finish time.  this will work better
with deferred flushes...)

5 years agoiris: Drop vestiges of throttling code
Kenneth Graunke [Mon, 19 Nov 2018 22:16:03 +0000 (14:16 -0800)]
iris: Drop vestiges of throttling code

5 years agoiris: Merge two walks of the exec_bos list
Chris Wilson [Mon, 19 Nov 2018 22:12:52 +0000 (14:12 -0800)]
iris: Merge two walks of the exec_bos list

5 years agoiris: replace vestiges of fence fds with newer exec_fence API
Kenneth Graunke [Thu, 8 Nov 2018 22:42:00 +0000 (14:42 -0800)]
iris: replace vestiges of fence fds with newer exec_fence API

patch by me and Chris Wilson

5 years agoiris: Avoid synchronizing due to the workaround BO
Kenneth Graunke [Tue, 20 Nov 2018 06:08:51 +0000 (22:08 -0800)]
iris: Avoid synchronizing due to the workaround BO

5 years agoiris: Avoid cross-batch synchronization on read/reads
Kenneth Graunke [Tue, 20 Nov 2018 05:49:56 +0000 (21:49 -0800)]
iris: Avoid cross-batch synchronization on read/reads

This avoids flushing batches just because e.g. both are reading the same
dynamic state streaming buffer, or shader assembly buffer.

5 years agoiris: Combine iris_use_pinned_bo and add_exec_bo
Kenneth Graunke [Tue, 20 Nov 2018 05:40:54 +0000 (21:40 -0800)]
iris: Combine iris_use_pinned_bo and add_exec_bo

5 years agoiris: Use iris_use_pinned_bo rather than add_exec_bo directly
Kenneth Graunke [Tue, 20 Nov 2018 05:32:52 +0000 (21:32 -0800)]
iris: Use iris_use_pinned_bo rather than add_exec_bo directly

less special this way

5 years agoiris: Fix assigning the output handle for exporting for KMS
Chris Wilson [Tue, 13 Nov 2018 17:55:45 +0000 (17:55 +0000)]
iris: Fix assigning the output handle for exporting for KMS

Fixes gbm_bo_get_handle() used for KMS in glamor.

5 years agoiris: Tidy exporting the flink handle
Chris Wilson [Tue, 13 Nov 2018 17:55:21 +0000 (17:55 +0000)]
iris: Tidy exporting the flink handle

5 years agoiris: Fix SLM
Kenneth Graunke [Mon, 19 Nov 2018 19:22:56 +0000 (11:22 -0800)]
iris: Fix SLM

Now that Jason has set up the L3 we can do this.  Also, my assert was
useless because we hadn't set up the field in the first place.  Oops.

5 years agoiris: Don't set constant read lengths at upload time
Jason Ekstrand [Wed, 14 Nov 2018 22:52:26 +0000 (16:52 -0600)]
iris: Don't set constant read lengths at upload time

They're set in derived_data as part of store_cs_state

5 years agoiris: Configure the L3$ on the compute context
Jason Ekstrand [Thu, 15 Nov 2018 05:09:10 +0000 (23:09 -0600)]
iris: Configure the L3$ on the compute context

5 years agoiris: properly pin stencil buffers
Kenneth Graunke [Mon, 19 Nov 2018 08:23:54 +0000 (00:23 -0800)]
iris: properly pin stencil buffers

5 years agoiris: Fix TCS/TES slot unification
Kenneth Graunke [Sat, 17 Nov 2018 00:01:28 +0000 (16:01 -0800)]
iris: Fix TCS/TES slot unification

TCS outputs, TES inputs...not TCS inputs

Fixes some barrier tests

5 years agoiris: more todo notes
Kenneth Graunke [Fri, 16 Nov 2018 23:12:57 +0000 (15:12 -0800)]
iris: more todo notes

5 years agoiris: scissored and mirrored blits
Kenneth Graunke [Fri, 9 Nov 2018 05:16:59 +0000 (21:16 -0800)]
iris: scissored and mirrored blits

5 years agoiris: more TODO
Kenneth Graunke [Sat, 10 Nov 2018 19:41:22 +0000 (11:41 -0800)]
iris: more TODO

5 years agoiris: Fix independent alpha blending.
Kenneth Graunke [Mon, 12 Nov 2018 19:33:44 +0000 (11:33 -0800)]
iris: Fix independent alpha blending.

independent_blend_enable means per-RT blending, not RGB != A

5 years agoiris: "Fix" transfer maps of buffers
Kenneth Graunke [Sat, 10 Nov 2018 10:25:24 +0000 (02:25 -0800)]
iris: "Fix" transfer maps of buffers

x should be in bytes, not cpp units

This generally worked out because PIPE_BUFFER is supposedly required
to be R8_UINT or R8_UNORM.  I hear some state trackers pass
PIPE_FORMAT_NONE instead, however, which would make this break.

Just do the right thing directly, to be defensive and clear.

5 years agoiris: Fix SourceAlphaBlendFactor
Kenneth Graunke [Sat, 10 Nov 2018 08:15:37 +0000 (00:15 -0800)]
iris: Fix SourceAlphaBlendFactor

5 years agoiris: leave another TODO
Kenneth Graunke [Sat, 10 Nov 2018 08:08:03 +0000 (00:08 -0800)]
iris: leave another TODO

5 years agoiris: only clip lower if there's something to clip against
Kenneth Graunke [Sat, 10 Nov 2018 01:35:29 +0000 (17:35 -0800)]
iris: only clip lower if there's something to clip against

5 years agoiris: fix sysval only binding tables
Kenneth Graunke [Sat, 10 Nov 2018 01:35:22 +0000 (17:35 -0800)]
iris: fix sysval only binding tables

5 years agoiris: don't forget to upload CS consts
Kenneth Graunke [Sat, 10 Nov 2018 00:56:29 +0000 (16:56 -0800)]
iris: don't forget to upload CS consts

5 years agoiris: drop param stuffs
Kenneth Graunke [Sat, 10 Nov 2018 00:50:19 +0000 (16:50 -0800)]
iris: drop param stuffs

5 years agoiris: don't trip on param asserts
Kenneth Graunke [Fri, 9 Nov 2018 20:49:49 +0000 (12:49 -0800)]
iris: don't trip on param asserts

I'd rather not rewrite i965's compute system value handling right now :(

5 years agoiris: don't support pull constants.
Kenneth Graunke [Fri, 9 Nov 2018 20:09:50 +0000 (12:09 -0800)]
iris: don't support pull constants.

I don't think it matters, we won't have any params anyway, but let's
be sure it doesn't try

5 years agoiris: regather info so we get CLIP_DIST slots, not CLIP_VERTEX
Kenneth Graunke [Fri, 9 Nov 2018 20:06:11 +0000 (12:06 -0800)]
iris: regather info so we get CLIP_DIST slots, not CLIP_VERTEX

5 years agoiris: enable push constants if we have sysvals but no uniforms
Kenneth Graunke [Fri, 9 Nov 2018 19:57:03 +0000 (11:57 -0800)]
iris: enable push constants if we have sysvals but no uniforms

5 years agoiris: drop iris_setup_push_uniform_range
Kenneth Graunke [Fri, 9 Nov 2018 19:56:15 +0000 (11:56 -0800)]
iris: drop iris_setup_push_uniform_range

it doesn't do anything, we have no params.  I guess I thought there
would be some, but they all get dead code eliminated even if we try
to make them exist in the first place.

5 years agoiris: fix more uniform setup
Kenneth Graunke [Fri, 9 Nov 2018 10:40:29 +0000 (02:40 -0800)]
iris: fix more uniform setup

5 years agoiris: fix num clip plane consts
Kenneth Graunke [Fri, 9 Nov 2018 10:20:31 +0000 (02:20 -0800)]
iris: fix num clip plane consts

5 years agoiris: actually upload clip planes.
Kenneth Graunke [Fri, 9 Nov 2018 10:11:16 +0000 (02:11 -0800)]
iris: actually upload clip planes.

5 years agoiris: bypass params and do it ourselves
Kenneth Graunke [Fri, 9 Nov 2018 10:04:23 +0000 (02:04 -0800)]
iris: bypass params and do it ourselves

the backend keeps dead code eliminating them all, so we can't do that,
plus we don't want to because params[] is lame

5 years agoiris: dodge backend UCP lowering
Kenneth Graunke [Fri, 9 Nov 2018 09:35:14 +0000 (01:35 -0800)]
iris: dodge backend UCP lowering

5 years agoiris: fix system value remapping
Kenneth Graunke [Fri, 9 Nov 2018 09:27:39 +0000 (01:27 -0800)]
iris: fix system value remapping

5 years agoiris: hook up key stuff for clip plane lowering
Kenneth Graunke [Sat, 27 Oct 2018 05:18:56 +0000 (22:18 -0700)]
iris: hook up key stuff for clip plane lowering

5 years agoiris: lower user clip planes
Kenneth Graunke [Fri, 9 Nov 2018 09:08:36 +0000 (01:08 -0800)]
iris: lower user clip planes

5 years agoiris: only bother with params if there are any...
Kenneth Graunke [Fri, 9 Nov 2018 08:51:58 +0000 (00:51 -0800)]
iris: only bother with params if there are any...

5 years agoiris: fill out params array with built-ins, like clip planes
Kenneth Graunke [Fri, 9 Nov 2018 08:41:36 +0000 (00:41 -0800)]
iris: fill out params array with built-ins, like clip planes

5 years agoiris: add param domain defines
Kenneth Graunke [Fri, 9 Nov 2018 07:19:53 +0000 (23:19 -0800)]
iris: add param domain defines

5 years agoiris: drop unnecessary param[] setup from iris_setup_uniforms
Kenneth Graunke [Fri, 9 Nov 2018 08:04:19 +0000 (00:04 -0800)]
iris: drop unnecessary param[] setup from iris_setup_uniforms

the backend just considers these dead anyway

5 years agoiris: Defer cbuf0 upload to draw time
Kenneth Graunke [Fri, 9 Nov 2018 07:10:46 +0000 (23:10 -0800)]
iris: Defer cbuf0 upload to draw time

5 years agoiris: Clone the NIR
Kenneth Graunke [Fri, 9 Nov 2018 05:48:37 +0000 (21:48 -0800)]
iris: Clone the NIR

The backend compiler used to do this for us, but after a rebase, it's
now the driver's responsibility.  This lets us alter it for say, clip
vertex lowering, at the global level rather than the per-variant level.

5 years agoiris: Print the batch name when decoding
Kenneth Graunke [Thu, 8 Nov 2018 23:32:59 +0000 (15:32 -0800)]
iris: Print the batch name when decoding

5 years agoiris: partial set_query_active_state
Kenneth Graunke [Thu, 8 Nov 2018 09:14:27 +0000 (01:14 -0800)]
iris: partial set_query_active_state

used to avoid OQ during clears for example

fixes occlusion_query_meta_no_fragments

5 years agoiris: Fix multiple RTs with non-independent blending
Kenneth Graunke [Thu, 8 Nov 2018 08:15:50 +0000 (00:15 -0800)]
iris: Fix multiple RTs with non-independent blending

rt[i] isn't filled out in this case, so we have to use rt[0]

5 years agoiris: Fix TextureBarrier
Kenneth Graunke [Thu, 8 Nov 2018 07:23:30 +0000 (23:23 -0800)]
iris: Fix TextureBarrier

I don't know how I came up with the old one, this is now what i965 does
Also we now do compute batches too

5 years agoiris: Fix MSAA smooth points
Kenneth Graunke [Thu, 8 Nov 2018 06:54:25 +0000 (22:54 -0800)]
iris: Fix MSAA smooth points

Fixes bin/ext_framebuffer_multisample-point-smooth 2 -auto -fbo

5 years agoiris: implement scratch space!
Kenneth Graunke [Thu, 8 Nov 2018 06:05:14 +0000 (22:05 -0800)]
iris: implement scratch space!

we borrow the approach from anv rather than i965, as it works better
with pre-baked state that needs to contain scratch BO addresses

fixes a bunch of varying packing tests

5 years agoiris: tidy more warnings
Kenneth Graunke [Thu, 8 Nov 2018 06:07:08 +0000 (22:07 -0800)]
iris: tidy more warnings

5 years agoiris: Enable msaa_map transfer helpers
Kenneth Graunke [Thu, 8 Nov 2018 05:06:49 +0000 (21:06 -0800)]
iris: Enable msaa_map transfer helpers

This does the downsampling for us.  It'll use BLORP anyway because
it uses blit(), and that uses BLORP.

5 years agoiris: Actually create/destroy HW contexts
Kenneth Graunke [Wed, 7 Nov 2018 17:35:19 +0000 (09:35 -0800)]
iris: Actually create/destroy HW contexts

The intention is that render and compute use their own contexts,
and each is PIPELINE_SELECT'd to the right pipeline.  But we hadn't
actually made them, so we got the fd-default context.

Thanks to Chris Wilson for catching this!

5 years agoiris: Don't leak the compute batch
Kenneth Graunke [Wed, 7 Nov 2018 17:56:37 +0000 (09:56 -0800)]
iris: Don't leak the compute batch

5 years agoiris: cross batch flushing
Kenneth Graunke [Wed, 7 Nov 2018 05:34:58 +0000 (21:34 -0800)]
iris: cross batch flushing