Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
test_pipe_cache_host_stale.c File Reference
#include "caches/pixelpipe_cache.h"
#include "system/atomic.h"
#include "system/dtpthread.h"
#include <stdarg.h>
#include <stddef.h>
#include <setjmp.h>
#include <stdint.h>
#include <string.h>
#include <cmocka.h>
#include "win/main_wrapper.h"
Include dependency graph for test_pipe_cache_host_stale.c:

Go to the source code of this file.

Macros

#define LINE_BYTES   (256 * 1024)
#define HASH_A   0x0A0A0A0A0A0A0A0Aull
#define HASH_B   0x0B0B0B0B0B0B0B0Bull
#define HASH_C   0x0C0C0C0C0C0C0C0Cull

Functions

static int _setup (void **state __attribute__((unused)))
static int _teardown (void **state __attribute__((unused)))
static dt_pixel_cache_entry_t _produce (const uint64_t hash, const dt_pixel_cache_entry_t *hint, const gboolean allow_rekey, const gboolean write_host, const dt_dev_pixelpipe_cache_writable_status_t expected)
static void _rekeyed_line_publishes_no_host_pixels (void **state __attribute__((unused)))
static void _rewritten_line_publishes_its_host_pixels (void **state __attribute__((unused)))
static void _without_rekey_the_previous_output_stays (void **state __attribute__((unused)))
int main (int argc, char *argv[])

Macro Definition Documentation

◆ HASH_A

#define HASH_A   0x0A0A0A0A0A0A0A0Aull

Definition at line 47 of file test_pipe_cache_host_stale.c.

◆ HASH_B

#define HASH_B   0x0B0B0B0B0B0B0B0Bull

◆ HASH_C

#define HASH_C   0x0C0C0C0C0C0C0C0Cull

◆ LINE_BYTES

#define LINE_BYTES   (256 * 1024)

A cacheline rekeyed in place publishes no host pixels until they are rewritten.

A module's output cacheline is reused for its next output by moving it to the new hash, host buffer included. When that next output stays on the GPU, the host buffer keeps the previous hash's pixels under the new key, where a CPU-only module downstream, the GUI or an exact hit in another pipe would read them as the new hash's.

These tests drive the cache alone, without a pipe or a device: the contract is the cache's.

Definition at line 46 of file test_pipe_cache_host_stale.c.

Function Documentation

◆ _produce()

◆ _rekeyed_line_publishes_no_host_pixels()

◆ _rewritten_line_publishes_its_host_pixels()

void _rewritten_line_publishes_its_host_pixels ( void **state __attribute__(unused))
static

◆ _setup()

int _setup ( void **state __attribute__(unused))
static

Definition at line 51 of file test_pipe_cache_host_stale.c.

References dt_dev_pixelpipe_cache_init(), FALSE, and state.

◆ _teardown()

int _teardown ( void **state __attribute__(unused))
static

Definition at line 56 of file test_pipe_cache_host_stale.c.

References dt_dev_pixelpipe_cache_cleanup(), and state.

◆ _without_rekey_the_previous_output_stays()

◆ main()

int main ( int argc,
char * argv[] )
Todo
: test if file with replaced ext exists
Todo
: add a callback to set the bpp without going through the config
Todo
: have a parameter in command line to get the export presets

Definition at line 180 of file test_pipe_cache_host_stale.c.

References _rekeyed_line_publishes_no_host_pixels(), _rewritten_line_publishes_its_host_pixels(), _setup(), _teardown(), and _without_rekey_the_previous_output_stays().