Three ways to increase pixelpipe UI responsiveness #21274
Three ways to increase pixelpipe UI responsiveness #21274jenshannoschwalm wants to merge 5 commits into
Conversation
7cb21b7 to
3bcc3bf
Compare
07a4847 to
c404091
Compare
|
Latest force-push further adds:
|
ca0e461 to
21088ad
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.
- 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.
- as dt_opencl_copy_image_to_host() logs errors some dt_prints() got removed
- Some readability maintenance, comments ...
Adding DT_DEV_PIXELPIPE_PROCESSING mode to dt_dev_pixelpipe_stopper_t allows us to distinguish between a processing pipe and an idle pipe. - get rid of pipe->processing - less housekeeping
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.
We had `obsolete` in dt_dev_pixelpipe_t for brute-force invalidation of all pipe cachelines while not being fully sure about piece hashes and input OpenCL cachelines not written back if changed. Not necessary any more, **if** we would want further help for cache efficiency that would go via testing for DT_DEV_PIPE_REMOVE and/or DT_DEV_PIPE_SYNCH
21088ad to
a2ad8bf
Compare
|
Rebased on top of current master, it does not look good. :-( I tried disabling OpenCL, turned modules on/off, panned, zoomed -- did not help, the editor preview remained black. |
|
Arrg, yes i saw that too and fixed it on my local working brach but forgot to update and force-push. |
|
No problem, thanks for the quick response! I gave the changes to the bots, they came back with these (probably includes the stuff you fixed on your branch):
|
|
I will check again ... thanks EDIT: and will split the first commit from the rest. |

EDIT according to latest commits: In short, this is all about how fast the UI responds to user actions while already processing the pipes, collected work ...
processingflag, introducesDT_DEV_PIXELPIPE_PROCESSINGas a shutdown "mode" and makes callers aware of thisobsoleteflag as not required any more since pipe cache is now fully implemented.