[PATCH 023/156] drm/nouveau/nvkm: move nouveau_nvif.c to nvkm/core/driver.c
Ben Skeggs
bskeggs at nvidia.com
Tue Apr 16 23:37:49 UTC 2024
- move to a more appropriate place before making changes
Signed-off-by: Ben Skeggs <bskeggs at nvidia.com>
---
drivers/gpu/drm/nouveau/Kbuild | 1 -
drivers/gpu/drm/nouveau/nvkm/core/Kbuild | 1 +
.../{nouveau_nvif.c => nvkm/core/driver.c} | 36 +++++++++----------
3 files changed, 18 insertions(+), 20 deletions(-)
rename drivers/gpu/drm/nouveau/{nouveau_nvif.c => nvkm/core/driver.c} (75%)
diff --git a/drivers/gpu/drm/nouveau/Kbuild b/drivers/gpu/drm/nouveau/Kbuild
index c3223ec97aff..f99b7b227947 100644
--- a/drivers/gpu/drm/nouveau/Kbuild
+++ b/drivers/gpu/drm/nouveau/Kbuild
@@ -25,7 +25,6 @@ nouveau-y += nouveau_drm.o
nouveau-y += nouveau_hwmon.o
nouveau-$(CONFIG_COMPAT) += nouveau_ioc32.o
nouveau-$(CONFIG_LEDS_CLASS) += nouveau_led.o
-nouveau-y += nouveau_nvif.o
nouveau-$(CONFIG_NOUVEAU_PLATFORM_DRIVER) += nouveau_platform.o
nouveau-y += nouveau_vga.o
diff --git a/drivers/gpu/drm/nouveau/nvkm/core/Kbuild b/drivers/gpu/drm/nouveau/nvkm/core/Kbuild
index e40712023c73..7d111a5481d3 100644
--- a/drivers/gpu/drm/nouveau/nvkm/core/Kbuild
+++ b/drivers/gpu/drm/nouveau/nvkm/core/Kbuild
@@ -1,5 +1,6 @@
# SPDX-License-Identifier: MIT
nvkm-y := nvkm/core/client.o
+nvkm-y += nvkm/core/driver.o
nvkm-y += nvkm/core/engine.o
nvkm-y += nvkm/core/enum.o
nvkm-y += nvkm/core/event.o
diff --git a/drivers/gpu/drm/nouveau/nouveau_nvif.c b/drivers/gpu/drm/nouveau/nvkm/core/driver.c
similarity index 75%
rename from drivers/gpu/drm/nouveau/nouveau_nvif.c
rename to drivers/gpu/drm/nouveau/nvkm/core/driver.c
index 9a7e3f64b79f..3494002b40cd 100644
--- a/drivers/gpu/drm/nouveau/nouveau_nvif.c
+++ b/drivers/gpu/drm/nouveau/nvkm/core/driver.c
@@ -27,49 +27,48 @@
******************************************************************************/
#include <core/client.h>
+#include <core/event.h>
#include <core/ioctl.h>
-#include <nvif/client.h>
#include <nvif/driver.h>
#include <nvif/event.h>
-#include <nvif/ioctl.h>
-
-#include "nouveau_drv.h"
static void
-nvkm_client_unmap(void *priv, void __iomem *ptr, u32 size)
+nvkm_driver_unmap(void *priv, void __iomem *ptr, u32 size)
{
iounmap(ptr);
}
static void __iomem *
-nvkm_client_map(void *priv, u64 handle, u32 size)
+nvkm_driver_map(void *priv, u64 handle, u32 size)
{
return ioremap(handle, size);
}
static int
-nvkm_client_ioctl(void *priv, void *data, u32 size, void **hack)
+nvkm_driver_ioctl(void *priv, void *data, u32 size, void **hack)
{
return nvkm_ioctl(priv, data, size, hack);
}
static int
-nvkm_client_resume(void *priv)
+nvkm_driver_resume(void *priv)
{
struct nvkm_client *client = priv;
+
return nvkm_object_init(&client->object);
}
static int
-nvkm_client_suspend(void *priv)
+nvkm_driver_suspend(void *priv)
{
struct nvkm_client *client = priv;
+
return nvkm_object_fini(&client->object, true);
}
static int
-nvkm_client_event(u64 token, void *repv, u32 repc)
+nvkm_driver_event(u64 token, void *repv, u32 repc)
{
struct nvif_object *object = (void *)(unsigned long)token;
struct nvif_event *event = container_of(object, typeof(*event), object);
@@ -81,21 +80,20 @@ nvkm_client_event(u64 token, void *repv, u32 repc)
}
static int
-nvkm_client_driver_init(const char *name, u64 device, const char *cfg,
- const char *dbg, void **ppriv)
+nvkm_driver_init(const char *name, u64 device, const char *cfg, const char *dbg, void **ppriv)
{
- return nvkm_client_new(name, device, cfg, dbg, nvkm_client_event,
+ return nvkm_client_new(name, device, cfg, dbg, nvkm_driver_event,
(struct nvkm_client **)ppriv);
}
const struct nvif_driver
nvif_driver_nvkm = {
.name = "nvkm",
- .init = nvkm_client_driver_init,
- .suspend = nvkm_client_suspend,
- .resume = nvkm_client_resume,
- .ioctl = nvkm_client_ioctl,
- .map = nvkm_client_map,
- .unmap = nvkm_client_unmap,
+ .init = nvkm_driver_init,
+ .suspend = nvkm_driver_suspend,
+ .resume = nvkm_driver_resume,
+ .ioctl = nvkm_driver_ioctl,
+ .map = nvkm_driver_map,
+ .unmap = nvkm_driver_unmap,
.keep = false,
};
--
2.41.0
More information about the Nouveau
mailing list