Commit dcc32b83 authored by Dave Airlie's avatar Dave Airlie

Merge remote branch 'nouveau/drm-nouveau-fixes' of /ssd/git/drm-nouveau-next into drm-fixes

* 'nouveau/drm-nouveau-fixes' of /ssd/git/drm-nouveau-next:
  drm/nv40: fall back to paged dma object for the moment
  drm/nouveau: fix leak of gart mm node
  drm/nouveau: fix vram page mapping when crossing page table boundaries
  drm/nv17-nv40: Fix modesetting failure when pitch == 4096px (fdo bug 35901).
  drm/nouveau: don't create accel engine objects when noaccel=1
  drm/nvc0: recognise 0xdX chipsets as NV_C0
parents de52bcab 4cff3ce5
...@@ -900,6 +900,7 @@ nv_save_state_ext(struct drm_device *dev, int head, ...@@ -900,6 +900,7 @@ nv_save_state_ext(struct drm_device *dev, int head,
} }
/* NV11 and NV20 don't have this, they stop at 0x52. */ /* NV11 and NV20 don't have this, they stop at 0x52. */
if (nv_gf4_disp_arch(dev)) { if (nv_gf4_disp_arch(dev)) {
rd_cio_state(dev, head, regp, NV_CIO_CRE_42);
rd_cio_state(dev, head, regp, NV_CIO_CRE_53); rd_cio_state(dev, head, regp, NV_CIO_CRE_53);
rd_cio_state(dev, head, regp, NV_CIO_CRE_54); rd_cio_state(dev, head, regp, NV_CIO_CRE_54);
...@@ -1003,6 +1004,7 @@ nv_load_state_ext(struct drm_device *dev, int head, ...@@ -1003,6 +1004,7 @@ nv_load_state_ext(struct drm_device *dev, int head,
nouveau_wait_eq(dev, 650000000, NV_PRMCIO_INP0__COLOR, 0x8, 0x0); nouveau_wait_eq(dev, 650000000, NV_PRMCIO_INP0__COLOR, 0x8, 0x0);
} }
wr_cio_state(dev, head, regp, NV_CIO_CRE_42);
wr_cio_state(dev, head, regp, NV_CIO_CRE_53); wr_cio_state(dev, head, regp, NV_CIO_CRE_53);
wr_cio_state(dev, head, regp, NV_CIO_CRE_54); wr_cio_state(dev, head, regp, NV_CIO_CRE_54);
......
...@@ -397,7 +397,7 @@ nouveau_mem_vram_init(struct drm_device *dev) ...@@ -397,7 +397,7 @@ nouveau_mem_vram_init(struct drm_device *dev)
if (pci_dma_supported(dev->pdev, DMA_BIT_MASK(40))) if (pci_dma_supported(dev->pdev, DMA_BIT_MASK(40)))
dma_bits = 40; dma_bits = 40;
} else } else
if (drm_pci_device_is_pcie(dev) && if (0 && drm_pci_device_is_pcie(dev) &&
dev_priv->chipset > 0x40 && dev_priv->chipset > 0x40 &&
dev_priv->chipset != 0x45) { dev_priv->chipset != 0x45) {
if (pci_dma_supported(dev->pdev, DMA_BIT_MASK(39))) if (pci_dma_supported(dev->pdev, DMA_BIT_MASK(39)))
...@@ -868,7 +868,9 @@ nouveau_gart_manager_del(struct ttm_mem_type_manager *man, ...@@ -868,7 +868,9 @@ nouveau_gart_manager_del(struct ttm_mem_type_manager *man,
nouveau_vm_unmap(&node->tmp_vma); nouveau_vm_unmap(&node->tmp_vma);
nouveau_vm_put(&node->tmp_vma); nouveau_vm_put(&node->tmp_vma);
} }
mem->mm_node = NULL; mem->mm_node = NULL;
kfree(node);
} }
static int static int
......
...@@ -458,7 +458,7 @@ nouveau_sgdma_init(struct drm_device *dev) ...@@ -458,7 +458,7 @@ nouveau_sgdma_init(struct drm_device *dev)
dev_priv->gart_info.type = NOUVEAU_GART_HW; dev_priv->gart_info.type = NOUVEAU_GART_HW;
dev_priv->gart_info.func = &nv50_sgdma_backend; dev_priv->gart_info.func = &nv50_sgdma_backend;
} else } else
if (drm_pci_device_is_pcie(dev) && if (0 && drm_pci_device_is_pcie(dev) &&
dev_priv->chipset > 0x40 && dev_priv->chipset != 0x45) { dev_priv->chipset > 0x40 && dev_priv->chipset != 0x45) {
if (nv44_graph_class(dev)) { if (nv44_graph_class(dev)) {
dev_priv->gart_info.func = &nv44_sgdma_backend; dev_priv->gart_info.func = &nv44_sgdma_backend;
......
...@@ -371,6 +371,7 @@ static int nouveau_init_engine_ptrs(struct drm_device *dev) ...@@ -371,6 +371,7 @@ static int nouveau_init_engine_ptrs(struct drm_device *dev)
engine->vram.flags_valid = nv50_vram_flags_valid; engine->vram.flags_valid = nv50_vram_flags_valid;
break; break;
case 0xC0: case 0xC0:
case 0xD0:
engine->instmem.init = nvc0_instmem_init; engine->instmem.init = nvc0_instmem_init;
engine->instmem.takedown = nvc0_instmem_takedown; engine->instmem.takedown = nvc0_instmem_takedown;
engine->instmem.suspend = nvc0_instmem_suspend; engine->instmem.suspend = nvc0_instmem_suspend;
...@@ -563,68 +564,68 @@ nouveau_card_init(struct drm_device *dev) ...@@ -563,68 +564,68 @@ nouveau_card_init(struct drm_device *dev)
if (ret) if (ret)
goto out_timer; goto out_timer;
switch (dev_priv->card_type) { if (!nouveau_noaccel) {
case NV_04: switch (dev_priv->card_type) {
nv04_graph_create(dev); case NV_04:
break; nv04_graph_create(dev);
case NV_10: break;
nv10_graph_create(dev); case NV_10:
break; nv10_graph_create(dev);
case NV_20: break;
case NV_30: case NV_20:
nv20_graph_create(dev); case NV_30:
break; nv20_graph_create(dev);
case NV_40: break;
nv40_graph_create(dev); case NV_40:
break; nv40_graph_create(dev);
case NV_50: break;
nv50_graph_create(dev); case NV_50:
break; nv50_graph_create(dev);
case NV_C0: break;
nvc0_graph_create(dev); case NV_C0:
break; nvc0_graph_create(dev);
default: break;
break; default:
} break;
}
switch (dev_priv->chipset) {
case 0x84:
case 0x86:
case 0x92:
case 0x94:
case 0x96:
case 0xa0:
nv84_crypt_create(dev);
break;
}
switch (dev_priv->card_type) {
case NV_50:
switch (dev_priv->chipset) { switch (dev_priv->chipset) {
case 0xa3: case 0x84:
case 0xa5: case 0x86:
case 0xa8: case 0x92:
case 0xaf: case 0x94:
nva3_copy_create(dev); case 0x96:
case 0xa0:
nv84_crypt_create(dev);
break; break;
} }
break;
case NV_C0:
nvc0_copy_create(dev, 0);
nvc0_copy_create(dev, 1);
break;
default:
break;
}
if (dev_priv->card_type == NV_40) switch (dev_priv->card_type) {
nv40_mpeg_create(dev); case NV_50:
else switch (dev_priv->chipset) {
if (dev_priv->card_type == NV_50 && case 0xa3:
(dev_priv->chipset < 0x98 || dev_priv->chipset == 0xa0)) case 0xa5:
nv50_mpeg_create(dev); case 0xa8:
case 0xaf:
nva3_copy_create(dev);
break;
}
break;
case NV_C0:
nvc0_copy_create(dev, 0);
nvc0_copy_create(dev, 1);
break;
default:
break;
}
if (dev_priv->card_type == NV_40)
nv40_mpeg_create(dev);
else
if (dev_priv->card_type == NV_50 &&
(dev_priv->chipset < 0x98 || dev_priv->chipset == 0xa0))
nv50_mpeg_create(dev);
if (!nouveau_noaccel) {
for (e = 0; e < NVOBJ_ENGINE_NR; e++) { for (e = 0; e < NVOBJ_ENGINE_NR; e++) {
if (dev_priv->eng[e]) { if (dev_priv->eng[e]) {
ret = dev_priv->eng[e]->init(dev, e); ret = dev_priv->eng[e]->init(dev, e);
...@@ -922,6 +923,7 @@ int nouveau_load(struct drm_device *dev, unsigned long flags) ...@@ -922,6 +923,7 @@ int nouveau_load(struct drm_device *dev, unsigned long flags)
dev_priv->card_type = NV_50; dev_priv->card_type = NV_50;
break; break;
case 0xc0: case 0xc0:
case 0xd0:
dev_priv->card_type = NV_C0; dev_priv->card_type = NV_C0;
break; break;
default: default:
......
...@@ -58,6 +58,7 @@ nouveau_vm_map_at(struct nouveau_vma *vma, u64 delta, struct nouveau_mem *node) ...@@ -58,6 +58,7 @@ nouveau_vm_map_at(struct nouveau_vma *vma, u64 delta, struct nouveau_mem *node)
num -= len; num -= len;
pte += len; pte += len;
if (unlikely(end >= max)) { if (unlikely(end >= max)) {
phys += len << (bits + 12);
pde++; pde++;
pte = 0; pte = 0;
} }
......
...@@ -376,7 +376,10 @@ nv_crtc_mode_set_vga(struct drm_crtc *crtc, struct drm_display_mode *mode) ...@@ -376,7 +376,10 @@ nv_crtc_mode_set_vga(struct drm_crtc *crtc, struct drm_display_mode *mode)
*/ */
/* framebuffer can be larger than crtc scanout area. */ /* framebuffer can be larger than crtc scanout area. */
regp->CRTC[NV_CIO_CRE_RPC0_INDEX] = XLATE(fb->pitch / 8, 8, NV_CIO_CRE_RPC0_OFFSET_10_8); regp->CRTC[NV_CIO_CRE_RPC0_INDEX] =
XLATE(fb->pitch / 8, 8, NV_CIO_CRE_RPC0_OFFSET_10_8);
regp->CRTC[NV_CIO_CRE_42] =
XLATE(fb->pitch / 8, 11, NV_CIO_CRE_42_OFFSET_11);
regp->CRTC[NV_CIO_CRE_RPC1_INDEX] = mode->crtc_hdisplay < 1280 ? regp->CRTC[NV_CIO_CRE_RPC1_INDEX] = mode->crtc_hdisplay < 1280 ?
MASK(NV_CIO_CRE_RPC1_LARGE) : 0x00; MASK(NV_CIO_CRE_RPC1_LARGE) : 0x00;
regp->CRTC[NV_CIO_CRE_LSR_INDEX] = XLATE(horizBlankEnd, 6, NV_CIO_CRE_LSR_HBE_6) | regp->CRTC[NV_CIO_CRE_LSR_INDEX] = XLATE(horizBlankEnd, 6, NV_CIO_CRE_LSR_HBE_6) |
...@@ -824,8 +827,11 @@ nv04_crtc_do_mode_set_base(struct drm_crtc *crtc, ...@@ -824,8 +827,11 @@ nv04_crtc_do_mode_set_base(struct drm_crtc *crtc,
regp->CRTC[NV_CIO_CR_OFFSET_INDEX] = drm_fb->pitch >> 3; regp->CRTC[NV_CIO_CR_OFFSET_INDEX] = drm_fb->pitch >> 3;
regp->CRTC[NV_CIO_CRE_RPC0_INDEX] = regp->CRTC[NV_CIO_CRE_RPC0_INDEX] =
XLATE(drm_fb->pitch >> 3, 8, NV_CIO_CRE_RPC0_OFFSET_10_8); XLATE(drm_fb->pitch >> 3, 8, NV_CIO_CRE_RPC0_OFFSET_10_8);
regp->CRTC[NV_CIO_CRE_42] =
XLATE(drm_fb->pitch / 8, 11, NV_CIO_CRE_42_OFFSET_11);
crtc_wr_cio_state(crtc, regp, NV_CIO_CRE_RPC0_INDEX); crtc_wr_cio_state(crtc, regp, NV_CIO_CRE_RPC0_INDEX);
crtc_wr_cio_state(crtc, regp, NV_CIO_CR_OFFSET_INDEX); crtc_wr_cio_state(crtc, regp, NV_CIO_CR_OFFSET_INDEX);
crtc_wr_cio_state(crtc, regp, NV_CIO_CRE_42);
/* Update the framebuffer location. */ /* Update the framebuffer location. */
regp->fb_start = nv_crtc->fb.offset & ~3; regp->fb_start = nv_crtc->fb.offset & ~3;
......
...@@ -277,6 +277,8 @@ ...@@ -277,6 +277,8 @@
# define NV_CIO_CRE_EBR_VDE_11 2:2 # define NV_CIO_CRE_EBR_VDE_11 2:2
# define NV_CIO_CRE_EBR_VRS_11 4:4 # define NV_CIO_CRE_EBR_VRS_11 4:4
# define NV_CIO_CRE_EBR_VBS_11 6:6 # define NV_CIO_CRE_EBR_VBS_11 6:6
# define NV_CIO_CRE_42 0x42
# define NV_CIO_CRE_42_OFFSET_11 6:6
# define NV_CIO_CRE_43 0x43 # define NV_CIO_CRE_43 0x43
# define NV_CIO_CRE_44 0x44 /* head control */ # define NV_CIO_CRE_44 0x44 /* head control */
# define NV_CIO_CRE_CSB 0x45 /* colour saturation boost */ # define NV_CIO_CRE_CSB 0x45 /* colour saturation boost */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment