aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2018-07-03 20:27:12 -0400
committerDave Airlie <airlied@redhat.com>2018-07-03 20:27:12 -0400
commitf29135ee4e0d4e01911ed569f731bfdb841cea6d (patch)
treee72d49a2f677dd069c3a673522cf785548148f71 /drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
parenteab976693153b9854bfa83d131374748f6ca4280 (diff)
parent021c91791a5e7e85c567452f1be3e4c2c6cb6063 (diff)
Merge v4.18-rc3 into drm-next
Two requests have come in for a backmerge, and I've got some pull reqs on rc2, so this just makes sense. Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c33
1 files changed, 27 insertions, 6 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
index 3f2a5e73e69f..a66cd521a875 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
@@ -52,7 +52,7 @@ int amdgpu_vcn_sw_init(struct amdgpu_device *adev)
52 unsigned long bo_size; 52 unsigned long bo_size;
53 const char *fw_name; 53 const char *fw_name;
54 const struct common_firmware_header *hdr; 54 const struct common_firmware_header *hdr;
55 unsigned version_major, version_minor, family_id; 55 unsigned char fw_check;
56 int r; 56 int r;
57 57
58 INIT_DELAYED_WORK(&adev->vcn.idle_work, amdgpu_vcn_idle_work_handler); 58 INIT_DELAYED_WORK(&adev->vcn.idle_work, amdgpu_vcn_idle_work_handler);
@@ -83,12 +83,33 @@ int amdgpu_vcn_sw_init(struct amdgpu_device *adev)
83 83
84 hdr = (const struct common_firmware_header *)adev->vcn.fw->data; 84 hdr = (const struct common_firmware_header *)adev->vcn.fw->data;
85 adev->vcn.fw_version = le32_to_cpu(hdr->ucode_version); 85 adev->vcn.fw_version = le32_to_cpu(hdr->ucode_version);
86 family_id = le32_to_cpu(hdr->ucode_version) & 0xff;
87 version_major = (le32_to_cpu(hdr->ucode_version) >> 24) & 0xff;
88 version_minor = (le32_to_cpu(hdr->ucode_version) >> 8) & 0xff;
89 DRM_INFO("Found VCN firmware Version: %hu.%hu Family ID: %hu\n",
90 version_major, version_minor, family_id);
91 86
87 /* Bit 20-23, it is encode major and non-zero for new naming convention.
88 * This field is part of version minor and DRM_DISABLED_FLAG in old naming
89 * convention. Since the l:wq!atest version minor is 0x5B and DRM_DISABLED_FLAG
90 * is zero in old naming convention, this field is always zero so far.
91 * These four bits are used to tell which naming convention is present.
92 */
93 fw_check = (le32_to_cpu(hdr->ucode_version) >> 20) & 0xf;
94 if (fw_check) {
95 unsigned int dec_ver, enc_major, enc_minor, vep, fw_rev;
96
97 fw_rev = le32_to_cpu(hdr->ucode_version) & 0xfff;
98 enc_minor = (le32_to_cpu(hdr->ucode_version) >> 12) & 0xff;
99 enc_major = fw_check;
100 dec_ver = (le32_to_cpu(hdr->ucode_version) >> 24) & 0xf;
101 vep = (le32_to_cpu(hdr->ucode_version) >> 28) & 0xf;
102 DRM_INFO("Found VCN firmware Version ENC: %hu.%hu DEC: %hu VEP: %hu Revision: %hu\n",
103 enc_major, enc_minor, dec_ver, vep, fw_rev);
104 } else {
105 unsigned int version_major, version_minor, family_id;
106
107 family_id = le32_to_cpu(hdr->ucode_version) & 0xff;
108 version_major = (le32_to_cpu(hdr->ucode_version) >> 24) & 0xff;
109 version_minor = (le32_to_cpu(hdr->ucode_version) >> 8) & 0xff;
110 DRM_INFO("Found VCN firmware Version: %hu.%hu Family ID: %hu\n",
111 version_major, version_minor, family_id);
112 }
92 113
93 bo_size = AMDGPU_GPU_PAGE_ALIGN(le32_to_cpu(hdr->ucode_size_bytes) + 8) 114 bo_size = AMDGPU_GPU_PAGE_ALIGN(le32_to_cpu(hdr->ucode_size_bytes) + 8)
94 + AMDGPU_VCN_STACK_SIZE + AMDGPU_VCN_HEAP_SIZE 115 + AMDGPU_VCN_STACK_SIZE + AMDGPU_VCN_HEAP_SIZE