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

Commit c89a9f5a authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* 'drm-next' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6:
  drm: fix ordering of driver unload vs agp unload.
  drm/i915: Respect the other stolen memory sizes we know of.
  drm/i915: Non-mobile parts don't have integrated TV-out.
  drm/i915: Add support for integrated HDMI on G4X hardware.
  drm/i915: Pin cursor bo and unpin old bo when setting cursor.
  drm/i915: Don't allow objects to get bound while VT switched.
parents db30c705 a75f2841
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -314,14 +314,14 @@ static void drm_cleanup(struct drm_device * dev)
		DRM_DEBUG("mtrr_del=%d\n", retval);
	}

	if (dev->driver->unload)
		dev->driver->unload(dev);

	if (drm_core_has_AGP(dev) && dev->agp) {
		drm_free(dev->agp, sizeof(*dev->agp), DRM_MEM_AGPLISTS);
		dev->agp = NULL;
	}

	if (dev->driver->unload)
		dev->driver->unload(dev);

	drm_ht_remove(&dev->map_hash);
	drm_ctxbitmap_cleanup(dev);

+1 −0
Original line number Diff line number Diff line
@@ -13,6 +13,7 @@ i915-y := i915_drv.o i915_dma.o i915_irq.o i915_mem.o \
	  intel_crt.o \
	  intel_lvds.o \
	  intel_bios.o \
	  intel_hdmi.o \
	  intel_sdvo.o \
	  intel_modes.o \
	  intel_i2c.o \
+33 −13
Original line number Diff line number Diff line
@@ -827,6 +827,7 @@ static int i915_probe_agp(struct drm_device *dev, unsigned long *aperture_size,
	struct pci_dev *bridge_dev;
	u16 tmp = 0;
	unsigned long overhead;
	unsigned long stolen;

	bridge_dev = pci_get_bus_and_slot(0, PCI_DEVFN(0,0));
	if (!bridge_dev) {
@@ -866,36 +867,55 @@ static int i915_probe_agp(struct drm_device *dev, unsigned long *aperture_size,
	else
		overhead = (*aperture_size / 1024) + 4096;

	switch (tmp & INTEL_855_GMCH_GMS_MASK) {
	switch (tmp & INTEL_GMCH_GMS_MASK) {
	case INTEL_855_GMCH_GMS_DISABLED:
		DRM_ERROR("video memory is disabled\n");
		return -1;
	case INTEL_855_GMCH_GMS_STOLEN_1M:
		break; /* 1M already */
		stolen = 1 * 1024 * 1024;
		break;
	case INTEL_855_GMCH_GMS_STOLEN_4M:
		*preallocated_size *= 4;
		stolen = 4 * 1024 * 1024;
		break;
	case INTEL_855_GMCH_GMS_STOLEN_8M:
		*preallocated_size *= 8;
		stolen = 8 * 1024 * 1024;
		break;
	case INTEL_855_GMCH_GMS_STOLEN_16M:
		*preallocated_size *= 16;
		stolen = 16 * 1024 * 1024;
		break;
	case INTEL_855_GMCH_GMS_STOLEN_32M:
		*preallocated_size *= 32;
		stolen = 32 * 1024 * 1024;
		break;
	case INTEL_915G_GMCH_GMS_STOLEN_48M:
		*preallocated_size *= 48;
		stolen = 48 * 1024 * 1024;
		break;
	case INTEL_915G_GMCH_GMS_STOLEN_64M:
		*preallocated_size *= 64;
		stolen = 64 * 1024 * 1024;
		break;
	case INTEL_GMCH_GMS_STOLEN_128M:
		stolen = 128 * 1024 * 1024;
		break;
	case INTEL_GMCH_GMS_STOLEN_256M:
		stolen = 256 * 1024 * 1024;
		break;
	case INTEL_GMCH_GMS_STOLEN_96M:
		stolen = 96 * 1024 * 1024;
		break;
	case INTEL_GMCH_GMS_STOLEN_160M:
		stolen = 160 * 1024 * 1024;
		break;
	case INTEL_GMCH_GMS_STOLEN_224M:
		stolen = 224 * 1024 * 1024;
		break;
	case INTEL_GMCH_GMS_STOLEN_352M:
		stolen = 352 * 1024 * 1024;
		break;
	case INTEL_855_GMCH_GMS_DISABLED:
		DRM_ERROR("video memory is disabled\n");
		return -1;
	default:
		DRM_ERROR("unexpected GMCH_GMS value: 0x%02x\n",
			tmp & INTEL_855_GMCH_GMS_MASK);
			tmp & INTEL_GMCH_GMS_MASK);
		return -1;
	}
	*preallocated_size -= overhead;
	*preallocated_size = stolen - overhead;

	return 0;
}
+2 −0
Original line number Diff line number Diff line
@@ -664,6 +664,7 @@ extern void intel_modeset_cleanup(struct drm_device *dev);
				 writel(upper_32_bits(val), dev_priv->regs + \
					(reg) + 4))
#endif
#define POSTING_READ(reg)	(void)I915_READ(reg)

#define I915_VERBOSE 0

@@ -760,6 +761,7 @@ extern int i915_wait_ring(struct drm_device * dev, int n, const char *caller);
			IS_I945GM(dev) || IS_I965GM(dev) || IS_GM45(dev))

#define I915_NEED_GFX_HWS(dev) (IS_G33(dev) || IS_GM45(dev) || IS_G4X(dev))
#define SUPPORTS_INTEGRATED_HDMI(dev)	(IS_G4X(dev))

#define PRIMARY_RINGBUFFER_SIZE         (128*1024)

+9 −6
Original line number Diff line number Diff line
@@ -1623,6 +1623,8 @@ i915_gem_object_bind_to_gtt(struct drm_gem_object *obj, unsigned alignment)
	struct drm_mm_node *free_space;
	int page_count, ret;

	if (dev_priv->mm.suspended)
		return -EBUSY;
	if (alignment == 0)
		alignment = PAGE_SIZE;
	if (alignment & (PAGE_SIZE - 1)) {
@@ -2641,7 +2643,7 @@ i915_gem_object_pin(struct drm_gem_object *obj, uint32_t alignment)
	if (obj_priv->gtt_space == NULL) {
		ret = i915_gem_object_bind_to_gtt(obj, alignment);
		if (ret != 0) {
			if (ret != -ERESTARTSYS)
			if (ret != -EBUSY && ret != -ERESTARTSYS)
				DRM_ERROR("Failure to bind: %d", ret);
			return ret;
		}
@@ -3219,20 +3221,21 @@ i915_gem_entervt_ioctl(struct drm_device *dev, void *data,
		dev_priv->mm.wedged = 0;
	}

	ret = i915_gem_init_ringbuffer(dev);
	if (ret != 0)
		return ret;

	dev_priv->mm.gtt_mapping = io_mapping_create_wc(dev->agp->base,
							dev->agp->agp_info.aper_size
							* 1024 * 1024);

	mutex_lock(&dev->struct_mutex);
	dev_priv->mm.suspended = 0;

	ret = i915_gem_init_ringbuffer(dev);
	if (ret != 0)
		return ret;

	BUG_ON(!list_empty(&dev_priv->mm.active_list));
	BUG_ON(!list_empty(&dev_priv->mm.flushing_list));
	BUG_ON(!list_empty(&dev_priv->mm.inactive_list));
	BUG_ON(!list_empty(&dev_priv->mm.request_list));
	dev_priv->mm.suspended = 0;
	mutex_unlock(&dev->struct_mutex);

	drm_irq_install(dev);
Loading