Commit 5609f7fe authored by Rob Clark's avatar Rob Clark Committed by Greg Kroah-Hartman

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: default avatarRob Clark <rob@ti.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a890e662
...@@ -570,6 +570,9 @@ static int dev_load(struct drm_device *dev, unsigned long flags) ...@@ -570,6 +570,9 @@ static int dev_load(struct drm_device *dev, unsigned long flags)
dev->dev_private = priv; dev->dev_private = priv;
priv->wq = alloc_workqueue("omapdrm",
WQ_UNBOUND | WQ_NON_REENTRANT, 1);
omap_gem_init(dev); omap_gem_init(dev);
ret = omap_modeset_init(dev); ret = omap_modeset_init(dev);
...@@ -598,6 +601,8 @@ static int dev_load(struct drm_device *dev, unsigned long flags) ...@@ -598,6 +601,8 @@ static int dev_load(struct drm_device *dev, unsigned long flags)
static int dev_unload(struct drm_device *dev) static int dev_unload(struct drm_device *dev)
{ {
struct omap_drm_private *priv = dev->dev_private;
DBG("unload: dev=%p", dev); DBG("unload: dev=%p", dev);
drm_vblank_cleanup(dev); drm_vblank_cleanup(dev);
...@@ -607,6 +612,9 @@ static int dev_unload(struct drm_device *dev) ...@@ -607,6 +612,9 @@ static int dev_unload(struct drm_device *dev)
omap_modeset_free(dev); omap_modeset_free(dev);
omap_gem_deinit(dev); omap_gem_deinit(dev);
flush_workqueue(priv->wq);
destroy_workqueue(priv->wq);
kfree(dev->dev_private); kfree(dev->dev_private);
dev->dev_private = NULL; dev->dev_private = NULL;
......
...@@ -51,6 +51,8 @@ struct omap_drm_private { ...@@ -51,6 +51,8 @@ struct omap_drm_private {
struct drm_fb_helper *fbdev; struct drm_fb_helper *fbdev;
struct workqueue_struct *wq;
bool has_dmm; bool has_dmm;
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment