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

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

drm/nouveau: fix non-vram notifier blocks



Due to a thinko, these were previously forced to VRAM even if we allocated
them in GART.

This commit fixes that bug, but keeps the previous behaviour of using VRAM
by default until it's been tested properly across more chipsets.

Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent 16226536
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -56,7 +56,7 @@ int nouveau_vram_pushbuf;
module_param_named(vram_pushbuf, nouveau_vram_pushbuf, int, 0400);
module_param_named(vram_pushbuf, nouveau_vram_pushbuf, int, 0400);


MODULE_PARM_DESC(vram_notify, "Force DMA notifiers to be in VRAM");
MODULE_PARM_DESC(vram_notify, "Force DMA notifiers to be in VRAM");
int nouveau_vram_notify;
int nouveau_vram_notify = 1;
module_param_named(vram_notify, nouveau_vram_notify, int, 0400);
module_param_named(vram_notify, nouveau_vram_notify, int, 0400);


MODULE_PARM_DESC(duallink, "Allow dual-link TMDS (>=GeForce 8)");
MODULE_PARM_DESC(duallink, "Allow dual-link TMDS (>=GeForce 8)");
+10 −3
Original line number Original line Diff line number Diff line
@@ -34,15 +34,20 @@ nouveau_notifier_init_channel(struct nouveau_channel *chan)
{
{
	struct drm_device *dev = chan->dev;
	struct drm_device *dev = chan->dev;
	struct nouveau_bo *ntfy = NULL;
	struct nouveau_bo *ntfy = NULL;
	uint32_t flags;
	int ret;
	int ret;


	ret = nouveau_gem_new(dev, NULL, PAGE_SIZE, 0, nouveau_vram_notify ?
	if (nouveau_vram_notify)
			      TTM_PL_FLAG_VRAM : TTM_PL_FLAG_TT,
		flags = TTM_PL_FLAG_VRAM;
	else
		flags = TTM_PL_FLAG_TT;

	ret = nouveau_gem_new(dev, NULL, PAGE_SIZE, 0, flags,
			      0, 0x0000, false, true, &ntfy);
			      0, 0x0000, false, true, &ntfy);
	if (ret)
	if (ret)
		return ret;
		return ret;


	ret = nouveau_bo_pin(ntfy, TTM_PL_FLAG_VRAM);
	ret = nouveau_bo_pin(ntfy, flags);
	if (ret)
	if (ret)
		goto out_err;
		goto out_err;


@@ -128,6 +133,8 @@ nouveau_notifier_alloc(struct nouveau_channel *chan, uint32_t handle,
			target = NV_DMA_TARGET_PCI;
			target = NV_DMA_TARGET_PCI;
		} else {
		} else {
			target = NV_DMA_TARGET_AGP;
			target = NV_DMA_TARGET_AGP;
			if (dev_priv->card_type >= NV_50)
				offset += dev_priv->vm_gart_base;
		}
		}
	} else {
	} else {
		NV_ERROR(dev, "Bad DMA target, mem_type %d!\n",
		NV_ERROR(dev, "Bad DMA target, mem_type %d!\n",