Commit 15eb9ad0 authored by Jordan Crouse's avatar Jordan Crouse Committed by Rob Clark

drm/msm: Drop context arg to gpu->submit()

Now that we can get the ctx from the submitqueue, the extra arg is
redundant.
Signed-off-by: default avatarJordan Crouse <jcrouse@codeaurora.org>
[split out of previous patch to reduce churny noise]
Signed-off-by: default avatarRob Clark <robdclark@chromium.org>
Reviewed-by: default avatarBjorn Andersson <bjorn.andersson@linaro.org>
parent cf655d61
...@@ -43,8 +43,7 @@ static void a5xx_flush(struct msm_gpu *gpu, struct msm_ringbuffer *ring) ...@@ -43,8 +43,7 @@ static void a5xx_flush(struct msm_gpu *gpu, struct msm_ringbuffer *ring)
gpu_write(gpu, REG_A5XX_CP_RB_WPTR, wptr); gpu_write(gpu, REG_A5XX_CP_RB_WPTR, wptr);
} }
static void a5xx_submit_in_rb(struct msm_gpu *gpu, struct msm_gem_submit *submit, static void a5xx_submit_in_rb(struct msm_gpu *gpu, struct msm_gem_submit *submit)
struct msm_file_private *ctx)
{ {
struct msm_drm_private *priv = gpu->dev->dev_private; struct msm_drm_private *priv = gpu->dev->dev_private;
struct msm_ringbuffer *ring = submit->ring; struct msm_ringbuffer *ring = submit->ring;
...@@ -57,7 +56,7 @@ static void a5xx_submit_in_rb(struct msm_gpu *gpu, struct msm_gem_submit *submit ...@@ -57,7 +56,7 @@ static void a5xx_submit_in_rb(struct msm_gpu *gpu, struct msm_gem_submit *submit
case MSM_SUBMIT_CMD_IB_TARGET_BUF: case MSM_SUBMIT_CMD_IB_TARGET_BUF:
break; break;
case MSM_SUBMIT_CMD_CTX_RESTORE_BUF: case MSM_SUBMIT_CMD_CTX_RESTORE_BUF:
if (priv->lastctx == ctx) if (priv->lastctx == submit->queue->ctx)
break; break;
/* fall-thru */ /* fall-thru */
case MSM_SUBMIT_CMD_BUF: case MSM_SUBMIT_CMD_BUF:
...@@ -103,8 +102,7 @@ static void a5xx_submit_in_rb(struct msm_gpu *gpu, struct msm_gem_submit *submit ...@@ -103,8 +102,7 @@ static void a5xx_submit_in_rb(struct msm_gpu *gpu, struct msm_gem_submit *submit
msm_gpu_retire(gpu); msm_gpu_retire(gpu);
} }
static void a5xx_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit, static void a5xx_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit)
struct msm_file_private *ctx)
{ {
struct adreno_gpu *adreno_gpu = to_adreno_gpu(gpu); struct adreno_gpu *adreno_gpu = to_adreno_gpu(gpu);
struct a5xx_gpu *a5xx_gpu = to_a5xx_gpu(adreno_gpu); struct a5xx_gpu *a5xx_gpu = to_a5xx_gpu(adreno_gpu);
...@@ -114,7 +112,7 @@ static void a5xx_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit, ...@@ -114,7 +112,7 @@ static void a5xx_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit,
if (IS_ENABLED(CONFIG_DRM_MSM_GPU_SUDO) && submit->in_rb) { if (IS_ENABLED(CONFIG_DRM_MSM_GPU_SUDO) && submit->in_rb) {
priv->lastctx = NULL; priv->lastctx = NULL;
a5xx_submit_in_rb(gpu, submit, ctx); a5xx_submit_in_rb(gpu, submit);
return; return;
} }
...@@ -148,7 +146,7 @@ static void a5xx_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit, ...@@ -148,7 +146,7 @@ static void a5xx_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit,
case MSM_SUBMIT_CMD_IB_TARGET_BUF: case MSM_SUBMIT_CMD_IB_TARGET_BUF:
break; break;
case MSM_SUBMIT_CMD_CTX_RESTORE_BUF: case MSM_SUBMIT_CMD_CTX_RESTORE_BUF:
if (priv->lastctx == ctx) if (priv->lastctx == submit->queue->ctx)
break; break;
/* fall-thru */ /* fall-thru */
case MSM_SUBMIT_CMD_BUF: case MSM_SUBMIT_CMD_BUF:
......
...@@ -81,8 +81,7 @@ static void get_stats_counter(struct msm_ringbuffer *ring, u32 counter, ...@@ -81,8 +81,7 @@ static void get_stats_counter(struct msm_ringbuffer *ring, u32 counter,
OUT_RING(ring, upper_32_bits(iova)); OUT_RING(ring, upper_32_bits(iova));
} }
static void a6xx_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit, static void a6xx_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit)
struct msm_file_private *ctx)
{ {
unsigned int index = submit->seqno % MSM_GPU_SUBMIT_STATS_COUNT; unsigned int index = submit->seqno % MSM_GPU_SUBMIT_STATS_COUNT;
struct msm_drm_private *priv = gpu->dev->dev_private; struct msm_drm_private *priv = gpu->dev->dev_private;
...@@ -115,7 +114,7 @@ static void a6xx_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit, ...@@ -115,7 +114,7 @@ static void a6xx_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit,
case MSM_SUBMIT_CMD_IB_TARGET_BUF: case MSM_SUBMIT_CMD_IB_TARGET_BUF:
break; break;
case MSM_SUBMIT_CMD_CTX_RESTORE_BUF: case MSM_SUBMIT_CMD_CTX_RESTORE_BUF:
if (priv->lastctx == ctx) if (priv->lastctx == submit->queue->ctx)
break; break;
/* fall-thru */ /* fall-thru */
case MSM_SUBMIT_CMD_BUF: case MSM_SUBMIT_CMD_BUF:
......
...@@ -440,8 +440,7 @@ void adreno_recover(struct msm_gpu *gpu) ...@@ -440,8 +440,7 @@ void adreno_recover(struct msm_gpu *gpu)
} }
} }
void adreno_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit, void adreno_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit)
struct msm_file_private *ctx)
{ {
struct adreno_gpu *adreno_gpu = to_adreno_gpu(gpu); struct adreno_gpu *adreno_gpu = to_adreno_gpu(gpu);
struct msm_drm_private *priv = gpu->dev->dev_private; struct msm_drm_private *priv = gpu->dev->dev_private;
...@@ -455,7 +454,7 @@ void adreno_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit, ...@@ -455,7 +454,7 @@ void adreno_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit,
break; break;
case MSM_SUBMIT_CMD_CTX_RESTORE_BUF: case MSM_SUBMIT_CMD_CTX_RESTORE_BUF:
/* ignore if there has not been a ctx switch: */ /* ignore if there has not been a ctx switch: */
if (priv->lastctx == ctx) if (priv->lastctx == submit->queue->ctx)
break; break;
/* fall-thru */ /* fall-thru */
case MSM_SUBMIT_CMD_BUF: case MSM_SUBMIT_CMD_BUF:
......
...@@ -269,8 +269,7 @@ struct drm_gem_object *adreno_fw_create_bo(struct msm_gpu *gpu, ...@@ -269,8 +269,7 @@ struct drm_gem_object *adreno_fw_create_bo(struct msm_gpu *gpu,
const struct firmware *fw, u64 *iova); const struct firmware *fw, u64 *iova);
int adreno_hw_init(struct msm_gpu *gpu); int adreno_hw_init(struct msm_gpu *gpu);
void adreno_recover(struct msm_gpu *gpu); void adreno_recover(struct msm_gpu *gpu);
void adreno_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit, void adreno_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit);
struct msm_file_private *ctx);
void adreno_flush(struct msm_gpu *gpu, struct msm_ringbuffer *ring); void adreno_flush(struct msm_gpu *gpu, struct msm_ringbuffer *ring);
bool adreno_idle(struct msm_gpu *gpu, struct msm_ringbuffer *ring); bool adreno_idle(struct msm_gpu *gpu, struct msm_ringbuffer *ring);
#if defined(CONFIG_DEBUG_FS) || defined(CONFIG_DEV_COREDUMP) #if defined(CONFIG_DEBUG_FS) || defined(CONFIG_DEV_COREDUMP)
......
...@@ -785,7 +785,7 @@ int msm_ioctl_gem_submit(struct drm_device *dev, void *data, ...@@ -785,7 +785,7 @@ int msm_ioctl_gem_submit(struct drm_device *dev, void *data,
} }
} }
msm_gpu_submit(gpu, submit, ctx); msm_gpu_submit(gpu, submit);
args->fence = submit->fence->seqno; args->fence = submit->fence->seqno;
......
...@@ -524,7 +524,7 @@ static void recover_worker(struct work_struct *work) ...@@ -524,7 +524,7 @@ static void recover_worker(struct work_struct *work)
struct msm_ringbuffer *ring = gpu->rb[i]; struct msm_ringbuffer *ring = gpu->rb[i];
list_for_each_entry(submit, &ring->submits, node) list_for_each_entry(submit, &ring->submits, node)
gpu->funcs->submit(gpu, submit, NULL); gpu->funcs->submit(gpu, submit);
} }
} }
...@@ -751,8 +751,7 @@ void msm_gpu_retire(struct msm_gpu *gpu) ...@@ -751,8 +751,7 @@ void msm_gpu_retire(struct msm_gpu *gpu)
} }
/* add bo's to gpu's ring, and kick gpu: */ /* add bo's to gpu's ring, and kick gpu: */
void msm_gpu_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit, void msm_gpu_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit)
struct msm_file_private *ctx)
{ {
struct drm_device *dev = gpu->dev; struct drm_device *dev = gpu->dev;
struct msm_drm_private *priv = dev->dev_private; struct msm_drm_private *priv = dev->dev_private;
...@@ -792,8 +791,8 @@ void msm_gpu_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit, ...@@ -792,8 +791,8 @@ void msm_gpu_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit,
msm_gem_move_to_active(&msm_obj->base, gpu, false, submit->fence); msm_gem_move_to_active(&msm_obj->base, gpu, false, submit->fence);
} }
gpu->funcs->submit(gpu, submit, ctx); gpu->funcs->submit(gpu, submit);
priv->lastctx = ctx; priv->lastctx = submit->queue->ctx;
hangcheck_timer_reset(gpu); hangcheck_timer_reset(gpu);
} }
......
...@@ -46,8 +46,7 @@ struct msm_gpu_funcs { ...@@ -46,8 +46,7 @@ struct msm_gpu_funcs {
int (*hw_init)(struct msm_gpu *gpu); int (*hw_init)(struct msm_gpu *gpu);
int (*pm_suspend)(struct msm_gpu *gpu); int (*pm_suspend)(struct msm_gpu *gpu);
int (*pm_resume)(struct msm_gpu *gpu); int (*pm_resume)(struct msm_gpu *gpu);
void (*submit)(struct msm_gpu *gpu, struct msm_gem_submit *submit, void (*submit)(struct msm_gpu *gpu, struct msm_gem_submit *submit);
struct msm_file_private *ctx);
void (*flush)(struct msm_gpu *gpu, struct msm_ringbuffer *ring); void (*flush)(struct msm_gpu *gpu, struct msm_ringbuffer *ring);
irqreturn_t (*irq)(struct msm_gpu *irq); irqreturn_t (*irq)(struct msm_gpu *irq);
struct msm_ringbuffer *(*active_ring)(struct msm_gpu *gpu); struct msm_ringbuffer *(*active_ring)(struct msm_gpu *gpu);
...@@ -293,8 +292,7 @@ int msm_gpu_perfcntr_sample(struct msm_gpu *gpu, uint32_t *activetime, ...@@ -293,8 +292,7 @@ int msm_gpu_perfcntr_sample(struct msm_gpu *gpu, uint32_t *activetime,
uint32_t *totaltime, uint32_t ncntrs, uint32_t *cntrs); uint32_t *totaltime, uint32_t ncntrs, uint32_t *cntrs);
void msm_gpu_retire(struct msm_gpu *gpu); void msm_gpu_retire(struct msm_gpu *gpu);
void msm_gpu_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit, void msm_gpu_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit);
struct msm_file_private *ctx);
int msm_gpu_init(struct drm_device *drm, struct platform_device *pdev, int msm_gpu_init(struct drm_device *drm, struct platform_device *pdev,
struct msm_gpu *gpu, const struct msm_gpu_funcs *funcs, struct msm_gpu *gpu, const struct msm_gpu_funcs *funcs,
......
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