Commit 0daf556c authored by Dave Gordon's avatar Dave Gordon Committed by Tvrtko Ursulin

drm/i915/guc: prefer 'dev_priv' to 'dev' for static functions

Convert all static functions in i915_guc_submission.c that currently
take a 'dev' pointer to take 'dev_priv' instead (there are three,
guc_client_alloc(), guc_client_free(), and gem_allocate_guc_obj().
Signed-off-by: default avatarDave Gordon <david.s.gordon@intel.com>
Reviewed-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
parent e93da0a0
...@@ -591,7 +591,7 @@ int i915_guc_submit(struct drm_i915_gem_request *rq) ...@@ -591,7 +591,7 @@ int i915_guc_submit(struct drm_i915_gem_request *rq)
/** /**
* gem_allocate_guc_obj() - Allocate gem object for GuC usage * gem_allocate_guc_obj() - Allocate gem object for GuC usage
* @dev: drm device * @dev_priv: driver private data structure
* @size: size of object * @size: size of object
* *
* This is a wrapper to create a gem obj. In order to use it inside GuC, the * This is a wrapper to create a gem obj. In order to use it inside GuC, the
...@@ -600,13 +600,12 @@ int i915_guc_submit(struct drm_i915_gem_request *rq) ...@@ -600,13 +600,12 @@ int i915_guc_submit(struct drm_i915_gem_request *rq)
* *
* Return: A drm_i915_gem_object if successful, otherwise NULL. * Return: A drm_i915_gem_object if successful, otherwise NULL.
*/ */
static struct drm_i915_gem_object *gem_allocate_guc_obj(struct drm_device *dev, static struct drm_i915_gem_object *
u32 size) gem_allocate_guc_obj(struct drm_i915_private *dev_priv, u32 size)
{ {
struct drm_i915_private *dev_priv = dev->dev_private;
struct drm_i915_gem_object *obj; struct drm_i915_gem_object *obj;
obj = i915_gem_object_create(dev, size); obj = i915_gem_object_create(dev_priv->dev, size);
if (IS_ERR(obj)) if (IS_ERR(obj))
return NULL; return NULL;
...@@ -642,10 +641,10 @@ static void gem_release_guc_obj(struct drm_i915_gem_object *obj) ...@@ -642,10 +641,10 @@ static void gem_release_guc_obj(struct drm_i915_gem_object *obj)
drm_gem_object_unreference(&obj->base); drm_gem_object_unreference(&obj->base);
} }
static void guc_client_free(struct drm_device *dev, static void
struct i915_guc_client *client) guc_client_free(struct drm_i915_private *dev_priv,
struct i915_guc_client *client)
{ {
struct drm_i915_private *dev_priv = dev->dev_private;
struct intel_guc *guc = &dev_priv->guc; struct intel_guc *guc = &dev_priv->guc;
if (!client) if (!client)
...@@ -688,7 +687,7 @@ static void guc_client_free(struct drm_device *dev, ...@@ -688,7 +687,7 @@ static void guc_client_free(struct drm_device *dev,
/** /**
* guc_client_alloc() - Allocate an i915_guc_client * guc_client_alloc() - Allocate an i915_guc_client
* @dev: drm device * @dev_priv: driver private data structure
* @priority: four levels priority _CRITICAL, _HIGH, _NORMAL and _LOW * @priority: four levels priority _CRITICAL, _HIGH, _NORMAL and _LOW
* The kernel client to replace ExecList submission is created with * The kernel client to replace ExecList submission is created with
* NORMAL priority. Priority of a client for scheduler can be HIGH, * NORMAL priority. Priority of a client for scheduler can be HIGH,
...@@ -698,12 +697,12 @@ static void guc_client_free(struct drm_device *dev, ...@@ -698,12 +697,12 @@ static void guc_client_free(struct drm_device *dev,
* *
* Return: An i915_guc_client object if success, else NULL. * Return: An i915_guc_client object if success, else NULL.
*/ */
static struct i915_guc_client *guc_client_alloc(struct drm_device *dev, static struct i915_guc_client *
uint32_t priority, guc_client_alloc(struct drm_i915_private *dev_priv,
struct i915_gem_context *ctx) uint32_t priority,
struct i915_gem_context *ctx)
{ {
struct i915_guc_client *client; struct i915_guc_client *client;
struct drm_i915_private *dev_priv = dev->dev_private;
struct intel_guc *guc = &dev_priv->guc; struct intel_guc *guc = &dev_priv->guc;
struct drm_i915_gem_object *obj; struct drm_i915_gem_object *obj;
...@@ -724,7 +723,7 @@ static struct i915_guc_client *guc_client_alloc(struct drm_device *dev, ...@@ -724,7 +723,7 @@ static struct i915_guc_client *guc_client_alloc(struct drm_device *dev,
} }
/* The first page is doorbell/proc_desc. Two followed pages are wq. */ /* The first page is doorbell/proc_desc. Two followed pages are wq. */
obj = gem_allocate_guc_obj(dev, GUC_DB_SIZE + GUC_WQ_SIZE); obj = gem_allocate_guc_obj(dev_priv, GUC_DB_SIZE + GUC_WQ_SIZE);
if (!obj) if (!obj)
goto err; goto err;
...@@ -768,7 +767,7 @@ static struct i915_guc_client *guc_client_alloc(struct drm_device *dev, ...@@ -768,7 +767,7 @@ static struct i915_guc_client *guc_client_alloc(struct drm_device *dev,
err: err:
DRM_ERROR("FAILED to create priority %u GuC client!\n", priority); DRM_ERROR("FAILED to create priority %u GuC client!\n", priority);
guc_client_free(dev, client); guc_client_free(dev_priv, client);
return NULL; return NULL;
} }
...@@ -793,7 +792,7 @@ static void guc_create_log(struct intel_guc *guc) ...@@ -793,7 +792,7 @@ static void guc_create_log(struct intel_guc *guc)
obj = guc->log_obj; obj = guc->log_obj;
if (!obj) { if (!obj) {
obj = gem_allocate_guc_obj(dev_priv->dev, size); obj = gem_allocate_guc_obj(dev_priv, size);
if (!obj) { if (!obj) {
/* logging will be off */ /* logging will be off */
i915.guc_log_level = -1; i915.guc_log_level = -1;
...@@ -853,7 +852,7 @@ static void guc_create_ads(struct intel_guc *guc) ...@@ -853,7 +852,7 @@ static void guc_create_ads(struct intel_guc *guc)
obj = guc->ads_obj; obj = guc->ads_obj;
if (!obj) { if (!obj) {
obj = gem_allocate_guc_obj(dev_priv->dev, PAGE_ALIGN(size)); obj = gem_allocate_guc_obj(dev_priv, PAGE_ALIGN(size));
if (!obj) if (!obj)
return; return;
...@@ -925,7 +924,7 @@ int i915_guc_submission_init(struct drm_device *dev) ...@@ -925,7 +924,7 @@ int i915_guc_submission_init(struct drm_device *dev)
if (guc->ctx_pool_obj) if (guc->ctx_pool_obj)
return 0; /* already allocated */ return 0; /* already allocated */
guc->ctx_pool_obj = gem_allocate_guc_obj(dev_priv->dev, gemsize); guc->ctx_pool_obj = gem_allocate_guc_obj(dev_priv, gemsize);
if (!guc->ctx_pool_obj) if (!guc->ctx_pool_obj)
return -ENOMEM; return -ENOMEM;
...@@ -943,7 +942,7 @@ int i915_guc_submission_enable(struct drm_device *dev) ...@@ -943,7 +942,7 @@ int i915_guc_submission_enable(struct drm_device *dev)
struct i915_guc_client *client; struct i915_guc_client *client;
/* client for execbuf submission */ /* client for execbuf submission */
client = guc_client_alloc(dev, client = guc_client_alloc(dev_priv,
GUC_CTX_PRIORITY_KMD_NORMAL, GUC_CTX_PRIORITY_KMD_NORMAL,
dev_priv->kernel_context); dev_priv->kernel_context);
if (!client) { if (!client) {
...@@ -963,7 +962,7 @@ void i915_guc_submission_disable(struct drm_device *dev) ...@@ -963,7 +962,7 @@ void i915_guc_submission_disable(struct drm_device *dev)
struct drm_i915_private *dev_priv = dev->dev_private; struct drm_i915_private *dev_priv = dev->dev_private;
struct intel_guc *guc = &dev_priv->guc; struct intel_guc *guc = &dev_priv->guc;
guc_client_free(dev, guc->execbuf_client); guc_client_free(dev_priv, guc->execbuf_client);
guc->execbuf_client = NULL; guc->execbuf_client = NULL;
} }
......
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