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 | |
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')
-rw-r--r-- | drivers/gpu/drm/nouveau/core/engine/disp/nvd0.c | 3 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/core/engine/disp/nve0.c | 3 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/core/engine/disp/nvf0.c | 3 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/core/subdev/bios/base.c | 6 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/core/subdev/devinit/nvc0.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_bios.c | 7 |
6 files changed, 17 insertions, 7 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 | ||
diff --git a/drivers/gpu/drm/nouveau/nouveau_bios.c b/drivers/gpu/drm/nouveau/nouveau_bios.c index e09817df7934..3e7287675ecf 100644 --- a/drivers/gpu/drm/nouveau/nouveau_bios.c +++ b/drivers/gpu/drm/nouveau/nouveau_bios.c | |||
@@ -2051,19 +2051,14 @@ nouveau_bios_posted(struct drm_device *dev) | |||
2051 | struct nouveau_drm *drm = nouveau_drm(dev); | 2051 | struct nouveau_drm *drm = nouveau_drm(dev); |
2052 | unsigned htotal; | 2052 | unsigned htotal; |
2053 | 2053 | ||
2054 | if (nv_device(drm->device)->card_type >= NV_50) { | 2054 | if (nv_device(drm->device)->card_type >= NV_50) |
2055 | if (NVReadVgaCrtc(dev, 0, 0x00) == 0 && | ||
2056 | NVReadVgaCrtc(dev, 0, 0x1a) == 0) | ||
2057 | return false; | ||
2058 | return true; | 2055 | return true; |
2059 | } | ||
2060 | 2056 | ||
2061 | htotal = NVReadVgaCrtc(dev, 0, 0x06); | 2057 | htotal = NVReadVgaCrtc(dev, 0, 0x06); |
2062 | htotal |= (NVReadVgaCrtc(dev, 0, 0x07) & 0x01) << 8; | 2058 | htotal |= (NVReadVgaCrtc(dev, 0, 0x07) & 0x01) << 8; |
2063 | htotal |= (NVReadVgaCrtc(dev, 0, 0x07) & 0x20) << 4; | 2059 | htotal |= (NVReadVgaCrtc(dev, 0, 0x07) & 0x20) << 4; |
2064 | htotal |= (NVReadVgaCrtc(dev, 0, 0x25) & 0x01) << 10; | 2060 | htotal |= (NVReadVgaCrtc(dev, 0, 0x25) & 0x01) << 10; |
2065 | htotal |= (NVReadVgaCrtc(dev, 0, 0x41) & 0x01) << 11; | 2061 | htotal |= (NVReadVgaCrtc(dev, 0, 0x41) & 0x01) << 11; |
2066 | |||
2067 | return (htotal != 0); | 2062 | return (htotal != 0); |
2068 | } | 2063 | } |
2069 | 2064 | ||