Skip to content

Commit

Permalink
drm/nouveau/kms: enable for non-vga pci classes
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
  • Loading branch information
Ben Skeggs committed Sep 17, 2013
1 parent 5495e39 commit fc16208
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 21 deletions.
35 changes: 15 additions & 20 deletions drivers/gpu/drm/nouveau/nouveau_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,6 @@ nouveau_display_create(struct drm_device *dev)
{
struct nouveau_drm *drm = nouveau_drm(dev);
struct nouveau_display *disp;
u32 pclass = dev->pdev->class >> 8;
int ret, gen;

disp = drm->display = kzalloc(sizeof(*disp), GFP_KERNEL);
Expand Down Expand Up @@ -340,29 +339,25 @@ nouveau_display_create(struct drm_device *dev)
drm_kms_helper_poll_init(dev);
drm_kms_helper_poll_disable(dev);

if (nouveau_modeset == 1 ||
(nouveau_modeset < 0 && pclass == PCI_CLASS_DISPLAY_VGA)) {
if (drm->vbios.dcb.entries) {
if (nv_device(drm->device)->card_type < NV_50)
ret = nv04_display_create(dev);
else
ret = nv50_display_create(dev);
} else {
ret = 0;
}

if (ret)
goto disp_create_err;
if (drm->vbios.dcb.entries) {
if (nv_device(drm->device)->card_type < NV_50)
ret = nv04_display_create(dev);
else
ret = nv50_display_create(dev);
} else {
ret = 0;
}

if (dev->mode_config.num_crtc) {
ret = drm_vblank_init(dev, dev->mode_config.num_crtc);
if (ret)
goto vblank_err;
}
if (ret)
goto disp_create_err;

nouveau_backlight_init(dev);
if (dev->mode_config.num_crtc) {
ret = drm_vblank_init(dev, dev->mode_config.num_crtc);
if (ret)
goto vblank_err;
}

nouveau_backlight_init(dev);
return 0;

vblank_err:
Expand Down
3 changes: 2 additions & 1 deletion drivers/gpu/drm/nouveau/nouveau_fbcon.c
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,8 @@ nouveau_fbcon_init(struct drm_device *dev)
int preferred_bpp;
int ret;

if (!dev->mode_config.num_crtc)
if (!dev->mode_config.num_crtc ||
(dev->pdev->class >> 8) != PCI_CLASS_DISPLAY_VGA)
return 0;

fbcon = kzalloc(sizeof(struct nouveau_fbdev), GFP_KERNEL);
Expand Down

0 comments on commit fc16208

Please sign in to comment.