]> asedeno.scripts.mit.edu Git - linux.git/log
linux.git
5 years agoMerge tag 'du-next-20180925' of git://linuxtv.org/pinchartl/media into drm-next
Dave Airlie [Thu, 27 Sep 2018 00:54:54 +0000 (10:54 +1000)]
Merge tag 'du-next-20180925' of git://linuxtv.org/pinchartl/media into drm-next

R-Car DU support for the D3 and E3 SoCs (v4.20)

Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/3289904.RCOHkcp7u8@avalon
5 years agodrm: rcar-du: Add r8a77990 and r8a77995 device support
Ulrich Hecht [Tue, 14 Aug 2018 13:49:56 +0000 (15:49 +0200)]
drm: rcar-du: Add r8a77990 and r8a77995 device support

Add support for the R-Car D3 (R8A77995) and E3 (R8A77990) SoCs to the
R-Car DU driver. The two SoCs instantiate compatible DUs, so a single
information structure is enough.

Signed-off-by: Ulrich Hecht <uli+renesas@fpond.eu>
[Add support for R8A77990]
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
5 years agodrm: rcar-du: Don't use TV sync mode when not supported by the hardware
Laurent Pinchart [Wed, 22 Aug 2018 13:21:33 +0000 (16:21 +0300)]
drm: rcar-du: Don't use TV sync mode when not supported by the hardware

The official way to stop the display is to clear the display enable
(DEN) bit in the DSYSR register, but that operates at a group level and
affects the two channels in the group. To disable channels selectively,
the driver uses TV sync mode that stops display operation on the channel
and turns output signals into inputs.

While TV sync mode is available in all DU models currently supported,
the D3 and E3 DUs don't support it. We will thus need to find an
alternative way to turn channels off.

In the meantime, condition the switch to TV sync mode to the
availability of the feature, to avoid writing an invalid value to the
DSYSR register. When the feature is unavailable the display output will
turn blank as all planes are disabled when stopping the CRTC.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
5 years agodrm: rcar-du: Cache DSYSR value to ensure known initial value
Laurent Pinchart [Wed, 22 Aug 2018 13:05:02 +0000 (16:05 +0300)]
drm: rcar-du: Cache DSYSR value to ensure known initial value

DSYSR is a DU channel register that also contains group fields. It is
thus written to by both the group and CRTC code, using read-update-write
sequences. As the register isn't initialized explicitly at startup time,
this can lead to invalid or otherwise unexpected values being written to
some of the fields if they have been modified by the firmware or just
not reset properly.

To fix this we can write a fully known value to the DSYSR register when
turning a channel's functional clock on. However, the mix of group and
channel fields complicate this. A simpler solution is to cache the
register and initialize the cached value to the desired hardware
defaults.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
5 years agodrm: rcar-du: Enable configurable DPAD0 routing on Gen3
Laurent Pinchart [Tue, 21 Aug 2018 21:01:07 +0000 (00:01 +0300)]
drm: rcar-du: Enable configurable DPAD0 routing on Gen3

All Gen3 SoCs supported so far have a fixed association between DPAD0
and DU channels, which led to hardcoding that association when writing
the corresponding hardware register. The D3 and E3 will break that
mechanism as DPAD0 can be dynamically connected to either DU0 or DU1.

Make DPAD0 routing dynamic on Gen3. To ensure a valid hardware
configuration when the DU starts without the RGB output enabled, DPAD0
is associated at initialization time to the first DU channel that it can
be connected to. This makes no change on Gen2 as all Gen2 SoCs can
connected DPAD0 to DU0, which is the current implicit default value.

As the DPAD0 source is always 0 when a single source is possible on
Gen2, we can also simplify the Gen2 code in the same function to remove
a conditional check.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
Reviewed-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
5 years agodrm: rcar-du: Use LVDS PLL clock as dot clock when possible
Laurent Pinchart [Tue, 21 Aug 2018 18:31:04 +0000 (21:31 +0300)]
drm: rcar-du: Use LVDS PLL clock as dot clock when possible

On selected SoCs, the DU can use the clock output by the LVDS encoder
PLL as its input dot clock. This feature is optional, but on the D3 and
E3 SoC it is often the only way to obtain a precise dot clock frequency,
as the other available clocks (CPG-generated clock and external clock)
usually have fixed rates.

Add a DU model information field to describe which DU channels can use
the LVDS PLL output clock as their input clock, and configure clock
routing accordingly.

This feature is available on H2, M2-W, M2-N, D3 and E3 SoCs, with D3 and
E3 being the primary targets. It is left disabled in this commit, and
will be enabled per-SoC after careful testing.

At the hardware level, clock routing is configured at runtime in two
steps, first selecting an internal dot clock between the LVDS PLL clock
and the external DOTCLKIN clock, and then selecting between the internal
dot clock and the CPG-generated clock. The first part requires stopping
the whole DU group in order for the change to take effect, thus causing
flickering on the screen. For this reason we currently hardcode the
clock source to the LVDS PLL clock if available, and allow flicker-free
selection of the external DOTCLKIN clock or CPG-generated clock
otherwise. A more dynamic clock selection process can be implemented
later if the need arises.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
Reviewed-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
5 years agodrm: rcar-du: Perform the initial CRTC setup from rcar_du_crtc_get()
Laurent Pinchart [Fri, 14 Jul 2017 00:26:17 +0000 (03:26 +0300)]
drm: rcar-du: Perform the initial CRTC setup from rcar_du_crtc_get()

The rcar_du_crtc_get() function is always immediately followed by a call
to rcar_du_crtc_setup(). Call the later from the former to simplify the
code, and add a comment to explain how the get and put calls are
balanced.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
Reviewed-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
5 years agodrm: rcar-du: lvds: D3/E3 support
Laurent Pinchart [Tue, 21 Aug 2018 15:06:50 +0000 (18:06 +0300)]
drm: rcar-du: lvds: D3/E3 support

The LVDS encoders in the D3 and E3 SoCs differ significantly from those
in the other R-Car Gen3 family members:

- The LVDS PLL architecture is more complex and requires computing PLL
  parameters manually.
- The PLL uses external clocks as inputs, which need to be retrieved
  from DT.
- In addition to the different PLL setup, the startup sequence has
  changed *again* (seems someone had trouble making his/her mind).

Supporting all this requires DT bindings extensions for external clocks,
brand new PLL setup code, and a few quirks to handle the differences in
the startup sequence.

The implementation doesn't support all hardware features yet, namely

- Using the LV[01] clocks generated by the CPG as PLL input.
- Providing the LVDS PLL clock to the DU for use with the RGB output.

Those features can be added later when the need will arise.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
Reviewed-by: Ulrich Hecht <uli+renesas@fpond.eu>
Reviewed-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
5 years agodrm: bridge: thc63: Restrict modes based on hardware operating frequency
Laurent Pinchart [Wed, 22 Aug 2018 14:04:06 +0000 (17:04 +0300)]
drm: bridge: thc63: Restrict modes based on hardware operating frequency

The THC63LVD1024 is restricted to a pixel clock frequency in the range
of 8 to 135 MHz. Implement the bridge .mode_valid() operation
accordingly.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
Tested-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
5 years agodt-bindings: display: renesas: lvds: Add EXTAL and DU_DOTCLKIN clocks
Laurent Pinchart [Wed, 22 Aug 2018 12:27:16 +0000 (15:27 +0300)]
dt-bindings: display: renesas: lvds: Add EXTAL and DU_DOTCLKIN clocks

On the D3 and E3 SoCs, the LVDS encoder can derive its internal pixel
clock from an externally supplied clock, either through the EXTAL pin or
through one of the DU_DOTCLKINx pins. Add corresponding clocks to the DT
bindings.

To retain backward compatibility with DT that don't specify the
clock-names property, the functional clock must always be specified
first, and the clock-names property is optional when only the functional
clock is specified.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
Reviewed-by: Ulrich Hecht <uli+renesas@fpond.eu>
Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
5 years agodt-bindings: display: renesas: lvds: Document r8a77990 bindings
Laurent Pinchart [Mon, 20 Aug 2018 14:12:49 +0000 (17:12 +0300)]
dt-bindings: display: renesas: lvds: Document r8a77990 bindings

The E3 (r8a77990) supports two LVDS channels. Extend the binding to
support them.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Reviewed-by: Ulrich Hecht <uli+renesas@fpond.eu>
Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
5 years agodt-bindings: display: renesas: du: Document r8a77990 bindings
Laurent Pinchart [Mon, 20 Aug 2018 14:07:25 +0000 (17:07 +0300)]
dt-bindings: display: renesas: du: Document r8a77990 bindings

Document the E3 (r8a77990) SoC in the R-Car DU bindings.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Reviewed-by: Ulrich Hecht <uli+renesas@fpond.eu>
5 years agoMerge branch 'drm-next-4.20' of git://people.freedesktop.org/~agd5f/linux into drm-next
Dave Airlie [Thu, 20 Sep 2018 23:52:34 +0000 (09:52 +1000)]
Merge branch 'drm-next-4.20' of git://people.freedesktop.org/~agd5f/linux into drm-next

This is a new pull for drm-next on top of last weeks with the following
changes:
- Fixed 64 bit divide
- Fixed vram type on vega20
- Misc vega20 fixes
- Misc DC fixes
- Fix GDS/GWS/OA domain handling

Previous changes from last week:
amdgpu/kfd:
- Picasso (new APU) support
- Raven2 (new APU) support
- Vega20 enablement
- ACP powergating improvements
- Add ABGR/XBGR display support
- VCN JPEG engine support
- Initial xGMI support
- Use load balancing for engine scheduling
- Lots of new documentation
- Rework and clean up i2c and aux handling in DC
- Add DP YCbCr 4:2:0 support in DC
- Add DMCU firmware loading for Raven (used for ABM and PSR)
- New debugfs features in DC
- LVDS support in DC
- Implement wave kill for gfx/compute (light weight reset for shaders)
- Use AGP aperture to avoid gart mappings when possible
- GPUVM performance improvements
- Bulk moves for more efficient GPUVM LRU handling
- Merge amdgpu and amdkfd into one module
- Enable gfxoff and stutter mode on Raven
- Misc cleanups

Scheduler:
- Load balancing support
- Bug fixes

ttm:
- Bulk move functionality
- Bug fixes

radeon:
- Misc cleanups

Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Alex Deucher <alexdeucher@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180920150438.12693-1-alexander.deucher@amd.com
5 years agoMerge tag 'du-next-20180914' of git://linuxtv.org/pinchartl/media into drm-next
Dave Airlie [Thu, 20 Sep 2018 04:12:01 +0000 (14:12 +1000)]
Merge tag 'du-next-20180914' of git://linuxtv.org/pinchartl/media into drm-next

R-Car DU changes for v4.20

The pull request mostly contains updates to the R-Car DU driver, notably
support for interlaced modes on Gen3 hardware, support for the LVDS output on
R8A77980, and a set of miscellaneous bug fixes. There are also two SPDX
conversion patches for the drm shmobile and panel-lvds drivers, as well as an
update to MAINTAINERS to add Kieran Bingham as a co-maintainer for the DU
driver.

Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/3273568.LdoAI77IYW@avalon
5 years agodrm/amdgpu: Exclude MM engines for vega20 virtual device
Frank Min [Thu, 26 Apr 2018 19:45:50 +0000 (03:45 +0800)]
drm/amdgpu: Exclude MM engines for vega20 virtual device

Temporary disable UVD/VCE block if is virtual device

Signed-off-by: Frank Min <Frank.Min@amd.com>
Signed-off-by: Xiangliang Yu <Xiangliang.Yu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdgpu: add vega20 sriov capability detection
Frank Min [Thu, 26 Apr 2018 19:44:11 +0000 (03:44 +0800)]
drm/amdgpu: add vega20 sriov capability detection

Add sriov capability detection for vega20, then can check if device is
virtual device.

Signed-off-by: Frank Min <Frank.Min@amd.com>
Signed-off-by: Xiangliang Yu <Xiangliang.Yu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agoMerge tag 'drm-misc-next-2018-09-19' of git://anongit.freedesktop.org/drm/drm-misc...
Dave Airlie [Thu, 20 Sep 2018 00:14:59 +0000 (10:14 +1000)]
Merge tag 'drm-misc-next-2018-09-19' of git://anongit.freedesktop.org/drm/drm-misc into drm-next

drm-misc-next for 4.20:

UAPI Changes:
- None

Cross-subsystem Changes:
- None

Core Changes:
- Allow drivers to disable features with per-device granularity (Ville)
- Use EOPNOTSUPP when iface/feature is unsupported instead of
  EINVAL/errno soup (Chris)
- Simplify M/N DP quirk by using constant N to limit size of M/N (Shawn)
- add quirk for LG LP140WF6-SPM1 eDP panel (Shawn)

Driver Changes:
- i915/amdgpu: Disable DRIVER_ATOMIC for older/unsupported devices (Ville)
- sun4i: add support for R40 HDMI PHY (Icenowy)

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Icenowy Zheng <icenowy@aosc.io>
Cc: Lee, Shawn C <shawn.c.lee@intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Sean Paul <sean@poorly.run>
Link: https://patchwork.freedesktop.org/patch/msgid/20180919200218.GA186644@art_vandelay
5 years agodrm/amdgpu: move reserving GDS/GWS/OA into common code
Christian König [Fri, 14 Sep 2018 19:08:57 +0000 (21:08 +0200)]
drm/amdgpu: move reserving GDS/GWS/OA into common code

We don't need that in the per ASIC code.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdgpu: initialize GDS/GWS/OA domains even when they are zero sized
Christian König [Fri, 14 Sep 2018 18:59:27 +0000 (20:59 +0200)]
drm/amdgpu: initialize GDS/GWS/OA domains even when they are zero sized

Stops crashing on SI.

Signed-off-by: Christian König <christian.koenig@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdgpu: fix up GDS/GWS/OA shifting
Christian König [Fri, 14 Sep 2018 14:06:31 +0000 (16:06 +0200)]
drm/amdgpu: fix up GDS/GWS/OA shifting

That only worked by pure coincident. Completely remove the shifting and
always apply correct PAGE_SHIFT.

Signed-off-by: Christian König <christian.koenig@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdgpu: fix shadow BO restoring
Christian König [Tue, 11 Sep 2018 09:50:57 +0000 (11:50 +0200)]
drm/amdgpu: fix shadow BO restoring

Don't grab the reservation lock any more and simplify the handling quite
a bit.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdgpu: always recover VRAM during GPU recovery
Christian König [Tue, 11 Sep 2018 08:36:16 +0000 (10:36 +0200)]
drm/amdgpu: always recover VRAM during GPU recovery

It shouldn't add much overhead and we should make sure that critical
VRAM content is always restored.

Signed-off-by: Christian König <christian.koenig@amd.com>
Acked-by: Junwei Zhang <Jerry.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdgpu: shadow BOs don't need any alignment
Christian König [Tue, 11 Sep 2018 08:31:54 +0000 (10:31 +0200)]
drm/amdgpu: shadow BOs don't need any alignment

They aren't directly used by the hardware.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Junwei Zhang <Jerry.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdgpu: always enable shadow BOs v2
Christian König [Tue, 11 Sep 2018 08:30:31 +0000 (10:30 +0200)]
drm/amdgpu: always enable shadow BOs v2

Even when GPU recovery is disabled we could run into a manually
triggered recovery.

v2: keep accidental removed comments

Signed-off-by: Christian König <christian.koenig@amd.com>
Acked-by: Emily Deng <Emily.Deng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdgpu: stop pipelining VM PDs/PTs moves
Christian König [Tue, 11 Sep 2018 07:30:46 +0000 (09:30 +0200)]
drm/amdgpu: stop pipelining VM PDs/PTs moves

We are going to need this for recoverable page fault handling and it
makes shadow handling during GPU reset much more easier.

Signed-off-by: Christian König <christian.koenig@amd.com>
Acked-by: Junwei Zhang <Jerry.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdgpu: remove fence fallback
Christian König [Tue, 18 Sep 2018 08:38:09 +0000 (10:38 +0200)]
drm/amdgpu: remove fence fallback

DC doesn't seem to have a fallback path either.

So when interrupts doesn't work any more we are pretty much busted no
matter what.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amd/powerplay: retrieve the updated clock table after OD
Evan Quan [Mon, 17 Sep 2018 06:59:54 +0000 (14:59 +0800)]
drm/amd/powerplay: retrieve the updated clock table after OD

With OD settings applied, the clock table will be updated accordingly.
We need to retrieve the new clock tables then.

Signed-off-by: Evan Quan <evan.quan@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amd/powerplay: update OD to take voltage value instead of offset
Evan Quan [Thu, 13 Sep 2018 08:14:33 +0000 (16:14 +0800)]
drm/amd/powerplay: update OD to take voltage value instead of offset

With the latest SMC fw, we are able to get the voltage value for
specific frequency point. So, we update the OD relates to take
absolute voltage instead of offset.

Signed-off-by: Evan Quan <evan.quan@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amd/powerplay: update OD feature judgement
Evan Quan [Wed, 12 Sep 2018 03:45:01 +0000 (11:45 +0800)]
drm/amd/powerplay: update OD feature judgement

Update the conditions to judge whether an OD feature
should be supported on vega20.

Signed-off-by: Evan Quan <evan.quan@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdgpu: fix unknown vram mem type for vega20
Hawking Zhang [Mon, 17 Sep 2018 12:19:48 +0000 (20:19 +0800)]
drm/amdgpu: fix unknown vram mem type for vega20

vega20 should use umc_info v3_3 instead of v3_1. There are
serveral versions of umc_info for vega series. Compared to
various versions of these structures, vram_info strucure is
unified for vega series. The patch switch to query mem_type
from vram_info structure for all the vega series dGPU.

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>
5 years agodrm/amdgpu: update vram_info structure in atomfirmware.h
Hawking Zhang [Mon, 17 Sep 2018 12:25:03 +0000 (20:25 +0800)]
drm/amdgpu: update vram_info structure in atomfirmware.h

atomfirmware has structure changes in varm_info. Updated it
to the latest one.

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>
5 years agodrm/radeon: change function signature to pass full range
Mathieu Malaterre [Thu, 12 Apr 2018 19:33:33 +0000 (21:33 +0200)]
drm/radeon: change function signature to pass full range

In function ‘radeon_process_i2c_ch’ a comparison of a u8 value against
255 is done. Since it is always false, change the signature of this
function to use an `int` instead, which match the type used in caller:
`radeon_atom_hw_i2c_xfer`.

Fix the following warning triggered with W=1:

  CC [M]  drivers/gpu/drm/radeon/atombios_i2c.o
  drivers/gpu/drm/radeon/atombios_i2c.c: In function ‘radeon_process_i2c_ch’:
  drivers/gpu/drm/radeon/atombios_i2c.c:71:11: warning: comparison is always false due to limited range of data type [-Wtype-limits]
   if (num > ATOM_MAX_HW_I2C_READ) {
           ^

Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Mathieu Malaterre <malat@debian.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdgpu: use processed values for counting
A. Wilcox [Mon, 2 Jul 2018 03:44:52 +0000 (22:44 -0500)]
drm/amdgpu: use processed values for counting

adev->gfx.rlc has the values from rlc_hdr already processed by
le32_to_cpu.  Using the rlc_hdr values on big-endian machines causes
a kernel Oops due to writing well outside of the array (0x24000000
instead of 0x24).

Signed-off-by: A. Wilcox <AWilcox@Wilcox-Tech.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amd/amdgpu: Avoid fault when allocating an empty buffer object
Tom St Denis [Mon, 17 Sep 2018 18:07:00 +0000 (14:07 -0400)]
drm/amd/amdgpu: Avoid fault when allocating an empty buffer object

Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdgpu: drop size check
Christian König [Fri, 14 Sep 2018 19:06:50 +0000 (21:06 +0200)]
drm/amdgpu: drop size check

We no don't allocate zero sized kernel BOs any longer.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdgpu: don't allocate zero sized kernel BOs
Christian König [Fri, 14 Sep 2018 19:03:37 +0000 (21:03 +0200)]
drm/amdgpu: don't allocate zero sized kernel BOs

Just free the BO if the size should be zero.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdgpu: stop crashing on GDS/GWS/OA eviction
Christian König [Fri, 14 Sep 2018 18:44:17 +0000 (20:44 +0200)]
drm/amdgpu: stop crashing on GDS/GWS/OA eviction

Simply ignore any copying here.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdgpu: add GDS, GWS and OA debugfs files
Christian König [Fri, 14 Sep 2018 13:43:57 +0000 (15:43 +0200)]
drm/amdgpu: add GDS, GWS and OA debugfs files

Additional to the existing files for VRAM and GTT.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdgpu: fix parameter documentation for amdgpu_vm_free_pts
Christian König [Sat, 15 Sep 2018 08:04:54 +0000 (10:04 +0200)]
drm/amdgpu: fix parameter documentation for amdgpu_vm_free_pts

The function was modified without updating the documentation.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdgpu: add amdgpu_vm_entries_mask v2
Christian König [Sat, 15 Sep 2018 08:02:13 +0000 (10:02 +0200)]
drm/amdgpu: add amdgpu_vm_entries_mask v2

We can't get the mask for the root directory from the number of entries.

So add a new function to avoid that problem.

v2: fix typo in mask

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm: add LG eDP panel to quirk database
Lee, Shawn C [Wed, 12 Sep 2018 06:22:51 +0000 (23:22 -0700)]
drm: add LG eDP panel to quirk database

The N value was computed by kernel driver that based on synchronous clock
mode. But only specific N value (0x8000) would be acceptable for
LG LP140WF6-SPM1 eDP panel which is running at asynchronous clock mode.
With the other N value, Tcon will enter BITS mode and display black screen.
Add this panel into quirk database and give particular N value when
calculate M/N divider.

v2: no update
v3: add lost commit messages back for version 2
v4: send patch to both intel-gfx and dri-devel

Cc: Jani Nikula <jani.nikula@intel.com>
Cc: Cooper Chiou <cooper.chiou@intel.com>
Cc: Matt Atwood <matthew.s.atwood@intel.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
Cc: Clint Taylor <clinton.a.taylor@intel.com>
Signed-off-by: Lee, Shawn C <shawn.c.lee@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1536733371-25004-4-git-send-email-shawn.c.lee@intel.com
5 years agodrm: Change limited M/N quirk to constant N quirk.
Lee, Shawn C [Wed, 12 Sep 2018 06:22:50 +0000 (23:22 -0700)]
drm: Change limited M/N quirk to constant N quirk.

Some DP dongles in particular seem to be fussy about too large
link M/N values. Set specific value for N divider can resolve
this issue per dongle vendor's comment. So configure N as
constant value (0x8000) to instead of reduce M/N formula when
specific DP dongle connected.

v2: add more comments for issue description and fix typo.
v3: add lost commit messages back for version 2
v4: send patch to both intel-gfx and dri-devel

Cc: Jani Nikula <jani.nikula@intel.com>
Cc: Cooper Chiou <cooper.chiou@intel.com>
Cc: Matt Atwood <matthew.s.atwood@intel.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
Cc: Clint Taylor <clinton.a.taylor@intel.com>
Tested-by: Clint Taylor <clinton.a.taylor@intel.com>
Signed-off-by: Lee, Shawn C <shawn.c.lee@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1536733371-25004-3-git-send-email-shawn.c.lee@intel.com
5 years agodrm: Add support for device_id based detection.
Lee, Shawn C [Wed, 12 Sep 2018 06:22:49 +0000 (23:22 -0700)]
drm: Add support for device_id based detection.

DP quirk list just compare sink or branch device's OUI so far.
That means particular vendor's products will be applied specific
change. This change would confirm device_id the same or not.
Then driver can implement some changes for branch/sink device
that really need additional WA.

v2: use sizeof instead of hard coded '6'
v3: add lost commit messages back for version 2
v4: send patch to both intel-gfx and dri-devel

Cc: Jani Nikula <jani.nikula@intel.com>
Cc: Cooper Chiou <cooper.chiou@intel.com>
Cc: Matt Atwood <matthew.s.atwood@intel.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
Cc: Clint Taylor <clinton.a.taylor@intel.com>
Tested-by: Clint Taylor <clinton.a.taylor@intel.com>
Signed-off-by: Lee, Shawn C <shawn.c.lee@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1536733371-25004-2-git-send-email-shawn.c.lee@intel.com
5 years agodrm/virtio: add dma sync for dma mapped virtio gpu framebuffer pages
Jiandi An [Wed, 19 Sep 2018 07:09:53 +0000 (07:09 +0000)]
drm/virtio: add dma sync for dma mapped virtio gpu framebuffer pages

With virtio gpu ttm-pages being dma mapped, dma sync is needed when
swiotlb is used as bounce buffers, before TRANSFER_TO_HOST_2D/3D
commands are sent.

Signed-off-by: Jiandi An <jiandi.an@amd.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20180919070931.91168-1-jiandi.an@amd.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
5 years agodrm/sun4i: add support for R40 HDMI PHY
Icenowy Zheng [Sun, 16 Sep 2018 04:34:08 +0000 (12:34 +0800)]
drm/sun4i: add support for R40 HDMI PHY

The R40 SoC has a HDMI PHY that is possible to mux two video PLLs.

Add support for it.

Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180916043409.62374-4-icenowy@aosc.io
5 years agodt-bindings: sun4i-drm: add compatible for R40 HDMI PHY
Icenowy Zheng [Sun, 16 Sep 2018 04:34:07 +0000 (12:34 +0800)]
dt-bindings: sun4i-drm: add compatible for R40 HDMI PHY

The Allwinner R40 HDMI PHY is currently the only one that seems to be
able to select between two PLL inputs.

Add a compatible string for it, and the pll-1 clock input definition.

Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180916043409.62374-3-icenowy@aosc.io
5 years agodrm: rcar-du: Remove packed VYUY support
Kieran Bingham [Fri, 14 Sep 2018 13:21:49 +0000 (14:21 +0100)]
drm: rcar-du: Remove packed VYUY support

The Gen3 VSP used by the DU for display does not support the packed VYUY
pixel format. Gen2 VSP hardware is able to process this format, but
DU + VSP operation isn't enabled on Gen2, and VYUY isn't a strategic
format, so it can be ignored.

Remove the format from the capabilities of the DU driver.

Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
5 years agodrm: rcar-du: Update framebuffer pitch and alignment limits for Gen3
Laurent Pinchart [Fri, 31 Aug 2018 18:12:59 +0000 (19:12 +0100)]
drm: rcar-du: Update framebuffer pitch and alignment limits for Gen3

The framebuffer pitch and alignment constraints reflect the limitations
of the Gen2 DU hardware. On Gen3, the DU has no memory interface and
thus doesn't impose any constraint. The limitations come instead from
the VSP that has a limit of 65535 bytes for the pitch and no alignment
constraint. Update the checks accordingly.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
5 years agodrm: rcar-du: Add support for missing pixel formats
Koji Matsuoka [Fri, 31 Aug 2018 18:12:58 +0000 (19:12 +0100)]
drm: rcar-du: Add support for missing pixel formats

This patch supports pixel format of RGB332, ARGB4444, XRGB4444,
BGR888, RGB888, BGRA8888, BGRX8888 and YVYU.
VYUY pixel format is not supported by H/W specification.

Signed-off-by: Koji Matsuoka <koji.matsuoka.xm@renesas.com>
Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
[Reordered formats with RGB first]
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
5 years agodrm: rcar-du: Update Gen3 output limitations
Kieran Bingham [Fri, 31 Aug 2018 18:12:57 +0000 (19:12 +0100)]
drm: rcar-du: Update Gen3 output limitations

The R-Car Gen3 DU utilises the VSP1 hardware for memory access. The
limits on the RPF and WPF in this pipeline are 8190x8190.

Update the supported maximum sizes accordingly.

Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
5 years agodrm: rcar-du: lvds: add R8A77980 support
Sergei Shtylyov [Tue, 5 Jun 2018 20:30:36 +0000 (23:30 +0300)]
drm: rcar-du: lvds: add R8A77980 support

Add support for the R-Car V3H (R8A77980) SoC to the LVDS encoder driver.

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
5 years agodrm: rcar-du: Write ESCR and OTAR as CRTC registers
Jacopo Mondi [Wed, 22 Aug 2018 07:21:48 +0000 (09:21 +0200)]
drm: rcar-du: Write ESCR and OTAR as CRTC registers

The ESCR and OTAR registers exist in each DU channel, but at different
offsets for odd and even channels. This led to usage of the group
register access API to write them, with offsets macros named ESCR/OTAR
and ESCR2/OTAR2 for the first and second ESCR/OTAR register in the group
respectively.

The names are confusing as it suggests that the ESCR/OTAR registers for
DU0 and DU2 are taken into account, especially with writes performed to
the group register access API.

Rename the offsets to ESCR/OTAR02 and ESCR/OTAR13, and use the CRTC
register access API to clarify the code. The offsets values are updated
accordingly.

Cosmetic patch, no functional changes intended.

Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
[Squashed ESCR and OTAR changes in a single commit]
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
5 years agodrm: rcar-du: Rename and document dpll_ch field
Jacopo Mondi [Wed, 22 Aug 2018 07:21:47 +0000 (09:21 +0200)]
drm: rcar-du: Rename and document dpll_ch field

Document and re-name the 'dpll_ch' field to a more precise 'dpll_mask' for
consistency with the 'channels_mask' field defined in 'struct
rcar_du_device_info'.

Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
5 years agodrm: rcar-du: Improve non-DPLL clock selection
Jacopo Mondi [Mon, 20 Aug 2018 15:26:17 +0000 (17:26 +0200)]
drm: rcar-du: Improve non-DPLL clock selection

DU channels not equipped with a DPLL use an SoC internal (provided by
the CPG) or external clock source combined with a DU internal divider to
generate the desired output dot clock frequency.

The current clock selection procedure does not fully exploit the ability
of external clock sources to generate the exact dot clock frequency by
themselves, but relies instead on tuning the internal DU clock divider
only, resulting in a less precise clock generation process.

When possible, and desirable, ask the external clock source for the
exact output dot clock frequency, and select the clock source that
produces the frequency closest to the desired output dot clock.

This patch specifically targets platforms (like Salvator-X[S] and ULCBs)
where the DU's input dotclock.in is generated by the versaclock VC5
clock source, which is capable of generating the exact rate the DU needs
as pixel clock output.

This patch fixes higher resolution modes which requires an high pixel
clock output currently not working on non-HDMI DU channel (such as
1920x1080@60Hz on the VGA output).

Fixes: 1b30dbde8596 ("drm: rcar-du: Add support for external pixel clock")
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
[Factor out code to a helper function]
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
5 years agodrm: rcar-du: Rework clock configuration based on hardware limits
Laurent Pinchart [Fri, 27 Jul 2018 12:29:08 +0000 (15:29 +0300)]
drm: rcar-du: Rework clock configuration based on hardware limits

The DU channels that have a display PLL (DPLL) can only use external
clock sources, and don't have an internal clock divider (with the
exception of H3 ES1.x where the post-divider is present and needs to be
used as a workaround for a DPLL silicon issue).

Rework the clock configuration to take this into account, avoiding
selection of non-existing clock sources or usage of a missing
post-divider.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
5 years agodrm/amd/display: Drop amdgpu_dm_prev_state struct
Leo Li [Wed, 5 Sep 2018 15:28:29 +0000 (11:28 -0400)]
drm/amd/display: Drop amdgpu_dm_prev_state struct

[Why]
It's not being used

[How]
Nuke it

Signed-off-by: Leo Li <sunpeng.li@amd.com>
Reviewed-by: David Francis <David.Francis@amd.com>
Acked-by: Leo Li <sunpeng.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amd/display: Drop amdgpu_display_manager.dal member
Leo Li [Wed, 5 Sep 2018 15:19:42 +0000 (11:19 -0400)]
drm/amd/display: Drop amdgpu_display_manager.dal member

[Why]
It's not being used anymore.

[How]
Nuke it

Signed-off-by: Leo Li <sunpeng.li@amd.com>
Reviewed-by: David Francis <David.Francis@amd.com>
Acked-by: Leo Li <sunpeng.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amd/display: add query HPD interface.
Chiawen Huang [Wed, 5 Sep 2018 12:34:57 +0000 (20:34 +0800)]
drm/amd/display: add query HPD interface.

[Why]
current dc_link_detect function is not only detection but also update some link data.

[How]
added a pure get HPD state function.

Signed-off-by: Chiawen Huang <chiawen.huang@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Leo Li <sunpeng.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amd/display: dc 3.1.66
Tony Cheng [Mon, 27 Aug 2018 17:35:31 +0000 (13:35 -0400)]
drm/amd/display: dc 3.1.66

Signed-off-by: Tony Cheng <tony.cheng@amd.com>
Reviewed-by: Steven Chiu <Steven.Chiu@amd.com>
Acked-by: Leo Li <sunpeng.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amd/display: add aux i2c event log.
Chiawen Huang [Wed, 29 Aug 2018 10:39:38 +0000 (18:39 +0800)]
drm/amd/display: add aux i2c event log.

[Why]
support i2c transition event log

[How]
refined aux REQ and REP events in aux flow.
commented REQ and REP events in i2c flow.

note: i2c event log is currently commented out. more work is required
to find an portocol parser to and generate event for the parser

Signed-off-by: Chiawen Huang <chiawen.huang@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Leo Li <sunpeng.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amd/display: stop using switch for different CS revisions
Dmytro Laktyushkin [Wed, 29 Aug 2018 20:23:59 +0000 (16:23 -0400)]
drm/amd/display: stop using switch for different CS revisions

Clock sources currently have support for asic specific
function pointers. But actual separation into functions
was never performed, leaving us with giant functions that
rely on switch.

This change creates separate functions, removing switch use.

Signed-off-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Leo Li <sunpeng.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amd/display: Fix 3D stereo issues.
Charlene Liu [Mon, 27 Aug 2018 15:31:08 +0000 (11:31 -0400)]
drm/amd/display: Fix 3D stereo issues.

We were not providing the correct pixel clocks to DML for marks
calculation.

Signed-off-by: Charlene Liu <charlene.liu@amd.com>
Reviewed-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
Acked-by: Leo Li <sunpeng.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm: Differentiate the lack of an interface from invalid parameter
Chris Wilson [Thu, 13 Sep 2018 19:20:50 +0000 (20:20 +0100)]
drm: Differentiate the lack of an interface from invalid parameter

If the ioctl is not supported on a particular piece of HW/driver
combination, report ENOTSUP (aka EOPNOTSUPP) so that it can be easily
distinguished from both the lack of the ioctl and from a regular invalid
parameter.

v2: Across all the kms ioctls we had a mixture of reporting EINVAL,
ENODEV and a few ENOTSUPP (most where EINVAL) for a failed
drm_core_check_feature(). Update everybody to report ENOTSUPP.

v3: ENOTSUPP is an internal errno! It's value (524) does not correspond
to a POSIX errno, the one we want is ENOTSUP. However,
uapi/asm-generic/errno.h doesn't include ENOTSUP but man errno says

"ENOTSUP and EOPNOTSUPP have the same value on Linux,
but according to POSIX.1 these error values should be
distinct."

so use EOPNOTSUPP as its equivalent.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> #v2
Link: https://patchwork.freedesktop.org/patch/msgid/20180913192050.24812-1-chris@chris-wilson.co.uk
5 years agodrm/amdgpu: revert "stop using gart_start as offset for the GTT domain"
Christian König [Fri, 14 Sep 2018 10:54:33 +0000 (12:54 +0200)]
drm/amdgpu: revert "stop using gart_start as offset for the GTT domain"

Turned out the commit is incomplete and since we remove using the AGP
mapping from the GTT manager it is also not necessary any more.

This reverts commit 22d8bfafcc12dfa17b91d2e8ae4e1898e782003a.

Signed-off-by: Christian König <christian.koenig@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Acked-by: James Zhu <James.Zhu@amd.com>
Tested-by: James Zhu <James.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdgpu: fix mask in GART location calculation
Christian König [Fri, 14 Sep 2018 08:17:24 +0000 (10:17 +0200)]
drm/amdgpu: fix mask in GART location calculation

We need to mask the lower bits not the upper one.

Fixes: ec210e3226dc0 drm/amdgpu: put GART away from VRAM v2
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Acked-by: James Zhu <James.Zhu@amd.com>
Tested-by: James Zhu <James.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdgpu/display: return proper error codes in dm
Alex Deucher [Thu, 13 Sep 2018 16:01:28 +0000 (11:01 -0500)]
drm/amdgpu/display: return proper error codes in dm

Replace -1 with proper error codes.

Acked-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdgpu: simplify Raven, Raven2, and Picasso handling
Alex Deucher [Thu, 13 Sep 2018 20:41:57 +0000 (15:41 -0500)]
drm/amdgpu: simplify Raven, Raven2, and Picasso handling

Treat them all as Raven rather than adding a new picasso
asic type.  This simplifies a lot of code and also handles the
case of rv2 chips with the 0x15d8 pci id.  It also fixes dmcu
fw handling for picasso.

Acked-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdgpu/soc15: clean up picasso support
Alex Deucher [Thu, 13 Sep 2018 20:05:22 +0000 (15:05 -0500)]
drm/amdgpu/soc15: clean up picasso support

It's the same as raven so remove the duplicate case.

Acked-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdgpu: Add DMCU to firmware query interface
David Francis [Thu, 13 Sep 2018 19:37:50 +0000 (15:37 -0400)]
drm/amdgpu: Add DMCU to firmware query interface

DMCU firmware version can be read using the AMDGPU_INFO ioctl
or the amdgpu_firmware_info debugfs entry

Signed-off-by: David Francis <David.Francis@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amd/display: Add DMCU firmware version
David Francis [Thu, 13 Sep 2018 19:36:27 +0000 (15:36 -0400)]
drm/amd/display: Add DMCU firmware version

Read the version number from the common firmware header and store
it in the dm struct

Signed-off-by: David Francis <David.Francis@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdgpu: Style fixes to PRIME code documentation
Vijetha Malkai [Thu, 13 Sep 2018 18:47:39 +0000 (14:47 -0400)]
drm/amdgpu: Style fixes to PRIME code documentation

* Use consistent capitalization in the description of function arguments
* Define and consistently use the BO acronym for buffer objects
* Some minor wording improvements

Signed-off-by: Vijetha Malkai <vijetha.malkai@amd.com>
[ Michel Dänzer: Made commit log more specific ]

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdgpu: Initialize fences array entries in amdgpu_sa_bo_next_hole
Michel Dänzer [Wed, 12 Sep 2018 16:07:10 +0000 (18:07 +0200)]
drm/amdgpu: Initialize fences array entries in amdgpu_sa_bo_next_hole

The entries were only initialized once in amdgpu_sa_bo_new. If a fence
wasn't signalled yet in the first amdgpu_sa_bo_next_hole call, but then
got signalled before a later amdgpu_sa_bo_next_hole call, it could
destroy the fence but leave its pointer in the array, resulting in
use-after-free in amdgpu_sa_bo_new.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdgpu: set CG flags for raven2 (v2)
Huang Rui [Tue, 19 Jun 2018 15:46:42 +0000 (10:46 -0500)]
drm/amdgpu: set CG flags for raven2 (v2)

Raven2 does not enable all of the CG flags that raven1 does.

v2: rebase (Alex)

Signed-off-by: Huang Rui <ray.huang@amd.com>
Reviewed-by: Feifei Xu <Feifei.Xu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amd/powerplay: disable raven2 force dpm level support (v2)
Evan Quan [Tue, 19 Jun 2018 15:41:00 +0000 (10:41 -0500)]
drm/amd/powerplay: disable raven2 force dpm level support (v2)

It's not supported yet.

v2: rebase (Alex)

Signed-off-by: Evan Quan <evan.quan@amd.com>
Reviewed-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amd/powerplay: round up the Mhz convertion (v2)
Evan Quan [Tue, 19 Jun 2018 15:32:50 +0000 (10:32 -0500)]
drm/amd/powerplay: round up the Mhz convertion (v2)

Since the clock value there may be like 29999 10Khz.

v2: rebase (Alex)

Signed-off-by: Evan Quan <evan.quan@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amd/powerplay: update smu10_verify_smc_interface() to be raven2 compatible
Evan Quan [Fri, 15 Jun 2018 22:22:38 +0000 (17:22 -0500)]
drm/amd/powerplay: update smu10_verify_smc_interface() to be raven2 compatible

Check the raven2 version number as well.

Signed-off-by: Evan Quan <evan.quan@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amd/display: Add DC config flag for Raven2 (v2)
Bhawanpreet Lakha [Mon, 22 Jan 2018 22:40:50 +0000 (17:40 -0500)]
drm/amd/display: Add DC config flag for Raven2 (v2)

Add DRM_AMD_DC_DCN1_01 config flag for Raven2

v2: Make DC select DRM_AMD_DC_DCN1_01 (Alex)

Signed-off-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amd/display: Add Raven2 definitions in dc
Bhawanpreet Lakha [Mon, 22 Jan 2018 21:12:27 +0000 (16:12 -0500)]
drm/amd/display: Add Raven2 definitions in dc

Add Raven2 definitions in the dc code

Signed-off-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdgpu: fix the VM fault while write at the top of the invisible vram
Huang Rui [Tue, 16 Jan 2018 02:42:58 +0000 (10:42 +0800)]
drm/amdgpu: fix the VM fault while write at the top of the invisible vram

Raven2 has a HW issue that it is unable to use the vram which is out of
MC_VM_SYSTEM_APERTURE_HIGH_ADDR. So here is the workaround that increase system
aperture high address to get rid of the VM fault and hardware hang.

Signed-off-by: Huang Rui <ray.huang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdgpu/gfx9: add raven2 golden setting
Feifei Xu [Thu, 4 Jan 2018 10:36:40 +0000 (18:36 +0800)]
drm/amdgpu/gfx9: add raven2 golden setting

Golden register settings from the hw team.

Signed-off-by: Feifei Xu <Feifei.Xu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdgpu/gfx9: add support for raven2 gfx firmware
Feifei Xu [Thu, 4 Jan 2018 10:33:49 +0000 (18:33 +0800)]
drm/amdgpu/gfx9: add support for raven2 gfx firmware

use raven2 gfx firmware.

Signed-off-by: Feifei Xu <Feifei.Xu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdgpu/sdma4: Add raven2 golden setting
Feifei Xu [Thu, 4 Jan 2018 10:13:41 +0000 (18:13 +0800)]
drm/amdgpu/sdma4: Add raven2 golden setting

Golden register settings from the hw team.

Signed-off-by: Feifei Xu <Feifei.Xu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdgpu/sdma4: specify raven2 firmware.
Feifei Xu [Thu, 4 Jan 2018 10:05:35 +0000 (18:05 +0800)]
drm/amdgpu/sdma4: specify raven2 firmware.

use raven2 sdma firmware.

Signed-off-by: Feifei Xu <Feifei.Xu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdgpu: add psp support for raven2
Likun Gao [Tue, 5 Jun 2018 06:05:45 +0000 (14:05 +0800)]
drm/amdgpu: add psp support for raven2

Modified for using raven2_asd.bin to replace raven_asd.bin for raven2

Signed-off-by: Likun Gao <Likun.Gao@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdgpu: add raven2 vcn firmware support
Feifei Xu [Fri, 15 Jun 2018 21:01:41 +0000 (16:01 -0500)]
drm/amdgpu: add raven2 vcn firmware support

Specify raven2 vcn firmware on amdgpu_vce_sw_init.

Signed-off-by: Feifei Xu <Feifei.Xu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdgpu: add raven2 to gpu_info firmware
Feifei Xu [Thu, 4 Jan 2018 09:26:00 +0000 (17:26 +0800)]
drm/amdgpu: add raven2 to gpu_info firmware

Add gpu_info firmware for raven2.

Signed-off-by: Feifei Xu <Feifei.Xu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdgpu: set external rev id for raven2
Alex Deucher [Fri, 15 Jun 2018 22:28:44 +0000 (17:28 -0500)]
drm/amdgpu: set external rev id for raven2

It's different from raven1.

Signed-off-by: Huang Rui <ray.huang@amd.com>
Reviewed-by: Feifei Xu <Feifei.Xu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdgpu: move get_rev_id at first before load gpu_info firmware
Huang Rui [Fri, 15 Jun 2018 21:05:48 +0000 (16:05 -0500)]
drm/amdgpu: move get_rev_id at first before load gpu_info firmware

Rev id is used for identifying Raven2 series of chips. So we would better to
initialize it at first.

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>
5 years agodrm/amdgpu: use IP presence to free uvd and vce handles
Alex Deucher [Wed, 12 Sep 2018 18:51:25 +0000 (13:51 -0500)]
drm/amdgpu: use IP presence to free uvd and vce handles

Rather than checking the asic type, check whether the UVD
or VCE IP blocks exist.  This way we don't have to update
the check with new asics that use VCN.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdgpu: enable gfxoff in non-sriov and stutter mode by default
Kenneth Feng [Thu, 6 Sep 2018 06:56:19 +0000 (14:56 +0800)]
drm/amdgpu: enable gfxoff in non-sriov and stutter mode by default

enable gfxoff in non-sriov and stutter mode by default

Signed-off-by: Kenneth Feng <kenneth.feng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdgpu: add new raven series device
Huang Rui [Mon, 9 Jul 2018 11:51:19 +0000 (19:51 +0800)]
drm/amdgpu: add new raven series device

This patch is to add new pci device for raven series.

Signed-off-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Likun Gao <Likun.Gao@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdgpu: add ip blocks for picasso (v2)
Huang Rui [Mon, 9 Jul 2018 12:00:05 +0000 (20:00 +0800)]
drm/amdgpu: add ip blocks for picasso (v2)

Add PCO IPs.

V2: enable VCN as well

Signed-off-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Likun Gao <Likun.Gao@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdgpu: enable vcn powergating for PCO
Kenneth Feng [Fri, 24 Aug 2018 08:44:11 +0000 (16:44 +0800)]
drm/amdgpu: enable vcn powergating for PCO

enable vcn pg

Signed-off-by: Kenneth Feng <kenneth.feng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdgpu: enable mmhub power gating
Kenneth Feng [Mon, 20 Aug 2018 07:39:32 +0000 (15:39 +0800)]
drm/amdgpu: enable mmhub power gating

Remove some functions due to the design change.
All the mmhub power gating sequence is moved to
smu fw.Driver sends the message to enable mmhub
powergating.We can also skip the fw version check
since the old fw version is in a very early stage
and we don't use that fw for release.

Signed-off-by: Kenneth Feng <kenneth.feng@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdgpu: Enable SDMA power gating for PCO
Kenneth Feng [Fri, 10 Aug 2018 08:22:26 +0000 (16:22 +0800)]
drm/amdgpu: Enable SDMA power gating for PCO

Enable SDMA power gating

Signed-off-by: Kenneth Feng <kenneth.feng@amd.com>
Acked-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdgpu: Add pg support for gfxoff for PCO
Kenneth Feng [Tue, 7 Aug 2018 09:05:22 +0000 (17:05 +0800)]
drm/amdgpu: Add pg support for gfxoff for PCO

Add pg support for gfxoff.

Signed-off-by: Kenneth Feng <kenneth.feng@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdgpu: add picasso for amdgpu kms
Likun Gao [Tue, 10 Jul 2018 12:34:10 +0000 (20:34 +0800)]
drm/amdgpu: add picasso for amdgpu kms

Add picasso for amdgpu kms

Signed-off-by: Likun Gao <Likun.Gao@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdgpu: add picasso support for sdma_v4
Likun Gao [Tue, 10 Jul 2018 12:30:42 +0000 (20:30 +0800)]
drm/amdgpu: add picasso support for sdma_v4

Add sdma support to picasso

Signed-off-by: Likun Gao <Likun.Gao@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdgpu: add picasso support for gfx_v9_0
Likun Gao [Tue, 10 Jul 2018 12:29:12 +0000 (20:29 +0800)]
drm/amdgpu: add picasso support for gfx_v9_0

Add gfx support to picasso

Signed-off-by: Likun Gao <Likun.Gao@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdgpu: add picasso support for gmc
Likun Gao [Tue, 10 Jul 2018 12:26:41 +0000 (20:26 +0800)]
drm/amdgpu: add picasso support for gmc

Same as raven.

Signed-off-by: Likun Gao <Likun.Gao@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>