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

Commit ed48c06c authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux

Pull nouveau fixes from Dave Airlie:
 "Just a nouveau set, since we have a couple of reports on lkml and
  dri-devel of regressions that this should fix I sent it along on its
  own."

* 'drm-fixes' of git://people.freedesktop.org/~airlied/linux:
  drm/nouveau: headless mode by default if pci class != vga display
  drm/nouveau: resurrect headless mode since rework
  drm/nv50/fb: prevent oops on chipsets without compression tags
  drm/nouveau: allow creation of zero-sized mm
  drm/nouveau/i2c: fix typo when checking nvio i2c port validity
  drm/nouveau: silence modesetting spam on pre-gf8 chipsets
parents 296bac30 4936b172
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -218,13 +218,16 @@ nouveau_mm_init(struct nouveau_mm *mm, u32 offset, u32 length, u32 block)
	node = kzalloc(sizeof(*node), GFP_KERNEL);
	if (!node)
		return -ENOMEM;

	if (length) {
		node->offset  = roundup(offset, mm->block_size);
	node->length = rounddown(offset + length, mm->block_size) - node->offset;
		node->length  = rounddown(offset + length, mm->block_size);
		node->length -= node->offset;
	}

	list_add_tail(&node->nl_entry, &mm->nodes);
	list_add_tail(&node->fl_entry, &mm->free);
	mm->heap_nodes++;
	mm->heap_size += length;
	return 0;
}

+0 −1
Original line number Diff line number Diff line
@@ -19,7 +19,6 @@ struct nouveau_mm {

	u32 block_size;
	int heap_nodes;
	u32 heap_size;
};

int  nouveau_mm_init(struct nouveau_mm *, u32 offset, u32 length, u32 block);
+4 −6
Original line number Diff line number Diff line
@@ -219,13 +219,11 @@ nv50_fb_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
			     ((priv->base.ram.size & 0x000000ff) << 32);

	tags = nv_rd32(priv, 0x100320);
	if (tags) {
	ret = nouveau_mm_init(&priv->base.tags, 0, tags, 1);
	if (ret)
		return ret;

	nv_debug(priv, "%d compression tags\n", tags);
	}

	size = (priv->base.ram.size >> 12) - rsvd_head - rsvd_tail;
	switch (device->chipset) {
+1 −1
Original line number Diff line number Diff line
@@ -292,7 +292,7 @@ nouveau_i2c_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
		case DCB_I2C_NVIO_BIT:
			port->drive = info.drive & 0x0f;
			if (device->card_type < NV_D0) {
				if (info.drive >= ARRAY_SIZE(nv50_i2c_port))
				if (port->drive >= ARRAY_SIZE(nv50_i2c_port))
					break;
				port->drive = nv50_i2c_port[port->drive];
				port->sense = port->drive;
+21 −15
Original line number Diff line number Diff line
@@ -290,6 +290,7 @@ nouveau_display_create(struct drm_device *dev)
	struct nouveau_drm *drm = nouveau_drm(dev);
	struct nouveau_disp *pdisp = nouveau_disp(drm->device);
	struct nouveau_display *disp;
	u32 pclass = dev->pdev->class >> 8;
	int ret, gen;

	disp = drm->display = kzalloc(sizeof(*disp), GFP_KERNEL);
@@ -360,6 +361,8 @@ nouveau_display_create(struct drm_device *dev)
	drm_kms_helper_poll_init(dev);
	drm_kms_helper_poll_disable(dev);

	if (nouveau_modeset == 1 ||
	    (nouveau_modeset < 0 && pclass == PCI_CLASS_DISPLAY_VGA)) {
		if (nv_device(drm->device)->card_type < NV_50)
			ret = nv04_display_create(dev);
		else
@@ -377,6 +380,8 @@ nouveau_display_create(struct drm_device *dev)
		}

		nouveau_backlight_init(dev);
	}

	return 0;

vblank_err:
@@ -395,6 +400,7 @@ nouveau_display_destroy(struct drm_device *dev)
	nouveau_backlight_exit(dev);
	drm_vblank_cleanup(dev);

	if (disp->dtor)
		disp->dtor(dev);

	drm_kms_helper_poll_fini(dev);
Loading