mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
drm/amdgpu/ttm: replace duplicate code with exiting function
using exiting function to replace duplicate code blocks in amdgpu_ttm_vram_write(). Signed-off-by: Kevin Wang <kevin1.wang@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
048af66be7
commit
5fb95aa73f
1 changed files with 1 additions and 6 deletions
|
@ -2145,7 +2145,6 @@ static ssize_t amdgpu_ttm_vram_write(struct file *f, const char __user *buf,
|
|||
return -ENXIO;
|
||||
|
||||
while (size) {
|
||||
unsigned long flags;
|
||||
uint32_t value;
|
||||
|
||||
if (*pos >= adev->gmc.mc_vram_size)
|
||||
|
@ -2155,11 +2154,7 @@ static ssize_t amdgpu_ttm_vram_write(struct file *f, const char __user *buf,
|
|||
if (r)
|
||||
return r;
|
||||
|
||||
spin_lock_irqsave(&adev->mmio_idx_lock, flags);
|
||||
WREG32_NO_KIQ(mmMM_INDEX, ((uint32_t)*pos) | 0x80000000);
|
||||
WREG32_NO_KIQ(mmMM_INDEX_HI, *pos >> 31);
|
||||
WREG32_NO_KIQ(mmMM_DATA, value);
|
||||
spin_unlock_irqrestore(&adev->mmio_idx_lock, flags);
|
||||
amdgpu_device_mm_access(adev, *pos, &value, 4, true);
|
||||
|
||||
result += 4;
|
||||
buf += 4;
|
||||
|
|
Loading…
Add table
Reference in a new issue