Commit 0388aee7 authored by Leo Liu's avatar Leo Liu Committed by Alex Deucher

drm/amdgpu: use the JPEG structure for general driver support

JPEG1.0 will be functional along with VCN1.0
Signed-off-by: default avatarLeo Liu <leo.liu@amd.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent bb0db70f
...@@ -169,10 +169,10 @@ static int amdgpu_ctx_init(struct amdgpu_device *adev, ...@@ -169,10 +169,10 @@ static int amdgpu_ctx_init(struct amdgpu_device *adev,
} }
break; break;
case AMDGPU_HW_IP_VCN_JPEG: case AMDGPU_HW_IP_VCN_JPEG:
for (j = 0; j < adev->vcn.num_vcn_inst; ++j) { for (j = 0; j < adev->jpeg.num_jpeg_inst; ++j) {
if (adev->vcn.harvest_config & (1 << j)) if (adev->vcn.harvest_config & (1 << j))
continue; continue;
rings[num_rings++] = &adev->vcn.inst[j].ring_jpeg; rings[num_rings++] = &adev->jpeg.inst[j].ring_dec;
} }
break; break;
} }
......
...@@ -401,11 +401,11 @@ static int amdgpu_hw_ip_info(struct amdgpu_device *adev, ...@@ -401,11 +401,11 @@ static int amdgpu_hw_ip_info(struct amdgpu_device *adev,
break; break;
case AMDGPU_HW_IP_VCN_JPEG: case AMDGPU_HW_IP_VCN_JPEG:
type = AMD_IP_BLOCK_TYPE_VCN; type = AMD_IP_BLOCK_TYPE_VCN;
for (i = 0; i < adev->vcn.num_vcn_inst; i++) { for (i = 0; i < adev->jpeg.num_jpeg_inst; i++) {
if (adev->uvd.harvest_config & (1 << i)) if (adev->jpeg.harvest_config & (1 << i))
continue; continue;
if (adev->vcn.inst[i].ring_jpeg.sched.ready) if (adev->jpeg.inst[i].ring_dec.sched.ready)
++num_rings; ++num_rings;
} }
ib_start_alignment = 16; ib_start_alignment = 16;
......
...@@ -214,8 +214,6 @@ int amdgpu_vcn_sw_fini(struct amdgpu_device *adev) ...@@ -214,8 +214,6 @@ int amdgpu_vcn_sw_fini(struct amdgpu_device *adev)
for (i = 0; i < adev->vcn.num_enc_rings; ++i) for (i = 0; i < adev->vcn.num_enc_rings; ++i)
amdgpu_ring_fini(&adev->vcn.inst[j].ring_enc[i]); amdgpu_ring_fini(&adev->vcn.inst[j].ring_enc[i]);
amdgpu_ring_fini(&adev->vcn.inst[j].ring_jpeg);
} }
release_firmware(adev->vcn.fw); release_firmware(adev->vcn.fw);
...@@ -308,7 +306,7 @@ static void amdgpu_vcn_idle_work_handler(struct work_struct *work) ...@@ -308,7 +306,7 @@ static void amdgpu_vcn_idle_work_handler(struct work_struct *work)
else else
new_state.fw_based = VCN_DPG_STATE__UNPAUSE; new_state.fw_based = VCN_DPG_STATE__UNPAUSE;
if (amdgpu_fence_count_emitted(&adev->vcn.inst[j].ring_jpeg)) if (amdgpu_fence_count_emitted(&adev->jpeg.inst[j].ring_dec))
new_state.jpeg = VCN_DPG_STATE__PAUSE; new_state.jpeg = VCN_DPG_STATE__PAUSE;
else else
new_state.jpeg = VCN_DPG_STATE__UNPAUSE; new_state.jpeg = VCN_DPG_STATE__UNPAUSE;
...@@ -316,7 +314,7 @@ static void amdgpu_vcn_idle_work_handler(struct work_struct *work) ...@@ -316,7 +314,7 @@ static void amdgpu_vcn_idle_work_handler(struct work_struct *work)
adev->vcn.pause_dpg_mode(adev, &new_state); adev->vcn.pause_dpg_mode(adev, &new_state);
} }
fence[j] += amdgpu_fence_count_emitted(&adev->vcn.inst[j].ring_jpeg); fence[j] += amdgpu_fence_count_emitted(&adev->jpeg.inst[j].ring_dec);
fence[j] += amdgpu_fence_count_emitted(&adev->vcn.inst[j].ring_dec); fence[j] += amdgpu_fence_count_emitted(&adev->vcn.inst[j].ring_dec);
fences += fence[j]; fences += fence[j];
} }
...@@ -360,7 +358,7 @@ void amdgpu_vcn_ring_begin_use(struct amdgpu_ring *ring) ...@@ -360,7 +358,7 @@ void amdgpu_vcn_ring_begin_use(struct amdgpu_ring *ring)
else else
new_state.fw_based = VCN_DPG_STATE__UNPAUSE; new_state.fw_based = VCN_DPG_STATE__UNPAUSE;
if (amdgpu_fence_count_emitted(&adev->vcn.inst[ring->me].ring_jpeg)) if (amdgpu_fence_count_emitted(&adev->jpeg.inst[ring->me].ring_dec))
new_state.jpeg = VCN_DPG_STATE__PAUSE; new_state.jpeg = VCN_DPG_STATE__PAUSE;
else else
new_state.jpeg = VCN_DPG_STATE__UNPAUSE; new_state.jpeg = VCN_DPG_STATE__UNPAUSE;
......
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