summaryrefslogtreecommitdiff
path: root/drivers/staging/omapdrm
diff options
context:
space:
mode:
authorRob Clark <rob@ti.com>2012-03-05 10:48:32 -0600
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-03-07 13:38:06 -0800
commit5609f7fe306508d77e0dcf1de2c9a957b6af1e06 (patch)
tree740802402c81e6f7a9ab51a87f8fa4238a78c5d6 /drivers/staging/omapdrm
parenta890e6623ae024d28f855d672e72649fa2cb511e (diff)
staging: drm/omap: add a workqueue
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 <rob@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/omapdrm')
-rw-r--r--drivers/staging/omapdrm/omap_drv.c8
-rw-r--r--drivers/staging/omapdrm/omap_drv.h2
2 files changed, 10 insertions, 0 deletions
diff --git a/drivers/staging/omapdrm/omap_drv.c b/drivers/staging/omapdrm/omap_drv.c
index 3bbea9aac404..7417e1f35aa9 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 d924c95c769e..a84547c2464b 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;
};