From 0a8448bf1c5b8193bb3d2d3ec53cb6b98e75812a Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Sat, 29 Oct 2011 11:31:29 +1000 Subject: [PATCH] --- yaml --- r: 282603 b: refs/heads/master c: 020c6bf39488c4dd162bafed04b631b98f85d9f0 h: refs/heads/master i: 282601: f3799ec2dc3cc718997495880f2b0d4884518c1a 282599: 837f40d6b861a6bb9ca7cd8b0d2662c622099074 v: v3 --- [refs] | 2 +- trunk/drivers/gpu/drm/nouveau/nv50_display.c | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index d6284926cbfa..069efded1b53 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 19fa224f8a91a73a39b35251ced04b59b2a171b4 +refs/heads/master: 020c6bf39488c4dd162bafed04b631b98f85d9f0 diff --git a/trunk/drivers/gpu/drm/nouveau/nv50_display.c b/trunk/drivers/gpu/drm/nouveau/nv50_display.c index cfd7a8278470..a59d0b923cc8 100644 --- a/trunk/drivers/gpu/drm/nouveau/nv50_display.c +++ b/trunk/drivers/gpu/drm/nouveau/nv50_display.c @@ -54,13 +54,13 @@ static int evo_icmd(struct drm_device *dev, int ch, u32 mthd, u32 data) { 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_wr32(dev, 0x610304 + (ch * 0x08), data); nv_wr32(dev, 0x610300 + (ch * 0x08), 0x80000001 | mthd); if (!nv_wait(dev, 0x610300 + (ch * 0x08), 0x80000000, 0x00000000)) 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); return ret; } @@ -68,13 +68,15 @@ evo_icmd(struct drm_device *dev, int ch, u32 mthd, u32 data) int nv50_display_early_init(struct drm_device *dev) { + u32 ctrl = nv_rd32(dev, 0x610200); int i; + /* 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 * it is, do our best to reset the display engine... */ - if (nv_rd32(dev, 0x610200) & 0x00000001) { - NV_INFO(dev, "PDISP: already active, attempting to reset...\n"); + if ((ctrl & 0x00000003) == 0x00000003) { + NV_INFO(dev, "PDISP: EVO(0) 0x%08x, resetting...\n", ctrl); /* deactivate both heads first, PDISP will disappear forever * (well, until you power cycle) on some boards as soon as @@ -94,6 +96,7 @@ nv50_display_early_init(struct drm_device *dev) nv_mask(dev, 0x000200, 0x40000000, 0x00000000); nv_mask(dev, 0x000200, 0x40000000, 0x40000000); } + return 0; }