GitHub/exynos8895/android_kernel_samsung_universal8895.git
12 years agodrm/nouveau: move fence sequence check to start of loop
Ben Skeggs [Wed, 21 Mar 2012 03:51:03 +0000 (13:51 +1000)]
drm/nouveau: move fence sequence check to start of loop

I want to be able to use REF_CNT from other places in the kernel without
pushing a fence object onto the list of emitted fences.

The current code makes an assumption that every time the acked sequence is
bumped that there's at least one fence on the list that'll be signalled.

This will no longer be true in the near future.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
12 years agodrm/nouveau: remove subchannel names from places where it doesn't matter
Ben Skeggs [Thu, 15 Mar 2012 14:09:54 +0000 (00:09 +1000)]
drm/nouveau: remove subchannel names from places where it doesn't matter

These are FIFO methods, it doesn't matter what subchannel is being used.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
12 years agodrm/nouveau/ttm: always do buffer moves on kernel channel
Ben Skeggs [Fri, 16 Mar 2012 02:40:17 +0000 (12:40 +1000)]
drm/nouveau/ttm: always do buffer moves on kernel channel

There was once good reasons for wanting the drm to be able to use M2MF etc
on user channels, but they're not relevant anymore.  For the general
buffer move case, we've already lost by transferring between vram/sysmem
already so the context switching overhead is minimal in comparison.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
12 years agodrm/nouveau: map first page of mmio early and determine chipset earlier
Ben Skeggs [Mon, 12 Mar 2012 05:55:43 +0000 (15:55 +1000)]
drm/nouveau: map first page of mmio early and determine chipset earlier

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
12 years agodrm/nvd0/disp: disconnect encoders before reprogramming them
Ben Skeggs [Mon, 12 Mar 2012 05:23:44 +0000 (15:23 +1000)]
drm/nvd0/disp: disconnect encoders before reprogramming them

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
12 years agodrm/nvd0/disp: move syncs/magic setup to or mode_set
Ben Skeggs [Mon, 12 Mar 2012 01:42:20 +0000 (11:42 +1000)]
drm/nvd0/disp: move syncs/magic setup to or mode_set

NVIDIA appear to do these around the same place they do the MODE_CTRL
methods, and for DP at least we need to bash some extra bits in "syncs"
to keep EVO happy.

It's a bit of a guess as to the 6/8bpc, but i have no better idea yet.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
12 years agodrm/nouveau/dp: account for channel coding overhead in link training
Ben Skeggs [Mon, 12 Mar 2012 01:16:55 +0000 (11:16 +1000)]
drm/nouveau/dp: account for channel coding overhead in link training

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
12 years agodrm/nvd0/disp: fix dcb sor link matching in supervisor handler
Ben Skeggs [Sun, 11 Mar 2012 06:13:49 +0000 (16:13 +1000)]
drm/nvd0/disp: fix dcb sor link matching in supervisor handler

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
12 years agodrm/nvd0/disp: initial implementation of displayport
Ben Skeggs [Sat, 10 Mar 2012 15:28:48 +0000 (01:28 +1000)]
drm/nvd0/disp: initial implementation of displayport

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
12 years agodrm/nouveau/dp: make dp dpms function common, call from sor code instead
Ben Skeggs [Sat, 10 Mar 2012 15:20:54 +0000 (01:20 +1000)]
drm/nouveau/dp: make dp dpms function common, call from sor code instead

GF119 will use this too.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
12 years agodrm/nv50/hwsq: some nv92 fixes
Martin Peres [Thu, 8 Mar 2012 23:15:01 +0000 (00:15 +0100)]
drm/nv50/hwsq: some nv92 fixes

The shift from hwsq_data = 0x1400 to 0x080000 actually happened in nv94, not nv92
This fixes some reclocking issues on my newly acquired nv92

Signed-off-by: Martin Peres <martin.peres@labri.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
12 years agodrm/nouveau/dp: move all nv50/sor-specific code out of nouveau_dp.c
Ben Skeggs [Fri, 9 Mar 2012 06:22:56 +0000 (16:22 +1000)]
drm/nouveau/dp: move all nv50/sor-specific code out of nouveau_dp.c

Off-chip encoders (which we don't support yet anyway), and newer chipsets
(such as NVD9...), will need their own code for this.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
12 years agodrm/nouveau/dp: make functions for executing various bios tables
Ben Skeggs [Fri, 9 Mar 2012 05:22:19 +0000 (15:22 +1000)]
drm/nouveau/dp: make functions for executing various bios tables

More code to do the same thing, but will make it easier to handle various
changes that could possibly happen the the VBIOS tables.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
12 years agodrm/nouveau/pm: fix oops if chipset has no pm support at all
Ben Skeggs [Wed, 7 Mar 2012 04:18:49 +0000 (14:18 +1000)]
drm/nouveau/pm: fix oops if chipset has no pm support at all

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
12 years agodrm/nouveau/bios: rework vbios shadowing
Ben Skeggs [Wed, 7 Mar 2012 03:22:50 +0000 (13:22 +1000)]
drm/nouveau/bios: rework vbios shadowing

Refactored to allow shadowing of VBIOS images longer than 64KiB, which
allows us to pass the VBIOS checksum test on certain boards.

There's also a workaround for reading the PROM VBIOS on some chipsets.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
12 years agodrm/nouveau/bios: attempt acpi rom fetch before pcirom
Ben Skeggs [Sun, 4 Mar 2012 07:05:54 +0000 (17:05 +1000)]
drm/nouveau/bios: attempt acpi rom fetch before pcirom

There's cards out there with completely messed up PCIROM images that have
a perfectly valid signature.. Sigh!

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
12 years agodrm/nvd0/disp: attempt to handle more than 2 crtcs if possible
Ben Skeggs [Sun, 4 Mar 2012 06:25:59 +0000 (16:25 +1000)]
drm/nvd0/disp: attempt to handle more than 2 crtcs if possible

Theoretically handles CRTC2/CRTC3, should any GF119 out there actually
have them enabled.  The room is there for the regs etc, so why not :)

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
12 years agodrm/nvc0/vram: get part count from PUNITS
Ben Skeggs [Sun, 4 Mar 2012 05:44:59 +0000 (15:44 +1000)]
drm/nvc0/vram: get part count from PUNITS

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
12 years agodrm/nv40/pm: fix fanspeed regression
Ben Skeggs [Thu, 9 Feb 2012 05:25:25 +0000 (15:25 +1000)]
drm/nv40/pm: fix fanspeed regression

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
12 years agodrm/nouveau/pm: several fixes for nvc0 memory timings
Roy Spliet [Mon, 6 Feb 2012 23:29:06 +0000 (00:29 +0100)]
drm/nouveau/pm: several fixes for nvc0 memory timings

This patch fixes two small issues in timing generation as spotted on
several NVCx cards.

In addition, the header of the file is updated to also contain (some of)
the current developers of this code.

Signed-off-by: Roy Spliet <r.spliet@student.tudelft.nl>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
12 years agodrm/nvc0/pm: restrict pll mode to clocks that can actually use it
Ben Skeggs [Mon, 6 Feb 2012 23:59:54 +0000 (09:59 +1000)]
drm/nvc0/pm: restrict pll mode to clocks that can actually use it

Fixes reclocking failure on some chips where we attempted to set PDAEMON
to PLL mode.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
12 years agodrm/nouveau/dp: fix bad comparison in dp_link_train_commit()
Xi Wang [Fri, 3 Feb 2012 16:13:55 +0000 (11:13 -0500)]
drm/nouveau/dp: fix bad comparison in dp_link_train_commit()

The comparison (lpre == DP_TRAIN_PRE_EMPHASIS_9_5) is always false:
lpre is initialized as (lane & 0x0c) >> 2, which is at most 3, while
DP_TRAIN_PRE_EMPHASIS_9_5 is defined as (3 << 3).

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
12 years agodrm/nouveau/mxm: call mxmi to determine revision before calling mxms
Ben Skeggs [Wed, 1 Feb 2012 23:33:05 +0000 (09:33 +1000)]
drm/nouveau/mxm: call mxmi to determine revision before calling mxms

There's a HP laptop out there where the MXM version in the VBIOS doesn't
match what the ACPI implementation is expecting.  These tables will accept
0x00 to MXMS to return latest version, but *only* if MXMI has been called
first..

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
12 years agodrm/nouveau/pm: init only after display subsystem has been created
Ben Skeggs [Wed, 1 Feb 2012 05:17:07 +0000 (15:17 +1000)]
drm/nouveau/pm: init only after display subsystem has been created

This patch fixes an oops cause by pm_trigger accessing the (uninitialised)
crtc list.

Reported-by: Roy Spliet <r.spliet@student.tudelft.nl>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
12 years agodrm/nvc0/fb: detect presense of second rank
Ben Skeggs [Tue, 31 Jan 2012 23:05:42 +0000 (09:05 +1000)]
drm/nvc0/fb: detect presense of second rank

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
12 years agodrm/nv50/display: expose color vibrance control
Christoph Bumiller [Sat, 21 Jan 2012 22:13:26 +0000 (23:13 +0100)]
drm/nv50/display: expose color vibrance control

Signed-off-by: Christoph Bumiller <e0425955@student.tuwien.ac.at>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
12 years agodrm/nv50-nvc0/vm: support unsnooped system memory
Ben Skeggs [Thu, 12 Jan 2012 05:34:54 +0000 (15:34 +1000)]
drm/nv50-nvc0/vm: support unsnooped system memory

v2 (Emil Velikov <emil.l.velikov@gmail.com>):
- Fixed a regression on certain nv50 IGP due to not passing the correct
  target type to nv50_vm_addr()

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Tested-by: Johannes Obermayr <johannesobermayr@gmx.de>
12 years agodrm/nouveau: recognise DCB connector type for DP+DVI+VGA DMS-59
Ben Skeggs [Thu, 12 Jan 2012 06:17:16 +0000 (16:17 +1000)]
drm/nouveau: recognise DCB connector type for DP+DVI+VGA DMS-59

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
12 years agodrm/nouveau/mem: handle dll_off for ddr2/ddr3
Ben Skeggs [Tue, 24 Jan 2012 08:30:10 +0000 (18:30 +1000)]
drm/nouveau/mem: handle dll_off for ddr2/ddr3

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Martin Peres <martin.peres@labri.fr>
12 years agodrm/nouveau/pm: extend profile interface for destroy/init/fini
Ben Skeggs [Tue, 24 Jan 2012 08:03:25 +0000 (18:03 +1000)]
drm/nouveau/pm: extend profile interface for destroy/init/fini

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Martin Peres <martin.peres@labri.fr>
12 years agodrm/nouveau/pm: rework to allow selecting separate profiles for ac/battery
Ben Skeggs [Tue, 24 Jan 2012 05:59:07 +0000 (15:59 +1000)]
drm/nouveau/pm: rework to allow selecting separate profiles for ac/battery

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Martin Peres <martin.peres@labri.fr>
12 years agodrm/nouveau/pm: fix dll off -> dll on transitions
Ben Skeggs [Tue, 24 Jan 2012 03:39:56 +0000 (13:39 +1000)]
drm/nouveau/pm: fix dll off -> dll on transitions

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Martin Peres <martin.peres@labri.fr>
12 years agodrm/nouveau/pm: detect when we need dll disabled for gddr3
Ben Skeggs [Tue, 24 Jan 2012 01:26:40 +0000 (11:26 +1000)]
drm/nouveau/pm: detect when we need dll disabled for gddr3

Fixes minor flickering on NVS295 when at perflvl 0.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Martin Peres <martin.peres@labri.fr>
12 years agodrm/nv50: fix detection of second vram rank
Ben Skeggs [Tue, 24 Jan 2012 01:03:14 +0000 (11:03 +1000)]
drm/nv50: fix detection of second vram rank

Goes a long way to correcting NVS295 memory reclocking issues.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Martin Peres <martin.peres@labri.fr>
12 years agodrm/nouveau/pm: track mr2 for gddr3
Ben Skeggs [Tue, 24 Jan 2012 00:24:05 +0000 (10:24 +1000)]
drm/nouveau/pm: track mr2 for gddr3

There's some "extended" GDDR3 chipsets out there with EMRS2 settings that
change the layout of MRS/EMRS1 bitmaps.. Sigh.. Still need to track down
how exactly we're supposed to handle this.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Martin Peres <martin.peres@labri.fr>
12 years agodrm/nv50/pm: wait for all fifo-connected engines to idle before reclocking
Martin Peres [Mon, 9 Jan 2012 05:23:10 +0000 (15:23 +1000)]
drm/nv50/pm: wait for all fifo-connected engines to idle before reclocking

Signed-off-by: Martin Peres <martin.peres@labri.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
12 years agodrm/nv50/pm: use hwsq for engine reclocking too
Ben Skeggs [Mon, 23 Jan 2012 23:47:04 +0000 (09:47 +1000)]
drm/nv50/pm: use hwsq for engine reclocking too

Idea from Martin Peres, different implementation by me.

v2: Martin Peres:
- fix mast calculation

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Martin Peres <martin.peres@labri.fr>
12 years agodrm/nv50/disp: more accurate function to determine active crtcs
Ben Skeggs [Mon, 23 Jan 2012 03:22:58 +0000 (13:22 +1000)]
drm/nv50/disp: more accurate function to determine active crtcs

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Martin Peres <martin.peres@labri.fr>
12 years agodrm/nv50/pm: initial work towards proper memory reclocking, with timings
Ben Skeggs [Mon, 23 Jan 2012 03:17:11 +0000 (13:17 +1000)]
drm/nv50/pm: initial work towards proper memory reclocking, with timings

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Martin Peres <martin.peres@labri.fr>
12 years agodrm/nouveau/pm: introduce ram reclocking helper
Ben Skeggs [Mon, 23 Jan 2012 03:12:09 +0000 (13:12 +1000)]
drm/nouveau/pm: introduce ram reclocking helper

This will probably result in more lines of code, however, we're going to
have at least 3 slightly different implementations of this very soon and
I'd rather keep the ram reclocking logic separate from the hw specifics.

DDR2/DDR3/GDDR3 implemented thus far, others will be added as necessary.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Martin Peres <martin.peres@labri.fr>
12 years agodrm/nouveau/pm: embed timings into perflvl structs
Ben Skeggs [Tue, 17 Jan 2012 23:02:28 +0000 (09:02 +1000)]
drm/nouveau/pm: embed timings into perflvl structs

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Martin Peres <martin.peres@labri.fr>
12 years agodrm/nouveau/pm: calculate memory timings at perflvl creation time
Ben Skeggs [Tue, 17 Jan 2012 11:10:58 +0000 (21:10 +1000)]
drm/nouveau/pm: calculate memory timings at perflvl creation time

Statically generating the PFB register and MR values for each timing set
turns out to be insufficient.  There's at least one (so far) known piece
of information which effects MR values which is stored in the perflvl
entry on some chipsets (and in another table on later ones), which is
disconnected from the timing table entries.

After this change we will generate a timing set based on an input clock
frequency instead, and have this data stored in the performance level
data.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Martin Peres <martin.peres@labri.fr>
12 years agodrm/nouveau/pm: readback boot perflvl *before* parsing vbios
Ben Skeggs [Mon, 23 Jan 2012 03:47:02 +0000 (13:47 +1000)]
drm/nouveau/pm: readback boot perflvl *before* parsing vbios

We might want/need the boot data to generate the other perflevels.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Martin Peres <martin.peres@labri.fr>
12 years agodrm/nouveau/pm: implement DDR2/DDR3/GDDR3/GDDR5 MR generation and validation
Roy Spliet [Mon, 9 Jan 2012 05:23:07 +0000 (15:23 +1000)]
drm/nouveau/pm: implement DDR2/DDR3/GDDR3/GDDR5 MR generation and validation

Roy Spliet:
- Implement according to specs
- Simplify
- Make array for mc latency registers

Martin Peres:
- squash and split all the commits from Roy
- rework following Ben Skeggs comments
- add a form of timings validation
- store the initial timings for later use

Ben Skeggs
- merge slightly modified tidy-up patch with this one
- remove perflvl-dropping logic for the moment

Signed-off-by: Roy Spliet <r.spliet@student.tudelft.nl>
Signed-off-by: Martin Peres <martin.peres@labri.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
12 years agodrm/nouveau/pm: restructure bios table parsing
Ben Skeggs [Mon, 16 Jan 2012 12:34:03 +0000 (22:34 +1000)]
drm/nouveau/pm: restructure bios table parsing

It turns out we need access to some additional information in various VBIOS
tables to handle PFB memory timings correctly.

Rather than hack in parsing of the new stuff in some kludgy way, I've
restructured the VBIOS parsing to be more primitive, so we can use them in
more flexible ways in the future.

The perflvl->timing association code is disabled for the moment until it can
be reworked.  We don't use this stuff yet anyway, so no harm done.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Martin Peres <martin.peres@labri.fr>
12 years agodrm/nouveau/pm: avoid potential divide-by-zero
Ben Skeggs [Mon, 23 Jan 2012 02:58:33 +0000 (12:58 +1000)]
drm/nouveau/pm: avoid potential divide-by-zero

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Martin Peres <martin.peres@labri.fr>
12 years agodrm/nouveau: Fix module parameter description formats
Jean Delvare [Wed, 30 Nov 2011 16:23:55 +0000 (17:23 +0100)]
drm/nouveau: Fix module parameter description formats

Module parameter descriptions don't take a trailing \n, otherwise it
breaks formatting of modinfo's output. Also remove trailing space.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
Cc: David Airlie <airlied@linux.ie>
Cc: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
12 years agodrm/nouveau/pm: improve memory timing generation
Roy Spliet [Fri, 25 Nov 2011 14:52:22 +0000 (15:52 +0100)]
drm/nouveau/pm: improve memory timing generation

- Rename several VBIOS entries to closer match the real world
- Add the missing 0x100238 and 0x100240 register values
- Parse bit 14 of the VBIOS timing table
- "Magic value" -> tCWL, fixing some minor bugs in the process
- Also name a few more by their name rather than their number.
- Some values seem to be dependent on the memory type. Fix

Edits by Martin Peres <martin.peres@labri.fr>:
- this is a squash commit
- reworked for fixing some style issues

Signed-off-by: Roy Spliet <r.spliet@student.tudelft.nl>
Signed-off-by: Martin Peres <martin.peres@labri.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
12 years agodrm/nouveau/pm: improve the reclocking logs' readability
Martin Peres [Wed, 2 Nov 2011 23:03:06 +0000 (00:03 +0100)]
drm/nouveau/pm: improve the reclocking logs' readability

Signed-off-by: Martin Peres <martin.peres@labri.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
12 years agodrm/nouveau: move pwm_divisor to the nouveau_pm_fan struct
Martin Peres [Sat, 20 Aug 2011 14:37:06 +0000 (16:37 +0200)]
drm/nouveau: move pwm_divisor to the nouveau_pm_fan struct

Signed-off-by: Martin Peres <martin.peres@labri.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
12 years agodrm/nouveau/pm: restore fan speed after suspend
Martin Peres [Thu, 6 Oct 2011 23:33:12 +0000 (01:33 +0200)]
drm/nouveau/pm: restore fan speed after suspend

Signed-off-by: Martin Peres <martin.peres@labri.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
12 years agodrm/nouveau/pm: style fixes
Martin Peres [Sat, 17 Dec 2011 11:24:59 +0000 (12:24 +0100)]
drm/nouveau/pm: style fixes

Signed-off-by: Martin Peres <martin.peres@labri.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
12 years agodrm/nouveau: rework the init/takedown ordering
Ben Skeggs [Thu, 15 Dec 2011 00:43:03 +0000 (10:43 +1000)]
drm/nouveau: rework the init/takedown ordering

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
12 years agodrm/nvc0: add initial memory type detection
Ben Skeggs [Tue, 13 Dec 2011 02:46:18 +0000 (12:46 +1000)]
drm/nvc0: add initial memory type detection

Uses only the VBIOS tables, from what I can tell this is what NVIDIA do
too, I was able to change the detected memory type by modifying this table
on a NVC1 chipset.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
12 years agodrm/nv50: hopefully handle the DDR2/DDR3 memtype detection somewhat better
Ben Skeggs [Tue, 13 Dec 2011 01:57:55 +0000 (11:57 +1000)]
drm/nv50: hopefully handle the DDR2/DDR3 memtype detection somewhat better

M version 2 appears to have a table with some form of memory type info
available.

NVIDIA appear to ignore the table information except for this DDR2/DDR3
case (which has the same value in 0x100714).  My guess is this is due to
some of the supported memory types not being represented in the table.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
12 years agodrm/nv50: add memory type detection
Ben Skeggs [Mon, 12 Dec 2011 23:45:25 +0000 (09:45 +1000)]
drm/nv50: add memory type detection

DDR1/DDR[23] confirmed on NVA8 (see note about DDR3 in source) by changing
the value and watching the binary driver's behaviour.

GDDR3/4 values confirmed on a NV96 via the same method above.  That GDDR4
is present is interesting, as far as I can see no boards using it were ever
released.

GDDR5 value is based on VBIOS images of known GDDR5 boards.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
12 years agodrm/nv20-nv40: add memory type detection
Ben Skeggs [Mon, 12 Dec 2011 13:03:14 +0000 (23:03 +1000)]
drm/nv20-nv40: add memory type detection

NV20/NV30 is partially educated guesswork at this point, based on any
information around about available memory types and a horribly unspeakable
amount of vbios image scouring.  I'm not entirely certain the GDDR3 define
is correct, I have not spotted a single vbios with that value yet (though
it is mentioned in some 1218-using nv4x vbios), but there are reports that
some nv3x did use it..

NV40(100914) confirmed by switching an NV49 to DDR1/DDR2 values and making
sure that the binary driver behaviour showed it had detected DDR1/DDR2
instead of GDDR3 before dying horribly.

NV40(100474) confirmed by doing much the same task as above on an NV44,
except this was *much* easier as changing the values didn't seem to have
any noticable effect on the memory controller aside from changing the
binary driver's behaviour.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
12 years agodrm/nv20: split PFB code out of nv10_fb.c
Ben Skeggs [Mon, 12 Dec 2011 12:51:33 +0000 (22:51 +1000)]
drm/nv20: split PFB code out of nv10_fb.c

Most functions were quite different between NV10/NV20 already, and they're
about to get even more so.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
12 years agodrm/nouveau: memory type detection for the really old chipsets
Ben Skeggs [Sat, 10 Dec 2011 15:31:17 +0000 (01:31 +1000)]
drm/nouveau: memory type detection for the really old chipsets

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
12 years agodrm/nouveau: move vram detection funcs to chipset-specific fb code
Ben Skeggs [Sat, 10 Dec 2011 14:30:05 +0000 (00:30 +1000)]
drm/nouveau: move vram detection funcs to chipset-specific fb code

Also, display detected memory type in logs - though, we don't even try to
detect this yet.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
12 years agoMerge branch 'drm-gma500-alanc' into drm-core-next
Dave Airlie [Sat, 10 Mar 2012 13:10:41 +0000 (13:10 +0000)]
Merge branch 'drm-gma500-alanc' into drm-core-next

* drm-gma500-alanc: (47 commits)
  gma500: psb_irq: mark mid_{enable, disable}_pipe_event() as static
  gma500: mark psb_intel_sdvo_hdmi_sink_detect() as static
  gma500: psb_intel_display: drop unused variables
  gma500: mark psb_intel_pipe_set_base() as static
  gma500: drop unused psb_intel_modeset_cleanup()
  gma500: oaktrail_lvds_init() drop unused variable
  gma500: oaktrail_hdmi_i2c_access() drop unused variable
  gma500: mark oaktrail_backlight_init() as static
  gma500: oaktrail_hdmi: fix -Wmissing-field-initializers warning
  gma500: oaktrail_hdmi: drop dead code
  gma500: oaktrail_crtc: drop unused variables
  gma500: oaktrail_crtc: mark few functions as static
  gma500: mdfld_intel_display: drop unused variables
  gma500: mdfld_dsi_pkg_sender: fix -Wtype-limits warning
  gma500: mdfld_dsi_dpi: drop unused variables
  gma500: mdfld_device: mark few functions as static
  gma500: cdv_intel_lvds: #if 0 currently unused functions
  gma500: cdv_intel_lvds: mark few functions as static
  gma500: cdv_intel_hdmi: add missing include
  gma500: cdv_intel_crt: mark few functions as static
  ...

12 years agogma500: psb_irq: mark mid_{enable, disable}_pipe_event() as static
Kirill A. Shutemov [Thu, 8 Mar 2012 16:15:47 +0000 (16:15 +0000)]
gma500: psb_irq: mark mid_{enable, disable}_pipe_event() as static

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agogma500: mark psb_intel_sdvo_hdmi_sink_detect() as static
Kirill A. Shutemov [Thu, 8 Mar 2012 16:15:34 +0000 (16:15 +0000)]
gma500: mark psb_intel_sdvo_hdmi_sink_detect() as static

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agogma500: psb_intel_display: drop unused variables
Kirill A. Shutemov [Thu, 8 Mar 2012 16:15:20 +0000 (16:15 +0000)]
gma500: psb_intel_display: drop unused variables

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agogma500: mark psb_intel_pipe_set_base() as static
Kirill A. Shutemov [Thu, 8 Mar 2012 16:14:44 +0000 (16:14 +0000)]
gma500: mark psb_intel_pipe_set_base() as static

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agogma500: drop unused psb_intel_modeset_cleanup()
Kirill A. Shutemov [Thu, 8 Mar 2012 16:14:32 +0000 (16:14 +0000)]
gma500: drop unused psb_intel_modeset_cleanup()

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agogma500: oaktrail_lvds_init() drop unused variable
Kirill A. Shutemov [Thu, 8 Mar 2012 16:14:18 +0000 (16:14 +0000)]
gma500: oaktrail_lvds_init() drop unused variable

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agogma500: oaktrail_hdmi_i2c_access() drop unused variable
Kirill A. Shutemov [Thu, 8 Mar 2012 16:13:23 +0000 (16:13 +0000)]
gma500: oaktrail_hdmi_i2c_access() drop unused variable

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agogma500: mark oaktrail_backlight_init() as static
Kirill A. Shutemov [Thu, 8 Mar 2012 16:13:10 +0000 (16:13 +0000)]
gma500: mark oaktrail_backlight_init() as static

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agogma500: oaktrail_hdmi: fix -Wmissing-field-initializers warning
Kirill A. Shutemov [Thu, 8 Mar 2012 16:12:56 +0000 (16:12 +0000)]
gma500: oaktrail_hdmi: fix -Wmissing-field-initializers warning

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agogma500: oaktrail_hdmi: drop dead code
Kirill A. Shutemov [Thu, 8 Mar 2012 16:12:28 +0000 (16:12 +0000)]
gma500: oaktrail_hdmi: drop dead code

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agogma500: oaktrail_crtc: drop unused variables
Kirill A. Shutemov [Thu, 8 Mar 2012 16:12:16 +0000 (16:12 +0000)]
gma500: oaktrail_crtc: drop unused variables

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agogma500: oaktrail_crtc: mark few functions as static
Kirill A. Shutemov [Thu, 8 Mar 2012 16:12:04 +0000 (16:12 +0000)]
gma500: oaktrail_crtc: mark few functions as static

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agogma500: mdfld_intel_display: drop unused variables
Kirill A. Shutemov [Thu, 8 Mar 2012 16:11:50 +0000 (16:11 +0000)]
gma500: mdfld_intel_display: drop unused variables

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agogma500: mdfld_dsi_pkg_sender: fix -Wtype-limits warning
Kirill A. Shutemov [Thu, 8 Mar 2012 16:11:38 +0000 (16:11 +0000)]
gma500: mdfld_dsi_pkg_sender: fix -Wtype-limits warning

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agogma500: mdfld_dsi_dpi: drop unused variables
Kirill A. Shutemov [Thu, 8 Mar 2012 16:11:26 +0000 (16:11 +0000)]
gma500: mdfld_dsi_dpi: drop unused variables

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agogma500: mdfld_device: mark few functions as static
Kirill A. Shutemov [Thu, 8 Mar 2012 16:11:14 +0000 (16:11 +0000)]
gma500: mdfld_device: mark few functions as static

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agogma500: cdv_intel_lvds: #if 0 currently unused functions
Kirill A. Shutemov [Thu, 8 Mar 2012 16:11:02 +0000 (16:11 +0000)]
gma500: cdv_intel_lvds: #if 0 currently unused functions

cdv_intel_lvds_set_brightness() is only used in commented out code in
cdv_set_brightness().

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agogma500: cdv_intel_lvds: mark few functions as static
Kirill A. Shutemov [Thu, 8 Mar 2012 16:10:50 +0000 (16:10 +0000)]
gma500: cdv_intel_lvds: mark few functions as static

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agogma500: cdv_intel_hdmi: add missing include
Kirill A. Shutemov [Thu, 8 Mar 2012 16:10:38 +0000 (16:10 +0000)]
gma500: cdv_intel_hdmi: add missing include

drivers/gpu/drm/gma500/cdv_intel_hdmi.c:305:6: warning: no previous prototype for 'cdv_hdmi_init' [-Wmissing-prototypes]

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agogma500: cdv_intel_crt: mark few functions as static
Kirill A. Shutemov [Thu, 8 Mar 2012 16:10:23 +0000 (16:10 +0000)]
gma500: cdv_intel_crt: mark few functions as static

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agogma500: cdv_intel_crt: drop unused variables
Kirill A. Shutemov [Thu, 8 Mar 2012 16:10:10 +0000 (16:10 +0000)]
gma500: cdv_intel_crt: drop unused variables

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agogma500: cdv_intel_crt: drop dead code
Kirill A. Shutemov [Thu, 8 Mar 2012 16:09:57 +0000 (16:09 +0000)]
gma500: cdv_intel_crt: drop dead code

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agogma500: cdv_intel_crt: add missing include
Kirill A. Shutemov [Thu, 8 Mar 2012 16:09:45 +0000 (16:09 +0000)]
gma500: cdv_intel_crt: add missing include

drivers/gpu/drm/gma500/cdv_intel_crt.c:273:6: warning: no previous prototype for 'cdv_intel_crt_init' [-Wmissing-prototypes]

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agogma500: fix cdv_intel_wait_for_vblank() prototype
Kirill A. Shutemov [Thu, 8 Mar 2012 16:09:33 +0000 (16:09 +0000)]
gma500: fix cdv_intel_wait_for_vblank() prototype

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agogma500: fix two -Wmissing-field-initializers warnings
Kirill A. Shutemov [Thu, 8 Mar 2012 16:09:19 +0000 (16:09 +0000)]
gma500: fix two -Wmissing-field-initializers warnings

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agogma500: mark psb_driver_device_is_agp() and psb_driver_preclose() as static
Kirill A. Shutemov [Thu, 8 Mar 2012 16:08:45 +0000 (16:08 +0000)]
gma500: mark psb_driver_device_is_agp() and psb_driver_preclose() as static

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agogma500: psb_driver_load(): drop unused variables
Kirill A. Shutemov [Thu, 8 Mar 2012 16:05:00 +0000 (16:05 +0000)]
gma500: psb_driver_load(): drop unused variables

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agogma500: fix ioctl confict
Kirill A. Shutemov [Thu, 8 Mar 2012 16:04:47 +0000 (16:04 +0000)]
gma500: fix ioctl confict

Move DRM_GMA_GET_PIPE_FROM_CRTC_ID to 0x08 to avoid confict with
DRM_GMA_GEM_MMAP.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agogma500: use DRM_IOCTL_DEF_DRV instead of custom PSB_IOCTL_DEF
Kirill A. Shutemov [Thu, 8 Mar 2012 16:04:32 +0000 (16:04 +0000)]
gma500: use DRM_IOCTL_DEF_DRV instead of custom PSB_IOCTL_DEF

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agogma500: mmu: mark psb_mmu_free_pt() and psb_mmu_pt_alloc_map_lock() as static
Kirill A. Shutemov [Thu, 8 Mar 2012 16:04:20 +0000 (16:04 +0000)]
gma500: mmu: mark psb_mmu_free_pt() and psb_mmu_pt_alloc_map_lock() as static

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agogma500: mmu: drop unused psb_get_default_pd_addr()
Kirill A. Shutemov [Thu, 8 Mar 2012 16:04:08 +0000 (16:04 +0000)]
gma500: mmu: drop unused psb_get_default_pd_addr()

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agogma500: gtt: mark psb_gtt_entry() and psb_gtt_alloc() as static
Kirill A. Shutemov [Thu, 8 Mar 2012 16:03:55 +0000 (16:03 +0000)]
gma500: gtt: mark psb_gtt_entry() and psb_gtt_alloc() as static

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agogma500: mark psb_fbdev_destroy() and psb_fbdev_fini() as static
Kirill A. Shutemov [Thu, 8 Mar 2012 16:03:44 +0000 (16:03 +0000)]
gma500: mark psb_fbdev_destroy() and psb_fbdev_fini() as static

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agogma500: drop unused psbfb_suspend()/psbfb_resume()
Kirill A. Shutemov [Thu, 8 Mar 2012 16:03:32 +0000 (16:03 +0000)]
gma500: drop unused psbfb_suspend()/psbfb_resume()

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agogma500: gem_glue: add missing include
Kirill A. Shutemov [Thu, 8 Mar 2012 16:03:19 +0000 (16:03 +0000)]
gma500: gem_glue: add missing include

It fixes W=1 warnings:

drivers/gpu/drm/gma500/gem_glue.c:23:6: warning: no previous prototype for ‘drm_gem_object_release_wrap’ [-Wmissing-prototypes]
drivers/gpu/drm/gma500/gem_glue.c:44:5: warning: no previous prototype for ‘gem_create_mmap_offset’ [-Wmissing-prototypes]

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agogma500: medfield: drop a bit of dead code
Kirill A. Shutemov [Thu, 8 Mar 2012 16:03:04 +0000 (16:03 +0000)]
gma500: medfield: drop a bit of dead code

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agogma500: mdfld_dsi_output_init() drop unused parameter
Kirill A. Shutemov [Thu, 8 Mar 2012 16:02:50 +0000 (16:02 +0000)]
gma500: mdfld_dsi_output_init() drop unused parameter

Nobody uses 'config' parameter.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agogma500: psbfb_create(): move depth initialization out of loop
Kirill A. Shutemov [Thu, 8 Mar 2012 16:02:36 +0000 (16:02 +0000)]
gma500: psbfb_create(): move depth initialization out of loop

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agogma500: initial medfield merge
Kirill A. Shutemov [Thu, 8 Mar 2012 16:02:20 +0000 (16:02 +0000)]
gma500: initial medfield merge

We need to merge this ahead of some of the cleanup because a lot of needed
cleanup spans both new and old chips. If we try and clean up and the merge
we end up fighting ourselves.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
[With a load of the cleanup stuff folded in, register stuff reworked sanely]
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>