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 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 (void)
 

Macro Definition Documentation

◆ HASH_A

#define HASH_A   0x0A0A0A0A0A0A0A0Aull

Definition at line 43 of file test_pipe_cache_host_stale.c.

◆ HASH_B

#define HASH_B   0x0B0B0B0B0B0B0B0Bull

Definition at line 44 of file test_pipe_cache_host_stale.c.

◆ HASH_C

#define HASH_C   0x0C0C0C0C0C0C0C0Cull

Definition at line 45 of file test_pipe_cache_host_stale.c.

◆ 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 42 of file test_pipe_cache_host_stale.c.

Function Documentation

◆ _produce()

◆ _rekeyed_line_publishes_no_host_pixels()

◆ _rewritten_line_publishes_its_host_pixels()

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

◆ _setup()

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

Definition at line 47 of file test_pipe_cache_host_stale.c.

References dt_dev_pixelpipe_cache_init(), and FALSE.

Referenced by main().

◆ _teardown()

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

Definition at line 52 of file test_pipe_cache_host_stale.c.

References dt_dev_pixelpipe_cache_cleanup().

Referenced by main().

◆ _without_rekey_the_previous_output_stays()

◆ main()