mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-27 19:29:37 +00:00
drm/radeon: properly byte swap vce firmware setup
Firmware is LE. Need to properly byteswap some of the fields so they are interpreted correctly by the driver on BE systems. Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org
This commit is contained in:
parent
9441f964f8
commit
cc78eb2288
1 changed files with 6 additions and 6 deletions
|
@ -178,12 +178,12 @@ int vce_v1_0_load_fw(struct radeon_device *rdev, uint32_t *data)
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
for (i = 0; i < sign->num; ++i) {
|
||||
if (sign->val[i].chip_id == chip_id)
|
||||
for (i = 0; i < le32_to_cpu(sign->num); ++i) {
|
||||
if (le32_to_cpu(sign->val[i].chip_id) == chip_id)
|
||||
break;
|
||||
}
|
||||
|
||||
if (i == sign->num)
|
||||
if (i == le32_to_cpu(sign->num))
|
||||
return -EINVAL;
|
||||
|
||||
data += (256 - 64) / 4;
|
||||
|
@ -191,18 +191,18 @@ int vce_v1_0_load_fw(struct radeon_device *rdev, uint32_t *data)
|
|||
data[1] = sign->val[i].nonce[1];
|
||||
data[2] = sign->val[i].nonce[2];
|
||||
data[3] = sign->val[i].nonce[3];
|
||||
data[4] = sign->len + 64;
|
||||
data[4] = cpu_to_le32(le32_to_cpu(sign->len) + 64);
|
||||
|
||||
memset(&data[5], 0, 44);
|
||||
memcpy(&data[16], &sign[1], rdev->vce_fw->size - sizeof(*sign));
|
||||
|
||||
data += data[4] / 4;
|
||||
data += le32_to_cpu(data[4]) / 4;
|
||||
data[0] = sign->val[i].sigval[0];
|
||||
data[1] = sign->val[i].sigval[1];
|
||||
data[2] = sign->val[i].sigval[2];
|
||||
data[3] = sign->val[i].sigval[3];
|
||||
|
||||
rdev->vce.keyselect = sign->val[i].keyselect;
|
||||
rdev->vce.keyselect = le32_to_cpu(sign->val[i].keyselect);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue