Commit a77b9fdf authored by Leo Liu's avatar Leo Liu Committed by Alex Deucher

drm/amdgpu/VCN: add buffer for indirect SRAM usage

This will be used later for indirect SRAM mode
Signed-off-by: default avatarLeo Liu <leo.liu@amd.com>
Reviewed-by: default avatarJames Zhu <James.Zhu@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 1768908e
...@@ -137,6 +137,16 @@ int amdgpu_vcn_sw_init(struct amdgpu_device *adev) ...@@ -137,6 +137,16 @@ int amdgpu_vcn_sw_init(struct amdgpu_device *adev)
return r; return r;
} }
if (adev->vcn.indirect_sram) {
r = amdgpu_bo_create_kernel(adev, 64 * 2 * 4, PAGE_SIZE,
AMDGPU_GEM_DOMAIN_VRAM, &adev->vcn.dpg_sram_bo,
&adev->vcn.dpg_sram_gpu_addr, &adev->vcn.dpg_sram_cpu_addr);
if (r) {
dev_err(adev->dev, "(%d) failed to allocate DPG bo\n", r);
return r;
}
}
return 0; return 0;
} }
...@@ -146,6 +156,12 @@ int amdgpu_vcn_sw_fini(struct amdgpu_device *adev) ...@@ -146,6 +156,12 @@ int amdgpu_vcn_sw_fini(struct amdgpu_device *adev)
kvfree(adev->vcn.saved_bo); kvfree(adev->vcn.saved_bo);
if (adev->vcn.indirect_sram) {
amdgpu_bo_free_kernel(&adev->vcn.dpg_sram_bo,
&adev->vcn.dpg_sram_gpu_addr,
(void **)&adev->vcn.dpg_sram_cpu_addr);
}
amdgpu_bo_free_kernel(&adev->vcn.vcpu_bo, amdgpu_bo_free_kernel(&adev->vcn.vcpu_bo,
&adev->vcn.gpu_addr, &adev->vcn.gpu_addr,
(void **)&adev->vcn.cpu_addr); (void **)&adev->vcn.cpu_addr);
......
...@@ -164,6 +164,12 @@ struct amdgpu_vcn { ...@@ -164,6 +164,12 @@ struct amdgpu_vcn {
struct amdgpu_vcn_reg internal, external; struct amdgpu_vcn_reg internal, external;
int (*pause_dpg_mode)(struct amdgpu_device *adev, int (*pause_dpg_mode)(struct amdgpu_device *adev,
struct dpg_pause_state *new_state); struct dpg_pause_state *new_state);
bool indirect_sram;
struct amdgpu_bo *dpg_sram_bo;
void *dpg_sram_cpu_addr;
uint64_t dpg_sram_gpu_addr;
uint32_t *dpg_sram_curr_addr;
}; };
int amdgpu_vcn_sw_init(struct amdgpu_device *adev); int amdgpu_vcn_sw_init(struct amdgpu_device *adev);
......
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