aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2011-10-28 21:31:29 -0400
committerBen Skeggs <bskeggs@redhat.com>2011-12-21 04:01:26 -0500
commit020c6bf39488c4dd162bafed04b631b98f85d9f0 (patch)
treece550a8eacf137378b1f5918e09b6239f528be61 /drivers
parent19fa224f8a91a73a39b35251ced04b59b2a171b4 (diff)
drm/nv50/disp: stricter check for evo being active on init
Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Tested-by: Martin Peres <martin.peres@labri.fr>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/nouveau/nv50_display.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/gpu/drm/nouveau/nv50_display.c b/drivers/gpu/drm/nouveau/nv50_display.c
index cfd7a8278470..a59d0b923cc8 100644
--- a/drivers/gpu/drm/nouveau/nv50_display.c
+++ b/drivers/gpu/drm/nouveau/nv50_display.c
@@ -54,13 +54,13 @@ static int
54evo_icmd(struct drm_device *dev, int ch, u32 mthd, u32 data) 54evo_icmd(struct drm_device *dev, int ch, u32 mthd, u32 data)
55{ 55{
56 int ret = 0; 56 int ret = 0;
57 if (nouveau_reg_debug & NOUVEAU_REG_DEBUG_EVO)
58 NV_INFO(dev, "EvoPIO: %d 0x%04x 0x%08x\n", ch, mthd, data);
59 nv_mask(dev, 0x610300 + (ch * 0x08), 0x00000001, 0x00000001); 57 nv_mask(dev, 0x610300 + (ch * 0x08), 0x00000001, 0x00000001);
60 nv_wr32(dev, 0x610304 + (ch * 0x08), data); 58 nv_wr32(dev, 0x610304 + (ch * 0x08), data);
61 nv_wr32(dev, 0x610300 + (ch * 0x08), 0x80000001 | mthd); 59 nv_wr32(dev, 0x610300 + (ch * 0x08), 0x80000001 | mthd);
62 if (!nv_wait(dev, 0x610300 + (ch * 0x08), 0x80000000, 0x00000000)) 60 if (!nv_wait(dev, 0x610300 + (ch * 0x08), 0x80000000, 0x00000000))
63 ret = -EBUSY; 61 ret = -EBUSY;
62 if (ret || (nouveau_reg_debug & NOUVEAU_REG_DEBUG_EVO))
63 NV_INFO(dev, "EvoPIO: %d 0x%04x 0x%08x\n", ch, mthd, data);
64 nv_mask(dev, 0x610300 + (ch * 0x08), 0x00000001, 0x00000000); 64 nv_mask(dev, 0x610300 + (ch * 0x08), 0x00000001, 0x00000000);
65 return ret; 65 return ret;
66} 66}
@@ -68,13 +68,15 @@ evo_icmd(struct drm_device *dev, int ch, u32 mthd, u32 data)
68int 68int
69nv50_display_early_init(struct drm_device *dev) 69nv50_display_early_init(struct drm_device *dev)
70{ 70{
71 u32 ctrl = nv_rd32(dev, 0x610200);
71 int i; 72 int i;
73
72 /* check if master evo channel is already active, a good a sign as any 74 /* check if master evo channel is already active, a good a sign as any
73 * that the display engine is in a weird state (hibernate/kexec), if 75 * that the display engine is in a weird state (hibernate/kexec), if
74 * it is, do our best to reset the display engine... 76 * it is, do our best to reset the display engine...
75 */ 77 */
76 if (nv_rd32(dev, 0x610200) & 0x00000001) { 78 if ((ctrl & 0x00000003) == 0x00000003) {
77 NV_INFO(dev, "PDISP: already active, attempting to reset...\n"); 79 NV_INFO(dev, "PDISP: EVO(0) 0x%08x, resetting...\n", ctrl);
78 80
79 /* deactivate both heads first, PDISP will disappear forever 81 /* deactivate both heads first, PDISP will disappear forever
80 * (well, until you power cycle) on some boards as soon as 82 * (well, until you power cycle) on some boards as soon as
@@ -94,6 +96,7 @@ nv50_display_early_init(struct drm_device *dev)
94 nv_mask(dev, 0x000200, 0x40000000, 0x00000000); 96 nv_mask(dev, 0x000200, 0x40000000, 0x00000000);
95 nv_mask(dev, 0x000200, 0x40000000, 0x40000000); 97 nv_mask(dev, 0x000200, 0x40000000, 0x40000000);
96 } 98 }
99
97 return 0; 100 return 0;
98} 101}
99 102