From patchwork Thu Sep 6 00:42:05 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuansheng Liu X-Patchwork-Id: 1412141 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id 9CD443FC71 for ; Thu, 6 Sep 2012 06:35:56 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6CE349EC0F for ; Wed, 5 Sep 2012 23:35:56 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mga03.intel.com (mga03.intel.com [143.182.124.21]) by gabe.freedesktop.org (Postfix) with ESMTP id CE8D29E961 for ; Wed, 5 Sep 2012 17:42:09 -0700 (PDT) Received: from azsmga002.ch.intel.com ([10.2.17.35]) by azsmga101.ch.intel.com with ESMTP; 05 Sep 2012 17:42:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.80,377,1344236400"; d="scan'208";a="141980632" Received: from fmsmsx106.amr.corp.intel.com ([10.19.9.37]) by AZSMGA002.ch.intel.com with ESMTP; 05 Sep 2012 17:42:08 -0700 Received: from fmsmsx152.amr.corp.intel.com (10.19.17.221) by FMSMSX106.amr.corp.intel.com (10.19.9.37) with Microsoft SMTP Server (TLS) id 14.1.355.2; Wed, 5 Sep 2012 17:42:07 -0700 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by fmsmsx152.amr.corp.intel.com (10.19.17.221) with Microsoft SMTP Server (TLS) id 14.1.355.2; Wed, 5 Sep 2012 17:42:07 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.239]) by SHSMSX102.ccr.corp.intel.com ([169.254.2.92]) with mapi id 14.01.0355.002; Thu, 6 Sep 2012 08:42:05 +0800 From: "Liu, Chuansheng" To: Alan Cox Subject: RE: [Patch 0/1]drm_irq: Introducing the irq_thread support Thread-Topic: [Patch 0/1]drm_irq: Introducing the irq_thread support Thread-Index: AQHNi2RAGw34DfcXvEyjDrzHnr2E5pd8ebww Date: Thu, 6 Sep 2012 00:42:05 +0000 Message-ID: <27240C0AC20F114CBF8149A2696CBE4A177FB6@SHSMSX101.ccr.corp.intel.com> References: <27240C0AC20F114CBF8149A2696CBE4A177306@SHSMSX101.ccr.corp.intel.com> <20120905134932.00707b98@pyramind.ukuu.org.uk> In-Reply-To: <20120905134932.00707b98@pyramind.ukuu.org.uk> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 05 Sep 2012 23:28:15 -0700 Cc: "alexander.deucher@amd.com" , "airlied@redhat.com" , "'linux-kernel@vger.kernel.org' \(linux-kernel@vger.kernel.org\)" , "dri-devel@lists.freedesktop.org" , "Shi, Yang A" X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org > This possibly ought to be submitted in parallel with the code that uses it so that > the whole proposal can be evaluated as one thing ? > > Alan Patch is here, thanks. 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 irq_handler_t; 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 Nacked-by: Daniel Vetter --- 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; else 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) { mutex_lock(&dev->struct_mutex); 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 #define DRIVER_BUS_PLATFORM 0x2 @@ -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);