Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9ace404b authored by Ben Skeggs's avatar Ben Skeggs
Browse files

drm/nouveau/device: include core/device.h automatically for subdevs/engines



Pretty much every subdev/engine is going to need access to nvkm_device
shortly to touch registers and/or output messages.

The odd placement of the includes is necessary to work around some
inter-dependencies that currently exist.  This will be fixed later.

Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent 6d0d40e7
Loading
Loading
Loading
Loading
+60 −0
Original line number Diff line number Diff line
@@ -3,6 +3,66 @@
#include <core/engine.h>
#include <core/event.h>

enum nvkm_devidx {
	NVDEV_ENGINE_DEVICE,
	NVDEV_SUBDEV_VBIOS,

	/* All subdevs from DEVINIT to DEVINIT_LAST will be created before
	 * *any* of them are initialised.  This subdev category is used
	 * for any subdevs that the VBIOS init table parsing may call out
	 * to during POST.
	 */
	NVDEV_SUBDEV_DEVINIT,
	NVDEV_SUBDEV_IBUS,
	NVDEV_SUBDEV_GPIO,
	NVDEV_SUBDEV_I2C,
	NVDEV_SUBDEV_DEVINIT_LAST = NVDEV_SUBDEV_I2C,

	/* This grouping of subdevs are initialised right after they've
	 * been created, and are allowed to assume any subdevs in the
	 * list above them exist and have been initialised.
	 */
	NVDEV_SUBDEV_FUSE,
	NVDEV_SUBDEV_MXM,
	NVDEV_SUBDEV_MC,
	NVDEV_SUBDEV_BUS,
	NVDEV_SUBDEV_TIMER,
	NVDEV_SUBDEV_FB,
	NVDEV_SUBDEV_LTC,
	NVDEV_SUBDEV_INSTMEM,
	NVDEV_SUBDEV_MMU,
	NVDEV_SUBDEV_BAR,
	NVDEV_SUBDEV_PMU,
	NVDEV_SUBDEV_VOLT,
	NVDEV_SUBDEV_THERM,
	NVDEV_SUBDEV_CLK,

	NVDEV_ENGINE_FIRST,
	NVDEV_ENGINE_DMAOBJ = NVDEV_ENGINE_FIRST,
	NVDEV_ENGINE_IFB,
	NVDEV_ENGINE_FIFO,
	NVDEV_ENGINE_SW,
	NVDEV_ENGINE_GR,
	NVDEV_ENGINE_MPEG,
	NVDEV_ENGINE_ME,
	NVDEV_ENGINE_VP,
	NVDEV_ENGINE_CIPHER,
	NVDEV_ENGINE_BSP,
	NVDEV_ENGINE_MSPPP,
	NVDEV_ENGINE_CE0,
	NVDEV_ENGINE_CE1,
	NVDEV_ENGINE_CE2,
	NVDEV_ENGINE_VIC,
	NVDEV_ENGINE_MSENC,
	NVDEV_ENGINE_DISP,
	NVDEV_ENGINE_PM,
	NVDEV_ENGINE_MSVLD,
	NVDEV_ENGINE_SEC,
	NVDEV_ENGINE_MSPDEC,

	NVDEV_SUBDEV_NR,
};

struct nvkm_device {
	struct nvkm_engine engine;
	struct list_head head;
+0 −62
Original line number Diff line number Diff line
#ifndef __NVKM_DEVIDX_H__
#define __NVKM_DEVIDX_H__
enum nvkm_devidx {
	NVDEV_ENGINE_DEVICE,
	NVDEV_SUBDEV_VBIOS,

	/* All subdevs from DEVINIT to DEVINIT_LAST will be created before
	 * *any* of them are initialised.  This subdev category is used
	 * for any subdevs that the VBIOS init table parsing may call out
	 * to during POST.
	 */
	NVDEV_SUBDEV_DEVINIT,
	NVDEV_SUBDEV_IBUS,
	NVDEV_SUBDEV_GPIO,
	NVDEV_SUBDEV_I2C,
	NVDEV_SUBDEV_DEVINIT_LAST = NVDEV_SUBDEV_I2C,

	/* This grouping of subdevs are initialised right after they've
	 * been created, and are allowed to assume any subdevs in the
	 * list above them exist and have been initialised.
	 */
	NVDEV_SUBDEV_FUSE,
	NVDEV_SUBDEV_MXM,
	NVDEV_SUBDEV_MC,
	NVDEV_SUBDEV_BUS,
	NVDEV_SUBDEV_TIMER,
	NVDEV_SUBDEV_FB,
	NVDEV_SUBDEV_LTC,
	NVDEV_SUBDEV_INSTMEM,
	NVDEV_SUBDEV_MMU,
	NVDEV_SUBDEV_BAR,
	NVDEV_SUBDEV_PMU,
	NVDEV_SUBDEV_VOLT,
	NVDEV_SUBDEV_THERM,
	NVDEV_SUBDEV_CLK,

	NVDEV_ENGINE_FIRST,
	NVDEV_ENGINE_DMAOBJ = NVDEV_ENGINE_FIRST,
	NVDEV_ENGINE_IFB,
	NVDEV_ENGINE_FIFO,
	NVDEV_ENGINE_SW,
	NVDEV_ENGINE_GR,
	NVDEV_ENGINE_MPEG,
	NVDEV_ENGINE_ME,
	NVDEV_ENGINE_VP,
	NVDEV_ENGINE_CIPHER,
	NVDEV_ENGINE_BSP,
	NVDEV_ENGINE_MSPPP,
	NVDEV_ENGINE_CE0,
	NVDEV_ENGINE_CE1,
	NVDEV_ENGINE_CE2,
	NVDEV_ENGINE_VIC,
	NVDEV_ENGINE_MSENC,
	NVDEV_ENGINE_DISP,
	NVDEV_ENGINE_PM,
	NVDEV_ENGINE_MSVLD,
	NVDEV_ENGINE_SEC,
	NVDEV_ENGINE_MSPDEC,

	NVDEV_SUBDEV_NR,
};
#endif
+2 −0
Original line number Diff line number Diff line
@@ -53,4 +53,6 @@ int nvkm_engine_create_(struct nvkm_object *, struct nvkm_object *,
#define _nvkm_engine_dtor _nvkm_subdev_dtor
#define _nvkm_engine_init _nvkm_subdev_init
#define _nvkm_engine_fini _nvkm_subdev_fini

#include <core/device.h>
#endif
+2 −1
Original line number Diff line number Diff line
#ifndef __NVKM_SUBDEV_H__
#define __NVKM_SUBDEV_H__
#include <core/object.h>
#include <core/devidx.h>

#define NV_SUBDEV_(sub,var) (NV_SUBDEV_CLASS | ((var) << 8) | (sub))
#define NV_SUBDEV(name,var)  NV_SUBDEV_(NVDEV_SUBDEV_##name, (var))
@@ -119,4 +118,6 @@ nv_mask(void *obj, u32 addr, u32 mask, u32 data)
	nv_wr32(obj, addr, (temp & ~mask) | data);
	return temp;
}

#include <core/engine.h>
#endif
+1 −3
Original line number Diff line number Diff line
#ifndef __NOUVEAU_VGA_H__
#define __NOUVEAU_VGA_H__

#include <core/os.h>
#include <core/subdev.h>

/* access to various legacy io ports */
u8   nv_rdport(void *obj, int head, u16 port);
@@ -26,5 +25,4 @@ void nv_wrvgai(void *obj, int head, u16 port, u8 index, u8 value);
bool nv_lockvgac(void *obj, bool lock);
u8   nv_rdvgaowner(void *obj);
void nv_wrvgaowner(void *obj, u8);

#endif
Loading