diff options
author | James Zhu <James.Zhu@amd.com> | 2018-01-22 13:46:16 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2018-01-23 01:43:15 -0500 |
commit | dead73d791455a0b4eb6f644ab592b7da6c670dc (patch) | |
tree | ac07acfea7f17d9ec2620607da1ccb124c3fea85 | |
parent | 54bc1398cc0c3affa301d65370be2fd8dcf1bf08 (diff) |
drm/amd/amdgpu: Add Polaris version check
Add Polaris version check if firmware support UVD encode
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: James Zhu <James.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c b/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c index 59271055a30e..b2bfedaf57f1 100644 --- a/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c +++ b/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c | |||
@@ -37,6 +37,9 @@ | |||
37 | #include "gmc/gmc_8_1_d.h" | 37 | #include "gmc/gmc_8_1_d.h" |
38 | #include "vi.h" | 38 | #include "vi.h" |
39 | 39 | ||
40 | /* Polaris10/11/12 firmware version */ | ||
41 | #define FW_1_130_16 ((1 << 24) | (130 << 16) | (16 << 8)) | ||
42 | |||
40 | static void uvd_v6_0_set_ring_funcs(struct amdgpu_device *adev); | 43 | static void uvd_v6_0_set_ring_funcs(struct amdgpu_device *adev); |
41 | static void uvd_v6_0_set_enc_ring_funcs(struct amdgpu_device *adev); | 44 | static void uvd_v6_0_set_enc_ring_funcs(struct amdgpu_device *adev); |
42 | 45 | ||
@@ -58,7 +61,9 @@ static void uvd_v6_0_enable_mgcg(struct amdgpu_device *adev, | |||
58 | */ | 61 | */ |
59 | static inline bool uvd_v6_0_enc_support(struct amdgpu_device *adev) | 62 | static inline bool uvd_v6_0_enc_support(struct amdgpu_device *adev) |
60 | { | 63 | { |
61 | return ((adev->asic_type >= CHIP_POLARIS10) && (adev->asic_type <= CHIP_POLARIS12)); | 64 | return ((adev->asic_type >= CHIP_POLARIS10) && |
65 | (adev->asic_type <= CHIP_POLARIS12) && | ||
66 | (!adev->uvd.fw_version || adev->uvd.fw_version >= FW_1_130_16)); | ||
62 | } | 67 | } |
63 | 68 | ||
64 | /** | 69 | /** |
@@ -411,7 +416,15 @@ static int uvd_v6_0_sw_init(void *handle) | |||
411 | if (r) | 416 | if (r) |
412 | return r; | 417 | return r; |
413 | 418 | ||
414 | if (uvd_v6_0_enc_support(adev)) { | 419 | if (!uvd_v6_0_enc_support(adev)) { |
420 | for (i = 0; i < adev->uvd.num_enc_rings; ++i) | ||
421 | adev->uvd.ring_enc[i].funcs = NULL; | ||
422 | |||
423 | adev->uvd.irq.num_types = 1; | ||
424 | adev->uvd.num_enc_rings = 0; | ||
425 | |||
426 | DRM_INFO("UVD ENC is disabled\n"); | ||
427 | } else { | ||
415 | struct drm_sched_rq *rq; | 428 | struct drm_sched_rq *rq; |
416 | ring = &adev->uvd.ring_enc[0]; | 429 | ring = &adev->uvd.ring_enc[0]; |
417 | rq = &ring->sched.sched_rq[DRM_SCHED_PRIORITY_NORMAL]; | 430 | rq = &ring->sched.sched_rq[DRM_SCHED_PRIORITY_NORMAL]; |