2 * SPDX-License-Identifier: MIT
4 * Copyright © 2019 Intel Corporation
7 #ifndef INTEL_RING_TYPES_H
8 #define INTEL_RING_TYPES_H
10 #include <linux/atomic.h>
11 #include <linux/kref.h>
12 #include <linux/types.h>
15 * Early gen2 devices have a cacheline of just 32 bytes, using 64 is overkill,
16 * but keeps the logic simple. Indeed, the whole purpose of this macro is just
17 * to give some inclination as to some of the magic values used in the various
20 #define CACHELINE_BYTES 64
21 #define CACHELINE_DWORDS (CACHELINE_BYTES / sizeof(u32))
31 * As we have two types of rings, one global to the engine used
32 * by ringbuffer submission and those that are exclusive to a
33 * context used by execlists, we have to play safe and allow
34 * atomic updates to the pin_count. However, the actual pinning
35 * of the context is either done during initialisation for
36 * ringbuffer submission or serialised as part of the context
37 * pinning for execlists, and so we do not need a mutex ourselves
38 * to serialise intel_ring_pin/intel_ring_unpin.
51 #endif /* INTEL_RING_TYPES_H */