[PATCH 1/2] amdgpu: export gfx double offchip LDS buffers by gpu info

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am 20.02.2017 um 03:56 schrieb Junwei Zhang:
> Signed-off-by: Junwei Zhang <Jerry.Zhang at amd.com>
> ---
>   amdgpu/amdgpu.h          | 2 ++
>   amdgpu/amdgpu_gpu_info.c | 2 ++
>   include/drm/amdgpu_drm.h | 2 ++
>   3 files changed, 6 insertions(+)
>
> diff --git a/amdgpu/amdgpu.h b/amdgpu/amdgpu.h
> index 84ab688..7a26298 100644
> --- a/amdgpu/amdgpu.h
> +++ b/amdgpu/amdgpu.h
> @@ -487,6 +487,8 @@ struct amdgpu_gpu_info {
>   	uint32_t vce_harvest_config;
>   	/* PCI revision ID */
>   	uint32_t pci_rev_id;
> +	/* gfx double offchip LDS buffers */
> +	uint32_t gc_double_offchip_lds_buf;

That won't work. The kernel IOCTL structures have a size attached to 
them, but the libdrm interface doesn't have that.

It clearly was a bad idea to munch in an extra layer of abstraction 
here. I would say we should just deprecate that interface sooner or later.

Please use the following code in the UMD to query the info directly from 
the kernel:

struct drm_amdgpu_info_device dev_info;

r = amdgpu_query_info(dev, AMDGPU_INFO_DEV_INFO, sizeof(dev_info), 
&dev_info);

This way you also only need to make the two line change 
include/drm/amdgpu_drm.h.

Regards,
Christian.

>   };
>   
>   
> diff --git a/amdgpu/amdgpu_gpu_info.c b/amdgpu/amdgpu_gpu_info.c
> index d801b86..984674e 100644
> --- a/amdgpu/amdgpu_gpu_info.c
> +++ b/amdgpu/amdgpu_gpu_info.c
> @@ -175,6 +175,8 @@ drm_private int amdgpu_query_gpu_info_init(amdgpu_device_handle dev)
>   	dev->info.ce_ram_size = dev->dev_info.ce_ram_size;
>   	dev->info.vce_harvest_config = dev->dev_info.vce_harvest_config;
>   	dev->info.pci_rev_id = dev->dev_info.pci_rev;
> +	dev->info.gc_double_offchip_lds_buf =
> +		dev->dev_info.gc_double_offchip_lds_buf;
>   
>   	for (i = 0; i < (int)dev->info.num_shader_engines; i++) {
>   		unsigned instance = (i << AMDGPU_INFO_MMR_SE_INDEX_SHIFT) |
> diff --git a/include/drm/amdgpu_drm.h b/include/drm/amdgpu_drm.h
> index 9c3bd18..85bb701 100644
> --- a/include/drm/amdgpu_drm.h
> +++ b/include/drm/amdgpu_drm.h
> @@ -767,6 +767,8 @@ struct drm_amdgpu_info_device {
>   	uint32_t vram_bit_width;
>   	/* vce harvesting instance */
>   	uint32_t vce_harvest_config;
> +	/* gfx double offchip LDS buffers */
> +	uint32_t gc_double_offchip_lds_buf;
>   };
>   
>   struct drm_amdgpu_info_hw_ip {




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux