drm/msm: Remove adreno_last_fence

adreno_last_fence is no longer very useful since we have a handy
per-ring pointer directly to the values we need.

Change-Id: Ic0dedbadfb195551afcd016651776965da32fb2d
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
This commit is contained in:
Jordan Crouse 2017-06-28 09:55:11 -06:00
parent 747d4d00db
commit abfc1cf3b3
7 changed files with 8 additions and 23 deletions

View file

@ -439,7 +439,6 @@ static const struct adreno_gpu_funcs funcs = {
.pm_suspend = msm_gpu_pm_suspend,
.pm_resume = msm_gpu_pm_resume,
.recover = a3xx_recover,
.last_fence = adreno_last_fence,
.submitted_fence = adreno_submitted_fence,
.submit = adreno_submit,
.flush = adreno_flush,

View file

@ -522,7 +522,6 @@ static const struct adreno_gpu_funcs funcs = {
.pm_suspend = a4xx_pm_suspend,
.pm_resume = a4xx_pm_resume,
.recover = a4xx_recover,
.last_fence = adreno_last_fence,
.submitted_fence = adreno_submitted_fence,
.submit = adreno_submit,
.flush = adreno_flush,

View file

@ -1252,7 +1252,6 @@ static const struct adreno_gpu_funcs funcs = {
.pm_suspend = a5xx_pm_suspend,
.pm_resume = a5xx_pm_resume,
.recover = a5xx_recover,
.last_fence = adreno_last_fence,
.submitted_fence = adreno_submitted_fence,
.submit = a5xx_submit,
.flush = a5xx_flush,

View file

@ -130,11 +130,6 @@ uint32_t adreno_submitted_fence(struct msm_gpu *gpu,
return ring->submitted_fence;
}
uint32_t adreno_last_fence(struct msm_gpu *gpu, struct msm_ringbuffer *ring)
{
return ring ? ring->memptrs->fence : 0;
}
void adreno_recover(struct msm_gpu *gpu)
{
struct drm_device *dev = gpu->dev;
@ -294,7 +289,7 @@ void adreno_show(struct msm_gpu *gpu, struct seq_file *m)
continue;
seq_printf(m, "rb %d: fence: %d/%d\n", i,
adreno_last_fence(gpu, ring),
ring->memptrs->fence,
adreno_submitted_fence(gpu, ring));
seq_printf(m, " rptr: %d\n",
@ -344,7 +339,7 @@ void adreno_dump_info(struct msm_gpu *gpu)
continue;
dev_err(dev->dev, " ring %d: fence %d/%d rptr/wptr %x/%x\n", i,
adreno_last_fence(gpu, ring),
ring->memptrs->fence,
adreno_submitted_fence(gpu, ring),
get_rptr(adreno_gpu, ring),
get_wptr(ring));
@ -603,7 +598,7 @@ static void adreno_snapshot_ringbuffer(struct msm_gpu *gpu,
header.rptr = get_rptr(adreno_gpu, ring);
header.wptr = get_wptr(ring);
header.timestamp_queued = adreno_submitted_fence(gpu, ring);
header.timestamp_retired = adreno_last_fence(gpu, ring);
header.timestamp_retired = ring->memptrs->fence;
/* Write the header even if the ringbuffer data is empty */
if (!SNAPSHOT_HEADER(snapshot, header, SNAPSHOT_SECTION_RB_V2,

View file

@ -217,7 +217,6 @@ static inline int adreno_is_a540(struct adreno_gpu *gpu)
int adreno_get_param(struct msm_gpu *gpu, uint32_t param, uint64_t *value);
int adreno_hw_init(struct msm_gpu *gpu);
uint32_t adreno_last_fence(struct msm_gpu *gpu, struct msm_ringbuffer *ring);
uint32_t adreno_submitted_fence(struct msm_gpu *gpu,
struct msm_ringbuffer *ring);
void adreno_recover(struct msm_gpu *gpu);

View file

@ -310,8 +310,7 @@ static void recover_worker(struct work_struct *work)
/* Retire all events that have already passed */
FOR_EACH_RING(gpu, ring, i)
retire_submits(gpu, ring,
gpu->funcs->last_fence(gpu, ring));
retire_submits(gpu, ring, ring->memptrs->fence);
retire_guilty_submit(gpu, gpu->funcs->active_ring(gpu));
@ -344,7 +343,7 @@ static void hangcheck_handler(unsigned long data)
struct drm_device *dev = gpu->dev;
struct msm_drm_private *priv = dev->dev_private;
struct msm_ringbuffer *ring = gpu->funcs->active_ring(gpu);
uint32_t fence = gpu->funcs->last_fence(gpu, ring);
uint32_t fence = ring->memptrs->fence;
uint32_t submitted = gpu->funcs->submitted_fence(gpu, ring);
if (fence != gpu->hangcheck_fence[ring->id]) {
@ -542,16 +541,13 @@ static void retire_worker(struct work_struct *work)
int i;
FOR_EACH_RING(gpu, ring, i) {
uint32_t fence;
if (!ring)
continue;
fence = gpu->funcs->last_fence(gpu, ring);
msm_update_fence(gpu->dev, fence);
msm_update_fence(gpu->dev, ring->memptrs->fence);
mutex_lock(&dev->struct_mutex);
_retire_ring(gpu, ring, fence);
_retire_ring(gpu, ring, ring->memptrs->fence);
mutex_unlock(&dev->struct_mutex);
}

View file

@ -64,8 +64,6 @@ struct msm_gpu_funcs {
void (*submit)(struct msm_gpu *gpu, struct msm_gem_submit *submit);
void (*flush)(struct msm_gpu *gpu, struct msm_ringbuffer *ring);
irqreturn_t (*irq)(struct msm_gpu *irq);
uint32_t (*last_fence)(struct msm_gpu *gpu,
struct msm_ringbuffer *ring);
uint32_t (*submitted_fence)(struct msm_gpu *gpu,
struct msm_ringbuffer *ring);
struct msm_ringbuffer *(*active_ring)(struct msm_gpu *gpu);
@ -186,7 +184,7 @@ static inline bool msm_gpu_active(struct msm_gpu *gpu)
FOR_EACH_RING(gpu, ring, i) {
if (gpu->funcs->submitted_fence(gpu, ring) >
gpu->funcs->last_fence(gpu, ring))
ring->memptrs->fence)
return true;
}