archive mirror
 help / color / mirror / Atom feed
From: "Liu, Chuansheng" <>
To: "'' (" 
Cc: "" <>,
	"" <>,
	"Shi, Yang A" <>
Subject: [Patch 1/1]drm_irq: Introducing the irq_thread support
Date: Wed, 5 Sep 2012 01:55:59 +0000	[thread overview]
Message-ID: <> (raw)

From: liu chuansheng <>
Subject: [PATCH] drm_irq: Introducing the irq_thread support

For some GPUs, the irq handler need >1ms to handle the irq action.
And it will delay the whole system irq handler.

This patch is adding the irq thread support, it will make the drm_irq
interface more flexible.

The changes include:
1/ Change the request_irq to request_thread_irq, and add new callback
2/ Normally we need IRQF_ONESHOT flag support for irq thread, so add
   this option in drm_irq;

Cc: Shi Yang <>
Signed-off-by: liu chuansheng <>
 drivers/gpu/drm/drm_irq.c |    8 ++++++--
 include/drm/drmP.h        |    2 ++
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c
index 03f16f3..bc105fe 100644
--- a/drivers/gpu/drm/drm_irq.c
+++ b/drivers/gpu/drm/drm_irq.c
@@ -345,13 +345,17 @@ int drm_irq_install(struct drm_device *dev)
        if (drm_core_check_feature(dev, DRIVER_IRQ_SHARED))
                sh_flags = IRQF_SHARED;
+       if (drm_core_check_feature(dev, DRIVER_IRQ_ONESHOT))
+               sh_flags |= IRQF_ONESHOT;
        if (dev->devname)
                irqname = dev->devname;
                irqname = dev->driver->name;
-       ret = request_irq(drm_dev_to_irq(dev), dev->driver->irq_handler,
-                         sh_flags, irqname, dev);
+       ret = request_threaded_irq(drm_dev_to_irq(dev),
+               dev->driver->irq_handler, dev->driver->irq_handler_t,
+               sh_flags, irqname, dev);
        if (ret < 0) {
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index d6b67bb..b28be4b 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -152,6 +152,7 @@ int drm_err(const char *func, const char *format, ...);
 #define DRIVER_GEM         0x1000
 #define DRIVER_MODESET     0x2000
 #define DRIVER_PRIME       0x4000
+#define DRIVER_IRQ_ONESHOT 0x8000
 #define DRIVER_BUS_PCI 0x1
@@ -872,6 +873,7 @@ struct drm_driver {
        /* these have to be filled in */
        irqreturn_t(*irq_handler) (DRM_IRQ_ARGS);
+       irqreturn_t(*irq_handler_t) (DRM_IRQ_ARGS);
        void (*irq_preinstall) (struct drm_device *dev);
        int (*irq_postinstall) (struct drm_device *dev);
        void (*irq_uninstall) (struct drm_device *dev);

                 reply	other threads:[~2012-09-05  1:56 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).