History log of /drivers/gpu/drm/nouveau/nv50_display.c
Revision Date Author Comments
eae7382bc5547391e72f8cde83f5e2be9c359d5b 30-Oct-2014 Roy Spliet <rspliet@eclipso.eu> drm/nouveau/nv50/disp: Fix modeset on G94

Commit 1dce6264045cd23e9c07574ed0bb31c7dce9354f introduced a regression
spotted on several G94 (FDObz #85160). This device seems to expect the
vblank period to be set after setting scale instead of before.

V2: shove this in a separate function

This is a candidate bug-fix for 3.18

Signed-off-by: Roy Spliet <rspliet@eclipso.eu>
Tested-by: Zlatko Calusic <zcalusic@bitsync.net>
Tested-by: Michael Riesch <michael@riesch.at>
Tested-by: "poma" <pomidorabelisima@gmail.com>
Tested-by: Adam Williamson <adamw@happyassassin.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
bb6178b04f5ef6f62990306713fb6afdf5d8bc56 09-Jan-2014 Maarten Lankhorst <maarten.lankhorst@canonical.com> drm/nouveau: export reservation_object from dmabuf to ttm

Adds an extra argument to nouveau_bo_new, which is only used in nouveau_prime.c.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
cc2a9071458254cb0db6153811734750da0233ea 15-Sep-2014 Ben Skeggs <bskeggs@redhat.com> drm/gt214-/disp: enable dp audio

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
d889c52427d48c05f163f2f39b2cfc12e17e5266 15-Sep-2014 Ben Skeggs <bskeggs@redhat.com> drm/gt214-/kms: fix hda eld regression

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
3eee8646c119db9c12f4fe66dc275093abd84555 15-Sep-2014 Ben Skeggs <bskeggs@redhat.com> drm/gt214-/kms: perform hda codec setup on displayport too

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
1dce6264045cd23e9c07574ed0bb31c7dce9354f 12-Sep-2014 Roy Spliet <rspliet@eclipso.eu> drm/nv50/kms: Set VBLANK time in modeset script

Solves blinking on reclocking memory. The value set is an underestimate, but
with non-reduced vblanking this should give us plenty of time

Signed-off-by: Roy Spliet <rspliet@eclipso.eu>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
f392ec4b1d92004949e5a4f4418b1fbb2582ef0d 09-Aug-2014 Ben Skeggs <bskeggs@redhat.com> drm/nouveau: use ram info from nvif_device

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
b76f15295eadd37405cdb4855351a6ceda0bd1b1 09-Aug-2014 Ben Skeggs <bskeggs@redhat.com> drm/nouveau/disp: allow user direct access to channel control registers

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
648d4dfde721885737b33a06f2b73ee125acf271 09-Aug-2014 Ben Skeggs <bskeggs@redhat.com> drm/nouveau/disp: audit and version display classes

The full object interfaces are about to be exposed to userspace, so we
need to check for any security-related issues and version the structs
to make it easier to handle any changes we may need in the future.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
67cb49c45feba4141ed4b962855249d30302cd7d 09-Aug-2014 Ben Skeggs <bskeggs@redhat.com> drm/nv50-/disp: audit and version PIOR_PWR method

The full object interfaces are about to be exposed to userspace, so we
need to check for any security-related issues and version the structs
to make it easier to handle any changes we may need in the future.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
c02ed2bf98a682c477640c782d1e6a94525b2123 09-Aug-2014 Ben Skeggs <bskeggs@redhat.com> drm/nv50-/disp: audit and version SOR_DP_PWR method

The full object interfaces are about to be exposed to userspace, so we
need to check for any security-related issues and version the structs
to make it easier to handle any changes we may need in the future.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
a3761fa2483f48d158234760d5e25e5071e41537 09-Aug-2014 Ben Skeggs <bskeggs@redhat.com> drm/nv50-/disp: audit and version LVDS_SCRIPT method

The full object interfaces are about to be exposed to userspace, so we
need to check for any security-related issues and version the structs
to make it easier to handle any changes we may need in the future.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
e00f2235386484cc1920dd99d17beac2a8dc4a95 09-Aug-2014 Ben Skeggs <bskeggs@redhat.com> drm/nv50-/disp: audit and version SOR_HDMI_PWR method

The full object interfaces are about to be exposed to userspace, so we
need to check for any security-related issues and version the structs
to make it easier to handle any changes we may need in the future.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
120b0c39c75688864e4a25e71cf3ed40e8e18651 09-Aug-2014 Ben Skeggs <bskeggs@redhat.com> drm/nv50-/disp: audit and version SOR_HDA_ELD method

The full object interfaces are about to be exposed to userspace, so we
need to check for any security-related issues and version the structs
to make it easier to handle any changes we may need in the future.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
d55b4af909bc16f7982c2b8b8656f0898158627b 09-Aug-2014 Ben Skeggs <bskeggs@redhat.com> drm/nv50-/disp: audit and version SOR_PWR method

The full object interfaces are about to be exposed to userspace, so we
need to check for any security-related issues and version the structs
to make it easier to handle any changes we may need in the future.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
c4abd3178e117d3ca15a40d76df2dbb135f33d78 09-Aug-2014 Ben Skeggs <bskeggs@redhat.com> drm/nv50-/disp: audit and version DAC_LOAD method

The full object interfaces are about to be exposed to userspace, so we
need to check for any security-related issues and version the structs
to make it easier to handle any changes we may need in the future.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
bf0eb89859439f016a1fab4cdf737c95f36dbb2e 09-Aug-2014 Ben Skeggs <bskeggs@redhat.com> drm/nv50-/disp: audit and version DAC_PWR method

The full object interfaces are about to be exposed to userspace, so we
need to check for any security-related issues and version the structs
to make it easier to handle any changes we may need in the future.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
410f3ec63570bea8efe00826a2b83ceb353553b1 09-Aug-2014 Ben Skeggs <bskeggs@redhat.com> drm/nv50/kms: don't assume same class versions for all channels

One of the next commits will remove some of the class IDs, leaving only
the ones used by NVIDIA which, presumably, mark where functionality
changes actually happened.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
bbf8906b2cad17cf9530b06db7509d0e39b02d16 09-Aug-2014 Ben Skeggs <bskeggs@redhat.com> drm/nouveau/fifo: audit and version fifo channel classes

The full object interfaces are about to be exposed to userspace, so we
need to check for any security-related issues and version the structs
to make it easier to handle any changes we may need in the future.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
4acfd707e28c820ba8ed8c12b497413a133d8c8f 09-Aug-2014 Ben Skeggs <bskeggs@redhat.com> drm/nouveau/dma: audit and version NV_DMA classes

The full object interfaces are about to be exposed to userspace, so we
need to check for any security-related issues and version the structs
to make it easier to handle any changes we may need in the future.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
fdb751ef2bbc78314d1e01d3425cfacfb19b9f86 09-Aug-2014 Ben Skeggs <bskeggs@redhat.com> drm/nouveau: remove as much direct use of core headers as possible

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
f45f55c4bbf8a9f9c607e5f6013abac60427e3f7 09-Aug-2014 Ben Skeggs <bskeggs@redhat.com> drm/nouveau: remove (most) hardcoded object handle usage

The PFIFO<->EVO sync buffers will be fixed up later when inter-channel
sync in general is improved.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
0ad72863ea426d46b2786cba9430e122a40aad0b 09-Aug-2014 Ben Skeggs <bskeggs@redhat.com> drm/nouveau: port to nvif client/device/objects

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
967e7bde8739fe3b215f7537e8f1f39c044902af 09-Aug-2014 Ben Skeggs <bskeggs@redhat.com> drm/nouveau: initial pass at moving to struct nvif_device

This is an attempt at isolating some of the changes necessary to port
to NVIF in a separate commit.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
db2bec187dd68e79d512112df1f6e7a849e7f0ce 09-Aug-2014 Ben Skeggs <bskeggs@redhat.com> drm/nouveau: kill nouveau_dev() + wrap register macros

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
fa2bade99a6fb24c3847d48ba3cad9a70dbb5364 09-Aug-2014 Ben Skeggs <bskeggs@redhat.com> drm/nouveau: fix some usages of the wrong print function

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
8a42364701d6860e51d53bbcbe3c84fe93816861 09-Aug-2014 Ben Skeggs <bskeggs@redhat.com> drm/nv50/kms: create ctxdma objects for framebuffers as required

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
ab0af559d34b6817768c1720859aef7d7009ee57 09-Aug-2014 Ben Skeggs <bskeggs@redhat.com> drm/nv50/kms: move framebuffer wrangling out of common code

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
276e526cfb257add928a57b196ea3e5c22b703ef 30-Jun-2014 Ben Skeggs <bskeggs@redhat.com> drm/nv50-/kms: pass a non-zero value for head to sor dpms methods

There's Apple machines out there which (probably completely arbitrarily)
restrict each output path to a particular head. This causes us to not
be able to locate the output data needed to power on/off the DP output
correctly.

We fix this by passing in a head index we know is valid (as opposed to
"head 0").

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
efa366fdf5658ca9ccad38e235818d121b1b8002 04-Jun-2014 Ben Skeggs <bskeggs@redhat.com> drm/nv50-: trigger update after all connectors disabled

We were sending the necessary state changes to unset the mode, but
never actually hit the big GO button unless another modeset happens
afterwards.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
e84a35a8054397b0a4efc86ba82d9bc8b3895c75 05-Jun-2014 Ben Skeggs <bskeggs@redhat.com> drm/nv50-: prepare for attaching a SOR to multiple heads

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
4874322e78d505d38c8d4481118af5c9f0e8306d 30-May-2014 Ben Skeggs <bskeggs@redhat.com> drm/nouveau/dp: fix support for dpms

SOR_PWR has no effect to power-off DP links, unlike other SOR protocols.

Instead, on the source side, we cut power to the lanes after having put
the sink into D3. Link training takes care of everything required to
bring it back again.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
56d237d2683bc0ba403148697260dd9499c40949 19-May-2014 Ben Skeggs <bskeggs@redhat.com> drm/nv50-/kms: wait for enough ring space in crtc_prepare()

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
8c6c361ac6490eb3b74593a85ef5ea7d86a8669f 03-Jun-2014 Jani Nikula <jani.nikula@intel.com> drm/nouveau: replace drm_get_connector_name() with direct name field use

Generated using semantic patches:

@@
expression E;
@@

- drm_get_connector_name(&E)
+ E.name

@@
expression E;
@@

- drm_get_connector_name(E)
+ E->name

v2: Turn drm_get_connector_name(&E) into E.name instead of &(E)->name.

Acked-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
f4510a2752b75ad5847b7935b68c233cab497f97 02-Apr-2014 Matt Roper <matthew.d.roper@intel.com> drm: Replace crtc fb with primary plane fb (v3)

Now that CRTC's have a primary plane, there's no need to track the
framebuffer in the CRTC. Replace all references to the CRTC fb with the
primary plane's fb.

This patch was generated by the Coccinelle semantic patching tool using
the following rules:

@@ struct drm_crtc C; @@
- (C).fb
+ C.primary->fb

@@ struct drm_crtc *C; @@
- (C)->fb
+ C->primary->fb

v3: Generate patch via coccinelle. Actual removal of crtc->fb has been
moved to a subsequent patch.

v2: Fixup several lingering crtc->fb instances that were missed in the
first patch iteration. [Rob Clark]

Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Reviewed-by: Rob Clark <robdclark@gmail.com>
eb2e9686d6bc94559dc7f25ed1e67ebbf0a9a41b 24-Jan-2014 Ben Skeggs <bskeggs@redhat.com> drm/nv50: fill in crtc mode struct members from crtc_mode_fixup

The DRM uses the adjusted mode to calculate constants for vblank
timestamping. Our encoder mode_fixup (usually) replaces this data
with our backend mode information, which doesn't have the needed
data filled in already.

Reported-by: Mario Kleiner mario.kleiner.de@gmail.com
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2332b31116d5500d05173b2a7aaa95ba15d7983a 21-Jan-2014 Ben Skeggs <bskeggs@redhat.com> drm/nouveau: create base display from common code

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
bdefc8cbdfc71ea73e0573dbd2d24c0a68232218 27-Nov-2013 Dan Carpenter <dan.carpenter@oracle.com> drm/nv50/disp: min/max are reversed in nv50_crtc_gamma_set()

We should be taking the minimum here instead of the max. It could lead
to a buffer overflow.

Fixes: 438d99e3b175 ('drm/nvd0/disp: initial crtc object implementation')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

a/drm/nv50_display.c b/drm/nv50_display.c
index f8e66c08b11a..4e384a2f99c3 100644
4b31ebcf69a48d5d70cf26cea080bd0818fdd9af 04-Sep-2013 Ben Skeggs <bskeggs@redhat.com> drm/nv50-/kms: assume analog display connected if load on any pin

Fixes a VGA monitor with a dodgy red (in this case) pin not being
detected.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
5addcf0a5f0fadceba6bd562d0616a1c5d4c1a4d 10-Sep-2012 Dave Airlie <airlied@redhat.com> nouveau: add runtime PM support (v0.9)

This hooks nouveau up to the runtime PM system to enable
dynamic power management for secondary GPUs in switchable
and optimus laptops.

a) rewrite suspend/resume printks to hide them during dynamic s/r
to avoid cluttering logs
b) add runtime pm suspend to irq handler, crtc display, ioctl handler,
connector status,
c) handle hdmi audio dynamic power on/off using magic register.

v0.5:
make sure we hit D3 properly
fix fbdev_set_suspend locking interaction, we only will poweroff if we have no
active crtcs/fbcon anyways.
add reference for active crtcs.
sprinkle mark last busy for autosuspend timeout

v0.6:
allow more flexible debugging - to avoid log spam
add option to enable/disable dynpm
got to D3Cold

v0.7:
add hdmi audio support.

v0.8:
call autosuspend from idle, so pci config space access doesn't go straight
back to sleep, this makes starting X faster.
only signal usage if we actually handle the irq, otherwise usb keeps us awake.
fix nv50 display active powerdown

v0.9:
use masking function to enable hdmi audio
set busy when we fail to suspend

Signed-off-by: Dave Airlie <airlied@redhat.com>
8dda53fca24789acf891ef31a3c5e03332b43cce 08-Jul-2013 Ben Skeggs <bskeggs@redhat.com> drm/nv50/kms: fix pin refcnt leaks

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>
dceef5d87cc01358cc1434416f3272e2ddc3d97a 04-Mar-2013 Ben Skeggs <bskeggs@redhat.com> drm/nouveau/fb: initialise vram controller as pfb sub-object

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
d40ee48acde16894fb3b241d7e896d5fa84e0f10 03-Jun-2013 Ben Skeggs <bskeggs@redhat.com> drm/nv50/kms: use dac loadval from vbios, where it's available

Regression from merging the old nv50/nvd9 code together, and may be
needed to fully fix fdo#64904.

The value is ignored completely by the hardware starting from nva3.

Reported-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
e5398b23a5cdcd1f4901cbce0933937b5509dc72 30-Mar-2013 Ben Skeggs <bskeggs@redhat.com> drm/nvf0/disp: expose display class 2.2

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
b1ea3e6e3883c5191caa5be72b3a5b9c32812e38 08-Apr-2013 Calvin Owens <jcalvinowens@gmail.com> drm/nouveau: fix unconditional return waiting on memory

Typo in nv50_display_flip_wait allows page flipping to run ahead before
memory has time to settle.

Signed-off-by: Calvin Owens <jcalvinowens@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
f60b6e7a6078ceae438a95b808be04cd98f9909a 19-Mar-2013 Ben Skeggs <bskeggs@redhat.com> drm/nv50/kms: prevent lockdep false-positive in page flipping path

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
94f54f5336aac6801f2a14dcb12467e41b35456a 05-Mar-2013 Ben Skeggs <bskeggs@redhat.com> drm/nv50: encoder creation failure doesn't mean full init failure

It's meant as a notification only, not a fatal error.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9f9bdaaf07dee47f73a160e6e4c64f67ee26c1d7 02-Mar-2013 Ben Skeggs <bskeggs@redhat.com> drm/nv50-: prevent some races between modesetting and page flipping

nexuiz-glx + gnome-shell is able to trigger this a lot of the time.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
67f9718b084ea7100cefa39b02863fcb14102f8c 25-Feb-2013 Ben Skeggs <bskeggs@redhat.com> drm/nv84: fix regression in page flipping

Need to emit the semaphore ctxdma before trying to use the semaphore
operations.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
eff76ed7881842ffcd2d77cf217eabcb1134b38b 20-Feb-2013 Ben Skeggs <bskeggs@redhat.com> drm/nv50-/kms: remove UPDATE methods after each encoder disconnect

Supervisor can now handle more than one operation within a single
series of interrupts.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
eb6313add6dddf07ea3e50c4caa33a9c3b2379f1 11-Feb-2013 Ben Skeggs <bskeggs@redhat.com> drm/nv50: initial kms support for off-chip TMDS/DP encoders

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
5a885f0b757ba4483d790c40813d8a66278bdda7 20-Feb-2013 Ben Skeggs <bskeggs@redhat.com> drm/nv50-/kms: remove unnecessary wait-for-completion points

DP link training is now handled as part of the supervisor processing,
and can no longer race with it.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
0a0afd282fd715dd63d64b243299a64da14f8e8d 19-Feb-2013 Ben Skeggs <bskeggs@redhat.com> drm/nv50-/disp: move DP link training to core and train from supervisor

We need to be able to do link training for PIOR-connected ANX9805 from
the third supervisor handler (due to script ordering in the bios, can't
have the "user" call train because some settings are overwritten from
the modesetting bios scripts).

This moves link training for SOR-connected DP encoders to the second
supervisor interrupt, *before* we call the modesetting scripts (yes,
different ordering from PIOR is necessary). This is useful since we
should now be able to remove some hacks to workaround races between
the supervisor and link training paths.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
5cc027f6b1ec651c18a4322ed3e30c6e9cf01e96 18-Feb-2013 Ben Skeggs <bskeggs@redhat.com> drm/nv50-/disp: handle supervisor tasks from workqueue

i2c_algo_bit sleeps...

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
5ed502096f698b978c12a435f04be5afb195b485 11-Feb-2013 Ben Skeggs <bskeggs@redhat.com> drm/nouveau: store i2c port pointer directly in nouveau_encoder

This is about to become somewhat more complicated to determine in a
number of cases, so store the "common" case (DDC/AUX) directly inside
the encoder structure.

Pre-nv50 code not touched except to fill the pointer, don't care.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
a34caf78f26bda63869471cb3f46f354f4658758 14-Feb-2013 Ben Skeggs <bskeggs@redhat.com> drm/nv84/fence: access fences with full virtual address, not offset

Allows most of the code to be shared between nv84/nvc0 implementations,
and paves the way for doing emit/sync on non-VRAM buffers (multi-gpu,
dma-buf).

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
e2de179458fe681a1a7c63b5911a8dc86b00ca44 11-Feb-2013 Ben Skeggs <bskeggs@redhat.com> drm/nv50/disp: fix missing sor modectrl sync flags

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
59ad1465423d968f06f243bc52cc3b1a320a27cf 02-Dec-2012 Daniel Vetter <daniel.vetter@ffwll.ch> drm/nouveau: protect evo_wait/evo_kick sections with a channel mutex

With per-crtc locks modeset operations can run in parallel, and the
cursor code uses the device-global evo master channel for hw frobbing.
But the pageflip code can also sync with the master under some
circumstances. Hence just wrap things up in a mutex to ensure that
pushbuf access doesn't intermingle.

The approach here is a bit overkill since the per-crtc channels used
to schedule the pageflips could probably be used without this pushbuf
locking, but I'm not familiar enough with the nouveau codebase to be
sure of that.

v2: Add missing mutex_init to avoid angering lockdep.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
04c8c21085e13011a2eaf3ae518ab44e23e21917 25-Nov-2012 Marcin Slusarz <marcin.slusarz@gmail.com> drm/nouveau: unpin various bo's before destroying

These objects leak VRAM - but only on module unload.

Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
bf2c886a857dcf61f2354796a8858a230f2737fa 21-Nov-2012 Ben Skeggs <bskeggs@redhat.com> drm/nouveau/disp: add support for 10bpc over DisplayPort

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
e225f446a0808ce38b124df489d0568c05c3057a 21-Nov-2012 Ben Skeggs <bskeggs@redhat.com> drm/nouveau: rename nvd0_display to nv50_display to reflect reality since merge

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
4f6029da58ba9204c98e33f4f3737fe085c87a6f 16-Nov-2012 Ben Skeggs <bskeggs@redhat.com> drm/nv50-nvc0: switch to common disp impl, removing previous version

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
186ecad21c854385823a430b1402053ae7fd59dc 08-Nov-2012 Ben Skeggs <bskeggs@redhat.com> drm/nv50/disp: move remaining interrupt handling into core

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2d0aca211994241c36f2bcfff7141e708f66b005 09-Nov-2012 Ben Skeggs <bskeggs@redhat.com> drm/nv50/disp: allocate display from driver core

EVO channels still handled "manually", this won't be ported here, and
will instead be held off until nv50_display/nvd0_display are merged.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9da49599a70eceac405287f34485ed57fe035393 21-Nov-2012 Ben Skeggs <bskeggs@redhat.com> drm/nouveau: remove newline-only NV_DEBUG calls

This used to output the function name, now doesn't, so just looks
stupid.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
77145f1cbdf8d28b46ff8070ca749bad821e0774 31-Jul-2012 Ben Skeggs <bskeggs@redhat.com> drm/nouveau: port remainder of drm code, and rip out compat layer

v2: Ben Skeggs <bskeggs@redhat.com>
- fill in nouveau_pm.dev to prevent oops
- fix ppc issues (build + OF shadow)

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
ebb945a94bba2ce8dff7b0942ff2b3f2a52a0a69 20-Jul-2012 Ben Skeggs <bskeggs@redhat.com> drm/nouveau: port all engines to new engine module format

This is a HUGE commit, but it's not nearly as bad as it looks - any problems
can be isolated to a particular chipset and engine combination. It was
simply too difficult to port each one at a time, the compat layers are
*already* ridiculous.

Most of the changes here are simply to the glue, the process for each of the
engine modules was to start with a standard skeleton and copy+paste the old
code into the appropriate places, fixing up variable names etc as needed.

v2: Marcin Slusarz <marcin.slusarz@gmail.com>
- fix find/replace bug in license header

v3: Ben Skeggs <bskeggs@redhat.com>
- bump indirect pushbuf size to 8KiB, 4KiB barely enough for userspace and
left no space for kernel's requirements during GEM pushbuf submission.
- fix duplicate assignments noticed by clang

v4: Marcin Slusarz <marcin.slusarz@gmail.com>
- add sparse annotations to nv04_fifo_pause/nv04_fifo_start
- use ioread32_native/iowrite32_native for fifo control registers

v5: Ben Skeggs <bskeggs@redhat.com>
- rebase on v3.6-rc4, modified to keep copy engine fix intact
- nv10/fence: unmap fence bo before destroying
- fixed fermi regression when using nvidia gr fuc
- fixed typo in supported dma_mask checking

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
f589be88caf32501a734e531180d5df5d6089ef3 22-Jul-2012 Ben Skeggs <bskeggs@redhat.com> drm/nouveau/pageflip: kick flip handling out of engsw and into fence

This is all very much a policy thing, and hence will not belong in SW
after the rework.

engsw now only handles receiving the event to say "can flip now" and makes
a callback to perform the actual work.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
3863c9bc887e9638a9d905d55f6038641ece78d6 14-Jul-2012 Ben Skeggs <bskeggs@redhat.com> drm/nouveau/instmem: completely new implementation, as a subdev module

v2 (Ben Skeggs):
- some fixes for 64KiB PAGE_SIZE
- fix porting issues in (currently unused) nv41/nv44 pciegart code

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
5a5c7432bbbd2e318dff107b4ff960ab543a7cef 11-Jul-2012 Ben Skeggs <bskeggs@redhat.com> drm/nouveau/timer: port to subdev interfaces

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
cb75d97e9c77743ecfcc43375be135a55a4d9b25 11-Jul-2012 Ben Skeggs <bskeggs@redhat.com> drm/nouveau: implement devinit subdev, and new init table parser

v2:
- make sure not to execute display scripts unless resuming

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
02a841d434513c7b3620250271c372fabce56de5 04-Jul-2012 Ben Skeggs <bskeggs@redhat.com> drm/nouveau: restructure source tree, split core from drm implementation

Future work will be headed in the way of separating the policy supplied by
the nouveau drm module from the mechanisms provided by the driver core.

There will be a couple of major classes (subdev, engine) of driver modules
that have clearly defined tasks, and the further directory structure change
is to reflect this.

No code changes here whatsoever, aside from fixing up a couple of include
file pathnames.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
760285e7e7ab282c25b5e90816f7c47000557f4f 02-Oct-2012 David Howells <dhowells@redhat.com> UAPI: (Scripted) Convert #include "..." to #include <path/...> in drivers/gpu/

Convert #include "..." to #include <path/...> in drivers/gpu/.

Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Acked-by: Dave Jones <davej@redhat.com>
0ade74b6c6843892b52e6c2a4ac02183242eec27 08-May-2012 Ben Skeggs <bskeggs@redhat.com> drm/nv50: extend vblank semaphore to generic dmaobj + offset pair

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
35bcf5d55540e47091a67e5962f12b88d51d7131 30-Apr-2012 Ben Skeggs <bskeggs@redhat.com> drm/nouveau: move flip-related channel setup to software engine

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
20abd1634a6e2eedb84ca977adea56b8aa06cc3e 30-Apr-2012 Ben Skeggs <bskeggs@redhat.com> drm/nouveau: create real execution engine for software object class

Just a cleanup more or less, and to remove the need for special handling of
software objects.

This removes a heap of documentation on dma/graph object formats. The info
is very out of date with our current understanding, and is far better
documented in rnndb in envytools git.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
a8f81837c506aba186b42f0c67633e85851395b1 20-Apr-2012 Ben Skeggs <bskeggs@redhat.com> drm/nv50/disp: fixup error paths in crtc object creation

Reported-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6d597027755b2eed4298b85ebe3cb5c93b29d1a9 01-Apr-2012 Ben Skeggs <bskeggs@redhat.com> drm/nouveau: use the same packet header macros as userspace

Cosmetic cleanup only.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
b5b2e5988bd18a2f6e3f192adf7439599de00d3f 15-Mar-2012 Ben Skeggs <bskeggs@redhat.com> 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>
8663bc7cde00c8e832d985354f8a6d57a52f7d92 09-Mar-2012 Ben Skeggs <bskeggs@redhat.com> 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>
e495d0d7e36298f76336fdc58685ac4cacd454ba 23-Jan-2012 Ben Skeggs <bskeggs@redhat.com> 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>
52c4d767437b40b0cbc02d6a4480abb45ace64bb 23-Nov-2011 Ben Skeggs <bskeggs@redhat.com> drm/nouveau: move hpd enable/disable to common code

No idea why I didn't do this initially... NVD9 HPD is now enabled.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
a0b25635515ef5049f93b032a1e37f18b16e0f6f 21-Nov-2011 Ben Skeggs <bskeggs@redhat.com> drm/nouveau/gpio: reimplement as nouveau_gpio.c, fixing a number of issues

- moves out of nouveau_bios.c and demagics the logical state definitions
- simplifies chipset-specific driver interface
- makes most of gpio irq handling common, will use for nv4x hpd later
- api extended to allow both direct gpio access, and access using the
logical function states
- api extended to allow for future use of gpio extender chips
- pre-nv50 was handled very badly, the main issue being that all GPIOs
were being treated as output-only.
- fixes nvd0 so gpio changes actually stick, magic reg needs bashing

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
befb51e9c97e783c86a1da27bdda3a638d2f02c7 18-Nov-2011 Ben Skeggs <bskeggs@redhat.com> drm/nouveau/disp: parse connector info directly in nouveau_connector.c

Another case where we parsed vbios data to some structs, then again use
that info once to construct another set of data. Skip the intermediate
step.

This is also slightly improved in that we can now use DCB 3.x connector
table info, which will allow NV4x to gain hotplug support, and to make
quirks for SPWG LVDS panels unnecessary.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
1772fcc6f8af681a6e08f5cca15e86e710efe809 09-Nov-2011 Ben Skeggs <bskeggs@redhat.com> drm/nv50/disp: fix evo for create/init + destroy/fini split

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2a44e4997c5fee8e1da1589ff57e0bd1c53f03ce 09-Nov-2011 Ben Skeggs <bskeggs@redhat.com> drm/nouveau/disp: introduce proper init/fini, separate from create/destroy

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
020c6bf39488c4dd162bafed04b631b98f85d9f0 29-Oct-2011 Ben Skeggs <bskeggs@redhat.com> drm/nv50/disp: stricter check for evo being active on init

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Tested-by: Martin Peres <martin.peres@labri.fr>
0f6ea564dec79271878b03884a978062bf86eb2a 14-Oct-2011 Ben Skeggs <bskeggs@redhat.com> drm/nv50/disp: completely reset disp if master evo channel active at init

Should fix issues with kexec, and as a nice side bonus, the code to avoid
having PDISP disappear will also fix hibernate on those effected systems.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
b98e3f5c9e42f70c171f67331773a575441eab3b 14-Oct-2011 Ben Skeggs <bskeggs@redhat.com> drm/nv50/disp: synchronise display right after init

This has the effect of ensuring the encoders which were active before we
loaded get disconnected properly before we start reprogramming them.

Also removing a bit of cargo-cult from the initial evo pushbuf.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
e6e039d10d08fbdecbdcaf20f29bb7a8c8580d4b 14-Oct-2011 Ben Skeggs <bskeggs@redhat.com> drm/nv50/disp: move sync routine to where it can be used by other modules

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
a55b68e06b593ef7311f4a1cf9d3ae349ef7e9ed 09-Nov-2011 Ben Skeggs <bskeggs@redhat.com> drm/nv50/disp: silence compiler warning

NFI why this only started appearing now. The use of the uninitialised var
can't actually happen, so perhaps my compiler just got stupider.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
46959b7790e3609e795c3b5e70e58dcd22c9e207 01-Jul-2011 Ben Skeggs <bskeggs@redhat.com> drm/nouveau/dp: remove reliance on vbios for native displayport

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
02e4f5877dc7b963b3dd2beaf9664cf29c12d728 06-Jul-2011 Ben Skeggs <bskeggs@redhat.com> drm/nouveau/bios: allow passing in crtc to the init table parser

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
048a88595a66526f68636b51b1cdb5842bc0f28c 04-Jul-2011 Ben Skeggs <bskeggs@redhat.com> drm/nouveau: make general drm modesetting init common

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
3d483d575bfba52eae04bf2575239642c26c355a 07-Jun-2011 Ben Skeggs <bskeggs@redhat.com> drm/nvc0: explicitly map PDISP semaphore buffer into each channel's vm

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
180cc30637b47dafa26e3202a41964b5ebdab365 07-Jun-2011 Ben Skeggs <bskeggs@redhat.com> drm/nouveau: convert bo.mem.start usage to bo.offset

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
f66b3d5540994cb92182312be24944864cec5a16 16-Jun-2011 Ben Skeggs <bskeggs@redhat.com> drm/nv50/disp: fix gamma with page flipping overlay turned on

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
b23b9e7109e74a2cb10705396148624016ad8f8f 18-Apr-2011 Ben Skeggs <bskeggs@redhat.com> drm/nv50: respect LVDS link count from EDID on SPWG panels

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
cdccc70eff1eaf3627a716374f9ebc115fc4621c 07-Feb-2011 Ben Skeggs <bskeggs@redhat.com> drm/nv50-nvc0: initialise display sync channels

Also imports a couple of helper functions that'll be used to implement
page flipping in the following commits..

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
60f60bf1bc45bef38568244f5c4e0d0f105c5032 03-Feb-2011 Ben Skeggs <bskeggs@redhat.com> drm/nv50-nvc0: request and wait on notification of modeset completion

This should prevent a number of races from occuring, the most obvious of
which will be exposed when we start making use of the "display sync" evo
channel for page flipping. The DS channel will reject any command stream
that doesn't completely agree with the current "master" state.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
f13e435c59573aa0ac398210777cc0406c476593 03-Feb-2011 Ben Skeggs <bskeggs@redhat.com> drm/nv50-nvc0: switch to tasklet for display isr bh

We need to be able to have the bh run while possibly spinning waiting for
the EVO notifier to signal. This apparently happens in some circumstances
with preempt disabled, so our workqueue was never being run.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
8348f36d89d1c9630580932931aca51b6069097a 03-Feb-2011 Ben Skeggs <bskeggs@redhat.com> drm/nv50-nvc0: include nv50_display in evo debugging

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
59c0f5780f21ef10428bdaccd9999879f38225bc 01-Feb-2011 Ben Skeggs <bskeggs@redhat.com> drm/nv50-nvc0: rename disp->evo to disp->master

More appropriate, and we're about to be using more than just the master
EVO channel.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
ef8389a84bbd80daaf6c60a5534461d82ba22c0a 01-Feb-2011 Ben Skeggs <bskeggs@redhat.com> drm/nv50-nvc0: move non-sharable display state into private structure

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
d82f8e6c802bb1244ce590d3877f7c66a8fb0ff0 26-Jan-2011 Tejun Heo <tj@kernel.org> drm/nouveau: use system_wq instead of dev_priv->wq

With cmwq, there's no reason for nouveau to use a dedicated workqueue.
Drop dev_priv->wq and use system_wq instead. Each work item is sync
flushed when the containing structure is unregistered/destroyed.

Note that this change also makes sure that nv50_gpio_handler is not
freed while the contained work item is still running.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: David Airlie <airlied@linux.ie>
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
ea5f2786a0942832f32deb7c507531b766028356 30-Jan-2011 Ben Skeggs <bskeggs@redhat.com> drm/nouveau: silence some compiler warnings

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
fce2bad0ee2666d6a10bfeb634b1021469cc3d79 11-Nov-2010 Ben Skeggs <bskeggs@redhat.com> drm/nv50: rework PGPIO IRQ handling and hotplug detection

Allows callers to install their own handlers for when a GPIO line
changes state (such as for hotplug detect).

This also fixes a bug where we weren't acknowledging the GPIO IRQ
until after the bottom half had run, causing a severe IRQ storm
in some cases.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
19b7fc7bf59f4bf02ee738a79baaccae31220df3 03-Nov-2010 Ben Skeggs <bskeggs@redhat.com> drm/nv50: use register/unregister functionality for PDISPLAY ISR

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2cbd4c818578ef8f2e486dc77267ead1e503c637 03-Nov-2010 Ben Skeggs <bskeggs@redhat.com> drm/nv50: move GPIO ISR to nv50_gpio.c

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
1f6d2de2c539df6fe52ad2187191a9dfe10c7233 24-Oct-2010 Francisco Jerez <currojerez@riseup.net> drm/nv50: Keep track of the head a channel is vsync'ing to.

In a multihead setup vblank interrupts may end up enabled in both
heads. In that case we want to ignore the vblank interrupts coming
from the wrong CRTC to avoid tearing and unbalanced calls to
drm_vblank_get/put (fdo bug 31074).

Reported-by: Felix Leimbach <felix.leimbach@gmx.net>
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
042206c0cd4924879c4292c5ffa2bf1e8023ae5a 21-Oct-2010 Francisco Jerez <currojerez@riseup.net> drm/nouveau: Implement the vblank DRM hooks.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
97e2000f757c19bb53e032320669f9a0d0b2a989 20-Oct-2010 Ben Skeggs <bskeggs@redhat.com> drm/nv50: improve evo error handler when more than just channel 0 active

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
b7bc613a4cc08d867b43189c2af0bb83b1fa1dc6 19-Oct-2010 Ben Skeggs <bskeggs@redhat.com> drm/nv50: move evo handling to nv50_evo.c

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
106ddad5aa8e8e03503cea05f9a64611f849952f 19-Oct-2010 Ben Skeggs <bskeggs@redhat.com> drm/nv50: clearer separation of the stages of evo init

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
cbb4b608b603c7fba4c1cf5b298d1aa23d3fdd22 17-Oct-2010 Ben Skeggs <bskeggs@redhat.com> drm/nv50: remove some unnecessary PDISPLAY init

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
ab838338a2a9e0cb8346eb0cab9977be13e8dce5 17-Nov-2010 Andy Lutomirski <luto@mit.edu> nouveau: Acknowledge HPD irq in handler, not bottom half

The old code generated an interrupt storm bad enough to completely
take down my system.

Signed-off-by: Andy Lutomirski <luto@mit.edu>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
d961db75ce86a84f1f04e91ad1014653ed7d9f46 05-Aug-2010 Ben Skeggs <bskeggs@redhat.com> drm/ttm: restructure to allow driver to plug in alternate memory manager

Nouveau will need this on GeForce 8 and up to account for the GPU
reordering physical VRAM for some memory types.

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Acked-by: Thomas Hellström <thellstrom@vmware.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
4b5c152a79d512803ea525b0878ccef627cd1629 07-Sep-2010 Francisco Jerez <currojerez@riseup.net> drm/nouveau: Remove implicit argument from nv_wait().

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
8597a1ba376e03229835a0e4215a7a4cb1dcaa32 06-Sep-2010 Ben Skeggs <bskeggs@redhat.com> drm/nv50: fix SOR count for early chipsets

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
a8eaebc6c52bb0cd243b4cb421068f42d378be9c 01-Sep-2010 Ben Skeggs <bskeggs@redhat.com> drm/nouveau: remove nouveau_gpuobj_ref completely, replace with sanity

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
de3a6c0a3b642c0c350414d63298a1b19a009290 01-Sep-2010 Ben Skeggs <bskeggs@redhat.com> drm/nouveau: rebase per-channel pramin heap offsets to 0

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
b3beb167af0de6d7cb03aed0687eca645cfd06a6 01-Sep-2010 Ben Skeggs <bskeggs@redhat.com> drm/nouveau: modify object accessors, offset in bytes rather than dwords

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9d59e8a1fc8fc35bf22dc92d7722a7502769ab7e 27-Aug-2010 Ben Skeggs <bskeggs@redhat.com> drm/nouveau: require explicit unmap of kmapped bos

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
0165d15dba2cec6ae2e6eb9c4eb6f2a5b38d4944 04-Aug-2010 Ben Skeggs <bskeggs@redhat.com> drm/nvc0: fix evo dma object so we display something

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
0ccb3a75fe81ec3c4ceb7344c34d0497cbabb369 26-Jul-2010 Ben Skeggs <bskeggs@redhat.com> drm/nv50: fix some not-error error messages

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
ee2e013131dcf6427334663662dbe760ccdba735 26-Jul-2010 Ben Skeggs <bskeggs@redhat.com> drm/nouveau: introduce gpio engine

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
c88c2e0631b03ffb1485f8790a5b659beb1ac0be 24-Jul-2010 Francisco Jerez <currojerez@riseup.net> drm/nouveau: Move display init to a new nouveau_engine.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
d0875edd9374296af8702d850254809e34a809cd 23-Jul-2010 Ben Skeggs <bskeggs@redhat.com> drm/nv50: add function to control GPIO IRQ reporting

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
271f29e7b55278bc2e4bab53448eef9b35778664 09-Jul-2010 Ben Skeggs <bskeggs@redhat.com> drm/nv50: move dp_set_tmds() function to happen in the last display irq

It seems on some chipsets that doing this from the 0x20 handler causes the
display engine to not ever signal the final 0x40 stage.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
946cbc825adfa8189a035346d5f7ff31c32b549d 09-Jul-2010 Ben Skeggs <bskeggs@redhat.com> drm/nv50: fix dp_set_tmds to work on the right OR

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
f56cb86f9abd229418f894a8ffedfb9ff465c181 08-Jul-2010 Ben Skeggs <bskeggs@redhat.com> drm/nouveau: add instmem flush() hook

This removes the previous prepare_access() and finish_access() hooks, and
replaces it with a much simpler flush() hook.

All the chipset-specific code before nv50 has its use removed completely,
as it's not required there at all.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
87c0e0e5133e252a6d3d561dd0caeec0244ea9a5 06-Jul-2010 Ben Skeggs <bskeggs@redhat.com> drm/nv50: rewrite display irq handler

The previous handler basically worked correctly for a full-blown mode
change. However, it did nothing at all when a partial (encoder only)
reconfiguation was necessary, leading to the display hanging on certain
types of mode switch.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
7149eee87a020cb81c52e9653a44c5f9e7c2a0d9 30-Jun-2010 Ben Skeggs <bskeggs@redhat.com> drm/nv50: fix DP->DVI if output has been programmed for native DP previously

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
8f1a60868f4594bc5576cca8952635f475e8bec6 28-Jun-2010 Ben Skeggs <bskeggs@redhat.com> drm/nouveau: tidy connector/encoder creation a little

Create connectors before encoders to avoid having to do another loop across
encoder list whenever we create a new connector. This allows us to pass
the connector to the encoder creation functions, and avoid using a
create_resources() callback since we can now call it directly.

This can also potentially modify the connector ordering on nv50. On cards
where the DCB connector and encoder tables are in the same order, things
will be unchanged. However, there's some cards where the ordering between
the tables differ, and in one case, leads us to naming the connectors
"wrongly".

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
b833ac26f1f1c8e8d9149d83dbdd91432f2807d5 01-Jun-2010 Ben Skeggs <bskeggs@redhat.com> drm/nouveau: use drm_mm in preference to custom code doing the same thing

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
afa3b4c37772f21b69980c155515927fdecd3a27 23-Apr-2010 Ben Skeggs <bskeggs@redhat.com> drm/nv50: fix suspend/resume with DP outputs

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
eb1f8e4f3be898df808e2dfc131099f5831d491d 07-May-2010 Dave Airlie <airlied@redhat.com> drm/fbdev: rework output polling to be back in the core. (v4)

After thinking it over a lot it made more sense for the core to deal with
the output polling especially so it can notify X.

v2: drop plans for fake connector - per Michel's comments - fix X patch sent to xorg-devel, add intel polled/hpd setting, add initial nouveau polled/hpd settings.

v3: add config lock take inside polling, add intel/nouveau poll init/fini calls

v4: config lock was a bit agressive, only needed around connector list reading.
otherwise it could re-enter.

glisse: discard drm_helper_hpd_irq_event

v3: Reviewed-by: Michel Dänzer <michel@daenzer.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
a5acac66685397a73bed8638114262520565e41c 30-Mar-2010 Ben Skeggs <bskeggs@redhat.com> drm/nv50: punt hotplug irq handling out to workqueue

On DP outputs we'll likely end up running vbios init tables here, which
may sleep.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
a1663ed3412f4b94edcf30b271c9db3ace533605 25-Mar-2010 Ben Skeggs <bskeggs@redhat.com> drm/nv50: cleanup properly if PDISPLAY init fails

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
a76fb4e8ffe42144529e21fe1e609b762e8eb5cc 18-Mar-2010 Ben Skeggs <bskeggs@redhat.com> drm/nouveau: detect vram amount once, and save the value

As opposed to repeatedly reading the amount back from the GPU every
time we need to know the VRAM size.

We should now fail to load gracefully on detecting no VRAM, rather than
something potentially messy happening.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
4abe35204af82a018ca3ce6db4102aa09719698e 30-Mar-2010 Dave Airlie <airlied@redhat.com> drm/kms/fb: use slow work mechanism for normal hotplug also.

a) slow work is always used now for any fbcon hotplug, as its not
a fast task and is more suited to being ran under slow work.

b) attempt to not do any fbdev changes when X is running as we'll
just mess it up. This hooks set_par to hopefully do the changes
once X hands control to fbdev.

This also adds the nouveau/intel hotplug support.

Signed-off-by: Dave Airlie <airlied@redhat.com>
d544d623c5ef3ca14407e8bc042fdf938a966b04 10-Mar-2010 Ben Skeggs <bskeggs@redhat.com> drm/nv50: fix connector table parsing for some cards

The connector table index in the DCB entry for each output type is an
index into the connector table, and does *not* necessarily match up
with what was previously called "index" in the connector table entries
themselves.

Not real sure what that index is exactly, renamed to "index2" as we
still use it to prevent creating multiple TV connectors.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
1157563931dd773df2420b98eef61598205d39ec 24-Feb-2010 Ben Skeggs <bskeggs@redhat.com> drm/nv50: enable hpd on any connector we know the gpio line for

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
7f612d87f8b4b1ddbcee04264a93e5af7b9f21c7 23-Feb-2010 Ben Skeggs <bskeggs@redhat.com> drm/nouveau: use dcb connector table for creating drm connectors

This makes this code common to both the nv04 and nv50 paths.

For the moment, we keep the previous behaviour with HDMI/eDP connectors
and report them as DVI-D/DP instead. This will be fixed once the rest
of the code has been fixed to deal with those types.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
04a39c577f4114a3f098ee8ef0e20f7778b5ddad 24-Feb-2010 Ben Skeggs <bskeggs@redhat.com> drm/nouveau: merge nvbios and nouveau_bios_info

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
7f245b20e30515264b94f6373ef7d721155990a4 24-Feb-2010 Ben Skeggs <bskeggs@redhat.com> drm/nouveau: merge parsed_dcb and bios_parsed_dcb into dcb_table

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
fbe36a7a069267b82b7b82a66d79a4406cfa90b2 20-Dec-2009 Ben Skeggs <bskeggs@redhat.com> drm/nv50: ignore vbios table's claim to the contrary if EDID says >8bpc

Should fix dim panel issues reported on Dell M6400/M6500.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
75c722d7ea70b791d179ec900e7c88bd6d5fd71e 20-Dec-2009 Ben Skeggs <bskeggs@redhat.com> drm/nv50: ignore vbios table's claim to the contrary if EDID says >8bpc

Should fix dim panel issues reported on Dell M6400/M6500.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
ef2bb506687a5f1cc8ef2fef370bb168b2808106 13-Dec-2009 Maarten Maathuis <madman2003@gmail.com> drm/nouveau: use drm debug levels

- Use driver level (0x2) for NV_DEBUG instead of all levels
- Create a NV_DEBUG_KMS for KMS level (0x4) and use them in modesetting code
- Remove a few odd NV_TRACE calls and replace some of them with NV_DEBUG_KMS or
NV_INFO

Signed-off-by: Maarten Maathuis <madman2003@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6ee738610f41b59733f63718f0bdbcba7d3a3f12 11-Dec-2009 Ben Skeggs <bskeggs@redhat.com> drm/nouveau: Add DRM driver for NVIDIA GPUs

This adds a drm/kms staging non-API stable driver for GPUs from NVIDIA.

This driver is a KMS-based driver and requires a compatible nouveau
userspace libdrm and nouveau X.org driver.

This driver requires firmware files not available in this kernel tree,
interested parties can find them via the nouveau project git archive.

This driver is reverse engineered, and is in no way supported by nVidia.

Support for nearly the complete range of nvidia hw from nv04->g80 (nv50)
is available, and the kms driver should support driving nearly all
output types (displayport is under development still) along with supporting
suspend/resume.

This work is all from the upstream nouveau project found at
nouveau.freedesktop.org.

The original authors list from nouveau git tree is:
Anssi Hannula <anssi.hannula@iki.fi>
Ben Skeggs <bskeggs@redhat.com>
Francisco Jerez <currojerez@riseup.net>
Maarten Maathuis <madman2003@gmail.com>
Marcin Kościelnicki <koriakin@0x04.net>
Matthew Garrett <mjg@redhat.com>
Matt Parnell <mparnell@gmail.com>
Patrice Mandin <patmandin@gmail.com>
Pekka Paalanen <pq@iki.fi>
Xavier Chantry <shiningxc@gmail.com>
along with project founder Stephane Marchesin <marchesin@icps.u-strasbg.fr>

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>