All of lore.kernel.org
 help / color / mirror / Atom feed
From: Danilo Krummrich <dakr@kernel.org>
To: Zhi Wang <zhiw@nvidia.com>
Cc: nouveau@lists.freedesktop.org, airlied@gmail.com,
	daniel@ffwll.ch, bskeggs@nvidia.com, mtijanic@nvidia.com,
	jgg@nvidia.com, acurrid@nvidia.com, cjia@nvidia.com,
	smitra@nvidia.com, ankita@nvidia.com, aniketa@nvidia.com,
	kwankhede@nvidia.com, targupta@nvidia.com, zhiwang@kernel.org
Subject: Re: [RFC 6/8] drm/nouveau: override the WPR2 heap size when SRIOV is supported on Ada
Date: Fri, 17 Jan 2025 16:19:50 +0100	[thread overview]
Message-ID: <Z4p1FkTq4ZRj0Kaz@pollux> (raw)
In-Reply-To: <20241122125712.3653406-7-zhiw@nvidia.com>

On Fri, Nov 22, 2024 at 04:57:10AM -0800, Zhi Wang wrote:
> To support the maximum vGPUs on the device that support SRIOV, a larger
> WPR2 heap size is required. On Ada with SRIOV supported, the size should
> be set to at least 549MB. By setting the WPR2 heap size up to 549MB, the
> scrubber ucode image is required to scrub the FB memory before any other
> ucode image is executed.
> 
> Override the default WPR2 heap size on Ada when SRIOV is supported. Set
> the WPR2 heap size up to 576MB when SRIOV is supported on Ada.

Might be worth to also add a brief note about this in the code.

> 
> Cc: Milos Tijanic <mtijanic@nvidia.com>
> Signed-off-by: Zhi Wang <zhiw@nvidia.com>
> ---
>  drivers/gpu/drm/nouveau/nvkm/subdev/gsp/ad102.c | 12 +++++++++++-
>  1 file changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/ad102.c b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/ad102.c
> index 3ba67eab08d7..1e403dbd7323 100644
> --- a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/ad102.c
> +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/ad102.c
> @@ -20,6 +20,7 @@
>   * OTHER DEALINGS IN THE SOFTWARE.
>   */
>  
> +#include <core/pci.h>
>  #include <engine/sec2.h>
>  #include "priv.h"
>  
> @@ -58,9 +59,18 @@ ad102_execute_scrubber(struct nvkm_gsp *gsp)
>  static int
>  ad102_gsp_init_fw_heap(struct nvkm_gsp *gsp)
>  {
> +	struct nvkm_subdev *subdev = &gsp->subdev;
> +	struct nvkm_device *device = subdev->device;
> +	struct nvkm_device_pci *device_pci = container_of(device,
> +			typeof(*device_pci), device);
> +	int num_vfs;
>  	int ret;
>  
> -	nvkm_gsp_init_fw_heap(gsp, 0);
> +	num_vfs = pci_sriov_get_totalvfs(device_pci->pdev);
> +	if (!num_vfs)
> +		nvkm_gsp_init_fw_heap(gsp, 0);
> +	else
> +		nvkm_gsp_init_fw_heap(gsp, 576 * SZ_1M);
>  
>  	if (gsp->fb.wpr2.heap.size <= SZ_256M)
>  		return 0;
> -- 
> 2.34.1
> 

  reply	other threads:[~2025-01-17 15:19 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-22 12:57 [RFC 0/8] drm/nouveau: scrubber ucode image support for vGPU Zhi Wang
2024-11-22 12:57 ` [RFC 1/8] drm/nouveau: factor out nvkm_gsp_init_fw_heap() Zhi Wang
2025-01-17 15:13   ` Danilo Krummrich
2024-11-22 12:57 ` [RFC 2/8] drm/nouveau: introduce tu102_gsp_init_fw_heap() Zhi Wang
2024-11-22 16:26   ` Timur Tabi
2025-01-31 11:00     ` Zhi Wang
2024-11-22 12:57 ` [RFC 3/8] drm/nouveau: load scrubber ucode image when WPR2 heap size > 256MB Zhi Wang
2025-01-17 15:04   ` Danilo Krummrich
2024-11-22 12:57 ` [RFC 4/8] drm/nouveau: scrub the FB memory when scrubber firmware is loaded Zhi Wang
2025-01-09 22:58   ` Timur Tabi
2025-01-17 14:54     ` Danilo Krummrich
2025-01-17 14:57   ` Danilo Krummrich
2024-11-22 12:57 ` [RFC 5/8] drm/nouveau: support WPR2 heap size override Zhi Wang
2025-01-17 15:19   ` Danilo Krummrich
2024-11-22 12:57 ` [RFC 6/8] drm/nouveau: override the WPR2 heap size when SRIOV is supported on Ada Zhi Wang
2025-01-17 15:19   ` Danilo Krummrich [this message]
2024-11-22 12:57 ` [RFC 7/8] drm/nouveau: set max supported vGPU count when SRIOV is supported Zhi Wang
2025-01-17 15:24   ` Danilo Krummrich
2024-11-22 12:57 ` [RFC 8/8] drm/nouveau: introduce the scrubber on Ada in a kernel doc Zhi Wang
2025-01-17 15:27   ` Danilo Krummrich
2024-11-22 16:37 ` [RFC 0/8] drm/nouveau: scrubber ucode image support for vGPU Timur Tabi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Z4p1FkTq4ZRj0Kaz@pollux \
    --to=dakr@kernel.org \
    --cc=acurrid@nvidia.com \
    --cc=airlied@gmail.com \
    --cc=aniketa@nvidia.com \
    --cc=ankita@nvidia.com \
    --cc=bskeggs@nvidia.com \
    --cc=cjia@nvidia.com \
    --cc=daniel@ffwll.ch \
    --cc=jgg@nvidia.com \
    --cc=kwankhede@nvidia.com \
    --cc=mtijanic@nvidia.com \
    --cc=nouveau@lists.freedesktop.org \
    --cc=smitra@nvidia.com \
    --cc=targupta@nvidia.com \
    --cc=zhiw@nvidia.com \
    --cc=zhiwang@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.