58#define SHAPE_A_HASH 0x1111111111111111ull
61#define SHAPE_B_HASH 0x2222222222222222ull
73 while(!g_atomic_int_get(&
p->stop))
92#define HUNT_MICROSECONDS 400000
101 assert_non_null(writer);
106 while(g_get_monotonic_time() < deadline && crossed == 0)
112 __asm__ __volatile__(
"" :::
"memory");
113 const size_t width =
p.backbuf.width;
114 const size_t height =
p.backbuf.height;
120 g_atomic_int_set(&
p.stop, 1);
121 g_thread_join(writer);
123 print_message(
"field-by-field: %" G_GINT64_FORMAT
" reads, %" G_GINT64_FORMAT
" crossed pairings\n", reads,
125 assert_true(crossed > 0);
135 assert_non_null(writer);
140 while(g_get_monotonic_time() < deadline)
147 g_atomic_int_set(&
p.stop, 1);
148 g_thread_join(writer);
150 print_message(
"snapshot: %" G_GINT64_FORMAT
" reads, %" G_GINT64_FORMAT
" crossed pairings\n", reads, crossed);
151 assert_int_equal(crossed, 0);
172 const struct CMUnitTest tests[] = {
177 return cmocka_run_group_tests(tests, NULL, NULL);
typedef void((*dt_cache_allocate_t)(void *userdata, dt_cache_entry_t *entry))
void dt_dev_set_backbuf(dt_backbuf_t *backbuf, const int width, const int height, const size_t bpp, const int64_t hash, const int64_t history_hash)
#define DT_PIXELPIPE_CACHE_HASH_INVALID
static dt_backbuf_state_t dt_dev_backbuf_snapshot(const dt_backbuf_t *backbuf)
Read the whole record as one publication.
static void dt_dev_backbuf_set_hash(dt_backbuf_t *backbuf, const uint64_t hash)
static uint64_t dt_dev_backbuf_get_hash(const dt_backbuf_t *backbuf)
const float uint32_t state[4]
unsigned __int64 uint64_t
One coherent publication, by value.
What the pipeline last published: which cacheline, and what shape its pixels are in.
static void test_snapshot_never_crosses_publications(void **state)
static gpointer _publisher_main(gpointer user_data)
#define HUNT_MICROSECONDS
static void test_field_by_field_read_crosses_publications(void **state)
static gboolean _pairing_is_coherent(const uint64_t hash, const size_t width, const size_t height)
Is this (hash, width, height) triple one that was ever published together?
static void test_single_field_setter_is_a_publication(void **state)
A single-field setter must publish coherently too – the histogram backbuffers are invalidated that wa...