mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-12 13:55:32 +00:00
f5d974f9d2
Track the currently bound address space used by the HW context. Minor conversions to use the local intel_context.vm are made, leaving behind some more surgery required to make intel_context the primary through the selftests. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20190730143209.4549-2-chris@chris-wilson.co.uk
75 lines
1.7 KiB
C
75 lines
1.7 KiB
C
/*
|
|
* SPDX-License-Identifier: MIT
|
|
*
|
|
* Copyright © 2019 Intel Corporation
|
|
*/
|
|
|
|
#ifndef __INTEL_CONTEXT_TYPES__
|
|
#define __INTEL_CONTEXT_TYPES__
|
|
|
|
#include <linux/kref.h>
|
|
#include <linux/list.h>
|
|
#include <linux/mutex.h>
|
|
#include <linux/types.h>
|
|
|
|
#include "i915_active_types.h"
|
|
#include "i915_utils.h"
|
|
#include "intel_engine_types.h"
|
|
#include "intel_sseu.h"
|
|
|
|
struct i915_gem_context;
|
|
struct i915_vma;
|
|
struct intel_context;
|
|
struct intel_ring;
|
|
|
|
struct intel_context_ops {
|
|
int (*pin)(struct intel_context *ce);
|
|
void (*unpin)(struct intel_context *ce);
|
|
|
|
void (*enter)(struct intel_context *ce);
|
|
void (*exit)(struct intel_context *ce);
|
|
|
|
void (*reset)(struct intel_context *ce);
|
|
void (*destroy)(struct kref *kref);
|
|
};
|
|
|
|
struct intel_context {
|
|
struct kref ref;
|
|
|
|
struct intel_engine_cs *engine;
|
|
struct intel_engine_cs *inflight;
|
|
#define intel_context_inflight(ce) ptr_mask_bits((ce)->inflight, 2)
|
|
#define intel_context_inflight_count(ce) ptr_unmask_bits((ce)->inflight, 2)
|
|
#define intel_context_inflight_inc(ce) ptr_count_inc(&(ce)->inflight)
|
|
#define intel_context_inflight_dec(ce) ptr_count_dec(&(ce)->inflight)
|
|
|
|
struct i915_address_space *vm;
|
|
struct i915_gem_context *gem_context;
|
|
|
|
struct list_head signal_link;
|
|
struct list_head signals;
|
|
|
|
struct i915_vma *state;
|
|
struct intel_ring *ring;
|
|
|
|
u32 *lrc_reg_state;
|
|
u64 lrc_desc;
|
|
|
|
unsigned int active_count; /* notionally protected by timeline->mutex */
|
|
|
|
atomic_t pin_count;
|
|
struct mutex pin_mutex; /* guards pinning and associated on-gpuing */
|
|
|
|
/**
|
|
* active: Active tracker for the rq activity (inc. external) on this
|
|
* intel_context object.
|
|
*/
|
|
struct i915_active active;
|
|
|
|
const struct intel_context_ops *ops;
|
|
|
|
/** sseu: Control eu/slice partitioning */
|
|
struct intel_sseu sseu;
|
|
};
|
|
|
|
#endif /* __INTEL_CONTEXT_TYPES__ */
|