Skip to content

Commit

Permalink
drm/amdgpu add ce_ram_size for interface query
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ken Wang authored and Alex Deucher committed Jun 4, 2015
1 parent 32bf710 commit a101a89
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/gpu/drm/amd/amdgpu/amdgpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
2 changes: 2 additions & 0 deletions drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
2 changes: 2 additions & 0 deletions include/uapi/drm/amdgpu_drm.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit a101a89

Please sign in to comment.