summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2013-08-21drm/dispnv04: fix framebuffer pin refcountinglinux-3.11Ben Skeggs3-15/+47
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2013-08-21mc: fix race condition between constructor and request_irq()Ben Skeggs7-14/+14
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2013-08-21nouveau: fix reclocking on nv40Pali Rohár1-1/+1
In commit 77145f1cbdf8d28b46ff8070ca749bad821e0774 was introduced error which cause that reclocking on nv40 not working anymore. There is missing assigment of return value from pll_calc to ret. Signed-off-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Martin Peres <martin.peres@labri.fr> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2013-08-21ltcg: fix allocating memory as freeMaarten Lankhorst2-1/+5
Allocating type=0 marks the memory as free. This allows the ltcg memory to be allocated twice. Add a BUG_ON in core/mm.c to prevent this ever happening again. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2013-08-21ltcg: fix ltcg memory initialization after suspendMaarten Lankhorst1-9/+23
Some registers were not initialized in init, this causes them to be uninitialized after suspend. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2013-08-21fb: fix null derefs in nv49 and nv4e initIlia Mirkin2-8/+8
Commit dceef5d87 (drm/nouveau/fb: initialise vram controller as pfb sub-object) moved some code around and introduced these null derefs. pfb->ram is set to the new ram object outside of this ctor. Reported-by: Ronald Uitermark <ronald645@gmail.com> Tested-by: Ronald Uitermark <ronald645@gmail.com> Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2013-07-30drm: fix semaphore dmabuf objMaarten Lankhorst2-6/+10
Fixes some dmabuf object errors on nv50 chipset and below. Cc: stable@vger.kernel.org [3.7+] Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2013-07-30vm: make vm refcount into a krefBen Skeggs3-18/+22
Never used to be required, but a recent change made it necessary. Reported-by: Maarten Lankhorst <maarten.lankhorst@canonical.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2013-07-30mpeg/nv31: don't recognize nv3x cards as having nv44 graph classIlia Mirkin1-1/+4
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2013-07-30mpeg/nv40: write magic value to channel object to make it workIlia Mirkin1-0/+1
Looks like the rewrite in commit ebb945a94b ("drm/nouveau: port all engines to new engine module format") missed that one little detail. Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2013-07-30drm: fix size check for cards without vmMaarten Lankhorst1-1/+6
Op 24-07-13 17:55, Dan Carpenter schreef: > Hello Maarten Lankhorst, > > This is a semi-automatic email about new static checker warnings. > > The patch 0108bc808107: "drm/nouveau: do not allow negative sizes for > now" from Jul 7, 2013, leads to the following Smatch complaint: > > drivers/gpu/drm/nouveau/nouveau_bo.c:222 nouveau_bo_new() > warn: variable dereferenced before check 'drm->client.base.vm' (see line 201) > > drivers/gpu/drm/nouveau/nouveau_bo.c > 200 int type = ttm_bo_type_device; > 201 int max_size = INT_MAX & ~((1 << drm->client.base.vm->vmm->lpg_shift) - 1); > ^^^^^^^^^^^^^^^^^^^ > New dereference. > > 202 > 203 if (size <= 0 || size > max_size) { > 204 nv_warn(drm, "skipped size %x\n", (u32)size); > 205 return -EINVAL; > 206 } > 207 > 208 if (sg) > 209 type = ttm_bo_type_sg; > 210 > 211 nvbo = kzalloc(sizeof(struct nouveau_bo), GFP_KERNEL); > 212 if (!nvbo) > 213 return -ENOMEM; > 214 INIT_LIST_HEAD(&nvbo->head); > 215 INIT_LIST_HEAD(&nvbo->entry); > 216 INIT_LIST_HEAD(&nvbo->vma_list); > 217 nvbo->tile_mode = tile_mode; > 218 nvbo->tile_flags = tile_flags; > 219 nvbo->bo.bdev = &drm->ttm.bdev; > 220 > 221 nvbo->page_shift = 12; > 222 if (drm->client.base.vm) { > ^^^^^^^^^^^^^^^^^^^ > Old check. > > 223 if (!(flags & TTM_PL_FLAG_TT) && size > 256 * 1024) > 224 nvbo->page_shift = drm->client.base.vm->vmm->lpg_shift; > > regards, > dan carpenter 8<----- Commit 0108bc808107: "drm/nouveau: do not allow negative sizes for now" broke older nvidia gpu's that lack a vm. Add an explicit check to handle this. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Reported-by: konrad wilk <konrad.wilk@oracle.com> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2013-07-30disp/nv50-: remove dcb_outp_match call, and related variablesEmil Velikov1-8/+0
Unused and irrelavant since the code move of DP training/linkcontrol interrupt Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2013-07-30disp/nva3-: fix hda eld writing, needs to be paddedIlia Mirkin2-0/+4
Commits 0a9e2b959 (drm/nvd0/disp: move HDA codec setup to core) and a4feaf4ea (drm/nva3/disp: move hda codec handling to core) moved code around but neglected to fill data up to 0x60 as before. This caused /proc/asound/cardN/eld#3.0 to show eld_valid as 0. With this patch, that file is again populated with the correct data. See https://bugs.freedesktop.org/show_bug.cgi?id=67051 Reported-and-tested-by: Alex <alupu01@gmail.com> Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2013-07-30mpeg/nv31: fix mpeg engine initializationIlia Mirkin1-2/+2
object->engine is null, which leads to a null deref down the line Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2013-07-30mc/nv50: include vp in the fb error reporting maskIlia Mirkin1-1/+1
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2013-07-30drm: fix null pointer dereference in poll_changedMaarten Lankhorst1-1/+2
Fixes vgaswitcheroo on a card without display. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2013-07-30gpio/nv50: post-nv92 cards have 32 interrupt linesEmil Velikov1-5/+5
Since the original merge of nouveau to upstream kernel, we were assuming that nv90 (and later) cards have 32 lines. Based on mmio traces of the binary driver, as well as PBUS error messages during read/write of the e070/e074 registers, we can conclude that nv92 has only 16 lines whereas nv94 (and later) cards have 32. Reported-and-tested-by: David M. Lloyd <david.lloyd@redhat.com> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Cc: dri-devel@lists.freedesktop.org Cc: Ben Skeggs <bskeggs@redhat.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2013-07-30fb/nvc0: take lock in nvc0_ram_put()Roy Spliet3-12/+26
Kernel panic caused by list corruption in ltcg seems to indicate a concurrency issue. Take mutex of pfb like nv50_ram_put() to eliminate concurrency. V2: Separate critical section into separate function, avoid taking the lock twice on NVC0 Signed-off-by: Roy Spliet <r.spliet@student.tudelft.nl> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2013-07-30core: xtensa firmware size needs to be 0x40000 no matter whatIlia Mirkin1-1/+7
The current logic is wrong since we send fw->size >> 8 to the card. Rounding the size up by 0x100 and 0x1000 didn't seem to help, the card still hung, so go back to what the blob does -- 0x40000. Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2013-07-29drm: do not allow negative sizes for nowMaarten Lankhorst1-0/+6
The API allows up to 64-bits allocations, but size is handled as int inside nouveau almost everywhere. Until this is fixed it's better to prevent negative sizes. The 256 kB before INT_MAX is paranoia, because of the large page aligning below that could flip it above INT_MAX. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2013-07-29core: add falcon interrupt handlerMaarten Lankhorst7-0/+26
This prevents 100% cpu usage on fermi cards when the exit interrupt from the secret scrubber is not acked. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2013-07-29drm: use dedicated channel for async moves on GT/GF chipsets.Ben Skeggs2-3/+15
The moves themselves were generally async to graphics previously, with the exception that if the "main" channel is used to synchronise a page flip at the same time, it can end up blocked for a noticable amount of time for large buffer moves. Not really critical, and there's better ways of handling this, but they are all rather invasive, so this is fine for now. Based on a patch by Maarten Lankhorst addressing the same issue. Reported-by: Maarten Lankhorst <maarten.lankhorst@canonical.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Acked-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
2013-07-29drm: bump fence timeout to 15 secondsMaarten Lankhorst1-1/+1
calim didn't like 150 seconds timeout, so lower the timeout for him. 15 seconds should still be plenty. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2013-07-29drm: do not unpin in nouveau_gem_object_delMaarten Lankhorst2-8/+5
This should no longer be required, and is harmful for framebuffer pinning. Also add a warning if unpin causes the pin count to drop below 0. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2013-07-29drm: fix pin refcnt leaksBen Skeggs1-11/+35
Weren't critical previously, the buffers would go away anyway. But with recent changes to core drm/ttm lockdep will get pissed off now, so let's fix it. Reported-by: Maarten Lankhorst <maarten.lankhorst@canonical.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Acked-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
2013-07-29drm: fix some error-path leaks in fbcon handling codeMaarten Lankhorst2-6/+11
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2013-07-29drm: fix locking issues in page flipping pathsBen Skeggs3-36/+22
b580c9e2b7ba5030a795aa2fb73b796523d65a78 introduced additional problems while trying to solve issues that became apparent while porting to the new reservation stuff. The major problem was that the the previously mentioned patch took the client mutex earlier than previously, but the pinning of new_bo can can potentially cause a buffer move, which would result in attempting to acquire the same mutex again. This commit attempts to fix that "fix". Thanks to Maarten for the tips on keeping lockdep happy and cooking :) Reported-by: Maarten Lankhorst <maarten.lankhorst@canonical.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Acked-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
2013-07-22v3.11-rc1Ben Skeggs11-97/+110
2013-07-08gr/nvc0: fix gpc firmware regressionMaarten Lankhorst2-20/+23
"drm/nve0-/gr: some new gpc registers can have multiple copies" 5ee86c4190f9e caused a regression for nvc0, because the bit indicating last transfer has occured was no longer set, resulting in random system lockups. Reported-by: Ronald Uitermark <ronald645@gmail.com> Tested-by: Ronald Uitermark <ronald645@gmail.com> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2013-07-08drm: fix minor thinko causing bo moves to not be async on keplerBen Skeggs2-1/+3
Reported-by: Maarten Lankhorst <maarten.lankhorst@canonical.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2013-07-05disp/nva3: Fix HDMI audio regressionIlia Mirkin1-0/+4
This is the nva3 counterpart to commit beba44b17 (drm/nv84/disp: Fix HDMI audio regression). The regression happened as a result of refactoring in commit 8e9e3d2de (drm/nv84/disp: move hdmi control into core). Reported-and-tested-by: Max Baldwin <archerseven@gmail.com> Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2013-07-05nv50-/disp: Use output specific mask in interruptEmil Velikov1-1/+5
The commit commit 476e84e126171d809f9c0b5d97137f5055f95ca8 Author: Ben Skeggs <bskeggs@redhat.com> Date: Mon Feb 11 09:24:23 2013 +1000 drm/nv50-/disp: initial supervisor support for off-chip encoders changed the write mask in one of the interrupt functions for on-chip encoders, causing a regression in certain VGA dual-head setups. This commit reintroduces the mask thus resolving the regression Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=66129 Reported-and-Tested-by: Yves-Alexis <corsac@debian.org> Cc: stable@vger.kernel.org [3.9+] CC: Ben Skeggs <bskeggs@redhat.com> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2013-07-05gr/nvc0-: remove some more of the hardcoded register writesBen Skeggs3-28/+6
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2013-07-05gr/nvc0-: factor out yet more unknown magic into versioned functionsBen Skeggs9-14/+42
NVC1/NVD9 are the only chipsets that should have anything different happen on them after this. We previously weren't doing these register modifications, and NVIDIA do. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2013-07-05devinit/nvd7: use fermi class, not teslaBen Skeggs1-1/+1
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2013-07-05gr/nvf0-: ctxsw scratch reg count got bumped to 16Ben Skeggs12-3034/+3303
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2013-07-05gr/nvc0-: remove hardcoding of UNK count/mask in GPCCS ucodeBen Skeggs4-95/+129
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2013-07-05gr/nvf0: build cs ucode for GK110Ben Skeggs11-1/+1438
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2013-07-05gr/nvc0-: extend one of the magic calculations for >4 GPCsBen Skeggs1-6/+11
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2013-07-05gr/nvf0: fix ddx shaders locking up on meBen Skeggs3-3/+54
This can be generalised and used on GK104 (probably even GF117), but lets just make it work for now. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2013-07-05devinit/nvc0: minor typoBen Skeggs1-1/+1
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2013-07-05nvf0/gr: enable support, if external cs ucode is availableBen Skeggs2-1/+6
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2013-07-05gr/nvf0: magic sequence that makes PGRAPH come out of hidingBen Skeggs2-4/+48
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2013-07-05ce/nvf0: enable supportBen Skeggs1-1/+1
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2013-07-05fifo/nvf0: enable supportBen Skeggs2-2/+4
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2013-07-05gr/nvd7: initial supportMaarten Lankhorst29-20/+1940
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2013-07-04gr/nvc0-: generate cs register lists from grctx dataBen Skeggs11-2073/+1152
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2013-07-04gr/nvc0-: tpc regs a subset of gpc, add separate list for gpc/unk regsBen Skeggs8-34/+52
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2013-07-04gr/nve0-: some new gpc registers can have multiple copiesBen Skeggs4-180/+227
GK110 exposes more than one, and needs to be dealt with in the ctxsw ucode just like the TPC sets are. Broadcast is at +0xe00. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2013-07-04gr/nvc0-: pull out a group of separately context-switched gpc regsBen Skeggs6-96/+68
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>