diff options
author | Kenneth Graunke <[email protected]> | 2017-07-11 14:19:46 -0700 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2017-07-22 19:34:42 -0700 |
commit | 0044de931f9a82bcf33a4c12851709788361d990 (patch) | |
tree | 2a335c7f4d6bfc7aec2b09cd4de89222c8a46ce6 /src/mesa/swrast_setup/ss_triangle.c | |
parent | 8bdbc0c5b93ff97f08d302d7b634397d52620219 (diff) |
i965: Drop non-LLC lunacy in the program cache code.
The non-LLC story was a horror show. We uploaded data via pwrite
(drm_intel_bo_subdata), which would stall if the cache BO was in
use (being read) by the GPU. Obviously, we wanted to avoid that.
So, we tried to detect whether the buffer was busy, and if so, we'd
allocate a new BO, map the old one read-only (hopefully not stalling),
copy all shaders compiled since the dawn of time to the new buffer,
upload our new one, toss the old BO, and let the state upload code
know that our program cache BO changed. This was a lot of extra data
copying, and flagging BRW_NEW_PROGRAM_CACHE would also cause a new
STATE_BASE_ADDRESS to be emitted, stalling the entire pipeline.
Not only that, but our rudimentary busy tracking consistented of a flag
set at execbuf time, and not cleared until we threw out the program
cache BO. So, the first shader upload after any drawing would hit this
"abandon the cache and start over" copying path.
This is largely unnecessary - it's just ancient and crufty code. We can
use the same persistent mapping paths on all platforms. On non-ancient
kernels, this will use a write combining map, which should be reasonably
fast.
One aspect that is worse: we do occasionally grow the program cache BO,
and copy the old contents to the newer BO. This will suffer from UC
readback performance now. To mitigate this, we use the MOVNTDQA based
streaming memcpy on platforms with SSE 4.1 (all Gen7+ atoms). Gen4-5
are unfortunately going to be penalized.
v2: Add MOVNTDQA path, rebase on other map flag changes.
v3: Drop cache->bo_used_by_gpu too (caught by Chris Wilson).
Reviewed-by: Matt Turner <[email protected]>
Diffstat (limited to 'src/mesa/swrast_setup/ss_triangle.c')
0 files changed, 0 insertions, 0 deletions