linux/drivers/gpu/drm/i915/gt/intel_ring.h

/* SPDX-License-Identifier: MIT */
/*
 * Copyright © 2019 Intel Corporation
 */

#ifndef INTEL_RING_H
#define INTEL_RING_H

#include "i915_gem.h" /* GEM_BUG_ON */
#include "i915_request.h"
#include "intel_ring_types.h"

struct intel_engine_cs;

struct intel_ring *
intel_engine_create_ring(struct intel_engine_cs *engine, int size);

u32 *intel_ring_begin(struct i915_request *rq, unsigned int num_dwords);
int intel_ring_cacheline_align(struct i915_request *rq);

unsigned int intel_ring_update_space(struct intel_ring *ring);

void __intel_ring_pin(struct intel_ring *ring);
int intel_ring_pin(struct intel_ring *ring, struct i915_gem_ww_ctx *ww);
void intel_ring_unpin(struct intel_ring *ring);
void intel_ring_reset(struct intel_ring *ring, u32 tail);

void intel_ring_free(struct kref *ref);

static inline struct intel_ring *intel_ring_get(struct intel_ring *ring)
{}

static inline void intel_ring_put(struct intel_ring *ring)
{}

static inline void intel_ring_advance(struct i915_request *rq, u32 *cs)
{}

static inline u32 intel_ring_wrap(const struct intel_ring *ring, u32 pos)
{}

static inline int intel_ring_direction(const struct intel_ring *ring,
				       u32 next, u32 prev)
{}

static inline bool
intel_ring_offset_valid(const struct intel_ring *ring,
			unsigned int pos)
{}

static inline u32 intel_ring_offset(const struct i915_request *rq, void *addr)
{}

static inline void
assert_ring_tail_valid(const struct intel_ring *ring, unsigned int tail)
{}

static inline unsigned int
intel_ring_set_tail(struct intel_ring *ring, unsigned int tail)
{}

static inline unsigned int
__intel_ring_space(unsigned int head, unsigned int tail, unsigned int size)
{}

#endif /* INTEL_RING_H */