diff options
| author | Dave Airlie <airlied@redhat.com> | 2012-10-30 23:46:04 -0400 |
|---|---|---|
| committer | Dave Airlie <airlied@redhat.com> | 2012-10-30 23:46:09 -0400 |
| commit | 4936b172d699434547addbe452c2d600ea6a4baf (patch) | |
| tree | 4a2dd158ac377671fbc58032f42cd9109306348d | |
| parent | 8f0d8163b50e01f398b14bcd4dc039ac5ab18d64 (diff) | |
| parent | e412e95a268fa8544858ebfe066826b290430d51 (diff) | |
Merge branch 'drm-nouveau-fixes' of git://people.freedesktop.org/git/nouveau/linux-2.6 into drm-fixes
This covers all known nouveau regressions at the moment, along with a fix
to not steal the console on headless GPUs.
* 'drm-nouveau-fixes' of git://people.freedesktop.org/git/nouveau/linux-2.6:
drm/nouveau: headless mode by default if pci class != vga display
drm/nouveau: resurrect headless mode since rework
drm/nv50/fb: prevent oops on chipsets without compression tags
drm/nouveau: allow creation of zero-sized mm
drm/nouveau/i2c: fix typo when checking nvio i2c port validity
drm/nouveau: silence modesetting spam on pre-gf8 chipsets
| -rw-r--r-- | drivers/gpu/drm/nouveau/core/core/mm.c | 9 | ||||
| -rw-r--r-- | drivers/gpu/drm/nouveau/core/include/core/mm.h | 1 | ||||
| -rw-r--r-- | drivers/gpu/drm/nouveau/core/subdev/fb/nv50.c | 10 | ||||
| -rw-r--r-- | drivers/gpu/drm/nouveau/core/subdev/i2c/base.c | 2 | ||||
| -rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_display.c | 36 | ||||
| -rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_drm.c | 36 | ||||
| -rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_drm.h | 2 | ||||
| -rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_irq.c | 16 | ||||
| -rw-r--r-- | drivers/gpu/drm/nouveau/nv04_dac.c | 16 | ||||
| -rw-r--r-- | drivers/gpu/drm/nouveau/nv04_dfp.c | 14 | ||||
| -rw-r--r-- | drivers/gpu/drm/nouveau/nv04_tv.c | 9 |
11 files changed, 83 insertions, 68 deletions
diff --git a/drivers/gpu/drm/nouveau/core/core/mm.c b/drivers/gpu/drm/nouveau/core/core/mm.c index 4d6206448670..a6d3cd6490f7 100644 --- a/drivers/gpu/drm/nouveau/core/core/mm.c +++ b/drivers/gpu/drm/nouveau/core/core/mm.c | |||
| @@ -218,13 +218,16 @@ nouveau_mm_init(struct nouveau_mm *mm, u32 offset, u32 length, u32 block) | |||
| 218 | node = kzalloc(sizeof(*node), GFP_KERNEL); | 218 | node = kzalloc(sizeof(*node), GFP_KERNEL); |
| 219 | if (!node) | 219 | if (!node) |
| 220 | return -ENOMEM; | 220 | return -ENOMEM; |
| 221 | node->offset = roundup(offset, mm->block_size); | 221 | |
| 222 | node->length = rounddown(offset + length, mm->block_size) - node->offset; | 222 | if (length) { |
| 223 | node->offset = roundup(offset, mm->block_size); | ||
| 224 | node->length = rounddown(offset + length, mm->block_size); | ||
| 225 | node->length -= node->offset; | ||
| 226 | } | ||
| 223 | 227 | ||
| 224 | list_add_tail(&node->nl_entry, &mm->nodes); | 228 | list_add_tail(&node->nl_entry, &mm->nodes); |
| 225 | list_add_tail(&node->fl_entry, &mm->free); | 229 | list_add_tail(&node->fl_entry, &mm->free); |
| 226 | mm->heap_nodes++; | 230 | mm->heap_nodes++; |
| 227 | mm->heap_size += length; | ||
| 228 | return 0; | 231 | return 0; |
| 229 | } | 232 | } |
| 230 | 233 | ||
diff --git a/drivers/gpu/drm/nouveau/core/include/core/mm.h b/drivers/gpu/drm/nouveau/core/include/core/mm.h index 9ee9bf4028ca..975137ba34a6 100644 --- a/drivers/gpu/drm/nouveau/core/include/core/mm.h +++ b/drivers/gpu/drm/nouveau/core/include/core/mm.h | |||
| @@ -19,7 +19,6 @@ struct nouveau_mm { | |||
| 19 | 19 | ||
| 20 | u32 block_size; | 20 | u32 block_size; |
| 21 | int heap_nodes; | 21 | int heap_nodes; |
| 22 | u32 heap_size; | ||
| 23 | }; | 22 | }; |
| 24 | 23 | ||
| 25 | int nouveau_mm_init(struct nouveau_mm *, u32 offset, u32 length, u32 block); | 24 | int nouveau_mm_init(struct nouveau_mm *, u32 offset, u32 length, u32 block); |
diff --git a/drivers/gpu/drm/nouveau/core/subdev/fb/nv50.c b/drivers/gpu/drm/nouveau/core/subdev/fb/nv50.c index 27fb1af7a779..5f570806143a 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/fb/nv50.c +++ b/drivers/gpu/drm/nouveau/core/subdev/fb/nv50.c | |||
| @@ -219,13 +219,11 @@ nv50_fb_ctor(struct nouveau_object *parent, struct nouveau_object *engine, | |||
| 219 | ((priv->base.ram.size & 0x000000ff) << 32); | 219 | ((priv->base.ram.size & 0x000000ff) << 32); |
| 220 | 220 | ||
| 221 | tags = nv_rd32(priv, 0x100320); | 221 | tags = nv_rd32(priv, 0x100320); |
| 222 | if (tags) { | 222 | ret = nouveau_mm_init(&priv->base.tags, 0, tags, 1); |
| 223 | ret = nouveau_mm_init(&priv->base.tags, 0, tags, 1); | 223 | if (ret) |
| 224 | if (ret) | 224 | return ret; |
| 225 | return ret; | ||
| 226 | 225 | ||
| 227 | nv_debug(priv, "%d compression tags\n", tags); | 226 | nv_debug(priv, "%d compression tags\n", tags); |
| 228 | } | ||
| 229 | 227 | ||
| 230 | size = (priv->base.ram.size >> 12) - rsvd_head - rsvd_tail; | 228 | size = (priv->base.ram.size >> 12) - rsvd_head - rsvd_tail; |
| 231 | switch (device->chipset) { | 229 | switch (device->chipset) { |
diff --git a/drivers/gpu/drm/nouveau/core/subdev/i2c/base.c b/drivers/gpu/drm/nouveau/core/subdev/i2c/base.c index 3d2c88310f98..dbfc2abf0cfe 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/i2c/base.c +++ b/drivers/gpu/drm/nouveau/core/subdev/i2c/base.c | |||
| @@ -292,7 +292,7 @@ nouveau_i2c_ctor(struct nouveau_object *parent, struct nouveau_object *engine, | |||
| 292 | case DCB_I2C_NVIO_BIT: | 292 | case DCB_I2C_NVIO_BIT: |
| 293 | port->drive = info.drive & 0x0f; | 293 | port->drive = info.drive & 0x0f; |
| 294 | if (device->card_type < NV_D0) { | 294 | if (device->card_type < NV_D0) { |
| 295 | if (info.drive >= ARRAY_SIZE(nv50_i2c_port)) | 295 | if (port->drive >= ARRAY_SIZE(nv50_i2c_port)) |
| 296 | break; | 296 | break; |
| 297 | port->drive = nv50_i2c_port[port->drive]; | 297 | port->drive = nv50_i2c_port[port->drive]; |
| 298 | port->sense = port->drive; | 298 | port->sense = port->drive; |
diff --git a/drivers/gpu/drm/nouveau/nouveau_display.c b/drivers/gpu/drm/nouveau/nouveau_display.c index d2f8ffeed742..86124b131f4f 100644 --- a/drivers/gpu/drm/nouveau/nouveau_display.c +++ b/drivers/gpu/drm/nouveau/nouveau_display.c | |||
| @@ -290,6 +290,7 @@ nouveau_display_create(struct drm_device *dev) | |||
| 290 | struct nouveau_drm *drm = nouveau_drm(dev); | 290 | struct nouveau_drm *drm = nouveau_drm(dev); |
| 291 | struct nouveau_disp *pdisp = nouveau_disp(drm->device); | 291 | struct nouveau_disp *pdisp = nouveau_disp(drm->device); |
| 292 | struct nouveau_display *disp; | 292 | struct nouveau_display *disp; |
| 293 | u32 pclass = dev->pdev->class >> 8; | ||
| 293 | int ret, gen; | 294 | int ret, gen; |
| 294 | 295 | ||
| 295 | disp = drm->display = kzalloc(sizeof(*disp), GFP_KERNEL); | 296 | disp = drm->display = kzalloc(sizeof(*disp), GFP_KERNEL); |
| @@ -360,23 +361,27 @@ nouveau_display_create(struct drm_device *dev) | |||
| 360 | drm_kms_helper_poll_init(dev); | 361 | drm_kms_helper_poll_init(dev); |
| 361 | drm_kms_helper_poll_disable(dev); | 362 | drm_kms_helper_poll_disable(dev); |
| 362 | 363 | ||
| 363 | if (nv_device(drm->device)->card_type < NV_50) | 364 | if (nouveau_modeset == 1 || |
| 364 | ret = nv04_display_create(dev); | 365 | (nouveau_modeset < 0 && pclass == PCI_CLASS_DISPLAY_VGA)) { |
| 365 | else | 366 | if (nv_device(drm->device)->card_type < NV_50) |
| 366 | if (nv_device(drm->device)->card_type < NV_D0) | 367 | ret = nv04_display_create(dev); |
| 367 | ret = nv50_display_create(dev); | 368 | else |
| 368 | else | 369 | if (nv_device(drm->device)->card_type < NV_D0) |
| 369 | ret = nvd0_display_create(dev); | 370 | ret = nv50_display_create(dev); |
| 370 | if (ret) | 371 | else |
| 371 | goto disp_create_err; | 372 | ret = nvd0_display_create(dev); |
| 372 | |||
| 373 | if (dev->mode_config.num_crtc) { | ||
| 374 | ret = drm_vblank_init(dev, dev->mode_config.num_crtc); | ||
| 375 | if (ret) | 373 | if (ret) |
| 376 | goto vblank_err; | 374 | goto disp_create_err; |
| 375 | |||
| 376 | if (dev->mode_config.num_crtc) { | ||
| 377 | ret = drm_vblank_init(dev, dev->mode_config.num_crtc); | ||
| 378 | if (ret) | ||
| 379 | goto vblank_err; | ||
| 380 | } | ||
| 381 | |||
| 382 | nouveau_backlight_init(dev); | ||
| 377 | } | 383 | } |
| 378 | 384 | ||
| 379 | nouveau_backlight_init(dev); | ||
| 380 | return 0; | 385 | return 0; |
| 381 | 386 | ||
| 382 | vblank_err: | 387 | vblank_err: |
| @@ -395,7 +400,8 @@ nouveau_display_destroy(struct drm_device *dev) | |||
| 395 | nouveau_backlight_exit(dev); | 400 | nouveau_backlight_exit(dev); |
| 396 | drm_vblank_cleanup(dev); | 401 | drm_vblank_cleanup(dev); |
| 397 | 402 | ||
| 398 | disp->dtor(dev); | 403 | if (disp->dtor) |
| 404 | disp->dtor(dev); | ||
| 399 | 405 | ||
| 400 | drm_kms_helper_poll_fini(dev); | 406 | drm_kms_helper_poll_fini(dev); |
| 401 | drm_mode_config_cleanup(dev); | 407 | drm_mode_config_cleanup(dev); |
diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c index ccae8c26ae2b..0910125cbbc3 100644 --- a/drivers/gpu/drm/nouveau/nouveau_drm.c +++ b/drivers/gpu/drm/nouveau/nouveau_drm.c | |||
| @@ -63,8 +63,9 @@ MODULE_PARM_DESC(noaccel, "disable kernel/abi16 acceleration"); | |||
| 63 | static int nouveau_noaccel = 0; | 63 | static int nouveau_noaccel = 0; |
| 64 | module_param_named(noaccel, nouveau_noaccel, int, 0400); | 64 | module_param_named(noaccel, nouveau_noaccel, int, 0400); |
| 65 | 65 | ||
| 66 | MODULE_PARM_DESC(modeset, "enable driver"); | 66 | MODULE_PARM_DESC(modeset, "enable driver (default: auto, " |
| 67 | static int nouveau_modeset = -1; | 67 | "0 = disabled, 1 = enabled, 2 = headless)"); |
| 68 | int nouveau_modeset = -1; | ||
| 68 | module_param_named(modeset, nouveau_modeset, int, 0400); | 69 | module_param_named(modeset, nouveau_modeset, int, 0400); |
| 69 | 70 | ||
| 70 | static struct drm_driver driver; | 71 | static struct drm_driver driver; |
| @@ -363,7 +364,8 @@ nouveau_drm_unload(struct drm_device *dev) | |||
| 363 | 364 | ||
| 364 | nouveau_pm_fini(dev); | 365 | nouveau_pm_fini(dev); |
| 365 | 366 | ||
