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

Commit 444c9a08 authored by Dave Airlie's avatar Dave Airlie
Browse files

Merge branch 'drm-init-cleanup' of git://people.freedesktop.org/~danvet/drm into drm-next

Next pull request, this time more of the drm de-midlayering work. The big
thing is that his patch series here removes everything from drm_bus except
the set_busid callback. Thierry has a few more patches on top of this to
make that one optional to.

With that we can ditch all the non-pci drm_bus implementations, which
Thierry has already done for the fake tegra host1x drm_bus.

Reviewed by Thierry, Laurent and David and now also survived some testing
on my intel boxes to make sure the irq fumble is fixed correctly ;-) The
last minute rebase was just to add the r-b tags from Thierry for the 2
patches I've redone.

* 'drm-init-cleanup' of git://people.freedesktop.org/~danvet/drm:
  drm/<drivers>: don't set driver->dev_priv_size to 0
  drm: Remove dev->kdriver
  drm: remove drm_bus->get_name
  drm: rip out dev->devname
  drm: inline drm_pci_set_unique
  drm: remove bus->get_irq implementations
  drm: pass the irq explicitly to drm_irq_install
  drm/irq: Look up the pci irq directly in the drm_control ioctl
  drm/irq: track the irq installed in drm_irq_install in dev->irq
  drm: rename dev->count_lock to dev->buf_lock
  drm: Rip out totally bogus vga_switcheroo->can_switch locking
  drm: kill drm_bus->bus_type
  drm: remove drm_dev_to_irq from drivers
  drm/irq: remove cargo-culted locking from irq_install/uninstall
  drm/irq: drm_control is a legacy ioctl, so pci devices only
  drm/pci: fold in irq_by_busid support
  drm/irq: simplify irq checks in drm_wait_vblank
parents 7e9ab408 3c841395
Loading
Loading
Loading
Loading
+1 −9
Original line number Diff line number Diff line
@@ -341,14 +341,6 @@ char *date;</synopsis>
        </para>
        <sect4>
          <title>Managed IRQ Registration</title>
          <para>
            Both the <function>drm_irq_install</function> and
	    <function>drm_irq_uninstall</function> functions get the device IRQ by
	    calling <function>drm_dev_to_irq</function>. This inline function will
	    call a bus-specific operation to retrieve the IRQ number. For platform
	    devices, <function>platform_get_irq</function>(..., 0) is used to
	    retrieve the IRQ number.
          </para>
          <para>
            <function>drm_irq_install</function> starts by calling the
            <methodname>irq_preinstall</methodname> driver operation. The operation
@@ -356,7 +348,7 @@ char *date;</synopsis>
            clearing all pending interrupt flags or disabling the interrupt.
          </para>
          <para>
            The IRQ will then be requested by a call to
            The passed-in IRQ will then be requested by a call to
            <function>request_irq</function>. If the DRIVER_IRQ_SHARED driver
            feature flag is set, a shared (IRQF_SHARED) IRQ handler will be
            requested.
+1 −1
Original line number Diff line number Diff line
@@ -173,7 +173,7 @@ static int armada_drm_load(struct drm_device *dev, unsigned long flags)
	if (ret)
		goto err_kms;

	ret = drm_irq_install(dev);
	ret = drm_irq_install(dev, platform_get_irq(dev->platformdev, 0));
	if (ret)
		goto err_kms;

+0 −1
Original line number Diff line number Diff line
@@ -198,7 +198,6 @@ static const struct file_operations ast_fops = {

static struct drm_driver driver = {
	.driver_features = DRIVER_MODESET | DRIVER_GEM,
	.dev_priv_size = 0,

	.load = ast_driver_load,
	.unload = ast_driver_unload,
+16 −16
Original line number Diff line number Diff line
@@ -656,13 +656,13 @@ int drm_addbufs_agp(struct drm_device * dev, struct drm_buf_desc * request)
		DRM_DEBUG("zone invalid\n");
		return -EINVAL;
	}
	spin_lock(&dev->count_lock);
	spin_lock(&dev->buf_lock);
	if (dev->buf_use) {
		spin_unlock(&dev->count_lock);
		spin_unlock(&dev->buf_lock);
		return -EBUSY;
	}
	atomic_inc(&dev->buf_alloc);
	spin_unlock(&dev->count_lock);
	spin_unlock(&dev->buf_lock);

	mutex_lock(&dev->struct_mutex);
	entry = &dma->bufs[order];
@@ -805,13 +805,13 @@ int drm_addbufs_pci(struct drm_device * dev, struct drm_buf_desc * request)
	page_order = order - PAGE_SHIFT > 0 ? order - PAGE_SHIFT : 0;
	total = PAGE_SIZE << page_order;

	spin_lock(&dev->count_lock);
	spin_lock(&dev->buf_lock);
	if (dev->buf_use) {
		spin_unlock(&dev->count_lock);
		spin_unlock(&dev->buf_lock);
		return -EBUSY;
	}
	atomic_inc(&dev->buf_alloc);
	spin_unlock(&dev->count_lock);
	spin_unlock(&dev->buf_lock);

	mutex_lock(&dev->struct_mutex);
	entry = &dma->bufs[order];
@@ -1015,13 +1015,13 @@ static int drm_addbufs_sg(struct drm_device * dev, struct drm_buf_desc * request
	if (order < DRM_MIN_ORDER || order > DRM_MAX_ORDER)
		return -EINVAL;

	spin_lock(&dev->count_lock);
	spin_lock(&dev->buf_lock);
	if (dev->buf_use) {
		spin_unlock(&dev->count_lock);
		spin_unlock(&dev->buf_lock);
		return -EBUSY;
	}
	atomic_inc(&dev->buf_alloc);
	spin_unlock(&dev->count_lock);
	spin_unlock(&dev->buf_lock);

	mutex_lock(&dev->struct_mutex);
	entry = &dma->bufs[order];
@@ -1175,7 +1175,7 @@ int drm_addbufs(struct drm_device *dev, void *data,
 * \param arg pointer to a drm_buf_info structure.
 * \return zero on success or a negative number on failure.
 *
 * Increments drm_device::buf_use while holding the drm_device::count_lock
 * Increments drm_device::buf_use while holding the drm_device::buf_lock
 * lock, preventing of allocating more buffers after this call. Information
 * about each requested buffer is then copied into user space.
 */
@@ -1196,13 +1196,13 @@ int drm_infobufs(struct drm_device *dev, void *data,
	if (!dma)
		return -EINVAL;

	spin_lock(&dev->count_lock);
	spin_lock(&dev->buf_lock);
	if (atomic_read(&dev->buf_alloc)) {
		spin_unlock(&dev->count_lock);
		spin_unlock(&dev->buf_lock);
		return -EBUSY;
	}
	++dev->buf_use;		/* Can't allocate more after this call */
	spin_unlock(&dev->count_lock);
	spin_unlock(&dev->buf_lock);

	for (i = 0, count = 0; i < DRM_MAX_ORDER + 1; i++) {
		if (dma->bufs[i].buf_count)
@@ -1381,13 +1381,13 @@ int drm_mapbufs(struct drm_device *dev, void *data,
	if (!dma)
		return -EINVAL;

	spin_lock(&dev->count_lock);
	spin_lock(&dev->buf_lock);
	if (atomic_read(&dev->buf_alloc)) {
		spin_unlock(&dev->count_lock);
		spin_unlock(&dev->buf_lock);
		return -EBUSY;
	}
	dev->buf_use++;		/* Can't allocate more after this call */
	spin_unlock(&dev->count_lock);
	spin_unlock(&dev->buf_lock);

	if (request->count >= dma->buf_count) {
		if ((dev->agp && (dma->flags & _DRM_DMA_USE_AGP))
+2 −4
Original line number Diff line number Diff line
@@ -47,18 +47,16 @@ int drm_name_info(struct seq_file *m, void *data)
	struct drm_minor *minor = node->minor;
	struct drm_device *dev = minor->dev;
	struct drm_master *master = minor->master;
	const char *bus_name;
	if (!master)
		return 0;

	bus_name = dev->driver->bus->get_name(dev);
	if (master->unique) {
		seq_printf(m, "%s %s %s\n",
			   bus_name,
			   dev->driver->name,
			   dev_name(dev->dev), master->unique);
	} else {
		seq_printf(m, "%s %s\n",
			   bus_name, dev_name(dev->dev));
			   dev->driver->name, dev_name(dev->dev));
	}
	return 0;
}
Loading