cascardo/linux.git
9 years agodrm/nouveau/nouveau: Do not BUG_ON(!spin_is_locked()) on UP
Bruno Prémont [Sun, 21 Dec 2014 16:43:31 +0000 (17:43 +0100)]
drm/nouveau/nouveau: Do not BUG_ON(!spin_is_locked()) on UP

On !SMP systems spinlocks do not exist. Thus checking of they
are active will always fail.

Use
  assert_spin_locked(lock);
instead of
  BUG_ON(!spin_is_locked(lock));
to not BUG() on all UP systems.

Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nv4c/mc: disable msi
Ilia Mirkin [Tue, 16 Dec 2014 18:55:38 +0000 (13:55 -0500)]
drm/nv4c/mc: disable msi

Several users have, over time, reported issues with MSI on these IGPs.
They're old, rarely available, and MSI doesn't provide such huge
advantages on them. Just disable.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=87361
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74492
Fixes: fa8c9ac72fe ("drm/nv4c/mc: nv4x igp's have a different msi rearm register")
Cc: stable@vger.kernel.org
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau/fb/ram/mcp77: enable NISO poller
Pierre Moreau [Mon, 15 Dec 2014 23:47:40 +0000 (09:47 +1000)]
drm/nouveau/fb/ram/mcp77: enable NISO poller

Signed-off-by: Pierre Moreau <pierre.morrow@free.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau/fb/ram/mcp77: use carveout reg to determine size
Ben Skeggs [Thu, 11 Dec 2014 03:21:24 +0000 (13:21 +1000)]
drm/nouveau/fb/ram/mcp77: use carveout reg to determine size

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau/fb/ram/mcp77: subclass nouveau_ram
Ben Skeggs [Thu, 11 Dec 2014 03:19:31 +0000 (13:19 +1000)]
drm/nouveau/fb/ram/mcp77: subclass nouveau_ram

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau: wake up the card if necessary during gem callbacks
Ben Skeggs [Thu, 11 Dec 2014 00:05:00 +0000 (10:05 +1000)]
drm/nouveau: wake up the card if necessary during gem callbacks

The failure paths if we fail to wake the card are less than desirable,
but there's not really a graceful way to handle this case currently.

I'll keep this situation in mind when I get to fixing other vm-related
issues.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau/device: Add support for GK208B, resolves bug 86935
Sven Köhler [Wed, 3 Dec 2014 14:15:54 +0000 (14:15 +0000)]
drm/nouveau/device: Add support for GK208B, resolves bug 86935

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau: fix missing return statement in nouveau_ttm_tt_unpopulate
Alexandre Courbot [Wed, 10 Dec 2014 18:09:10 +0000 (03:09 +0900)]
drm/nouveau: fix missing return statement in nouveau_ttm_tt_unpopulate

nouveau_ttm_tt_unpopulate() is supposed to return right after calling
ttm_dma_unpopulate() in the case of a coherent buffer. The return
statement was omitted, leading to the pages being unmapped twice. Fix
this.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau/bios: fix oops on pre-nv50 chipsets
Ben Skeggs [Wed, 3 Dec 2014 06:16:52 +0000 (16:16 +1000)]
drm/nouveau/bios: fix oops on pre-nv50 chipsets

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nv50/kms: drop requirement that framebuffer bos be contig up-front
Ben Skeggs [Mon, 10 Nov 2014 02:36:44 +0000 (12:36 +1000)]
drm/nv50/kms: drop requirement that framebuffer bos be contig up-front

We'll move them at pin() time if necessary.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nv50/kms: directly use cursor image from userspace buffer
Ben Skeggs [Mon, 10 Nov 2014 05:52:02 +0000 (15:52 +1000)]
drm/nv50/kms: directly use cursor image from userspace buffer

Preparation for transition to planes, which use framebuffers for the
cursor image.  We've always done copies from the userspace buffer up
until now for legacy reasons, there's no good reason to do so on the
chipsets this code covers.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau/kms: when pinning display-related buffers, force contig vram
Ben Skeggs [Mon, 10 Nov 2014 02:35:06 +0000 (12:35 +1000)]
drm/nouveau/kms: when pinning display-related buffers, force contig vram

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau: teach nouveau_bo_pin() how to force a contig vram allocation
Ben Skeggs [Mon, 10 Nov 2014 01:24:27 +0000 (11:24 +1000)]
drm/nouveau: teach nouveau_bo_pin() how to force a contig vram allocation

We have the ability to move buffers around in the kernel if necessary,
and should probably use it rather than failing if userspace passes us
a non-contig buffer for a plane.

The NOUVEAU_GEM_TILE_NONCONTIG flag from userspace will become a mere
initial placement hint once all the relevant paths have been updated.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau/volt: add support for GK20A
Vince Hsu [Tue, 2 Dec 2014 04:50:35 +0000 (12:50 +0800)]
drm/nouveau/volt: add support for GK20A

The voltage value are calculated by the hardware characterized
result.

Signed-off-by: Vince Hsu <vinceh@nvidia.com>
Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
Acked-by: Martin Peres <martin.peres@free.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau/platform: add GPU speedo information to nouveau platform
Vince Hsu [Tue, 2 Dec 2014 04:50:34 +0000 (12:50 +0800)]
drm/nouveau/platform: add GPU speedo information to nouveau platform

For GK20A we need the GPU speedo value to calculate voltage levels.

Signed-off-by: Vince Hsu <vinceh@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau/volt: allow non-bios voltage scaling
Vince Hsu [Tue, 2 Dec 2014 04:50:33 +0000 (12:50 +0800)]
drm/nouveau/volt: allow non-bios voltage scaling

Move the vbios parsing out of init() and call it conditionally if the
platform has a vbios. Non-vbios platforms can use the ctor() to init the
data structures.

Signed-off-by: Vince Hsu <vinceh@nvidia.com>
Acked-by: Alexandre Courbot <acourbot@nvidia.com>
Acked-by: Martin Peres <martin.peres@free.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/gf100-/gr: return non-fatal error code when fw not present
Ben Skeggs [Tue, 25 Nov 2014 23:03:15 +0000 (09:03 +1000)]
drm/gf100-/gr: return non-fatal error code when fw not present

This allows the module to load without acceleration.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau/devinit: bump priv ring timeouts before executing scripts
Ben Skeggs [Tue, 25 Nov 2014 22:51:10 +0000 (08:51 +1000)]
drm/nouveau/devinit: bump priv ring timeouts before executing scripts

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau/bios: translate ramcfg strap through M0203
Ben Skeggs [Tue, 4 Nov 2014 05:13:30 +0000 (15:13 +1000)]
drm/nouveau/bios: translate ramcfg strap through M0203

A machine has been spotted where the ramcfg strap is "8", and the ramcfg
xlat table goes 0-7,0-7, resulting in us selecting config 0 for memory
items.  On this particular system, config "8" is available and supposed
to be used.  It appears that starting from GT21x (where Mv2 appears),
we're supposed to use the value in this table instead.

One concern here is that not all the places we currently use ramcfg xlat
are supposed to be treated the same now.  The strap xlat table wasn't
removed from the vbios either, presumably for some kind of good reason.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau/fb: make use of M0203 routines for ram type determination
Ben Skeggs [Tue, 4 Nov 2014 03:04:35 +0000 (13:04 +1000)]
drm/nouveau/fb: make use of M0203 routines for ram type determination

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau/bios: add parsing of BIT M(v2) +0x03 table
Ben Skeggs [Tue, 4 Nov 2014 02:06:25 +0000 (12:06 +1000)]
drm/nouveau/bios: add parsing of BIT M(v2) +0x03 table

We only support one kind of matching here (ramcfg strap), but it appears
alternate methods are possible.  I wrote a tool to scan our vbios repo
for other types, but did not see any used.  Hopefully this means there
aren't any in the wild that will now break.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau/core: allow vbios parsing without knowing chipset type
Ben Skeggs [Tue, 18 Nov 2014 00:51:19 +0000 (10:51 +1000)]
drm/nouveau/core: allow vbios parsing without knowing chipset type

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau/lib: add null backend
Ben Skeggs [Tue, 18 Nov 2014 00:36:59 +0000 (10:36 +1000)]
drm/nouveau/lib: add null backend

For the moment, just used to speed up vbios-only testing.  Have some
ideas for extending in the future.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau/device: store revision
Ben Skeggs [Mon, 17 Nov 2014 12:56:37 +0000 (22:56 +1000)]
drm/nouveau/device: store revision

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau/core: add some forgotten subdevs to disable mask
Ben Skeggs [Mon, 17 Nov 2014 12:52:11 +0000 (22:52 +1000)]
drm/nouveau/core: add some forgotten subdevs to disable mask

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/gk20a/clk: fix max VCO value
Alexandre Courbot [Thu, 13 Nov 2014 09:07:27 +0000 (18:07 +0900)]
drm/gk20a/clk: fix max VCO value

For some reason max_vco was set to a lower value that it can support,
which prevented some clock states to be applied. Fix this by setting it
to the same value as downstream.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau: we need pin_refcnt for nouveau_bo_placement_set()
Ben Skeggs [Mon, 10 Nov 2014 01:12:17 +0000 (11:12 +1000)]
drm/nouveau: we need pin_refcnt for nouveau_bo_placement_set()

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nv50-/kms: add some evo tracing ability for debugging
Ben Skeggs [Mon, 3 Nov 2014 06:43:59 +0000 (16:43 +1000)]
drm/nv50-/kms: add some evo tracing ability for debugging

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nv50/kms: use sclass() instead of trial-and-error
Ben Skeggs [Mon, 3 Nov 2014 05:01:33 +0000 (15:01 +1000)]
drm/nv50/kms: use sclass() instead of trial-and-error

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nv50/kms: remove a couple of cursor-related stub functions
Ben Skeggs [Mon, 3 Nov 2014 04:33:01 +0000 (14:33 +1000)]
drm/nv50/kms: remove a couple of cursor-related stub functions

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau: fix pin refcnt leak in failure path
Ben Skeggs [Thu, 6 Nov 2014 04:34:31 +0000 (14:34 +1000)]
drm/nouveau: fix pin refcnt leak in failure path

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau: synchronize BOs when required
Alexandre Courbot [Mon, 27 Oct 2014 09:49:19 +0000 (18:49 +0900)]
drm/nouveau: synchronize BOs when required

On architectures for which access to GPU memory is non-coherent,
caches need to be flushed and invalidated explicitly when BO control
changes between CPU and GPU.

This patch adds buffer synchronization functions which invokes the
correct API (PCI or DMA) to ensure synchronization is effective.

Based on the TTM DMA cache helper patches by Lucas Stach.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau: allocate GPFIFOs and fences coherently
Alexandre Courbot [Mon, 27 Oct 2014 09:49:18 +0000 (18:49 +0900)]
drm/nouveau: allocate GPFIFOs and fences coherently

Specify TTM_PL_FLAG_UNCACHED when allocating GPFIFOs and fences to
allow them to be safely accessed by the kernel without being synced
on non-coherent architectures.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau: implement explicitly coherent BOs
Alexandre Courbot [Mon, 27 Oct 2014 09:49:17 +0000 (18:49 +0900)]
drm/nouveau: implement explicitly coherent BOs

Allow nouveau_bo_new() to recognize the TTM_PL_FLAG_UNCACHED flag, which
means that we want the allocated BO to be perfectly coherent between the
CPU and GPU. This is useful on non-coherent architectures for which we
do not want to manually sync some rarely-accessed buffers: typically,
fences and pushbuffers.

A TTM BO allocated with the TTM_PL_FLAG_UNCACHED on a non-coherent
architecture will be populated using the DMA API, and accesses to it
performed using the coherent mapping performed by dma_alloc_coherent().

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau: introduce nv_device_is_cpu_coherent()
Alexandre Courbot [Mon, 27 Oct 2014 09:49:16 +0000 (18:49 +0900)]
drm/nouveau: introduce nv_device_is_cpu_coherent()

Add a function allowing us to know whether a device is CPU-coherent,
i.e. accesses performed by the CPU on GPU-mapped buffers will
be immediately visible on the GPU side and vice-versa.

For now, a device is considered to be coherent if it uses the PCI bus on
a non-ARM architecture.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau: warn when moving a pinned object
Alexandre Courbot [Mon, 27 Oct 2014 09:11:52 +0000 (18:11 +0900)]
drm/nouveau: warn when moving a pinned object

Pinned BOs are supposed to remain in their current location until
unpinned. Display a warning for the supposedly-erroneous case where we
are trying to move such objects.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau/disp: clear notify intr status when enabling, to prevent races
Ben Skeggs [Tue, 28 Oct 2014 01:21:44 +0000 (11:21 +1000)]
drm/nouveau/disp: clear notify intr status when enabling, to prevent races

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nv50-/disp: rename class members to match nvidia channel names
Ben Skeggs [Thu, 2 Oct 2014 05:25:25 +0000 (15:25 +1000)]
drm/nv50-/disp: rename class members to match nvidia channel names

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau/core: remove some dead code that got forgotten
Ben Skeggs [Tue, 21 Oct 2014 05:23:16 +0000 (15:23 +1000)]
drm/nouveau/core: remove some dead code that got forgotten

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau/pwr/fuc: Fix thinko in nouveau_memx_wait()
Roy Spliet [Thu, 2 Oct 2014 16:01:58 +0000 (18:01 +0200)]
drm/nouveau/pwr/fuc: Fix thinko in nouveau_memx_wait()

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nva3/clock: Allow user reclocking
Roy Spliet [Thu, 2 Oct 2014 16:01:57 +0000 (18:01 +0200)]
drm/nva3/clock: Allow user reclocking

Signed-off-by: Roy Spliet <rspliet@eclipso.eu>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau/fb/ramnva3: Reclocking script for GDDR3
Roy Spliet [Thu, 2 Oct 2014 16:01:56 +0000 (18:01 +0200)]
drm/nouveau/fb/ramnva3: Reclocking script for GDDR3

Signed-off-by: Roy Spliet <rspliet@eclipso.eu>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau/fb/ramnva3: Reclocking script for DDR2
Roy Spliet [Thu, 2 Oct 2014 16:01:55 +0000 (18:01 +0200)]
drm/nouveau/fb/ramnva3: Reclocking script for DDR2

Signed-off-by: Roy Spliet <rspliet@eclipso.eu>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau/fb/ramnva3: Reclocking script for DDR3
Roy Spliet [Thu, 2 Oct 2014 16:01:54 +0000 (18:01 +0200)]
drm/nouveau/fb/ramnva3: Reclocking script for DDR3

Signed-off-by: Roy Spliet <rspliet@eclipso.eu>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau/fb/ramnva3: Ressurect timing calculation code
Roy Spliet [Thu, 2 Oct 2014 16:01:53 +0000 (18:01 +0200)]
drm/nouveau/fb/ramnva3: Ressurect timing calculation code

Signed-off-by: Roy Spliet <rspliet@eclipso.eu>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau/fb/ramnva3: Link training for DDR3
Roy Spliet [Thu, 2 Oct 2014 16:01:52 +0000 (18:01 +0200)]
drm/nouveau/fb/ramnva3: Link training for DDR3

V2: fix whitespace errors in memx.fuc

Signed-off-by: Roy Spliet <rspliet@eclipso.eu>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau/fb/gddr3: Generate MR values
Roy Spliet [Thu, 2 Oct 2014 16:01:51 +0000 (18:01 +0200)]
drm/nouveau/fb/gddr3: Generate MR values

Signed-off-by: Roy Spliet <rspliet@eclipso.eu>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau/bios/ramcfg: 10_02_40 -> DLLoff
Roy Spliet [Thu, 2 Oct 2014 16:01:50 +0000 (18:01 +0200)]
drm/nouveau/bios/ramcfg: 10_02_40 -> DLLoff

Signed-off-by: Roy Spliet <rspliet@eclipso.eu>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau: move the (far too many...) different s/r paths to the same place
Ben Skeggs [Thu, 2 Oct 2014 03:31:00 +0000 (13:31 +1000)]
drm/nouveau: move the (far too many...) different s/r paths to the same place

No code changes.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/gk104-/fifo: handle copy engine class errors
Ben Skeggs [Fri, 26 Sep 2014 05:33:24 +0000 (15:33 +1000)]
drm/gk104-/fifo: handle copy engine class errors

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau/bios: stop after NV+NPDS+ISBN image
Ben Skeggs [Thu, 25 Sep 2014 02:11:16 +0000 (12:11 +1000)]
drm/nouveau/bios: stop after NV+NPDS+ISBN image

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau/bios: add some more signatures as seen on my gtx660
Ben Skeggs [Thu, 25 Sep 2014 01:37:51 +0000 (11:37 +1000)]
drm/nouveau/bios: add some more signatures as seen on my gtx660

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau: add support for gm204
Ben Skeggs [Tue, 19 Aug 2014 00:23:47 +0000 (10:23 +1000)]
drm/nouveau: add support for gm204

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau/device: recognise GM204
Ben Skeggs [Mon, 18 Aug 2014 04:02:14 +0000 (14:02 +1000)]
drm/nouveau/device: recognise GM204

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/gm204/disp: some magic that fixes bringup of uninitialised outputs
Ben Skeggs [Thu, 28 Aug 2014 03:00:30 +0000 (13:00 +1000)]
drm/gm204/disp: some magic that fixes bringup of uninitialised outputs

Probably missing something here, doesn't make a lot of sense to write
or+link data into a register whose offset is calculated by the same
or+link info..

This is the all I've witnessed the binary driver and vbios doing so
far, so it'll do.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/gm204/disp: initial support
Ben Skeggs [Mon, 18 Aug 2014 22:45:27 +0000 (08:45 +1000)]
drm/gm204/disp: initial support

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/gf110-/disp: magic that might help some tmds issues
Ben Skeggs [Thu, 28 Aug 2014 01:52:12 +0000 (11:52 +1000)]
drm/gf110-/disp: magic that might help some tmds issues

The binary driver has been doing this since GF119, and we've somehow
gotten away with it.  But, TMDS that hasn't been initialised already
by the x86 vbios code is distorted without it on GM204.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau/bios: support for opcodes 0x47/0x48
Ben Skeggs [Wed, 20 Aug 2014 22:22:03 +0000 (08:22 +1000)]
drm/nouveau/bios: support for opcodes 0x47/0x48

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau/bios: add support for udisp 2.2
Ben Skeggs [Tue, 19 Aug 2014 00:58:39 +0000 (10:58 +1000)]
drm/nouveau/bios: add support for udisp 2.2

Not entirely sure why this got bumped at all yet.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau/bios: add support for dp 4.1
Ben Skeggs [Mon, 18 Aug 2014 22:38:12 +0000 (08:38 +1000)]
drm/nouveau/bios: add support for dp 4.1

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau/i2c: add support for DCB_I2C_PMGR port type
Ben Skeggs [Mon, 18 Aug 2014 22:25:40 +0000 (08:25 +1000)]
drm/nouveau/i2c: add support for DCB_I2C_PMGR port type

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau/bios: add support for ccb 4.1
Ben Skeggs [Mon, 18 Aug 2014 22:20:26 +0000 (08:20 +1000)]
drm/nouveau/bios: add support for ccb 4.1

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau/bios: add support for dcb 4.1
Ben Skeggs [Mon, 18 Aug 2014 04:09:00 +0000 (14:09 +1000)]
drm/nouveau/bios: add support for dcb 4.1

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/gm204/i2c: add aux channel driver
Ben Skeggs [Mon, 18 Aug 2014 21:26:08 +0000 (07:26 +1000)]
drm/gm204/i2c: add aux channel driver

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/gm204/i2c: add pad driver
Ben Skeggs [Mon, 18 Aug 2014 21:18:01 +0000 (07:18 +1000)]
drm/gm204/i2c: add pad driver

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau/i2c: segregate aux channel adapter indices from bit-banged i2c
Ben Skeggs [Wed, 24 Sep 2014 00:41:50 +0000 (10:41 +1000)]
drm/nouveau/i2c: segregate aux channel adapter indices from bit-banged i2c

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau/bios: store aux addr independently of i2c
Ben Skeggs [Mon, 18 Aug 2014 22:14:08 +0000 (08:14 +1000)]
drm/nouveau/bios: store aux addr independently of i2c

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nv50-/i2c: kill some unused struct members
Ben Skeggs [Mon, 18 Aug 2014 21:22:32 +0000 (07:22 +1000)]
drm/nv50-/i2c: kill some unused struct members

Left-over from before a rework a while back.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau/bios: log if auxch accesses fail, also return 0x00 from rd when it does
Ben Skeggs [Thu, 21 Aug 2014 00:39:01 +0000 (10:39 +1000)]
drm/nouveau/bios: log if auxch accesses fail, also return 0x00 from rd when it does

Logging at trace level, rather than as en error, as it seems conceivable
that failure could be normal under certain circumstances (new bios,
older sink that doesn't support a particular DPCD address)

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/gm204/devinit: initial implementation
Ben Skeggs [Tue, 23 Sep 2014 05:42:45 +0000 (15:42 +1000)]
drm/gm204/devinit: initial implementation

Starting from GM204, certain registers are no longer accessible by the host
(or unsigned PMU firmware).

This commit implements devinit on PMU, using a signed microcode image, and
devinit data, from the VBIOS.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau/devinit: allow impl to select its own cold-boot method
Ben Skeggs [Tue, 23 Sep 2014 05:39:26 +0000 (15:39 +1000)]
drm/nouveau/devinit: allow impl to select its own cold-boot method

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau/bios: add parsing of pmu image tables
Ben Skeggs [Mon, 22 Sep 2014 02:30:57 +0000 (12:30 +1000)]
drm/nouveau/bios: add parsing of pmu image tables

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau/bios: recognise nv-specific rom/pcir signatures
Ben Skeggs [Mon, 22 Sep 2014 01:28:21 +0000 (11:28 +1000)]
drm/nouveau/bios: recognise nv-specific rom/pcir signatures

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau/bios: use NPDE to locate images beyond those defined by PCIR
Ben Skeggs [Mon, 22 Sep 2014 01:21:57 +0000 (11:21 +1000)]
drm/nouveau/bios: use NPDE to locate images beyond those defined by PCIR

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau/bios: add NPDE parsing
Ben Skeggs [Sat, 20 Sep 2014 23:35:16 +0000 (09:35 +1000)]
drm/nouveau/bios: add NPDE parsing

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau/bios: fetch images beyond the first one in the rom
Ben Skeggs [Mon, 22 Sep 2014 01:08:01 +0000 (11:08 +1000)]
drm/nouveau/bios: fetch images beyond the first one in the rom

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau/bios: use size/type from pci data structure
Ben Skeggs [Mon, 22 Sep 2014 00:51:37 +0000 (10:51 +1000)]
drm/nouveau/bios: use size/type from pci data structure

The field at +0x2 is technically processor specific, though I don't know
that it's ever mattered in practice (yet).

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau/bios: add pci data structure parsing
Ben Skeggs [Sat, 20 Sep 2014 23:22:48 +0000 (09:22 +1000)]
drm/nouveau/bios: add pci data structure parsing

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau/bios: split out shadow methods
Ben Skeggs [Wed, 17 Sep 2014 23:24:10 +0000 (09:24 +1000)]
drm/nouveau/bios: split out shadow methods

We're about to need to be able to fetch additional chunks of data beyond
the primary bios image, which makes fetching a lot more complicated.

This splits out the verious shadowing routines to be nothing more than
very dumb "fetch this much data from this offset" routines, and leaves
the logic of what and how much to fetch in common code.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau/bios: fix thinko when parsing extdev table
Ben Skeggs [Mon, 18 Aug 2014 04:05:40 +0000 (14:05 +1000)]
drm/nouveau/bios: fix thinko when parsing extdev table

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau: a, somehow, missed hunk of "fix regression on agp boards"
Ben Skeggs [Mon, 20 Oct 2014 05:49:33 +0000 (15:49 +1000)]
drm/nouveau: a, somehow, missed hunk of "fix regression on agp boards"

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agosoc/tegra: fuse: export tegra_sku_info
Vince Hsu [Tue, 2 Dec 2014 04:50:32 +0000 (12:50 +0800)]
soc/tegra: fuse: export tegra_sku_info

Some Tegra drivers might be compiled as kernel modules, and they need the
fuse information for initialization. One example is the GK20A Nouveau
driver. It needs the GPU speedo value to calculate frequency-voltage
table. So export the tegra_sku_info.

Signed-off-by: Vince Hsu <vinceh@nvidia.com>
Acked-by: Alexandre Courbot <acourbot@nvidia.com>
Acked-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agoARM: shmobile: marzen: Remove DU platform device
Laurent Pinchart [Thu, 27 Nov 2014 15:19:13 +0000 (17:19 +0200)]
ARM: shmobile: marzen: Remove DU platform device

Platform data support has been removed from the DU driver, drop DU
support from the legacy Marzen board file. The multiplatform DT-based
Marzen support should be used instead.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Dave Airlie <airlied@redhat.com>
9 years agoARM: shmobile: lager: Remove DU platform device
Laurent Pinchart [Thu, 27 Nov 2014 15:19:12 +0000 (17:19 +0200)]
ARM: shmobile: lager: Remove DU platform device

Platform data support has been removed from the DU driver, drop DU
support from the legacy Lager board file. The multiplatform DT-based
Lager support should be used instead.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Dave Airlie <airlied@redhat.com>
9 years agoMerge branch 'drm/du/adv7511' of git://linuxtv.org/pinchartl/fbdev into drm-next
Dave Airlie [Wed, 26 Nov 2014 22:36:19 +0000 (08:36 +1000)]
Merge branch 'drm/du/adv7511' of git://linuxtv.org/pinchartl/fbdev into drm-next

The branch is based on a merge of drm-next and Simon's tags/renesas-dt-du-for-
v3.19 available at
git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git, the latter
having been pulled in the ARM SoC tree for v3.19.

Compared to v1, I've rebased my branch on a later drm-next, added Julia's
error return code fix, and documented the "drm: Decouple EDID parsing from I2C
adapter" patch properly.

v1:
Here's a pull request that adds HDMI support to the R-Car DU driver, including
a new slave encoder driver for the adv7511.

* 'drm/du/adv7511' of git://linuxtv.org/pinchartl/fbdev:
  drm: Add adv7511 encoder driver
  video: Add ADV751[13] DT bindings documentation
  drm: Decouple EDID parsing from I2C adapter
  drm: rcar-du: Add HDMI encoder and connector support
  drm: rcar-du: Replace drm_encoder with drm_slave_encoder
  drm: rcar-du: Replace direct DRM encoder access with cast macro
  drm: rcar-du: Pass the encoder DT node to rcar_du_encoder_init()
  drm: rcar-du: Remove platform data support
  drm: rcar-du: fix error return code
  ARM: shmobile: koelsch: Enable DU device in DT
  ARM: shmobile: koelsch-reference: Remove DU platform device
  ARM: shmobile: lager: Enable DU device in DT
  ARM: shmobile: lager-reference: Remove DU platform device
  ARM: shmobile: marzen: Enable DU device in DT
  ARM: shmobile: dts: Add common file for AA104XD12 panel
  ARM: shmobile: r8a7791: Add DU node to device tree
  ARM: shmobile: r8a7790: Add DU node to device tree
  ARM: shmobile: r8a7779: Add DU node to device tree
  ARM: shmobile: Remove FSF address from copyright headers

9 years agoMerge branch 'amdkfd-next-3.19' of git://people.freedesktop.org/~gabbayo/linux into...
Dave Airlie [Wed, 26 Nov 2014 22:28:22 +0000 (08:28 +1000)]
Merge branch 'amdkfd-next-3.19' of git://people.freedesktop.org/~gabbayo/linux into drm-next

- Fixes for sparse warnings
- Memory leak fixes
- Fix for deadlock between amdkfd and iommu

* 'amdkfd-next-3.19' of git://people.freedesktop.org/~gabbayo/linux:
  amdkfd: delete some dead code
  amdkfd: Fix memory leak of mqds on dqm fini
  amdkfd: fix an error handling bug in pqm_create_queue()
  amdkfd: fix some error handling in ioctl
  amdkfd: Remove DRM_AMDGPU dependency from Kconfig
  amdkfd: explicitely include io.h in kfd_doorbell.c
  amdkfd: Clear ctx cb before suspend
  amdkfd: Instead of using get function, use container_of
  amdkfd: use schedule() in sync_with_hw
  amdkfd: Fix memory leak on process deregistration
  amdkfd: add __iomem attribute to doorbell_ptr
  amdkfd: fence_wait_timeout() can be static
  amdkfd: is_occupied() can be static
  amdkfd: Fix sparse warnings in kfd_flat_memory.c
  amdkfd: pqm_get_kernel_queue() can be static
  amdkfd: test_kq() can be static
  amdkfd: Fix sparse warnings in kfd_topology.c
  amdkfd: Fix sparse warnings in kfd_chardev.c

9 years agodrm: Add adv7511 encoder driver
Lars-Peter Clausen [Mon, 5 Mar 2012 15:30:57 +0000 (16:30 +0100)]
drm: Add adv7511 encoder driver

This patch adds a driver for the Analog Devices adv7511. The adv7511 is
a standalone HDMI transmitter chip. It features a HDMI output interface
on one end and video and audio input interfaces on the other.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
9 years agovideo: Add ADV751[13] DT bindings documentation
Laurent Pinchart [Wed, 24 Sep 2014 19:09:46 +0000 (22:09 +0300)]
video: Add ADV751[13] DT bindings documentation

The ADV7511, ADV7511W and ADV7513 are HDMI audio and video transmitters
compatible with HDMI 1.4 and DVI 1.0. They're described in DT using the
OF graph bindings and a list of custom properties pertaining to the
input video bus configuration.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
9 years agodrm: Decouple EDID parsing from I2C adapter
Lars-Peter Clausen [Fri, 27 Apr 2012 09:11:58 +0000 (11:11 +0200)]
drm: Decouple EDID parsing from I2C adapter

The drm_get_edid() function performs direct I2C accesses to read EDID
blocks, assuming that the monitor DDC interface is directly connected to
the I2C bus. It can't thus be used with HDMI encoders that control the
DDC bus and expose EDID blocks through a different interface.

Refactor drm_do_get_edid() to take a block read callback function
instead of an I2C adapter, and export it for direct use by drivers.

As in the general case the DDC bus is accessible by the kernel at the
I2C level, drivers must make all reasonable efforts to expose it as an
I2C adapter and use drm_get_edid() instead of abusing this function.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
9 years agodrm: rcar-du: Add HDMI encoder and connector support
Laurent Pinchart [Sun, 30 Mar 2014 19:55:38 +0000 (21:55 +0200)]
drm: rcar-du: Add HDMI encoder and connector support

SoCs that integrate the DU have no internal HDMI encoder, support
external encoders only.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
9 years agodrm: rcar-du: Replace drm_encoder with drm_slave_encoder
Laurent Pinchart [Sun, 30 Mar 2014 23:52:01 +0000 (01:52 +0200)]
drm: rcar-du: Replace drm_encoder with drm_slave_encoder

DRM slave encoders require their associated struct drm_encoder instance
to be embedded in a struct drm_slave_encoder. This makes processing
encoders regardless of their types needlessly and painfully complex in
drivers that use a mix of slave encoders and custom encoders. Such a
driver will need to either create drm_slave_encoder instances that fake
their embedded encoder instance, or to turn all drm_encoder instances
into drm_slave_encoder instances.

Between the two evils, one must choose the lesser. Use drm_slave_encoder
everywhere.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
9 years agodrm: rcar-du: Replace direct DRM encoder access with cast macro
Laurent Pinchart [Sun, 30 Mar 2014 23:50:16 +0000 (01:50 +0200)]
drm: rcar-du: Replace direct DRM encoder access with cast macro

Add a new macro to downcast an rcar_du_encoder pointer to a drm_encoder
pointer and use it. This prepares for the replacement of the
rcar_drm_encoder encoder field with a drm_slave_encoder.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
9 years agodrm: rcar-du: Pass the encoder DT node to rcar_du_encoder_init()
Laurent Pinchart [Wed, 17 Sep 2014 11:41:57 +0000 (14:41 +0300)]
drm: rcar-du: Pass the encoder DT node to rcar_du_encoder_init()

The encoder DT node will be needed to register an external HDMI encoder.
Pass it to the rcar_du_encoder_init() function to prepare for HDMI
support.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
9 years agodrm: rcar-du: Remove platform data support
Laurent Pinchart [Tue, 16 Sep 2014 23:07:52 +0000 (02:07 +0300)]
drm: rcar-du: Remove platform data support

All platforms now instantiate the DU through DT, platform data support
isn't needed anymore.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
9 years agodrm: rcar-du: fix error return code
Julia Lawall [Sun, 23 Nov 2014 13:11:17 +0000 (14:11 +0100)]
drm: rcar-du: fix error return code

Propagate the error code on failure.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
identifier ret; expression e1,e2;
@@
(
if (\(ret < 0\|ret != 0\))
 { ... return ret; }
|
ret = 0
)
... when != ret = e1
    when != &ret
*if(...)
{
  ... when != ret = e2
      when forall
 return ret;
}
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
9 years agodrm/udl: properly check for error pointers
Haixia Shi [Tue, 25 Nov 2014 20:04:03 +0000 (12:04 -0800)]
drm/udl: properly check for error pointers

The drm_prime_pages_to_sg() function never returns NULL pointers, only
error pointers and valid pointers.

Signed-off-by: Haixia Shi <hshi@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
9 years agodrm/udl: handle page mapping in dmabuf export.
Haixia Shi [Tue, 25 Nov 2014 20:04:02 +0000 (12:04 -0800)]
drm/udl: handle page mapping in dmabuf export.

Fixes dmabuf export failure with -E_NOMEM when the page is not mapped.

Signed-off-by: Haixia Shi <hshi@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
9 years agoMAINTAINERS: add maintainer for i.MX DRM driver
Philipp Zabel [Mon, 24 Nov 2014 15:33:35 +0000 (16:33 +0100)]
MAINTAINERS: add maintainer for i.MX DRM driver

Add myself as the maintainer of the i.MX DRM driver.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
9 years agodrm: imx: Move imx-drm driver out of staging
Philipp Zabel [Mon, 24 Nov 2014 15:33:34 +0000 (16:33 +0100)]
drm: imx: Move imx-drm driver out of staging

The imx-drm driver was put into staging mostly for the following reasons,
all of which have been addressed or superseded:
 - convert the irq driver to use linear irq domains
 - work out the device tree bindings, this lead to the common of_graph
   bindings being used
 - factor out common helper functions, this mostly resulted in the
   component framework and drm of_graph helpers.

Before adding new fixes, and certainly before adding new features,
move it into its proper place below drivers/gpu/drm.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Dave Airlie <airlied@redhat.com>
9 years agoMerge tag 'tags/renesas-dt-du-for-v3.19' into drm/next/adv7511-base
Laurent Pinchart [Tue, 25 Nov 2014 23:38:43 +0000 (01:38 +0200)]
Merge tag 'tags/renesas-dt-du-for-v3.19' into drm/next/adv7511-base

Renesas ARM Based SoC DT DU Updates for v3.19

* Enable DU using DT on marzen/r8a7779, lager/r8a7790 and koelsch/r8a7791