diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2011-08-11 20:05:43 -0400 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2011-09-20 02:11:51 -0400 |
commit | 59ef9742f6b24d1f3062b975ec959512519f8987 (patch) | |
tree | d4030d54e3ba6b857aee3b988812f755fe6dafa0 /drivers/gpu/drm | |
parent | 6d6538a0c33e29781151d03c150b7e31ab4f6411 (diff) |
drm/nv40/pm: execute memory reset script from vbios
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_bios.c | 10 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_drv.h | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nv40_pm.c | 5 |
3 files changed, 16 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_bios.c b/drivers/gpu/drm/nouveau/nouveau_bios.c index 58b2535e3b6b..032a82098136 100644 --- a/drivers/gpu/drm/nouveau/nouveau_bios.c +++ b/drivers/gpu/drm/nouveau/nouveau_bios.c | |||
@@ -6776,6 +6776,16 @@ nouveau_bios_run_init_table(struct drm_device *dev, uint16_t table, | |||
6776 | spin_unlock_bh(&bios->lock); | 6776 | spin_unlock_bh(&bios->lock); |
6777 | } | 6777 | } |
6778 | 6778 | ||
6779 | void | ||
6780 | nouveau_bios_init_exec(struct drm_device *dev, uint16_t table) | ||
6781 | { | ||
6782 | struct drm_nouveau_private *dev_priv = dev->dev_private; | ||
6783 | struct nvbios *bios = &dev_priv->vbios; | ||
6784 | struct init_exec iexec = { true, false }; | ||
6785 | |||
6786 | parse_init_table(bios, table, &iexec); | ||
6787 | } | ||
6788 | |||
6779 | static bool NVInitVBIOS(struct drm_device *dev) | 6789 | static bool NVInitVBIOS(struct drm_device *dev) |
6780 | { | 6790 | { |
6781 | struct drm_nouveau_private *dev_priv = dev->dev_private; | 6791 | struct drm_nouveau_private *dev_priv = dev->dev_private; |
diff --git a/drivers/gpu/drm/nouveau/nouveau_drv.h b/drivers/gpu/drm/nouveau/nouveau_drv.h index ecaa4ffbeab9..29837da1098b 100644 --- a/drivers/gpu/drm/nouveau/nouveau_drv.h +++ b/drivers/gpu/drm/nouveau/nouveau_drv.h | |||
@@ -1071,6 +1071,7 @@ extern void nouveau_bios_takedown(struct drm_device *dev); | |||
1071 | extern int nouveau_run_vbios_init(struct drm_device *); | 1071 | extern int nouveau_run_vbios_init(struct drm_device *); |
1072 | extern void nouveau_bios_run_init_table(struct drm_device *, uint16_t table, | 1072 | extern void nouveau_bios_run_init_table(struct drm_device *, uint16_t table, |
1073 | struct dcb_entry *, int crtc); | 1073 | struct dcb_entry *, int crtc); |
1074 | extern void nouveau_bios_init_exec(struct drm_device *, uint16_t table); | ||
1074 | extern struct dcb_gpio_entry *nouveau_bios_gpio_entry(struct drm_device *, | 1075 | extern struct dcb_gpio_entry *nouveau_bios_gpio_entry(struct drm_device *, |
1075 | enum dcb_gpio_tag); | 1076 | enum dcb_gpio_tag); |
1076 | extern struct dcb_connector_table_entry * | 1077 | extern struct dcb_connector_table_entry * |
diff --git a/drivers/gpu/drm/nouveau/nv40_pm.c b/drivers/gpu/drm/nouveau/nv40_pm.c index 491688676df4..bbc0b9c7e1f7 100644 --- a/drivers/gpu/drm/nouveau/nv40_pm.c +++ b/drivers/gpu/drm/nouveau/nv40_pm.c | |||
@@ -221,6 +221,7 @@ nv40_pm_clocks_set(struct drm_device *dev, void *pre_state) | |||
221 | struct drm_nouveau_private *dev_priv = dev->dev_private; | 221 | struct drm_nouveau_private *dev_priv = dev->dev_private; |
222 | struct nv40_pm_state *info = pre_state; | 222 | struct nv40_pm_state *info = pre_state; |
223 | unsigned long flags; | 223 | unsigned long flags; |
224 | struct bit_entry M; | ||
224 | u32 crtc_mask = 0; | 225 | u32 crtc_mask = 0; |
225 | u8 sr1[2]; | 226 | u8 sr1[2]; |
226 | int i; | 227 | int i; |
@@ -310,6 +311,10 @@ nv40_pm_clocks_set(struct drm_device *dev, void *pre_state) | |||
310 | nv_mask(dev, 0x100210, 0x80000000, 0x80000000); | 311 | nv_mask(dev, 0x100210, 0x80000000, 0x80000000); |
311 | udelay(100); | 312 | udelay(100); |
312 | 313 | ||
314 | /* execute memory reset script from vbios */ | ||
315 | if (!bit_table(dev, 'M', &M)) | ||
316 | nouveau_bios_init_exec(dev, ROM16(M.data[0])); | ||
317 | |||
313 | /* make sure we're in vblank (hopefully the same one as before), and | 318 | /* make sure we're in vblank (hopefully the same one as before), and |
314 | * then re-enable crtc memory access | 319 | * then re-enable crtc memory access |
315 | */ | 320 | */ |