![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include "system/atomic.h"#include "imageio/imageio_core.h"#include "develop/iop_order.h"#include "pixel/format.h"#include "develop/dev_roi_request.h"#include "develop/pixelpipe.h"#include "caches/pixelpipe_cache.h"
Include dependency graph for pixelpipe_hb.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Data Structures | |
| struct | dt_dev_pixelpipe_raster_mask_t |
| struct | dt_dev_pixelpipe_iop_t |
| struct | dt_backbuf_t |
| What the pipeline last published: which cacheline, and what shape its pixels are in. More... | |
| struct | dt_backbuf_state_t |
| One coherent publication, by value. More... | |
| struct | dt_dev_pixelpipe_t |
Macros | |
| #define | dt_dev_pixelpipe_synch_all(pipe) dt_dev_pixelpipe_synch_all_real(pipe, __FUNCTION__) |
Typedefs | |
| typedef struct dt_dev_pixelpipe_raster_mask_t | dt_dev_pixelpipe_raster_mask_t |
| typedef struct dt_dev_pixelpipe_iop_t | dt_dev_pixelpipe_iop_t |
| typedef enum dt_dev_pixelpipe_change_t | dt_dev_pixelpipe_change_t |
| typedef enum dt_dev_pixelpipe_cache_request_t | dt_dev_pixelpipe_cache_request_t |
| typedef struct dt_backbuf_t | dt_backbuf_t |
| What the pipeline last published: which cacheline, and what shape its pixels are in. | |
| typedef struct dt_backbuf_state_t | dt_backbuf_state_t |
| One coherent publication, by value. | |
| typedef struct dt_dev_pixelpipe_t | dt_dev_pixelpipe_t |
Enumerations | |
| enum | dt_dev_pixelpipe_change_t { DT_DEV_PIPE_UNCHANGED = 0 , DT_DEV_PIPE_TOP_CHANGED = 1 << 0 , DT_DEV_PIPE_REMOVE = 1 << 1 , DT_DEV_PIPE_SYNCH = 1 << 2 , DT_DEV_PIPE_ZOOMED = 1 << 3 , DT_DEV_PIPE_CACHE_REQUEST = 1 << 4 , DT_DEV_PIPE_REENTRY = 1 << 5 , DT_DEV_PIPE_SWITCHED = 1 << 6 } |
| enum | dt_dev_pixelpipe_cache_request_t { DT_DEV_PIXELPIPE_CACHE_REQUEST_NONE = 0 , DT_DEV_PIXELPIPE_CACHE_REQUEST_BACKBUF = 1 , DT_DEV_PIXELPIPE_CACHE_REQUEST_MODULE = 2 } |
| #define dt_dev_pixelpipe_synch_all | ( | pipe | ) | dt_dev_pixelpipe_synch_all_real(pipe, __FUNCTION__) |
Definition at line 715 of file pixelpipe_hb.h.
| typedef struct dt_backbuf_state_t dt_backbuf_state_t |
One coherent publication, by value.
| typedef struct dt_backbuf_t dt_backbuf_t |
What the pipeline last published: which cacheline, and what shape its pixels are in.
this encapsulates the pixelpipe. a develop module will need several of these: for previews and full blits to cairo and for the export function.
These five fields are ONE fact and must be read as one. ‘hash’ names a cacheline and ‘width’/‘height’ say what shape the pixels in it are – a cacheline records how many BYTES it holds and nothing about their layout, so a consumer that pairs a hash from one publication with dimensions from the next has no way to notice. It computes a cairo stride from the wrong width and paints the diagonal striping of a stride error, or writes a mis-shaped thumbnail into the mipmap cache. The published entry is routinely LARGER than width x height x bpp (aligned allocation, pool reuse), so a size check does not catch it either.
That was reachable: ‘hash’ was atomic and the dimensions were plain fields, so a GUI thread could read the hash, resolve its entry, and then read dimensions the worker had republished in between. It needs a publication whose SHAPE changes to become visible, which is why entering a clipping module's edit mode – where the crop is neutralised and the frame jumps to the full transformed image – is where it was reported.
So the record carries a seqlock, exactly as dt_dev_geometry_store_t does (develop/dev_geometry.h), and dt_dev_backbuf_snapshot is how a consumer reads it. Do not read the fields directly to pair them with pixels; a bare read is fine only for something that pairs with nothing.
WRITERS ARE SERIALISED BY CONVENTION, not by a lock: each backbuffer belongs to one pipe and is published by the thread that runs it, with the view's leave() joining that thread before it touches anything. A second concurrent publisher needs a real lock, not a second odd counter.
| typedef enum dt_dev_pixelpipe_change_t dt_dev_pixelpipe_change_t |
| typedef struct dt_dev_pixelpipe_iop_t dt_dev_pixelpipe_iop_t |
Runtime representation of one history item instantiated inside a pixelpipe node.
A piece is the sealed processing contract for one module on one pipe. It is authored during history -> pipe synchronization and then consumed by the recursive runtime without recomputing its format contract.
Contract sealing order:
input_format() may overwrite the fields it requires on #dsc_in,commit_params() may update value-domain metadata that depends on module parameters, such as processed_maximum or RAW normalization coefficients,output_format() may finally overwrite the output storage contract.After synchronization:
process(), process_cl(), process_tiling(), and blending,modify_roi_in() / modify_roi_out()) are still allowed to mutate the piece because ROI planning happens before processing starts and some modules derive descriptor details from the planned crop,Mutable lifecycle summary:
commit_params(), input_format(), output_format(), and ROI planning are the only places allowed to author the contract,| typedef struct dt_dev_pixelpipe_raster_mask_t dt_dev_pixelpipe_raster_mask_t |
| typedef struct dt_dev_pixelpipe_t dt_dev_pixelpipe_t |
| Enumerator | |
|---|---|
| DT_DEV_PIXELPIPE_CACHE_REQUEST_NONE | |
| DT_DEV_PIXELPIPE_CACHE_REQUEST_BACKBUF | |
| DT_DEV_PIXELPIPE_CACHE_REQUEST_MODULE | |
Definition at line 213 of file pixelpipe_hb.h.
| Enumerator | |
|---|---|
| DT_DEV_PIPE_UNCHANGED | |
| DT_DEV_PIPE_TOP_CHANGED | |
| DT_DEV_PIPE_REMOVE | |
| DT_DEV_PIPE_SYNCH | |
| DT_DEV_PIPE_ZOOMED | |
| DT_DEV_PIPE_CACHE_REQUEST | |
| DT_DEV_PIPE_REENTRY | |
| DT_DEV_PIPE_SWITCHED | |
Definition at line 199 of file pixelpipe_hb.h.
|
inlinestatic |
Definition at line 331 of file pixelpipe_hb.h.
References dt_atomic_get_uint64(), and dt_backbuf_t::hash.
Referenced by _build_preview_fallback_surface(), _get_backbuf_source_piece(), _lib_navigation_compose(), _lib_navigation_picture_key(), _needs_recompute(), _peek_gui(), _redraw_surface(), _resolve_backbuf_sampling_source(), dt_dev_pixelpipe_cleanup(), dt_dev_pixelpipe_is_backbufer_valid(), dt_imageio_export_with_flags(), expose(), and test_field_by_field_read_crosses_publications().
|
inlinestatic |
Definition at line 343 of file pixelpipe_hb.h.
References dt_atomic_get_uint64(), and dt_backbuf_t::history_hash.
Referenced by dt_dev_pixelpipe_is_backbufer_valid().
|
inlinestatic |
Definition at line 291 of file pixelpipe_hb.h.
References dt_atomic_get_uint64(), dt_atomic_set_uint64(), and dt_backbuf_t::generation.
Referenced by dt_dev_backbuf_set_hash(), dt_dev_backbuf_set_history_hash(), and dt_dev_set_backbuf().
|
inlinestatic |
Definition at line 296 of file pixelpipe_hb.h.
References dt_atomic_get_uint64(), dt_atomic_set_uint64(), and dt_backbuf_t::generation.
Referenced by dt_dev_backbuf_set_hash(), dt_dev_backbuf_set_history_hash(), and dt_dev_set_backbuf().
| void dt_dev_backbuf_release_keepalive | ( | dt_backbuf_t * | backbuf | ) |
Release this backbuffer's keepalive reference, if it holds one. Safe to call twice.
Definition at line 2217 of file develop.c.
References dt_dev_pixelpipe_cache_unref_entry(), IS_NULL_PTR, and dt_backbuf_t::keepalive.
Referenced by _clear_histogram_backbuf(), _studio_dev_teardown(), _update_backbuf_cache_reference(), dt_dev_backbuf_take_keepalive(), dt_dev_pixelpipe_cleanup(), and leave().
|
inlinestatic |
Definition at line 336 of file pixelpipe_hb.h.
References dt_atomic_set_uint64(), dt_dev_backbuf_publish_begin(), dt_dev_backbuf_publish_end(), dt_backbuf_t::hash, and hash.
Referenced by _studio_dev_teardown(), leave(), and test_single_field_setter_is_a_publication().
|
inlinestatic |
Definition at line 348 of file pixelpipe_hb.h.
References dt_atomic_set_uint64(), dt_dev_backbuf_publish_begin(), dt_dev_backbuf_publish_end(), and dt_backbuf_t::history_hash.
|
inlinestatic |
Read the whole record as one publication.
Retries until a settled generation is read twice with no write in between. A publication is five stores between two counter bumps, so this converges immediately unless a writer is running right now; there is no waiting and no lock to order against anything.
Definition at line 308 of file pixelpipe_hb.h.
References dt_backbuf_t::bpp, dt_atomic_get_uint64(), DT_PIXELPIPE_CACHE_HASH_INVALID, dt_backbuf_t::generation, dt_backbuf_t::hash, dt_backbuf_t::height, dt_backbuf_t::history_hash, IS_NULL_PTR, state, and dt_backbuf_t::width.
Referenced by _lib_navigation_compose(), _preview_pipe_finished(), dt_dev_lock_pipe_surface(), dt_dev_resync_mipmap_cache(), expose(), test_single_field_setter_is_a_publication(), and test_snapshot_never_crosses_publications().
| void dt_dev_backbuf_take_keepalive | ( | dt_backbuf_t * | backbuf, |
| struct dt_pixel_cache_entry_t * | entry | ||
| ) |
Take the keepalive reference on entry, releasing whatever this backbuffer held. Idempotent for the same entry, so a republication that resolves to the same cacheline does not stack references.
Definition at line 2201 of file develop.c.
References dt_dev_backbuf_release_keepalive(), dt_dev_pixelpipe_cache_ref_count_entry(), IS_NULL_PTR, dt_backbuf_t::keepalive, and TRUE.
Referenced by _refresh_global_histogram_backbuf_for_hash(), and _update_backbuf_cache_reference().
| float * dt_dev_distort_detail_mask | ( | const dt_dev_pixelpipe_t * | pipe, |
| float * | src, | ||
| const struct dt_iop_module_t * | target_module | ||
| ) |
Referenced by _refine_with_detail_mask(), and _refine_with_detail_mask_cl().
| float * dt_dev_get_raster_mask | ( | dt_dev_pixelpipe_t * | pipe, |
| const struct dt_iop_module_t * | raster_mask_source, | ||
| const int | raster_mask_id, | ||
| const struct dt_iop_module_t * | target_module, | ||
| int * | error | ||
| ) |
Retrieve a provider mask from the global cache and transform it to a consumer.
The returned buffer is always a caller-owned working copy. If an expected cache entry was evicted, *error is set to 1 so interactive pipelines can perform one targeted provider retry. error may be NULL for export/thumbnail callers.
Referenced by _develop_blend_init_raster_mask(), and write_image().
| void dt_dev_pixelpipe_cleanup | ( | dt_dev_pixelpipe_t * | pipe | ) |
Definition at line 540 of file pixelpipe_hb.c.
References dt_dev_pixelpipe_t::backbuf, dt_dev_pixelpipe_t::busy_mutex, dt_atomic_exch_ptr(), DT_COLORSPACE_NONE, dt_dev_backbuf_get_hash(), dt_dev_backbuf_release_keepalive(), dt_dev_free_history_item(), dt_dev_pixelpipe_cache_flag_auto_destroy(), dt_dev_pixelpipe_cache_flush_clmem_for_pipe(), dt_dev_pixelpipe_cleanup_nodes(), dt_dev_pixelpipe_reset_cache_request(), dt_dev_set_backbuf(), dt_free, dt_ioppr_cleanup_profile_info(), dt_masks_forms_snapshot_release(), DT_PIXELPIPE_CACHE_HASH_INVALID, dt_pthread_mutex_destroy(), dt_dev_pixelpipe_t::forms, dt_dev_pixelpipe_t::icc_filename, dt_dev_pixelpipe_t::icc_type, dt_dev_pixelpipe_t::input_profile_info, dt_backbuf_t::keepalive, dt_dev_pixelpipe_t::last_devid, dt_dev_pixelpipe_t::last_history_item, dt_dev_pixelpipe_t::no_cache, dt_dev_pixelpipe_t::output_imgid, dt_dev_pixelpipe_t::owned_input_profile_info, pipe, dt_dev_pixelpipe_t::raster_mask_hashes, TRUE, and UNKNOWN_IMAGE.
Referenced by _engine_free(), dt_dev_cleanup(), dt_dev_snapshot_capture(), dt_focus_draw_clusters(), and dt_imageio_export_with_flags().
| void dt_dev_pixelpipe_cleanup_nodes | ( | dt_dev_pixelpipe_t * | pipe | ) |
Definition at line 625 of file pixelpipe_hb.c.
References dt_dev_clear_rawdetail_mask(), dt_dev_pixelpipe_cache_unref_hash(), dt_dev_pixelpipe_set_history_hash(), dt_free, dt_free_gpointer(), dt_iop_cleanup_pipe(), DT_PIXELPIPE_CACHE_HASH_INVALID, dt_supervisor_active(), dt_supervisor_node(), dt_supervisor_node_key(), DT_SV_DELETE, hash, dt_dev_pixelpipe_t::imgid, dt_dev_pixelpipe_t::iop_order_list, IS_NULL_PTR, k, dt_dev_pixelpipe_t::nodes, piece, pipe, dt_dev_pixelpipe_t::raster_mask_hashes, and dt_dev_pixelpipe_t::type.
Referenced by _cleanup_nodes_releases_the_masks(), _detail_output_with_its_mask_stands(), _released_masks_go_with_the_flush(), _studio_dev_teardown(), dt_dev_pixelpipe_change(), dt_dev_pixelpipe_cleanup(), and leave().
| void dt_dev_pixelpipe_create_nodes | ( | dt_dev_pixelpipe_t * | pipe | ) |
Definition at line 677 of file pixelpipe_hb.c.
References _reset_piece_cache_entry(), dt_dev_pixelpipe_t::dev, dt_iop_buffer_dsc_update_bpp(), dt_iop_init_pipe(), dt_ioppr_iop_order_copy_deep(), DT_PIXELPIPE_CACHE_HASH_INVALID, DT_REQUEST_ONLY_IN_GUI, dt_supervisor_active(), dt_supervisor_node(), dt_supervisor_node_key(), DT_SV_CREATE, dt_dev_pixelpipe_t::hash, dt_dev_pixelpipe_t::iheight, dt_dev_pixelpipe_t::imgid, dt_develop_t::iop, dt_develop_t::iop_order_list, dt_dev_pixelpipe_t::iop_order_list, IS_NULL_PTR, dt_dev_pixelpipe_t::iwidth, dt_iop_module_t::multi_priority, dt_dev_pixelpipe_t::nodes, dt_iop_module_t::op, piece, pipe, TRUE, dt_dev_pixelpipe_t::type, and TYPE_FLOAT.
Referenced by dt_dev_pixelpipe_change(), dt_dev_snapshot_capture(), dt_focus_draw_clusters(), and dt_imageio_export_with_flags().
| void dt_dev_pixelpipe_disable_after | ( | dt_dev_pixelpipe_t * | pipe, |
| const char * | op | ||
| ) |
Definition at line 1323 of file pixelpipe_hb.c.
References dt_dev_pixelpipe_t::nodes, piece, and pipe.
Referenced by _filter_pipeline().
| void dt_dev_pixelpipe_disable_before | ( | dt_dev_pixelpipe_t * | pipe, |
| const char * | op | ||
| ) |
Definition at line 1337 of file pixelpipe_hb.c.
References dt_dev_pixelpipe_t::nodes, piece, and pipe.
Referenced by _filter_pipeline().
|
inlinestatic |
Definition at line 636 of file pixelpipe_hb.h.
References dt_dev_pixelpipe_t::cache_request, dt_atomic_get_int(), DT_DEV_PIXELPIPE_CACHE_REQUEST_NONE, and pipe.
Referenced by dt_dev_darkroom_pipeline(), and dt_dev_pixelpipe_process().
|
inlinestatic |
Definition at line 642 of file pixelpipe_hb.h.
References dt_dev_pixelpipe_t::cache_request_module, dt_atomic_get_ptr(), and pipe.
Referenced by dt_dev_pixelpipe_process().
|
inlinestatic |
Definition at line 621 of file pixelpipe_hb.h.
References dt_dev_pixelpipe_t::changed, dt_atomic_get_int(), and pipe.
Referenced by _resync_pipe_with_history(), and dt_dev_darkroom_pipeline().
|
inlinestatic |
Definition at line 601 of file pixelpipe_hb.h.
References dt_atomic_get_uint64(), dt_dev_pixelpipe_t::hash, and pipe.
Referenced by _peek_gui(), _update_backbuf_cache_reference(), dt_dev_pixelpipe_is_backbufer_valid(), dt_dev_pixelpipe_process(), dt_dev_pixelpipe_process_rec(), dt_dev_resync_mipmap_cache(), and gui_post_expose().
|
inlinestatic |
Definition at line 611 of file pixelpipe_hb.h.
References dt_atomic_get_uint64(), dt_dev_pixelpipe_t::history_hash, and pipe.
Referenced by _resync_pipe_with_history(), _update_backbuf_cache_reference(), dt_dev_pixelpipe_is_pipeline_valid(), and dt_dev_pixelpipe_process().
| gboolean dt_dev_pixelpipe_get_realtime | ( | const dt_dev_pixelpipe_t * | pipe | ) |
Definition at line 498 of file pixelpipe_hb.c.
References dt_atomic_get_int(), FALSE, pipe, and dt_dev_pixelpipe_t::realtime.
Referenced by _module_requires_global_histogram_input_cache(), _module_requires_global_histogram_output_cache(), _peek_gui(), _sample_picker_from_cache(), _seal_opencl_cache_policy(), _sync_focused_in_place(), commit_params(), dt_dev_darkroom_pipeline(), dt_drawlayer_set_pipeline_realtime_mode(), and process_cl().
| gboolean dt_dev_pixelpipe_has_reentry | ( | dt_dev_pixelpipe_t * | pipe | ) |
Definition at line 613 of file pixelpipe_hb.c.
References pipe, and dt_dev_pixelpipe_t::reentry.
Referenced by dt_dev_darkroom_pipeline(), and dt_dev_pixelpipe_process().
|
inlinestatic |
Definition at line 695 of file pixelpipe_hb.h.
References dt_atomic_get_int(), pipe, dt_dev_pixelpipe_t::shutdown, and dt_dev_pixelpipe_t::shutdown_ext.
Referenced by _harmonic_reconstruct_cl(), _harmonic_reconstruct_regions(), _hl_knee_estimate(), _nn_cancelled(), dt_dev_pixelpipe_process(), dt_dev_pixelpipe_process_rec(), dt_imageio_export_with_flags(), nlmeans_cl_run(), nlmeans_denoise(), pixelpipe_process_on_CPU(), pixelpipe_process_on_GPU(), process(), process_cl(), process_harmonic_cl(), process_laplacian(), process_laplacian_bayer_cl(), process_laplacian_passthrough_cl(), process_laplacian_xtrans_cl(), process_nlmeans_cl(), process_wavelets(), process_wavelets(), and wavelets_process().
| int dt_dev_pixelpipe_init | ( | dt_dev_pixelpipe_t * | pipe, |
| struct dt_develop_t * | dev | ||
| ) |
Definition at line 438 of file pixelpipe_hb.c.
References dt_dev_pixelpipe_t::dev, DT_DEV_PIXELPIPE_FULL, dt_dev_pixelpipe_init_cached(), pipe, res, dt_dev_pixelpipe_t::store_all_raster_masks, TRUE, and dt_dev_pixelpipe_t::type.
Referenced by dt_dev_init(), and dt_dev_snapshot_capture().
| int dt_dev_pixelpipe_init_cached | ( | dt_dev_pixelpipe_t * | pipe | ) |
Definition at line 449 of file pixelpipe_hb.c.
References dt_dev_pixelpipe_t::backbuf, dt_dev_pixelpipe_t::busy_mutex, dt_dev_pixelpipe_t::devid, dt_atomic_set_int(), DT_COLORSPACE_NONE, DT_DEV_PIPE_UNCHANGED, dt_dev_pixelpipe_reset_cache_request(), dt_dev_pixelpipe_reset_reentry(), dt_dev_pixelpipe_set_changed(), dt_dev_pixelpipe_set_hash(), dt_dev_pixelpipe_set_history_hash(), dt_dev_roi_request_neutral(), dt_dev_set_backbuf(), DT_INTENT_LAST, DT_PIXELPIPE_CACHE_HASH_INVALID, dt_pthread_mutex_init(), FALSE, dt_dev_pixelpipe_t::icc_intent, dt_dev_pixelpipe_t::icc_type, IMAGEIO_INT8, IMAGEIO_RGB, dt_dev_pixelpipe_t::iscale, dt_dev_pixelpipe_t::last_devid, dt_dev_pixelpipe_t::last_history_hash, dt_dev_pixelpipe_t::levels, dt_dev_pixelpipe_t::mask_rasterization_step, dt_dev_pixelpipe_t::output_imgid, pipe, dt_dev_pixelpipe_t::raster_mask_hashes, dt_dev_pixelpipe_t::rawdetail_mask_hash, dt_dev_pixelpipe_t::realtime, dt_dev_pixelpipe_t::roi_request, dt_dev_pixelpipe_t::shutdown, UNKNOWN_IMAGE, and dt_dev_roi_request_store_t::value.
Referenced by dt_dev_pixelpipe_init(), dt_dev_pixelpipe_init_dummy(), dt_dev_pixelpipe_init_export(), dt_dev_pixelpipe_init_preview(), and dt_dev_pixelpipe_init_thumbnail().
| int dt_dev_pixelpipe_init_dummy | ( | dt_dev_pixelpipe_t * | pipe, |
| struct dt_develop_t * | dev | ||
| ) |
Definition at line 399 of file pixelpipe_hb.c.
References dt_dev_pixelpipe_t::dev, dt_dev_pixelpipe_init_cached(), DT_DEV_PIXELPIPE_THUMBNAIL, dt_dev_pixelpipe_t::no_cache, pipe, res, TRUE, and dt_dev_pixelpipe_t::type.
Referenced by dt_focus_draw_clusters().
| int dt_dev_pixelpipe_init_export | ( | dt_dev_pixelpipe_t * | pipe, |
| struct dt_develop_t * | dev, | ||
| int | levels, | ||
| gboolean | store_masks | ||
| ) |
Definition at line 376 of file pixelpipe_hb.c.
References dt_dev_pixelpipe_t::dev, DT_DEV_PIXELPIPE_EXPORT, dt_dev_pixelpipe_init_cached(), FALSE, dt_dev_pixelpipe_t::gui_observable_source, dt_dev_pixelpipe_t::levels, levels(), dt_dev_pixelpipe_t::no_cache, pipe, res, dt_dev_pixelpipe_t::store_all_raster_masks, TRUE, and dt_dev_pixelpipe_t::type.
Referenced by dt_imageio_export_with_flags().
| int dt_dev_pixelpipe_init_preview | ( | dt_dev_pixelpipe_t * | pipe, |
| struct dt_develop_t * | dev | ||
| ) |
Definition at line 408 of file pixelpipe_hb.c.
References dt_dev_pixelpipe_t::dev, dt_dev_pixelpipe_init_cached(), DT_DEV_PIXELPIPE_PREVIEW, dt_dev_pixelpipe_t::gui_observable_source, pipe, res, dt_dev_pixelpipe_t::store_all_raster_masks, TRUE, and dt_dev_pixelpipe_t::type.
Referenced by dt_dev_init().
| int dt_dev_pixelpipe_init_thumbnail | ( | dt_dev_pixelpipe_t * | pipe, |
| struct dt_develop_t * | dev | ||
| ) |
Definition at line 390 of file pixelpipe_hb.c.
References dt_dev_pixelpipe_t::dev, dt_dev_pixelpipe_init_cached(), DT_DEV_PIXELPIPE_THUMBNAIL, dt_dev_pixelpipe_t::no_cache, pipe, res, TRUE, and dt_dev_pixelpipe_t::type.
Referenced by dt_imageio_export_with_flags().
|
inlinestatic |
Definition at line 631 of file pixelpipe_hb.h.
References dt_dev_pixelpipe_t::changed, dt_atomic_or_int(), flags, and pipe.
Referenced by _change_pipe(), _peek_gui(), _process_at_roi(), _publish_backend_progress(), _publish_mask_edit_transient(), _resync_pipe_with_history(), dt_dev_darkroom_pipeline(), dt_dev_history_commit_item_now(), dt_dev_history_pixelpipe_update(), and dt_dev_roi_request_publish().
| int dt_dev_pixelpipe_process | ( | dt_dev_pixelpipe_t * | pipe, |
| dt_iop_roi_t | roi | ||
| ) |
We loop over enabled providers and the mask ids they advertise, looking for dedicated cachelines required by this graph. Acquire the new references before releasing the previous set so an unchanged mask never becomes briefly evictable between consecutive renders.
Invalidate immediately before the raster reconstruction pass, while no other pixelpipe can republish one of these shared hashes. Invalidating when the first pass failed is too early: the preview pipe may run before this retry and recreate the provider image while the dedicated mask cacheline remains absent.
We are looking for the provider output captured in reentry_hash, then collect every enabled cumulative output after it. This forces recursion through the provider while preserving all upstream cache lines.
Definition at line 1505 of file pixelpipe_hb.c.
References _bypass_cache(), _get_requested_piece_node(), _print_opencl_errors(), _update_backbuf_cache_reference(), dt_develop_t::color_picker, dt_dev_pixelpipe_iop_t::data, dt_dev_pixelpipe_t::dev, dt_dev_pixelpipe_t::devid, dt_control_signal_get_global(), DT_DEBUG_CONTROL_SIGNAL_RAISE, DT_DEBUG_DEV, DT_DEBUG_MEMORY, DT_DEBUG_OPENCL, dt_dev_pixelpipe_cache_invalidate_hashes(), dt_dev_pixelpipe_cache_print(), dt_dev_pixelpipe_cache_ref_entry_by_hash(), dt_dev_pixelpipe_cache_ref_host_entry_by_hash(), DT_DEV_PIXELPIPE_CACHE_REQUEST_MODULE, DT_DEV_PIXELPIPE_CACHE_REQUEST_NONE, dt_dev_pixelpipe_cache_restore_host_payload(), dt_dev_pixelpipe_cache_unref_entry(), dt_dev_pixelpipe_cache_unref_hash(), DT_DEV_PIXELPIPE_DISPLAY_NONE, DT_DEV_PIXELPIPE_EXPORT, DT_DEV_PIXELPIPE_FULL, dt_dev_pixelpipe_get_cache_request(), dt_dev_pixelpipe_get_cache_request_module(), dt_dev_pixelpipe_get_hash(), dt_dev_pixelpipe_get_history_hash(), dt_dev_pixelpipe_get_roi_in(), dt_dev_pixelpipe_has_reentry(), dt_dev_pixelpipe_has_shutdown(), DT_DEV_PIXELPIPE_PREVIEW, dt_dev_pixelpipe_process_rec(), dt_dev_pixelpipe_raster_mask_hash(), dt_dev_pixelpipe_reset_cache_request(), DT_DEV_PIXELPIPE_THUMBNAIL, dt_free, dt_get_debug_flags(), dt_get_times(), dt_iop_is_raster_mask_used(), dt_masks_forms_snapshot_release(), dt_masks_snapshot_current_forms(), dt_opencl_check_tuning(), dt_opencl_events_flush(), dt_opencl_events_reset(), dt_opencl_release_device(), dt_opencl_report_pipe_error(), dt_opencl_reserve_device_for_pipe(), dt_opencl_update_settings(), dt_pipeline_threadsafe_mutex(), DT_PIXELPIPE_CACHE_HASH_INVALID, dt_pixelpipe_get_global_hash(), dt_pixelpipe_get_pipe_name(), dt_print(), dt_print_mem_usage(), dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), dt_sentry_set_processed_image(), dt_show_times(), DT_SIGNAL_CACHELINE_READY, dt_supervisor_node_key(), dt_telemetry_record_file_type(), FALSE, dt_dev_pixelpipe_t::flush_cache, dt_dev_pixelpipe_t::forms, dt_dev_pixelpipe_iop_t::global_hash, dt_develop_t::gui_attached, hash, dt_iop_roi_t::height, dt_develop_t::image_storage, dt_develop_t::iop, IS_NULL_PTR, k, dt_dev_pixelpipe_t::keep_outputs, KILL_SWITCH_PIPE, dt_dev_pixelpipe_t::last_devid, dt_dev_pixelpipe_t::mask_display, mask_id, mask_name, dt_dev_pixelpipe_t::nodes, dt_iop_module_t::op, dt_dev_pixelpipe_t::opencl_enabled, dt_dev_pixelpipe_t::opencl_error, dt_develop_t::pending_module, dt_develop_t::pending_pipe, piece, dt_develop_t::piece_hash, pipe, dt_dev_pixelpipe_t::raster_mask_hashes, dt_dev_pixelpipe_t::reentry_hash, dt_dev_pixelpipe_t::store_all_raster_masks, TRUE, dt_dev_pixelpipe_t::type, void(), and dt_iop_roi_t::width.
Referenced by _process_at_roi(), dt_dev_darkroom_pipeline(), and dt_imageio_export_with_flags().
| gboolean dt_dev_pixelpipe_rawdetail_mask_check_hit | ( | dt_dev_pixelpipe_t * | pipe, |
| const dt_dev_pixelpipe_iop_t * | piece, | ||
| const uint64_t | output_hash | ||
| ) |
Whether a cached output of piece may stand for it, called before that output is looked up.
The hidden detailmask stage publishes two cachelines: its output, a copy of its input, and the detail mask, under a hash of its own. Either can be evicted without the other, and the output alone cannot rebuild the mask: a consumer finding none skips the detail refinement, and its output is cached under the hash of a refined one. So a cached output stands for the stage only while its mask is there too. When it is, the pipe takes the mask now, as the stage's process() would; when it is not, the output is invalidated so that the stage runs and publishes the mask again. Any other piece's output stands as it is.
| pipe | The pipe about to look up the output. |
| piece | The piece the output belongs to. |
| output_hash | The output's cache key. |
Definition at line 14 of file pixelpipe_rawdetail.c.
References dt_dev_clear_rawdetail_mask(), dt_dev_pixelpipe_cache_invalidate_hashes(), dt_dev_pixelpipe_cache_ref_entry_by_hash(), dt_dev_pixelpipe_rawdetail_mask_hash(), DT_PIXELPIPE_CACHE_HASH_INVALID, FALSE, piece, pipe, dt_dev_pixelpipe_t::rawdetail_mask_hash, dt_dev_pixelpipe_t::rawdetail_mask_roi, and TRUE.
Referenced by _detail_output_with_its_mask_stands(), _detail_output_without_its_mask_goes(), _other_output_stands(), and dt_dev_pixelpipe_process_rec().
|
inlinestatic |
Definition at line 656 of file pixelpipe_hb.h.
References dt_dev_pixelpipe_t::cache_request, dt_dev_pixelpipe_t::cache_request_module, dt_atomic_set_int(), dt_atomic_set_ptr(), DT_DEV_PIXELPIPE_CACHE_REQUEST_NONE, IS_NULL_PTR, and pipe.
Referenced by dt_dev_pixelpipe_cleanup(), dt_dev_pixelpipe_init_cached(), and dt_dev_pixelpipe_process().
| void dt_dev_pixelpipe_reset_reentry | ( | dt_dev_pixelpipe_t * | pipe | ) |
Definition at line 618 of file pixelpipe_hb.c.
References DT_PIXELPIPE_CACHE_HASH_INVALID, FALSE, dt_dev_pixelpipe_t::flush_cache, pipe, dt_dev_pixelpipe_t::reentry, and dt_dev_pixelpipe_t::reentry_hash.
Referenced by dt_dev_darkroom_pipeline(), and dt_dev_pixelpipe_init_cached().
|
inlinestatic |
Definition at line 647 of file pixelpipe_hb.h.
References dt_dev_pixelpipe_t::cache_request, dt_dev_pixelpipe_t::cache_request_module, dt_atomic_set_int(), dt_atomic_set_ptr(), IS_NULL_PTR, and pipe.
Referenced by _peek_gui(), and dt_dev_darkroom_pipeline().
|
inlinestatic |
Definition at line 626 of file pixelpipe_hb.h.
References dt_dev_pixelpipe_t::changed, dt_atomic_set_int(), pipe, and v.
Referenced by dt_dev_pixelpipe_init_cached().
|
inlinestatic |
Definition at line 606 of file pixelpipe_hb.h.
References dt_atomic_set_uint64(), dt_dev_pixelpipe_t::hash, hash, and pipe.
Referenced by dt_dev_pixelpipe_init_cached(), and dt_pixelpipe_get_global_hash().
|
inlinestatic |
Definition at line 616 of file pixelpipe_hb.h.
References dt_atomic_set_uint64(), dt_dev_pixelpipe_t::history_hash, and pipe.
Referenced by dt_dev_pixelpipe_change(), dt_dev_pixelpipe_cleanup_nodes(), and dt_dev_pixelpipe_init_cached().
| void dt_dev_pixelpipe_set_icc | ( | dt_dev_pixelpipe_t * | pipe, |
| dt_colorspaces_color_profile_type_t | icc_type, | ||
| const gchar * | icc_filename, | ||
| dt_iop_color_intent_t | icc_intent | ||
| ) |
Definition at line 531 of file pixelpipe_hb.c.
References dt_free, dt_dev_pixelpipe_t::icc_filename, dt_dev_pixelpipe_t::icc_intent, dt_dev_pixelpipe_t::icc_type, and pipe.
Referenced by dt_dev_snapshot_capture(), and dt_imageio_export_with_flags().
| void dt_dev_pixelpipe_set_input | ( | dt_dev_pixelpipe_t * | pipe, |
| int32_t | imgid, | ||
| int | width, | ||
| int | height, | ||
| float | iscale, | ||
| dt_mipmap_size_t | size | ||
| ) |
Definition at line 503 of file pixelpipe_hb.c.
References dt_dev_pixelpipe_t::dev, height, dt_dev_pixelpipe_t::iheight, dt_develop_t::image_storage, dt_dev_pixelpipe_t::imgid, IS_NULL_PTR, iscale, dt_dev_pixelpipe_t::iscale, dt_dev_pixelpipe_t::iwidth, dt_dev_pixelpipe_t::nodes, piece, pipe, size, dt_dev_pixelpipe_t::size, and width.
Referenced by _process_at_roi(), dt_dev_darkroom_pipeline(), dt_dev_snapshot_capture(), dt_focus_draw_clusters(), and dt_imageio_export_with_flags().
| void dt_dev_pixelpipe_set_mask_rasterization_step | ( | dt_dev_pixelpipe_t * | pipe, |
| const int | step | ||
| ) |
Set the drawn-mask rasterisation step for the next frame, in image pixels (clamped to >= 1).
Set the drawn-mask rasterisation step for the next frame, in image pixels (clamped to >= 1).
| step | Maximum distance, in image pixels, between consecutive samples of a mask outline. Clamped to at least 1 (pixel accuracy). |
Called by the darkroom, which is the only place that knows both the zoom level and the user's preference. Nothing else raises it, so a pipe that is never told – every headless export, thumbnail and snapshot – keeps the pixel-accurate default it was initialised with.
Definition at line 431 of file pixelpipe_hb.c.
References IS_NULL_PTR, dt_dev_pixelpipe_t::mask_rasterization_step, MAX, and pipe.
Referenced by dt_dev_roi_request_publish().
| void dt_dev_pixelpipe_set_realtime | ( | dt_dev_pixelpipe_t * | pipe, |
| gboolean | state | ||
| ) |
Definition at line 492 of file pixelpipe_hb.c.
References dt_atomic_set_int(), FALSE, IS_NULL_PTR, pipe, dt_dev_pixelpipe_t::realtime, state, and TRUE.
Referenced by dt_dev_pixelpipe_change_zoom_main(), dt_dev_pixelpipe_update_zoom_main_real(), and dt_drawlayer_set_pipeline_realtime_mode().
| gboolean dt_dev_pixelpipe_set_reentry | ( | dt_dev_pixelpipe_t * | pipe, |
| uint64_t | hash | ||
| ) |
Set the re-entry pipeline flag, only if no object is already capturing it.
Re-entered pipelines bypass normal exact hits for one processing pass. Raster-mask consumers use this after the dedicated side-band cacheline was evicted while the provider image remained cached: provider and downstream image states are invalidated immediately before the retry, while upstream states and the synchronized node graph remain intact.
It can be used for any case where a full pipeline recompute is needed once, based on runtime module requirements, but a full cache flush would be overkill.
NOTE: in main darkroom pipe, the coordinates of the ROI can change between runs from the same thread.
| pipe | |
| hash | Unique ID of the object attempting capture the re-entry flag. This should stay constant between 2 pipeline runs from the same thread. |
Definition at line 586 of file pixelpipe_hb.c.
References DT_DEBUG_DEV, DT_PIXELPIPE_CACHE_HASH_INVALID, dt_print(), FALSE, hash, pipe, dt_dev_pixelpipe_t::reentry, dt_dev_pixelpipe_t::reentry_hash, and TRUE.
Referenced by dt_dev_get_raster_mask().
| void dt_dev_pixelpipe_synch_all_real | ( | dt_dev_pixelpipe_t * | pipe, |
| const char * | caller_func | ||
| ) |
Definition at line 1764 of file dev_pixelpipe.c.
References _synch_all_snapshot(), dt_dev_pixelpipe_t::dev, dt_dev_history_snapshot_release(), dt_dev_history_snapshot_take(), dt_pthread_rwlock_rdlock(), dt_pthread_rwlock_unlock(), dt_develop_t::history_mutex, and pipe.
| void dt_dev_pixelpipe_synch_top | ( | dt_dev_pixelpipe_t * | pipe | ) |
Definition at line 1835 of file dev_pixelpipe.c.
References _synch_top_snapshot(), dt_dev_pixelpipe_t::dev, dt_dev_history_snapshot_release(), dt_dev_history_snapshot_take(), dt_pthread_rwlock_rdlock(), dt_pthread_rwlock_unlock(), dt_develop_t::history_mutex, and pipe.
| gboolean dt_dev_pixelpipe_unset_reentry | ( | dt_dev_pixelpipe_t * | pipe, |
| uint64_t | hash | ||
| ) |
Remove the re-entry pipeline flag, only if the object identifier is the one that set it. See dt_dev_pixelpipe_set_reentry.
| pipe | |
| hash | Unique ID of the object attempting capture the re-entry flag. This should stay constant between 2 pipeline runs from the same thread. |
Definition at line 600 of file pixelpipe_hb.c.
References DT_DEBUG_DEV, DT_PIXELPIPE_CACHE_HASH_INVALID, dt_print(), FALSE, hash, pipe, dt_dev_pixelpipe_t::reentry, dt_dev_pixelpipe_t::reentry_hash, and TRUE.
Referenced by dt_dev_get_raster_mask().
| float * dt_dev_retrieve_rawdetail_mask | ( | const dt_dev_pixelpipe_t * | pipe, |
| const struct dt_iop_module_t * | target_module | ||
| ) |
Referenced by _refine_with_detail_mask(), and _refine_with_detail_mask_cl().
| char * dt_pixelpipe_get_pipe_name | ( | dt_dev_pixelpipe_type_t | pipe_type | ) |
Definition at line 259 of file pixelpipe_hb.c.
References DT_DEV_PIXELPIPE_EXPORT, DT_DEV_PIXELPIPE_FULL, DT_DEV_PIXELPIPE_PREVIEW, DT_DEV_PIXELPIPE_THUMBNAIL, and r.
Referenced by _envelope(), _get_debug_pipe_name(), _peek_gui(), _print_nan_debug(), _print_opencl_errors(), _print_perf_debug(), _trace_buffer_content(), _trace_cache_owner(), _update_backbuf_cache_reference(), dt_dev_darkroom_pipeline(), dt_dev_get_raster_mask(), dt_dev_pixelpipe_debug_dump_module_io(), dt_dev_pixelpipe_process(), dt_dev_pixelpipe_process_rec(), dt_iop_commit_params(), and dt_supervisor_describe().