Three ways to increase pixelpipe UI responsiveness #21274
Open
jenshannoschwalm wants to merge 3 commits into
Open
Three ways to increase pixelpipe UI responsiveness #21274jenshannoschwalm wants to merge 3 commits into
jenshannoschwalm wants to merge 3 commits into
Conversation
7cb21b7 to
3bcc3bf
Compare
b17ff31 to
b155b8e
Compare
- Major _module_pipe_stop() work
If we find pipe shutdown reflecting an iop_order we invalidate cachelines for the
specified iop_order as output is unsafe.
As the input cacheline either
- requires updating as we possibly have done some colorspace conversion
- or does not have any valid data at all
we write back the cl_mem to host to have valid cacheline data for the next pixelpipe run.
As input cl_mem is not used any more we release it here.
- we don't have to invalidate input data cachelines because of in-space colorspace correctiosn,
the cache cst has been updated and data have been written back in all cases via (1)
- The pixelpipe CPU path missed a _module_pipe_stop()
- Added and use dt_dev_pixelpipe_cache_invalidate_iop()
This invalidates cachelines claimed by this iop.
- Activate DT_PIPE_CAS_SHUTDOWN, now we only can set shutdown mode once per pixelpipe run.
Also some log improvements here, we want this to be logged via -d pipe if relevant & new,
otherwise the -d verbose switch must be used.
- Some readability maintenance, comments ...
For a fast UI response when switching darkroom HQ processing mode or changing history (setting pipe shutdown to DT_DEV_PIXELPIPE_STOP_NODES) we may use dt_dev_pixelpipe_set_shutdown() *while* processing a module to enforce a clean pipe shutdown asap. The pixelpipe tests for those UI induced shutdown requests for an early exit at safe locations. Yet a few heavy processing modules with high number of iterations (most notably diffuse) can lead to a significant delay until such a safe point has been reached. With this commit they can test for a requested shutdown via dt_dev_pixelpipe_piece_shutdown() and possibly stop iterating, cacheline integrity is kept by invalidating incorrect output.
Currently we use dt_dev_pixelpipe_set_shutdown() to stop a running pixelpipe asap, this is
used for changing the nodes involved in the pipe (history changes) or when toggling between
darkroom HQ mode on/off as examples, we do this for UI responsiveness.
Being in darkroom mode **while** the dt_dev_pixelpipe_process() is still running, a UI move of the
the displayed part of the main canvas or zooming-in/out results in a new control job which is
currently processed *after the complete* dt_dev_pixelpipe_process().
This commit adds an early-exit & restart pipe mechanism for a faster UI response, avoiding up to
one pixelpipe run with a good chance of finding valid pixelpipe cache data.
1. A new shutdown mode DT_DEV_PIXELPIPE_STOP_ZOOM has been added to dt_dev_pixelpipe_stopper_t.
It is
a) checked, reported and handled in dt_dev_process_image_job()
b) tested in dt_dev_pixelpipe_process() via _module_pipe_stop() making sure the pipe
possibly exits with TRUE state and a shutdown mode.
In all cases we ensure pixelpipe cache integrity via _module_pipe_stop().
2. How is this shutdown mode induced?
If we zoom in/out or reposition the main canvas we set shutdown to DT_DEV_PIXELPIPE_STOP_ZOOM
in dt_dev_zoom_move() enforcing the pipe restart.
b155b8e to
07a4847
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In short, this is all about how fast the UI responds to user actions while already processing the pipes, collected work ...
@TurboGit those two are genuine bugs. The first mentioned would be safe and good to be fixed for 5.6, i would do another PR for 5.6 if you want. The second case is not important - i have never spotted that "in the wild" so with invalidation we are absolutely safe, just not as fast as we could ...