openwrt/staging/blogic.git
7 years agodrm/nouveau/disp/gf119-: port OR DP VCPI control to nvkm_ior
Ben Skeggs [Fri, 19 May 2017 13:59:35 +0000 (23:59 +1000)]
drm/nouveau/disp/gf119-: port OR DP VCPI control to nvkm_ior

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
7 years agodrm/nouveau/disp/gt215-: port HDA ELD controls to nvkm_ior
Ben Skeggs [Fri, 19 May 2017 13:59:35 +0000 (23:59 +1000)]
drm/nouveau/disp/gt215-: port HDA ELD controls to nvkm_ior

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
7 years agodrm/nouveau/disp/g94-: port OR DP drive setting control to nvkm_ior
Ben Skeggs [Fri, 19 May 2017 13:59:35 +0000 (23:59 +1000)]
drm/nouveau/disp/g94-: port OR DP drive setting control to nvkm_ior

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
7 years agodrm/nouveau/disp/g94-: port OR DP training pattern control to nvkm_ior
Ben Skeggs [Fri, 19 May 2017 13:59:35 +0000 (23:59 +1000)]
drm/nouveau/disp/g94-: port OR DP training pattern control to nvkm_ior

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
7 years agodrm/nouveau/disp/g94-: port OR DP link power control to nvkm_ior
Ben Skeggs [Fri, 19 May 2017 13:59:35 +0000 (23:59 +1000)]
drm/nouveau/disp/g94-: port OR DP link power control to nvkm_ior

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
7 years agodrm/nouveau/disp/g94-: port OR DP link setup to nvkm_ior
Ben Skeggs [Fri, 19 May 2017 13:59:35 +0000 (23:59 +1000)]
drm/nouveau/disp/g94-: port OR DP link setup to nvkm_ior

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
7 years agodrm/nouveau/disp/g94-: port OR DP lane mapping to nvkm_ior
Ben Skeggs [Fri, 19 May 2017 13:59:35 +0000 (23:59 +1000)]
drm/nouveau/disp/g94-: port OR DP lane mapping to nvkm_ior

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
7 years agodrm/nouveau/disp/g84-: port OR HDMI control to nvkm_ior
Ben Skeggs [Fri, 19 May 2017 13:59:35 +0000 (23:59 +1000)]
drm/nouveau/disp/g84-: port OR HDMI control to nvkm_ior

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
7 years agodrm/nouveau/disp/nv50-: port OR manual sink detection to nvkm_ior
Ben Skeggs [Fri, 19 May 2017 13:59:35 +0000 (23:59 +1000)]
drm/nouveau/disp/nv50-: port OR manual sink detection to nvkm_ior

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
7 years agodrm/nouveau/disp/nv50-: port OR power state control to nvkm_ior
Ben Skeggs [Fri, 19 May 2017 13:59:35 +0000 (23:59 +1000)]
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>
7 years agodrm/nouveau/disp/nv50-: fetch head/OR state at beginning of supervisor
Ben Skeggs [Fri, 19 May 2017 13:59:35 +0000 (23:59 +1000)]
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>
7 years agodrm/nouveau/disp/nv50-: execute supervisor on its own workqueue
Ben Skeggs [Fri, 19 May 2017 13:59:35 +0000 (23:59 +1000)]
drm/nouveau/disp/nv50-: execute supervisor on its own workqueue

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
7 years agodrm/nouveau/disp/dp: train link only when actively displaying an image
Ben Skeggs [Fri, 19 May 2017 13:59:35 +0000 (23:59 +1000)]
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>
7 years agodrm/nouveau/disp/dp: only check for re-train when the link is active
Ben Skeggs [Fri, 19 May 2017 13:59:35 +0000 (23:59 +1000)]
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>
7 years agodrm/nouveau/disp/dp: determine a failsafe link training rate
Ben Skeggs [Fri, 19 May 2017 13:59:35 +0000 (23:59 +1000)]
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>
7 years agodrm/nouveau/disp/dp: use cached link configuration when checking link status
Ben Skeggs [Fri, 19 May 2017 13:59:35 +0000 (23:59 +1000)]
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>
7 years agodrm/nouveau/disp/dp: no need for lt_state except during manual link training
Ben Skeggs [Fri, 19 May 2017 13:59:35 +0000 (23:59 +1000)]
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>
7 years agodrm/nouveau/disp/dp: store current link configuration in nvkm_ior
Ben Skeggs [Fri, 19 May 2017 13:59:35 +0000 (23:59 +1000)]
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>
7 years agodrm/nouveau/disp/dp: remove DP_PWR method
Ben Skeggs [Fri, 19 May 2017 13:59:35 +0000 (23:59 +1000)]
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>
7 years agodrm/nouveau/disp: identity-map display paths to output resources
Ben Skeggs [Fri, 19 May 2017 13:59:35 +0000 (23:59 +1000)]
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>
7 years agodrm/nouveau/disp: fork off some new hw-specific implementations
Ben Skeggs [Fri, 19 May 2017 13:59:35 +0000 (23:59 +1000)]
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>
7 years agodrm/nouveau/disp: introduce input/output resource abstraction
Ben Skeggs [Fri, 19 May 2017 13:59:35 +0000 (23:59 +1000)]
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>
7 years agodrm/nouveau/disp: common implementation of scanoutpos method in nvkm_head
Ben Skeggs [Fri, 19 May 2017 13:59:35 +0000 (23:59 +1000)]
drm/nouveau/disp: common implementation of scanoutpos method in nvkm_head

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
7 years agodrm/nouveau/disp: move vblank_{get,put} methods into nvkm_head
Ben Skeggs [Fri, 19 May 2017 13:59:35 +0000 (23:59 +1000)]
drm/nouveau/disp: move vblank_{get,put} methods into nvkm_head

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
7 years agodrm/nouveau/disp: introduce object to track per-head functions/state
Ben Skeggs [Fri, 19 May 2017 13:59:34 +0000 (23:59 +1000)]
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>
7 years agodrm/nouveau/disp: delay output path / connector construction until oneinit()
Ben Skeggs [Fri, 19 May 2017 13:59:34 +0000 (23:59 +1000)]
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>
7 years agodrm/nouveau/disp: s/nvkm_connector/nvkm_conn/
Ben Skeggs [Fri, 19 May 2017 13:59:34 +0000 (23:59 +1000)]
drm/nouveau/disp: s/nvkm_connector/nvkm_conn/

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
7 years agodrm/nouveau/disp: rename nvkm_output_dp to nvkm_dp
Ben Skeggs [Fri, 19 May 2017 13:59:34 +0000 (23:59 +1000)]
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>
7 years agodrm/nouveau/disp: rename nvkm_output to nvkm_outp
Ben Skeggs [Fri, 19 May 2017 13:59:34 +0000 (23:59 +1000)]
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>
7 years agodrm/nouveau/disp: shuffle functions around
Ben Skeggs [Fri, 19 May 2017 13:59:34 +0000 (23:59 +1000)]
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>
7 years agodrm/nouveau/kms/nv04: use new devinit script interpreter entry-point
Ben Skeggs [Fri, 19 May 2017 13:59:34 +0000 (23:59 +1000)]
drm/nouveau/kms/nv04: use new devinit script interpreter entry-point

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
7 years agodrm/nouveau/fb/ram/nv40-: use new devinit script interpreter entry-point
Ben Skeggs [Fri, 19 May 2017 13:59:34 +0000 (23:59 +1000)]
drm/nouveau/fb/ram/nv40-: use new devinit script interpreter entry-point

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
7 years agodrm/nouveau/devinit: use new devinit script interpreter entry-point
Ben Skeggs [Fri, 19 May 2017 13:59:34 +0000 (23:59 +1000)]
drm/nouveau/devinit: use new devinit script interpreter entry-point

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
7 years agodrm/nouveau/bios/init: add a new devinit script interpreter entry-point
Ben Skeggs [Fri, 19 May 2017 13:59:34 +0000 (23:59 +1000)]
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>
7 years agodrm/nouveau/bios/init: add or/link args separate from output path
Ben Skeggs [Fri, 19 May 2017 13:59:34 +0000 (23:59 +1000)]
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>
7 years agodrm/nouveau/bios/init: bump script offset to 32-bits
Ben Skeggs [Fri, 19 May 2017 13:59:34 +0000 (23:59 +1000)]
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>
7 years agodrm/nouveau/bios/init: rename 'crtc' to 'head'
Ben Skeggs [Fri, 19 May 2017 13:59:34 +0000 (23:59 +1000)]
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>
7 years agodrm/nouveau/bios/init: remove internal use of nvbios_init.bios
Ben Skeggs [Fri, 19 May 2017 13:59:34 +0000 (23:59 +1000)]
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>
7 years agodrm/nouveau/bios/init: rename nvbios_init() to nvbios_devinit()
Ben Skeggs [Fri, 19 May 2017 13:59:34 +0000 (23:59 +1000)]
drm/nouveau/bios/init: rename nvbios_init() to nvbios_devinit()

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
7 years agodrm/nouveau/tmr: remove nvkm_timer_alarm_cancel()
Ben Skeggs [Thu, 11 May 2017 07:29:58 +0000 (17:29 +1000)]
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>
7 years agodrm/nouveau/bios/iccsense: rails for power sensors have a mask of 0xf8 for version...
Karol Herbst [Sun, 23 Apr 2017 18:06:37 +0000 (20:06 +0200)]
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>
7 years agodrm/nouveau/bios/volt: Parse min and max for Version 0x40
Karol Herbst [Sun, 23 Apr 2017 08:36:31 +0000 (10:36 +0200)]
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>
7 years agodrm/nouveau: Enable stereoscopic 3D output over HDMI
Alastair Bridgewater [Tue, 11 Apr 2017 17:11:25 +0000 (13:11 -0400)]
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>
7 years agodrm/nouveau: Handle frame-packing mode geometry and timing effects
Alastair Bridgewater [Tue, 11 Apr 2017 17:11:24 +0000 (13:11 -0400)]
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>
7 years agodrm/nouveau/disp/gk104-: Use supplied HDMI InfoFrames
Alastair Bridgewater [Tue, 11 Apr 2017 17:11:23 +0000 (13:11 -0400)]
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>
7 years agodrm/nouveau/disp/gf119: Use supplied HDMI InfoFrames
Alastair Bridgewater [Tue, 11 Apr 2017 17:11:22 +0000 (13:11 -0400)]
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>
7 years agodrm/nouveau/disp/gt215: Use supplied HDMI InfoFrames
Alastair Bridgewater [Tue, 11 Apr 2017 17:11:21 +0000 (13:11 -0400)]
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>
7 years agodrm/nouveau/disp/g84-gt200: Use supplied HDMI InfoFrames
Alastair Bridgewater [Tue, 11 Apr 2017 17:11:20 +0000 (13:11 -0400)]
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>
7 years agodrm/nouveau/disp: Add mechanism to convert HDMI InfoFrames to hardware format
Alastair Bridgewater [Tue, 11 Apr 2017 17:11:19 +0000 (13:11 -0400)]
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>
7 years agodrm/nouveau: Pass mode-dependent AVI and Vendor HDMI InfoFrames to NVKM
Alastair Bridgewater [Tue, 11 Apr 2017 17:11:18 +0000 (13:11 -0400)]
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>
7 years agodrm/nouveau/disp/g84-: Extend NVKM HDMI power control method to set InfoFrames
Alastair Bridgewater [Tue, 11 Apr 2017 17:11:17 +0000 (13:11 -0400)]
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>
7 years agodrm/nouveau: Clean up nv50_head_atomic_check_mode() and fix blankus calculation
Alastair Bridgewater [Tue, 11 Apr 2017 17:11:16 +0000 (13:11 -0400)]
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>
7 years agoBackMerge tag 'v4.12-rc5' into drm-next
Dave Airlie [Fri, 16 Jun 2017 03:58:27 +0000 (13:58 +1000)]
BackMerge tag 'v4.12-rc5' into drm-next

Linux 4.12-rc5 for nouveau fixes

7 years agoMerge tag 'imx-drm-next-2017-06-08' of git://git.pengutronix.de/git/pza/linux into...
Dave Airlie [Fri, 16 Jun 2017 00:05:38 +0000 (10:05 +1000)]
Merge tag 'imx-drm-next-2017-06-08' of git://git.pengutronix.de/git/pza/linux into drm-next

imx-drm: cleanups and YUV 4:2:0 memory read/write reduction support

- Remove counter load enable form PRE, which has no effect.
- Add support for setting the double read/write reduction flag in channel
  parameter memory. This can be used to save some memory bandwidth when
  capturing in YUV 4:2:0 chroma subsampled formats.
- Allocate DMA channel structures as needed, most of the 64 channels are
  unused or even reserved.
- Remove unused interrupt busy waiting routine.
- Set VDIC field order for both AUTO and MAN inputs simultaneously as
  both can't be active at the same time.

* tag 'imx-drm-next-2017-06-08' of git://git.pengutronix.de/git/pza/linux:
  gpu: ipu-v3: vdic: include AUTO field order bit in ipu_vdi_set_field_order
  gpu: ipu-v3: remove interrupt busy waiting routine
  gpu: ipu-v3: allocate ipuv3_channels as needed
  gpu: ipu-v3: Add support for double read/write reduction
  gpu: ipu-v3: prg: remove counter load enable

7 years agoMerge tag 'drm-fsl-dcu-for-v4.13' of http://git.agner.ch/git/linux-drm-fsl-dcu into...
Dave Airlie [Fri, 16 Jun 2017 00:05:03 +0000 (10:05 +1000)]
Merge tag 'drm-fsl-dcu-for-v4.13' of git.agner.ch/git/linux-drm-fsl-dcu into drm-next

some fsl-dcu cleanups

* tag 'drm-fsl-dcu-for-v4.13' of http://git.agner.ch/git/linux-drm-fsl-dcu:
  drm/fsl-dcu: use new drm_atomic_helper_shutdown
  drm/fsl-dcu: implement irq_preinstall/uninstall callbacks
  drm/fsl: Drop drm_vblank_cleanup

7 years agoMerge branch 'drm/next/du' of git://linuxtv.org/pinchartl/media into drm-next
Dave Airlie [Fri, 16 Jun 2017 00:04:14 +0000 (10:04 +1000)]
Merge branch 'drm/next/du' of git://linuxtv.org/pinchartl/media into drm-next

The series interleaves DRM and V4L2 patches due to dependencies between the R-
Car DU and VSP drivers. Mauro has acked all the V4L2 patches to go through
your tree, and they don't conflict with anything queued for v4.13 in his tree.
If I need to send any conflicting patches through Mauro's tree for v4.13, I'll
make sure to base them on this branch.

* 'drm/next/du' of git://linuxtv.org/pinchartl/media:
  drm: rcar-du: Map memory through the VSP device
  v4l: vsp1: Add API to map and unmap DRM buffers through the VSP
  v4l: vsp1: Map the DL and video buffers through the proper bus master
  v4l: rcar-fcp: Add an API to retrieve the FCP device
  v4l: rcar-fcp: Don't get/put module reference
  drm: rcar-du: Register a completion callback with VSP1
  v4l: vsp1: Extend VSP1 module API to allow DRM callbacks
  v4l: vsp1: Postpone frame end handling in event of display list race
  drm: rcar-du: Arm the page flip event after queuing the page flip

7 years agoMerge tag 'sunxi-drm-for-4.13' of https://git.kernel.org/pub/scm/linux/kernel/git...
Dave Airlie [Fri, 16 Jun 2017 00:02:35 +0000 (10:02 +1000)]
Merge tag 'sunxi-drm-for-4.13' of https://git./linux/kernel/git/mripard/linux into drm-next

sun4i-drm changes for 4.13

An unusually big pull request for this merge window, with three notable
features:
  - V3s display engine support. This is especially notable because it uses
    a different display engine used on the newer Allwinner SoCs (H3, A64
    and the likes) that will be quite easily supported now.
  - HDMI support for the old Allwinner SoCs. This is enabled only on the
    A10s for now, but should be really easy to extend to deal with A10, A20
    and A31
  - Preliminary work to deal with dual-pipeline SoCs (A10, A20, A31, H3,
    etc.). It currently ignores the second pipeline, but we can use the
    dual-pipelines bindings. This will be useful to enable the display
    pipeline while we work on the dual-pipeline.

* tag 'sunxi-drm-for-4.13' of https://git.kernel.org/pub/scm/linux/kernel/git/mripard/linux: (27 commits)
  drm/sun4i: Add compatible for the A10s pipeline
  drm/sun4i: Add HDMI support
  dt-bindings: display: sun4i: Add allwinner,tcon-channel property
  dt-bindings: display: sun4i: Add HDMI display bindings
  drm/sun4i: Ignore the generic connectors for components
  drm/sun4i: tcon: multiply the vtotal when not in interlace
  drm/sun4i: tcon: Change vertical total size computation inconsistency
  drm/sun4i: tcon: Fix tcon channel 1 backporch calculation
  drm/sun4i: tcon: Switch mux on only for composite
  drm/sun4i: tcon: Move the muxing out of the mode set function
  drm/sun4i: tcon: Add channel debug
  drm/sun4i: tcon: add support for V3s TCON
  drm/sun4i: Add compatible string for V3s display engine
  drm/sun4i: add support for Allwinner DE2 mixers
  drm/sun4i: add a Kconfig option for sun4i-backend
  drm/sun4i: abstract a engine type
  drm/sun4i: return only planes for layers created
  dt-bindings: add bindings for DE2 on V3s SoC
  drm/sun4i: backend: Clarify sun4i_backend_layer_enable debug message
  drm/sun4i: Set TCON clock inside sun4i_tconX_mode_set
  ...

7 years agoMerge branch 'drm-next-4.13' of git://people.freedesktop.org/~agd5f/linux into drm...
Dave Airlie [Thu, 15 Jun 2017 23:54:02 +0000 (09:54 +1000)]
Merge branch 'drm-next-4.13' of git://people.freedesktop.org/~agd5f/linux into drm-next

New radeon and amdgpu features for 4.13:
- Lots of Vega10 bug fixes
- Preliminary Raven support
- KIQ support for compute rings
- MEC queue management rework from Andres
- Audio support for DCE6
- SR-IOV improvements
- Improved module parameters for controlling radeon vs amdgpu support
  for SI and CIK
- Bug fixes
- General code cleanups

[airlied: dropped drmP.h header from one file was needed and build broke]

* 'drm-next-4.13' of git://people.freedesktop.org/~agd5f/linux: (362 commits)
  drm/amdgpu: Fix compiler warnings
  drm/amdgpu: vm_update_ptes remove code duplication
  drm/amd/amdgpu: Port VCN over to new SOC15 macros
  drm/amd/amdgpu: Port PSP v10.0 over to new SOC15 macros
  drm/amd/amdgpu: Port PSP v3.1 over to new SOC15 macros
  drm/amd/amdgpu: Port NBIO v7.0 driver over to new SOC15 macros
  drm/amd/amdgpu: Port NBIO v6.1 driver over to new SOC15 macros
  drm/amd/amdgpu: Port UVD 7.0 over to new SOC15 macros
  drm/amd/amdgpu: Port MMHUB over to new SOC15 macros
  drm/amd/amdgpu: Cleanup gfxhub read-modify-write patterns
  drm/amd/amdgpu: Port GFXHUB over to new SOC15 macros
  drm/amd/amdgpu: Add offset variant to SOC15 macros
  drm/amd/powerplay: add avfs control for Vega10
  drm/amdgpu: add virtual display support for raven
  drm/amdgpu/gfx9: fix compute ring doorbell index
  drm/amd/amdgpu: Rename KIQ ring to avoid spaces
  drm/amd/amdgpu: gfx9 tidy ups (v2)
  drm/amdgpu: add contiguous flag in ucode bo create
  drm/amdgpu: fix missed gpu info firmware when cache firmware during S3
  drm/amdgpu: export test ib debugfs interface
  ...

7 years agoMerge tag 'drm-misc-next-2017-06-15' of git://anongit.freedesktop.org/git/drm-misc...
Dave Airlie [Thu, 15 Jun 2017 23:33:43 +0000 (09:33 +1000)]
Merge tag 'drm-misc-next-2017-06-15' of git://anongit.freedesktop.org/git/drm-misc into drm-next

Cross-subsystem Changes:
- dt-bindings: add vendor prefix for NLT Technologies, Ltd. (Lucas)
- dt-bindings: Add support for samsung s6e3hf2 panel (Hoegeun)

Core Changes:
- Add drm_panel_bridge to avoid connector boilerplate in drivers (Eric)
- Trival fixes for dupe forward decl and reduce scope of variable (Dawid)

Driver Changes:
- dw-hdmi: Use mode_valid hook on bridge instead of connector (Jose)
- vc4,atmel-hlcdc: Use drm_panel_bridge where appropriate (Eric)
- panel: Add Innolux P079ZCA panel driver (Chris)
- panel-simple: Add NL12880B20-05, NL192108AC18-02D, P320HVN03 panels (Lucas)
- panel-samsung-s6e3ha2: Add s6e3hf2 panel support (Hoegeun)
- zte,vc4,pl111,panel,mxsfb: Miscellaneous fixes

Cc: Jose Abreu <Jose.Abreu@synopsys.com>
Cc: Eric Anholt <eric@anholt.net>
Cc: Chris Zhong <zyw@rock-chips.com>
Cc: Lucas Stach <l.stach@pengutronix.de>
Cc: Hoegeun Kwon <hoegeun.kwon@samsung.com>
Cc: Dawid Kurek <dawikur@gmail.com>
* tag 'drm-misc-next-2017-06-15' of git://anongit.freedesktop.org/git/drm-misc: (26 commits)
  drm: Reduce scope of 'state' variable
  drm: mxsfb_crtc: Reset the eLCDIF controller
  drm: Remove duplicate forward declaration
  drm/panel: s6e3ha2: Add support for s6e3hf2 panel on TM2e board
  dt-bindings: Add support for samsung s6e3hf2 panel
  drm/panel: add backlight dependency for sitronix-st7789v
  drm/panel: S6E3HA2 needs backlight code
  drm/panel: simple: add support for AUO P320HVN03
  drm/panel: simple: add support for NLT NL192108AC18-02D
  dt-bindings: add vendor prefix for NLT Technologies, Ltd.
  drm/panel: simple: add support for NEC NL12880B20-05
  drm/panel: add Innolux P079ZCA panel driver
  dt-bindings: Add INNOLUX P079ZCA panel bindings
  drm/vc4: Fix resource leak in 'vc4_get_hang_state_ioctl()' in error handling path
  drm/vc4/vc4_bo.c: always set bo->resv
  drm: Add const to name field declaration in struct drm_prop_enum_list
  drm/pl111: Fix offset calculation for the primary plane.
  drm/atmel-hlcdc: Fix panel registration
  drm/bridge: Build the panel wrapper in drm_kms_helper
  drm/atmel-hlcdc: Replace the panel usage with drm_panel_bridge.
  ...

7 years agodrm: Reduce scope of 'state' variable
Dawid Kurek [Thu, 15 Jun 2017 17:45:56 +0000 (19:45 +0200)]
drm: Reduce scope of 'state' variable

Smaller scope reduces visibility of variable and makes usage of
uninitialized variable less possible.

Changes in v2:
- separate declaration and initialization
Changes in v3:
- add missing signed-off-by tag

Signed-off-by: Dawid Kurek <dawikur@gmail.com>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link: http://patchwork.freedesktop.org/patch/msgid/20170615174556.GA8872@gmail.com
7 years agodrm: mxsfb_crtc: Reset the eLCDIF controller
Fabio Estevam [Fri, 5 May 2017 18:01:41 +0000 (15:01 -0300)]
drm: mxsfb_crtc: Reset the eLCDIF controller

According to the eLCDIF initialization steps listed in the MX6SX
Reference Manual the eLCDIF block reset is mandatory.

Without performing the eLCDIF reset the display shows garbage content
when the kernel boots.

In earlier tests this issue has not been observed because the bootloader
was previously showing a splash screen and the bootloader display driver
does properly implement the eLCDIF reset.

Add the eLCDIF reset to the driver, so that it can operate correctly
independently of the bootloader.

Tested on a imx6sx-sdb board.

Cc: <stable@vger.kernel.org>
Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Reviewed-by: Marek Vasut <marex@denx.de>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link: http://patchwork.freedesktop.org/patch/msgid/1494007301-14535-1-git-send-email-fabio.estevam@nxp.com
7 years agodrm/amdgpu: Fix compiler warnings
Harish Kasiviswanathan [Fri, 9 Jun 2017 21:47:28 +0000 (17:47 -0400)]
drm/amdgpu: Fix compiler warnings

Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Harish Kasiviswanathan <Harish.Kasiviswanathan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu: vm_update_ptes remove code duplication
Harish Kasiviswanathan [Fri, 9 Jun 2017 21:47:27 +0000 (17:47 -0400)]
drm/amdgpu: vm_update_ptes remove code duplication

CPU and GPU paths were mostly the same.

Acked-by: Christian König <christian.koenig@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Harish Kasiviswanathan <Harish.Kasiviswanathan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/amdgpu: Port VCN over to new SOC15 macros
Tom St Denis [Mon, 12 Jun 2017 17:50:53 +0000 (13:50 -0400)]
drm/amd/amdgpu: Port VCN over to new SOC15 macros

Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/amdgpu: Port PSP v10.0 over to new SOC15 macros
Tom St Denis [Mon, 12 Jun 2017 17:46:44 +0000 (13:46 -0400)]
drm/amd/amdgpu: Port PSP v10.0 over to new SOC15 macros

Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/amdgpu: Port PSP v3.1 over to new SOC15 macros
Tom St Denis [Mon, 12 Jun 2017 17:45:30 +0000 (13:45 -0400)]
drm/amd/amdgpu: Port PSP v3.1 over to new SOC15 macros

Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/amdgpu: Port NBIO v7.0 driver over to new SOC15 macros
Tom St Denis [Mon, 12 Jun 2017 17:43:36 +0000 (13:43 -0400)]
drm/amd/amdgpu: Port NBIO v7.0 driver over to new SOC15 macros

Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/amdgpu: Port NBIO v6.1 driver over to new SOC15 macros
Tom St Denis [Mon, 12 Jun 2017 17:09:41 +0000 (13:09 -0400)]
drm/amd/amdgpu: Port NBIO v6.1 driver over to new SOC15 macros

Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/amdgpu: Port UVD 7.0 over to new SOC15 macros
Tom St Denis [Mon, 12 Jun 2017 17:03:41 +0000 (13:03 -0400)]
drm/amd/amdgpu: Port UVD 7.0 over to new SOC15 macros

Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/amdgpu: Port MMHUB over to new SOC15 macros
Tom St Denis [Mon, 12 Jun 2017 16:34:28 +0000 (12:34 -0400)]
drm/amd/amdgpu: Port MMHUB over to new SOC15 macros

Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/amdgpu: Cleanup gfxhub read-modify-write patterns
Tom St Denis [Mon, 12 Jun 2017 16:30:41 +0000 (12:30 -0400)]
drm/amd/amdgpu: Cleanup gfxhub read-modify-write patterns

Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/amdgpu: Port GFXHUB over to new SOC15 macros
Tom St Denis [Mon, 12 Jun 2017 16:12:22 +0000 (12:12 -0400)]
drm/amd/amdgpu: Port GFXHUB over to new SOC15 macros

Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/amdgpu: Add offset variant to SOC15 macros
Tom St Denis [Mon, 12 Jun 2017 16:05:42 +0000 (12:05 -0400)]
drm/amd/amdgpu: Add offset variant to SOC15 macros

Allows reading/writing via SOC15 macros with offset for
various register banks.

Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/powerplay: add avfs control for Vega10
Eric Huang [Tue, 13 Jun 2017 18:51:57 +0000 (14:51 -0400)]
drm/amd/powerplay: add avfs control for Vega10

Signed-off-by: Eric Huang <JinHuiEric.Huang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu: add virtual display support for raven
Alex Deucher [Fri, 2 Jun 2017 18:52:18 +0000 (14:52 -0400)]
drm/amdgpu: add virtual display support for raven

Same as other asics.  If enabled, exposes a user selectable
number of virtual displays.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu/gfx9: fix compute ring doorbell index
Alex Deucher [Tue, 13 Jun 2017 02:55:22 +0000 (22:55 -0400)]
drm/amdgpu/gfx9: fix compute ring doorbell index

This got lost when the code was revamped.  Copy/paste bug from
gfx8.

Reported-by: Evan Quan <evan.quan@amd.com>
Fixes: 78c168342 (drm/amdgpu: allow split of queues with kfd at queue granularity v4)
Reviewed-by: Junwei Zhang <Jerry.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/amdgpu: Rename KIQ ring to avoid spaces
Tom St Denis [Mon, 12 Jun 2017 13:05:04 +0000 (09:05 -0400)]
drm/amd/amdgpu: Rename KIQ ring to avoid spaces

Swap space for underscore in ring name.

Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/amdgpu: gfx9 tidy ups (v2)
Tom St Denis [Mon, 12 Jun 2017 12:45:02 +0000 (08:45 -0400)]
drm/amd/amdgpu: gfx9 tidy ups (v2)

A couple of simple tidy ups to register programming.

Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
(v2): Avoid using 'data' uninitialized

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu: add contiguous flag in ucode bo create
horchen [Fri, 9 Jun 2017 11:56:48 +0000 (04:56 -0700)]
drm/amdgpu: add contiguous flag in ucode bo create

Under VF environment, the ucode would be settled to the visible VRAM,
As it would be pinned to the visible VRAM, it's better to add
contiguous flag,otherwise it need to move gpu address during the pin
process. This movement is not necessary.

Signed-off-by: horchen <horace.chen@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu: fix missed gpu info firmware when cache firmware during S3
Huang Rui [Mon, 5 Jun 2017 14:11:59 +0000 (22:11 +0800)]
drm/amdgpu: fix missed gpu info firmware when cache firmware during S3

gpu_info firmware is released after data is used. But when system enters into
suspend, upper class driver will cache all firmware names. At that time,
gpu_info will be failing to load. It seems an upper class issue, that we should
not release gpu_info firmware until device finished.

[  903.236589] cache_firmware: amdgpu/vega10_sdma1.bin
[  903.236590] fw_set_page_data: fw-amdgpu/vega10_sdma1.bin buf=ffff88041eee10c0 data=ffffc90002561000 size=17408
[  903.236591] cache_firmware: amdgpu/vega10_sdma1.bin ret=0
[  903.464160] __allocate_fw_buf: fw-amdgpu/vega10_gpu_info.bin buf=ffff88041eee2c00
[  903.471815] (NULL device *): loading /lib/firmware/updates/4.11.0-custom/amdgpu/vega10_gpu_info.bin failed with error -2
[  903.482870] (NULL device *): loading /lib/firmware/updates/amdgpu/vega10_gpu_info.bin failed with error -2
[  903.492716] (NULL device *): loading /lib/firmware/4.11.0-custom/amdgpu/vega10_gpu_info.bin failed with error -2
[  903.503156] (NULL device *): direct-loading amdgpu/vega10_gpu_info.bin

Signed-off-by: Huang Rui <ray.huang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu: export test ib debugfs interface
Huang Rui [Wed, 10 May 2017 15:04:06 +0000 (23:04 +0800)]
drm/amdgpu: export test ib debugfs interface

As Christian and David's suggestion, submit the test ib ring debug interfaces.
It's useful for debugging with the command submission without VM case.

Signed-off-by: Huang Rui <ray.huang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/powerplay: add GPU power display for vega10
Eric Huang [Thu, 8 Jun 2017 18:39:32 +0000 (14:39 -0400)]
drm/amd/powerplay: add GPU power display for vega10

Signed-off-by: Eric Huang <JinHuiEric.Huang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/powerplay: update vega10_ppsmc.h
Eric Huang [Thu, 8 Jun 2017 17:48:59 +0000 (13:48 -0400)]
drm/amd/powerplay: update vega10_ppsmc.h

Signed-off-by: Eric Huang <JinHuiEric.Huang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu: avoid to reset wave_front_size to 0
Hawking Zhang [Fri, 9 Jun 2017 15:39:31 +0000 (23:39 +0800)]
drm/amdgpu: avoid to reset wave_front_size to 0

No need to clear it.  The values are set explicitly.

Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu: add new member in gpu_info fw
Hawking Zhang [Fri, 9 Jun 2017 14:30:52 +0000 (22:30 +0800)]
drm/amdgpu: add new member in gpu_info fw

Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm: Remove duplicate forward declaration
Dawid Kurek [Wed, 14 Jun 2017 21:35:18 +0000 (23:35 +0200)]
drm: Remove duplicate forward declaration

Forward declarations in C are great but I'm pretty sure one is enough.

Signed-off-by: Dawid Kurek <dawikur@gmail.com>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link: http://patchwork.freedesktop.org/patch/msgid/20170614213518.GA3554@gmail.com
7 years agodrm/panel: s6e3ha2: Add support for s6e3hf2 panel on TM2e board
Hoegeun Kwon [Tue, 18 Apr 2017 08:40:35 +0000 (17:40 +0900)]
drm/panel: s6e3ha2: Add support for s6e3hf2 panel on TM2e board

This patch supports TM2e panel and the panel has 1600x2560 resolution
in 5.65" physical.

This identify panel type with compatibility string, also invoke
display mode that matches the type. So add the check code for s6e3ha2
compatibility and s6e3hf2 type and select the drm_display_mode of
default and edge type.

Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
Reviewed-by: Inki Dae <inki.dae@samsung.com>
[treding@nvidia.com: fixup checkpatch warnings]
Signed-off-by: Thierry Reding <treding@nvidia.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1492504836-19225-3-git-send-email-hoegeun.kwon@samsung.com
7 years agodt-bindings: Add support for samsung s6e3hf2 panel
Hoegeun Kwon [Tue, 18 Apr 2017 08:40:34 +0000 (17:40 +0900)]
dt-bindings: Add support for samsung s6e3hf2 panel

The samsung s6e3hf2 panel is a 5.65" 1600x2560 AMOLED panel connected
using MIPI-DSI interfaces.

The s6e3hf2 is add to samsung,s6e3ha2.txt binding because it is a
panel similar to the s6e3ha2. So add the compatible string and
comments.

Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1492504836-19225-2-git-send-email-hoegeun.kwon@samsung.com
7 years agodrm/panel: add backlight dependency for sitronix-st7789v
Arnd Bergmann [Wed, 19 Apr 2017 18:03:08 +0000 (20:03 +0200)]
drm/panel: add backlight dependency for sitronix-st7789v

Without the dependency, we run into a link error:

drivers/gpu/drm/panel/panel-sitronix-st7789v.o: In function `st7789v_probe':
panel-sitronix-st7789v.c:(.text.st7789v_probe+0xc0): undefined reference to `of_find_backlight_by_node'

Fixes: 7142afb3a186 ("drm/panel: Add driver for sitronix ST7789V LCD controller")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170419180326.303994-1-arnd@arndb.de
7 years agodrm/panel: S6E3HA2 needs backlight code
Arnd Bergmann [Wed, 19 Apr 2017 17:59:18 +0000 (19:59 +0200)]
drm/panel: S6E3HA2 needs backlight code

The new S6E3HA2 driver fails to link when backlight is disabled:

ERROR: "backlight_device_register" [drivers/gpu/drm/panel/panel-samsung-s6e3ha2.ko] undefined!
ERROR: "backlight_device_unregister" [drivers/gpu/drm/panel/panel-samsung-s6e3ha2.ko] undefined!

This adds a Kconfig dependency like we have it for some other panel drivers.

Fixes: ed29f9426d9b ("drm/panel: Add support for S6E3HA2 panel driver on TM2 board")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170419175939.189098-2-arnd@arndb.de
7 years agodrm/panel: simple: add support for AUO P320HVN03
Lucas Stach [Thu, 8 Jun 2017 18:07:58 +0000 (20:07 +0200)]
drm/panel: simple: add support for AUO P320HVN03

This adds support for the AU Optronics Corporation 31.5"
FHD (1920x1080) LVDS TFT LCD panel, which can be supported
by the simple panel driver

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170608180758.31020-4-l.stach@pengutronix.de
7 years agodrm/panel: simple: add support for NLT NL192108AC18-02D
Lucas Stach [Thu, 8 Jun 2017 18:07:57 +0000 (20:07 +0200)]
drm/panel: simple: add support for NLT NL192108AC18-02D

This adds support for the NLT Technologies NL192108AC18-02D
15.6" LVDS FullHD TFT LCD panel, which can be supported
by the simple panel driver.

Timings are taken from the preliminary datasheet, as a final
one is not yet available.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170608180758.31020-3-l.stach@pengutronix.de
7 years agodt-bindings: add vendor prefix for NLT Technologies, Ltd.
Lucas Stach [Thu, 8 Jun 2017 18:07:56 +0000 (20:07 +0200)]
dt-bindings: add vendor prefix for NLT Technologies, Ltd.

NLT technologies is the former NEC display business, but changed its
name to NLT Technologies when forming a joint venture with
Shenzhen AVIC OPTOELECTRONICS, Ltd.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170608180758.31020-2-l.stach@pengutronix.de
7 years agodrm/panel: simple: add support for NEC NL12880B20-05
Lucas Stach [Thu, 8 Jun 2017 18:07:55 +0000 (20:07 +0200)]
drm/panel: simple: add support for NEC NL12880B20-05

This adds support for the NEC LCD Technologies, Ltd. 12.1"
WXGA (1280x800) LVDS TFT LCD panel, which can be supported
by the simple panel driver.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170608180758.31020-1-l.stach@pengutronix.de
7 years agodrm/panel: add Innolux P079ZCA panel driver
Chris Zhong [Fri, 24 Mar 2017 00:51:32 +0000 (08:51 +0800)]
drm/panel: add Innolux P079ZCA panel driver

Support Innolux P079ZCA 7.85" 768x1024 TFT LCD panel, it is a MIPI DSI
panel.

Signed-off-by: Chris Zhong <zyw@rock-chips.com>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Tested-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1490316692-20506-2-git-send-email-zyw@rock-chips.com
7 years agodt-bindings: Add INNOLUX P079ZCA panel bindings
Chris Zhong [Fri, 24 Mar 2017 00:51:31 +0000 (08:51 +0800)]
dt-bindings: Add INNOLUX P079ZCA panel bindings

The Innolux P079ZCA is a 7.85" panel with a 768X1024 resolution and
connected to DSI using four lanes.

Signed-off-by: Chris Zhong <zyw@rock-chips.com>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1490316692-20506-1-git-send-email-zyw@rock-chips.com
7 years agodrm/syncobj: add sync_file interaction. (v1.2)
Dave Airlie [Wed, 26 Apr 2017 03:09:02 +0000 (04:09 +0100)]
drm/syncobj: add sync_file interaction. (v1.2)

This interface allows importing the fence from a sync_file into
an existing drm sync object, or exporting the fence attached to
an existing drm sync object into a new sync file object.

This should only be used to interact with sync files where necessary.

v1.1: fence put fixes (Chris), drop fence from ioctl names (Chris)
fixup for new fence replace API.

Reviewed-by: Sean Paul <seanpaul@chromium.org>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Dave Airlie <airlied@redhat.com>
7 years agodrm: introduce sync objects (v4)
Dave Airlie [Tue, 4 Apr 2017 03:26:24 +0000 (13:26 +1000)]
drm: introduce sync objects (v4)

Sync objects are new toplevel drm object, that contain a
pointer to a fence. This fence can be updated via command
submission ioctls via drivers.

There is also a generic wait obj API modelled on the vulkan
wait API (with code modelled on some amdgpu code).

These objects can be converted to an opaque fd that can be
passes between processes.

v2: rename reference/unreference to put/get (Chris)
fix leaked reference (David Zhou)
drop mutex in favour of cmpxchg (Chris)
v3: cleanups from danvet, rebase on drm_fops rename
check fd_flags is 0 in ioctls.
v4: export find/free, change replace fence to take a
syncobj. In order to support lookup first, replace
later semantics which seem in the end to be cleaner.

Reviewed-by: Sean Paul <seanpaul@chromium.org>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Dave Airlie <airlied@redhat.com>
7 years agodrm/vc4: Fix resource leak in 'vc4_get_hang_state_ioctl()' in error handling path
Christophe JAILLET [Fri, 12 May 2017 12:38:03 +0000 (14:38 +0200)]
drm/vc4: Fix resource leak in 'vc4_get_hang_state_ioctl()' in error handling path

If one 'drm_gem_handle_create()' fails, we leak somes handles and some
memory.

In order to fix it:
  - move the 'free(bo_state)' at the end of the function so that it is also
    called in the eror handling path. This has the side effect to also try
    to free it if the first 'kcalloc' fails. This is harmless.
  - add a new label, err_delete_handle, in order to delete already
    allocated handles in error handling path
  - remove the now useless 'err' label

The way the code is now written will also delete the handles if the
'copy_to_user()' call fails.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Eric Anholt <eric@anholt.net>
Link: http://patchwork.freedesktop.org/patch/msgid/20170512123803.1886-1-christophe.jaillet@wanadoo.fr
7 years agodrm/vc4/vc4_bo.c: always set bo->resv
Hans Verkuil [Wed, 7 Jun 2017 19:05:57 +0000 (21:05 +0200)]
drm/vc4/vc4_bo.c: always set bo->resv

The bo->resv pointer could be NULL, leading to kernel oopses
like the one below.

This patch ensures that bo->resv is always set in vc4_create_object
ensuring that it is never NULL.

Thanks to Eric Anholt for pointing to the correct solution.

[   19.738487] Unable to handle kernel NULL pointer dereference at virtual address 00000000
[   19.746805] pgd = ffff8000275fc000
[   19.750319] [00000000] *pgd=0000000000000000
[   19.754715] Internal error: Oops: 96000004 [#1] PREEMPT SMP
[   19.760369] Modules linked in: smsc95xx usbnet vc4 drm_kms_helper drm pwm_bcm2835 i2c_bcm2835 bcm2835_rng rng_core bcm2835_dma virt_dma
[   19.772767] CPU: 0 PID: 1297 Comm: Xorg Not tainted 4.12.0-rc1-rpi3 #58
[   19.779476] Hardware name: Raspberry Pi 3 Model B (DT)
[   19.784688] task: ffff800028268000 task.stack: ffff800026c08000
[   19.790705] PC is at ww_mutex_lock_interruptible+0x14/0xc0
[   19.796329] LR is at vc4_submit_cl_ioctl+0x4fc/0x998 [vc4]
...
[   20.240855] [<ffff0000088975f4>] ww_mutex_lock_interruptible+0x14/0xc0
[   20.247528] [<ffff0000009b3ea4>] vc4_submit_cl_ioctl+0x4fc/0x998 [vc4]
[   20.254372] [<ffff0000008f75f8>] drm_ioctl+0x180/0x438 [drm]
[   20.260120] [<ffff00000821383c>] do_vfs_ioctl+0xa4/0x7d0
[   20.265510] [<ffff000008213fe4>] SyS_ioctl+0x7c/0x98
[   20.270550] [<ffff000008082f30>] el0_svc_naked+0x24/0x28
[   20.275941] Code: d2800002 d5384103 910003fd f9800011 (c85ffc04)
[   20.282527] ---[ end trace 1f6bd640ff32ae12 ]---

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Link: http://patchwork.freedesktop.org/patch/msgid/14e68768-6c92-2d74-92fd-196dbc50d8f7@xs4all.nl