diff mbox

drm/amdkfd: Don't report local memory size

Message ID 1430815221-22568-1-git-send-email-oded.gabbay@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Oded Gabbay May 5, 2015, 8:40 a.m. UTC
This patch sets the local memory size that is reported to userspace to 0.
This is done to make sure that userspace won't try to allocate local memory
for HSA.

As long as amdkfd doesn't support allocating local memory for HSA,
we need this patch.

Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
---
 drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Alex Deucher May 5, 2015, 4:19 p.m. UTC | #1
On Tue, May 5, 2015 at 4:40 AM, Oded Gabbay <oded.gabbay@gmail.com> wrote:
> This patch sets the local memory size that is reported to userspace to 0.
> This is done to make sure that userspace won't try to allocate local memory
> for HSA.
>
> As long as amdkfd doesn't support allocating local memory for HSA,
> we need this patch.
>
> Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>

> ---
>  drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c
> index 661c660..e469c4b 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c
> @@ -728,9 +728,9 @@ static ssize_t node_show(struct kobject *kobj, struct attribute *attr,
>                 sysfs_show_32bit_prop(buffer, "max_engine_clk_fcompute",
>                         dev->gpu->kfd2kgd->get_max_engine_clock_in_mhz(
>                                         dev->gpu->kgd));
> +
>                 sysfs_show_64bit_prop(buffer, "local_mem_size",
> -                       dev->gpu->kfd2kgd->get_vmem_size(
> -                                       dev->gpu->kgd));
> +                               (unsigned long long int) 0);
>
>                 sysfs_show_32bit_prop(buffer, "fw_version",
>                         dev->gpu->kfd2kgd->get_fw_version(
> --
> 1.9.1
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
diff mbox

Patch

diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c
index 661c660..e469c4b 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c
@@ -728,9 +728,9 @@  static ssize_t node_show(struct kobject *kobj, struct attribute *attr,
 		sysfs_show_32bit_prop(buffer, "max_engine_clk_fcompute",
 			dev->gpu->kfd2kgd->get_max_engine_clock_in_mhz(
 					dev->gpu->kgd));
+
 		sysfs_show_64bit_prop(buffer, "local_mem_size",
-			dev->gpu->kfd2kgd->get_vmem_size(
-					dev->gpu->kgd));
+				(unsigned long long int) 0);
 
 		sysfs_show_32bit_prop(buffer, "fw_version",
 			dev->gpu->kfd2kgd->get_fw_version(