Commit Graph

650100 Commits

Author SHA1 Message Date
Noralf Trønnes fa201ac2c6 drm: Add DRM support for tiny LCD displays
tinydrm provides helpers for very simple displays that can use
CMA backed framebuffers and need flushing on changes.

Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Thierry Reding <treding@nvidia.com>
2017-02-18 18:04:58 +01:00
Dave Airlie 9ca70356a9 Revert "drm: Resurrect atomic rmfb code, v3"
This reverts commit 1592364de3.

This apparantly causes some regressions so pull it out for now.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-02-17 12:39:04 +10:00
Dave Airlie 08293fe8d3 omapdrm fixes for v4.11
Fix regressions:
 - Planes might have been left enabled
 - Scaling checks did not use the new config
 
 Also limit downscaling decimation to prevent HW underflows.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJYpZssAAoJEPo9qoy8lh71acEP/jtHaQprxMQH0YeWkWpx2BuQ
 rRnhcQybXMyriG+2NqLOFCKDKR+PZMXiUQCbtRVGo3jBtsMCVWKjnckcCv/4NvIJ
 VwLWzdXNMUPpvqm3jIAqUWGXlPaT/D47ptarofdepTXWASJGRJbCST/bJZJN3mmv
 NashDcRz1QzW5wDfFeh47nQa42h/Bm/FHONFjGaSlPb7kDuBWTnPLoXqrUFw0l2+
 iSYU6hfHDzN1bJPdksQ/yn5+DLv8fn3n904V5kA/bPBRrXc788i8t0r5tiUN2zRz
 lcWuYJc6IC0OyWRK32fkNshcOxXUhL9H1cc8cuooXpHfnZ3WYRtBVw/GNlDcMaKY
 pnzSeufB9WZlQ56JjN6yRswGBgvpMn3BDRHdqRD+NooMrpybfCvcskpNdMbl0L4K
 gv2DR48mPvBfFU7sp5+u9fvGLjUlIGyS4Xio+ocCzLsgNKrEXQm5Tmca+fRjoZP2
 xFnaX38ZE0ZpRWLd44lzGhVN5/mFsluS9rY3sWHcfIPSR3D25MzKJfZkb2coy3OT
 qSyLwCWMjxXDM7s8jQHlckt9QapOFmt1p/HU2KtA7Uo05mAo3MnSmmGlefY8meGg
 Xy3Jhq9FW4XHKCFqgOZIwckgcOfMKyjfu28Eo48Aao4ZVM+7dwyE/BEjgPT13kY2
 ATR4A4dJ0Sp/K1WHBnyP
 =2TLd
 -----END PGP SIGNATURE-----

Merge tag 'omapdrm-4.11-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux into drm-next

omapdrm fixes for v4.11

Fix regressions:
- Planes might have been left enabled
- Scaling checks did not use the new config

Also limit downscaling decimation to prevent HW underflows.

* tag 'omapdrm-4.11-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux:
  drm/omapdrm: dispc: Refuse x-decimation above 4 for all but 8-bit formats
  drm/omapdrm: Move commit_modeset_enables() before commit_planes()
  Revert "drm: omapdrm: Let the DRM core skip plane commit on inactive CRTCs"
2017-02-17 12:04:09 +10:00
Dave Airlie dec13c8ba2 Merge branch 'drm-next-4.11' of git://people.freedesktop.org/~agd5f/linux into drm-next
Fixes for 4.11. Highlights:
- fix >2 displays on asics with 3 or 5 crtcs
- fix SI headless asics
- powerplay fixes for new polaris variants
- misc fixes

* 'drm-next-4.11' of git://people.freedesktop.org/~agd5f/linux:
  drm/amdgpu: fix warning on older gcc releases
  drm/ttm: make TTM_MAX_BO_PRIORITY unsigned
  drm/amd/amdgpu: Fix flow control in uvd_v4_2_stop()
  drm/amd/powerplay: add didt config table for polaris kicker
  drm/amd/powerplay: modify VddcPhase value for polaris kicker
  drm/amd/powerplay: add kicker flag into smumgr
  drm/amdgpu: Initialize pipe priority order on graphic initialization
  drm/amdgpu: read hw register to check pg status.
  drm/amdgpu: Add to initialization of mmVCE_VCPU_CNTL register
  drm/amdgpu/pm: check for headless before calling compute_clocks
  drm/amdgpu: use amdgpu_gem_va_check() in amdgpu_gem_va_update_vm()
  drm/amdgpu: add more cases to DCE11 possible crtc mask setup
2017-02-17 11:55:12 +10:00
Arnd Bergmann e8411302b4 drm/amdgpu: fix warning on older gcc releases
gcc-4.8 warns about '{0}' being used an an initializer for nested structures:

drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c: In function ‘gfx_v8_0_ring_emit_ce_meta_init’:
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c:7263:2: warning: missing braces around initializer [-Wmissing-braces]
  } ce_payload = {0};
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c: In function ‘gfx_v8_0_ring_emit_de_meta_init’:
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c:7290:2: warning: missing braces around initializer [-Wmissing-braces]
  } de_payload = {0};

Using an empty {} initializer however has the same effect and works on all versions.

Fixes: acad2b2a7b ("drm/amdgpu:implement CE/DE meta-init routines")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2017-02-16 12:19:52 -05:00
Nicolai Hähnle 5187b6cd1d drm/ttm: make TTM_MAX_BO_PRIORITY unsigned
Fix a warning about different types in min() macro in amdgpu:

In file included from ./include/linux/list.h:8:0,
                 from drivers/gpu/drm/amd/amdgpu/amdgpu_object.c:32:
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c: In function ‘amdgpu_bo_create_restricted’:
./include/linux/kernel.h:739:16: warning: comparison of distinct pointer types lacks a cast
  (void) (&min1 == &min2);   \
                ^
./include/linux/kernel.h:742:2: note: in expansion of macro ‘__min’
  __min(typeof(x), typeof(y),   \
  ^~~~~
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c:434:21: note: in expansion of macro ‘min’
  bo->tbo.priority = min(bo->tbo.priority, TTM_MAX_BO_PRIORITY - 1);
                     ^~~

Signed-off-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2017-02-16 11:44:26 -05:00
Tom St Denis e89d5b5c20 drm/amd/amdgpu: Fix flow control in uvd_v4_2_stop()
Break out of outer loop properly.

Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2017-02-16 11:43:44 -05:00
Huang Rui fce293ca3d drm/amd/powerplay: add didt config table for polaris kicker
Signed-off-by: Huang Rui <ray.huang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2017-02-16 11:43:32 -05:00
Huang Rui 28a488848f drm/amd/powerplay: modify VddcPhase value for polaris kicker
Signed-off-by: Huang Rui <ray.huang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2017-02-16 11:43:22 -05:00
Huang Rui 5d7213b0be drm/amd/powerplay: add kicker flag into smumgr
Signed-off-by: Huang Rui <ray.huang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2017-02-16 11:43:11 -05:00
Jyri Sarha 1b30ab0c40 drm/omapdrm: dispc: Refuse x-decimation above 4 for all but 8-bit formats
Let's disable all scaling that requires horizontal decimation with
higher factor than 4, until we have better estimates of what we can
and can not do. However, NV12 color format appears to work Ok with
all decimation factors.

When decimating horizontally by more that 4 the dss is not able to
fetch the data in burst mode. When this happens it is hard to tell if
there enough bandwidth. Despite what theory says this appears to be
true also for 16-bit color formats.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-02-16 14:11:08 +02:00
Jyri Sarha 897145d0c7 drm/omapdrm: Move commit_modeset_enables() before commit_planes()
Move drm_atomic_helper_commit_modeset_enables() call to before
drm_atomic_helper_commit_planes() call and have a
omap_atomic_wait_for_completion() call after both.

With the current dss dispc implementation we have to enable the new
modeset before we can commit planes. The dispc ovl configuration
relies on the video mode configuration been written into the HW when
the ovl configuration is calculated.

This approach is not ideal because after a mode change the plane
update is executed only after the first vblank interrupt. The dispc
implementation should be fixed so that it is able use uncommitted drm
state information.  information.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-02-16 14:09:55 +02:00
Jyri Sarha e025d3860b Revert "drm: omapdrm: Let the DRM core skip plane commit on inactive CRTCs"
This reverts commit dadf4659d0.

If planes are not disabled when the they are not on any crtc anymore
they will remain active and may show as "ghosts" when the crtc they
were last on is active again.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-02-16 14:09:55 +02:00
Dave Airlie be3c9f5eed Merge branch 'drm-rockchip-next-2017-02-16' of https://github.com/markyzq/kernel-drm-rockchip into drm-next
Use iommu for rockchip arm64 platform.

* 'drm-rockchip-next-2017-02-16' of https://github.com/markyzq/kernel-drm-rockchip:
  drm/rockchip: Use common IOMMU API to attach devices
  drm/rockchip: Do not use DMA mapping API if attached to IOMMU domain
2017-02-16 13:57:37 +10:00
Dave Airlie b7bc0daa88 Merge tag 'drm-misc-next-fixes-2017-02-15' of git://anongit.freedesktop.org/git/drm-misc into drm-next
Fixes for the v4.11 merge window.

* tag 'drm-misc-next-fixes-2017-02-15' of git://anongit.freedesktop.org/git/drm-misc:
  drm: Resurrect atomic rmfb code, v3
  uapi: add missing install of dma-buf.h
2017-02-16 13:27:55 +10:00
Dave Airlie 1e9d996645 - remove deprecated stih416 chip functionnalities
- fix issues met around gdp panes
 - fix STI driver unbind procedure
 - DVI/HDMI mode is automatically detected
 - allow fps statisitics resetting
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJYnX00AAoJENMx8KsF0f19GScP/RsSL8+Qo5N9Ru+gMUDsBMS/
 587xtU8I6y2o3r1Mb4/WxFaTI9Rf3rlosFFtF42loFKbnTiTOihXnGAlQ+hcEnn9
 YyCxdBaLz/CF0FDN1kTE0Rq01qR2+PTiKJcxzOr3WcjVVmYsWl0QyoAcCSsnm1/k
 pSvJe0QaHxsLeC/iPgQBsEaLYlQWAhOZ/Yco+Rym6x36PHDCmDJfw+Njjbp3Bjnq
 yq6tP/uNQg3SQLCLsJdlGgN4FvLrTzlC32REU1t5NfLKhQngXNL/bnjw/xg/U/wN
 3XIGE1YGunEc4i2Su/sPBv0NzVXlj4umW3qqKmu+5uXN3IidNXDTSdSK1MfaVn5q
 n4A9IKOo3QSzG4IFzgW5yxJc03fFw4sU3seILRmORELLqjUUSmqmwTZhwl9Zq363
 TVZ0h0Ku8aeLVUGhWs4J8Y9Ec40CVpQmSScogsP2Syi/Ac7QkqJIHv68s8IEL0xX
 FTStehIraGIco3QtRl8CbCSCEVuAjI+16REYs6h7vRLVce7PCLnfoR22KmMPj6p9
 X5Wt3xuU+dZhP5xgVSEyXARvM4TtFVLrtstC8MlJwPGUSR76aTnsaxiXIsHVTVAh
 6M/syyDSVN6OswMPAixw9/dALZWXBhQLMyANpG2jTgZIAjmGLmCSg7LkUa149nWZ
 pG+O8mdNVpREz97WgZZV
 =I/dF
 -----END PGP SIGNATURE-----

Merge tag 'sti-drm-next-2017-02-10' of https://github.com/vinceab/linux into drm-next

- remove deprecated stih416 chip functionnalities
- fix issues met around gdp panes
- fix STI driver unbind procedure
- DVI/HDMI mode is automatically detected
- allow fps statisitics resetting

* tag 'sti-drm-next-2017-02-10' of https://github.com/vinceab/linux:
  drm/sti: debug fps reset
  drm/sti: hdmi: automatically check DVI/HDMI mode
  drm/sti: unbind all components while driver cleanup
  drm/sti: do not post GDP command if no update
  drm/sti: do not set gdp pixel clock rate if mode is not set
  drm/sti: enable gdp pixel clock in atomic_update
  drm/sti: remove deprecated legacy vtg slave
  drm/sti: remove deprecated sink_term config
  drm/sti: do not check hw scaling if mode is not set
  drm/sti: Fix up crtc_state->event handling
  drm/sti: use atomic_helper for commit
2017-02-16 13:27:24 +10:00
Maarten Lankhorst 1592364de3 drm: Resurrect atomic rmfb code, v3
This was somehow lost between v3 and the merged version in Maarten's
patch merged as:

commit f2d580b9a8
Author: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Date:   Wed May 4 14:38:26 2016 +0200

    drm/core: Do not preserve framebuffer on rmfb, v4.

This introduces a slight behavioral change to rmfb. Instead of
disabling a crtc when the primary plane is disabled, we try to
preserve it.

Apart from old versions of the vmwgfx xorg driver, there is
nothing depending on rmfb disabling a crtc. Since vmwgfx is
a legacy driver we can safely only disable the plane with atomic.

If this commit is rejected by the driver then we will still fall
back to the old behavior and turn off the crtc.

v2:
- Remove plane->fb assignment, done by drm_atomic_clean_old_fb.
- Add WARN_ON when atomic_remove_fb fails.
- Always call drm_atomic_state_put.
v3:
- Use drm_drv_uses_atomic_modeset
- Handle the case where the first plane-disable-only commit fails
  with -EINVAL. Some drivers do not support this, fall back to
  disabling all crtc's in this case.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/66fc3da5-697b-1613-0a67-a5293209f0dc@linux.intel.com
2017-02-15 15:40:57 +02:00
Shunqian Zheng 1aa5ca6e3e drm/rockchip: Use common IOMMU API to attach devices
Rockchip DRM used the arm special API, arm_iommu_*(), to attach
iommu for ARM32 SoCs. This patch convert to common iommu API
so it would support ARM64 like RK3399.

Since previous patch added support for direct IOMMU address space
management, there is no need to use DMA API anymore and this patch wires
things to use the new method.

Signed-off-by: Shunqian Zheng <zhengsq@rock-chips.com>
Signed-off-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2017-02-15 08:52:13 +08:00
Tomasz Figa 38f993b7c5 drm/rockchip: Do not use DMA mapping API if attached to IOMMU domain
The API is not suitable for subsystems consisting of multiple devices
and requires severe hacks to use it. To mitigate this, this patch
implements allocation and address space management locally by using
helpers provided by DRM framework, like other DRM drivers do, e.g.
Tegra.

This patch should not introduce any functional changes until the driver
is made to attach subdevices into an IOMMU domain with the generic IOMMU
API, which will happen in following patch. Based heavily on GEM
implementation of Tegra DRM driver.

Signed-off-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Shunqian Zheng <zhengsq@rock-chips.com>
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
Signed-off-by: rjan Eide <orjan.eide@arm.com>
2017-02-15 08:52:13 +08:00
Denys Dmytriyenko 2220fc1ab3 uapi: add missing install of dma-buf.h
As part of c11e391da2 "dma-buf: Add ioctls to
allow userspace to flush" a new uapi header file dma-buf.h was added, but an
entry was not added on Kbuild to install it. This patch resolves this omission
so that "make headers_install" installs this header.

Signed-off-by: Denys Dmytriyenko <denys@ti.com>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: David Herrmann <dh.herrmann@gmail.com>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: Daniel Vetter <daniel.vetter@intel.com>
Cc: Tiago Vignatti <tiago.vignatti@intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1487102447-59265-1-git-send-email-denis@denix.org
2017-02-14 22:45:16 +01:00
ozeng d238326755 drm/amdgpu: Initialize pipe priority order on graphic initialization
Initialized PIPE_ORDER_TS0/1/2/3 field of SPI_ARB_PRIORITY register to 2.
This set the pipe priority order to:
02 - HP3D, CS_H, GFX, CS_M, CS_L

Signed-off-by: Oak Zeng <Oak.Zeng@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>
2017-02-13 15:08:33 -05:00
Rex Zhu 254cd2e08d drm/amdgpu: read hw register to check pg status.
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2017-02-13 12:43:04 -05:00
Alan Harrison d50e5c2448 drm/amdgpu: Add to initialization of mmVCE_VCPU_CNTL register
Add a bit needed during initialization into the driver, where it is supposed
to be.  Currently, this is happening in the VCE firmware, and although
functional, this is the correct place to perform this initialization.

Reviewed-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Alan Harrison <Alan.Harrison@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2017-02-13 12:41:07 -05:00
Alex Deucher c10c8f7c27 drm/amdgpu/pm: check for headless before calling compute_clocks
Don't update display bandwidth on headless asics.

bug:
https://bugs.freedesktop.org/show_bug.cgi?id=99387

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
2017-02-10 18:09:32 -05:00
Samuel Pitoiset a73effaf58 drm/amdgpu: use amdgpu_gem_va_check() in amdgpu_gem_va_update_vm()
This removes code duplication.

Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2017-02-10 12:07:33 -05:00
Alex Deucher 4ce3bd45b3 drm/amdgpu: add more cases to DCE11 possible crtc mask setup
Add cases for asics with 3 and 5 crtcs.  Fixes an artificial
limitation on asics with 3 or 5 crtcs.

Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=99744

Reviewed-by: Michel Dänzer <michel.daenzer@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
2017-02-10 12:07:33 -05:00
Vincent Abriou c462c2f5f5 drm/sti: debug fps reset
Reset the fps debug information when 'fps_show' is updated.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
2017-02-10 09:34:39 +01:00
Vincent Abriou 97d7c57630 drm/sti: hdmi: automatically check DVI/HDMI mode
Remove the hdmi_mode_property and use drm_detect_hdmi_monitor function
to check whether the connected monitor is HDMI capable or DVI only.

Signed-off-by: Vincent Abriou <vincent.abriou@st.com>
2017-02-10 09:34:39 +01:00
Vincent Abriou b7e05db3d1 drm/sti: unbind all components while driver cleanup
Unbind all the components when the STI driver is unregistered.

Signed-off-by: Vincent Abriou <vincent.abriou@st.com>
2017-02-10 09:34:39 +01:00
Vincent Abriou e9f494d36f drm/sti: do not post GDP command if no update
Do not process update requests with unmodified parameters.

This typically happens when the driver is called with legacy
(non-atomic) IOCTL : in that case atomic_update() is called multiple
times with the same parameters.

Signed-off-by: Vincent Abriou <vincent.abriou@st.com>
2017-02-10 09:34:39 +01:00
Vincent Abriou c5649ee497 drm/sti: do not set gdp pixel clock rate if mode is not set
Fix a division by 0 case : in some cases, when the GDP plane is being
disabled atomic_check() is called with "mode->clock = 0".
In that case, do not set parent and pixel clock rate.

Signed-off-by: Vincent Abriou <vincent.abriou@st.com>
2017-02-10 09:34:39 +01:00
Vincent Abriou 1b7f145123 drm/sti: enable gdp pixel clock in atomic_update
Set gdp pix clock rate and parent in atomic_check function and enable
it in the atomic_update only the first time.

Signed-off-by: Vincent Abriou <vincent.abriou@st.com>
2017-02-10 09:34:39 +01:00
Vincent Abriou 0c7ff84f7f drm/sti: remove deprecated legacy vtg slave
stih416 chip family is no more supported in Linux v4.9.
It is then useless to keep vtg slave field since it not used at all for
the stih407/10 chip family supported by sti driver.

Signed-off-by: Vincent Abriou <vincent.abriou@st.com>
2017-02-10 09:34:39 +01:00
Vincent Abriou e6d50dc647 drm/sti: remove deprecated sink_term config
stih416 chip family is no more supported in Linux v4.9.
Then sink_term config becomes useless. The field of the
register it was referring to is tag as reserved for stih410
chip family.

Signed-off-by: Vincent Abriou <vincent.abriou@st.com>
2017-02-10 09:34:39 +01:00
Fabien DESSENNE 6801723b01 drm/sti: do not check hw scaling if mode is not set
Fix a division by 0 case : in some cases, when the HQVDP plane is being
disabled atomic_check() is called with "mode->clock = 0".
In that case, do not check for scaling capabilities.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Vincent Abriou <vincent.abriou@st.com>
2017-02-10 09:34:39 +01:00
Fabien DESSENNE c62052d146 drm/sti: Fix up crtc_state->event handling
Use drm-core to handle event.
This is required to be able to use the nonblocking helpers.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Vincent Abriou <vincent.abriou@st.com>
2017-02-10 09:34:39 +01:00
Fabien DESSENNE 5e60f595d6 drm/sti: use atomic_helper for commit
Since nonblocking atomic commits are now supported, the driver can
now use drm_atomic_helper_commit().

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Vincent Abriou <vincent.abriou@st.com>
2017-02-10 09:34:39 +01:00
Dave Airlie 13f62f54d1 Merge branch 'drm-next-4.11' of git://people.freedesktop.org/~agd5f/linux into drm-next
Some additional fixes for 4.11.  Delayed a bit due to Chinese New Year. Highlights:
- Powerplay fixes
- VCE and UVD powergating fixes
- Clean up amdgpu SI gfx code to match CI and VI
- Misc bug fixes

* 'drm-next-4.11' of git://people.freedesktop.org/~agd5f/linux: (30 commits)
  drm/amdgpu: report the number of bytes moved at buffer creation
  drm/amdgpu: fix a potential deadlock in amdgpu_bo_create_restricted()
  drm/amdgpu: add support for new smc firmware on polaris
  drm/amd/powerplay: refine code to avoid potential bug that the memory not cleared.
  drm/amdgpu: shut up #warning for compile testing
  drm/amdgpu/virt: fix double kfree on bo_va
  drm/radeon: remove some dead code
  drm/radeon: avoid kernel segfault in vce when gpu fails to resume
  drm/amd/powerplay: set fan speed to max in profile peak mode only.
  drm/amd/gfx6: update gb_addr_config
  drm/amdgpu: update HAINAN_GB_ADDR_CONFIG_GOLDEN
  drm/amdgpu: update VERDE_GB_ADDR_CONFIG_GOLDEN
  drm/amdgpu: refine si_read_register
  drm/amdgpu/gfx6: clean up spi configuration
  drm/amdgpu/gfx6: clean up cu configuration
  drm/amdgpu/gfx6: clean up rb configuration
  drm/amdgpu: refine vce3.0 code and related powerplay pg code.
  drm/amdgpu: move subfunctions to the front of vce_v2_0.c.
  drm/amdgpu: enable vce pg feature on Kv.
  drm/amdgpu: refine code for VCE2.0 and related dpm code.
  ...
2017-02-10 10:13:30 +10:00
Dave Airlie f320d35723 Merge tag 'drm-fsl-dcu-for-v4.11' of http://git.agner.ch/git/linux-drm-fsl-dcu into drm-next
two minor fixes.

* tag 'drm-fsl-dcu-for-v4.11' of http://git.agner.ch/git/linux-drm-fsl-dcu:
  drm/fsl-dcu: check for clk_prepare_enable() error
  drm/fsl-dcu: remove unneeded 'ret' assignment
2017-02-10 10:12:56 +10:00
Dave Airlie 79b33494af Merge tag 'drm-misc-next-fixes-2017-02-09' of git://anongit.freedesktop.org/git/drm-misc into drm-next
Just 3 bugfixes for 4.11 merge window:

- fbdev module unload oops fix from Chris
- patch from Dan that look really dangers, better safe than sorry

* tag 'drm-misc-next-fixes-2017-02-09' of git://anongit.freedesktop.org/git/drm-misc:
  drm/atomic: fix an error code in mode_fixup()
  drm: Cancel drm_fb_helper_resume_work on unload
  drm: Cancel drm_fb_helper_dirty_work on unload
2017-02-10 10:12:00 +10:00
Samuel Pitoiset fad061270a drm/amdgpu: report the number of bytes moved at buffer creation
Like ttm_bo_validate(), ttm_bo_init() might need to move BO and
the number of bytes moved by TTM should be reported. This can help
the throttle buffer migration mechanism to make a better decision.

v2: fix computation

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2017-02-09 11:29:44 -05:00
Samuel Pitoiset 38fc4856ad drm/amdgpu: fix a potential deadlock in amdgpu_bo_create_restricted()
When ttm_bo_init() fails, the reservation mutex should be unlocked.

In debug build, the kernel reported "possible recursive locking
detected" in this codepath. For debugging purposes, I also added
a "WARN_ON(ww_mutex_is_locked())" when ttm_bo_init() fails and the
mutex was locked as expected.

This should fix (random) GPU hangs. The easy way to reproduce the
issue is to change the "Super Sampling" option from 1.0 to 2.0 in
Hitman. It will create a huge buffer, evict a bunch of buffers
(around ~5k) and deadlock.

This regression has been introduced pretty recently.

v2: only release the mutex if resv is NULL

Fixes: 12a852219583 ("drm/amdgpu: improve AMDGPU_GEM_CREATE_VRAM_CLEARED handling (v2)")
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2017-02-09 11:28:24 -05:00
Alex Deucher a52d120f62 drm/amdgpu: add support for new smc firmware on polaris
Some polaris variants require new smc firmware.

Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2017-02-09 10:54:45 -05:00
Rex Zhu 4d8d44c6ce drm/amd/powerplay: refine code to avoid potential bug that the memory not cleared.
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2017-02-09 10:54:08 -05:00
Arnd Bergmann 31bb90f1cd drm/amdgpu: shut up #warning for compile testing
My randconfig tests on linux-next showed a newly introduced warning:

drivers/gpu/drm/amd/amdgpu/amdgpu_object.c: In function 'amdgpu_bo_create_restricted':
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c:377:2: error: #warning Please enable CONFIG_MTRR and CONFIG_X86_PAT for better performance thanks to write-combining [-Werror=cpp]

Generally speaking, warnings about bad kernel configuration are not particularly
helpful. We could enforce the selection of X86_PAT through Kconfig, so the driver
cannot even be used unless it is enabled, or we could just rely on the runtime
warning that is also there.

In this version, I'm making the warning conditional on CONFIG_COMPILE_TEST, which
shuts it up for me, but not people that may actually want to run the kernel
as a compromize.

Fixes: a2e2f29970 ("drm/amdgpu: Bring bo creation in line with radeon driver (v2)")
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2017-02-09 00:23:24 -05:00
Colin Ian King 6127f4aee4 drm/amdgpu/virt: fix double kfree on bo_va
bo_va is being kfree'd twice, once in the call to amdgpu_vm_bo_rmv
and then a short while later. Fix this double free by removing
the 2nd kfree.

Detected by CoverityScan, CID#1399524 ("Double Free")

Reviewed-by: Monk Liu <monk.liu@amd.com>
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2017-02-08 21:06:00 -05:00
Dan Carpenter 9338acc579 drm/radeon: remove some dead code
If "rdev->bios" is NULL then we don't need to free it.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2017-02-08 21:04:29 -05:00
Jérôme Glisse 3b4821f8a4 drm/radeon: avoid kernel segfault in vce when gpu fails to resume
When GPU fails to resume we can not trust that value we write to GPU
memory will post and we might get garbage (more like 0xffffffff on
x86) when reading them back. This trigger out of range memory access
in the kernel inside the vce resume code path.

This patch use canonical value to compute offset instead of reading
back value from GPU memory.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Jérôme Glisse <jglisse@redhat.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2017-02-08 20:59:16 -05:00
Rex Zhu 5ada90d55f drm/amd/powerplay: set fan speed to max in profile peak mode only.
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2017-02-08 17:27:39 -05:00
Flora Cui 0d09a096c4 drm/amd/gfx6: update gb_addr_config
Signed-off-by: Flora Cui <Flora.Cui@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2017-02-08 17:25:19 -05:00