diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2013-09-09 23:20:34 -0400 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2013-09-17 10:16:29 -0400 |
commit | fc1620883af8cbc10bfb1a4ef2eb4e8113243012 (patch) | |
tree | 93ed88760f9a6735aaf172a84d873e2f515dd85a | |
parent | 5495e39fb3695182b9f2a72fe4169056cada37a1 (diff) |
drm/nouveau/kms: enable for non-vga pci classes
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_display.c | 35 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_fbcon.c | 3 |
2 files changed, 17 insertions, 21 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_display.c b/drivers/gpu/drm/nouveau/nouveau_display.c index d2712e6e5d31..7848590f5568 100644 --- a/drivers/gpu/drm/nouveau/nouveau_display.c +++ b/drivers/gpu/drm/nouveau/nouveau_display.c | |||
@@ -278,7 +278,6 @@ nouveau_display_create(struct drm_device *dev) | |||
278 | { | 278 | { |
279 | struct nouveau_drm *drm = nouveau_drm(dev); | 279 | struct nouveau_drm *drm = nouveau_drm(dev); |
280 | struct nouveau_display *disp; | 280 | struct nouveau_display *disp; |
281 | u32 pclass = dev->pdev->class >> 8; | ||
282 | int ret, gen; | 281 | int ret, gen; |
283 | 282 | ||
284 | disp = drm->display = kzalloc(sizeof(*disp), GFP_KERNEL); | 283 | disp = drm->display = kzalloc(sizeof(*disp), GFP_KERNEL); |
@@ -340,29 +339,25 @@ nouveau_display_create(struct drm_device *dev) | |||
340 | drm_kms_helper_poll_init(dev); | 339 | drm_kms_helper_poll_init(dev); |
341 | drm_kms_helper_poll_disable(dev); | 340 | drm_kms_helper_poll_disable(dev); |
342 | 341 | ||
343 | if (nouveau_modeset == 1 || | 342 | if (drm->vbios.dcb.entries) { |
344 | (nouveau_modeset < 0 && pclass == PCI_CLASS_DISPLAY_VGA)) { | 343 | if (nv_device(drm->device)->card_type < NV_50) |
345 | if (drm->vbios.dcb.entries) { | 344 | ret = nv04_display_create(dev); |
346 | if (nv_device(drm->device)->card_type < NV_50) | 345 | else |
347 | ret = nv04_display_create(dev); | 346 | ret = nv50_display_create(dev); |
348 | else | 347 | } else { |
349 | ret = nv50_display_create(dev); | 348 | ret = 0; |
350 | } else { | 349 | } |
351 | ret = 0; | ||
352 | } | ||
353 | |||
354 | if (ret) | ||
355 | goto disp_create_err; | ||
356 | 350 | ||
357 | if (dev->mode_config.num_crtc) { | 351 | if (ret) |
358 | ret = drm_vblank_init(dev, dev->mode_config.num_crtc); | 352 | goto disp_create_err; |
359 | if (ret) | ||
360 | goto vblank_err; | ||
361 | } | ||
362 | 353 | ||
363 | nouveau_backlight_init(dev); | 354 | if (dev->mode_config.num_crtc) { |
355 | ret = drm_vblank_init(dev, dev->mode_config.num_crtc); | ||
356 | if (ret) | ||
357 | goto vblank_err; | ||
364 | } | 358 | } |
365 | 359 | ||
360 | nouveau_backlight_init(dev); | ||
366 | return 0; | 361 | return 0; |
367 | 362 | ||
368 | vblank_err: | 363 | vblank_err: |
diff --git a/drivers/gpu/drm/nouveau/nouveau_fbcon.c b/drivers/gpu/drm/nouveau/nouveau_fbcon.c index 8f6d63d7edd3..a86ecf65c164 100644 --- a/drivers/gpu/drm/nouveau/nouveau_fbcon.c +++ b/drivers/gpu/drm/nouveau/nouveau_fbcon.c | |||
@@ -454,7 +454,8 @@ nouveau_fbcon_init(struct drm_device *dev) | |||
454 | int preferred_bpp; | 454 | int preferred_bpp; |
455 | int ret; | 455 | int ret; |
456 | 456 | ||
457 | if (!dev->mode_config.num_crtc) | 457 | if (!dev->mode_config.num_crtc || |
458 | (dev->pdev->class >> 8) != PCI_CLASS_DISPLAY_VGA) | ||
458 | return 0; | 459 | return 0; |
459 | 460 | ||
460 | fbcon = kzalloc(sizeof(struct nouveau_fbdev), GFP_KERNEL); | 461 | fbcon = kzalloc(sizeof(struct nouveau_fbdev), GFP_KERNEL); |