dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/18] drm_bus cleanups and other cruft removal
@ 2014-04-11 21:35 Daniel Vetter
  2014-04-11 21:35 ` [PATCH 01/18] drm/omap: fix up pdev_remove Daniel Vetter
                   ` (19 more replies)
  0 siblings, 20 replies; 54+ messages in thread
From: Daniel Vetter @ 2014-04-11 21:35 UTC (permalink / raw)
  To: DRI Development; +Cc: Daniel Vetter

Hi all,

I've chatted a bit with Thierry about how we could allow drivers to not even
required a drm_bus any more. Which is relevant when e.g. due to the new
master/component no platform device is conveniently around.

So I've brushed off my old series to remove some drm_bus functions and other
cruft and rebased it onto latest drm-next.

It gets rid of everything but drm_bus->set_busid, but Thierry has a good plan to
make that one optional too - it's only really needed for backwards compat with
some old libdrm versions on pci drm drivers.

Comments and review highly welcome.

Presuming no one screams I plan to send a pull request with these patches to
Dave fairly early for 3.16 so that Thierry can base his tegra rework on top of
it.

Cheers, Daniel

Daniel Vetter (18):
  drm/omap: fix up pdev_remove
  drm/irq: simplify irq checks in drm_wait_vblank
  drm/pci: fold in irq_by_busid support
  drm/irq: drm_control is a legacy ioctl, so pci devices only
  drm/irq: remove cargo-culted locking from irq_install/unistall
  drm: remove drm_dev_to_irq from drivers
  drm: kill drm_bus->bus_type
  drm: Rip out totally bogus vga_switcheroo->can_switch locking
  drm: rename dev->count_lock to dev->buf_lock
  drm/irq: track the irq installed in drm_irq_install in dev->irq
  drm/irq: Look up the pci irq directly in the drm_control ioctl
  drm: pass the irq explicitly to drm_irq_install
  drm: remove bus->get_irq implementations
  drm: inline drm_pci_set_unique
  drm: rip out dev->devname
  drm: remove drm_bus->get_name
  drm: Remove dev->kdriver
  drm/<drivers>: don't set driver->dev_priv_size to 0

 Documentation/DocBook/drm.tmpl           |  10 +--
 drivers/gpu/drm/armada/armada_drv.c      |   2 +-
 drivers/gpu/drm/ast/ast_drv.c            |   1 -
 drivers/gpu/drm/drm_bufs.c               |  32 +++++-----
 drivers/gpu/drm/drm_info.c               |   6 +-
 drivers/gpu/drm/drm_ioctl.c              |  13 ++--
 drivers/gpu/drm/drm_irq.c                | 106 +++++++++++--------------------
 drivers/gpu/drm/drm_pci.c                |  94 +++++++++++++--------------
 drivers/gpu/drm/drm_platform.c           |  25 --------
 drivers/gpu/drm/drm_stub.c               |   7 +-
 drivers/gpu/drm/drm_usb.c                |  14 ----
 drivers/gpu/drm/gma500/psb_drv.c         |   2 +-
 drivers/gpu/drm/i915/i915_dma.c          |   9 ++-
 drivers/gpu/drm/i915/i915_drv.c          |   9 ++-
 drivers/gpu/drm/i915/i915_gem.c          |   7 +-
 drivers/gpu/drm/mga/mga_state.c          |   2 +-
 drivers/gpu/drm/msm/msm_drv.c            |   2 +-
 drivers/gpu/drm/nouveau/nouveau_vga.c    |   7 +-
 drivers/gpu/drm/omapdrm/omap_drv.c       |   2 +
 drivers/gpu/drm/qxl/qxl_drv.c            |   1 -
 drivers/gpu/drm/qxl/qxl_irq.c            |   2 +-
 drivers/gpu/drm/r128/r128_state.c        |   2 +-
 drivers/gpu/drm/radeon/radeon_device.c   |   7 +-
 drivers/gpu/drm/radeon/radeon_drv.c      |   1 -
 drivers/gpu/drm/radeon/radeon_irq_kms.c  |   2 +-
 drivers/gpu/drm/radeon/radeon_state.c    |   2 +-
 drivers/gpu/drm/shmobile/shmob_drm_drv.c |   2 +-
 drivers/gpu/drm/tegra/bus.c              |  11 ----
 drivers/gpu/drm/tilcdc/tilcdc_drv.c      |   2 +-
 drivers/gpu/drm/vmwgfx/vmwgfx_drv.c      |   2 +-
 include/drm/drmP.h                       |  33 +++-------
 31 files changed, 159 insertions(+), 258 deletions(-)

-- 
1.8.5.2

^ permalink raw reply	[flat|nested] 54+ messages in thread
* [PATCH 37/50] drm/irq: track the irq installed in drm_irq_install in dev->irq
@ 2013-12-11 10:34 Daniel Vetter
  2013-12-16 10:29 ` [PATCH] " Daniel Vetter
  0 siblings, 1 reply; 54+ messages in thread
From: Daniel Vetter @ 2013-12-11 10:34 UTC (permalink / raw)
  To: DRI Development; +Cc: Daniel Vetter

To get rid of the dev->bus->get_irq callback we need to pass in the
desired irq explicitly into drm_irq_install. To avoid having to do the
same for drm_irq_unistall just track it internally. That leaves
drivers with less room to botch things up.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/drm_irq.c | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c
index 38c0bab3296e..1348e041c2af 100644
--- a/drivers/gpu/drm/drm_irq.c
+++ b/drivers/gpu/drm/drm_irq.c
@@ -249,14 +249,16 @@ static inline int drm_dev_to_irq(struct drm_device *dev)
  */
 int drm_irq_install(struct drm_device *dev)
 {
-	int ret;
+	int ret, irq;
 	unsigned long sh_flags = 0;
 	char *irqname;
 
+	irq = drm_dev_to_irq(dev);
+
 	if (!drm_core_check_feature(dev, DRIVER_HAVE_IRQ))
 		return -EINVAL;
 
-	if (drm_dev_to_irq(dev) == 0)
+	if (irq == 0)
 		return -EINVAL;
 
 	/* Driver must have been initialized */
@@ -267,7 +269,7 @@ int drm_irq_install(struct drm_device *dev)
 		return -EBUSY;
 	dev->irq_enabled = true;
 
-	DRM_DEBUG("irq=%d\n", drm_dev_to_irq(dev));
+	DRM_DEBUG("irq=%d\n", dev->irq);
 
 	/* Before installing handler */
 	if (dev->driver->irq_preinstall)
@@ -282,7 +284,7 @@ int drm_irq_install(struct drm_device *dev)
 	else
 		irqname = dev->driver->name;
 
-	ret = request_irq(drm_dev_to_irq(dev), dev->driver->irq_handler,
+	ret = request_irq(dev->irq, dev->driver->irq_handler,
 			  sh_flags, irqname, dev);
 
 	if (ret < 0) {
@@ -301,7 +303,9 @@ int drm_irq_install(struct drm_device *dev)
 		dev->irq_enabled = false;
 		if (!drm_core_check_feature(dev, DRIVER_MODESET))
 			vga_client_register(dev->pdev, NULL, NULL, NULL);
-		free_irq(drm_dev_to_irq(dev), dev);
+		free_irq(dev->irq, dev);
+	} else {
+		dev->irq = irq;
 	}
 
 	return ret;
@@ -344,7 +348,7 @@ int drm_irq_uninstall(struct drm_device *dev)
 	if (!irq_enabled)
 		return -EINVAL;
 
-	DRM_DEBUG("irq=%d\n", drm_dev_to_irq(dev));
+	DRM_DEBUG("irq=%d\n", dev->irq);
 
 	if (!drm_core_check_feature(dev, DRIVER_MODESET))
 		vga_client_register(dev->pdev, NULL, NULL, NULL);
@@ -352,7 +356,7 @@ int drm_irq_uninstall(struct drm_device *dev)
 	if (dev->driver->irq_uninstall)
 		dev->driver->irq_uninstall(dev);
 
-	free_irq(drm_dev_to_irq(dev), dev);
+	free_irq(dev->irq, dev);
 
 	return 0;
 }
-- 
1.8.4.3

^ permalink raw reply related	[flat|nested] 54+ messages in thread

end of thread, other threads:[~2014-04-23  8:32 UTC | newest]

Thread overview: 54+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-11 21:35 [PATCH 00/18] drm_bus cleanups and other cruft removal Daniel Vetter
2014-04-11 21:35 ` [PATCH 01/18] drm/omap: fix up pdev_remove Daniel Vetter
2014-04-12 15:26   ` Rob Clark
2014-04-14  6:26   ` Tomi Valkeinen
2014-04-16  8:15     ` Daniel Vetter
2014-04-16  8:27       ` Tomi Valkeinen
2014-04-16 17:05         ` Daniel Vetter
2014-04-11 21:35 ` [PATCH 02/18] drm/irq: simplify irq checks in drm_wait_vblank Daniel Vetter
2014-04-14 20:55   ` Thierry Reding
2014-04-11 21:36 ` [PATCH 03/18] drm/pci: fold in irq_by_busid support Daniel Vetter
2014-04-17 14:33   ` Thierry Reding
2014-04-11 21:36 ` [PATCH 04/18] drm/irq: drm_control is a legacy ioctl, so pci devices only Daniel Vetter
2014-04-17 14:38   ` Thierry Reding
2014-04-11 21:36 ` [PATCH 05/18] drm/irq: remove cargo-culted locking from irq_install/unistall Daniel Vetter
2014-04-17 14:43   ` Thierry Reding
2014-04-17 14:44     ` Thierry Reding
2014-04-11 21:36 ` [PATCH 06/18] drm: remove drm_dev_to_irq from drivers Daniel Vetter
2014-04-17 14:47   ` Thierry Reding
2014-04-11 21:36 ` [PATCH 07/18] drm: kill drm_bus->bus_type Daniel Vetter
2014-04-17 14:50   ` Thierry Reding
2014-04-11 21:36 ` [PATCH 08/18] drm: Rip out totally bogus vga_switcheroo->can_switch locking Daniel Vetter
2014-04-17 14:56   ` Thierry Reding
2014-04-22 20:45     ` [PATCH] " Daniel Vetter
2014-04-23  7:28       ` Thierry Reding
2014-04-11 21:36 ` [PATCH 09/18] drm: rename dev->count_lock to dev->buf_lock Daniel Vetter
2014-04-17 14:57   ` Thierry Reding
2014-04-11 21:36 ` [PATCH 10/18] drm/irq: track the irq installed in drm_irq_install in dev->irq Daniel Vetter
2014-04-16 21:57   ` Laurent Pinchart
2014-04-16 22:02   ` Laurent Pinchart
2014-04-22  9:46     ` Daniel Vetter
2014-04-22 10:49       ` Thierry Reding
2014-04-17 15:03   ` Thierry Reding
2014-04-22 20:44   ` [PATCH] " Daniel Vetter
2014-04-23  7:27     ` Thierry Reding
2014-04-23  8:31       ` Daniel Vetter
2014-04-11 21:36 ` [PATCH 11/18] drm/irq: Look up the pci irq directly in the drm_control ioctl Daniel Vetter
2014-04-11 21:36 ` [PATCH 12/18] drm: pass the irq explicitly to drm_irq_install Daniel Vetter
2014-04-17 15:06   ` Thierry Reding
2014-04-11 21:36 ` [PATCH 13/18] drm: remove bus->get_irq implementations Daniel Vetter
2014-04-17 15:07   ` Thierry Reding
2014-04-11 21:36 ` [PATCH 14/18] drm: inline drm_pci_set_unique Daniel Vetter
2014-04-17 15:10   ` Thierry Reding
2014-04-11 21:36 ` [PATCH 15/18] drm: rip out dev->devname Daniel Vetter
2014-04-17 15:11   ` Thierry Reding
2014-04-11 21:36 ` [PATCH 16/18] drm: remove drm_bus->get_name Daniel Vetter
2014-04-17 15:12   ` Thierry Reding
2014-04-11 21:36 ` [PATCH 17/18] drm: Remove dev->kdriver Daniel Vetter
2014-04-17 15:13   ` Thierry Reding
2014-04-11 21:36 ` [PATCH 18/18] drm/<drivers>: don't set driver->dev_priv_size to 0 Daniel Vetter
2014-04-17 15:14   ` Thierry Reding
2014-04-16 22:10 ` [PATCH 00/18] drm_bus cleanups and other cruft removal Laurent Pinchart
2014-04-22  7:30 ` David Herrmann
  -- strict thread matches above, loose matches on Subject: below --
2013-12-11 10:34 [PATCH 37/50] drm/irq: track the irq installed in drm_irq_install in dev->irq Daniel Vetter
2013-12-16 10:29 ` [PATCH] " Daniel Vetter
2013-12-16 11:17   ` Thierry Reding

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).