diff options
author | Maarten Lankhorst <maarten.lankhorst@canonical.com> | 2013-06-27 03:35:53 -0400 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2013-06-30 23:50:50 -0400 |
commit | 791dc143ed2c441f5202d8721609d94dce9fcf88 (patch) | |
tree | 216e356ae9c18704f345ec7b464af3c0050c21f8 /drivers/gpu/drm/nouveau/core | |
parent | e99716f13d3a499f95a17e5442ef39270e4fc38b (diff) |
drm/nvd0-/disp: handle case where display engine is missing/disabled
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/core')
5 files changed, 16 insertions, 1 deletions
diff --git a/drivers/gpu/drm/nouveau/core/engine/disp/nvd0.c b/drivers/gpu/drm/nouveau/core/engine/disp/nvd0.c index 3ed10b00e81c..52dd7a1db729 100644 --- a/drivers/gpu/drm/nouveau/core/engine/disp/nvd0.c +++ b/drivers/gpu/drm/nouveau/core/engine/disp/nvd0.c | |||
@@ -958,6 +958,9 @@ nvd0_disp_ctor(struct nouveau_object *parent, struct nouveau_object *engine, | |||
958 | int heads = nv_rd32(parent, 0x022448); | 958 | int heads = nv_rd32(parent, 0x022448); |
959 | int ret; | 959 | int ret; |
960 | 960 | ||
961 | if (nv_rd32(parent, 0x022500) & 0x00000001) | ||
962 | return -ENODEV; | ||
963 | |||
961 | ret = nouveau_disp_create(parent, engine, oclass, heads, | 964 | ret = nouveau_disp_create(parent, engine, oclass, heads, |
962 | "PDISP", "display", &priv); | 965 | "PDISP", "display", &priv); |
963 | *pobject = nv_object(priv); | 966 | *pobject = nv_object(priv); |
diff --git a/drivers/gpu/drm/nouveau/core/engine/disp/nve0.c b/drivers/gpu/drm/nouveau/core/engine/disp/nve0.c index 20725b363d58..fb1fe6ae5e74 100644 --- a/drivers/gpu/drm/nouveau/core/engine/disp/nve0.c +++ b/drivers/gpu/drm/nouveau/core/engine/disp/nve0.c | |||
@@ -54,6 +54,9 @@ nve0_disp_ctor(struct nouveau_object *parent, struct nouveau_object *engine, | |||
54 | int heads = nv_rd32(parent, 0x022448); | 54 | int heads = nv_rd32(parent, 0x022448); |
55 | int ret; | 55 | int ret; |
56 | 56 | ||
57 | if (nv_rd32(parent, 0x022500) & 0x00000001) | ||
58 | return -ENODEV; | ||
59 | |||
57 | ret = nouveau_disp_create(parent, engine, oclass, heads, | 60 | ret = nouveau_disp_create(parent, engine, oclass, heads, |
58 | "PDISP", "display", &priv); | 61 | "PDISP", "display", &priv); |
59 | *pobject = nv_object(priv); | 62 | *pobject = nv_object(priv); |
diff --git a/drivers/gpu/drm/nouveau/core/engine/disp/nvf0.c b/drivers/gpu/drm/nouveau/core/engine/disp/nvf0.c index a488c36e40f9..42aa6b97dbea 100644 --- a/drivers/gpu/drm/nouveau/core/engine/disp/nvf0.c +++ b/drivers/gpu/drm/nouveau/core/engine/disp/nvf0.c | |||
@@ -54,6 +54,9 @@ nvf0_disp_ctor(struct nouveau_object *parent, struct nouveau_object *engine, | |||
54 | int heads = nv_rd32(parent, 0x022448); | 54 | int heads = nv_rd32(parent, 0x022448); |
55 | int ret; | 55 | int ret; |
56 | 56 | ||
57 | if (nv_rd32(parent, 0x022500) & 0x00000001) | ||
58 | return -ENODEV; | ||
59 | |||
57 | ret = nouveau_disp_create(parent, engine, oclass, heads, | 60 | ret = nouveau_disp_create(parent, engine, oclass, heads, |
58 | "PDISP", "display", &priv); | 61 | "PDISP", "display", &priv); |
59 | *pobject = nv_object(priv); | 62 | *pobject = nv_object(priv); |
diff --git a/drivers/gpu/drm/nouveau/core/subdev/bios/base.c b/drivers/gpu/drm/nouveau/core/subdev/bios/base.c index 0e2c1a4f1659..aa0fbbec7f08 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/bios/base.c +++ b/drivers/gpu/drm/nouveau/core/subdev/bios/base.c | |||
@@ -85,11 +85,15 @@ static void | |||
85 | nouveau_bios_shadow_pramin(struct nouveau_bios *bios) | 85 | nouveau_bios_shadow_pramin(struct nouveau_bios *bios) |
86 | { | 86 | { |
87 | struct nouveau_device *device = nv_device(bios); | 87 | struct nouveau_device *device = nv_device(bios); |
88 | u64 addr = 0; | ||
88 | u32 bar0 = 0; | 89 | u32 bar0 = 0; |
89 | int i; | 90 | int i; |
90 | 91 | ||
91 | if (device->card_type >= NV_50) { | 92 | if (device->card_type >= NV_50) { |
92 | u64 addr = (u64)(nv_rd32(bios, 0x619f04) & 0xffffff00) << 8; | 93 | if ( device->card_type < NV_C0 || |
94 | !(nv_rd32(bios, 0x022500) & 0x00000001)) | ||
95 | addr = (u64)(nv_rd32(bios, 0x619f04) & 0xffffff00) << 8; | ||
96 | |||
93 | if (!addr) { | 97 | if (!addr) { |
94 | addr = (u64)nv_rd32(bios, 0x001700) << 16; | 98 | addr = (u64)nv_rd32(bios, 0x001700) << 16; |
95 | addr += 0xf0000; | 99 | addr += 0xf0000; |
diff --git a/drivers/gpu/drm/nouveau/core/subdev/devinit/nvc0.c b/drivers/gpu/drm/nouveau/core/subdev/devinit/nvc0.c index dd78efbcae1a..af407a8637c7 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/devinit/nvc0.c +++ b/drivers/gpu/drm/nouveau/core/subdev/devinit/nvc0.c | |||
@@ -73,6 +73,8 @@ nvc0_devinit_ctor(struct nouveau_object *parent, struct nouveau_object *engine, | |||
73 | return ret; | 73 | return ret; |
74 | 74 | ||
75 | priv->base.pll_set = nvc0_devinit_pll_set; | 75 | priv->base.pll_set = nvc0_devinit_pll_set; |
76 | if (nv_rd32(priv, 0x022500) & 0x00000001) | ||
77 | priv->base.post = true; | ||
76 | return 0; | 78 | return 0; |
77 | } | 79 | } |
78 | 80 | ||