Am 30.06.2016 um 09:09 schrieb Chunming Zhou: > Change-Id: I8ec7c9d6e34178752e2e97f4a1f2c3b705c66c82 > Signed-off-by: Chunming Zhou <David1.Zhou at amd.com> We could remove even more, but this should do it for now. Patch is Reviewed-by: Christian König <christian.koenig at amd.com>. Regards, Christian. > --- > drivers/gpu/drm/amd/amdgpu/amdgpu.h | 4 -- > drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 18 -------- > drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 72 ------------------------------ > 3 files changed, 94 deletions(-) > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h > index 35248d0..d22d0fa 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h > @@ -1211,10 +1211,6 @@ void amdgpu_ring_insert_nop(struct amdgpu_ring *ring, uint32_t count); > void amdgpu_ring_generic_pad_ib(struct amdgpu_ring *ring, struct amdgpu_ib *ib); > void amdgpu_ring_commit(struct amdgpu_ring *ring); > void amdgpu_ring_undo(struct amdgpu_ring *ring); > -unsigned amdgpu_ring_backup(struct amdgpu_ring *ring, > - uint32_t **data); > -int amdgpu_ring_restore(struct amdgpu_ring *ring, > - unsigned size, uint32_t *data); > int amdgpu_ring_init(struct amdgpu_device *adev, struct amdgpu_ring *ring, > unsigned ring_size, u32 nop, u32 align_mask, > struct amdgpu_irq_src *irq_src, unsigned irq_type, > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c > index 35cc529..8793bf6 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c > @@ -1932,11 +1932,6 @@ int amdgpu_resume_kms(struct drm_device *dev, bool resume, bool fbcon) > int amdgpu_gpu_reset(struct amdgpu_device *adev) > { > struct drm_atomic_state *state = NULL; > - unsigned ring_sizes[AMDGPU_MAX_RINGS]; > - uint32_t *ring_data[AMDGPU_MAX_RINGS]; > - > - bool saved = false; > - > int i, r; > int resched; > > @@ -1965,19 +1960,6 @@ int amdgpu_gpu_reset(struct amdgpu_device *adev) > amdgpu_atombios_scratch_regs_save(adev); > r = amdgpu_suspend(adev); > > - for (i = 0; i < AMDGPU_MAX_RINGS; ++i) { > - struct amdgpu_ring *ring = adev->rings[i]; > - if (!ring) > - continue; > - > - ring_sizes[i] = amdgpu_ring_backup(ring, &ring_data[i]); > - if (ring_sizes[i]) { > - saved = true; > - dev_info(adev->dev, "Saved %d dwords of commands " > - "on ring %d.\n", ring_sizes[i], i); > - } > - } > - > retry: > /* Disable fb access */ > if (adev->mode_info.num_crtc) { > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c > index 7311d58..ac8b62f 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c > @@ -142,78 +142,6 @@ void amdgpu_ring_undo(struct amdgpu_ring *ring) > } > > /** > - * amdgpu_ring_backup - Back up the content of a ring > - * > - * @ring: the ring we want to back up > - * > - * Saves all unprocessed commits from a ring, returns the number of dwords saved. > - */ > -unsigned amdgpu_ring_backup(struct amdgpu_ring *ring, > - uint32_t **data) > -{ > - unsigned size, ptr, i; > - > - *data = NULL; > - > - if (ring->ring_obj == NULL) > - return 0; > - > - /* it doesn't make sense to save anything if all fences are signaled */ > - if (!amdgpu_fence_count_emitted(ring)) > - return 0; > - > - ptr = le32_to_cpu(*ring->next_rptr_cpu_addr); > - > - size = ring->wptr + (ring->ring_size / 4); > - size -= ptr; > - size &= ring->ptr_mask; > - if (size == 0) > - return 0; > - > - /* and then save the content of the ring */ > - *data = kmalloc_array(size, sizeof(uint32_t), GFP_KERNEL); > - if (!*data) > - return 0; > - for (i = 0; i < size; ++i) { > - (*data)[i] = ring->ring[ptr++]; > - ptr &= ring->ptr_mask; > - } > - > - return size; > -} > - > -/** > - * amdgpu_ring_restore - append saved commands to the ring again > - * > - * @ring: ring to append commands to > - * @size: number of dwords we want to write > - * @data: saved commands > - * > - * Allocates space on the ring and restore the previously saved commands. > - */ > -int amdgpu_ring_restore(struct amdgpu_ring *ring, > - unsigned size, uint32_t *data) > -{ > - int i, r; > - > - if (!size || !data) > - return 0; > - > - /* restore the saved ring content */ > - r = amdgpu_ring_alloc(ring, size); > - if (r) > - return r; > - > - for (i = 0; i < size; ++i) { > - amdgpu_ring_write(ring, data[i]); > - } > - > - amdgpu_ring_commit(ring); > - kfree(data); > - return 0; > -} > - > -/** > * amdgpu_ring_init - init driver ring struct. > * > * @adev: amdgpu_device pointer