Commit 216c3c44 authored by Ben Skeggs's avatar Ben Skeggs Committed by Danilo Krummrich

drm/nouveau/nvif: remove device rd/wr

The previous commit ensures the device is always mapped, so these
are unneeded.
Signed-off-by: default avatarBen Skeggs <bskeggs@nvidia.com>
Signed-off-by: default avatarDanilo Krummrich <dakr@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20240726043828.58966-26-bskeggs@nvidia.com
parent cced63c3
...@@ -33,11 +33,7 @@ struct nvkm_object_func { ...@@ -33,11 +33,7 @@ struct nvkm_object_func {
int (*map)(struct nvkm_object *, void *argv, u32 argc, int (*map)(struct nvkm_object *, void *argv, u32 argc,
enum nvkm_object_map *, u64 *addr, u64 *size); enum nvkm_object_map *, u64 *addr, u64 *size);
int (*unmap)(struct nvkm_object *); int (*unmap)(struct nvkm_object *);
int (*rd08)(struct nvkm_object *, u64 addr, u8 *data);
int (*rd16)(struct nvkm_object *, u64 addr, u16 *data);
int (*rd32)(struct nvkm_object *, u64 addr, u32 *data); int (*rd32)(struct nvkm_object *, u64 addr, u32 *data);
int (*wr08)(struct nvkm_object *, u64 addr, u8 data);
int (*wr16)(struct nvkm_object *, u64 addr, u16 data);
int (*wr32)(struct nvkm_object *, u64 addr, u32 data); int (*wr32)(struct nvkm_object *, u64 addr, u32 data);
int (*bind)(struct nvkm_object *, struct nvkm_gpuobj *, int align, int (*bind)(struct nvkm_object *, struct nvkm_gpuobj *, int align,
struct nvkm_gpuobj **); struct nvkm_gpuobj **);
...@@ -61,11 +57,7 @@ int nvkm_object_ntfy(struct nvkm_object *, u32 mthd, struct nvkm_event **); ...@@ -61,11 +57,7 @@ int nvkm_object_ntfy(struct nvkm_object *, u32 mthd, struct nvkm_event **);
int nvkm_object_map(struct nvkm_object *, void *argv, u32 argc, int nvkm_object_map(struct nvkm_object *, void *argv, u32 argc,
enum nvkm_object_map *, u64 *addr, u64 *size); enum nvkm_object_map *, u64 *addr, u64 *size);
int nvkm_object_unmap(struct nvkm_object *); int nvkm_object_unmap(struct nvkm_object *);
int nvkm_object_rd08(struct nvkm_object *, u64 addr, u8 *data);
int nvkm_object_rd16(struct nvkm_object *, u64 addr, u16 *data);
int nvkm_object_rd32(struct nvkm_object *, u64 addr, u32 *data); int nvkm_object_rd32(struct nvkm_object *, u64 addr, u32 *data);
int nvkm_object_wr08(struct nvkm_object *, u64 addr, u8 data);
int nvkm_object_wr16(struct nvkm_object *, u64 addr, u16 data);
int nvkm_object_wr32(struct nvkm_object *, u64 addr, u32 data); int nvkm_object_wr32(struct nvkm_object *, u64 addr, u32 data);
int nvkm_object_bind(struct nvkm_object *, struct nvkm_gpuobj *, int align, int nvkm_object_bind(struct nvkm_object *, struct nvkm_gpuobj *, int align,
struct nvkm_gpuobj **); struct nvkm_gpuobj **);
......
...@@ -206,14 +206,6 @@ nvkm_ioctl_rd(struct nvkm_client *client, ...@@ -206,14 +206,6 @@ nvkm_ioctl_rd(struct nvkm_client *client,
nvif_ioctl(object, "rd vers %d size %d addr %016llx\n", nvif_ioctl(object, "rd vers %d size %d addr %016llx\n",
args->v0.version, args->v0.size, args->v0.addr); args->v0.version, args->v0.size, args->v0.addr);
switch (args->v0.size) { switch (args->v0.size) {
case 1:
ret = nvkm_object_rd08(object, args->v0.addr, &v.b08);
args->v0.data = v.b08;
break;
case 2:
ret = nvkm_object_rd16(object, args->v0.addr, &v.b16);
args->v0.data = v.b16;
break;
case 4: case 4:
ret = nvkm_object_rd32(object, args->v0.addr, &v.b32); ret = nvkm_object_rd32(object, args->v0.addr, &v.b32);
args->v0.data = v.b32; args->v0.data = v.b32;
...@@ -246,8 +238,6 @@ nvkm_ioctl_wr(struct nvkm_client *client, ...@@ -246,8 +238,6 @@ nvkm_ioctl_wr(struct nvkm_client *client,
return ret; return ret;
switch (args->v0.size) { switch (args->v0.size) {
case 1: return nvkm_object_wr08(object, args->v0.addr, args->v0.data);
case 2: return nvkm_object_wr16(object, args->v0.addr, args->v0.data);
case 4: return nvkm_object_wr32(object, args->v0.addr, args->v0.data); case 4: return nvkm_object_wr32(object, args->v0.addr, args->v0.data);
default: default:
break; break;
......
...@@ -132,22 +132,6 @@ nvkm_object_unmap(struct nvkm_object *object) ...@@ -132,22 +132,6 @@ nvkm_object_unmap(struct nvkm_object *object)
return -ENODEV; return -ENODEV;
} }
int
nvkm_object_rd08(struct nvkm_object *object, u64 addr, u8 *data)
{
if (likely(object->func->rd08))
return object->func->rd08(object, addr, data);
return -ENODEV;
}
int
nvkm_object_rd16(struct nvkm_object *object, u64 addr, u16 *data)
{
if (likely(object->func->rd16))
return object->func->rd16(object, addr, data);
return -ENODEV;
}
int int
nvkm_object_rd32(struct nvkm_object *object, u64 addr, u32 *data) nvkm_object_rd32(struct nvkm_object *object, u64 addr, u32 *data)
{ {
...@@ -156,22 +140,6 @@ nvkm_object_rd32(struct nvkm_object *object, u64 addr, u32 *data) ...@@ -156,22 +140,6 @@ nvkm_object_rd32(struct nvkm_object *object, u64 addr, u32 *data)
return -ENODEV; return -ENODEV;
} }
int
nvkm_object_wr08(struct nvkm_object *object, u64 addr, u8 data)
{
if (likely(object->func->wr08))
return object->func->wr08(object, addr, data);
return -ENODEV;
}
int
nvkm_object_wr16(struct nvkm_object *object, u64 addr, u16 data)
{
if (likely(object->func->wr16))
return object->func->wr16(object, addr, data);
return -ENODEV;
}
int int
nvkm_object_wr32(struct nvkm_object *object, u64 addr, u32 data) nvkm_object_wr32(struct nvkm_object *object, u64 addr, u32 data)
{ {
......
...@@ -55,36 +55,12 @@ nvkm_oproxy_unmap(struct nvkm_object *object) ...@@ -55,36 +55,12 @@ nvkm_oproxy_unmap(struct nvkm_object *object)
return nvkm_object_unmap(oproxy->object); return nvkm_object_unmap(oproxy->object);
} }
static int
nvkm_oproxy_rd08(struct nvkm_object *object, u64 addr, u8 *data)
{
return nvkm_object_rd08(nvkm_oproxy(object)->object, addr, data);
}
static int
nvkm_oproxy_rd16(struct nvkm_object *object, u64 addr, u16 *data)
{
return nvkm_object_rd16(nvkm_oproxy(object)->object, addr, data);
}
static int static int
nvkm_oproxy_rd32(struct nvkm_object *object, u64 addr, u32 *data) nvkm_oproxy_rd32(struct nvkm_object *object, u64 addr, u32 *data)
{ {
return nvkm_object_rd32(nvkm_oproxy(object)->object, addr, data); return nvkm_object_rd32(nvkm_oproxy(object)->object, addr, data);
} }
static int
nvkm_oproxy_wr08(struct nvkm_object *object, u64 addr, u8 data)
{
return nvkm_object_wr08(nvkm_oproxy(object)->object, addr, data);
}
static int
nvkm_oproxy_wr16(struct nvkm_object *object, u64 addr, u16 data)
{
return nvkm_object_wr16(nvkm_oproxy(object)->object, addr, data);
}
static int static int
nvkm_oproxy_wr32(struct nvkm_object *object, u64 addr, u32 data) nvkm_oproxy_wr32(struct nvkm_object *object, u64 addr, u32 data)
{ {
...@@ -197,11 +173,7 @@ nvkm_oproxy_func = { ...@@ -197,11 +173,7 @@ nvkm_oproxy_func = {
.ntfy = nvkm_oproxy_ntfy, .ntfy = nvkm_oproxy_ntfy,
.map = nvkm_oproxy_map, .map = nvkm_oproxy_map,
.unmap = nvkm_oproxy_unmap, .unmap = nvkm_oproxy_unmap,
.rd08 = nvkm_oproxy_rd08,
.rd16 = nvkm_oproxy_rd16,
.rd32 = nvkm_oproxy_rd32, .rd32 = nvkm_oproxy_rd32,
.wr08 = nvkm_oproxy_wr08,
.wr16 = nvkm_oproxy_wr16,
.wr32 = nvkm_oproxy_wr32, .wr32 = nvkm_oproxy_wr32,
.bind = nvkm_oproxy_bind, .bind = nvkm_oproxy_bind,
.sclass = nvkm_oproxy_sclass, .sclass = nvkm_oproxy_sclass,
......
...@@ -202,54 +202,6 @@ nvkm_udevice_mthd(struct nvkm_object *object, u32 mthd, void *data, u32 size) ...@@ -202,54 +202,6 @@ nvkm_udevice_mthd(struct nvkm_object *object, u32 mthd, void *data, u32 size)
return -EINVAL; return -EINVAL;
} }
static int
nvkm_udevice_rd08(struct nvkm_object *object, u64 addr, u8 *data)
{
struct nvkm_udevice *udev = nvkm_udevice(object);
*data = nvkm_rd08(udev->device, addr);
return 0;
}
static int
nvkm_udevice_rd16(struct nvkm_object *object, u64 addr, u16 *data)
{
struct nvkm_udevice *udev = nvkm_udevice(object);
*data = nvkm_rd16(udev->device, addr);
return 0;
}
static int
nvkm_udevice_rd32(struct nvkm_object *object, u64 addr, u32 *data)
{
struct nvkm_udevice *udev = nvkm_udevice(object);
*data = nvkm_rd32(udev->device, addr);
return 0;
}
static int
nvkm_udevice_wr08(struct nvkm_object *object, u64 addr, u8 data)
{
struct nvkm_udevice *udev = nvkm_udevice(object);
nvkm_wr08(udev->device, addr, data);
return 0;
}
static int
nvkm_udevice_wr16(struct nvkm_object *object, u64 addr, u16 data)
{
struct nvkm_udevice *udev = nvkm_udevice(object);
nvkm_wr16(udev->device, addr, data);
return 0;
}
static int
nvkm_udevice_wr32(struct nvkm_object *object, u64 addr, u32 data)
{
struct nvkm_udevice *udev = nvkm_udevice(object);
nvkm_wr32(udev->device, addr, data);
return 0;
}
static int static int
nvkm_udevice_map(struct nvkm_object *object, void *argv, u32 argc, nvkm_udevice_map(struct nvkm_object *object, void *argv, u32 argc,
enum nvkm_object_map *type, u64 *addr, u64 *size) enum nvkm_object_map *type, u64 *addr, u64 *size)
...@@ -362,12 +314,6 @@ nvkm_udevice = { ...@@ -362,12 +314,6 @@ nvkm_udevice = {
.fini = nvkm_udevice_fini, .fini = nvkm_udevice_fini,
.mthd = nvkm_udevice_mthd, .mthd = nvkm_udevice_mthd,
.map = nvkm_udevice_map, .map = nvkm_udevice_map,
.rd08 = nvkm_udevice_rd08,
.rd16 = nvkm_udevice_rd16,
.rd32 = nvkm_udevice_rd32,
.wr08 = nvkm_udevice_wr08,
.wr16 = nvkm_udevice_wr16,
.wr32 = nvkm_udevice_wr32,
.sclass = nvkm_udevice_child_get, .sclass = nvkm_udevice_child_get,
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment