Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
dev_pixelpipe.h File Reference
#include <inttypes.h>
#include <stdint.h>
#include <glib.h>
+ Include dependency graph for dev_pixelpipe.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_cache_wait_t
 

Macros

#define dt_dev_pixelpipe_rebuild_all(dev)   DT_DEBUG_TRACE_WRAPPER(DT_DEBUG_DEV, dt_dev_pixelpipe_rebuild_all_real, (dev))
 
#define dt_dev_pixelpipe_update_history_main(dev)   DT_DEBUG_TRACE_WRAPPER(DT_DEBUG_DEV, dt_dev_pixelpipe_update_history_main_real, (dev))
 
#define dt_dev_pixelpipe_update_history_preview(dev)   DT_DEBUG_TRACE_WRAPPER(DT_DEBUG_DEV, dt_dev_pixelpipe_update_history_preview_real, (dev))
 
#define dt_dev_pixelpipe_update_history_all(dev)   DT_DEBUG_TRACE_WRAPPER(DT_DEBUG_DEV, dt_dev_pixelpipe_update_history_all_real, (dev))
 
#define dt_dev_pixelpipe_update_zoom_main(dev)   DT_DEBUG_TRACE_WRAPPER(DT_DEBUG_DEV, dt_dev_pixelpipe_update_zoom_main_real, (dev))
 
#define dt_dev_pixelpipe_update_zoom_preview(dev)   DT_DEBUG_TRACE_WRAPPER(DT_DEBUG_DEV, dt_dev_pixelpipe_update_zoom_preview_real, (dev))
 
#define dt_dev_pixelpipe_resync_history_all(dev)   DT_DEBUG_TRACE_WRAPPER(DT_DEBUG_DEV, dt_dev_pixelpipe_resync_history_all_real, (dev))
 
#define dt_dev_pixelpipe_resync_history_main(dev)   DT_DEBUG_TRACE_WRAPPER(DT_DEBUG_DEV, dt_dev_pixelpipe_resync_history_main_real, (dev))
 
#define dt_dev_pixelpipe_resync_history_preview(dev)   DT_DEBUG_TRACE_WRAPPER(DT_DEBUG_DEV, dt_dev_pixelpipe_resync_history_preview_real, (dev))
 

Typedefs

typedef void(* dt_dev_pixelpipe_cache_ready_callback_t) (gpointer user_data)
 
typedef struct dt_dev_pixelpipe_cache_wait_t dt_dev_pixelpipe_cache_wait_t
 

Functions

void dt_dev_pixelpipe_rebuild_all_real (struct dt_develop_t *dev)
 
void dt_dev_pixelpipe_update_history_main_real (struct dt_develop_t *dev)
 
void dt_dev_pixelpipe_update_history_preview_real (struct dt_develop_t *dev)
 
void dt_dev_pixelpipe_update_history_all_real (struct dt_develop_t *dev)
 
void dt_dev_pixelpipe_update_zoom_main_real (struct dt_develop_t *dev)
 
void dt_dev_pixelpipe_update_zoom_preview_real (struct dt_develop_t *dev)
 
void dt_dev_pixelpipe_resync_history_all_real (struct dt_develop_t *dev)
 
void dt_dev_pixelpipe_resync_history_main_real (struct dt_develop_t *dev)
 
void dt_dev_pixelpipe_resync_history_preview_real (struct dt_develop_t *dev)
 
void dt_dev_pixelpipe_reset_all (struct dt_develop_t *dev)
 
void dt_dev_pixelpipe_change_zoom_main (struct dt_develop_t *dev)
 
void dt_dev_pixelpipe_get_roi_out (struct dt_dev_pixelpipe_t *pipe, const int width_in, const int height_in, int *width, int *height)
 
void dt_dev_pixelpipe_get_roi_in (struct dt_dev_pixelpipe_t *pipe, const struct dt_iop_roi_t roi_out)
 
gboolean dt_dev_pixelpipe_activemodule_disables_currentmodule (struct dt_develop_t *dev, struct dt_iop_module_t *current_module)
 
void dt_dev_pixelpipe_change (struct dt_dev_pixelpipe_t *pipe)
 
void dt_dev_pixelpipe_sync_virtual (struct dt_develop_t *dev, dt_dev_pixelpipe_change_t flag)
 
uint64_t dt_dev_pixelpipe_node_hash (struct dt_dev_pixelpipe_t *pipe, const struct dt_dev_pixelpipe_iop_t *piece, const struct dt_iop_roi_t, const int pos)
 
const struct dt_dev_pixelpipe_iop_tdt_dev_pixelpipe_get_module_piece (const struct dt_dev_pixelpipe_t *pipe, const struct dt_iop_module_t *module)
 Return the enabled piece owned by module in pipe.
 
const struct dt_dev_pixelpipe_iop_tdt_dev_pixelpipe_get_prev_enabled_piece (const struct dt_dev_pixelpipe_t *pipe, const struct dt_dev_pixelpipe_iop_t *piece)
 Return the closest enabled piece located immediately before piece in pipe.
 
void dt_dev_pixelpipe_cache_wait_cleanup (dt_dev_pixelpipe_cache_wait_t *wait)
 
gboolean dt_dev_pixelpipe_cache_peek_gui (dt_dev_pixelpipe_t *pipe, const struct dt_dev_pixelpipe_iop_t *piece, void **data, struct 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)
 Reopen one GUI-visible host cacheline, or queue the minimal pipe recompute needed to publish it.
 
void dt_pixelpipe_get_global_hash (struct dt_dev_pixelpipe_t *pipe)
 
gboolean dt_dev_pixelpipe_is_backbufer_valid (struct dt_dev_pixelpipe_t *pipe)
 
gboolean dt_dev_pixelpipe_is_pipeline_valid (struct dt_dev_pixelpipe_t *pipe)
 

Macro Definition Documentation

◆ dt_dev_pixelpipe_rebuild_all

#define dt_dev_pixelpipe_rebuild_all (   dev)    DT_DEBUG_TRACE_WRAPPER(DT_DEBUG_DEV, dt_dev_pixelpipe_rebuild_all_real, (dev))

◆ dt_dev_pixelpipe_resync_history_all

#define dt_dev_pixelpipe_resync_history_all (   dev)    DT_DEBUG_TRACE_WRAPPER(DT_DEBUG_DEV, dt_dev_pixelpipe_resync_history_all_real, (dev))

◆ dt_dev_pixelpipe_resync_history_main

#define dt_dev_pixelpipe_resync_history_main (   dev)    DT_DEBUG_TRACE_WRAPPER(DT_DEBUG_DEV, dt_dev_pixelpipe_resync_history_main_real, (dev))

◆ dt_dev_pixelpipe_resync_history_preview

#define dt_dev_pixelpipe_resync_history_preview (   dev)    DT_DEBUG_TRACE_WRAPPER(DT_DEBUG_DEV, dt_dev_pixelpipe_resync_history_preview_real, (dev))

◆ dt_dev_pixelpipe_update_history_all

#define dt_dev_pixelpipe_update_history_all (   dev)    DT_DEBUG_TRACE_WRAPPER(DT_DEBUG_DEV, dt_dev_pixelpipe_update_history_all_real, (dev))

◆ dt_dev_pixelpipe_update_history_main

#define dt_dev_pixelpipe_update_history_main (   dev)    DT_DEBUG_TRACE_WRAPPER(DT_DEBUG_DEV, dt_dev_pixelpipe_update_history_main_real, (dev))

◆ dt_dev_pixelpipe_update_history_preview

#define dt_dev_pixelpipe_update_history_preview (   dev)    DT_DEBUG_TRACE_WRAPPER(DT_DEBUG_DEV, dt_dev_pixelpipe_update_history_preview_real, (dev))

◆ dt_dev_pixelpipe_update_zoom_main

#define dt_dev_pixelpipe_update_zoom_main (   dev)    DT_DEBUG_TRACE_WRAPPER(DT_DEBUG_DEV, dt_dev_pixelpipe_update_zoom_main_real, (dev))

◆ dt_dev_pixelpipe_update_zoom_preview

#define dt_dev_pixelpipe_update_zoom_preview (   dev)    DT_DEBUG_TRACE_WRAPPER(DT_DEBUG_DEV, dt_dev_pixelpipe_update_zoom_preview_real, (dev))

Typedef Documentation

◆ dt_dev_pixelpipe_cache_ready_callback_t

typedef void(* dt_dev_pixelpipe_cache_ready_callback_t) (gpointer user_data)

◆ dt_dev_pixelpipe_cache_wait_t

Function Documentation

◆ dt_dev_pixelpipe_activemodule_disables_currentmodule()

◆ dt_dev_pixelpipe_cache_peek_gui()

gboolean dt_dev_pixelpipe_cache_peek_gui ( dt_dev_pixelpipe_t pipe,
const struct dt_dev_pixelpipe_iop_t piece,
void **  data,
struct 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 
)

Reopen one GUI-visible host cacheline, or queue the minimal pipe recompute needed to publish it.

GUI samplers only consume host-visible buffers. This wrapper first tries to reopen the requested cacheline:

  • piece output if piece is not NULL,
  • the pipe final backbuffer cacheline if piece is NULL.

If that cacheline does not exist yet, or only exists as a device-side OpenCL payload, the wrapper schedules one dedicated pipe run:

  • module requests stop recursion at that module and force one host cacheline there,
  • NULL requests ask for the final pipe backbuffer.

The request uses a dedicated pipe state instead of pretending history changed, so the worker can rerun just enough of the current synchronized graph to satisfy the GUI reader.

Parameters
pipeCurrent live pipe.
pieceTarget module piece, or NULL for the final backbuffer.
dataReturned host-visible pixel buffer on success.
cache_entryReturned cache entry owning data on success.
waitOptional one-shot cacheline-ready watcher owned by the caller.
restartOptional restart callback used with wait when the cacheline must be published asynchronously.
restart_dataOpaque pointer forwarded to restart.
Returns
TRUE when a host buffer is immediately available, FALSE when the caller must retry after the queued pipe update completed.

◆ dt_dev_pixelpipe_cache_wait_cleanup()

◆ dt_dev_pixelpipe_change()

void dt_dev_pixelpipe_change ( struct dt_dev_pixelpipe_t pipe)

Consume and clear pending change flags in one atomic step.

The previous get-then-store sequence could lose updates when another thread OR-ed a new flag between the load and the reset. That made history resync requests randomly disappear, especially under fast GUI actions such as toggles or consecutive parameter commits.

References _get_debug_pipe_name(), _refresh_pipe_detail_mask_state(), _seal_opencl_cache_policy(), _sync_realtime_top_history_in_place(), dt_dev_pixelpipe_t::bypass_blendif, dt_dev_pixelpipe_t::changed, dt_dev_pixelpipe_t::dev, dt_atomic_exch_int(), DT_DEBUG_DEV, DT_DEV_DETAIL_MASK_NONE, dt_dev_get_history_hash(), DT_DEV_PIPE_CACHE_REQUEST, DT_DEV_PIPE_REMOVE, DT_DEV_PIPE_SYNCH, DT_DEV_PIPE_TOP_CHANGED, DT_DEV_PIPE_UNCHANGED, DT_DEV_PIPE_ZOOMED, dt_dev_pixelpipe_cleanup_nodes(), dt_dev_pixelpipe_create_nodes(), DT_DEV_PIXELPIPE_DISPLAY_NONE, dt_dev_pixelpipe_get_roi_out(), dt_dev_pixelpipe_set_history_hash(), dt_dev_pixelpipe_sync_no_history(), dt_dev_pixelpipe_synch_all, dt_dev_pixelpipe_synch_top(), dt_free, dt_get_times(), dt_print(), dt_pthread_rwlock_rdlock, dt_pthread_rwlock_unlock, dt_show_times_f(), dt_develop_t::history_mutex, dt_dev_pixelpipe_t::iheight, dt_dev_pixelpipe_t::iwidth, dt_dev_pixelpipe_t::mask_display, dt_dev_pixelpipe_t::nodes, dt_dev_pixelpipe_t::processed_height, dt_dev_pixelpipe_t::processed_width, type, and dt_dev_pixelpipe_t::want_detail_mask.

Referenced by _sync_virtual_pipe(), dt_dev_darkroom_pipeline(), and dt_dev_get_thumbnail_size().

◆ dt_dev_pixelpipe_change_zoom_main()

◆ dt_dev_pixelpipe_get_module_piece()

const struct dt_dev_pixelpipe_iop_t * dt_dev_pixelpipe_get_module_piece ( const struct dt_dev_pixelpipe_t pipe,
const struct dt_iop_module_t module 
)

Return the enabled piece owned by module in pipe.

GUI-side cache readers must resolve the current live piece from the current pipe graph every time they sample. Piece pointers are not stable across history resyncs or pipe rebuilds, so callers should never persist them.

Parameters
pipeCurrent pipe graph.
moduleModule instance to look up.
Returns
The enabled piece matching module, or NULL if none exists in the current pipe graph.

◆ dt_dev_pixelpipe_get_prev_enabled_piece()

const struct dt_dev_pixelpipe_iop_t * dt_dev_pixelpipe_get_prev_enabled_piece ( const struct dt_dev_pixelpipe_t pipe,
const struct dt_dev_pixelpipe_iop_t piece 
)

Return the closest enabled piece located immediately before piece in pipe.

Cache readers that need the input buffer of one module must reopen the previous enabled module output, not simply the previous list node, because disabled pieces keep their place in pipe->nodes while not producing any cacheline. This utility keeps that rule centralized at the pixelpipe level.

Parameters
pipeCurrent pipe graph.
pieceReference piece inside pipe.
Returns
The previous enabled piece, or NULL if piece is the first enabled node or if either input is invalid.

◆ dt_dev_pixelpipe_get_roi_in()

◆ dt_dev_pixelpipe_get_roi_out()

◆ dt_dev_pixelpipe_is_backbufer_valid()

◆ dt_dev_pixelpipe_is_pipeline_valid()

gboolean dt_dev_pixelpipe_is_pipeline_valid ( struct dt_dev_pixelpipe_t pipe)

◆ dt_dev_pixelpipe_node_hash()

uint64_t dt_dev_pixelpipe_node_hash ( struct dt_dev_pixelpipe_t pipe,
const struct dt_dev_pixelpipe_iop_t piece,
const struct dt_iop_roi_t  ,
const int  pos 
)

◆ dt_dev_pixelpipe_rebuild_all_real()

◆ dt_dev_pixelpipe_reset_all()

◆ dt_dev_pixelpipe_resync_history_all_real()

◆ dt_dev_pixelpipe_resync_history_main_real()

void dt_dev_pixelpipe_resync_history_main_real ( struct dt_develop_t dev)

◆ dt_dev_pixelpipe_resync_history_preview_real()

void dt_dev_pixelpipe_resync_history_preview_real ( struct dt_develop_t dev)

◆ dt_dev_pixelpipe_sync_virtual()

void dt_dev_pixelpipe_sync_virtual ( struct dt_develop_t dev,
dt_dev_pixelpipe_change_t  flag 
)

References _sync_virtual_pipe(), and flag.

Referenced by gui_post_expose(), and gui_post_expose().

◆ dt_dev_pixelpipe_update_history_all_real()

◆ dt_dev_pixelpipe_update_history_main_real()

void dt_dev_pixelpipe_update_history_main_real ( struct dt_develop_t dev)

◆ dt_dev_pixelpipe_update_history_preview_real()

void dt_dev_pixelpipe_update_history_preview_real ( struct dt_develop_t dev)

◆ dt_dev_pixelpipe_update_zoom_main_real()

◆ dt_dev_pixelpipe_update_zoom_preview_real()

void dt_dev_pixelpipe_update_zoom_preview_real ( struct dt_develop_t dev)

◆ dt_pixelpipe_get_global_hash()