Commit cc362050 authored by Ben Skeggs's avatar Ben Skeggs
Browse files

drm/nouveau/fifo/gk104-: support querying engines available on each runlist



Will be used to improve channel runlist selection.

Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent ddc669e2
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -83,4 +83,11 @@ struct nv_device_time_v0 {

/* Returns the number of available channels. */
#define NV_DEVICE_FIFO_CHANNELS                      NV_DEVICE_FIFO(0x00000000)

/* Returns a mask of available runlists. */
#define NV_DEVICE_FIFO_RUNLISTS                      NV_DEVICE_FIFO(0x00000001)

/* These return a mask of engines available on a particular runlist. */
#define NV_DEVICE_FIFO_RUNLIST_ENGINES(n)     ((n) + NV_DEVICE_FIFO(0x00000010))
#define NV_DEVICE_FIFO_RUNLIST_ENGINES__SIZE                                64
#endif
+5 −0
Original line number Diff line number Diff line
@@ -8,6 +8,11 @@
struct nvif_device {
	struct nvif_object object;
	struct nv_device_info_v0 info;

	struct nvif_fifo_runlist {
		u64 engines;
	} *runlist;
	int runlists;
};

int  nvif_device_init(struct nvif_object *, u32 handle, s32 oclass, void *, u32,
+18 −0
Original line number Diff line number Diff line
#ifndef __NVIF_FIFO_H__
#define __NVIF_FIFO_H__
#include <nvif/device.h>

/* Returns mask of runlists that support a NV_DEVICE_INFO_ENGINE_* type. */
u64 nvif_fifo_runlist(struct nvif_device *, u64 engine);

/* CE-supporting runlists (excluding GRCE, if others exist). */
static inline u64
nvif_fifo_runlist_ce(struct nvif_device *device)
{
	u64 runmgr = nvif_fifo_runlist(device, NV_DEVICE_INFO_ENGINE_GR);
	u64 runmce = nvif_fifo_runlist(device, NV_DEVICE_INFO_ENGINE_CE);
	if (runmce && !(runmce &= ~runmgr))
		runmce = runmgr;
	return runmce;
}
#endif
+1 −0
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@ nvif-y := nvif/object.o
nvif-y += nvif/client.o
nvif-y += nvif/device.o
nvif-y += nvif/driver.o
nvif-y += nvif/fifo.o
nvif-y += nvif/mem.o
nvif-y += nvif/mmu.o
nvif-y += nvif/notify.o
+3 −0
Original line number Diff line number Diff line
@@ -37,6 +37,8 @@ nvif_device_time(struct nvif_device *device)
void
nvif_device_fini(struct nvif_device *device)
{
	kfree(device->runlist);
	device->runlist = NULL;
	nvif_object_fini(&device->object);
}

@@ -46,6 +48,7 @@ nvif_device_init(struct nvif_object *parent, u32 handle, s32 oclass,
{
	int ret = nvif_object_init(parent, handle, oclass, data, size,
				   &device->object);
	device->runlist = NULL;
	if (ret == 0) {
		device->info.version = 0;
		ret = nvif_object_mthd(&device->object, NV_DEVICE_V0_INFO,
Loading