Commit Graph

84 Commits

Author SHA1 Message Date
Mike Blumenkrantz
03d6d01fe2 iris: support INTEL_NO_HW environment variable
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2019-04-10 12:59:17 -07:00
Chris Wilson
db99d02fce iris: Push heavy memchecker code to DEBUG
Invoking VALGRIND_CHECK_MEM_IS_DEFINED pulls in enough code to convince
gcc to not inline __gen_uint and results in a lot of packing code ending
up out-of-line with lots of stack copying. To ameliorate this, only
insert the check inside the packer if DEBUG is defined and instead
perform the validation checking before submitting the batch to the
kernel. This should give accurate results if --trace-origins=yes is
used, and failing that we can recompile in full debug mode to check on
insertion.

Improve drawoverhead baseline by 25% with a default build with
valgrind-dev installed (with effectively no loss of vg coverage).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2019-03-22 10:38:03 -07:00
Kenneth Graunke
87f865aab3 iris: Fix batch chaining map_next increment.
Caught by Chris Wilson; split out from his valgrind patch.
2019-03-22 09:31:15 -07:00
Chris Wilson
04ddff1aa4 iris: Wire up EGL_IMG_context_priority
Add the missing PIPE_CAP_CONTEXT_PRIORITY_MASK and parsing of the context
construction flags.

Testcase: piglit/egl-context-priority

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2019-03-07 20:27:10 -08:00
Lionel Landwerlin
575f8e8b60 iris: fix decode_get_bo callback
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: acb50d6b1f ("intel/decoders: handle decoding MI_BBS from ring")
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
2019-03-07 17:39:07 +00:00
Lionel Landwerlin
0e269c0ac2 iris: fix decoder call
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: acb50d6b1f ("intel/decoders: handle decoding MI_BBS from ring")
2019-03-07 16:15:03 +00:00
Kenneth Graunke
9376799bd6 iris: Use READ_ONCE and WRITE_ONCE for snapshots_landed
Suggested by Chris Wilson, if only to make it obvious to the human
readers that these are volatile reads.  It may also be necessary for
the compiler in a few cases.
2019-02-21 10:26:11 -08:00
Kenneth Graunke
e092ed9213 iris: Drop dead state_size hash table
I inherited this from i965.  It would be nice to track the state size
so INTEL_DEBUG=color,bat decoding can print the right number of e.g.
binding table entries or blend states, but...without a single point
of entry for state, it's a little tricky to get right.  Punt for now,
and drop the dead code in the meantime.
2019-02-21 10:26:11 -08:00
Kenneth Graunke
6e41f1b459 iris: Drop comment about ISP_DIS
i965 re-emits 3DSTATE_CONSTANT_* on every batch, so there's no point in
restoring the constants from the context.  Iris actually re-pins the
constant buffers properly across the batch, and avoids re-emitting the
constant packets unless it's necessary.  So, we don't want ISP_DIS.
2019-02-21 10:26:11 -08:00
Kenneth Graunke
572fad1e84 iris: Don't check other batches for our batch BO
This is an awkward corner case.  We create batches in order, each of
which creates and pins a BO.  The other batches may not be set up yet,
so it may not be safe to ask whether they reference a BO.

Just avoid this for now.  We could avoid it for other context-local BOs
too, but we currently don't have a flag for that (and I'm not certain
whether it's worth it).
2019-02-21 10:26:11 -08:00
Kenneth Graunke
b92ca4d0f6 iris: don't print the pointer in INTEL_DEBUG=submit
lots of noise in diff, hope was it would be useful for gdb, but the
the GEM handle is good enough
2019-02-21 10:26:11 -08:00
Kenneth Graunke
f1a7392be1 iris: Put batches in an array
We keep re-making this array all over the place
2019-02-21 10:26:10 -08:00
Kenneth Graunke
db199d9d07 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.
2019-02-21 10:26:10 -08:00
Kenneth Graunke
d69bc4ac12 iris: Hang on to the last batch's sync-point, so we can wait on it 2019-02-21 10:26:10 -08:00
Chris Wilson
fae74234d9 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...)
2019-02-21 10:26:10 -08:00
Kenneth Graunke
3e332af611 iris: Drop vestiges of throttling code 2019-02-21 10:26:10 -08:00
Chris Wilson
54347c078e iris: Merge two walks of the exec_bos list 2019-02-21 10:26:10 -08:00
Kenneth Graunke
3455f57575 iris: replace vestiges of fence fds with newer exec_fence API
patch by me and Chris Wilson
2019-02-21 10:26:10 -08:00
Kenneth Graunke
11da219be9 iris: Avoid synchronizing due to the workaround BO 2019-02-21 10:26:10 -08:00
Kenneth Graunke
30d7bebc8a 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.
2019-02-21 10:26:10 -08:00
Kenneth Graunke
b21e916a62 iris: Combine iris_use_pinned_bo and add_exec_bo 2019-02-21 10:26:10 -08:00
Kenneth Graunke
fb4c898842 iris: Use iris_use_pinned_bo rather than add_exec_bo directly
less special this way
2019-02-21 10:26:10 -08:00
Kenneth Graunke
25f194d5ac iris: more TODO 2019-02-21 10:26:10 -08:00
Kenneth Graunke
89833eddab iris: leave another TODO 2019-02-21 10:26:10 -08:00
Kenneth Graunke
587e438128 iris: Print the batch name when decoding 2019-02-21 10:26:09 -08:00
Kenneth Graunke
9ec927497e 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!
2019-02-21 10:26:09 -08:00
Kenneth Graunke
fbe5d75f11 iris: cross batch flushing 2019-02-21 10:26:09 -08:00
Kenneth Graunke
c3cc525c7a iris: Cross-link iris_batches so they can potentially flush each other
This makes e.g. the render batch aware of the compute batch, so it can
ask questions like "is this BO referenced by some other batch?" and do
something about that.
2019-02-21 10:26:09 -08:00
Kenneth Graunke
822f91508e iris: don't mark contains_draw = false when chaining batches
chaining to a new batch reuses create_batch(), but we don't need to do
the work of pinning BOs we inherit from a previous batch...when that is
actually part of the same execbuf invocation.

instead, just flag it when setting primary_batch_size = 0, in
iris_batch_reset
2019-02-21 10:26:09 -08:00
Kenneth Graunke
eff081cdd9 iris: Support multiple binder BOs, update Surface State Base Address 2019-02-21 10:26:08 -08:00
Kenneth Graunke
888efcd192 iris: Allow inlining of require/get_command_space
eliminates so many callqs for ptr++
2019-02-21 10:26:08 -08:00
Kenneth Graunke
42dccb1233 iris: use consistent copyright formatting
some of them had typos, didn't say 'authors or copyright holders',
or other mistakes.  This is now https://opensource.org/licenses/MIT
text, formatted consistently.
2019-02-21 10:26:08 -08:00
Kenneth Graunke
2d578e71d5 iris: get angry about execbuf failures
want this to be easy to detect for now
2019-02-21 10:26:08 -08:00
Kenneth Graunke
a378ee3607 iris: simplify batch len qword alignment
Split from a patch by Chris Wilson so I can test it independently
2019-02-21 10:26:08 -08:00
Kenneth Graunke
621cb43f41 iris: rename ring to engine
makes more sense these days.  split from a patch by Chris Wilson
2019-02-21 10:26:08 -08:00
Kenneth Graunke
dfe1ee4f6f iris: comment everything
1. Write the code
2. Add comments
3. PROFIT (or just avoid cost of explaining or relearning things...)
2019-02-21 10:26:08 -08:00
Kenneth Graunke
a3a998f19a iris: iris - fix QWord aligned endings after batch chaining rework
I need to save the primary batch size after expanding it to include
MI_BATCH_BUFFER_END and the QWord padding NOP
2019-02-21 10:26:07 -08:00
Kenneth Graunke
aacbcbbf47 iris: colorize batchbuffer failures to make them stand out 2019-02-21 10:26:07 -08:00
Kenneth Graunke
8e2b71b190 iris: bad inherited comments 2019-02-21 10:26:07 -08:00
Kenneth Graunke
8c54433275 iris: Handle batch submission failure "better"
We used to not reset the batch, and just keep appending to it, so you'd
get the same invalid contents over and over.

I'd also really like to know about this, so aborting seems wise for now,
if not for the long term
2019-02-21 10:26:07 -08:00
Kenneth Graunke
9226ebfa85 iris: print second batch size separately 2019-02-21 10:26:07 -08:00
Kenneth Graunke
0a43c9defa iris: print refcounts in INTEL_DEBUG=submit 2019-02-21 10:26:07 -08:00
Kenneth Graunke
432790bacd iris: print binder utilization in INTEL_DEBUG=submit 2019-02-21 10:26:07 -08:00
Kenneth Graunke
c763ecaa65 iris: plug leaks 2019-02-21 10:26:07 -08:00
Kenneth Graunke
3f863cf680 iris: fix the validation list on new batches 2019-02-21 10:26:06 -08:00
Kenneth Graunke
9ea05ccf1f iris: completely rewrite binder
now we get a new one per batch, and flush if it fills up
2019-02-21 10:26:06 -08:00
Kenneth Graunke
4d24874236 iris: Lower the max number of decoded VBO lines
saint foo, vbo lines!
2019-02-21 10:26:06 -08:00
Kenneth Graunke
48ddd7212d iris: fix decoding and undo testing code 2019-02-21 10:26:06 -08:00
Kenneth Graunke
f31eea1f00 iris: fix batch chaining...
don't chain a batch just for the end
2019-02-21 10:26:06 -08:00
Kenneth Graunke
604a1a1614 iris: chaining not growing 2019-02-21 10:26:06 -08:00