diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2011-10-05 22:46:40 -0400 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2011-12-21 04:01:16 -0500 |
commit | 27d5030a235d89842ed70e18d924f017b34a496d (patch) | |
tree | 688eeb2c6139b79bf793447994c90d2184c60442 /drivers/gpu/drm/nouveau/nouveau_display.c | |
parent | 549cd872b0777bd72a66daa56558af28ec20d8a5 (diff) |
drm/nouveau: move master modesetting init to nouveau_display
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_display.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_display.c | 47 |
1 files changed, 46 insertions, 1 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_display.c b/drivers/gpu/drm/nouveau/nouveau_display.c index 7e88cd7f2b99..017d4ea12b1e 100644 --- a/drivers/gpu/drm/nouveau/nouveau_display.c +++ b/drivers/gpu/drm/nouveau/nouveau_display.c | |||
@@ -147,12 +147,57 @@ nouveau_user_framebuffer_create(struct drm_device *dev, | |||
147 | return &nouveau_fb->base; | 147 | return &nouveau_fb->base; |
148 | } | 148 | } |
149 | 149 | ||
150 | const struct drm_mode_config_funcs nouveau_mode_config_funcs = { | 150 | static const struct drm_mode_config_funcs nouveau_mode_config_funcs = { |
151 | .fb_create = nouveau_user_framebuffer_create, | 151 | .fb_create = nouveau_user_framebuffer_create, |
152 | .output_poll_changed = nouveau_fbcon_output_poll_changed, | 152 | .output_poll_changed = nouveau_fbcon_output_poll_changed, |
153 | }; | 153 | }; |
154 | 154 | ||
155 | int | 155 | int |
156 | nouveau_display_create(struct drm_device *dev) | ||
157 | { | ||
158 | struct drm_nouveau_private *dev_priv = dev->dev_private; | ||
159 | struct nouveau_display_engine *disp = &dev_priv->engine.display; | ||
160 | int ret; | ||
161 | |||
162 | drm_mode_config_init(dev); | ||
163 | drm_mode_create_scaling_mode_property(dev); | ||
164 | drm_mode_create_dithering_property(dev); | ||
165 | |||
166 | dev->mode_config.funcs = (void *)&nouveau_mode_config_funcs; | ||
167 | dev->mode_config.fb_base = pci_resource_start(dev->pdev, 1); | ||
168 | |||
169 | dev->mode_config.min_width = 0; | ||
170 | dev->mode_config.min_height = 0; | ||
171 | if (dev_priv->card_type < NV_10) { | ||
172 | dev->mode_config.max_width = 2048; | ||
173 | dev->mode_config.max_height = 2048; | ||
174 | } else | ||
175 | if (dev_priv->card_type < NV_50) { | ||
176 | dev->mode_config.max_width = 4096; | ||
177 | dev->mode_config.max_height = 4096; | ||
178 | } else { | ||
179 | dev->mode_config.max_width = 8192; | ||
180 | dev->mode_config.max_height = 8192; | ||
181 | } | ||
182 | |||
183 | ret = disp->create(dev); | ||
184 | if (ret) | ||
185 | return ret; | ||
186 | |||
187 | return 0; | ||
188 | } | ||
189 | |||
190 | void | ||
191 | nouveau_display_destroy(struct drm_device *dev) | ||
192 | { | ||
193 | struct drm_nouveau_private *dev_priv = dev->dev_private; | ||
194 | struct nouveau_display_engine *disp = &dev_priv->engine.display; | ||
195 | |||
196 | disp->destroy(dev); | ||
197 | drm_mode_config_cleanup(dev); | ||
198 | } | ||
199 | |||
200 | int | ||
156 | nouveau_vblank_enable(struct drm_device *dev, int crtc) | 201 | nouveau_vblank_enable(struct drm_device *dev, int crtc) |
157 | { | 202 | { |
158 | struct drm_nouveau_private *dev_priv = dev->dev_private; | 203 | struct drm_nouveau_private *dev_priv = dev->dev_private; |