Commit 020c6bf3 authored by Ben Skeggs's avatar Ben Skeggs

drm/nv50/disp: stricter check for evo being active on init

Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
Tested-by: default avatarMartin Peres <martin.peres@labri.fr>
parent 19fa224f
...@@ -54,13 +54,13 @@ static int ...@@ -54,13 +54,13 @@ static int
evo_icmd(struct drm_device *dev, int ch, u32 mthd, u32 data) evo_icmd(struct drm_device *dev, int ch, u32 mthd, u32 data)
{ {
int ret = 0; int ret = 0;
if (nouveau_reg_debug & NOUVEAU_REG_DEBUG_EVO)
NV_INFO(dev, "EvoPIO: %d 0x%04x 0x%08x\n", ch, mthd, data);
nv_mask(dev, 0x610300 + (ch * 0x08), 0x00000001, 0x00000001); nv_mask(dev, 0x610300 + (ch * 0x08), 0x00000001, 0x00000001);
nv_wr32(dev, 0x610304 + (ch * 0x08), data); nv_wr32(dev, 0x610304 + (ch * 0x08), data);
nv_wr32(dev, 0x610300 + (ch * 0x08), 0x80000001 | mthd); nv_wr32(dev, 0x610300 + (ch * 0x08), 0x80000001 | mthd);
if (!nv_wait(dev, 0x610300 + (ch * 0x08), 0x80000000, 0x00000000)) if (!nv_wait(dev, 0x610300 + (ch * 0x08), 0x80000000, 0x00000000))
ret = -EBUSY; ret = -EBUSY;
if (ret || (nouveau_reg_debug & NOUVEAU_REG_DEBUG_EVO))
NV_INFO(dev, "EvoPIO: %d 0x%04x 0x%08x\n", ch, mthd, data);
nv_mask(dev, 0x610300 + (ch * 0x08), 0x00000001, 0x00000000); nv_mask(dev, 0x610300 + (ch * 0x08), 0x00000001, 0x00000000);
return ret; return ret;
} }
...@@ -68,13 +68,15 @@ evo_icmd(struct drm_device *dev, int ch, u32 mthd, u32 data) ...@@ -68,13 +68,15 @@ evo_icmd(struct drm_device *dev, int ch, u32 mthd, u32 data)
int int
nv50_display_early_init(struct drm_device *dev) nv50_display_early_init(struct drm_device *dev)
{ {
u32 ctrl = nv_rd32(dev, 0x610200);
int i; int i;
/* check if master evo channel is already active, a good a sign as any /* check if master evo channel is already active, a good a sign as any
* that the display engine is in a weird state (hibernate/kexec), if * that the display engine is in a weird state (hibernate/kexec), if
* it is, do our best to reset the display engine... * it is, do our best to reset the display engine...
*/ */
if (nv_rd32(dev, 0x610200) & 0x00000001) { if ((ctrl & 0x00000003) == 0x00000003) {
NV_INFO(dev, "PDISP: already active, attempting to reset...\n"); NV_INFO(dev, "PDISP: EVO(0) 0x%08x, resetting...\n", ctrl);
/* deactivate both heads first, PDISP will disappear forever /* deactivate both heads first, PDISP will disappear forever
* (well, until you power cycle) on some boards as soon as * (well, until you power cycle) on some boards as soon as
...@@ -94,6 +96,7 @@ nv50_display_early_init(struct drm_device *dev) ...@@ -94,6 +96,7 @@ nv50_display_early_init(struct drm_device *dev)
nv_mask(dev, 0x000200, 0x40000000, 0x00000000); nv_mask(dev, 0x000200, 0x40000000, 0x00000000);
nv_mask(dev, 0x000200, 0x40000000, 0x40000000); nv_mask(dev, 0x000200, 0x40000000, 0x40000000);
} }
return 0; return 0;
} }
......
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