drm/amdgpu add ce_ram_size for interface query
authorKen Wang <Qingqing.Wang@amd.com>
Wed, 3 Jun 2015 09:47:54 +0000 (17:47 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 4 Jun 2015 01:04:02 +0000 (21:04 -0400)
Add a query for the CE ram size.  User mode drivers
will want to use this to determine how much size
of the cache on the CE.

Signed-off-by: Ken Wang <Qingqing.Wang@amd.com>
Reviewd-by: Jammy Zhou <Jammy.Zhou@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu.h
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
include/uapi/drm/amdgpu_drm.h

index 4300e3d4b1cdf584e0a14f0b2c483151d8159f37..6c99b7560a270b0419489f1041fb422d28f54147 100644 (file)
@@ -1136,6 +1136,8 @@ struct amdgpu_gfx {
        uint32_t gfx_current_status;
        /* sync signal for const engine */
        unsigned ce_sync_offs;
+       /* ce ram size*/
+       unsigned ce_ram_size;
 };
 
 int amdgpu_ib_get(struct amdgpu_ring *ring, struct amdgpu_vm *vm,
index 3c182b6c5a274ebf083b1cac98a87e6f087663de..9ede2446dcd6a1823c4e7c23df7e3e07dbd27b4c 100644 (file)
@@ -441,6 +441,7 @@ static int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file
                amdgpu_asic_get_cu_info(adev, &cu_info);
                dev_info.cu_active_number = cu_info.number;
                dev_info.cu_ao_mask = cu_info.ao_cu_mask;
+               dev_info.ce_ram_size = adev->gfx.ce_ram_size;
                memcpy(&dev_info.cu_bitmap[0], &cu_info.bitmap[0], sizeof(cu_info.bitmap));
 
                return copy_to_user(out, &dev_info,
index ed2f35de1d4f5b27a8fffdf89ecd36f10a3b2733..faa39b38f0f315b2c3f1b44e37e3fd0b48ac2d52 100644 (file)
@@ -4820,6 +4820,8 @@ static int gfx_v7_0_hw_init(void *handle)
        if (r)
                return r;
 
+       adev->gfx.ce_ram_size = 0x8000;
+
        return r;
 }
 
index ffdba19650296569e7d12721abe6b5aebaefb007..1895de4334467e90ac2ef6ba4b931a4475cb7622 100644 (file)
@@ -895,6 +895,8 @@ static int gfx_v8_0_sw_init(void *handle)
        if (r)
                return r;
 
+       adev->gfx.ce_ram_size = 0x8000;
+
        return 0;
 }
 
index 420c762f2ed71bd8dadc643e30353e6bef22b585..e24cc2e318df15ad2887c61f64d914a9ae98c5d2 100644 (file)
@@ -573,6 +573,8 @@ struct drm_amdgpu_info_device {
        /** Page table entry - fragment size */
        uint32_t pte_fragment_size;
        uint32_t gart_page_size;
+       /** constant engine ram size*/
+       uint32_t ce_ram_size;
 };
 
 struct drm_amdgpu_info_hw_ip {