Am 31.05.2017 um 21:28 schrieb Leo Liu: > To simplify vce bo create > > Signed-off-by: Leo Liu <leo.liu at amd.com> > --- > drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c | 27 +++------------------------ > 1 file changed, 3 insertions(+), 24 deletions(-) > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c > index 735c38d..b9b0906 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c > @@ -165,35 +165,14 @@ int amdgpu_vce_sw_init(struct amdgpu_device *adev, unsigned long size) > adev->vce.fw_version = ((version_major << 24) | (version_minor << 16) | > (binary_id << 8)); > > - /* allocate firmware, stack and heap BO */ > - > - r = amdgpu_bo_create(adev, size, PAGE_SIZE, true, > - AMDGPU_GEM_DOMAIN_VRAM, > - AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED | > - AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS, > - NULL, NULL, &adev->vce.vcpu_bo); > + r = amdgpu_bo_create_kernel(adev, size, PAGE_SIZE, > + AMDGPU_GEM_DOMAIN_VRAM, &adev->vce.vcpu_bo, > + &adev->vce.gpu_addr, &adev->vce.cpu_addr); When you now CPU map the BO you also need to make sure that this mapping is properly destroyed in amdgpu_vce_sw_fini(). In other words use amdgpu_bo_free_kernel() in amdgpu_vce_sw_fini() as well :) Apart from that the set looks good to me, Christian. > if (r) { > dev_err(adev->dev, "(%d) failed to allocate VCE bo\n", r); > return r; > } > > - r = amdgpu_bo_reserve(adev->vce.vcpu_bo, false); > - if (r) { > - amdgpu_bo_unref(&adev->vce.vcpu_bo); > - dev_err(adev->dev, "(%d) failed to reserve VCE bo\n", r); > - return r; > - } > - > - r = amdgpu_bo_pin(adev->vce.vcpu_bo, AMDGPU_GEM_DOMAIN_VRAM, > - &adev->vce.gpu_addr); > - amdgpu_bo_unreserve(adev->vce.vcpu_bo); > - if (r) { > - amdgpu_bo_unref(&adev->vce.vcpu_bo); > - dev_err(adev->dev, "(%d) VCE bo pin failed\n", r); > - return r; > - } > - > - > ring = &adev->vce.ring[0]; > rq = &ring->sched.sched_rq[AMD_SCHED_PRIORITY_NORMAL]; > r = amd_sched_entity_init(&ring->sched, &adev->vce.entity,