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

Commit 776d1e38 authored by Dave Airlie's avatar Dave Airlie
Browse files

Merge branch 'drm-nouveau-fixes' of...

Merge branch 'drm-nouveau-fixes' of git://anongit.freedesktop.org/git/nouveau/linux-2.6 into drm-fixes

Some more misc fallout from nouveau rework.

* 'drm-nouveau-fixes' of git://anongit.freedesktop.org/git/nouveau/linux-2.6:
  drm/nouveau/bios: fix DCB v1.5 parsing
  drm/nouveau: add missing pll_calc calls
  drm/nouveau: fix crash with noaccel=1
  drm/nv40: allocate ctxprog with kmalloc
  drm/nvc0/disp: fix thinko in vblank regression fix..
parents 6f755116 3bb076af
Loading
Loading
Loading
Loading
+12 −7
Original line number Diff line number Diff line
@@ -49,13 +49,7 @@ nv50_disp_intr_vblank(struct nv50_disp_priv *priv, int crtc)
		if (chan->vblank.crtc != crtc)
			continue;

		if (nv_device(priv)->chipset == 0x50) {
			nv_wr32(priv, 0x001704, chan->vblank.channel);
			nv_wr32(priv, 0x001710, 0x80000000 | chan->vblank.ctxdma);
			bar->flush(bar);
			nv_wr32(priv, 0x001570, chan->vblank.offset);
			nv_wr32(priv, 0x001574, chan->vblank.value);
		} else {
		if (nv_device(priv)->chipset >= 0xc0) {
			nv_wr32(priv, 0x001718, 0x80000000 | chan->vblank.channel);
			bar->flush(bar);
			nv_wr32(priv, 0x06000c,
@@ -63,6 +57,17 @@ nv50_disp_intr_vblank(struct nv50_disp_priv *priv, int crtc)
			nv_wr32(priv, 0x060010,
				lower_32_bits(chan->vblank.offset));
			nv_wr32(priv, 0x060014, chan->vblank.value);
		} else {
			nv_wr32(priv, 0x001704, chan->vblank.channel);
			nv_wr32(priv, 0x001710, 0x80000000 | chan->vblank.ctxdma);
			bar->flush(bar);
			if (nv_device(priv)->chipset == 0x50) {
				nv_wr32(priv, 0x001570, chan->vblank.offset);
				nv_wr32(priv, 0x001574, chan->vblank.value);
			} else {
				nv_wr32(priv, 0x060010, chan->vblank.offset);
				nv_wr32(priv, 0x060014, chan->vblank.value);
			}
		}

		list_del(&chan->vblank.head);
+9 −3
Original line number Diff line number Diff line
@@ -669,21 +669,27 @@ nv40_grctx_fill(struct nouveau_device *device, struct nouveau_gpuobj *mem)
			   });
}

void
int
nv40_grctx_init(struct nouveau_device *device, u32 *size)
{
	u32 ctxprog[256], i;
	u32 *ctxprog = kmalloc(256 * 4, GFP_KERNEL), i;
	struct nouveau_grctx ctx = {
		.device = device,
		.mode = NOUVEAU_GRCTX_PROG,
		.data = ctxprog,
		.ctxprog_max = ARRAY_SIZE(ctxprog)
		.ctxprog_max = 256,
	};

	if (!ctxprog)
		return -ENOMEM;

	nv40_grctx_generate(&ctx);

	nv_wr32(device, 0x400324, 0);
	for (i = 0; i < ctx.ctxprog_len; i++)
		nv_wr32(device, 0x400328, ctxprog[i]);
	*size = ctx.ctxvals_pos * 4;

	kfree(ctxprog);
	return 0;
}
+3 −1
Original line number Diff line number Diff line
@@ -346,7 +346,9 @@ nv40_graph_init(struct nouveau_object *object)
		return ret;

	/* generate and upload context program */
	nv40_grctx_init(nv_device(priv), &priv->size);
	ret = nv40_grctx_init(nv_device(priv), &priv->size);
	if (ret)
		return ret;

	/* No context present currently */
	nv_wr32(priv, NV40_PGRAPH_CTXCTL_CUR, 0x00000000);
+1 −1
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@ nv44_graph_class(void *priv)
	return !(0x0baf & (1 << (device->chipset & 0x0f)));
}

void nv40_grctx_init(struct nouveau_device *, u32 *size);
int  nv40_grctx_init(struct nouveau_device *, u32 *size);
void nv40_grctx_fill(struct nouveau_device *, struct nouveau_gpuobj *);

#endif
+9 −5
Original line number Diff line number Diff line
@@ -175,14 +175,18 @@ nv_mo32(void *obj, u32 addr, u32 mask, u32 data)
	return temp;
}

static inline bool
nv_strncmp(void *obj, u32 addr, u32 len, const char *str)
static inline int
nv_memcmp(void *obj, u32 addr, const char *str, u32 len)
{
	unsigned char c1, c2;

	while (len--) {
		if (nv_ro08(obj, addr++) != *(str++))
			return false;
		c1 = nv_ro08(obj, addr++);
		c2 = *(str++);
		if (c1 != c2)
			return c1 - c2;
	}
	return true;
	return 0;
}

#endif
Loading