]> git.ipfire.org Git - people/ms/linux.git/commitdiff
drm/amdgpu: differentiate between LP and non-LP DDR memory
authorAlex Deucher <alexander.deucher@amd.com>
Mon, 23 May 2022 15:24:31 +0000 (11:24 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 26 May 2022 18:56:33 +0000 (14:56 -0400)
Some applications want to know whether the memory is LP or
not.

Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
include/uapi/drm/amdgpu_drm.h

index 63e0293edc5fe6686029a0bb60f5884bce1913b7..fd8f3731758edec3e9e0c35f3d52d8768e067d92 100644 (file)
@@ -188,13 +188,17 @@ static int convert_atom_mem_type_to_vram_type(struct amdgpu_device *adev,
                        vram_type = AMDGPU_VRAM_TYPE_DDR3;
                        break;
                case Ddr4MemType:
-               case LpDdr4MemType:
                        vram_type = AMDGPU_VRAM_TYPE_DDR4;
                        break;
+               case LpDdr4MemType:
+                       vram_type = AMDGPU_VRAM_TYPE_LPDDR4;
+                       break;
                case Ddr5MemType:
-               case LpDdr5MemType:
                        vram_type = AMDGPU_VRAM_TYPE_DDR5;
                        break;
+               case LpDdr5MemType:
+                       vram_type = AMDGPU_VRAM_TYPE_LPDDR5;
+                       break;
                default:
                        vram_type = AMDGPU_VRAM_TYPE_UNKNOWN;
                        break;
index 5444515c1476e1f5f093497b156c0c62e3587a0a..e1e6441c475f3ffc75cee60ba891df9662f32037 100644 (file)
@@ -1018,7 +1018,9 @@ static const char *amdgpu_vram_names[] = {
        "DDR3",
        "DDR4",
        "GDDR6",
-       "DDR5"
+       "DDR5",
+       "LPDDR4",
+       "LPDDR5"
 };
 
 /**
index 9a1d210d135ddec632fc6ef91ded3cc92229d9df..d9d475d65c76b3ea2d4ab0d7eb131ba366859fb2 100644 (file)
@@ -988,6 +988,8 @@ struct drm_amdgpu_info_vbios {
 #define AMDGPU_VRAM_TYPE_DDR4  8
 #define AMDGPU_VRAM_TYPE_GDDR6 9
 #define AMDGPU_VRAM_TYPE_DDR5  10
+#define AMDGPU_VRAM_TYPE_LPDDR4 11
+#define AMDGPU_VRAM_TYPE_LPDDR5 12
 
 struct drm_amdgpu_info_device {
        /** PCI Device ID */