45 const uint32_t history_end, GList *start_node,
46 const char *debug_label);
51 const guint64 producer_node_key,
69 return G_SOURCE_REMOVE;
72 return G_SOURCE_REMOVE;
78 return G_SOURCE_REMOVE;
82 return G_SOURCE_REMOVE;
90 "[cache-wait] pending id=%" PRIu64
" owner=%s hash=%" PRIu64
91 " target=%s connected=%d age_ms=%" PRId64
"\n",
97 MAX(age_us / 1000, 0));
102 const char *context = !
IS_NULL_PTR(reason) ? reason :
"unspecified";
104 uint64_t queued = 0, served = 0, cancelled = 0, immediate = 0, misses = 0;
108 "[cache-wait] dump reason=%s pending=%u queued=%" PRIu64
" served=%" PRIu64
109 " cancelled=%" PRIu64
" immediate=%" PRIu64
" misses=%" PRIu64
"\n",
124 return !strcmp(module->
op,
"initialscale") || !strcmp(module->
op,
"colorout");
135 return !strcmp(module->
op,
"gamma");
155 if(module == picker_module)
return TRUE;
160 return !
IS_NULL_PTR(previous_piece) && previous_piece->module ==
module;
171 for(GList *nodes = g_list_first(pipe->
nodes); nodes; nodes = g_list_next(nodes))
174 if(!
IS_NULL_PTR(piece) && !strcmp(piece->module->op,
"detailmask"))
return nodes;
185 for(GList *nodes = g_list_first(pipe->
nodes); nodes; nodes = g_list_next(nodes))
190 if(!strcmp(piece->module->op,
"detailmask")) detailmask_piece = piece;
261 if(!transient && !realtime)
return FALSE;
263 const uint32_t history_end = (uint32_t)snap->
history_end;
264 if(history_end == 0)
return FALSE;
303 GList *last_item = g_list_nth(snap->
items, history_end - 1);
362 gboolean current_output_must_cache_host =
TRUE;
364 for(GList *pieces = g_list_last(pipe->
nodes); pieces; pieces = g_list_previous(pieces))
370 gboolean supports_opencl =
FALSE;
375 gchar *
string = g_strdup_printf(
"/plugins/%s/cache", module->op);
384 const gboolean global_hist_output_on
386 const gboolean global_hist_input_on
388 const gboolean module_hist_on
394 const gboolean active_in_gui
396 && focused_module == module;
404 .user_requested_cache = user_requested_cache,
405 .supports_opencl = supports_opencl,
406 .color_picker_on = color_picker_on,
407 .global_hist_output_on = global_hist_output_on,
408 .global_hist_input_on = global_hist_input_on,
409 .module_hist_on = module_hist_on,
410 .active_in_gui = active_in_gui,
411 .has_autoset = has_autoset };
415 ¤t_output_must_cache_host);
523 && dev->
gui_module->operation_tags_filter() & current_module->operation_tags())
531 const int width_in,
const int height_in,
536 gchar *pipe_name = NULL;
540 for(GList *nodes = g_list_first(pipe->
nodes); nodes; nodes = g_list_next(nodes))
554 module->modify_roi_out(module, pipe, piece, &roi_out, &roi_in);
563 "[roi-out] pipe=%-15s module=%-18s enabled=%d in =(x=%5d y=%5d w=%5d h=%5d scale=%2.2f)"
564 " out=(x=%5d y=%5d w=%5d h=%5d scale=%2.2f)\n",
565 pipe_name, module->op, piece->
enabled,
573 if(pipe_name)
dt_free(pipe_name);
592 gchar *pipe_name = NULL;
595 for(GList *nodes = g_list_last(pipe->
nodes); nodes; nodes = g_list_previous(nodes))
609 module->modify_roi_in(module, pipe, piece, &roi_out_temp, &roi_in);
611 roi_in = roi_out_temp;
619 "[roi-in ] pipe=%-15s module=%-18s enabled=%d out=(x=%5d y=%5d w=%5d h=%5d scale=%2.2f)"
620 " in=(x=%5d y=%5d w=%5d h=%5d scale=%2.2f)\n",
621 pipe_name, module->op, piece->
enabled,
622 roi_out_temp.
x, roi_out_temp.
y, roi_out_temp.
width, roi_out_temp.
height, roi_out_temp.
scale,
626 roi_out_temp = roi_in;
629 if(pipe_name)
dt_free(pipe_name);
635 for(GList *nodes = g_list_first(pipe->
nodes); nodes; nodes = g_list_next(nodes))
646 && (!piece->
enabled || strcmp(piece->module->op,
"rawprepare")))
677 return dt_hash(hash, (
const char *)&pos,
sizeof(
int));
686 for(GList *node = g_list_first(pipe->
nodes); node; node = g_list_next(node))
689 if(piece && piece->
enabled && piece->module == module)
701 GList *node = g_list_find(pipe->
nodes, (gpointer)piece);
704 for(node = g_list_previous(node); node; node = g_list_previous(node))
707 if(previous && previous->
enabled)
718 gpointer restart_data,
const gboolean retain)
777 if(!
IS_NULL_PTR(cache_entry)) *cache_entry = entry;
792 gboolean request_cacheline =
TRUE;
795 const gboolean changed_target = !wait->
connected
796 || wait->
pipe != pipe
797 || wait->module != (!
IS_NULL_PTR(piece) ? piece->module : NULL)
798 || wait->
hash != hash
802 gboolean activate_wait_cursor =
FALSE;
805 wait->module = !
IS_NULL_PTR(piece) ? piece->module : NULL;
831 piece->module->multi_priority)
845 if(queue_became_busy)
856 activate_wait_cursor =
TRUE;
859 if(activate_wait_cursor)
863 "[cache-wait] queued id=%" PRIu64
" owner=%s hash=%" PRIu64
" target=%s\n",
880 request_cacheline =
FALSE;
894 if(request_cacheline)
902 dt_print(
DT_DEBUG_DEV,
"[pixelpipe/gui] request host cache pipe=%s target=%s hash=%" PRIu64
"\n",
914 gpointer restart_data)
916 return _peek_gui(pipe, piece, data, cache_entry, wait, restart, restart_data,
FALSE);
923 gpointer restart_data)
925 return _peek_gui(pipe, piece, data, cache_entry, wait, restart, restart_data,
TRUE);
957 const guint64 producer_node_key,
960 gboolean restore_wait_cursor =
FALSE;
961 gboolean drained =
FALSE;
977 restore_wait_cursor =
TRUE;
979 if(restore_wait_cursor)
982 for(GList *iter = to_restart; iter; iter = g_list_next(iter))
990 const gboolean drift_serve = wait->
hash != hash;
993 "[cache-wait] served id=%" PRIu64
" owner=%s awaited=%" PRIu64
" published=%" PRIu64
999 drift_serve ?
" (drift: node-key)" :
"");
1007 drift_serve ?
"served (drift: node-key)" :
"served");
1010 wait->module = NULL;
1019 g_list_free(to_restart);
1025 gboolean restore_wait_cursor =
FALSE;
1028 const char *owner_tag = wait->
owner_tag;
1032 const gboolean had_module = !
IS_NULL_PTR(wait->module);
1034 const char *module_op = had_module ? wait->
module_op : NULL;
1036 const int cancel_pipe_type = wait->
pipe_type;
1037 const int32_t cancel_pipe_imgid = wait->
pipe_imgid;
1038 const char *cancel_reason = !
IS_NULL_PTR(reason) ? reason :
"unspecified";
1040 gboolean drained =
FALSE;
1052 restore_wait_cursor =
TRUE;
1054 if(restore_wait_cursor)
1059 const int64_t age_ms = -1;
1061 "[cache-wait] cancelled id=%" PRIu64
" owner=%s hash=%" PRIu64
1062 " target=%s age_ms=%" PRId64
" reason=%s\n",
1064 !
IS_NULL_PTR(owner_tag) ? owner_tag :
"(unknown)",
1066 had_module ? module_op :
"backbuf",
1073 g_snprintf(note,
sizeof(note),
"cancelled: %s", cancel_reason);
1075 module_op, module_multi_priority,
1076 had_pipe ? cancel_pipe_type : -1,
1077 had_pipe ? cancel_pipe_imgid : -1,
FALSE, note);
1081 wait->module = NULL;
1091 const char *owner_tag,
1092 gpointer owner_object)
1123 default:
return "?";
1130 piece->
dsc_in = *upstream_dsc;
1131 piece->
dsc_out = *upstream_dsc;
1140 piece->module->input_format(piece->module, pipe, piece, &piece->
dsc_in);
1163 piece->module->output_format(piece->module, pipe, piece, &piece->
dsc_out);
1168 piece->
dsc_in = actual_input_dsc;
1169 piece->
dsc_out = actual_input_dsc;
1174 *upstream_dsc = piece->
dsc_out;
1206 for(GList *nodes = g_list_first(pipe->
nodes); nodes; nodes = g_list_next(nodes))
1216 piece->
dsc_in = actual_input_dsc;
1217 piece->
dsc_out = actual_input_dsc;
1230 piece->module->input_format(piece->module, pipe, piece, &declared_in);
1236 const gboolean input_mismatch
1237 = (declared_in.
bpp != actual_input_dsc.
bpp
1243 dt_control_log(_(
"disabled module `%s`: unexpected input buffer format"),
1244 piece->module->name());
1246 "[pixelpipe] disabling module %s because input format expects %" G_GSIZE_FORMAT
1247 " B/px, %u channels, filters %u but upstream publishes %" G_GSIZE_FORMAT
1248 " B/px, %u channels, filters %u\n",
1257 piece->
dsc_in = actual_input_dsc;
1258 piece->
dsc_out = actual_input_dsc;
1276 piece->
dsc_in = declared_in;
1283 "[dsc] pipe=%s module=%s enabled=%d in=(cst=%s ch=%i bpp=%" G_GSIZE_FORMAT
1284 " filters=%u) out=(cst=%s ch=%i bpp=%" G_GSIZE_FORMAT
" filters=%u)\n",
1285 pipe_name, piece->module->op, piece->
enabled,
1289 upstream_dsc = piece->
dsc_out;
1299 const uint32_t history_end,
const char *debug_label)
1304 for(GList *nodes = g_list_first(pipe->
nodes); nodes; nodes = g_list_next(nodes))
1313 piece->
enabled = piece->module->default_enabled;
1319 gboolean found_history =
FALSE;
1321 for(GList *history = g_list_nth(history_list, history_end - 1);
1323 history = g_list_previous(history))
1326 if(piece->module == hist->module)
1331 history_param_hash = hist->
hash;
1332 found_history =
TRUE;
1338 if(!strcmp(piece->module->op,
"detailmask"))
1350 piece->module->multi_priority, piece->module->iop_order, pipe->
type, pipe->
imgid);
1354 piece->module->op, piece->module->multi_name, debug_label);
1367 const uint32_t history_end, GList *start_node,
1368 const char *debug_label)
1374 for(GList *node = g_list_first(pipe->
nodes); node && node != start_node; node = g_list_next(node))
1379 upstream_dsc = piece->
dsc_out;
1382 for(GList *nodes = start_node; nodes; nodes = g_list_next(nodes))
1392 piece->
enabled = piece->module->default_enabled;
1398 gboolean found_history =
FALSE;
1400 for(GList *history = g_list_nth(history_list, history_end - 1);
1402 history = g_list_previous(history))
1405 if(piece->module == hist->module)
1410 history_param_hash = hist->
hash;
1411 found_history =
TRUE;
1417 if(!strcmp(piece->module->op,
"detailmask"))
1429 piece->module->multi_priority, piece->module->iop_order, pipe->
type, pipe->
imgid);
1433 piece->module->op, piece->module->multi_name, debug_label);
1440 if(detailmask_node && detailmask_node != start_node)
1456 gboolean passthrough_preview =
FALSE;
1461 gboolean bypass_cache =
FALSE;
1463 for(GList *node = g_list_first(pipe->
nodes); node; node = g_list_next(node))
1479 if(passthrough_preview
1549 local_hash =
dt_hash(local_hash, (
const char *)&piece->module->request_mask_display,
sizeof(
int));
1559 local_hash =
dt_hash(local_hash, (
const char *)&revision,
sizeof(revision));
1571 local_hash =
dt_hash(local_hash, (
const char *)&piece->module->bypass_cache_variant,
sizeof(
int));
1576 local_hash =
dt_hash(local_hash, (
const char *)&zero,
sizeof(
int));
1577 local_hash =
dt_hash(local_hash, (
const char *)&zero,
sizeof(
int));
1585 local_hash =
dt_hash(local_hash, (
const char *)&bypass_distort,
sizeof(
int));
1598 "[pixelpipe] global hash for %20s (%s) in pipe %s enabled=%d bypass_cache=%d with hash %lu\n",
1600 (
long unsigned int)hash);
1621 passthrough_preview =
TRUE;
1644 const char *caller_func)
1647 dt_print(
DT_DEBUG_DEV,
"[pixelpipe] synch all modules with history for pipe %s called from %s\n",
type, caller_func);
1649 const uint32_t history_end = (uint32_t)snap->
history_end;
1653 GList *last_item = g_list_nth(snap->
items, history_end - 1);
1694 const uint32_t history_end = (uint32_t)snap->
history_end;
1695 GList *last_item = g_list_nth(snap->
items, history_end - 1);
1704 GList *first_item = NULL;
1705 for(GList *history = last_item; history; history = g_list_previous(history))
1708 first_item = history;
1714 GList *fence_item = g_list_nth(snap->
items, history_end);
1715 for(GList *history = first_item; history && history != fence_item; history = g_list_next(history))
1718 if(!hist || !hist->module)
continue;
1721 for(GList *nodes = g_list_last(pipe->
nodes); nodes; nodes = g_list_previous(nodes))
1724 if(
IS_NULL_PTR(piece) || piece->module != hist->module)
continue;
1761 for(GList *nodes = g_list_first(pipe->
nodes); nodes; nodes = g_list_next(nodes))
1767 dt_iop_commit_params(module, module->default_params, module->default_blendop_params, pipe, piece);
1788 char *status_str = g_strdup_printf(
"%s%s%s%s%s%s%s",
1797 dt_print(
DT_DEBUG_DEV,
"[dt_dev_pixelpipe_change] pipeline state changing for pipe %s, flag %s\n",
1828 const double _history_mutex_hold_start =
dt_get_wtime();
1833 const double _history_mutex_hold_ms = (
dt_get_wtime() - _history_mutex_hold_start) * 1000.0;
1834 if(_history_mutex_hold_ms > 1.0)
1836 "[dt_dev_pixelpipe_change] tid %lu pipe %s held history_mutex for %.2f ms (status 0x%x)\n",
1837 (
unsigned long)pthread_self(),
type, _history_mutex_hold_ms, (
unsigned)
status);
1842 gboolean formats_propagated =
FALSE;
1864 formats_propagated =
TRUE;
1882 const double _resync_ms = (
dt_get_wtime() - _history_mutex_hold_start) * 1000.0;
1883 if(_resync_ms > 1.0)
1885 "[dt_dev_pixelpipe_change] tid %lu pipe %s resynced from snapshot in %.2f ms, lock-free (status 0x%x)\n",
1886 (
unsigned long)pthread_self(),
type, _resync_ms, (
unsigned)
status);
1893 if(!formats_propagated)
1904 dt_show_times_f(&start,
"[dev_pixelpipe] pipeline resync with history",
"for pipe %s",
type);
struct dt_ui_t * dt_gui_get_ui(void)
GtkWidget * dt_gui_center_widget(void)
void dt_atomic_set_int(dt_atomic_int *var, int value)
int dt_atomic_get_int(dt_atomic_int *var)
int dt_atomic_exch_int(dt_atomic_int *var, int value)
static void * dt_atomic_exch_ptr(dt_atomic_ptr *var, void *value)
static void * dt_atomic_get_ptr(const dt_atomic_ptr *var)
typedef void((*dt_cache_allocate_t)(void *userdata, dt_cache_entry_t *entry))
void dt_conf_set_bool(const char *name, int val)
int dt_conf_get_bool(const char *name)
int dt_conf_key_exists(const char *key)
Does key have a value?
gboolean dt_conf_key_not_empty(const char *name)
void dt_control_log(const char *msg,...)
void dt_control_queue_redraw_center()
Request a redraw of the centre view.
void dt_control_change_cursor_by_name_and_flush(const char *curs_str)
Apply a named cursor immediatelly and flush display updates for immediate feedback.
void dt_control_commit_cursor()
void dt_control_navigation_redraw()
Request a redraw of the navigation module's widget.
struct dt_control_t * dt_control_get_global(void)
struct dt_gui_gtk_t * dt_gui_get_global(void)
gboolean dt_dev_transient_params_get(dt_develop_t *dev, const dt_iop_module_t *module, void *out_params, const size_t out_params_size, void *out_blend, const size_t out_blend_size, gboolean *out_has_blend)
void dt_dev_history_snapshot_release(dt_dev_history_snapshot_t *snapshot)
Release every reference a snapshot holds and reset it. Needs no lock.
void dt_dev_free_history_item(gpointer data)
Release a reference to a history item (used as GList free callback).
dt_dev_history_item_t * dt_dev_history_item_ref(dt_dev_history_item_t *item)
Take a reference on a history item. Pair with dt_dev_free_history_item().
void dt_dev_history_snapshot_take(dt_develop_t *dev, dt_dev_history_snapshot_t *snapshot) REQUIRES_SHARED(dev -> history_mutex)
Take a snapshot of dev->history. Caller holds history_mutex (reader suffices).
dt_dev_history_item_t * dt_dev_history_get_last_item_by_module(GList *history_list, dt_iop_module_t *module, int history_end)
Find the last history item referencing a module up to history_end.
gboolean dt_dev_transient_params_active(dt_develop_t *dev, const dt_iop_module_t *module)
void dt_dev_pixelpipe_propagate_formats(dt_dev_pixelpipe_t *pipe)
void dt_dev_pixelpipe_update_zoom_main_real(dt_develop_t *dev)
static gboolean _cache_wait_cursor_restore(gpointer user_data)
static void _prepare_piece_input_contract(dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece, const dt_iop_buffer_dsc_t *upstream_dsc)
void dt_dev_pixelpipe_update_history_all_real(dt_develop_t *dev)
const dt_dev_pixelpipe_iop_t * dt_dev_pixelpipe_get_module_piece(const dt_dev_pixelpipe_t *pipe, const dt_iop_module_t *module)
static void _sync_pipe_nodes_from_history_from_node(dt_dev_pixelpipe_t *pipe, GList *history_list, const uint32_t history_end, GList *start_node, const char *debug_label)
void dt_dev_pixelpipe_update_history_main_real(dt_develop_t *dev)
void dt_dev_pixelpipe_synch_top(dt_dev_pixelpipe_t *pipe)
static void _refresh_pipe_detail_mask_state(dt_dev_pixelpipe_t *pipe)
static gboolean _module_feeds_color_picker(const dt_dev_pixelpipe_t *pipe, const dt_iop_module_t *module, const dt_iop_module_t *picker_module)
Is module the one a picker samples, or the one feeding it?
static void _dump_one_pending(const dt_dev_pixelpipe_cache_wait_t *wait, const int64_t age_us, gpointer user_data)
void dt_dev_pixelpipe_cache_wait_cleanup(dt_dev_pixelpipe_cache_wait_t *wait, const char *reason)
Cancel one pending GUI cache wait request and clear its runtime state.
uint64_t dt_dev_pixelpipe_node_hash(dt_dev_pixelpipe_t *pipe, const dt_dev_pixelpipe_iop_t *piece, const dt_iop_roi_t roi_out, const int pos)
const dt_dev_pixelpipe_iop_t * dt_dev_pixelpipe_get_prev_enabled_piece(const dt_dev_pixelpipe_t *pipe, const dt_dev_pixelpipe_iop_t *piece)
static gboolean _sync_focused_in_place(dt_dev_pixelpipe_t *pipe, const dt_dev_history_snapshot_t *snap)
static void _pipe_set_last_history_item(dt_dev_pixelpipe_t *pipe, dt_dev_history_item_t *hist)
Re-commit the focused module's piece in place from transient (or realtime) params.
void dt_pixelpipe_get_global_hash(dt_dev_pixelpipe_t *pipe)
gboolean dt_dev_pixelpipe_is_backbufer_valid(dt_dev_pixelpipe_t *pipe)
void dt_dev_pixelpipe_reset_all(dt_develop_t *dev)
static void _commit_piece_contract(dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece, dt_iop_params_t *params, dt_develop_blend_params_t *blend_params, dt_iop_buffer_dsc_t *upstream_dsc)
static gboolean _cache_wait_connected
void dt_dev_pixelpipe_get_roi_out(dt_dev_pixelpipe_t *pipe, const int width_in, const int height_in, int *width, int *height)
void dt_dev_pixelpipe_change(dt_dev_pixelpipe_t *pipe)
static const char * _dsc_cst_name(const int cst)
void dt_dev_pixelpipe_cache_wait_dump_pending(const char *reason)
Dump pending GUI cache wait requests for lifecycle debugging.
static gboolean _peek_gui(dt_dev_pixelpipe_t *pipe, const dt_dev_pixelpipe_iop_t *piece, void **data, dt_pixel_cache_entry_t **cache_entry, dt_dev_pixelpipe_cache_wait_t *wait, dt_dev_pixelpipe_cache_ready_callback_t restart, gpointer restart_data, const gboolean retain)
static gchar * _get_debug_pipe_name(const dt_dev_pixelpipe_t *pipe, const dt_develop_t *dev)
static void _change_pipe(dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_change_t flag)
static void _synch_top_snapshot(dt_dev_pixelpipe_t *pipe, const dt_dev_history_snapshot_t *snap)
void dt_dev_pixelpipe_change_zoom_main(dt_develop_t *dev)
void dt_dev_pixelpipe_synch_all_real(dt_dev_pixelpipe_t *pipe, const char *caller_func)
void dt_dev_pixelpipe_sync_no_history(dt_dev_pixelpipe_t *pipe)
static GList * _find_detailmask_node(dt_dev_pixelpipe_t *pipe)
void dt_dev_pixelpipe_rebuild_all_real(dt_develop_t *dev)
static void _dt_dev_pixelpipe_cache_wait_ready_callback(gpointer instance, const guint64 hash, const guint64 producer_node_key, gpointer user_data)
Serve queued GUI cache waiters matching one published cacheline hash.
void dt_dev_pixelpipe_cache_wait_set_owner(dt_dev_pixelpipe_cache_wait_t *wait, const char *owner_tag, gpointer owner_object)
Attach debug ownership metadata to one cache wait request.
void dt_dev_pixelpipe_get_roi_in(dt_dev_pixelpipe_t *pipe, const struct dt_iop_roi_t roi_out)
static void _seal_opencl_cache_policy(dt_dev_pixelpipe_t *pipe)
Seal host-cache retention policy on synchronized pieces before processing starts.
void dt_dev_pixelpipe_update_history_preview_real(dt_develop_t *dev)
void dt_dev_pixelpipe_update_zoom_preview_real(dt_develop_t *dev)
static void _sync_pipe_nodes_from_history(dt_dev_pixelpipe_t *pipe, GList *history_list, const uint32_t history_end, const char *debug_label)
gboolean dt_dev_pixelpipe_is_pipeline_valid(dt_dev_pixelpipe_t *pipe)
static uint64_t _default_pipe_hash(dt_dev_pixelpipe_t *pipe)
static gboolean _cache_wait_cursor_progress(gpointer user_data)
void dt_dev_pixelpipe_resync_history_all_real(dt_develop_t *dev)
gboolean dt_dev_pixelpipe_cache_peek_gui_retained(dt_dev_pixelpipe_t *pipe, const dt_dev_pixelpipe_iop_t *piece, void **data, dt_pixel_cache_entry_t **cache_entry, dt_dev_pixelpipe_cache_wait_t *wait, dt_dev_pixelpipe_cache_ready_callback_t restart, gpointer restart_data)
gboolean dt_dev_pixelpipe_activemodule_disables_currentmodule(struct dt_develop_t *dev, struct dt_iop_module_t *current_module)
static gboolean _module_requires_global_histogram_output_cache(const dt_dev_pixelpipe_t *pipe, const dt_iop_module_t *module)
void dt_dev_pixelpipe_resync_history_main_real(dt_develop_t *dev)
void dt_dev_pixelpipe_resync_history_preview_real(dt_develop_t *dev)
static gboolean _module_requires_global_histogram_input_cache(const dt_dev_pixelpipe_t *pipe, const dt_iop_module_t *module)
static void _synch_all_snapshot(dt_dev_pixelpipe_t *pipe, const dt_dev_history_snapshot_t *snap, const char *caller_func)
Find the last history item matching each pipeline node (module), in the order of pipeline execution....
gboolean dt_dev_pixelpipe_cache_peek_gui(dt_dev_pixelpipe_t *pipe, const dt_dev_pixelpipe_iop_t *piece, void **data, dt_pixel_cache_entry_t **cache_entry, dt_dev_pixelpipe_cache_wait_t *wait, dt_dev_pixelpipe_cache_ready_callback_t restart, gpointer restart_data)
static gboolean _cache_wait_cursor_active
#define dt_dev_pixelpipe_rebuild_all(dev)
#define dt_dev_pixelpipe_resync_history_preview(dev)
#define dt_dev_pixelpipe_resync_history_main(dev)
dt_pixelpipe_cache_ready_callback_t dt_dev_pixelpipe_cache_ready_callback_t
#define dt_dev_pixelpipe_update_history_main(dev)
#define dt_dev_pixelpipe_update_zoom_main(dev)
#define dt_dev_pixelpipe_update_history_preview(dev)
void dt_dev_update_mouse_effect_radius(dt_develop_t *dev)
Convert absolute output-image coordinates to input image space by calling dt_dev_coordinates_image_ab...
static uint64_t dt_dev_get_history_hash(const dt_develop_t *dev)
@ DT_DEV_PIXELPIPE_DISPLAY_NONE
@ DT_DEV_DETAIL_MASK_ENABLED
@ DT_DEV_DETAIL_MASK_NONE
gboolean enabled
–doc was passed on the command line
GtkWidget * status
result of the last capture
static int dt_pthread_rwlock_unlock(dt_pthread_rwlock_t *rwlock) RELEASE_GENERIC(rwlock) NO_THREAD_SAFETY_ANALYSIS
static int dt_pthread_rwlock_rdlock(dt_pthread_rwlock_t *rwlock) ACQUIRE_SHARED(rwlock) NO_THREAD_SAFETY_ANALYSIS
void dt_geometry_chain_rebuild(dt_develop_t *dev)
Rebuild the chain from the dev's current modules and history. GUI thread only.
Where things are on the image, answered without a pipeline.
static uint64_t dt_hash(uint64_t hash, const char *str, size_t size)
void dt_iop_commit_params(dt_iop_module_t *module, dt_iop_params_t *params, dt_develop_blend_params_t *blendop_params, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece)
Copy params into the pipeline piece, so the next render uses them.
gboolean dt_iop_get_cache_bypass(dt_iop_module_t *module)
@ IOP_FLAGS_NO_HISTORY_STACK
_lib_location_type_t type
int32_t dt_get_debug_flags(void)
void dt_print(dt_debug_thread_t thread, const char *msg,...) __attribute__((format(printf
Print to stdout when thread is enabled, prefixed with seconds since startup.
#define IS_NULL_PTR(p)
C is way too permissive with !=, == and if(var) checks, which can mean too many things depending on w...
#define dt_free(ptr)
g_free() ptr and set it to NULL, skipping both if it is already NULL.
int dt_opencl_is_inited(void)
#define DT_MAX_FILENAME_LEN
Whether one pipeline node must keep a host-RAM copy of its output.
static gboolean dt_dev_pipe_cache_policy_decide(const dt_dev_pipe_cache_policy_inputs_t *in, const gboolean inherited_requirement, gboolean *upstream_requirement)
Decide one node's host-cache requirement, walking the pipe from the end backwards.
@ DT_DEV_PIXELPIPE_PREVIEW
void dt_dev_pixelpipe_cache_ref_count_entry(gboolean lock, dt_pixel_cache_entry_t *cache_entry)
Increase/Decrease the reference count on the cache line as to prevent LRU item removal....
gboolean dt_dev_pixelpipe_cache_peek(const uint64_t hash, void **data, dt_pixel_cache_entry_t **entry, const int preferred_devid, void **cl_mem_output)
Non-owning lookup of an existing cache line.
void dt_dev_pixelpipe_cache_flush(const int id)
Remove cache lines matching id. Entries locked in read/write or having reference count greater than 0...
gboolean dt_dev_pixelpipe_cache_ref_host_entry_by_hash(const uint64_t hash, void **data, dt_pixel_cache_entry_t **entry)
Resolve and retain an existing cacheline that already holds HOST pixels.
Pixelpipe cache for storing intermediate results in the pixelpipe.
#define DT_PIXELPIPE_CACHE_HASH_INVALID
guint dt_pixelpipe_cache_wait_pending_count(void)
How many requests are outstanding. Diagnostics only.
void dt_pixelpipe_cache_wait_foreach_pending(dt_pixelpipe_cache_wait_visitor_t callback, gpointer user_data)
gboolean dt_pixelpipe_cache_wait_cancel(dt_pixelpipe_cache_wait_t *wait, gboolean *drained)
Remove wait from the queue if it is there, and reset it to an inert state.
GList * dt_pixelpipe_cache_wait_take_matching(const uint64_t hash, const uint64_t producer_node_key, gboolean *drained)
Take every waiter satisfied by a publication of hash from node producer_node_key.
gboolean dt_pixelpipe_cache_wait_enqueue(dt_pixelpipe_cache_wait_t *wait)
Queue wait, or refresh it in place if it is already queued for the same target.
void dt_pixelpipe_cache_wait_count_immediate_hit(void)
Count one cache hit that never needed to queue.
void dt_pixelpipe_cache_wait_get_stats(uint64_t *queued, uint64_t *served, uint64_t *cancelled, uint64_t *immediate_hits, uint64_t *misses)
Snapshot of the lifetime counters, for the dump. Any pointer may be NULL.
void dt_pixelpipe_cache_wait_count_miss(void)
Count one miss that is about to queue.
gboolean dt_dev_pixelpipe_get_realtime(const dt_dev_pixelpipe_t *pipe)
char * dt_pixelpipe_get_pipe_name(dt_dev_pixelpipe_type_t pipe_type)
void dt_dev_pixelpipe_create_nodes(dt_dev_pixelpipe_t *pipe)
void dt_dev_pixelpipe_set_realtime(dt_dev_pixelpipe_t *pipe, gboolean state)
void dt_dev_pixelpipe_cleanup_nodes(dt_dev_pixelpipe_t *pipe)
static void dt_dev_pixelpipe_set_hash(dt_dev_pixelpipe_t *pipe, const uint64_t hash)
static uint64_t dt_dev_backbuf_get_history_hash(const dt_backbuf_t *backbuf)
static uint64_t dt_dev_pixelpipe_get_hash(const dt_dev_pixelpipe_t *pipe)
static void dt_dev_pixelpipe_or_changed(dt_dev_pixelpipe_t *pipe, const dt_dev_pixelpipe_change_t flags)
static void dt_dev_pixelpipe_set_cache_request(dt_dev_pixelpipe_t *pipe, const dt_dev_pixelpipe_cache_request_t request, const struct dt_iop_module_t *module)
dt_dev_pixelpipe_change_t
@ DT_DEV_PIPE_CACHE_REQUEST
@ DT_DEV_PIPE_TOP_CHANGED
static uint64_t dt_dev_pixelpipe_get_history_hash(const dt_dev_pixelpipe_t *pipe)
static void dt_dev_pixelpipe_set_history_hash(dt_dev_pixelpipe_t *pipe, const uint64_t history_hash)
static uint64_t dt_dev_backbuf_get_hash(const dt_backbuf_t *backbuf)
@ DT_DEV_PIXELPIPE_CACHE_REQUEST_BACKBUF
@ DT_DEV_PIXELPIPE_CACHE_REQUEST_MODULE
#define DT_DEBUG_CONTROL_SIGNAL_DISCONNECT(ctlsig, cb, user_data)
struct dt_control_signal_t * dt_control_signal_get_global(void)
@ DT_SIGNAL_CACHELINE_READY
This signal is raised when one cacheline write lock is released. 1 : uint64_t cacheline hash no retur...
#define DT_DEBUG_CONTROL_SIGNAL_CONNECT(ctlsig, signal, cb, user_data)
unsigned __int64 uint64_t
struct dt_develop_blend_params_t * blend_params
struct dt_iop_module_t *gboolean enabled
A reference-sharing snapshot of dev->history, for readers that outlive a lock.
dt_iop_buffer_dsc_t dsc_out
dt_dev_request_flags_t request_histogram
dt_iop_buffer_dsc_t dsc_in
uint64_t global_mask_hash
struct dt_iop_module_t *void * data
gboolean cache_output_on_ram
dt_atomic_ptr last_history_item
gboolean gui_observable_source
uint64_t last_history_hash
int mask_rasterization_step
Rasterisation step for drawn masks, in image pixels. Always >= 1.
dt_dev_pixelpipe_type_t type
struct dt_develop_t * dev
struct dt_develop_t::@13 color_picker
Authoritative darkroom color-picker state.
struct dt_iop_module_t * gui_module
dt_pthread_rwlock_t history_mutex
struct dt_dev_pixelpipe_t * preview_pipe
dt_atomic_int mask_preview_settings_revision
Revision of the global mask-preview appearance.
struct dt_dev_pixelpipe_t * pipe
char filename[DT_MAX_FILENAME_LEN]
dt_iop_buffer_type_t datatype
Region of interest passed through the pixelpipe.
One consumer's outstanding request, owned by that consumer, not by the queue.
dt_pixelpipe_cache_ready_callback_t restart
int module_multi_priority
const void *char module_op[20]
void dt_supervisor_cache_wait(const dt_sv_op_t op, const uint64_t request_id, const uint64_t awaited_hash, const char *owner_tag, const char *op_name, const int multi_priority, const int pipe_type, const int32_t imgid, const gboolean request_emitted, const char *note)
uint64_t dt_supervisor_node_key(const int pipe_type, const char *op_name, const int multi_priority)
void dt_supervisor_node(const dt_sv_op_t op, const uint64_t node_hash, const uint64_t param_hash, const uint64_t predecessor_hash, const char *op_name, const int multi_priority, const int iop_order, const int pipe_type, const int32_t imgid)
static gboolean dt_supervisor_active(void)
static void dt_get_times(dt_times_t *t)
static double dt_get_wtime(void)
void dt_show_times_f(const dt_times_t *start, const char *prefix, const char *suffix,...) __attribute__((format(printf