linux/drivers/gpu/drm/i915/gem/i915_gem_context.h

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

#ifndef __I915_GEM_CONTEXT_H__
#define __I915_GEM_CONTEXT_H__

#include "i915_gem_context_types.h"

#include "gt/intel_context.h"

#include "i915_drv.h"
#include "i915_gem.h"
#include "i915_scheduler.h"
#include "intel_device_info.h"

struct drm_device;
struct drm_file;

static inline bool i915_gem_context_is_closed(const struct i915_gem_context *ctx)
{}

static inline void i915_gem_context_set_closed(struct i915_gem_context *ctx)
{}

static inline bool i915_gem_context_no_error_capture(const struct i915_gem_context *ctx)
{}

static inline void i915_gem_context_set_no_error_capture(struct i915_gem_context *ctx)
{}

static inline void i915_gem_context_clear_no_error_capture(struct i915_gem_context *ctx)
{}

static inline bool i915_gem_context_is_bannable(const struct i915_gem_context *ctx)
{}

static inline void i915_gem_context_set_bannable(struct i915_gem_context *ctx)
{}

static inline void i915_gem_context_clear_bannable(struct i915_gem_context *ctx)
{}

static inline bool i915_gem_context_is_recoverable(const struct i915_gem_context *ctx)
{}

static inline void i915_gem_context_set_recoverable(struct i915_gem_context *ctx)
{}

static inline void i915_gem_context_clear_recoverable(struct i915_gem_context *ctx)
{}

static inline bool i915_gem_context_is_persistent(const struct i915_gem_context *ctx)
{}

static inline void i915_gem_context_set_persistence(struct i915_gem_context *ctx)
{}

static inline void i915_gem_context_clear_persistence(struct i915_gem_context *ctx)
{}

static inline bool
i915_gem_context_user_engines(const struct i915_gem_context *ctx)
{}

static inline void
i915_gem_context_set_user_engines(struct i915_gem_context *ctx)
{}

static inline void
i915_gem_context_clear_user_engines(struct i915_gem_context *ctx)
{}

static inline bool
i915_gem_context_uses_protected_content(const struct i915_gem_context *ctx)
{}

/* i915_gem_context.c */
void i915_gem_init__contexts(struct drm_i915_private *i915);

int i915_gem_context_open(struct drm_i915_private *i915,
			  struct drm_file *file);
void i915_gem_context_close(struct drm_file *file);

void i915_gem_context_release(struct kref *ctx_ref);

int i915_gem_vm_create_ioctl(struct drm_device *dev, void *data,
			     struct drm_file *file);
int i915_gem_vm_destroy_ioctl(struct drm_device *dev, void *data,
			      struct drm_file *file);

int i915_gem_context_create_ioctl(struct drm_device *dev, void *data,
				  struct drm_file *file);
int i915_gem_context_destroy_ioctl(struct drm_device *dev, void *data,
				   struct drm_file *file);
int i915_gem_context_getparam_ioctl(struct drm_device *dev, void *data,
				    struct drm_file *file_priv);
int i915_gem_context_setparam_ioctl(struct drm_device *dev, void *data,
				    struct drm_file *file_priv);
int i915_gem_context_reset_stats_ioctl(struct drm_device *dev, void *data,
				       struct drm_file *file);

struct i915_gem_context *
i915_gem_context_lookup(struct drm_i915_file_private *file_priv, u32 id);

static inline struct i915_gem_context *
i915_gem_context_get(struct i915_gem_context *ctx)
{}

static inline void i915_gem_context_put(struct i915_gem_context *ctx)
{}

static inline struct i915_address_space *
i915_gem_context_vm(struct i915_gem_context *ctx)
{}

static inline bool i915_gem_context_has_full_ppgtt(struct i915_gem_context *ctx)
{}

static inline struct i915_address_space *
i915_gem_context_get_eb_vm(struct i915_gem_context *ctx)
{}

static inline struct i915_gem_engines *
i915_gem_context_engines(struct i915_gem_context *ctx)
{}

static inline struct i915_gem_engines *
i915_gem_context_lock_engines(struct i915_gem_context *ctx)
	__acquires(&ctx->engines_mutex)
{}

static inline void
i915_gem_context_unlock_engines(struct i915_gem_context *ctx)
	__releases(&ctx->engines_mutex)
{}

static inline struct intel_context *
i915_gem_context_get_engine(struct i915_gem_context *ctx, unsigned int idx)
{}

static inline void
i915_gem_engines_iter_init(struct i915_gem_engines_iter *it,
			   struct i915_gem_engines *engines)
{}

struct intel_context *
i915_gem_engines_iter_next(struct i915_gem_engines_iter *it);

#define for_each_gem_engine(ce, engines, it)

void i915_gem_context_module_exit(void);
int i915_gem_context_module_init(void);

struct i915_lut_handle *i915_lut_handle_alloc(void);
void i915_lut_handle_free(struct i915_lut_handle *lut);

int i915_gem_user_to_context_sseu(struct intel_gt *gt,
				  const struct drm_i915_gem_context_param_sseu *user,
				  struct intel_sseu *context);

#endif /* !__I915_GEM_CONTEXT_H__ */