drm/i915/guc: kill the GuC client

We now only use 1 client without any plan to add more. The client is
also only holding information about the WQ and the process desc, so we
can just move those in the intel_guc structure and always use stage_id
0.

v2: fix comment (John)
v3: fix the comment for real, fix kerneldoc
Signed-off-by: default avatarDaniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: John Harrison <John.C.Harrison@Intel.com>
Cc: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: default avatarJohn Harrison <John.C.Harrison@Intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191205220243.27403-4-daniele.ceraolospurio@intel.com
parent e9362e13
...@@ -466,9 +466,6 @@ GuC-based command submission ...@@ -466,9 +466,6 @@ GuC-based command submission
.. kernel-doc:: drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c .. kernel-doc:: drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c
:doc: GuC-based command submission :doc: GuC-based command submission
.. kernel-doc:: drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c
:internal:
HuC HuC
--- ---
.. kernel-doc:: drivers/gpu/drm/i915/gt/uc/intel_huc.c .. kernel-doc:: drivers/gpu/drm/i915/gt/uc/intel_huc.c
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include "intel_reset.h" #include "intel_reset.h"
#include "uc/intel_guc.h" #include "uc/intel_guc.h"
#include "uc/intel_guc_submission.h"
#define RESET_MAX_RETRIES 3 #define RESET_MAX_RETRIES 3
...@@ -1085,6 +1086,7 @@ static inline int intel_gt_reset_engine(struct intel_engine_cs *engine) ...@@ -1085,6 +1086,7 @@ static inline int intel_gt_reset_engine(struct intel_engine_cs *engine)
int intel_engine_reset(struct intel_engine_cs *engine, const char *msg) int intel_engine_reset(struct intel_engine_cs *engine, const char *msg)
{ {
struct intel_gt *gt = engine->gt; struct intel_gt *gt = engine->gt;
bool uses_guc = intel_engine_in_guc_submission_mode(engine);
int ret; int ret;
GEM_TRACE("%s flags=%lx\n", engine->name, gt->reset.flags); GEM_TRACE("%s flags=%lx\n", engine->name, gt->reset.flags);
...@@ -1100,14 +1102,14 @@ int intel_engine_reset(struct intel_engine_cs *engine, const char *msg) ...@@ -1100,14 +1102,14 @@ int intel_engine_reset(struct intel_engine_cs *engine, const char *msg)
"Resetting %s for %s\n", engine->name, msg); "Resetting %s for %s\n", engine->name, msg);
atomic_inc(&engine->i915->gpu_error.reset_engine_count[engine->uabi_class]); atomic_inc(&engine->i915->gpu_error.reset_engine_count[engine->uabi_class]);
if (!engine->gt->uc.guc.execbuf_client) if (!uses_guc)
ret = intel_gt_reset_engine(engine); ret = intel_gt_reset_engine(engine);
else else
ret = intel_guc_reset_engine(&engine->gt->uc.guc, engine); ret = intel_guc_reset_engine(&engine->gt->uc.guc, engine);
if (ret) { if (ret) {
/* If we fail here, we expect to fallback to a global reset */ /* If we fail here, we expect to fallback to a global reset */
DRM_DEBUG_DRIVER("%sFailed to reset %s, ret=%d\n", DRM_DEBUG_DRIVER("%sFailed to reset %s, ret=%d\n",
engine->gt->uc.guc.execbuf_client ? "GuC " : "", uses_guc ? "GuC " : "",
engine->name, ret); engine->name, ret);
goto out; goto out;
} }
......
...@@ -46,9 +46,13 @@ struct intel_guc { ...@@ -46,9 +46,13 @@ struct intel_guc {
struct i915_vma *stage_desc_pool; struct i915_vma *stage_desc_pool;
void *stage_desc_pool_vaddr; void *stage_desc_pool_vaddr;
struct ida stage_ids;
struct intel_guc_client *execbuf_client; struct i915_vma *workqueue;
void *workqueue_vaddr;
spinlock_t wq_lock;
struct i915_vma *proc_desc;
void *proc_desc_vaddr;
/* Control params for fw initialization */ /* Control params for fw initialization */
u32 params[GUC_CTL_MAX_DWORDS]; u32 params[GUC_CTL_MAX_DWORDS];
......
...@@ -31,7 +31,6 @@ ...@@ -31,7 +31,6 @@
#define GUC_DOORBELL_INVALID 256 #define GUC_DOORBELL_INVALID 256
#define GUC_PD_SIZE (PAGE_SIZE)
#define GUC_WQ_SIZE (PAGE_SIZE * 2) #define GUC_WQ_SIZE (PAGE_SIZE * 2)
/* Work queue item header definitions */ /* Work queue item header definitions */
......
...@@ -6,48 +6,10 @@ ...@@ -6,48 +6,10 @@
#ifndef _INTEL_GUC_SUBMISSION_H_ #ifndef _INTEL_GUC_SUBMISSION_H_
#define _INTEL_GUC_SUBMISSION_H_ #define _INTEL_GUC_SUBMISSION_H_
#include <linux/spinlock.h> #include <linux/types.h>
#include "gt/intel_engine_types.h" struct intel_guc;
struct intel_engine_cs;
#include "i915_gem.h"
#include "i915_selftest.h"
struct drm_i915_private;
/*
* This structure primarily describes the GEM object shared with the GuC.
* The specs sometimes refer to this object as a "GuC context", but we use
* the term "client" to avoid confusion with hardware contexts. This
* GEM object is held for the entire lifetime of our interaction with
* the GuC, being allocated before the GuC is loaded with its firmware.
* Because there's no way to update the address used by the GuC after
* initialisation, the shared object must stay pinned into the GGTT as
* long as the GuC is in use. We also keep the first page (only) mapped
* into kernel address space, as it includes shared data that must be
* updated on every request submission.
*
* The single GEM object described here is actually made up of several
* separate areas, as far as the GuC is concerned. The first page (kept
* kmap'd) includes the "process descriptor" which holds sequence data for
* the doorbell, and one cacheline which actually *is* the doorbell; a
* write to this will "ring the doorbell" (i.e. send an interrupt to the
* GuC). The subsequent pages of the client object constitute the work
* queue (a circular array of work items), again described in the process
* descriptor. Work queue pages are mapped momentarily as required.
*/
struct intel_guc_client {
struct i915_vma *vma;
void *vaddr;
struct intel_guc *guc;
/* bitmap of (host) engine ids */
u32 priority;
u32 stage_id;
/* Protects GuC client's WQ access */
spinlock_t wq_lock;
};
void intel_guc_submission_init_early(struct intel_guc *guc); void intel_guc_submission_init_early(struct intel_guc *guc);
int intel_guc_submission_init(struct intel_guc *guc); int intel_guc_submission_init(struct intel_guc *guc);
...@@ -56,5 +18,6 @@ void intel_guc_submission_disable(struct intel_guc *guc); ...@@ -56,5 +18,6 @@ void intel_guc_submission_disable(struct intel_guc *guc);
void intel_guc_submission_fini(struct intel_guc *guc); void intel_guc_submission_fini(struct intel_guc *guc);
int intel_guc_preempt_work_create(struct intel_guc *guc); int intel_guc_preempt_work_create(struct intel_guc *guc);
void intel_guc_preempt_work_destroy(struct intel_guc *guc); void intel_guc_preempt_work_destroy(struct intel_guc *guc);
bool intel_engine_in_guc_submission_mode(const struct intel_engine_cs *engine);
#endif #endif
...@@ -1792,23 +1792,12 @@ static void i915_guc_log_info(struct seq_file *m, ...@@ -1792,23 +1792,12 @@ static void i915_guc_log_info(struct seq_file *m,
static int i915_guc_info(struct seq_file *m, void *data) static int i915_guc_info(struct seq_file *m, void *data)
{ {
struct drm_i915_private *dev_priv = node_to_i915(m->private); struct drm_i915_private *dev_priv = node_to_i915(m->private);
const struct intel_guc *guc = &dev_priv->gt.uc.guc;
struct intel_guc_client *client = guc->execbuf_client;
if (!USES_GUC(dev_priv)) if (!USES_GUC(dev_priv))
return -ENODEV; return -ENODEV;
i915_guc_log_info(m, dev_priv); i915_guc_log_info(m, dev_priv);
if (!USES_GUC_SUBMISSION(dev_priv))
return 0;
GEM_BUG_ON(!guc->execbuf_client);
seq_printf(m, "\nGuC execbuf client @ %p:\n", client);
seq_printf(m, "\tPriority %d, GuC stage index: %u\n",
client->priority,
client->stage_id);
/* Add more as required ... */ /* Add more as required ... */
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment