diff options
Diffstat (limited to 'drivers/gpu/drm/nouveau/nv04_display.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/nv04_display.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/drivers/gpu/drm/nouveau/nv04_display.c b/drivers/gpu/drm/nouveau/nv04_display.c index 2cd6fb8c548e..ad48444c385c 100644 --- a/drivers/gpu/drm/nouveau/nv04_display.c +++ b/drivers/gpu/drm/nouveau/nv04_display.c | |||
@@ -22,6 +22,9 @@ | |||
22 | * Author: Ben Skeggs | 22 | * Author: Ben Skeggs |
23 | */ | 23 | */ |
24 | 24 | ||
25 | #include <core/object.h> | ||
26 | #include <core/class.h> | ||
27 | |||
25 | #include <drm/drmP.h> | 28 | #include <drm/drmP.h> |
26 | #include <drm/drm_crtc_helper.h> | 29 | #include <drm/drm_crtc_helper.h> |
27 | 30 | ||
@@ -31,6 +34,8 @@ | |||
31 | #include "nouveau_encoder.h" | 34 | #include "nouveau_encoder.h" |
32 | #include "nouveau_connector.h" | 35 | #include "nouveau_connector.h" |
33 | 36 | ||
37 | #include <subdev/i2c.h> | ||
38 | |||
34 | int | 39 | int |
35 | nv04_display_early_init(struct drm_device *dev) | 40 | nv04_display_early_init(struct drm_device *dev) |
36 | { | 41 | { |
@@ -53,6 +58,7 @@ int | |||
53 | nv04_display_create(struct drm_device *dev) | 58 | nv04_display_create(struct drm_device *dev) |
54 | { | 59 | { |
55 | struct nouveau_drm *drm = nouveau_drm(dev); | 60 | struct nouveau_drm *drm = nouveau_drm(dev); |
61 | struct nouveau_i2c *i2c = nouveau_i2c(drm->device); | ||
56 | struct dcb_table *dcb = &drm->vbios.dcb; | 62 | struct dcb_table *dcb = &drm->vbios.dcb; |
57 | struct drm_connector *connector, *ct; | 63 | struct drm_connector *connector, *ct; |
58 | struct drm_encoder *encoder; | 64 | struct drm_encoder *encoder; |
@@ -71,6 +77,11 @@ nv04_display_create(struct drm_device *dev) | |||
71 | 77 | ||
72 | nouveau_hw_save_vga_fonts(dev, 1); | 78 | nouveau_hw_save_vga_fonts(dev, 1); |
73 | 79 | ||
80 | ret = nouveau_object_new(nv_object(drm), NVDRM_DEVICE, 0xd1500000, | ||
81 | NV04_DISP_CLASS, NULL, 0, &disp->core); | ||
82 | if (ret) | ||
83 | return ret; | ||
84 | |||
74 | nv04_crtc_create(dev, 0); | 85 | nv04_crtc_create(dev, 0); |
75 | if (nv_two_heads(dev)) | 86 | if (nv_two_heads(dev)) |
76 | nv04_crtc_create(dev, 1); | 87 | nv04_crtc_create(dev, 1); |
@@ -114,6 +125,11 @@ nv04_display_create(struct drm_device *dev) | |||
114 | } | 125 | } |
115 | } | 126 | } |
116 | 127 | ||
128 | list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) { | ||
129 | struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder); | ||
130 | nv_encoder->i2c = i2c->find(i2c, nv_encoder->dcb->i2c_index); | ||
131 | } | ||
132 | |||
117 | /* Save previous state */ | 133 | /* Save previous state */ |
118 | list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) | 134 | list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) |
119 | crtc->funcs->save(crtc); | 135 | crtc->funcs->save(crtc); |
@@ -140,7 +156,7 @@ nv04_display_destroy(struct drm_device *dev) | |||
140 | .crtc = crtc, | 156 | .crtc = crtc, |
141 | }; | 157 | }; |
142 | 158 | ||
143 | crtc->funcs->set_config(&modeset); | 159 | drm_mode_set_config_internal(&modeset); |
144 | } | 160 | } |
145 | 161 | ||
146 | /* Restore state */ | 162 | /* Restore state */ |