Commit Graph

679826 Commits

Author SHA1 Message Date
Ben Skeggs 7d1fede03c drm/nouveau/disp/g94-: port OR DP drive setting control to nvkm_ior
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-06-16 14:04:56 +10:00
Ben Skeggs a1de2b522f drm/nouveau/disp/g94-: port OR DP training pattern control to nvkm_ior
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-06-16 14:04:56 +10:00
Ben Skeggs a3e81117ce drm/nouveau/disp/g94-: port OR DP link power control to nvkm_ior
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-06-16 14:04:55 +10:00
Ben Skeggs 7dc0bac4aa drm/nouveau/disp/g94-: port OR DP link setup to nvkm_ior
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-06-16 14:04:55 +10:00
Ben Skeggs 333781045d drm/nouveau/disp/g94-: port OR DP lane mapping to nvkm_ior
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-06-16 14:04:54 +10:00
Ben Skeggs 797b2fb81b drm/nouveau/disp/g84-: port OR HDMI control to nvkm_ior
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-06-16 14:04:54 +10:00
Ben Skeggs 0df1824662 drm/nouveau/disp/nv50-: port OR manual sink detection to nvkm_ior
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-06-16 14:04:54 +10:00
Ben Skeggs 9c5753bc70 drm/nouveau/disp/nv50-: port OR power state control to nvkm_ior
Also removes the user-facing methods to these controls, as they're not
currently utilised by the DD anyway.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-06-16 14:04:53 +10:00
Ben Skeggs 29c0ca7389 drm/nouveau/disp/nv50-: fetch head/OR state at beginning of supervisor
This data will be used by essentially every part of the supervisor
handling process.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-06-16 14:04:53 +10:00
Ben Skeggs 3607bfd398 drm/nouveau/disp/nv50-: execute supervisor on its own workqueue
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-06-16 14:04:52 +10:00
Ben Skeggs 7d0a01a6de drm/nouveau/disp/dp: train link only when actively displaying an image
This essentially (unless the link becomes unstable and needs to be
re-trained) gives us a single entry-point to link training, during
supervisor handling, where we can ensure all routing is up to date.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-06-16 14:04:52 +10:00
Ben Skeggs 22e008f90d drm/nouveau/disp/dp: only check for re-train when the link is active
An upcoming commit will limit link training to only when the sink is
meant to be displaying an image.

We still need IRQs enabled even when the link isn't trained (for MST
messages), but don't want to train the link unnecessarily.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-06-16 14:04:52 +10:00
Ben Skeggs 49f2b376df drm/nouveau/disp/dp: determine a failsafe link training rate
The aim here is to protect the OR against locking up when something
unexpected happens (such as the display disappearing during modeset,
or the DD misbehaving).

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-06-16 14:04:51 +10:00
Ben Skeggs fafa8b5c9f drm/nouveau/disp/dp: use cached link configuration when checking link status
Saves some trips across the aux channel.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-06-16 14:04:51 +10:00
Ben Skeggs 4423c743ef drm/nouveau/disp/dp: no need for lt_state except during manual link training
This struct doesn't hold link configuration data anymore, so we can
limit its use to internal DP training (anx9805 handles training for
external DP).

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-06-16 14:04:51 +10:00
Ben Skeggs 75eefe95ee drm/nouveau/disp/dp: store current link configuration in nvkm_ior
We care about this information outside of link training.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-06-16 14:04:50 +10:00
Ben Skeggs 02d786ccbc drm/nouveau/disp/dp: remove DP_PWR method
This hasn't been used since atomic.

We may want to re-implement "fast" DPMS at some point, but for now,
this just gets in the way.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-06-16 14:04:50 +10:00
Ben Skeggs 01a976376b drm/nouveau/disp: identity-map display paths to output resources
This essentially replicates our current behaviour in a way that's
compatible with the new model that's emerging, so that we're able
to start porting the hw-specific functions to it.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-06-16 14:04:49 +10:00
Ben Skeggs b3c9c0226c drm/nouveau/disp: fork off some new hw-specific implementations
Upcoming commits make supervisor handling share code between the NV50
and GF119 implementations.  Because of this, and a few other cleanups,
we need to allow some additional customisation.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-06-16 14:04:49 +10:00
Ben Skeggs 78f1ad6f65 drm/nouveau/disp: introduce input/output resource abstraction
In order to properly support the SOR -> SOR + pad macro separation
that occurred with GM20x GPUs, we need to separate OR handling out
of the output path code.

This will be used as the base to support ORs (DAC, SOR, PIOR).

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-06-16 14:04:49 +10:00
Ben Skeggs 57b2d73be2 drm/nouveau/disp: common implementation of scanoutpos method in nvkm_head
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-06-16 14:04:48 +10:00
Ben Skeggs 14187b007e drm/nouveau/disp: move vblank_{get,put} methods into nvkm_head
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-06-16 14:04:48 +10:00
Ben Skeggs a1c930789a drm/nouveau/disp: introduce object to track per-head functions/state
Primarily intended as a way to pass per-head state around during
supervisor handling, and share logic between NV50/GF119.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-06-16 14:04:48 +10:00
Ben Skeggs 4b2b42f8e9 drm/nouveau/disp: delay output path / connector construction until oneinit()
This is to allow hw-specific code to instantiate output resources first,
so we can cull unsupported output paths based on them.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-06-16 14:04:47 +10:00
Ben Skeggs 981a8162e2 drm/nouveau/disp: s/nvkm_connector/nvkm_conn/
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-06-16 14:04:47 +10:00
Ben Skeggs f3e70d2991 drm/nouveau/disp: rename nvkm_output_dp to nvkm_dp
Not all users of nvkm_output_dp have been changed here.  The remaining
ones belong to code that's disappearing in upcoming commits.

This also modifies the debug level of some messages.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-06-16 14:04:46 +10:00
Ben Skeggs d7ce92e273 drm/nouveau/disp: rename nvkm_output to nvkm_outp
This isn't technically "output", but, "display/output path".

Not all users of nvkm_output have been changed here.  The remaining
ones belong to code that's disappearing in upcoming commits.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-06-16 14:04:46 +10:00
Ben Skeggs af85389c61 drm/nouveau/disp: shuffle functions around
Upcoming changes to split OR from output path drastically change the
placement of various operations.

In order to make the real changes clearer, do the moving around part
ahead of time.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-06-16 14:04:46 +10:00
Ben Skeggs 639d72e242 drm/nouveau/kms/nv04: use new devinit script interpreter entry-point
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-06-16 14:04:45 +10:00
Ben Skeggs 4fdc6ba32e drm/nouveau/fb/ram/nv40-: use new devinit script interpreter entry-point
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-06-16 14:04:45 +10:00
Ben Skeggs 28c62976a8 drm/nouveau/devinit: use new devinit script interpreter entry-point
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-06-16 14:04:44 +10:00
Ben Skeggs 74bcb2e98a drm/nouveau/bios/init: add a new devinit script interpreter entry-point
This will ensure unspecified args are easily identified.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-06-16 14:04:44 +10:00
Ben Skeggs b88afa4396 drm/nouveau/bios/init: add or/link args separate from output path
As of DCB 4.1, these are not the same thing.

Compatibility temporarily in place until callers have been updated.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-06-16 14:04:44 +10:00
Ben Skeggs ca9c2d5b28 drm/nouveau/bios/init: bump script offset to 32-bits
No (known) case yet, but other tables have been moving beyond 16-bits,
so we may as well be prepared.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-06-16 14:04:43 +10:00
Ben Skeggs 2195a22f6d drm/nouveau/bios/init: rename 'crtc' to 'head'
Compatibility temporarily in place until all callers have been updated.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-06-16 14:04:43 +10:00
Ben Skeggs 5b0e787ad5 drm/nouveau/bios/init: remove internal use of nvbios_init.bios
We already have a subdev pointer, from which we can locate the device's
BIOS subdev.  No need for a separate pointer.

Structure/callers not updated yet, as I want to batch more changes and
only touch the callers once.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-06-16 14:04:42 +10:00
Ben Skeggs 4bb4a7466a drm/nouveau/bios/init: rename nvbios_init() to nvbios_devinit()
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-06-16 14:04:42 +10:00
Ben Skeggs 7eaf1198a9 drm/nouveau/tmr: remove nvkm_timer_alarm_cancel()
nvkm_timer_alarm() already handles this as part of protecting against
callers passing in no timeout value.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-06-16 14:04:42 +10:00
Karol Herbst 4dc33b1222 drm/nouveau/bios/iccsense: rails for power sensors have a mask of 0xf8 for version 0x10
I only saw those values inside the vbios: 0xff, 0xfd, 0xfc, 0xfa for valid
rails.

No idea what the lower value does, but at least we get power readings on
a lot of Fermi GPUs with that.

v2: add missing parentheses

Signed-off-by: Karol Herbst <karolherbst@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-06-16 14:04:19 +10:00
Karol Herbst c0cd04700f drm/nouveau/bios/volt: Parse min and max for Version 0x40
This is according to what we have in nvbios.

Fixes "ERROR: Can't get value of subfeature in0_min: Can't read" errors
in sensors for some GPUs.

Signed-off-by: Karol Herbst <karolherbst@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-06-16 14:04:19 +10:00
Alastair Bridgewater 0f18d2765a drm/nouveau: Enable stereoscopic 3D output over HDMI
Enable stereoscopic output for HDMI and DisplayPort connectors on
NV50+ (G80+) hardware.  We do not enable stereoscopy on older
hardware in case there is some older board that still has HDMI
output but for which we have no logic for setting the Vendor
InfoFrame.

With this, I get an obvious 3D output when using the "testdisplay"
program from intel-gpu-tools with the "-3" parameter and outputting
to a 3D-capable HDMI display, for all available 3D modes (be they
TB, SBSH, or FP) on all four G80+ DISPs.

Signed-off-by: Alastair Bridgewater <alastair.bridgewater@gmail.com>
2017-06-16 14:04:19 +10:00
Alastair Bridgewater 37aa2243ff drm/nouveau: Handle frame-packing mode geometry and timing effects
Frame-packing modes add an extra vtotal raster lines to each frame
above and beyond what the basic mode description calls for.
Account for this during scaler configuration (possibly a bit of a
hack), during CRTC configuration (clearly not a hack), and when
checking that a mode is valid for a given connector (cribbed from
the i915 driver).

Signed-off-by: Alastair Bridgewater <alastair.bridgewater@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-06-16 14:04:18 +10:00
Alastair Bridgewater a897074350 drm/nouveau/disp/gk104-: Use supplied HDMI InfoFrames
Now that we have the InfoFrame data being provided, for the most
part, program the hardware to use it.

While we're here, and since the functionality will come in handy
for supporting 3D stereoscopy, implement setting the Vendor
("generic"?) InfoFrame.

Also don't enable any InfoFrame that is not provided, and disable
the Vendor InfoFrame when disabling the output.

Signed-off-by: Alastair Bridgewater <alastair.bridgewater@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-06-16 14:04:18 +10:00
Alastair Bridgewater 2709b275c5 drm/nouveau/disp/gf119: Use supplied HDMI InfoFrames
Now that we have the InfoFrame data being provided, for the most
part, program the hardware to use it.

While we're here, and since the functionality will come in handy
for supporting 3D stereoscopy, implement setting the Vendor
("generic"?) InfoFrame.

Also don't enable any InfoFrame that is not provided, and disable
the Vendor InfoFrame when disabling the output.

Signed-off-by: Alastair Bridgewater <alastair.bridgewater@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-06-16 14:04:18 +10:00
Alastair Bridgewater ba32836879 drm/nouveau/disp/gt215: Use supplied HDMI InfoFrames
Now that we have the InfoFrame data being provided, for the most
part, program the hardware to use it.

While we're here, and since the functionality will come in handy
for supporting 3D stereoscopy, implement setting the Vendor
("generic") InfoFrame.

Also don't enable any AVI or Vendor InfoFrame that is not provided,
and disable the Vendor InfoFrame when disabling the output.

Ignore the Audio InfoFrame: We don't supply it, and altering HDMI
audio semantics (for better or worse) on this hardware is out of
scope for me at this time.

Signed-off-by: Alastair Bridgewater <alastair.bridgewater@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-06-16 14:04:18 +10:00
Alastair Bridgewater a45f7908b3 drm/nouveau/disp/g84-gt200: Use supplied HDMI InfoFrames
Now that we have the InfoFrame data being provided, for the most
part, program the hardware to use it.

While we're here, and since the functionality will come in handy
for supporting 3D stereoscopy, implement setting the Vendor
("generic"?) InfoFrame.

Also don't enable any AVI or Vendor InfoFrame that is not provided,
and disable the Vendor InfoFrame when disabling the output.

Ignore the Audio InfoFrame: We don't supply it, and altering HDMI
audio semantics (for better or worse) on this hardware is out of
scope for me at this time.

Signed-off-by: Alastair Bridgewater <alastair.bridgewater@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-06-16 14:04:18 +10:00
Alastair Bridgewater f60213c0ee drm/nouveau/disp: Add mechanism to convert HDMI InfoFrames to hardware format
HDMI InfoFrames are passed to NVKM as bags of bytes, but the
hardware needs them to be packed into words.  Rather than having
four (or more) copies of the packing logic introduce a single copy
now, in a central place.

We currently need these for AVI and Vendor InfoFrames, but we may
also expect to need them for Audio InfoFrames at some point.

Signed-off-by: Alastair Bridgewater <alastair.bridgewater@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-06-16 14:04:18 +10:00
Alastair Bridgewater 34fd3e5d8c drm/nouveau: Pass mode-dependent AVI and Vendor HDMI InfoFrames to NVKM
Now that we have mechanism by which to pass mode-dependent HDMI
InfoFrames to the low-level hardware driver, it is incumbent upon
us to do so.

Signed-off-by: Alastair Bridgewater <alastair.bridgewater@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-06-16 14:04:18 +10:00
Alastair Bridgewater 31fe2c2002 drm/nouveau/disp/g84-: Extend NVKM HDMI power control method to set InfoFrames
The nouveau driver, in the Linux 3.7 days, used to try and set the
AVI InfoFrame based on the selected display mode.  These days, it
uses a fixed set of InfoFrames.  Start to correct that, by
providing a mechanism whereby InfoFrame data may be passed to the
NVKM functions that do the actual configuration.

At this point, only establish the new parameters and their parsing,
don't actually use the data anywhere yet (since it's not supplied
anywhere).

Signed-off-by: Alastair Bridgewater <alastair.bridgewater@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-06-16 14:04:18 +10:00
Alastair Bridgewater 35dd9874bf drm/nouveau: Clean up nv50_head_atomic_check_mode() and fix blankus calculation
drm_mode_set_crtcinfo() does compensation for interlace and
doublescan timing effects already, so do it first and use the
compensated figures instead of the constant "vscan / ilace" terms
that we had before.

And then it turns out that the hardware model for how the timing
parameters are configured is basically the standard model, but
starting one clock before the sync pulse rather than at the start
of the display area, which lets us drastically simplify the
overall timing calculations (verifying the changes by algebraic
operations is left as an exercise for the reader).

Finally, there were a couple of issues with the computation of
m->v.blankus that are addressed here.  Interlaced modes would
generate a negative intermediate result.  Double scan modes would
generate an overestimate rather than an underestimate.  And when
enabling frame-packing modes, a rather extreme overestimate would
be generated.  Fixed, by using the timings as adjusted for the
CRTC to find the length of the vertical blanking period instead of
mixing adjusted and pre-adjustment timing parameters.

Signed-off-by: Alastair Bridgewater <alastair.bridgewater@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-06-16 14:04:18 +10:00