Commit 9acc8100 authored by Ben Skeggs's avatar Ben Skeggs

drm/nouveau: fallback to sw fbcon if we can't get mutex immediately

Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent 6032649d
...@@ -61,8 +61,8 @@ nouveau_fbcon_fillrect(struct fb_info *info, const struct fb_fillrect *rect) ...@@ -61,8 +61,8 @@ nouveau_fbcon_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
return; return;
ret = -ENODEV; ret = -ENODEV;
if (!in_interrupt() && !(info->flags & FBINFO_HWACCEL_DISABLED)) { if (!in_interrupt() && !(info->flags & FBINFO_HWACCEL_DISABLED) &&
mutex_lock(&dev_priv->channel->mutex); mutex_trylock(&dev_priv->channel->mutex)) {
if (dev_priv->card_type < NV_50) if (dev_priv->card_type < NV_50)
ret = nv04_fbcon_fillrect(info, rect); ret = nv04_fbcon_fillrect(info, rect);
else else
...@@ -91,8 +91,8 @@ nouveau_fbcon_copyarea(struct fb_info *info, const struct fb_copyarea *image) ...@@ -91,8 +91,8 @@ nouveau_fbcon_copyarea(struct fb_info *info, const struct fb_copyarea *image)
return; return;
ret = -ENODEV; ret = -ENODEV;
if (!in_interrupt() && !(info->flags & FBINFO_HWACCEL_DISABLED)) { if (!in_interrupt() && !(info->flags & FBINFO_HWACCEL_DISABLED) &&
mutex_lock(&dev_priv->channel->mutex); mutex_trylock(&dev_priv->channel->mutex)) {
if (dev_priv->card_type < NV_50) if (dev_priv->card_type < NV_50)
ret = nv04_fbcon_copyarea(info, image); ret = nv04_fbcon_copyarea(info, image);
else else
...@@ -121,8 +121,8 @@ nouveau_fbcon_imageblit(struct fb_info *info, const struct fb_image *image) ...@@ -121,8 +121,8 @@ nouveau_fbcon_imageblit(struct fb_info *info, const struct fb_image *image)
return; return;
ret = -ENODEV; ret = -ENODEV;
if (!in_interrupt() && !(info->flags & FBINFO_HWACCEL_DISABLED)) { if (!in_interrupt() && !(info->flags & FBINFO_HWACCEL_DISABLED) &&
mutex_lock(&dev_priv->channel->mutex); mutex_trylock(&dev_priv->channel->mutex)) {
if (dev_priv->card_type < NV_50) if (dev_priv->card_type < NV_50)
ret = nv04_fbcon_imageblit(info, image); ret = nv04_fbcon_imageblit(info, image);
else else
...@@ -153,7 +153,9 @@ nouveau_fbcon_sync(struct fb_info *info) ...@@ -153,7 +153,9 @@ nouveau_fbcon_sync(struct fb_info *info)
info->flags & FBINFO_HWACCEL_DISABLED) info->flags & FBINFO_HWACCEL_DISABLED)
return 0; return 0;
mutex_lock(&chan->mutex); if (!mutex_trylock(&chan->mutex))
return 0;
ret = RING_SPACE(chan, 4); ret = RING_SPACE(chan, 4);
if (ret) { if (ret) {
mutex_unlock(&chan->mutex); mutex_unlock(&chan->mutex);
......
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