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

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

drm/nouveau: remove remnants of nouveau_pgraph_engine



Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent 92abe749
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -406,7 +406,7 @@ nouveau_ioctl_fifo_alloc(struct drm_device *dev, void *data,
	struct nouveau_channel *chan;
	int ret;

	if (dev_priv->engine.graph.accel_blocked)
	if (!dev_priv->eng[NVOBJ_ENGINE_GR])
		return -ENODEV;

	if (init->fb_ctxdma_handle == ~0 || init->tt_ctxdma_handle == ~0)
+1 −1
Original line number Diff line number Diff line
@@ -276,7 +276,7 @@ nouveau_crtc_page_flip(struct drm_crtc *crtc, struct drm_framebuffer *fb,
	struct nouveau_fence *fence;
	int ret;

	if (dev_priv->engine.graph.accel_blocked)
	if (!dev_priv->channel)
		return -ENODEV;

	s = kzalloc(sizeof(*s), GFP_KERNEL);
+0 −1
Original line number Diff line number Diff line
@@ -310,7 +310,6 @@ nouveau_pci_resume(struct pci_dev *pdev)
		if (dev_priv->eng[i])
			dev_priv->eng[i]->init(dev, i);
	}
	engine->graph.init(dev);
	engine->fifo.init(dev);

	nouveau_irq_postinstall(dev);
+1 −31
Original line number Diff line number Diff line
@@ -241,10 +241,7 @@ struct nouveau_channel {
	struct nouveau_gpuobj *cache;
	void *fifo_priv;

	/* PGRAPH context */
	/* XXX may be merge 2 pointers as private data ??? */
	struct nouveau_gpuobj *ramin_grctx;
	void *pgraph_ctx;
	/* Execution engine contexts */
	void *engctx[NVOBJ_ENGINE_NR];

	/* NV50 VM */
@@ -372,30 +369,6 @@ struct nouveau_fifo_engine {
	void (*tlb_flush)(struct drm_device *dev);
};

struct nouveau_pgraph_engine {
	bool accel_blocked;
	bool registered;
	int grctx_size;
	void *priv;

	/* NV2x/NV3x context table (0x400780) */
	struct nouveau_gpuobj *ctx_table;

	int  (*init)(struct drm_device *);
	void (*takedown)(struct drm_device *);

	void (*fifo_access)(struct drm_device *, bool);

	struct nouveau_channel *(*channel)(struct drm_device *);
	int  (*create_context)(struct nouveau_channel *);
	void (*destroy_context)(struct nouveau_channel *);
	int  (*load_context)(struct nouveau_channel *);
	int  (*unload_context)(struct drm_device *);
	int  (*object_new)(struct nouveau_channel *chan, u32 handle, u16 class);
	void (*tlb_flush)(struct drm_device *dev);

};

struct nouveau_display_engine {
	void *priv;
	int (*early_init)(struct drm_device *);
@@ -522,7 +495,6 @@ struct nouveau_engine {
	struct nouveau_mc_engine      mc;
	struct nouveau_timer_engine   timer;
	struct nouveau_fb_engine      fb;
	struct nouveau_pgraph_engine  graph;
	struct nouveau_fifo_engine    fifo;
	struct nouveau_display_engine display;
	struct nouveau_gpio_engine    gpio;
@@ -1168,8 +1140,6 @@ extern struct nouveau_enum nv50_data_error_names[];

/* nvc0_graph.c */
extern int  nvc0_graph_create(struct drm_device *);
extern void nvc0_graph_fifo_access(struct drm_device *, bool);
extern struct nouveau_channel *nvc0_graph_channel(struct drm_device *);

/* nv84_crypt.c */
extern int  nv84_crypt_create(struct drm_device *);
+11 −27
Original line number Diff line number Diff line
@@ -620,7 +620,6 @@ int
nouveau_gpuobj_gr_new(struct nouveau_channel *chan, u32 handle, int class)
{
	struct drm_nouveau_private *dev_priv = chan->dev->dev_private;
	struct nouveau_pgraph_engine *pgraph = &dev_priv->engine.graph;
	struct drm_device *dev = chan->dev;
	struct nouveau_gpuobj_class *oc;
	int ret;
@@ -628,37 +627,25 @@ nouveau_gpuobj_gr_new(struct nouveau_channel *chan, u32 handle, int class)
	NV_DEBUG(dev, "ch%d class=0x%04x\n", chan->id, class);

	list_for_each_entry(oc, &dev_priv->classes, head) {
		if (oc->id == class)
			goto found;
	}
		struct nouveau_exec_engine *eng = dev_priv->eng[oc->engine];

	NV_ERROR(dev, "illegal object class: 0x%x\n", class);
	return -EINVAL;
		if (oc->id != class)
			continue;

found:
	if (!dev_priv->eng[oc->engine]) {
		switch (oc->engine) {
		case NVOBJ_ENGINE_SW:
		if (oc->engine == NVOBJ_ENGINE_SW)
			return nouveau_gpuobj_sw_new(chan, handle, class);
		case NVOBJ_ENGINE_GR:
			if ((dev_priv->card_type >= NV_20 && !chan->ramin_grctx) ||
			    (dev_priv->card_type  < NV_20 && !chan->pgraph_ctx)) {
				ret = pgraph->create_context(chan);
				if (ret)
					return ret;
			}

			return pgraph->object_new(chan, handle, class);
		}
	}

		if (!chan->engctx[oc->engine]) {
		ret = dev_priv->eng[oc->engine]->context_new(chan, oc->engine);
			ret = eng->context_new(chan, oc->engine);
			if (ret)
				return ret;
		}

	return dev_priv->eng[oc->engine]->object_new(chan, oc->engine, handle, class);
		return eng->object_new(chan, oc->engine, handle, class);
	}

	NV_ERROR(dev, "illegal object class: 0x%x\n", class);
	return -EINVAL;
}

static int
@@ -676,9 +663,6 @@ nouveau_gpuobj_channel_init_pramin(struct nouveau_channel *chan)
	size = 0x2000;
	base = 0;

	/* PGRAPH context */
	size += dev_priv->engine.graph.grctx_size;

	if (dev_priv->card_type == NV_50) {
		/* Various fixed table thingos */
		size += 0x1400; /* mostly unknown stuff */
Loading