From patchwork Mon Mar 5 16:48:32 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Clark X-Patchwork-Id: 7091 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id CE23F23DC3 for ; Mon, 5 Mar 2012 16:49:06 +0000 (UTC) Received: from mail-iy0-f180.google.com (mail-iy0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id 95520A18184 for ; Mon, 5 Mar 2012 16:49:06 +0000 (UTC) Received: by mail-iy0-f180.google.com with SMTP id e36so7746420iag.11 for ; Mon, 05 Mar 2012 08:49:06 -0800 (PST) MIME-Version: 1.0 Received: by 10.50.197.135 with SMTP id iu7mr6191676igc.50.1330966146395; Mon, 05 Mar 2012 08:49:06 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.53.18 with SMTP id k18csp30876ibg; Mon, 5 Mar 2012 08:49:06 -0800 (PST) Received: by 10.236.80.4 with SMTP id j4mr22013674yhe.120.1330966145449; Mon, 05 Mar 2012 08:49:05 -0800 (PST) Received: from mail-yx0-f178.google.com (mail-yx0-f178.google.com [209.85.213.178]) by mx.google.com with ESMTPS id y4si7427722ani.127.2012.03.05.08.49.05 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 05 Mar 2012 08:49:05 -0800 (PST) Received-SPF: pass (google.com: domain of robdclark@gmail.com designates 209.85.213.178 as permitted sender) client-ip=209.85.213.178; Authentication-Results: mx.google.com; spf=pass (google.com: domain of robdclark@gmail.com designates 209.85.213.178 as permitted sender) smtp.mail=robdclark@gmail.com; dkim=pass header.i=@gmail.com Received: by yenm14 with SMTP id m14so2037708yen.37 for ; Mon, 05 Mar 2012 08:49:05 -0800 (PST) Received-SPF: pass (google.com: domain of robdclark@gmail.com designates 10.236.155.6 as permitted sender) client-ip=10.236.155.6; Received: from mr.google.com ([10.236.155.6]) by 10.236.155.6 with SMTP id i6mr27451335yhk.87.1330966145194 (num_hops = 1); Mon, 05 Mar 2012 08:49:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=dJ8n2WQqHbsVLrTZMASDQVsQSvir2Mw5X+VUJIrwVf0=; b=SnR9fZTpU7G0Yi+ccTGmnjW15YxW3HvNsVXHr8WN3cm9et3U5qSTNjR0MxFzaUFquh v07zRN5wgcft6VOd8v3Bh0DSdHlyhCFqPuBx2twjExsh5Fqa1WB4bLEh5kUpjituQ/d3 O8aMqbXUqXt096BjfU6xcBiE/j+QjTGIw7cqGogHm/GJz/Nsb2OVQwMW4J1IcgMjmubj GrJxja8LZNXxjko8hjqOAvGPxw0p9kLTqQiPPyEnj40rUjXWpTsbKolsCTTVH77q6LKC i0m3WHpzCbHbUKoxDveebKHEatbT3QonPR+6NNfp7+7SZ0JmWSVxR3QRYD/7gUiqayr9 kKUQ== Received: by 10.236.155.6 with SMTP id i6mr21649182yhk.87.1330966145078; Mon, 05 Mar 2012 08:49:05 -0800 (PST) Received: from localhost (dragon.ti.com. [192.94.94.33]) by mx.google.com with ESMTPS id n24sm41395311yhj.13.2012.03.05.08.49.03 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 05 Mar 2012 08:49:04 -0800 (PST) Sender: Rob Clark From: Rob Clark To: dri-devel@lists.freedesktop.org, linux-omap@vger.kernel.org Cc: patches@linaro.org, Greg KH , Tomi Valkeinen , Andy Gross , Rob Clark Subject: [PATCH 02/10] staging: drm/omap: add a workqueue Date: Mon, 5 Mar 2012 10:48:32 -0600 Message-Id: <1330966120-28582-3-git-send-email-rob.clark@linaro.org> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1330966120-28582-1-git-send-email-rob.clark@linaro.org> References: <1330966120-28582-1-git-send-email-rob.clark@linaro.org> X-Gm-Message-State: ALoCoQnwaAZckUJ5rE5SW1WQyBEnRyutFJ5gJL2h8YVFByU45cnPXqKFBSOOGmR0nMEajPij0znV From: Rob Clark Add a workqueue for omapdrm driver, which is needed for at least a couple things currently: (1) moving omap_gem_roll() to a non-atomic context, (2) synchronizing page flips w/ DSS scanout related irq's (in particular not unmapping previous buffer until DSS finishes scanout). Signed-off-by: Rob Clark --- drivers/staging/omapdrm/omap_drv.c | 8 ++++++++ drivers/staging/omapdrm/omap_drv.h | 2 ++ 2 files changed, 10 insertions(+), 0 deletions(-) diff --git a/drivers/staging/omapdrm/omap_drv.c b/drivers/staging/omapdrm/omap_drv.c index 3bbea9a..7417e1f 100644 --- a/drivers/staging/omapdrm/omap_drv.c +++ b/drivers/staging/omapdrm/omap_drv.c @@ -570,6 +570,9 @@ static int dev_load(struct drm_device *dev, unsigned long flags) dev->dev_private = priv; + priv->wq = alloc_workqueue("omapdrm", + WQ_UNBOUND | WQ_NON_REENTRANT, 1); + omap_gem_init(dev); ret = omap_modeset_init(dev); @@ -598,6 +601,8 @@ static int dev_load(struct drm_device *dev, unsigned long flags) static int dev_unload(struct drm_device *dev) { + struct omap_drm_private *priv = dev->dev_private; + DBG("unload: dev=%p", dev); drm_vblank_cleanup(dev); @@ -607,6 +612,9 @@ static int dev_unload(struct drm_device *dev) omap_modeset_free(dev); omap_gem_deinit(dev); + flush_workqueue(priv->wq); + destroy_workqueue(priv->wq); + kfree(dev->dev_private); dev->dev_private = NULL; diff --git a/drivers/staging/omapdrm/omap_drv.h b/drivers/staging/omapdrm/omap_drv.h index d924c95..a84547c 100644 --- a/drivers/staging/omapdrm/omap_drv.h +++ b/drivers/staging/omapdrm/omap_drv.h @@ -51,6 +51,8 @@ struct omap_drm_private { struct drm_fb_helper *fbdev; + struct workqueue_struct *wq; + bool has_dmm; };