提交 c7ca4d1b 编写于 作者: B Ben Skeggs

drm/nouveau: make vbios parser runnable from an atomic context

The nv50 display isr bh needs to be converted to a tasklet, which means
we can't sleep anymore.  The places we execute vbios init tables are
rare, and not in any way performance critical, so this isn't a huge
problem.
Signed-off-by: NBen Skeggs <bskeggs@redhat.com>
上级 8348f36d
...@@ -282,7 +282,7 @@ static void still_alive(void) ...@@ -282,7 +282,7 @@ static void still_alive(void)
{ {
#if 0 #if 0
sync(); sync();
msleep(2); mdelay(2);
#endif #endif
} }
...@@ -1904,7 +1904,7 @@ init_condition_time(struct nvbios *bios, uint16_t offset, ...@@ -1904,7 +1904,7 @@ init_condition_time(struct nvbios *bios, uint16_t offset,
BIOSLOG(bios, "0x%04X: " BIOSLOG(bios, "0x%04X: "
"Condition not met, sleeping for 20ms\n", "Condition not met, sleeping for 20ms\n",
offset); offset);
msleep(20); mdelay(20);
} }
} }
...@@ -1938,7 +1938,7 @@ init_ltime(struct nvbios *bios, uint16_t offset, struct init_exec *iexec) ...@@ -1938,7 +1938,7 @@ init_ltime(struct nvbios *bios, uint16_t offset, struct init_exec *iexec)
BIOSLOG(bios, "0x%04X: Sleeping for 0x%04X milliseconds\n", BIOSLOG(bios, "0x%04X: Sleeping for 0x%04X milliseconds\n",
offset, time); offset, time);
msleep(time); mdelay(time);
return 3; return 3;
} }
...@@ -2962,7 +2962,7 @@ init_time(struct nvbios *bios, uint16_t offset, struct init_exec *iexec) ...@@ -2962,7 +2962,7 @@ init_time(struct nvbios *bios, uint16_t offset, struct init_exec *iexec)
if (time < 1000) if (time < 1000)
udelay(time); udelay(time);
else else
msleep((time + 900) / 1000); mdelay((time + 900) / 1000);
return 3; return 3;
} }
...@@ -3856,7 +3856,7 @@ static int call_lvds_manufacturer_script(struct drm_device *dev, struct dcb_entr ...@@ -3856,7 +3856,7 @@ static int call_lvds_manufacturer_script(struct drm_device *dev, struct dcb_entr
if (script == LVDS_PANEL_OFF) { if (script == LVDS_PANEL_OFF) {
/* off-on delay in ms */ /* off-on delay in ms */
msleep(ROM16(bios->data[bios->fp.xlated_entry + 7])); mdelay(ROM16(bios->data[bios->fp.xlated_entry + 7]));
} }
#ifdef __powerpc__ #ifdef __powerpc__
/* Powerbook specific quirks */ /* Powerbook specific quirks */
...@@ -6702,11 +6702,11 @@ nouveau_bios_run_init_table(struct drm_device *dev, uint16_t table, ...@@ -6702,11 +6702,11 @@ nouveau_bios_run_init_table(struct drm_device *dev, uint16_t table,
struct nvbios *bios = &dev_priv->vbios; struct nvbios *bios = &dev_priv->vbios;
struct init_exec iexec = { true, false }; struct init_exec iexec = { true, false };
mutex_lock(&bios->lock); spin_lock_bh(&bios->lock);
bios->display.output = dcbent; bios->display.output = dcbent;
parse_init_table(bios, table, &iexec); parse_init_table(bios, table, &iexec);
bios->display.output = NULL; bios->display.output = NULL;
mutex_unlock(&bios->lock); spin_unlock_bh(&bios->lock);
} }
static bool NVInitVBIOS(struct drm_device *dev) static bool NVInitVBIOS(struct drm_device *dev)
...@@ -6715,7 +6715,7 @@ static bool NVInitVBIOS(struct drm_device *dev) ...@@ -6715,7 +6715,7 @@ static bool NVInitVBIOS(struct drm_device *dev)
struct nvbios *bios = &dev_priv->vbios; struct nvbios *bios = &dev_priv->vbios;
memset(bios, 0, sizeof(struct nvbios)); memset(bios, 0, sizeof(struct nvbios));
mutex_init(&bios->lock); spin_lock_init(&bios->lock);
bios->dev = dev; bios->dev = dev;
if (!NVShadowVBIOS(dev, bios->data)) if (!NVShadowVBIOS(dev, bios->data))
......
...@@ -251,7 +251,7 @@ struct nvbios { ...@@ -251,7 +251,7 @@ struct nvbios {
uint8_t digital_min_front_porch; uint8_t digital_min_front_porch;
bool fp_no_ddc; bool fp_no_ddc;
struct mutex lock; spinlock_t lock;
uint8_t data[NV_PROM_SIZE]; uint8_t data[NV_PROM_SIZE];
unsigned int length; unsigned int length;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册