From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jerome Glisse Subject: Re: [PATCH 05/83] drm/radeon: Add kfd-->kgd interface to get virtual ram size Date: Fri, 11 Jul 2014 12:27:49 -0400 Message-ID: <20140711162748.GF1870@gmail.com> References: <1405029027-6085-1-git-send-email-oded.gabbay@amd.com> <1405029027-6085-4-git-send-email-oded.gabbay@amd.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mail-qg0-f49.google.com (mail-qg0-f49.google.com [209.85.192.49]) by gabe.freedesktop.org (Postfix) with ESMTP id 36E736E291 for ; Fri, 11 Jul 2014 09:27:54 -0700 (PDT) Received: by mail-qg0-f49.google.com with SMTP id 63so1128127qgz.22 for ; Fri, 11 Jul 2014 09:27:53 -0700 (PDT) Content-Disposition: inline In-Reply-To: <1405029027-6085-4-git-send-email-oded.gabbay@amd.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Oded Gabbay Cc: Andrew Lewycky , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Alex Deucher , Christian =?iso-8859-1?Q?K=F6nig?= List-Id: dri-devel@lists.freedesktop.org On Fri, Jul 11, 2014 at 12:50:05AM +0300, Oded Gabbay wrote: > This patch adds a new interface to kfd2kgd_calls structure so that > the kfd driver could get the virtual ram size of a specific > radeon device. > = > Signed-off-by: Oded Gabbay What is vmem_size ? This need to be documented. I assume this is the number of bits the gpu can handle and i would assume that the minimum requirement is that the device have at least as many bit as the cpu ? ie on 48bits x86-64 the hardware also needs to support that. Otherwise this sounds like broken things can happen. Cheers, J=E9r=F4me > --- > drivers/gpu/drm/radeon/radeon_kfd.c | 12 ++++++++++++ > include/linux/radeon_kfd.h | 1 + > 2 files changed, 13 insertions(+) > = > diff --git a/drivers/gpu/drm/radeon/radeon_kfd.c b/drivers/gpu/drm/radeon= /radeon_kfd.c > index 7c7f808..1b859b5 100644 > --- a/drivers/gpu/drm/radeon/radeon_kfd.c > +++ b/drivers/gpu/drm/radeon/radeon_kfd.c > @@ -25,7 +25,10 @@ > #include > #include "radeon.h" > = > +static uint64_t get_vmem_size(struct kgd_dev *kgd); > + > static const struct kfd2kgd_calls kfd2kgd =3D { > + .get_vmem_size =3D get_vmem_size, > }; > = > static const struct kgd2kfd_calls *kgd2kfd; > @@ -92,3 +95,12 @@ void radeon_kfd_device_fini(struct radeon_device *rdev) > rdev->kfd =3D NULL; > } > } > + > +static uint64_t get_vmem_size(struct kgd_dev *kgd) > +{ > + struct radeon_device *rdev =3D (struct radeon_device *)kgd; > + > + BUG_ON(kgd =3D=3D NULL); > + > + return rdev->mc.real_vram_size; > +} > diff --git a/include/linux/radeon_kfd.h b/include/linux/radeon_kfd.h > index 59785e9..28cddf5 100644 > --- a/include/linux/radeon_kfd.h > +++ b/include/linux/radeon_kfd.h > @@ -57,6 +57,7 @@ struct kgd2kfd_calls { > }; > = > struct kfd2kgd_calls { > + uint64_t (*get_vmem_size)(struct kgd_dev *kgd); > }; > = > bool kgd2kfd_init(unsigned interface_version, > -- = > 1.9.1 > = From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754548AbaGKQ1z (ORCPT ); Fri, 11 Jul 2014 12:27:55 -0400 Received: from mail-qg0-f50.google.com ([209.85.192.50]:48439 "EHLO mail-qg0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750977AbaGKQ1y (ORCPT ); Fri, 11 Jul 2014 12:27:54 -0400 Date: Fri, 11 Jul 2014 12:27:49 -0400 From: Jerome Glisse To: Oded Gabbay Cc: David Airlie , Alex Deucher , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, John Bridgman , Andrew Lewycky , Joerg Roedel , Oded Gabbay , Christian =?iso-8859-1?Q?K=F6nig?= Subject: Re: [PATCH 05/83] drm/radeon: Add kfd-->kgd interface to get virtual ram size Message-ID: <20140711162748.GF1870@gmail.com> References: <1405029027-6085-1-git-send-email-oded.gabbay@amd.com> <1405029027-6085-4-git-send-email-oded.gabbay@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1405029027-6085-4-git-send-email-oded.gabbay@amd.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 11, 2014 at 12:50:05AM +0300, Oded Gabbay wrote: > This patch adds a new interface to kfd2kgd_calls structure so that > the kfd driver could get the virtual ram size of a specific > radeon device. > > Signed-off-by: Oded Gabbay What is vmem_size ? This need to be documented. I assume this is the number of bits the gpu can handle and i would assume that the minimum requirement is that the device have at least as many bit as the cpu ? ie on 48bits x86-64 the hardware also needs to support that. Otherwise this sounds like broken things can happen. Cheers, Jérôme > --- > drivers/gpu/drm/radeon/radeon_kfd.c | 12 ++++++++++++ > include/linux/radeon_kfd.h | 1 + > 2 files changed, 13 insertions(+) > > diff --git a/drivers/gpu/drm/radeon/radeon_kfd.c b/drivers/gpu/drm/radeon/radeon_kfd.c > index 7c7f808..1b859b5 100644 > --- a/drivers/gpu/drm/radeon/radeon_kfd.c > +++ b/drivers/gpu/drm/radeon/radeon_kfd.c > @@ -25,7 +25,10 @@ > #include > #include "radeon.h" > > +static uint64_t get_vmem_size(struct kgd_dev *kgd); > + > static const struct kfd2kgd_calls kfd2kgd = { > + .get_vmem_size = get_vmem_size, > }; > > static const struct kgd2kfd_calls *kgd2kfd; > @@ -92,3 +95,12 @@ void radeon_kfd_device_fini(struct radeon_device *rdev) > rdev->kfd = NULL; > } > } > + > +static uint64_t get_vmem_size(struct kgd_dev *kgd) > +{ > + struct radeon_device *rdev = (struct radeon_device *)kgd; > + > + BUG_ON(kgd == NULL); > + > + return rdev->mc.real_vram_size; > +} > diff --git a/include/linux/radeon_kfd.h b/include/linux/radeon_kfd.h > index 59785e9..28cddf5 100644 > --- a/include/linux/radeon_kfd.h > +++ b/include/linux/radeon_kfd.h > @@ -57,6 +57,7 @@ struct kgd2kfd_calls { > }; > > struct kfd2kgd_calls { > + uint64_t (*get_vmem_size)(struct kgd_dev *kgd); > }; > > bool kgd2kfd_init(unsigned interface_version, > -- > 1.9.1 >