![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include "caches/pixelpipe_cache.h"#include "develop/imageop.h"#include "develop/pixelpipe.h"#include "develop/pixelpipe_hb.h"#include "system/atomic.h"#include <stdarg.h>#include <stddef.h>#include <setjmp.h>#include <stdint.h>#include <string.h>#include <cmocka.h>#include <glib.h>#include "win/main_wrapper.h"
Include dependency graph for test_pipe_cleanup_nodes_masks.c:Go to the source code of this file.
Macros | |
| #define | LINE_BYTES (256 * 1024) |
| #define | HASH_RASTER 0x0B0B0B0B0B0B0B0BULL |
| #define | HASH_DETAIL 0x0C0C0C0C0C0C0C0CULL |
| #define | HASH_OUTPUT 0x0D0D0D0D0D0D0D0DULL |
Functions | |
| static int | _setup (void **state __attribute__((unused))) |
| static int | _teardown (void **state __attribute__((unused))) |
| static dt_pixel_cache_entry_t * | _publish (const uint64_t hash) |
| static void | _pipe_holding_masks (dt_dev_pixelpipe_t *pipe) |
| static void | _cleanup_nodes_releases_the_masks (void **state __attribute__((unused))) |
| static void | _released_masks_go_with_the_flush (void **state __attribute__((unused))) |
| static void | _detailmask_output (dt_iop_module_t *module, dt_dev_pixelpipe_iop_t *piece, const char *op) |
| static void | _detail_output_with_its_mask_stands (void **state __attribute__((unused))) |
| static void | _detail_output_without_its_mask_goes (void **state __attribute__((unused))) |
| static void | _other_output_stands (void **state __attribute__((unused))) |
| int | main (int argc, char *argv[]) |
| #define HASH_DETAIL 0x0C0C0C0C0C0C0C0CULL |
Definition at line 58 of file test_pipe_cleanup_nodes_masks.c.
| #define HASH_OUTPUT 0x0D0D0D0D0D0D0D0DULL |
Definition at line 127 of file test_pipe_cleanup_nodes_masks.c.
| #define HASH_RASTER 0x0B0B0B0B0B0B0B0BULL |
Definition at line 57 of file test_pipe_cleanup_nodes_masks.c.
| #define LINE_BYTES (256 * 1024) |
The side-band masks of a graph go with its nodes.
A pipe references the raster masks its graph published or reopened, and the detail mask, so that the LRU cannot evict them between two renders. The darkroom's pipes live for the whole session and leave() destroys their nodes only: the references used to be released by the next render or by dt_dev_pixelpipe_cleanup(), so back in the lighttable the masks of the last image stayed referenced, and no memory pressure could free them.
Released, a mask can be evicted while the output of its provider survives. For the detail mask, whose provider is the hidden detailmask stage, a cached output then stands for the stage only while its mask is there too: dt_dev_pixelpipe_rawdetail_mask_check_hit().
These tests drive a pipe with no node: the masks are lines the test publishes itself, held the way the pipe holds them.
Definition at line 56 of file test_pipe_cleanup_nodes_masks.c.
Destroying the nodes releases what the graph referenced, and forgets it.
Definition at line 97 of file test_pipe_cleanup_nodes_masks.c.
References _pipe_holding_masks(), dt_atomic_get_int(), dt_dev_pixelpipe_cache_get_entry(), dt_dev_pixelpipe_cleanup_nodes(), DT_PIXELPIPE_CACHE_HASH_INVALID, HASH_DETAIL, HASH_RASTER, pipe, dt_dev_pixelpipe_t::raster_mask_hashes, dt_dev_pixelpipe_t::rawdetail_mask_hash, and TRUE.
Referenced by main().
Its mask there, the output stands, and the pipe holds the mask from then on.
Definition at line 143 of file test_pipe_cleanup_nodes_masks.c.
References _detailmask_output(), _publish(), dt_atomic_get_int(), dt_dev_pixelpipe_cache_get_entry(), dt_dev_pixelpipe_cache_unref_entry(), dt_dev_pixelpipe_cleanup_nodes(), dt_dev_pixelpipe_rawdetail_mask_check_hit(), dt_dev_pixelpipe_rawdetail_mask_hash(), DT_PIXELPIPE_CACHE_HASH_INVALID, FALSE, HASH_OUTPUT, piece, pipe, dt_dev_pixelpipe_t::raster_mask_hashes, dt_dev_pixelpipe_t::rawdetail_mask_hash, dt_dev_pixelpipe_t::rawdetail_mask_roi, TRUE, and dt_iop_roi_t::width.
Referenced by main().
Its mask evicted, the output goes, so that the stage runs and publishes the mask again.
Definition at line 166 of file test_pipe_cleanup_nodes_masks.c.
References _detailmask_output(), dt_dev_pixelpipe_cache_get_entry(), dt_dev_pixelpipe_rawdetail_mask_check_hit(), DT_PIXELPIPE_CACHE_HASH_INVALID, HASH_OUTPUT, piece, pipe, and dt_dev_pixelpipe_t::rawdetail_mask_hash.
Referenced by main().
|
static |
Definition at line 130 of file test_pipe_cleanup_nodes_masks.c.
References _publish(), dt_dev_pixelpipe_cache_unref_entry(), HASH_OUTPUT, dt_iop_module_t::op, and piece.
Referenced by _detail_output_with_its_mask_stands(), _detail_output_without_its_mask_goes(), and _other_output_stands().
Any other stage's output stands as it is.
Definition at line 181 of file test_pipe_cleanup_nodes_masks.c.
References _detailmask_output(), dt_dev_pixelpipe_cache_get_entry(), dt_dev_pixelpipe_rawdetail_mask_check_hit(), DT_PIXELPIPE_CACHE_HASH_INVALID, HASH_OUTPUT, piece, pipe, and dt_dev_pixelpipe_t::rawdetail_mask_hash.
Referenced by main().
|
static |
Definition at line 85 of file test_pipe_cleanup_nodes_masks.c.
References _publish(), FALSE, HASH_DETAIL, HASH_RASTER, pipe, dt_dev_pixelpipe_t::raster_mask_hashes, and dt_dev_pixelpipe_t::rawdetail_mask_hash.
Referenced by _cleanup_nodes_releases_the_masks(), and _released_masks_go_with_the_flush().
|
static |
Definition at line 73 of file test_pipe_cleanup_nodes_masks.c.
References dt_dev_pixelpipe_cache_get(), dt_dev_pixelpipe_cache_wrlock_entry(), FALSE, hash, LINE_BYTES, and TRUE.
Referenced by _detail_output_with_its_mask_stands(), _detailmask_output(), and _pipe_holding_masks().
Released, the masks are lines like any other: the next flush frees them.
Definition at line 113 of file test_pipe_cleanup_nodes_masks.c.
References _pipe_holding_masks(), dt_dev_pixelpipe_cache_flush(), dt_dev_pixelpipe_cache_get_entry(), dt_dev_pixelpipe_cleanup_nodes(), HASH_DETAIL, HASH_RASTER, pipe, dt_dev_pixelpipe_t::raster_mask_hashes, and TRUE.
Referenced by main().
Definition at line 60 of file test_pipe_cleanup_nodes_masks.c.
References dt_dev_pixelpipe_cache_init(), and FALSE.
Referenced by main().
Definition at line 65 of file test_pipe_cleanup_nodes_masks.c.
References dt_dev_pixelpipe_cache_cleanup().
Referenced by main().
| int main | ( | int | argc, |
| char * | argv[] | ||
| ) |
Definition at line 194 of file test_pipe_cleanup_nodes_masks.c.
References _cleanup_nodes_releases_the_masks(), _detail_output_with_its_mask_stands(), _detail_output_without_its_mask_goes(), _other_output_stands(), _released_masks_go_with_the_flush(), _setup(), and _teardown().