diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2016-05-24 09:53:34 -0400 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2016-05-24 10:27:14 -0400 |
commit | e2efd13007cbdfb21a973faccddf967d86165d69 (patch) | |
tree | 6da8aacad997ef75138eb9878118fa9fb140b91a | |
parent | 2335986dd46f4fdfd11d613b68f4879c92726b47 (diff) |
drm/i915: Rename struct intel_context
Our goal is to rename the anonymous per-engine struct beneath the
current intel_context. However, after a lively debate resolving around
the confusion between intel_context_engine and intel_engine_context, the
realisation is that the two structs target different users. The outer
struct is API / user facing, and so carries the higher level GEM
information. The inner struct is hw facing. Thus we want to name the
inner struct intel_context and the outer one i915_gem_context. As the
first step, we need to rename the current struct:
s/struct intel_context/struct i915_gem_context/
which fits much better with its constructors already conveying the
i915_gem_context prefix!
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Dave Gordon <david.s.gordon@intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1464098023-3294-1-git-send-email-chris@chris-wilson.co.uk
-rw-r--r-- | drivers/gpu/drm/i915/i915_debugfs.c | 10 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_drv.h | 22 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem.c | 8 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem_context.c | 52 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem_execbuffer.c | 10 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_guc_submission.c | 12 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_sysfs.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_trace.h | 12 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_guc.h | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_lrc.c | 22 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_lrc.h | 10 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_ringbuffer.h | 4 |
12 files changed, 84 insertions, 82 deletions
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c index e606c6acef0f..424e11efa3e1 100644 --- a/drivers/gpu/drm/i915/i915_debugfs.c +++ b/drivers/gpu/drm/i915/i915_debugfs.c | |||
@@ -199,7 +199,7 @@ describe_obj(struct seq_file *m, struct drm_i915_gem_object *obj) | |||
199 | seq_printf(m, " (frontbuffer: 0x%03x)", obj->frontbuffer_bits); | 199 | seq_printf(m, " (frontbuffer: 0x%03x)", obj->frontbuffer_bits); |
200 | } | 200 | } |
201 | 201 | ||
202 | static void describe_ctx(struct seq_file *m, struct intel_context *ctx) | 202 | static void describe_ctx(struct seq_file *m, struct i915_gem_context *ctx) |
203 | { | 203 | { |
204 | seq_putc(m, ctx->legacy_hw_ctx.initialized ? 'I' : 'i'); | 204 | seq_putc(m, ctx->legacy_hw_ctx.initialized ? 'I' : 'i'); |
205 | seq_putc(m, ctx->remap_slice ? 'R' : 'r'); | 205 | seq_putc(m, ctx->remap_slice ? 'R' : 'r'); |
@@ -2000,7 +2000,7 @@ static int i915_context_status(struct seq_file *m, void *unused) | |||
2000 | struct drm_device *dev = node->minor->dev; | 2000 | struct drm_device *dev = node->minor->dev; |
2001 | struct drm_i915_private *dev_priv = dev->dev_private; | 2001 | struct drm_i915_private *dev_priv = dev->dev_private; |
2002 | struct intel_engine_cs *engine; | 2002 | struct intel_engine_cs *engine; |
2003 | struct intel_context *ctx; | 2003 | struct i915_gem_context *ctx; |
2004 | enum intel_engine_id id; | 2004 | enum intel_engine_id id; |
2005 | int ret; | 2005 | int ret; |
2006 | 2006 | ||
@@ -2046,7 +2046,7 @@ static int i915_context_status(struct seq_file *m, void *unused) | |||
2046 | } | 2046 | } |
2047 | 2047 | ||
2048 | static void i915_dump_lrc_obj(struct seq_file *m, | 2048 | static void i915_dump_lrc_obj(struct seq_file *m, |
2049 | struct intel_context *ctx, | 2049 | struct i915_gem_context *ctx, |
2050 | struct intel_engine_cs *engine) | 2050 | struct intel_engine_cs *engine) |
2051 | { | 2051 | { |
2052 | struct page *page; | 2052 | struct page *page; |
@@ -2094,7 +2094,7 @@ static int i915_dump_lrc(struct seq_file *m, void *unused) | |||
2094 | struct drm_device *dev = node->minor->dev; | 2094 | struct drm_device *dev = node->minor->dev; |
2095 | struct drm_i915_private *dev_priv = dev->dev_private; | 2095 | struct drm_i915_private *dev_priv = dev->dev_private; |
2096 | struct intel_engine_cs *engine; | 2096 | struct intel_engine_cs *engine; |
2097 | struct intel_context *ctx; | 2097 | struct i915_gem_context *ctx; |
2098 | int ret; | 2098 | int ret; |
2099 | 2099 | ||
2100 | if (!i915.enable_execlists) { | 2100 | if (!i915.enable_execlists) { |
@@ -2274,7 +2274,7 @@ static int i915_swizzle_info(struct seq_file *m, void *data) | |||
2274 | 2274 | ||
2275 | static int per_file_ctx(int id, void *ptr, void *data) | 2275 | static int per_file_ctx(int id, void *ptr, void *data) |
2276 | { | 2276 | { |
2277 | struct intel_context *ctx = ptr; | 2277 | struct i915_gem_context *ctx = ptr; |
2278 | struct seq_file *m = data; | 2278 | struct seq_file *m = data; |
2279 | struct i915_hw_ppgtt *ppgtt = ctx->ppgtt; | 2279 | struct i915_hw_ppgtt *ppgtt = ctx->ppgtt; |
2280 | 2280 | ||
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 78d38c246491..961ef403154e 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h | |||
@@ -831,7 +831,7 @@ struct i915_ctx_hang_stats { | |||
831 | 831 | ||
832 | #define CONTEXT_NO_ZEROMAP (1<<0) | 832 | #define CONTEXT_NO_ZEROMAP (1<<0) |
833 | /** | 833 | /** |
834 | * struct intel_context - as the name implies, represents a context. | 834 | * struct i915_gem_context - as the name implies, represents a context. |
835 | * @ref: reference count. | 835 | * @ref: reference count. |
836 | * @user_handle: userspace tracking identity for this context. | 836 | * @user_handle: userspace tracking identity for this context. |
837 | * @remap_slice: l3 row remapping information. | 837 | * @remap_slice: l3 row remapping information. |
@@ -849,7 +849,7 @@ struct i915_ctx_hang_stats { | |||
849 | * Contexts are memory images used by the hardware to store copies of their | 849 | * Contexts are memory images used by the hardware to store copies of their |
850 | * internal state. | 850 | * internal state. |
851 | */ | 851 | */ |
852 | struct intel_context { | 852 | struct i915_gem_context { |
853 | struct kref ref; | 853 | struct kref ref; |
854 | int user_handle; | 854 | int user_handle; |
855 | uint8_t remap_slice; | 855 | uint8_t remap_slice; |
@@ -1710,7 +1710,7 @@ struct i915_execbuffer_params { | |||
1710 | uint64_t batch_obj_vm_offset; | 1710 | uint64_t batch_obj_vm_offset; |
1711 | struct intel_engine_cs *engine; | 1711 | struct intel_engine_cs *engine; |
1712 | struct drm_i915_gem_object *batch_obj; | 1712 | struct drm_i915_gem_object *batch_obj; |
1713 | struct intel_context *ctx; | 1713 | struct i915_gem_context *ctx; |
1714 | struct drm_i915_gem_request *request; | 1714 | struct drm_i915_gem_request *request; |
1715 | }; | 1715 | }; |
1716 | 1716 | ||
@@ -2017,7 +2017,7 @@ struct drm_i915_private { | |||
2017 | void (*stop_engine)(struct intel_engine_cs *engine); | 2017 | void (*stop_engine)(struct intel_engine_cs *engine); |
2018 | } gt; | 2018 | } gt; |
2019 | 2019 | ||
2020 | struct intel_context *kernel_context; | 2020 | struct i915_gem_context *kernel_context; |
2021 | 2021 | ||
2022 | /* perform PHY state sanity checks? */ | 2022 | /* perform PHY state sanity checks? */ |
2023 | bool chv_phy_assert[2]; | 2023 | bool chv_phy_assert[2]; |
@@ -2385,7 +2385,7 @@ struct drm_i915_gem_request { | |||
2385 | * i915_gem_request_free() will then decrement the refcount on the | 2385 | * i915_gem_request_free() will then decrement the refcount on the |
2386 | * context. | 2386 | * context. |
2387 | */ | 2387 | */ |
2388 | struct intel_context *ctx; | 2388 | struct i915_gem_context *ctx; |
2389 | struct intel_ringbuffer *ringbuf; | 2389 | struct intel_ringbuffer *ringbuf; |
2390 | 2390 | ||
2391 | /** | 2391 | /** |
@@ -2397,7 +2397,7 @@ struct drm_i915_gem_request { | |||
2397 | * we keep the previous context pinned until the following (this) | 2397 | * we keep the previous context pinned until the following (this) |
2398 | * request is retired. | 2398 | * request is retired. |
2399 | */ | 2399 | */ |
2400 | struct intel_context *previous_context; | 2400 | struct i915_gem_context *previous_context; |
2401 | 2401 | ||
2402 | /** Batch buffer related to this request if any (used for | 2402 | /** Batch buffer related to this request if any (used for |
2403 | error state dump only) */ | 2403 | error state dump only) */ |
@@ -2441,7 +2441,7 @@ struct drm_i915_gem_request { | |||
2441 | 2441 | ||
2442 | struct drm_i915_gem_request * __must_check | 2442 | struct drm_i915_gem_request * __must_check |
2443 | i915_gem_request_alloc(struct intel_engine_cs *engine, | 2443 | i915_gem_request_alloc(struct intel_engine_cs *engine, |
2444 | struct intel_context *ctx); | 2444 | struct i915_gem_context *ctx); |
2445 | void i915_gem_request_free(struct kref *req_ref); | 2445 | void i915_gem_request_free(struct kref *req_ref); |
2446 | int i915_gem_request_add_to_client(struct drm_i915_gem_request *req, | 2446 | int i915_gem_request_add_to_client(struct drm_i915_gem_request *req, |
2447 | struct drm_file *file); | 2447 | struct drm_file *file); |
@@ -3427,22 +3427,22 @@ void i915_gem_context_reset(struct drm_device *dev); | |||
3427 | int i915_gem_context_open(struct drm_device *dev, struct drm_file *file); | 3427 | int i915_gem_context_open(struct drm_device *dev, struct drm_file *file); |
3428 | void i915_gem_context_close(struct drm_device *dev, struct drm_file *file); | 3428 | void i915_gem_context_close(struct drm_device *dev, struct drm_file *file); |
3429 | int i915_switch_context(struct drm_i915_gem_request *req); | 3429 | int i915_switch_context(struct drm_i915_gem_request *req); |
3430 | struct intel_context * | 3430 | struct i915_gem_context * |
3431 | i915_gem_context_get(struct drm_i915_file_private *file_priv, u32 id); | 3431 | i915_gem_context_get(struct drm_i915_file_private *file_priv, u32 id); |
3432 | void i915_gem_context_free(struct kref *ctx_ref); | 3432 | void i915_gem_context_free(struct kref *ctx_ref); |
3433 | struct drm_i915_gem_object * | 3433 | struct drm_i915_gem_object * |
3434 | i915_gem_alloc_context_obj(struct drm_device *dev, size_t size); | 3434 | i915_gem_alloc_context_obj(struct drm_device *dev, size_t size); |
3435 | static inline void i915_gem_context_reference(struct intel_context *ctx) | 3435 | static inline void i915_gem_context_reference(struct i915_gem_context *ctx) |
3436 | { | 3436 | { |
3437 | kref_get(&ctx->ref); | 3437 | kref_get(&ctx->ref); |
3438 | } | 3438 | } |
3439 | 3439 | ||
3440 | static inline void i915_gem_context_unreference(struct intel_context *ctx) | 3440 | static inline void i915_gem_context_unreference(struct i915_gem_context *ctx) |
3441 | { | 3441 | { |
3442 | kref_put(&ctx->ref, i915_gem_context_free); | 3442 | kref_put(&ctx->ref, i915_gem_context_free); |
3443 | } | 3443 | } |
3444 | 3444 | ||
3445 | static inline bool i915_gem_context_is_default(const struct intel_context *c) | 3445 | static inline bool i915_gem_context_is_default(const struct i915_gem_context *c) |
3446 | { | 3446 | { |
3447 | return c->user_handle == DEFAULT_CONTEXT_HANDLE; | 3447 | return c->user_handle == DEFAULT_CONTEXT_HANDLE; |
3448 | } | 3448 | } |
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index f78d4caf4b7f..3472280d8142 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c | |||
@@ -2689,7 +2689,7 @@ void __i915_add_request(struct drm_i915_gem_request *request, | |||
2689 | } | 2689 | } |
2690 | 2690 | ||
2691 | static bool i915_context_is_banned(struct drm_i915_private *dev_priv, | 2691 | static bool i915_context_is_banned(struct drm_i915_private *dev_priv, |
2692 | const struct intel_context *ctx) | 2692 | const struct i915_gem_context *ctx) |
2693 | { | 2693 | { |
2694 | unsigned long elapsed; | 2694 | unsigned long elapsed; |
2695 | 2695 | ||
@@ -2714,7 +2714,7 @@ static bool i915_context_is_banned(struct drm_i915_private *dev_priv, | |||
2714 | } | 2714 | } |
2715 | 2715 | ||
2716 | static void i915_set_reset_status(struct drm_i915_private *dev_priv, | 2716 | static void i915_set_reset_status(struct drm_i915_private *dev_priv, |
2717 | struct intel_context *ctx, | 2717 | struct i915_gem_context *ctx, |
2718 | const bool guilty) | 2718 | const bool guilty) |
2719 | { | 2719 | { |
2720 | struct i915_ctx_hang_stats *hs; | 2720 | struct i915_ctx_hang_stats *hs; |
@@ -2742,7 +2742,7 @@ void i915_gem_request_free(struct kref *req_ref) | |||
2742 | 2742 | ||
2743 | static inline int | 2743 | static inline int |
2744 | __i915_gem_request_alloc(struct intel_engine_cs *engine, | 2744 | __i915_gem_request_alloc(struct intel_engine_cs *engine, |
2745 | struct intel_context *ctx, | 2745 | struct i915_gem_context *ctx, |
2746 | struct drm_i915_gem_request **req_out) | 2746 | struct drm_i915_gem_request **req_out) |
2747 | { | 2747 | { |
2748 | struct drm_i915_private *dev_priv = engine->i915; | 2748 | struct drm_i915_private *dev_priv = engine->i915; |
@@ -2818,7 +2818,7 @@ err: | |||
2818 | */ | 2818 | */ |
2819 | struct drm_i915_gem_request * | 2819 | struct drm_i915_gem_request * |
2820 | i915_gem_request_alloc(struct intel_engine_cs *engine, | 2820 | i915_gem_request_alloc(struct intel_engine_cs *engine, |
2821 | struct intel_context *ctx) | 2821 | struct i915_gem_context *ctx) |
2822 | { | 2822 | { |
2823 | struct drm_i915_gem_request *req; | 2823 | struct drm_i915_gem_request *req; |
2824 | int err; | 2824 | int err; |
diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c index 2aedd188473d..8484da26b5d4 100644 --- a/drivers/gpu/drm/i915/i915_gem_context.c +++ b/drivers/gpu/drm/i915/i915_gem_context.c | |||
@@ -134,7 +134,7 @@ static int get_context_size(struct drm_i915_private *dev_priv) | |||
134 | return ret; | 134 | return ret; |
135 | } | 135 | } |
136 | 136 | ||
137 | static void i915_gem_context_clean(struct intel_context *ctx) | 137 | static void i915_gem_context_clean(struct i915_gem_context *ctx) |
138 | { | 138 | { |
139 | struct i915_hw_ppgtt *ppgtt = ctx->ppgtt; | 139 | struct i915_hw_ppgtt *ppgtt = ctx->ppgtt; |
140 | struct i915_vma *vma, *next; | 140 | struct i915_vma *vma, *next; |
@@ -151,7 +151,7 @@ static void i915_gem_context_clean(struct intel_context *ctx) | |||
151 | 151 | ||
152 | void i915_gem_context_free(struct kref *ctx_ref) | 152 | void i915_gem_context_free(struct kref *ctx_ref) |
153 | { | 153 | { |
154 | struct intel_context *ctx = container_of(ctx_ref, typeof(*ctx), ref); | 154 | struct i915_gem_context *ctx = container_of(ctx_ref, typeof(*ctx), ref); |
155 | 155 | ||
156 | trace_i915_context_free(ctx); | 156 | trace_i915_context_free(ctx); |
157 | 157 | ||
@@ -234,12 +234,12 @@ static int assign_hw_id(struct drm_i915_private *dev_priv, unsigned *out) | |||
234 | return 0; | 234 | return 0; |
235 | } | 235 | } |
236 | 236 | ||
237 | static struct intel_context * | 237 | static struct i915_gem_context * |
238 | __create_hw_context(struct drm_device *dev, | 238 | __create_hw_context(struct drm_device *dev, |
239 | struct drm_i915_file_private *file_priv) | 239 | struct drm_i915_file_private *file_priv) |
240 | { | 240 | { |
241 | struct drm_i915_private *dev_priv = dev->dev_private; | 241 | struct drm_i915_private *dev_priv = dev->dev_private; |
242 | struct intel_context *ctx; | 242 | struct i915_gem_context *ctx; |
243 | int ret; | 243 | int ret; |
244 | 244 | ||
245 | ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); | 245 | ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); |
@@ -296,12 +296,12 @@ err_out: | |||
296 | * context state of the GPU for applications that don't utilize HW contexts, as | 296 | * context state of the GPU for applications that don't utilize HW contexts, as |
297 | * well as an idle case. | 297 | * well as an idle case. |
298 | */ | 298 | */ |
299 | static struct intel_context * | 299 | static struct i915_gem_context * |
300 | i915_gem_create_context(struct drm_device *dev, | 300 | i915_gem_create_context(struct drm_device *dev, |
301 | struct drm_i915_file_private *file_priv) | 301 | struct drm_i915_file_private *file_priv) |
302 | { | 302 | { |
303 | const bool is_global_default_ctx = file_priv == NULL; | 303 | const bool is_global_default_ctx = file_priv == NULL; |
304 | struct intel_context *ctx; | 304 | struct i915_gem_context *ctx; |
305 | int ret = 0; | 305 | int ret = 0; |
306 | 306 | ||
307 | BUG_ON(!mutex_is_locked(&dev->struct_mutex)); | 307 | BUG_ON(!mutex_is_locked(&dev->struct_mutex)); |
@@ -352,7 +352,7 @@ err_destroy: | |||
352 | return ERR_PTR(ret); | 352 | return ERR_PTR(ret); |
353 | } | 353 | } |
354 | 354 | ||
355 | static void i915_gem_context_unpin(struct intel_context *ctx, | 355 | static void i915_gem_context_unpin(struct i915_gem_context *ctx, |
356 | struct intel_engine_cs *engine) | 356 | struct intel_engine_cs *engine) |
357 | { | 357 | { |
358 | if (i915.enable_execlists) { | 358 | if (i915.enable_execlists) { |
@@ -369,7 +369,7 @@ void i915_gem_context_reset(struct drm_device *dev) | |||
369 | struct drm_i915_private *dev_priv = dev->dev_private; | 369 | struct drm_i915_private *dev_priv = dev->dev_private; |
370 | 370 | ||
371 | if (i915.enable_execlists) { | 371 | if (i915.enable_execlists) { |
372 | struct intel_context *ctx; | 372 | struct i915_gem_context *ctx; |
373 | 373 | ||
374 | list_for_each_entry(ctx, &dev_priv->context_list, link) | 374 | list_for_each_entry(ctx, &dev_priv->context_list, link) |
375 | intel_lr_context_reset(dev_priv, ctx); | 375 | intel_lr_context_reset(dev_priv, ctx); |
@@ -381,7 +381,7 @@ void i915_gem_context_reset(struct drm_device *dev) | |||
381 | int i915_gem_context_init(struct drm_device *dev) | 381 | int i915_gem_context_init(struct drm_device *dev) |
382 | { | 382 | { |
383 | struct drm_i915_private *dev_priv = dev->dev_private; | 383 | struct drm_i915_private *dev_priv = dev->dev_private; |
384 | struct intel_context *ctx; | 384 | struct i915_gem_context *ctx; |
385 | 385 | ||
386 | /* Init should only be called once per module load. Eventually the | 386 | /* Init should only be called once per module load. Eventually the |
387 | * restriction on the context_disabled check can be loosened. */ | 387 | * restriction on the context_disabled check can be loosened. */ |
@@ -449,7 +449,7 @@ void i915_gem_context_lost(struct drm_i915_private *dev_priv) | |||
449 | void i915_gem_context_fini(struct drm_device *dev) | 449 | void i915_gem_context_fini(struct drm_device *dev) |
450 | { | 450 | { |
451 | struct drm_i915_private *dev_priv = dev->dev_private; | 451 | struct drm_i915_private *dev_priv = dev->dev_private; |
452 | struct intel_context *dctx = dev_priv->kernel_context; | 452 | struct i915_gem_context *dctx = dev_priv->kernel_context; |
453 | 453 | ||
454 | if (dctx->legacy_hw_ctx.rcs_state) | 454 | if (dctx->legacy_hw_ctx.rcs_state) |
455 | i915_gem_object_ggtt_unpin(dctx->legacy_hw_ctx.rcs_state); | 455 | i915_gem_object_ggtt_unpin(dctx->legacy_hw_ctx.rcs_state); |
@@ -462,7 +462,7 @@ void i915_gem_context_fini(struct drm_device *dev) | |||
462 | 462 | ||
463 | static int context_idr_cleanup(int id, void *p, void *data) | 463 | static int context_idr_cleanup(int id, void *p, void *data) |
464 | { | 464 | { |
465 | struct intel_context *ctx = p; | 465 | struct i915_gem_context *ctx = p; |
466 | 466 | ||
467 | i915_gem_context_unreference(ctx); | 467 | i915_gem_context_unreference(ctx); |
468 | return 0; | 468 | return 0; |
@@ -471,7 +471,7 @@ static int context_idr_cleanup(int id, void *p, void *data) | |||
471 | int i915_gem_context_open(struct drm_device *dev, struct drm_file *file) | 471 | int i915_gem_context_open(struct drm_device *dev, struct drm_file *file) |
472 | { | 472 | { |
473 | struct drm_i915_file_private *file_priv = file->driver_priv; | 473 | struct drm_i915_file_private *file_priv = file->driver_priv; |
474 | struct intel_context *ctx; | 474 | struct i915_gem_context *ctx; |
475 | 475 | ||
476 | idr_init(&file_priv->context_idr); | 476 | idr_init(&file_priv->context_idr); |
477 | 477 | ||
@@ -495,12 +495,12 @@ void i915_gem_context_close(struct drm_device *dev, struct drm_file *file) | |||
495 | idr_destroy(&file_priv->context_idr); | 495 | idr_destroy(&file_priv->context_idr); |
496 | } | 496 | } |
497 | 497 | ||
498 | struct intel_context * | 498 | struct i915_gem_context * |
499 | i915_gem_context_get(struct drm_i915_file_private *file_priv, u32 id) | 499 | i915_gem_context_get(struct drm_i915_file_private *file_priv, u32 id) |
500 | { | 500 | { |
501 | struct intel_context *ctx; | 501 | struct i915_gem_context *ctx; |
502 | 502 | ||
503 | ctx = (struct intel_context *)idr_find(&file_priv->context_idr, id); | 503 | ctx = idr_find(&file_priv->context_idr, id); |
504 | if (!ctx) | 504 | if (!ctx) |
505 | return ERR_PTR(-ENOENT); | 505 | return ERR_PTR(-ENOENT); |
506 | 506 | ||
@@ -641,7 +641,7 @@ static int remap_l3(struct drm_i915_gem_request *req, int slice) | |||
641 | 641 | ||
642 | static inline bool skip_rcs_switch(struct i915_hw_ppgtt *ppgtt, | 642 | static inline bool skip_rcs_switch(struct i915_hw_ppgtt *ppgtt, |
643 | struct intel_engine_cs *engine, | 643 | struct intel_engine_cs *engine, |
644 | struct intel_context *to) | 644 | struct i915_gem_context *to) |
645 | { | 645 | { |
646 | if (to->remap_slice) | 646 | if (to->remap_slice) |
647 | return false; | 647 | return false; |
@@ -658,7 +658,7 @@ static inline bool skip_rcs_switch(struct i915_hw_ppgtt *ppgtt, | |||
658 | static bool | 658 | static bool |
659 | needs_pd_load_pre(struct i915_hw_ppgtt *ppgtt, | 659 | needs_pd_load_pre(struct i915_hw_ppgtt *ppgtt, |
660 | struct intel_engine_cs *engine, | 660 | struct intel_engine_cs *engine, |
661 | struct intel_context *to) | 661 | struct i915_gem_context *to) |
662 | { | 662 | { |
663 | if (!ppgtt) | 663 | if (!ppgtt) |
664 | return false; | 664 | return false; |
@@ -683,7 +683,7 @@ needs_pd_load_pre(struct i915_hw_ppgtt *ppgtt, | |||
683 | 683 | ||
684 | static bool | 684 | static bool |
685 | needs_pd_load_post(struct i915_hw_ppgtt *ppgtt, | 685 | needs_pd_load_post(struct i915_hw_ppgtt *ppgtt, |
686 | struct intel_context *to, | 686 | struct i915_gem_context *to, |
687 | u32 hw_flags) | 687 | u32 hw_flags) |
688 | { | 688 | { |
689 | if (!ppgtt) | 689 | if (!ppgtt) |
@@ -700,10 +700,10 @@ needs_pd_load_post(struct i915_hw_ppgtt *ppgtt, | |||
700 | 700 | ||
701 | static int do_rcs_switch(struct drm_i915_gem_request *req) | 701 | static int do_rcs_switch(struct drm_i915_gem_request *req) |
702 | { | 702 | { |
703 | struct intel_context *to = req->ctx; | 703 | struct i915_gem_context *to = req->ctx; |
704 | struct intel_engine_cs *engine = req->engine; | 704 | struct intel_engine_cs *engine = req->engine; |
705 | struct i915_hw_ppgtt *ppgtt = to->ppgtt ?: req->i915->mm.aliasing_ppgtt; | 705 | struct i915_hw_ppgtt *ppgtt = to->ppgtt ?: req->i915->mm.aliasing_ppgtt; |
706 | struct intel_context *from; | 706 | struct i915_gem_context *from; |
707 | u32 hw_flags; | 707 | u32 hw_flags; |
708 | int ret, i; | 708 | int ret, i; |
709 | 709 | ||
@@ -859,7 +859,7 @@ int i915_switch_context(struct drm_i915_gem_request *req) | |||
859 | 859 | ||
860 | if (engine->id != RCS || | 860 | if (engine->id != RCS || |
861 | req->ctx->legacy_hw_ctx.rcs_state == NULL) { | 861 | req->ctx->legacy_hw_ctx.rcs_state == NULL) { |
862 | struct intel_context *to = req->ctx; | 862 | struct i915_gem_context *to = req->ctx; |
863 | struct i915_hw_ppgtt *ppgtt = | 863 | struct i915_hw_ppgtt *ppgtt = |
864 | to->ppgtt ?: req->i915->mm.aliasing_ppgtt; | 864 | to->ppgtt ?: req->i915->mm.aliasing_ppgtt; |
865 | 865 | ||
@@ -897,7 +897,7 @@ int i915_gem_context_create_ioctl(struct drm_device *dev, void *data, | |||
897 | { | 897 | { |
898 | struct drm_i915_gem_context_create *args = data; | 898 | struct drm_i915_gem_context_create *args = data; |
899 | struct drm_i915_file_private *file_priv = file->driver_priv; | 899 | struct drm_i915_file_private *file_priv = file->driver_priv; |
900 | struct intel_context *ctx; | 900 | struct i915_gem_context *ctx; |
901 | int ret; | 901 | int ret; |
902 | 902 | ||
903 | if (!contexts_enabled(dev)) | 903 | if (!contexts_enabled(dev)) |
@@ -926,7 +926,7 @@ int i915_gem_context_destroy_ioctl(struct drm_device *dev, void *data, | |||
926 | { | 926 | { |
927 | struct drm_i915_gem_context_destroy *args = data; | 927 | struct drm_i915_gem_context_destroy *args = data; |
928 | struct drm_i915_file_private *file_priv = file->driver_priv; | 928 | struct drm_i915_file_private *file_priv = file->driver_priv; |
929 | struct intel_context *ctx; | 929 | struct i915_gem_context *ctx; |
930 | int ret; | 930 | int ret; |
931 | 931 | ||
932 | if (args->pad != 0) | 932 | if (args->pad != 0) |
@@ -958,7 +958,7 @@ int i915_gem_context_getparam_ioctl(struct drm_device *dev, void *data, | |||
958 | { | 958 | { |
959 | struct drm_i915_file_private *file_priv = file->driver_priv; | 959 | struct drm_i915_file_private *file_priv = file->driver_priv; |
960 | struct drm_i915_gem_context_param *args = data; | 960 | struct drm_i915_gem_context_param *args = data; |
961 | struct intel_context *ctx; | 961 | struct i915_gem_context *ctx; |
962 | int ret; | 962 | int ret; |
963 | 963 | ||
964 | ret = i915_mutex_lock_interruptible(dev); | 964 | ret = i915_mutex_lock_interruptible(dev); |
@@ -1001,7 +1001,7 @@ int i915_gem_context_setparam_ioctl(struct drm_device *dev, void *data, | |||
1001 | { | 1001 | { |
1002 | struct drm_i915_file_private *file_priv = file->driver_priv; | 1002 | struct drm_i915_file_private *file_priv = file->driver_priv; |
1003 | struct drm_i915_gem_context_param *args = data; | 1003 | struct drm_i915_gem_context_param *args = data; |
1004 | struct intel_context *ctx; | 1004 | struct i915_gem_context *ctx; |
1005 | int ret; | 1005 | int ret; |
1006 | 1006 | ||
1007 | ret = i915_mutex_lock_interruptible(dev); | 1007 | ret = i915_mutex_lock_interruptible(dev); |
@@ -1047,7 +1047,7 @@ int i915_gem_context_reset_stats_ioctl(struct drm_device *dev, | |||
1047 | struct drm_i915_private *dev_priv = dev->dev_private; | 1047 | struct drm_i915_private *dev_priv = dev->dev_private; |
1048 | struct drm_i915_reset_stats *args = data; | 1048 | struct drm_i915_reset_stats *args = data; |
1049 | struct i915_ctx_hang_stats *hs; | 1049 | struct i915_ctx_hang_stats *hs; |
1050 | struct intel_context *ctx; | 1050 | struct i915_gem_context *ctx; |
1051 | int ret; | 1051 | int ret; |
1052 | 1052 | ||
1053 | if (args->flags || args->pad) | 1053 | if (args->flags || args->pad) |
diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c index a54a243ccaac..e61b92d7b0bc 100644 --- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c +++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c | |||
@@ -716,7 +716,7 @@ eb_vma_misplaced(struct i915_vma *vma) | |||
716 | static int | 716 | static int |
717 | i915_gem_execbuffer_reserve(struct intel_engine_cs *engine, | 717 | i915_gem_execbuffer_reserve(struct intel_engine_cs *engine, |
718 | struct list_head *vmas, | 718 | struct list_head *vmas, |
719 | struct intel_context *ctx, | 719 | struct i915_gem_context *ctx, |
720 | bool *need_relocs) | 720 | bool *need_relocs) |
721 | { | 721 | { |
722 | struct drm_i915_gem_object *obj; | 722 | struct drm_i915_gem_object *obj; |
@@ -828,7 +828,7 @@ i915_gem_execbuffer_relocate_slow(struct drm_device *dev, | |||
828 | struct intel_engine_cs *engine, | 828 | struct intel_engine_cs *engine, |
829 | struct eb_vmas *eb, | 829 | struct eb_vmas *eb, |
830 | struct drm_i915_gem_exec_object2 *exec, | 830 | struct drm_i915_gem_exec_object2 *exec, |
831 | struct intel_context *ctx) | 831 | struct i915_gem_context *ctx) |
832 | { | 832 | { |
833 | struct drm_i915_gem_relocation_entry *reloc; | 833 | struct drm_i915_gem_relocation_entry *reloc; |
834 | struct i915_address_space *vm; | 834 | struct i915_address_space *vm; |
@@ -1065,11 +1065,11 @@ validate_exec_list(struct drm_device *dev, | |||
1065 | return 0; | 1065 | return 0; |
1066 | } | 1066 | } |
1067 | 1067 | ||
1068 | static struct intel_context * | 1068 | static struct i915_gem_context * |
1069 | i915_gem_validate_context(struct drm_device *dev, struct drm_file *file, | 1069 | i915_gem_validate_context(struct drm_device *dev, struct drm_file *file, |
1070 | struct intel_engine_cs *engine, const u32 ctx_id) | 1070 | struct intel_engine_cs *engine, const u32 ctx_id) |
1071 | { | 1071 | { |
1072 | struct intel_context *ctx = NULL; | 1072 | struct i915_gem_context *ctx = NULL; |
1073 | struct i915_ctx_hang_stats *hs; | 1073 | struct i915_ctx_hang_stats *hs; |
1074 | 1074 | ||
1075 | if (engine->id != RCS && ctx_id != DEFAULT_CONTEXT_HANDLE) | 1075 | if (engine->id != RCS && ctx_id != DEFAULT_CONTEXT_HANDLE) |
@@ -1430,7 +1430,7 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data, | |||
1430 | struct drm_i915_gem_object *batch_obj; | 1430 | struct drm_i915_gem_object *batch_obj; |
1431 | struct drm_i915_gem_exec_object2 shadow_exec_entry; | 1431 | struct drm_i915_gem_exec_object2 shadow_exec_entry; |
1432 | struct intel_engine_cs *engine; | 1432 | struct intel_engine_cs *engine; |
1433 | struct intel_context *ctx; | 1433 | struct i915_gem_context *ctx; |
1434 | struct i915_address_space *vm; | 1434 | struct i915_address_space *vm; |
1435 | struct i915_execbuffer_params params_master; /* XXX: will be removed later */ | 1435 | struct i915_execbuffer_params params_master; /* XXX: will be removed later */ |
1436 | struct i915_execbuffer_params *params = ¶ms_master; | 1436 | struct i915_execbuffer_params *params = ¶ms_master; |
diff --git a/drivers/gpu/drm/i915/i915_guc_submission.c b/drivers/gpu/drm/i915/i915_guc_submission.c index 42a85088657b..b42a3adc3fa4 100644 --- a/drivers/gpu/drm/i915/i915_guc_submission.c +++ b/drivers/gpu/drm/i915/i915_guc_submission.c | |||
@@ -360,7 +360,7 @@ static void guc_init_ctx_desc(struct intel_guc *guc, | |||
360 | struct drm_i915_gem_object *client_obj = client->client_obj; | 360 | struct drm_i915_gem_object *client_obj = client->client_obj; |
361 | struct drm_i915_private *dev_priv = guc_to_i915(guc); | 361 | struct drm_i915_private *dev_priv = guc_to_i915(guc); |
362 | struct intel_engine_cs *engine; | 362 | struct intel_engine_cs *engine; |
363 | struct intel_context *ctx = client->owner; | 363 | struct i915_gem_context *ctx = client->owner; |
364 | struct guc_context_desc desc; | 364 | struct guc_context_desc desc; |
365 | struct sg_table *sg; | 365 | struct sg_table *sg; |
366 | enum intel_engine_id id; | 366 | enum intel_engine_id id; |
@@ -426,7 +426,7 @@ static void guc_init_ctx_desc(struct intel_guc *guc, | |||
426 | desc.wq_size = client->wq_size; | 426 | desc.wq_size = client->wq_size; |
427 | 427 | ||
428 | /* | 428 | /* |
429 | * XXX: Take LRCs from an existing intel_context if this is not an | 429 | * XXX: Take LRCs from an existing context if this is not an |
430 | * IsKMDCreatedContext client | 430 | * IsKMDCreatedContext client |
431 | */ | 431 | */ |
432 | desc.desc_private = (uintptr_t)client; | 432 | desc.desc_private = (uintptr_t)client; |
@@ -700,7 +700,7 @@ static void guc_client_free(struct drm_device *dev, | |||
700 | */ | 700 | */ |
701 | static struct i915_guc_client *guc_client_alloc(struct drm_device *dev, | 701 | static struct i915_guc_client *guc_client_alloc(struct drm_device *dev, |
702 | uint32_t priority, | 702 | uint32_t priority, |
703 | struct intel_context *ctx) | 703 | struct i915_gem_context *ctx) |
704 | { | 704 | { |
705 | struct i915_guc_client *client; | 705 | struct i915_guc_client *client; |
706 | struct drm_i915_private *dev_priv = dev->dev_private; | 706 | struct drm_i915_private *dev_priv = dev->dev_private; |
@@ -938,7 +938,7 @@ int i915_guc_submission_enable(struct drm_device *dev) | |||
938 | { | 938 | { |
939 | struct drm_i915_private *dev_priv = dev->dev_private; | 939 | struct drm_i915_private *dev_priv = dev->dev_private; |
940 | struct intel_guc *guc = &dev_priv->guc; | 940 | struct intel_guc *guc = &dev_priv->guc; |
941 | struct intel_context *ctx = dev_priv->kernel_context; | 941 | struct i915_gem_context *ctx = dev_priv->kernel_context; |
942 | struct i915_guc_client *client; | 942 | struct i915_guc_client *client; |
943 | 943 | ||
944 | /* client for execbuf submission */ | 944 | /* client for execbuf submission */ |
@@ -989,7 +989,7 @@ int intel_guc_suspend(struct drm_device *dev) | |||
989 | { | 989 | { |
990 | struct drm_i915_private *dev_priv = dev->dev_private; | 990 | struct drm_i915_private *dev_priv = dev->dev_private; |
991 | struct intel_guc *guc = &dev_priv->guc; | 991 | struct intel_guc *guc = &dev_priv->guc; |
992 | struct intel_context *ctx; | 992 | struct i915_gem_context *ctx; |
993 | u32 data[3]; | 993 | u32 data[3]; |
994 | 994 | ||
995 | if (guc->guc_fw.guc_fw_load_status != GUC_FIRMWARE_SUCCESS) | 995 | if (guc->guc_fw.guc_fw_load_status != GUC_FIRMWARE_SUCCESS) |
@@ -1015,7 +1015,7 @@ int intel_guc_resume(struct drm_device *dev) | |||
1015 | { | 1015 | { |
1016 | struct drm_i915_private *dev_priv = dev->dev_private; | 1016 | struct drm_i915_private *dev_priv = dev->dev_private; |
1017 | struct intel_guc *guc = &dev_priv->guc; | 1017 | struct intel_guc *guc = &dev_priv->guc; |
1018 | struct intel_context *ctx; | 1018 | struct i915_gem_context *ctx; |
1019 | u32 data[3]; | 1019 | u32 data[3]; |
1020 | 1020 | ||
1021 | if (guc->guc_fw.guc_fw_load_status != GUC_FIRMWARE_SUCCESS) | 1021 | if (guc->guc_fw.guc_fw_load_status != GUC_FIRMWARE_SUCCESS) |
diff --git a/drivers/gpu/drm/i915/i915_sysfs.c b/drivers/gpu/drm/i915/i915_sysfs.c index 37b6444b8e22..02507bfc8def 100644 --- a/drivers/gpu/drm/i915/i915_sysfs.c +++ b/drivers/gpu/drm/i915/i915_sysfs.c | |||
@@ -203,7 +203,7 @@ i915_l3_write(struct file *filp, struct kobject *kobj, | |||
203 | struct drm_minor *dminor = dev_to_drm_minor(dev); | 203 | struct drm_minor *dminor = dev_to_drm_minor(dev); |
204 | struct drm_device *drm_dev = dminor->dev; | 204 | struct drm_device *drm_dev = dminor->dev; |
205 | struct drm_i915_private *dev_priv = drm_dev->dev_private; | 205 | struct drm_i915_private *dev_priv = drm_dev->dev_private; |
206 | struct intel_context *ctx; | 206 | struct i915_gem_context *ctx; |
207 | u32 *temp = NULL; /* Just here to make handling failures easy */ | 207 | u32 *temp = NULL; /* Just here to make handling failures easy */ |
208 | int slice = (int)(uintptr_t)attr->private; | 208 | int slice = (int)(uintptr_t)attr->private; |
209 | int ret; | 209 | int ret; |
diff --git a/drivers/gpu/drm/i915/i915_trace.h b/drivers/gpu/drm/i915/i915_trace.h index 20b2e4039792..6768db032f84 100644 --- a/drivers/gpu/drm/i915/i915_trace.h +++ b/drivers/gpu/drm/i915/i915_trace.h | |||
@@ -734,12 +734,12 @@ DEFINE_EVENT(i915_ppgtt, i915_ppgtt_release, | |||
734 | * the context. | 734 | * the context. |
735 | */ | 735 | */ |
736 | DECLARE_EVENT_CLASS(i915_context, | 736 | DECLARE_EVENT_CLASS(i915_context, |
737 | TP_PROTO(struct intel_context *ctx), | 737 | TP_PROTO(struct i915_gem_context *ctx), |
738 | TP_ARGS(ctx), | 738 | TP_ARGS(ctx), |
739 | 739 | ||
740 | TP_STRUCT__entry( | 740 | TP_STRUCT__entry( |
741 | __field(u32, dev) | 741 | __field(u32, dev) |
742 | __field(struct intel_context *, ctx) | 742 | __field(struct i915_gem_context *, ctx) |
743 | __field(struct i915_address_space *, vm) | 743 | __field(struct i915_address_space *, vm) |
744 | ), | 744 | ), |
745 | 745 | ||
@@ -754,12 +754,12 @@ DECLARE_EVENT_CLASS(i915_context, | |||
754 | ) | 754 | ) |
755 | 755 | ||
756 | DEFINE_EVENT(i915_context, i915_context_create, | 756 | DEFINE_EVENT(i915_context, i915_context_create, |
757 | TP_PROTO(struct intel_context *ctx), | 757 | TP_PROTO(struct i915_gem_context *ctx), |
758 | TP_ARGS(ctx) | 758 | TP_ARGS(ctx) |
759 | ); | 759 | ); |
760 | 760 | ||
761 | DEFINE_EVENT(i915_context, i915_context_free, | 761 | DEFINE_EVENT(i915_context, i915_context_free, |
762 | TP_PROTO(struct intel_context *ctx), | 762 | TP_PROTO(struct i915_gem_context *ctx), |
763 | TP_ARGS(ctx) | 763 | TP_ARGS(ctx) |
764 | ); | 764 | ); |
765 | 765 | ||
@@ -771,13 +771,13 @@ DEFINE_EVENT(i915_context, i915_context_free, | |||
771 | * called only if full ppgtt is enabled. | 771 | * called only if full ppgtt is enabled. |
772 | */ | 772 | */ |
773 | TRACE_EVENT(switch_mm, | 773 | TRACE_EVENT(switch_mm, |
774 | TP_PROTO(struct intel_engine_cs *engine, struct intel_context *to), | 774 | TP_PROTO(struct intel_engine_cs *engine, struct i915_gem_context *to), |
775 | 775 | ||
776 | TP_ARGS(engine, to), | 776 | TP_ARGS(engine, to), |
777 | 777 | ||
778 | TP_STRUCT__entry( | 778 | TP_STRUCT__entry( |
779 | __field(u32, ring) | 779 | __field(u32, ring) |
780 | __field(struct intel_context *, to) | 780 | __field(struct i915_gem_context *, to) |
781 | __field(struct i915_address_space *, vm) | 781 | __field(struct i915_address_space *, vm) |
782 | __field(u32, dev) | 782 | __field(u32, dev) |
783 | ), | 783 | ), |
diff --git a/drivers/gpu/drm/i915/intel_guc.h b/drivers/gpu/drm/i915/intel_guc.h index 7b1a5a3fb106..41601c71f529 100644 --- a/drivers/gpu/drm/i915/intel_guc.h +++ b/drivers/gpu/drm/i915/intel_guc.h | |||
@@ -64,7 +64,7 @@ struct drm_i915_gem_request; | |||
64 | struct i915_guc_client { | 64 | struct i915_guc_client { |
65 | struct drm_i915_gem_object *client_obj; | 65 | struct drm_i915_gem_object *client_obj; |
66 | void *client_base; /* first page (only) of above */ | 66 | void *client_base; /* first page (only) of above */ |
67 | struct intel_context *owner; | 67 | struct i915_gem_context *owner; |
68 | struct intel_guc *guc; | 68 | struct intel_guc *guc; |
69 | uint32_t priority; | 69 | uint32_t priority; |
70 | uint32_t ctx_index; | 70 | uint32_t ctx_index; |
diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c index 0d1772a122fe..3d95b26b32ef 100644 --- a/drivers/gpu/drm/i915/intel_lrc.c +++ b/drivers/gpu/drm/i915/intel_lrc.c | |||
@@ -231,9 +231,9 @@ enum { | |||
231 | /* Typical size of the average request (2 pipecontrols and a MI_BB) */ | 231 | /* Typical size of the average request (2 pipecontrols and a MI_BB) */ |
232 | #define EXECLISTS_REQUEST_SIZE 64 /* bytes */ | 232 | #define EXECLISTS_REQUEST_SIZE 64 /* bytes */ |
233 | 233 | ||
234 | static int execlists_context_deferred_alloc(struct intel_context *ctx, | 234 | static int execlists_context_deferred_alloc(struct i915_gem_context *ctx, |
235 | struct intel_engine_cs *engine); | 235 | struct intel_engine_cs *engine); |
236 | static int intel_lr_context_pin(struct intel_context *ctx, | 236 | static int intel_lr_context_pin(struct i915_gem_context *ctx, |
237 | struct intel_engine_cs *engine); | 237 | struct intel_engine_cs *engine); |
238 | 238 | ||
239 | /** | 239 | /** |
@@ -315,7 +315,7 @@ logical_ring_init_platform_invariants(struct intel_engine_cs *engine) | |||
315 | * bits 55-63: group ID, currently unused and set to 0 | 315 | * bits 55-63: group ID, currently unused and set to 0 |
316 | */ | 316 | */ |
317 | static void | 317 | static void |
318 | intel_lr_context_descriptor_update(struct intel_context *ctx, | 318 | intel_lr_context_descriptor_update(struct i915_gem_context *ctx, |
319 | struct intel_engine_cs *engine) | 319 | struct intel_engine_cs *engine) |
320 | { | 320 | { |
321 | u64 desc; | 321 | u64 desc; |
@@ -330,7 +330,7 @@ intel_lr_context_descriptor_update(struct intel_context *ctx, | |||
330 | ctx->engine[engine->id].lrc_desc = desc; | 330 | ctx->engine[engine->id].lrc_desc = desc; |
331 | } | 331 | } |
332 | 332 | ||
333 | uint64_t intel_lr_context_descriptor(struct intel_context *ctx, | 333 | uint64_t intel_lr_context_descriptor(struct i915_gem_context *ctx, |
334 | struct intel_engine_cs *engine) | 334 | struct intel_engine_cs *engine) |
335 | { | 335 | { |
336 | return ctx->engine[engine->id].lrc_desc; | 336 | return ctx->engine[engine->id].lrc_desc; |
@@ -929,7 +929,7 @@ int logical_ring_flush_all_caches(struct drm_i915_gem_request *req) | |||
929 | return 0; | 929 | return 0; |
930 | } | 930 | } |
931 | 931 | ||
932 | static int intel_lr_context_pin(struct intel_context *ctx, | 932 | static int intel_lr_context_pin(struct i915_gem_context *ctx, |
933 | struct intel_engine_cs *engine) | 933 | struct intel_engine_cs *engine) |
934 | { | 934 | { |
935 | struct drm_i915_private *dev_priv = ctx->i915; | 935 | struct drm_i915_private *dev_priv = ctx->i915; |
@@ -985,7 +985,7 @@ err: | |||
985 | return ret; | 985 | return ret; |
986 | } | 986 | } |
987 | 987 | ||
988 | void intel_lr_context_unpin(struct intel_context *ctx, | 988 | void intel_lr_context_unpin(struct i915_gem_context *ctx, |
989 | struct intel_engine_cs *engine) | 989 | struct intel_engine_cs *engine) |
990 | { | 990 | { |
991 | struct drm_i915_gem_object *ctx_obj; | 991 | struct drm_i915_gem_object *ctx_obj; |
@@ -2046,7 +2046,7 @@ logical_ring_setup(struct drm_device *dev, enum intel_engine_id id) | |||
2046 | static int | 2046 | static int |
2047 | logical_ring_init(struct intel_engine_cs *engine) | 2047 | logical_ring_init(struct intel_engine_cs *engine) |
2048 | { | 2048 | { |
2049 | struct intel_context *dctx = engine->i915->kernel_context; | 2049 | struct i915_gem_context *dctx = engine->i915->kernel_context; |
2050 | int ret; | 2050 | int ret; |
2051 | 2051 | ||
2052 | ret = i915_cmd_parser_init_ring(engine); | 2052 | ret = i915_cmd_parser_init_ring(engine); |
@@ -2270,7 +2270,7 @@ static u32 intel_lr_indirect_ctx_offset(struct intel_engine_cs *engine) | |||
2270 | } | 2270 | } |
2271 | 2271 | ||
2272 | static int | 2272 | static int |
2273 | populate_lr_context(struct intel_context *ctx, | 2273 | populate_lr_context(struct i915_gem_context *ctx, |
2274 | struct drm_i915_gem_object *ctx_obj, | 2274 | struct drm_i915_gem_object *ctx_obj, |
2275 | struct intel_engine_cs *engine, | 2275 | struct intel_engine_cs *engine, |
2276 | struct intel_ringbuffer *ringbuf) | 2276 | struct intel_ringbuffer *ringbuf) |
@@ -2418,7 +2418,7 @@ populate_lr_context(struct intel_context *ctx, | |||
2418 | * takes care of the bits that are LRC related: the per-engine backing | 2418 | * takes care of the bits that are LRC related: the per-engine backing |
2419 | * objects and the logical ringbuffer. | 2419 | * objects and the logical ringbuffer. |
2420 | */ | 2420 | */ |
2421 | void intel_lr_context_free(struct intel_context *ctx) | 2421 | void intel_lr_context_free(struct i915_gem_context *ctx) |
2422 | { | 2422 | { |
2423 | int i; | 2423 | int i; |
2424 | 2424 | ||
@@ -2486,7 +2486,7 @@ uint32_t intel_lr_context_size(struct intel_engine_cs *engine) | |||
2486 | * | 2486 | * |
2487 | * Return: non-zero on error. | 2487 | * Return: non-zero on error. |
2488 | */ | 2488 | */ |
2489 | static int execlists_context_deferred_alloc(struct intel_context *ctx, | 2489 | static int execlists_context_deferred_alloc(struct i915_gem_context *ctx, |
2490 | struct intel_engine_cs *engine) | 2490 | struct intel_engine_cs *engine) |
2491 | { | 2491 | { |
2492 | struct drm_i915_gem_object *ctx_obj; | 2492 | struct drm_i915_gem_object *ctx_obj; |
@@ -2536,7 +2536,7 @@ error_deref_obj: | |||
2536 | } | 2536 | } |
2537 | 2537 | ||
2538 | void intel_lr_context_reset(struct drm_i915_private *dev_priv, | 2538 | void intel_lr_context_reset(struct drm_i915_private *dev_priv, |
2539 | struct intel_context *ctx) | 2539 | struct i915_gem_context *ctx) |
2540 | { | 2540 | { |
2541 | struct intel_engine_cs *engine; | 2541 | struct intel_engine_cs *engine; |
2542 | 2542 | ||
diff --git a/drivers/gpu/drm/i915/intel_lrc.h b/drivers/gpu/drm/i915/intel_lrc.h index 1afba0331dc6..eb2e1d157fed 100644 --- a/drivers/gpu/drm/i915/intel_lrc.h +++ b/drivers/gpu/drm/i915/intel_lrc.h | |||
@@ -99,16 +99,18 @@ static inline void intel_logical_ring_emit_reg(struct intel_ringbuffer *ringbuf, | |||
99 | #define LRC_PPHWSP_PN (LRC_GUCSHR_PN + 1) | 99 | #define LRC_PPHWSP_PN (LRC_GUCSHR_PN + 1) |
100 | #define LRC_STATE_PN (LRC_PPHWSP_PN + 1) | 100 | #define LRC_STATE_PN (LRC_PPHWSP_PN + 1) |
101 | 101 | ||
102 | void intel_lr_context_free(struct intel_context *ctx); | 102 | struct i915_gem_context; |
103 | |||
104 | void intel_lr_context_free(struct i915_gem_context *ctx); | ||
103 | uint32_t intel_lr_context_size(struct intel_engine_cs *engine); | 105 | uint32_t intel_lr_context_size(struct intel_engine_cs *engine); |
104 | void intel_lr_context_unpin(struct intel_context *ctx, | 106 | void intel_lr_context_unpin(struct i915_gem_context *ctx, |
105 | struct intel_engine_cs *engine); | 107 | struct intel_engine_cs *engine); |
106 | 108 | ||
107 | struct drm_i915_private; | 109 | struct drm_i915_private; |
108 | 110 | ||
109 | void intel_lr_context_reset(struct drm_i915_private *dev_priv, | 111 | void intel_lr_context_reset(struct drm_i915_private *dev_priv, |
110 | struct intel_context *ctx); | 112 | struct i915_gem_context *ctx); |
111 | uint64_t intel_lr_context_descriptor(struct intel_context *ctx, | 113 | uint64_t intel_lr_context_descriptor(struct i915_gem_context *ctx, |
112 | struct intel_engine_cs *engine); | 114 | struct intel_engine_cs *engine); |
113 | 115 | ||
114 | /* Execlists */ | 116 | /* Execlists */ |
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.h b/drivers/gpu/drm/i915/intel_ringbuffer.h index 929e7b4af2a4..b33c876fed20 100644 --- a/drivers/gpu/drm/i915/intel_ringbuffer.h +++ b/drivers/gpu/drm/i915/intel_ringbuffer.h | |||
@@ -119,7 +119,7 @@ struct intel_ringbuffer { | |||
119 | u32 last_retired_head; | 119 | u32 last_retired_head; |
120 | }; | 120 | }; |
121 | 121 | ||
122 | struct intel_context; | 122 | struct i915_gem_context; |
123 | struct drm_i915_reg_table; | 123 | struct drm_i915_reg_table; |
124 | 124 | ||
125 | /* | 125 | /* |
@@ -310,7 +310,7 @@ struct intel_engine_cs { | |||
310 | 310 | ||
311 | wait_queue_head_t irq_queue; | 311 | wait_queue_head_t irq_queue; |
312 | 312 | ||
313 | struct intel_context *last_context; | 313 | struct i915_gem_context *last_context; |
314 | 314 | ||
315 | struct intel_ring_hangcheck hangcheck; | 315 | struct intel_ring_hangcheck hangcheck; |
316 | 316 | ||