platform/kernel/linux-rpi.git
6 years agoMerge tag 'drm-misc-next-2018-03-09-3' of git://anongit.freedesktop.org/drm/drm-misc...
Dave Airlie [Wed, 14 Mar 2018 00:59:16 +0000 (10:59 +1000)]
Merge tag 'drm-misc-next-2018-03-09-3' of git://anongit.freedesktop.org/drm/drm-misc into drm-next

drm-misc-next for 4.17:

UAPI Changes:
 plane: Add color encoding/range properties (Jyri)
 nouveau: Replace iturbt_709 property with color_encoding property (Ville)

Core Changes:
 atomic: Move plane clipping into plane check helper (Ville)
 property: Multiple new property checks/verification (Ville)

Driver Changes:
 rockchip: Fixes & improvements for rk3399/chromebook plus (various)
 sun4i: Add H3/H5 HDMI support (Jernej)
 i915: Add support for limited/full-range ycbcr toggling (Ville)
 pl111: Add bandwidth checking/limiting (Linus)

Cc: Jernej Skrabec <jernej.skrabec@siol.net>
Cc: Jyri Sarha <jsarha@ti.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
* tag 'drm-misc-next-2018-03-09-3' of git://anongit.freedesktop.org/drm/drm-misc: (85 commits)
  drm/rockchip: Don't use atomic constructs for psr
  drm/rockchip: analogix_dp: set psr activate/deactivate when enable/disable bridge
  drm/rockchip: dw_hdmi: Move HDMI vpll clock enable to bind()
  drm/rockchip: inno_hdmi: reorder clk_disable_unprepare call in unbind
  drm/rockchip: inno_hdmi: Fix error handling path.
  drm/rockchip: dw-mipi-dsi: Fix connector and encoder cleanup.
  drm/nouveau: Replace the iturbt_709 prop with the standard COLOR_ENCODING prop
  drm/pl111: Use max memory bandwidth for resolution
  drm/bridge: sii902x: Retry status read after DDI I2C
  drm/pl111: Handle the RealView variant separately
  drm/pl111: Make the default BPP a per-variant variable
  drm: simple_kms_helper: Fix .mode_valid() documentation
  bridge: Elaborate a bit on dumb VGA bridges in Kconfig
  drm/atomic: Add new reverse iterator over all plane state (V2)
  drm: Reject bad property flag combinations
  drm: Make property flags u32
  drm/uapi: Deprecate DRM_MODE_PROP_PENDING
  drm: WARN when trying to add enum value > 63 to a bitmask property
  drm: WARN when trying add enum values to non-enum/bitmask properties
  drm: Reject replacing property enum values
  ...

6 years agodrm/amd/pp: fix missing CONFIG_ACPI.
Dave Airlie [Wed, 14 Mar 2018 00:54:55 +0000 (10:54 +1000)]
drm/amd/pp: fix missing CONFIG_ACPI.

This was stopping me building on ARM after last pull.

Signed-off-by: Dave Airlie <airlied@redhat.com>
6 years agoMerge branch 'drm-next-4.17' of git://people.freedesktop.org/~agd5f/linux into drm...
Dave Airlie [Fri, 9 Mar 2018 00:50:45 +0000 (10:50 +1000)]
Merge branch 'drm-next-4.17' of git://people.freedesktop.org/~agd5f/linux into drm-next

More stuff for 4.17. Highlights:
- More fixes for "wattman" like functionality (fine grained clk/voltage control)
- Add more power profile infrastucture (context based dpm)
- SR-IOV fixes
- Add iomem debugging interface for use with umr
- Powerplay and cgs cleanups
- DC fixes and cleanups
- ttm improvements
- Misc cleanups all over

* 'drm-next-4.17' of git://people.freedesktop.org/~agd5f/linux: (143 commits)
  drm/amdgpu:Always save uvd vcpu_bo in VM Mode
  drm/amdgpu:Correct max uvd handles
  drm/amdgpu: replace iova debugfs file with iomem (v3)
  drm/amd/display: validate plane format on primary plane
  drm/amdgpu: Clean sdma wptr register when only enable wptr polling
  drm/amd/amdgpu: re-add missing GC 9.1 and SDMA0 4.1 sh_mask header files
  drm/amdgpu: give warning before sleep in kiq_r/wreg
  drm/amdgpu: further mitigate workaround for i915
  drm/amdgpu: drop gtt->adev
  drm/amdgpu: add amdgpu_evict_gtt debugfs entry
  drm/amd/pp: Add #ifdef checks for CONFIG_ACPI
  drm/amd/pp: fix "Delete the wrapper layer of smu_allocate/free_memory"
  drm/amd/pp: Drop wrapper functions for upper/lower_32_bits
  drm/amdgpu: Delete cgs wrapper functions for gpu memory manager
  drm/amd/pp: Delete the wrapper layer of smu_allocate/free_memory
  drm/amd/pp: Remove cgs wrapper function for temperature update
  Revert "drm/amd/pp: Add a pp feature mask bit for AutoWattman feature"
  drm/amd/pp: Add auto power profilng switch based on workloads (v2)
  drm/amd/pp: Revert gfx/compute profile switch sysfs
  drm/amd/pp: Fix sclk in highest two levels when compute on smu7
  ...

6 years agoMerge branch 'drm/next/du' of git://linuxtv.org/pinchartl/media into drm-next
Dave Airlie [Fri, 9 Mar 2018 00:22:30 +0000 (10:22 +1000)]
Merge branch 'drm/next/du' of git://linuxtv.org/pinchartl/media into drm-next

- Convert LVDS support to a drm_bridge driver
- Add DT bindings for the R8A77995 SoC
- Add DT bindings and driver support for the R8A77970 SoC

Note that the LVDS conversion depends on a patch series from Frank Rowand that
will make it upstream through Rob Herring's tree. Frank has provided a stable
branch based on v4.16-rc1 with the patches, and both Rob and I have merged it
into our trees. This should thus generate no conflict when reaching -next.

* 'drm/next/du' of git://linuxtv.org/pinchartl/media:
  dt-bindings: display: renesas: lvds: Document r8a77995 bindings
  dt-bindings: display: renesas: du: Document r8a77995 bindings
  drm: rcar-du: lvds: Add R8A77970 support
  drm: rcar-du: Add R8A77970 support
  dt-bindings: display: renesas: lvds: Document R8A77970 bindings
  dt-bindings: display: renesas: du: Document R8A77970 bindings
  drm: rcar-du: Convert LVDS encoder code to bridge driver
  drm: rcar-du: Fix legacy DT to create LVDS encoder nodes
  dt-bindings: display: renesas: Deprecate LVDS support in the DU bindings
  dt-bindings: display: renesas: Add R-Car LVDS encoder DT bindings
  of: improve reporting invalid overlay target path
  of: convert unittest overlay devicetree source to sugar syntax
  of: Documentation: of_overlay_apply() replaced by of_overlay_fdt_apply()
  of: change overlay apply input data from unflattened to FDT
  x86: devicetree: fix config option around x86_flattree_get_config()

6 years agodrm/rockchip: Don't use atomic constructs for psr
Sean Paul [Mon, 5 Mar 2018 22:22:54 +0000 (23:22 +0100)]
drm/rockchip: Don't use atomic constructs for psr

Instead of using timer and spinlocks, use delayed_work and
mutexes for rockchip psr. This allows us to make blocking
calls when enabling/disabling psr (which is sort of important
given we're talking over dpcd to the display).

Cc: Caesar Wang <wxt@rock-chips.com>
Cc: 征增 王 <wzz@rock-chips.com>
Cc: Stéphane Marchesin <marcheu@chromium.org>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Thierry Escande <thierry.escande@collabora.com>
Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20180305222324.5872-3-enric.balletbo@collabora.com
6 years agodrm/rockchip: analogix_dp: set psr activate/deactivate when enable/disable bridge
zain wang [Mon, 5 Mar 2018 22:22:53 +0000 (23:22 +0100)]
drm/rockchip: analogix_dp: set psr activate/deactivate when enable/disable bridge

There's a race between when bridge_disable and when vop_crtc_disable
are called. If the flush timer triggers a new psr work between these,
we will operate eDP without power shutdowned by bridge_disable. In this
case, moving activate/deactivate to enable/disable bridge to avoid it.

Cc: Stéphane Marchesin <marcheu@chromium.org>
Signed-off-by: zain wang <wzz@rock-chips.com>
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Thierry Escande <thierry.escande@collabora.com>
Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20180305222324.5872-2-enric.balletbo@collabora.com
6 years agodrm/rockchip: dw_hdmi: Move HDMI vpll clock enable to bind()
Jeffy Chen [Fri, 2 Mar 2018 17:57:56 +0000 (18:57 +0100)]
drm/rockchip: dw_hdmi: Move HDMI vpll clock enable to bind()

The HDMI vpll clock should be enabled when bind() is called. So move the
clk_prepare_enable of that clock to bind() function and add the missing
clk_disable_unprepare() required in error handling path and unbind().

Fixes: 12b9f204e804 ("drm: bridge/dw_hdmi: add rockchip rk3288 support")
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Signed-off-by: Thierry Escande <thierry.escande@collabora.com>
Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20180302175757.28192-5-enric.balletbo@collabora.com
6 years agodrm/rockchip: inno_hdmi: reorder clk_disable_unprepare call in unbind
Jeffy Chen [Fri, 2 Mar 2018 17:57:55 +0000 (18:57 +0100)]
drm/rockchip: inno_hdmi: reorder clk_disable_unprepare call in unbind

In bind the clk_prepare_enable of the HDMI pclk is called before adding the
i2c_adapter. So it should be the other way around in unbind, first remove
the i2c_adapter and then call the clk_disable_unprepare.

Fixes: 412d4ae6b7a5 ("drm/rockchip: hdmi: add Innosilicon HDMI support")
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Signed-off-by: Thierry Escande <thierry.escande@collabora.com>
Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20180302175757.28192-4-enric.balletbo@collabora.com
6 years agodrm/rockchip: inno_hdmi: Fix error handling path.
Jeffy Chen [Fri, 2 Mar 2018 17:57:54 +0000 (18:57 +0100)]
drm/rockchip: inno_hdmi: Fix error handling path.

Add missing error handling in bind().

Fixes: 412d4ae6b7a5 ("drm/rockchip: hdmi: add Innosilicon HDMI support")
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Signed-off-by: Thierry Escande <thierry.escande@collabora.com>
[moved clk_disable_unprepare reordering in unbind to separate patch]
Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20180302175757.28192-3-enric.balletbo@collabora.com
6 years agodrm/rockchip: dw-mipi-dsi: Fix connector and encoder cleanup.
Jeffy Chen [Fri, 2 Mar 2018 17:57:53 +0000 (18:57 +0100)]
drm/rockchip: dw-mipi-dsi: Fix connector and encoder cleanup.

In bind()'s error handling path call destroy functions instead of
cleanup functions for encoder and connector and reorder to match how is
called in bind().

In unbind() call the connector and encoder destroy functions.

Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Signed-off-by: Thierry Escande <thierry.escande@collabora.com>
Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20180302175757.28192-2-enric.balletbo@collabora.com
6 years agodrm/nouveau: Replace the iturbt_709 prop with the standard COLOR_ENCODING prop
Ville Syrjälä [Tue, 20 Feb 2018 13:48:16 +0000 (15:48 +0200)]
drm/nouveau: Replace the iturbt_709 prop with the standard COLOR_ENCODING prop

Replace the ad-hoc iturbt_709 property with the new standard
COLOR_ENCODING property. Compiles, but not tested.

v2: Fix typos (Ilia)

Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: nouveau@lists.freedesktop.org
Cc: Ben Skeggs <bskeggs@redhat.com>
Cc: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180220134816.15229-1-ville.syrjala@linux.intel.com
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Acked-by: Ben Skeggs <bskeggs@redhat.com> #irc
6 years agodrm/pl111: Use max memory bandwidth for resolution
Linus Walleij [Wed, 7 Mar 2018 21:58:19 +0000 (22:58 +0100)]
drm/pl111: Use max memory bandwidth for resolution

We were previously selecting 1024x768 and 32BPP as the default
set-up for the PL111 consumers.

This does not work on elder systems: the device tree bindings
support a property "max-memory-bandwidth" in bytes/second that
states that if you exceed this the memory bus will saturate.
The result is flickering and unstable images.

Parse the "max-memory-bandwidth" and respect it when
intializing the driver. On the RealView PB11MP, Versatile and
Integrator/CP we get a nice console as default with this code.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20180307215819.15814-1-linus.walleij@linaro.org
6 years agodrm/bridge: sii902x: Retry status read after DDI I2C
Linus Walleij [Mon, 5 Mar 2018 10:17:02 +0000 (11:17 +0100)]
drm/bridge: sii902x: Retry status read after DDI I2C

The following happens when connection a DVI output driven
from the SiI9022 using a DVI-to-VGA adapter plug:

i2c i2c-0: sendbytes: NAK bailout.
i2c i2c-0: sendbytes: NAK bailout.

Then no picture. Apparently the I2C engine inside the SiI9022
is not smart enough to try to fall back to DDC I2C. Or the
vendor have not integrated the electronics properly. I don't
know which one it is.

After this, the I2C bus seems stalled and the first attempt to
read the status register fails, and the code returns with
negative return value, and the display fails to initialized.

Instead, retry status readout five times and continue even
if this fails.

Tested on the ARM Versatile Express with a DVI-to-VGA
connector, it now gives picture.

Introduce a helper struct device *dev variable to make
the code more readable.

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Liviu Dudau <Liviu.Dudau@arm.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20180305101702.13441-1-linus.walleij@linaro.org
6 years agodrm/pl111: Handle the RealView variant separately
Linus Walleij [Fri, 2 Mar 2018 09:09:47 +0000 (10:09 +0100)]
drm/pl111: Handle the RealView variant separately

We want to cut down the default bpp to 16 on the RealView so
we can have a 1024x768 framebuffer console by default. The
memory bandwidth limitations makes this not work with the
PL111 default of 32bpp.

This builds on top of the earlier patches making the
framebuffer default bpp a per-variant variable.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20180302090948.6399-4-linus.walleij@linaro.org
6 years agodrm/pl111: Make the default BPP a per-variant variable
Linus Walleij [Fri, 2 Mar 2018 09:09:45 +0000 (10:09 +0100)]
drm/pl111: Make the default BPP a per-variant variable

The PL110, Integrator and Versatile boards strongly prefer to
use 16 BPP even if other modes are supported, both to keep down
memory consumption and also to easier find a good match to
supported resolutions with consideration taken to the memory
bandwidth of the platforms.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20180302090948.6399-2-linus.walleij@linaro.org
Link: https://patchwork.freedesktop.org/patch/msgid/20180307084316.23623-1-linus.walleij@linaro.org
Link: https://patchwork.freedesktop.org/patch/msgid/20180307084316.23623-1-linus.walleij@linaro.org
6 years agodrm: simple_kms_helper: Fix .mode_valid() documentation
Linus Walleij [Tue, 27 Feb 2018 10:11:09 +0000 (11:11 +0100)]
drm: simple_kms_helper: Fix .mode_valid() documentation

This fixes up the .mode_valid() vtable entry documentation
by copyediting the documentation from the .mode_valid()
documentation in the drm_modeset_helper_vtables.h file.

Fixes: 40275dc4edb4 ("drm: simple_kms_helper: Add mode_valid() callback support")
Suggested-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20180227101109.6088-1-linus.walleij@linaro.org
6 years agobridge: Elaborate a bit on dumb VGA bridges in Kconfig
Linus Walleij [Fri, 2 Mar 2018 09:14:26 +0000 (10:14 +0100)]
bridge: Elaborate a bit on dumb VGA bridges in Kconfig

It's better if we explain a bit that this pertains to
non-programmable VGA DAC bridges.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20180302091426.8463-1-linus.walleij@linaro.org
6 years agodrm/amdgpu:Always save uvd vcpu_bo in VM Mode
James Zhu [Tue, 6 Mar 2018 19:52:35 +0000 (14:52 -0500)]
drm/amdgpu:Always save uvd vcpu_bo in VM Mode

When UVD is in VM mode, there is not uvd handle exchanged,
uvd.handles are always 0. So vcpu_bo always need save,
Otherwise amdgpu driver will fail during suspend/resume.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105021
Signed-off-by: James Zhu <James.Zhu@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
6 years agodrm/amdgpu:Correct max uvd handles
James Zhu [Tue, 6 Mar 2018 19:43:50 +0000 (14:43 -0500)]
drm/amdgpu:Correct max uvd handles

Max uvd handles should use adev->uvd.max_handles instead of
AMDGPU_MAX_UVD_HANDLES here.

Signed-off-by: James Zhu <James.Zhu@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
6 years agodrm/amdgpu: replace iova debugfs file with iomem (v3)
Tom St Denis [Fri, 23 Feb 2018 14:46:23 +0000 (09:46 -0500)]
drm/amdgpu: replace iova debugfs file with iomem (v3)

This allows access to pages allocated through the driver with optional
IOMMU mapping.

v2: Fix number of bytes copied and add write method
v3: drop check for kmap return

Original-by: Christian König <christian.koenig@amd.com>
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>
6 years agodrm/amd/display: validate plane format on primary plane
Shirish S [Wed, 7 Mar 2018 07:06:11 +0000 (12:36 +0530)]
drm/amd/display: validate plane format on primary plane

In dce110, the plane configuration is such that plane 0
or the primary plane should be rendered with only RGB data.

This patch adds the validation to ensure that no video data
is rendered on plane 0.

Signed-off-by: Shirish S <shirish.s@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amdgpu: Clean sdma wptr register when only enable wptr polling
Emily Deng [Wed, 7 Mar 2018 01:47:43 +0000 (09:47 +0800)]
drm/amdgpu: Clean sdma wptr register when only enable wptr polling

The sdma wptr polling memory is not fast enough, then the sdma
wptr register will be random, and not equal to sdma rptr, which
will cause sdma engine hang when load driver, so clean up the sdma
wptr directly to fix this issue.

v2:add comment above the code and correct coding style

Reviewed-by: Xiangliang Yu <Xiangliang.Yu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Emily Deng <Emily.Deng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/amdgpu: re-add missing GC 9.1 and SDMA0 4.1 sh_mask header files
Tom St Denis [Tue, 6 Mar 2018 15:52:41 +0000 (10:52 -0500)]
drm/amd/amdgpu: re-add missing GC 9.1 and SDMA0 4.1 sh_mask header files

These are required by umr to properly parse bitfield offsets.

Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
Reviewed-by: Alex Deucher <alexdeucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amdgpu: give warning before sleep in kiq_r/wreg
Monk Liu [Mon, 5 Mar 2018 11:26:36 +0000 (19:26 +0800)]
drm/amdgpu: give warning before sleep in kiq_r/wreg

to catch error that may schedule in atomic context early on

Signed-off-by: Monk Liu <Monk.Liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amdgpu: further mitigate workaround for i915
Christian König [Tue, 20 Feb 2018 18:51:02 +0000 (19:51 +0100)]
drm/amdgpu: further mitigate workaround for i915

Disable the workaround on imported BOs as well.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexdeucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amdgpu: drop gtt->adev
Christian König [Wed, 28 Feb 2018 08:35:39 +0000 (09:35 +0100)]
drm/amdgpu: drop gtt->adev

We can use ttm->bdev instead.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexdeucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amdgpu: add amdgpu_evict_gtt debugfs entry
Christian König [Mon, 19 Feb 2018 13:47:55 +0000 (14:47 +0100)]
drm/amdgpu: add amdgpu_evict_gtt debugfs entry

Allow evicting all BOs from the GTT domain.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexdeucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/pp: Add #ifdef checks for CONFIG_ACPI
Rex Zhu [Tue, 6 Mar 2018 06:42:24 +0000 (14:42 +0800)]
drm/amd/pp: Add #ifdef checks for CONFIG_ACPI

Fix compiling error when CONFIG_ACPI not enabled.

Change-Id: I5f901adbc799c10b30e5ea79f8f44760e749fae1
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
6 years agodrm/amd/pp: fix "Delete the wrapper layer of smu_allocate/free_memory"
Christian König [Tue, 6 Mar 2018 13:56:00 +0000 (14:56 +0100)]
drm/amd/pp: fix "Delete the wrapper layer of smu_allocate/free_memory"

For amdgpu_bo_create_kernel to work the handle must be NULL initialized,
otherwise we only try to pin and map the BO.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Rex Zhu <rezhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/pp: Drop wrapper functions for upper/lower_32_bits
Rex Zhu [Tue, 6 Mar 2018 05:31:13 +0000 (13:31 +0800)]
drm/amd/pp: Drop wrapper functions for upper/lower_32_bits

replace smu_upper_32_bits/smu_lower_32_bits with
the standard kernel macros

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amdgpu: Delete cgs wrapper functions for gpu memory manager
Rex Zhu [Mon, 5 Mar 2018 10:36:47 +0000 (18:36 +0800)]
drm/amdgpu: Delete cgs wrapper functions for gpu memory manager

delete those cgs interfaces:
amdgpu_cgs_alloc_gpu_mem
amdgpu_cgs_free_gpu_mem
amdgpu_cgs_gmap_gpu_mem
amdgpu_cgs_gunmap_gpu_mem
amdgpu_cgs_kmap_gpu_mem
amdgpu_cgs_kunmap_gpu_mem

Reviewed-by: Alex Deucher <alexdeucher@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/pp: Delete the wrapper layer of smu_allocate/free_memory
Rex Zhu [Tue, 6 Mar 2018 05:13:21 +0000 (13:13 +0800)]
drm/amd/pp: Delete the wrapper layer of smu_allocate/free_memory

use amdgpu_bo_create/free_kernel instand.

Reviewed-by: Alex Deucher <alexdeucher@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/pp: Remove cgs wrapper function for temperature update
Rex Zhu [Mon, 5 Mar 2018 08:07:22 +0000 (16:07 +0800)]
drm/amd/pp: Remove cgs wrapper function for temperature update

Reviewed-by: Alex Deucher <alexdeucher@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agoRevert "drm/amd/pp: Add a pp feature mask bit for AutoWattman feature"
Rex Zhu [Mon, 5 Mar 2018 06:42:56 +0000 (14:42 +0800)]
Revert "drm/amd/pp: Add a pp feature mask bit for AutoWattman feature"

This reverts commit e429ea87b2939c4cce1b439baf6d76535a0767f2.

Implement Workload Aware Dynamic power management instand of
AutoWattman feature in linux.

Reviewed-by: Alex Deucher <alexdeucher@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/pp: Add auto power profilng switch based on workloads (v2)
Rex Zhu [Fri, 2 Mar 2018 12:09:11 +0000 (20:09 +0800)]
drm/amd/pp: Add auto power profilng switch based on workloads (v2)

Add power profiling mode dynamic switch based on the workloads.
Currently, support Cumpute, VR, Video, 3D,power saving with Cumpute
have highest prority, power saving have lowest prority.

in manual dpm mode, driver will stop auto switch, just save the client's
requests. user can set power profiling mode through sysfs.

when exit manual dpm mode, driver will response the client's requests.
switch based on the client's prority.

v2: squash in fixes from Rex

Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/atomic: Add new reverse iterator over all plane state (V2)
Shirish S [Wed, 7 Mar 2018 03:10:03 +0000 (08:40 +0530)]
drm/atomic: Add new reverse iterator over all plane state (V2)

Add reverse iterator for_each_oldnew_plane_in_state_reverse to
compliment the for_each_oldnew_plane_in_state way or reading plane
states.

The plane states are required to be read in reverse order for
amd drivers, cause the z order convention followed in linux is
opposite to how the planes are supposed to be presented to DC
engine, which is in common to both windows and linux.

V2: fix compile time errors due to -Werror flag.

Signed-off-by: Shirish S <shirish.s@amd.com>
Signed-off-by: Pratik Vishwakarma <Pratik.Vishwakarma@amd.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1520392203-6885-1-git-send-email-shirish.s@amd.com
6 years agodt-bindings: display: renesas: lvds: Document r8a77995 bindings
Kieran Bingham [Thu, 15 Feb 2018 08:38:18 +0000 (08:38 +0000)]
dt-bindings: display: renesas: lvds: Document r8a77995 bindings

The D3 (r8a77995) supports two LVDS channels. Extend the binding to
support them.

Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
[Fixed compatible string]
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
6 years agodt-bindings: display: renesas: du: Document r8a77995 bindings
Kieran Bingham [Thu, 15 Feb 2018 08:38:17 +0000 (08:38 +0000)]
dt-bindings: display: renesas: du: Document r8a77995 bindings

Document the D3 (r8a77995) SoC in the R-Car DU bindings.

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>
6 years agodrm: rcar-du: lvds: Add R8A77970 support
Sergei Shtylyov [Thu, 1 Mar 2018 18:10:16 +0000 (21:10 +0300)]
drm: rcar-du: lvds: Add R8A77970 support

Add support for the R-Car V3M (R8A77970) SoC to the LVDS encoder driver.
Note that there are some differences with the other R-Car gen3 SoCs, e.g.
LVDPLLCR has the same layout as in the R-Car gen2 SoCs.

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>
6 years agodrm: rcar-du: Add R8A77970 support
Sergei Shtylyov [Thu, 18 Jan 2018 21:05:59 +0000 (00:05 +0300)]
drm: rcar-du: Add R8A77970 support

Add support for the R-Car V3M (R8A77970) SoC to the R-Car DU 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>
6 years agodt-bindings: display: renesas: lvds: Document R8A77970 bindings
Sergei Shtylyov [Fri, 19 Jan 2018 18:29:20 +0000 (21:29 +0300)]
dt-bindings: display: renesas: lvds: Document R8A77970 bindings

Document the R-Car V3M (R8A77970) SoC in the R-Car LVDS bindings.

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
6 years agodt-bindings: display: renesas: du: Document R8A77970 bindings
Sergei Shtylyov [Thu, 18 Jan 2018 21:05:58 +0000 (00:05 +0300)]
dt-bindings: display: renesas: du: Document R8A77970 bindings

Document the R-Car V3M (R8A77970) SoC in the R-Car DU bindings.

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Acked-by: Rob Herring <robh@kernel.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
6 years agodrm: Reject bad property flag combinations
Ville Syrjälä [Tue, 6 Mar 2018 16:48:49 +0000 (18:48 +0200)]
drm: Reject bad property flag combinations

Pimp drm_property_type_valid() to check for more fails with the
property flags. Also make the check before adding the property,
and bail out if things look bad.

Since we're now chekcing for more than the type let's also
change the function name to drm_property_flags_valid().

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180306164849.2862-6-ville.syrjala@linux.intel.com
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
6 years agodrm: Make property flags u32
Ville Syrjälä [Tue, 6 Mar 2018 16:48:48 +0000 (18:48 +0200)]
drm: Make property flags u32

The property flags are part of the uabi and we have 32 bits for them.
Pass them around as u32 internally as well, instead of a signed int.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180306164849.2862-5-ville.syrjala@linux.intel.com
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
6 years agodrm/uapi: Deprecate DRM_MODE_PROP_PENDING
Ville Syrjälä [Tue, 6 Mar 2018 16:48:47 +0000 (18:48 +0200)]
drm/uapi: Deprecate DRM_MODE_PROP_PENDING

DRM_MODE_PROP_PENDING is not used anywhere (except printed out
by libdrm proptest/modetest).

This seems to be yet another thing blindly copied from xrandr.
Quoting from the protocol spec:
"If 'pending' is TRUE, changes made to property values with
 RRChangeOutputProperty will be saved in the pending property value
 and be automatically copied to the current value on the next
 RRSetCrtcConfig request involving the named output. If 'pending' is
 FALSE, changes are copied immediately."

So it was some kind of early idea for atomic property updates.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180306164849.2862-4-ville.syrjala@linux.intel.com
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
6 years agodrm: WARN when trying to add enum value > 63 to a bitmask property
Ville Syrjälä [Tue, 6 Mar 2018 16:48:46 +0000 (18:48 +0200)]
drm: WARN when trying to add enum value > 63 to a bitmask property

Enum values >63 with a bitmask property is a programmer error. WARN
when someone is attempting this.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180306164849.2862-3-ville.syrjala@linux.intel.com
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
6 years agodrm: WARN when trying add enum values to non-enum/bitmask properties
Ville Syrjälä [Tue, 6 Mar 2018 16:48:45 +0000 (18:48 +0200)]
drm: WARN when trying add enum values to non-enum/bitmask properties

Trying to add enum values to non-enum/bitmask properties is a
programmer mistake. WARN to make sure the developers notice
their mistake.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180306164849.2862-2-ville.syrjala@linux.intel.com
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
6 years agodrm: Reject replacing property enum values
Ville Syrjälä [Tue, 6 Mar 2018 16:48:44 +0000 (18:48 +0200)]
drm: Reject replacing property enum values

If the property already has the enum value WARN and bail.
Replacing enum values doesn't make sense to me.

Throw out the pointless list_empty() while at it.

Cc: Daniel Vetter <daniel@ffwll.ch>
Suggested-by: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180306164849.2862-1-ville.syrjala@linux.intel.com
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
6 years agodrm: rcar-du: Convert LVDS encoder code to bridge driver
Laurent Pinchart [Wed, 10 Jan 2018 03:47:42 +0000 (05:47 +0200)]
drm: rcar-du: Convert LVDS encoder code to bridge driver

The LVDS encoders used to be described in DT as part of the DU. They now
have their own DT node, linked to the DU using the OF graph bindings.
This allows moving internal LVDS encoder support to a separate driver
modelled as a DRM bridge. Backward compatibility is retained as legacy
DT is patched live to move to the new bindings.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
6 years agodrm: rcar-du: Fix legacy DT to create LVDS encoder nodes
Laurent Pinchart [Wed, 10 Jan 2018 00:40:27 +0000 (02:40 +0200)]
drm: rcar-du: Fix legacy DT to create LVDS encoder nodes

The internal LVDS encoders now have their own DT bindings. Before
switching the driver infrastructure to those new bindings, implement
backward-compatibility through live DT patching.

Patching is disabled and will be enabled along with support for the new
DT bindings in the DU driver.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Reviewed-by: Frank Rowand <frank.rowand@sony.com>
6 years agodt-bindings: display: renesas: Deprecate LVDS support in the DU bindings
Laurent Pinchart [Wed, 10 Jan 2018 14:05:46 +0000 (16:05 +0200)]
dt-bindings: display: renesas: Deprecate LVDS support in the DU bindings

The internal LVDS encoders now have their own DT bindings, representing
them as part of the DU is deprecated.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
6 years agodt-bindings: display: renesas: Add R-Car LVDS encoder DT bindings
Laurent Pinchart [Wed, 10 Jan 2018 14:05:46 +0000 (16:05 +0200)]
dt-bindings: display: renesas: Add R-Car LVDS encoder DT bindings

The Renesas R-Car Gen2 and Gen3 SoCs have internal LVDS encoders. Add
corresponding device tree bindings.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
6 years agoMerge tag 'overlay_apply_fdt_v7-for-4.17' of git://git.kernel.org/pub/scm/linux/kerne...
Laurent Pinchart [Sun, 4 Mar 2018 11:33:50 +0000 (13:33 +0200)]
Merge tag 'overlay_apply_fdt_v7-for-4.17' of git://git./linux/kernel/git/frowand/linux into drm/next/du

- DT overlay applying rework (Frank Rowand)

Move duplicating and unflattening of an overlay flattened devicetree
(FDT) into the overlay application code.  To accomplish this,
of_overlay_apply() is replaced by of_overlay_fdt_apply().

6 years agodrm/bridge: analogix_dp: Don't create useless connectors
Marek Szyprowski [Mon, 5 Mar 2018 08:57:41 +0000 (09:57 +0100)]
drm/bridge: analogix_dp: Don't create useless connectors

If there is another bridge after analogix_dp, then the connector object
should not be created. This fixes following timeouts on Exynos5420-based
Chromebook2 Peach-PIT board during boot:

exynos-dp 145b0000.dp-controller: AUX CH cmd reply timeout!
exynos-dp 145b0000.dp-controller: AUX CH enable timeout!
exynos-dp 145b0000.dp-controller: AUX CH enable timeout!
exynos-dp 145b0000.dp-controller: AUX CH enable timeout!
exynos-dp 145b0000.dp-controller: AUX CH enable timeout!

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Tested-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180305085741.18896-4-m.szyprowski@samsung.com
6 years agodrm/bridge: analogix_dp: Postpone enabling runtime power management
Marek Szyprowski [Mon, 5 Mar 2018 08:57:40 +0000 (09:57 +0100)]
drm/bridge: analogix_dp: Postpone enabling runtime power management

Enabling runtime power management early in analogix_dp_bind() causes following
kernel NULL pointer dereference:

Unable to handle kernel NULL pointer dereference at virtual address 000007d8
pgd = 28ffa2e4
[000007d8] *pgd=00000000
Internal error: Oops: 5 [#1] PREEMPT SMP ARM
Modules linked in:
CPU: 6 PID: 69 Comm: kworker/6:1 Not tainted 4.16.0-rc1-00062-ge25751974ba8 #3622
Hardware name: SAMSUNG EXYNOS (Flattened Device Tree)
Workqueue: events deferred_probe_work_func
PC is at analogix_dp_resume+0x8/0xc0
LR is at pm_generic_runtime_resume+0x2c/0x38
pc : [<c0531b98>]    lr : [<c0543fec>] psr: a0000113
sp : ee13fbd8  ip : 0000001a  fp : 00000001
r10: ee0eb080  r9 : c0552bd8  r8 : c0fb1d98
r7 : eebb1010  r6 : eeae9808  r5 : 00000000  r4 : d4850415
r3 : ee0ed010  r2 : b2d05e00  r1 : 00000000  r0 : 00000000
Flags: NzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM Segment none
Control: 10c5387d  Table: 2000406a  DAC: 00000051
Process kworker/6:1 (pid: 69, stack limit = 0x913205b4)
Stack: (0xee13fbd8 to 0xee140000)
...
[<c0531b98>] (analogix_dp_resume) from [<c0543fec>] (pm_generic_runtime_resume+0x2c/0x38)
[<c0543fec>] (pm_generic_runtime_resume) from [<c054ffb4>] (__genpd_runtime_resume+0x2c/0x8c)
[<c054ffb4>] (__genpd_runtime_resume) from [<c0552d24>] (genpd_runtime_resume+0x14c/0x258)
[<c0552d24>] (genpd_runtime_resume) from [<c0547798>] (__rpm_callback+0x134/0x214)
[<c0547798>] (__rpm_callback) from [<c0547898>] (rpm_callback+0x20/0x80)
[<c0547898>] (rpm_callback) from [<c0546ff4>] (rpm_resume+0x3a0/0x734)
[<c0546ff4>] (rpm_resume) from [<c05475ec>] (__pm_runtime_resume+0x64/0x9c)
[<c05475ec>] (__pm_runtime_resume) from [<c053b95c>] (__device_attach+0x8c/0x134)
[<c053b95c>] (__device_attach) from [<c053ad08>] (bus_probe_device+0x88/0x90)
[<c053ad08>] (bus_probe_device) from [<c05390d0>] (device_add+0x3a8/0x580)
[<c05390d0>] (device_add) from [<c06764c4>] (i2c_register_adapter+0xd4/0x3ec)
[<c06764c4>] (i2c_register_adapter) from [<c05321c8>] (analogix_dp_bind+0x2a0/0x410)
[<c05321c8>] (analogix_dp_bind) from [<c0528e90>] (exynos_dp_bind+0x9c/0x12c)
[<c0528e90>] (exynos_dp_bind) from [<c0535bc4>] (component_bind_all+0xfc/0x258)
[<c0535bc4>] (component_bind_all) from [<c0522ee8>] (exynos_drm_bind+0x15c/0x28c)
[<c0522ee8>] (exynos_drm_bind) from [<c0536378>] (try_to_bring_up_master+0x1b8/0x29c)
[<c0536378>] (try_to_bring_up_master) from [<c05364fc>] (component_add+0xa0/0x170)
[<c05364fc>] (component_add) from [<c0528fe4>] (exynos_dp_probe+0x64/0xb8)
[<c0528fe4>] (exynos_dp_probe) from [<c053debc>] (platform_drv_probe+0x50/0xb0)
[<c053debc>] (platform_drv_probe) from [<c053bd18>] (driver_probe_device+0x2b8/0x4a0)
[<c053bd18>] (driver_probe_device) from [<c0539e4c>] (bus_for_each_drv+0x44/0x8c)
[<c0539e4c>] (bus_for_each_drv) from [<c053b970>] (__device_attach+0xa0/0x134)
[<c053b970>] (__device_attach) from [<c053ad08>] (bus_probe_device+0x88/0x90)
[<c053ad08>] (bus_probe_device) from [<c053b258>] (deferred_probe_work_func+0x3c/0x168)
[<c053b258>] (deferred_probe_work_func) from [<c014352c>] (process_one_work+0x1d0/0x7bc)
[<c014352c>] (process_one_work) from [<c0143b84>] (worker_thread+0x34/0x4dc)
[<c0143b84>] (worker_thread) from [<c014a30c>] (kthread+0x128/0x164)
[<c014a30c>] (kthread) from [<c01010b4>] (ret_from_fork+0x14/0x20)
Exception stack(0xee13ffb0 to 0xee13fff8)
ffa0:                                     00000000 00000000 00000000 00000000
ffc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
ffe0: 00000000 00000000 00000000 00000000 00000013 00000000
Code: e2800e37 eafee601 e92d4070 e1a05000 (e59067d8)
---[ end trace bf6046013df7cab2 ]---

This oops happens, because analogix_dp_bind() calls drm_dp_aux_register()
which registers i2c adapter. I2C core tries to runtime get i2c host
device during registration. This ends in analogix_dp_resume(), but dp
context is NULL there. dp context is set in exynos_dp_bind() after
executing analogix_dp_bind(). Fix this issue by postponing enabling runtime
power management after drm_dp_aux_register().

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Tested-by: Heiko Stuebner <heiko@sntech.de>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180305085741.18896-3-m.szyprowski@samsung.com
6 years agodrm/bridge: analogix_dp: Don't power bridge in analogix_dp_bind
zain wang [Mon, 5 Mar 2018 08:57:39 +0000 (09:57 +0100)]
drm/bridge: analogix_dp: Don't power bridge in analogix_dp_bind

The bridge does not need to be powered in analogix_dp_bind(), so
remove the calls to pm_runtime_get()/phy_power_on()/analogix_dp_init_dp()
as well as their power-off counterparts.

Cc: Stéphane Marchesin <marcheu@chromium.org>
Signed-off-by: zain wang <wzz@rock-chips.com>
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
[the patch originally just removed the power_on portion, seanpaul removed
the power off code as well as improved the commit message]
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Thierry Escande <thierry.escande@collabora.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Tested-by: Heiko Stuebner <heiko@sntech.de>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180305085741.18896-2-m.szyprowski@samsung.com
6 years agodrm/amd/pp: Revert gfx/compute profile switch sysfs
Rex Zhu [Sat, 24 Feb 2018 11:53:41 +0000 (19:53 +0800)]
drm/amd/pp: Revert gfx/compute profile switch sysfs

The gfx/compute profiling mode switch is only for internally
test. Not a complete solution and unexpectly upstream.
so revert it.

Reviewed-by: Evan Quan <evan.quan@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/pp: Fix sclk in highest two levels when compute on smu7
Rex Zhu [Fri, 23 Feb 2018 09:41:07 +0000 (17:41 +0800)]
drm/amd/pp: Fix sclk in highest two levels when compute on smu7

Compute workload tends to be "bursty", Only tune the behavior of
nature dpm don't work well for most of such workloads. From test
results, Fix sclk in highest two levels can get better performance.
so add min sclk setting into the default cumpute workload policy on
smu7.

user still can change sclk range through sysfs pp_dpm_sclk
for better perf/watt.

Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/pp: Implement get/set_power_profile_mode on smu7
Rex Zhu [Wed, 31 Jan 2018 06:48:14 +0000 (14:48 +0800)]
drm/amd/pp: Implement get/set_power_profile_mode on smu7

It show what parameters can be configured to tune
the behavior of natural dpm for perf/watt on smu7.

user can select the mode per workload, but even the default per
workload settings are not bulletproof.

user can configure custom settings per different use case
for better perf or better perf/watt.

cat pp_power_profile_mode
NUM        MODE_NAME     SCLK_UP_HYST   SCLK_DOWN_HYST SCLK_ACTIVE_LEVEL     MCLK_UP_HYST   MCLK_DOWN_HYST MCLK_ACTIVE_LEVEL
  0   3D_FULL_SCREEN:        0              100               30                0              100               10
  1     POWER_SAVING:       10                0               30                -                -                -
  2            VIDEO:        -                -                -               10               16               31
  3               VR:        0               11               50                0              100               10
  4          COMPUTE:        0                5               30                -                -                -
  5           CUSTOM:        0                0                0                0                0                0
  *          CURRENT:        0              100               30                0              100               10

Under manual dpm level,

user can echo "0/1/2/3/4">pp_power_profile_mode
to select 3D_FULL_SCREEN/POWER_SAVING/VIDEO/VR/COMPUTE
mode.

echo "5 * * * * * * * *">pp_power_profile_mode
to set custom settings.
"5 * * * * * * * *" mean "CUSTOM enable_sclk SCLK_UP_HYST
SCLK_DOWN_HYST SCLK_ACTIVE_LEVEL enable_mclk MCLK_UP_HYST
MCLK_DOWN_HYST MCLK_ACTIVE_LEVEL"

if the parameter enable_sclk/enable_mclk is true,
driver will update the following parameters to dpm table.
if false, ignore the following parameters.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/pp: Implement update_dpm_settings on CI
Rex Zhu [Fri, 23 Feb 2018 08:52:41 +0000 (16:52 +0800)]
drm/amd/pp: Implement update_dpm_settings on CI

use SW method to update DPM settings by updating SRAM
directly on CI.

Reviewed-by: Alex Deucher <alexdeucher@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/pp: Implement update_dpm_settings on Tonga
Rex Zhu [Fri, 23 Feb 2018 08:41:20 +0000 (16:41 +0800)]
drm/amd/pp: Implement update_dpm_settings on Tonga

use SW method to update DPM settings by updating SRAM
directly on Tonga.

Reviewed-by: Alex Deucher <alexdeucher@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/pp: Implement update_dpm_settings on Fiji
Rex Zhu [Fri, 23 Feb 2018 08:39:59 +0000 (16:39 +0800)]
drm/amd/pp: Implement update_dpm_settings on Fiji

use SW method to update DPM settings by updating SRAM
directly on Fiji.

Reviewed-by: Alex Deucher <alexdeucher@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/prime: make the pages array optional for drm_prime_sg_to_page_addr_arrays
Christian König [Tue, 27 Feb 2018 11:49:57 +0000 (12:49 +0100)]
drm/prime: make the pages array optional for drm_prime_sg_to_page_addr_arrays

Most of the time we only need the dma addresses.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Roger He <Hongbo.He@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180227115000.4105-2-christian.koenig@amd.com
Link: https://patchwork.freedesktop.org/patch/msgid/20180227115000.4105-3-christian.koenig@amd.com
Link: https://patchwork.freedesktop.org/patch/msgid/20180227115000.4105-4-christian.koenig@amd.com
Link: https://patchwork.freedesktop.org/patch/msgid/20180227115000.4105-5-christian.koenig@amd.com
Link: https://patchwork.freedesktop.org/patch/msgid/BN6PR12MB18262C0DE9B5F07B9A42EAE7F2C60@BN6PR12MB1826.namprd12.prod.outlook.com
6 years agodrm/prime: fix potential race in drm_gem_map_detach
Christian König [Tue, 27 Feb 2018 11:49:56 +0000 (12:49 +0100)]
drm/prime: fix potential race in drm_gem_map_detach

Unpin the GEM object only after freeing the sg table.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Roger He <Hongbo.He@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180227115000.4105-1-christian.koenig@amd.com
6 years agodrm: Check property/enum name length
Ville Syrjälä [Fri, 2 Mar 2018 14:03:00 +0000 (16:03 +0200)]
drm: Check property/enum name length

Reject requests to add properties/enums with an overly long name.
Previously we would have just silently truncated the string and exposed
it userspace.

v2: drm_property_create() returns a pointer

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180302140300.31110-1-ville.syrjala@linux.intel.com
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
6 years agodrm: Don't create properties without names
Ville Syrjälä [Fri, 2 Mar 2018 13:25:42 +0000 (15:25 +0200)]
drm: Don't create properties without names

Creating a property that doesn't have a name makes no sense to me. Don't
allow it.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180302132544.12491-1-ville.syrjala@linux.intel.com
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
6 years agodrm: bridge: dw-hdmi: Fix overflow workaround for Amlogic Meson GX SoCs
Neil Armstrong [Fri, 23 Feb 2018 11:44:37 +0000 (12:44 +0100)]
drm: bridge: dw-hdmi: Fix overflow workaround for Amlogic Meson GX SoCs

The Amlogic Meson GX SoCs, embedded the v2.01a controller, has been also
identified needing this workaround.
This patch adds the corresponding version to enable a single iteration for
this specific version.

Fixes: be41fc55f1aa ("drm: bridge: dw-hdmi: Handle overflow workaround based on device version")
Acked-by: Archit Taneja <architt@codeaurora.org>
[narmstrong: s/identifies/identified and rebased against Jernej's change]
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1519386277-25902-1-git-send-email-narmstrong@baylibre.com
6 years agodrm: of: simplify component probe code
Baruch Siach [Thu, 22 Feb 2018 19:22:50 +0000 (21:22 +0200)]
drm: of: simplify component probe code

Use positive logic for better readability. This also eliminates one
of_node_put() call, making the code shorter.

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Tested-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Archit Taneja <archit@cradlewise.com>
Link: https://patchwork.freedesktop.org/patch/msgid/61c56895d44117d80e7d82f04e729e29c60fadbd.1519327370.git.baruch@tkos.co.il
6 years agodrm: NULL pointer dereference [null-pointer-deref] (CWE 476) problem
Joe Moriarty [Tue, 20 Feb 2018 19:11:57 +0000 (14:11 -0500)]
drm: NULL pointer dereference [null-pointer-deref] (CWE 476) problem

The Parfait (version 2.1.0) static code analysis tool found the
following NULL pointer dereference problem.

- drivers/gpu/drm/drm_drv.c
Any calls to drm_minor_get_slot() could result in the return of a NULL
pointer when an invalid DRM device type is encountered.  The
return of NULL was removed with BUG() from drm_minor_get_slot().

Signed-off-by: Joe Moriarty <joe.moriarty@oracle.com>
Reviewed-by: Steven Sistare <steven.sistare@oracle.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20180220191157.100960-3-joe.moriarty@oracle.com
6 years agodrm: NULL pointer dereference [null-pointer-deref] (CWE 476) problem
Joe Moriarty [Tue, 20 Feb 2018 19:11:56 +0000 (14:11 -0500)]
drm: NULL pointer dereference [null-pointer-deref] (CWE 476) problem

The Parfait (version 2.1.0) static code analysis tool found the
following NULL pointer derefernce problem.

- drivers/gpu/drm/drm_vblank.c
Null pointer checks were added to return values from calls to
drm_crtc_from_index().  There is a possibility, however minute, that
crtc->index may not be found when trying to find the struct crtc
from it's assigned index given in drm_crtc_init_with_planes().
3 return checks for NULL where added with a call to
WARN_ON(!crtc).

Signed-off-by: Joe Moriarty <joe.moriarty@oracle.com>
Reviewed-by: Steven Sistare <steven.sistare@oracle.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20180220191157.100960-2-joe.moriarty@oracle.com
6 years agodrm/amdgpu: fix KV harvesting
Alex Deucher [Thu, 1 Mar 2018 16:05:31 +0000 (11:05 -0500)]
drm/amdgpu: fix KV harvesting

Always set the graphics values to the max for the
asic type.  E.g., some 1 RB chips are actually 1 RB chips,
others are actually harvested 2 RB chips.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=99353
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
6 years agodrm/radeon: fix KV harvesting
Alex Deucher [Thu, 1 Mar 2018 16:03:27 +0000 (11:03 -0500)]
drm/radeon: fix KV harvesting

Always set the graphics values to the max for the
asic type.  E.g., some 1 RB chips are actually 1 RB chips,
others are actually harvested 2 RB chips.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=99353
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
6 years agodrm/amd/pp: Implement update_dpm_settings on Polaris
Rex Zhu [Wed, 24 Jan 2018 09:15:37 +0000 (17:15 +0800)]
drm/amd/pp: Implement update_dpm_settings on Polaris

v2: lock dpm level when update pptable by SW method

use SW method to update DPM settings by updating SRAM
directly on Polaris.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/pp: Add a helper to set field in u32
Rex Zhu [Fri, 23 Feb 2018 08:32:55 +0000 (16:32 +0800)]
drm/amd/pp: Add a helper to set field in u32

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/pp: Add common interface in smu for update dpm setting
Rex Zhu [Wed, 24 Jan 2018 06:48:17 +0000 (14:48 +0800)]
drm/amd/pp: Add common interface in smu for update dpm setting

it is used for adjust part of dpm settigs per workloads
to change the natural dpm behavior for better perf or perf/watt.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/pp: Add PCC feature support on Vega
Rex Zhu [Fri, 2 Mar 2018 05:50:59 +0000 (13:50 +0800)]
drm/amd/pp: Add PCC feature support on Vega

This features controls vega peak current protection to allow
for a wider compatibility with power supplies.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/pp: Export new smu message for PCC feature on Vega10
Rex Zhu [Fri, 2 Mar 2018 02:52:25 +0000 (10:52 +0800)]
drm/amd/pp: Export new smu message for PCC feature on Vega10

used to set PccThrottleLevel and PccResidencyThreshold

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/pp: Remove cgs_query_system_info
Rex Zhu [Tue, 27 Feb 2018 11:15:08 +0000 (19:15 +0800)]
drm/amd/pp: Remove cgs_query_system_info

Get gpu info through adev directly in powerplay

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/pp: Remove the wrap functions for acpi in powerplay
Rex Zhu [Tue, 27 Feb 2018 10:28:54 +0000 (18:28 +0800)]
drm/amd/pp: Remove the wrap functions for acpi in powerplay

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/pp: Use amdgpu acpi helper functions in powerplay
Rex Zhu [Tue, 27 Feb 2018 10:27:54 +0000 (18:27 +0800)]
drm/amd/pp: Use amdgpu acpi helper functions in powerplay

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amdgpu: Notify sbios device ready before send request
Rex Zhu [Tue, 27 Feb 2018 10:20:53 +0000 (18:20 +0800)]
drm/amdgpu: Notify sbios device ready before send request

it is required if a platform supports PCIe root complex
core voltage reduction. After receiving this notification,
SBIOS can apply default PCIe root complex power policy.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
6 years agodrm/amd/pp: Refine powerplay instance
Rex Zhu [Tue, 27 Feb 2018 06:09:40 +0000 (14:09 +0800)]
drm/amd/pp: Refine powerplay instance

Include adev in powerplay instance.
so can visit adev directly instand of through cgs interface.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/pp: Simplify the create of powerplay instance
Rex Zhu [Mon, 26 Feb 2018 11:58:49 +0000 (19:58 +0800)]
drm/amd/pp: Simplify the create of powerplay instance

use adev as input parameter to create powerplay instance
directly. delete cgs wrap layer for power play create.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/dc: Use forward declaration instand of include header file
Rex Zhu [Mon, 26 Feb 2018 11:47:54 +0000 (19:47 +0800)]
drm/amd/dc: Use forward declaration instand of include header file

avoid build error:

drivers/gpu/drm/amd/amdgpu/../powerplay/inc/smu9_driver_if.h:342:3: error: redeclaration of enumerator ‘WM_COUNT’
   WM_COUNT,
   ^
In file included from drivers/gpu/drm/amd/amdgpu/../display/dc/dm_services_types.h:32:0,
                 from drivers/gpu/drm/amd/amdgpu/../display/dc/dm_services.h:35,
                 from drivers/gpu/drm/amd/amdgpu/../display/modules/inc/mod_freesync.h:57,
                 from drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgpu_mode.h:48,
                 from drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgpu.h:55,
                 from drivers/gpu/drm/amd/amdgpu/../powerplay/inc/amd_powerplay.h:33,
                 from drivers/gpu/drm/amd/amdgpu/../powerplay/inc/smumgr.h:26,
                 from drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/vega10_smumgr.c:24:
drivers/gpu/drm/amd/amdgpu/../display/dc/dm_pp_smu.h:43:2: note: previous definition of ‘WM_COUNT’ was here
  WM_COUNT,

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/display: disable CRTCs with NULL FB on their primary plane (V2)
Shirish S [Wed, 28 Feb 2018 06:44:58 +0000 (12:14 +0530)]
drm/amd/display: disable CRTCs with NULL FB on their primary plane (V2)

The below commit

"drm/atomic: Try to preserve the crtc enabled state in drm_atomic_remove_fb, v2"

introduces a slight behavioral change to rmfb. Instead of disabling a crtc
when the primary plane is disabled, it now preserves it.

This change leads to BUG hit while performing atomic commit on amd driver.

As a fix this patch ensures that we disable the CRTC's with NULL FB by returning
-EINVAL and hence triggering fall back to the old behavior and turning off the
crtc in atomic_remove_fb().

V2: Added error check for plane_state and removed sanity check for crtc.

Signed-off-by: Shirish S <shirish.s@amd.com>
Signed-off-by: Pratik Vishwakarma <Pratik.Vishwakarma@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/pp: Fix incorrect return value in smu7_check_clk_voltage_valid
Rex Zhu [Fri, 2 Mar 2018 10:41:41 +0000 (18:41 +0800)]
drm/amd/pp: Fix incorrect return value in smu7_check_clk_voltage_valid

Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amdgpu/dce6: Use DRM_DEBUG instead of DRM_INFO for HPD IRQ info
Michel Dänzer [Fri, 23 Feb 2018 11:29:04 +0000 (12:29 +0100)]
drm/amdgpu/dce6: Use DRM_DEBUG instead of DRM_INFO for HPD IRQ info

For consistency with other DCE generations.

HPD IRQs appear to be working fine.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amdgpu: use separate status for buffer funcs availability v2
Christian König [Thu, 1 Mar 2018 10:09:15 +0000 (11:09 +0100)]
drm/amdgpu: use separate status for buffer funcs availability v2

The ring status can change during GPU reset, but we still need to be
able to schedule TTM buffer moves in the meantime.

Otherwise we can ran into problems because of aborted move/fill
operations during GPU resets.

v2: still check if ring is available during direct submit.

Signed-off-by: Christian König <christian.koenig@amd.com>
Acked-by: Chunming zhou <david1.zhou@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amdgpu: ignore changes of buffer function status because of GPU resets
Christian König [Thu, 1 Mar 2018 10:03:27 +0000 (11:03 +0100)]
drm/amdgpu: ignore changes of buffer function status because of GPU resets

When we reset the GPU we also disable/enable the SDMA, but we don't want
to change TTM idea of the VRAM size in the middle of that.

Signed-off-by: Christian König <christian.koenig@amd.com>
Acked-by: Chunming zhou <david1.zhou@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amdgpu: change amdgpu_ttm_set_active_vram_size
Christian König [Thu, 1 Mar 2018 10:01:52 +0000 (11:01 +0100)]
drm/amdgpu: change amdgpu_ttm_set_active_vram_size

Instead of setting the active VRAM size directly provide a the info if
we can use the buffer functions or not.

Signed-off-by: Christian König <christian.koenig@amd.com>
Acked-by: Chunming zhou <david1.zhou@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amdgpu: move some functions into amdgpu_ttm.h
Christian König [Thu, 1 Mar 2018 09:41:46 +0000 (10:41 +0100)]
drm/amdgpu: move some functions into amdgpu_ttm.h

Those belong to the TTM handling.

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>
6 years agodrm/amd/display: Default HDMI6G support to true. Log VBIOS table error.
Harry Wentland [Tue, 20 Feb 2018 18:36:23 +0000 (13:36 -0500)]
drm/amd/display: Default HDMI6G support to true. Log VBIOS table error.

There have been many reports of Ellesmere and Baffin systems not being
able to drive HDMI 4k60 due to the fact that we check the HDMI_6GB_EN
bit from VBIOS table. Windows seems to not have this issue.

On some systems we fail to the encoder cap info from VBIOS. In that case
we should default to enabling HDMI6G support.

This was tested by dwagner on
https://bugs.freedesktop.org/show_bug.cgi?id=102820

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Roman Li <Roman.Li@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
6 years agodrm/amd/display: update plane params before validation
Shirish S [Tue, 13 Feb 2018 08:45:17 +0000 (14:15 +0530)]
drm/amd/display: update plane params before validation

This patch updates the dc's plane state with the parameters set by the
user side.
This is needed to validate the plane capabilities with the parameters
user space wants to set.

Signed-off-by: Shirish S <shirish.s@amd.com>
Reviewed-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/display: Don't blow up if TG is NULL in dce110_vblank_set
Harry Wentland [Tue, 13 Feb 2018 16:07:43 +0000 (11:07 -0500)]
drm/amd/display: Don't blow up if TG is NULL in dce110_vblank_set

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Roman Li <Roman.Li@amd.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/display: validate plane in dce110 for scaling
Shirish S [Tue, 13 Feb 2018 08:41:37 +0000 (14:11 +0530)]
drm/amd/display: validate plane in dce110 for scaling

CZ & ST support uptil a limit 2:1 downscaling, this patch
adds validate_plane hook, that shall be used to validate
the plane attributes sent by the user space based
on dce110 capabilities.

Signed-off-by: Shirish S <shirish.s@amd.com>
Reviewed-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/display: defer modeset check in dm_update_planes_state
Shirish S [Fri, 16 Feb 2018 06:14:22 +0000 (11:44 +0530)]
drm/amd/display: defer modeset check in dm_update_planes_state

amdgpu_dm_atomic_check() is used to validate the entire configuration of
planes and crtc's that the user space wants to commit.

However amdgpu_dm_atomic_check() depends upon DRM_MODE_ATOMIC_ALLOW_MODESET
flag else its mostly dummy.
Its not mandatory for the user space to set DRM_MODE_ATOMIC_ALLOW_MODESET,
and in general its not set either along with DRM_MODE_ATOMIC_TEST_ONLY.

Considering its importantance, this patch defers the allow_modeset check
in dm_update_planes_state(), so that there shall be scope to validate
the configuration sent from user space, without impacting the population
of dc/dm related data structures.

Signed-off-by: Shirish S <shirish.s@amd.com>
Reviewed-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/display: Clean up formatting in irq_service_dce110.c
Harry Wentland [Tue, 13 Feb 2018 16:07:07 +0000 (11:07 -0500)]
drm/amd/display: Clean up formatting in irq_service_dce110.c

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Roman Li <Roman.Li@amd.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/display: Return success when enabling interrupt
Harry Wentland [Tue, 13 Feb 2018 16:03:01 +0000 (11:03 -0500)]
drm/amd/display: Return success when enabling interrupt

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Roman Li <Roman.Li@amd.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/display: Use crtc enable/disable_vblank hooks
Harry Wentland [Tue, 13 Feb 2018 15:54:26 +0000 (10:54 -0500)]
drm/amd/display: Use crtc enable/disable_vblank hooks

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/display: dal 3.1.37
Tony Cheng [Wed, 21 Feb 2018 21:40:50 +0000 (16:40 -0500)]
drm/amd/display: dal 3.1.37

Signed-off-by: Tony Cheng <tony.cheng@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>