summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/gma500/accel_2d.c
diff options
context:
space:
mode:
authorAlan Cox2011-11-29 23:27:10 +0100
committerDave Airlie2011-12-06 10:55:38 +0100
commit9242fe23d2ebab9c61dbc50d65f30cfa20a856ae (patch)
treee41e980dc788a75488e1fbfdadef47e250b0d902 /drivers/gpu/drm/gma500/accel_2d.c
parentgma500: Fix backlight crash (diff)
downloadkernel-qcow2-linux-9242fe23d2ebab9c61dbc50d65f30cfa20a856ae.tar.gz
kernel-qcow2-linux-9242fe23d2ebab9c61dbc50d65f30cfa20a856ae.tar.xz
kernel-qcow2-linux-9242fe23d2ebab9c61dbc50d65f30cfa20a856ae.zip
gma500: frame buffer locking
If we are the console then a printk can hit us with a spin lock held (and in fact the kernel will do its best to take the console printing lock). In that case we cannot politely sleep when synching after an accelerated op but must behave obnoxiously to be sure of getting the bits out. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/gma500/accel_2d.c')
-rw-r--r--drivers/gpu/drm/gma500/accel_2d.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/gpu/drm/gma500/accel_2d.c b/drivers/gpu/drm/gma500/accel_2d.c
index f0cef7678d41..f0ce82aed654 100644
--- a/drivers/gpu/drm/gma500/accel_2d.c
+++ b/drivers/gpu/drm/gma500/accel_2d.c
@@ -111,8 +111,9 @@ static int psbfb_2d_submit(struct drm_psb_private *dev_priv, uint32_t *cmdbuf,
int ret = 0;
int i;
unsigned submit_size;
+ unsigned long flags;
- mutex_lock(&dev_priv->mutex_2d);
+ spin_lock_irqsave(&dev_priv->lock_2d, flags);
while (size > 0) {
submit_size = (size < 0x60) ? size : 0x60;
size -= submit_size;
@@ -127,7 +128,7 @@ static int psbfb_2d_submit(struct drm_psb_private *dev_priv, uint32_t *cmdbuf,
(void)PSB_RSGX32(PSB_SGX_2D_SLAVE_PORT + i - 4);
}
- mutex_unlock(&dev_priv->mutex_2d);
+ spin_unlock_irqrestore(&dev_priv->lock_2d, flags);
return ret;
}
@@ -327,8 +328,9 @@ int psbfb_sync(struct fb_info *info)
struct drm_psb_private *dev_priv = dev->dev_private;
unsigned long _end = jiffies + DRM_HZ;
int busy = 0;
+ unsigned long flags;
- mutex_lock(&dev_priv->mutex_2d);
+ spin_lock_irqsave(&dev_priv->lock_2d, flags);
/*
* First idle the 2D engine.
*/
@@ -357,6 +359,6 @@ int psbfb_sync(struct fb_info *info)
_PSB_C2B_STATUS_BUSY) != 0);
out:
- mutex_unlock(&dev_priv->mutex_2d);
+ spin_unlock_irqrestore(&dev_priv->lock_2d, flags);
return (busy) ? -EBUSY : 0;
}