nouveau.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Ben Skeggs <skeggsb@gmail.com>
To: nouveau@lists.freedesktop.org
Cc: Ben Skeggs <bskeggs@redhat.com>
Subject: [Nouveau] [PATCH 04/10] drm/nouveau/fb/ga102-: construct vidmem heap via new gp102 paths
Date: Thu, 25 May 2023 10:31:00 +1000	[thread overview]
Message-ID: <20230525003106.3853741-4-skeggsb@gmail.com> (raw)
In-Reply-To: <20230525003106.3853741-1-skeggsb@gmail.com>

From: Ben Skeggs <bskeggs@redhat.com>

No need for custom implementation anymore.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
---
 drivers/gpu/drm/nouveau/nvkm/subdev/fb/Kbuild |  1 -
 .../gpu/drm/nouveau/nvkm/subdev/fb/ga102.c    |  9 ++++-
 drivers/gpu/drm/nouveau/nvkm/subdev/fb/ram.h  |  1 -
 .../gpu/drm/nouveau/nvkm/subdev/fb/ramga102.c | 40 -------------------
 4 files changed, 8 insertions(+), 43 deletions(-)
 delete mode 100644 drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramga102.c

diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/Kbuild b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/Kbuild
index 11dbfc4a381a..394c305e759a 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/Kbuild
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/Kbuild
@@ -56,7 +56,6 @@ nvkm-y += nvkm/subdev/fb/ramgm107.o
 nvkm-y += nvkm/subdev/fb/ramgm200.o
 nvkm-y += nvkm/subdev/fb/ramgp100.o
 nvkm-y += nvkm/subdev/fb/ramgp102.o
-nvkm-y += nvkm/subdev/fb/ramga102.o
 nvkm-y += nvkm/subdev/fb/sddr2.o
 nvkm-y += nvkm/subdev/fb/sddr3.o
 nvkm-y += nvkm/subdev/fb/gddr3.o
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ga102.c b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ga102.c
index dd476e079fe1..76f6877b54c6 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ga102.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ga102.c
@@ -24,6 +24,12 @@
 
 #include <engine/nvdec.h>
 
+static u64
+ga102_fb_vidmem_size(struct nvkm_fb *fb)
+{
+	return (u64)nvkm_rd32(fb->subdev.device, 0x1183a4) << 20;
+}
+
 static int
 ga102_fb_oneinit(struct nvkm_fb *fb)
 {
@@ -43,7 +49,8 @@ ga102_fb = {
 	.init_page = gv100_fb_init_page,
 	.init_unkn = gp100_fb_init_unkn,
 	.sysmem.flush_page_init = gf100_fb_sysmem_flush_page_init,
-	.ram_new = ga102_ram_new,
+	.vidmem.size = ga102_fb_vidmem_size,
+	.ram_new = gp102_ram_new,
 	.default_bigpage = 16,
 	.vpr.scrub_required = tu102_fb_vpr_scrub_required,
 	.vpr.scrub = gp102_fb_vpr_scrub,
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ram.h b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ram.h
index 33d4ab8d92e6..50f0c1914f58 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ram.h
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ram.h
@@ -71,5 +71,4 @@ int gm107_ram_new(struct nvkm_fb *, struct nvkm_ram **);
 int gm200_ram_new(struct nvkm_fb *, struct nvkm_ram **);
 int gp100_ram_new(struct nvkm_fb *, struct nvkm_ram **);
 int gp102_ram_new(struct nvkm_fb *, struct nvkm_ram **);
-int ga102_ram_new(struct nvkm_fb *, struct nvkm_ram **);
 #endif
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramga102.c b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramga102.c
deleted file mode 100644
index 298c136cefe0..000000000000
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramga102.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright 2021 Red Hat Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-#include "ram.h"
-
-#include <subdev/bios.h>
-#include <subdev/bios/init.h>
-#include <subdev/bios/rammap.h>
-
-static const struct nvkm_ram_func
-ga102_ram = {
-};
-
-int
-ga102_ram_new(struct nvkm_fb *fb, struct nvkm_ram **pram)
-{
-	struct nvkm_device *device = fb->subdev.device;
-	enum nvkm_ram_type type = nvkm_fb_bios_memtype(device->bios);
-	u32 size = nvkm_rd32(device, 0x1183a4);
-
-	return nvkm_ram_new_(&ga102_ram, fb, type, (u64)size << 20, pram);
-}
-- 
2.40.1


  parent reply	other threads:[~2023-05-25  0:31 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-25  0:30 [Nouveau] [PATCH 01/10] drm/nouveau/nvkm: fini object children in reverse order Ben Skeggs
2023-05-25  0:30 ` [Nouveau] [PATCH 02/10] drm/nouveau/nvkm: punt spurious irq messages to debug level Ben Skeggs
2023-06-13 21:26   ` Karol Herbst
2023-05-25  0:30 ` [Nouveau] [PATCH 03/10] drm/nouveau/fb/gp102-ga100: switch to simpler vram size detection method Ben Skeggs
2023-06-13 21:29   ` Karol Herbst
2023-05-25  0:31 ` Ben Skeggs [this message]
2023-05-25  0:31 ` [Nouveau] [PATCH 05/10] drm/nouveau/fifo: remove left-over references to nvkm_fifo_chan Ben Skeggs
2023-06-13 21:32   ` Karol Herbst
2023-05-25  0:31 ` [Nouveau] [PATCH 06/10] drm/nouveau/fifo: return ERR_PTR from nvkm_runl_new() Ben Skeggs
2023-06-13 21:32   ` Karol Herbst
2023-05-25  0:31 ` [Nouveau] [PATCH 07/10] drm/nouveau/fifo/ga100-: remove individual runlists rather than failing oneinit Ben Skeggs
2023-06-13 21:35   ` Karol Herbst
2023-05-25  0:31 ` [Nouveau] [PATCH 08/10] drm/nouveau/fifo/ga100-: add per-runlist nonstall intr handling Ben Skeggs
2023-06-13 21:41   ` Karol Herbst
2023-05-25  0:31 ` [Nouveau] [PATCH 09/10] drm/nouveau/nvif: fix potential double-free Ben Skeggs
2023-06-13 21:44   ` Karol Herbst
2023-05-25  0:31 ` [Nouveau] [PATCH 10/10] drm/nouveau/kms: don't call drm_dp_cec_set_edid() on TMDS Ben Skeggs
2023-06-13 21:44   ` Karol Herbst
2023-06-13 21:26 ` [Nouveau] [PATCH 01/10] drm/nouveau/nvkm: fini object children in reverse order Karol Herbst
2023-06-13 21:52 ` Lyude Paul

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=20230525003106.3853741-4-skeggsb@gmail.com \
    --to=skeggsb@gmail.com \
    --cc=bskeggs@redhat.com \
    --cc=nouveau@lists.freedesktop.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).