Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/external/bsd/drm2/dist/drm/amd/amdgpu amdgpu: Fix scale ...
details: https://anonhg.NetBSD.org/src/rev/067735a26f72
branches: trunk
changeset: 373604:067735a26f72
user: riastradh <riastradh%NetBSD.org@localhost>
date: Tue Feb 21 11:39:39 2023 +0000
description:
amdgpu: Fix scale factor for 64-bit doorbell indexing.
The register is 64 bits wide, but the indexing is for 32-bit
quantities (and presumably index must be even here).
Found by Jeff Frasca -- thanks!
diffstat:
sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_device.c | 24 +++++++-------
1 files changed, 12 insertions(+), 12 deletions(-)
diffs (70 lines):
diff -r 46417fb2d946 -r 067735a26f72 sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_device.c
--- a/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_device.c Mon Feb 20 15:47:56 2023 +0000
+++ b/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_device.c Tue Feb 21 11:39:39 2023 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: amdgpu_device.c,v 1.17 2022/09/20 23:01:42 mrg Exp $ */
+/* $NetBSD: amdgpu_device.c,v 1.18 2023/02/21 11:39:39 riastradh Exp $ */
/*
* Copyright 2008 Advanced Micro Devices, Inc.
@@ -28,7 +28,7 @@
* Jerome Glisse
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: amdgpu_device.c,v 1.17 2022/09/20 23:01:42 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: amdgpu_device.c,v 1.18 2023/02/21 11:39:39 riastradh Exp $");
#include <linux/power_supply.h>
#include <linux/kthread.h>
@@ -483,19 +483,19 @@
#ifdef __NetBSD__
#ifdef _LP64
return bus_space_read_8(adev->doorbell.bst, adev->doorbell.bsh,
- 8*index);
+ 4*index);
#else
uint64_t lo, hi;
#if _BYTE_ORDER == _LITTLE_ENDIAN
lo = bus_space_read_4(adev->doorbell.bst, adev->doorbell.bsh,
- 8*index);
+ 4*index);
hi = bus_space_read_4(adev->doorbell.bst, adev->doorbell.bsh,
- 8*index + 4);
+ 4*index + 4);
#else
hi = bus_space_read_4(adev->doorbell.bst, adev->doorbell.bsh,
- 8*index);
+ 4*index);
lo = bus_space_read_4(adev->doorbell.bst, adev->doorbell.bsh,
- 8*index + 4);
+ 4*index + 4);
#endif
return lo | (hi << 32);
#endif
@@ -524,21 +524,21 @@
#ifdef __NetBSD__
#ifdef _LP64
bus_space_write_8(adev->doorbell.bst, adev->doorbell.bsh,
- 8*index, v);
+ 4*index, v);
#else
/*
* XXX This might not be as atomic as one might hope...
*/
#if _BYTE_ORDER == _LITTLE_ENDIAN
bus_space_write_4(adev->doorbell.bst, adev->doorbell.bsh,
- 8*index, v & 0xffffffffU);
+ 4*index, v & 0xffffffffU);
bus_space_write_4(adev->doorbell.bst, adev->doorbell.bsh,
- 8*index + 4, v >> 32);
+ 4*index + 4, v >> 32);
#else
bus_space_write_4(adev->doorbell.bst, adev->doorbell.bsh,
- 8*index, v >> 32);
+ 4*index, v >> 32);
bus_space_write_4(adev->doorbell.bst, adev->doorbell.bsh,
- 8*index + 4, v & 0xffffffffU);
+ 4*index + 4, v & 0xffffffffU);
#endif
#endif
#else
Home |
Main Index |
Thread Index |
Old Index