Commit graph

724481 commits

Author SHA1 Message Date
Alex Deucher
052c299080 drm/amdgpu: add atpx quirk handling (v2)
Add quirks for handling PX/HG systems.  In this case, add
a quirk for a weston dGPU that only seems to properly power
down using ATPX power control rather than HG (_PR3).

v2: append a new weston XT

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Junwei Zhang <Jerry.Zhang@amd.com> (v2)
Reviewed-and-Tested-by: Junwei Zhang <Jerry.Zhang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Cc: stable@vger.kernel.org
2018-01-10 15:44:38 -05:00
Alex Deucher
f2e5262f75 drm/amdgpu: Add dpm quirk for Jet PRO (v2)
Fixes stability issues.

v2: clamp sclk to 600 Mhz

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103370
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
2018-01-10 15:44:27 -05:00
Alex Deucher
239b5f64e1 drm/radeon: Add dpm quirk for Jet PRO (v2)
Fixes stability issues.

v2: clamp sclk to 600 Mhz

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103370
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
2018-01-10 15:44:14 -05:00
Arnd Bergmann
fb8baefc7b drm/amdgpu: use %pap format string for phys_addr_t
The newly added get_local_mem_info() function prints a phys_addr_t
using 0x%llx, which is wrong on most 32-bit systems, as shown by
this warning:

drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c: In function 'get_local_mem_info':
include/linux/kern_levels.h:5:18: error: format '%llx' expects argument of type 'long long unsigned int', but argument 2 has type 'resource_size_t {aka unsigned int}' [-Werror=format=]
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c:297:31: note: format string is defined here
  pr_debug("Address base: 0x%llx limit 0x%llx public 0x%llx private 0x%llx\n",

Passing the address by reference to the special %pap format string will
produce the correct output and avoid the warning.

Fixes: 30f1c0421e ("drm/amdgpu: Implement get_local_mem_info")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2018-01-09 10:59:28 +10:00
Dave Airlie
6213640fae drm-misc-next for 4.16:
Cross-subsystem Changes:
 
 - some dt-binding changes for Ilitek and sun4i devices
 
 Core Changes:
 
 - panel_orientation_quirks: fix tainted kernel
 
 Driver Changes:
 
 - panel changes
 - A83T and LVDS support to sun4i
 -----BEGIN PGP SIGNATURE-----
 
 iQIcBAABAgAGBQJaU3TTAAoJEEN0HIUfOBk0ql4QAM1JjU3byMMuiIUP0XLLFnYD
 vvd+feffYcMLHcytDmgsIzKQo7e+SqXyD3Wcqt99eiQiECrBkX8f8mN4DdM+Uhx6
 CdktjLgZ1Oqwa89CNFuxn4121GPN1D/h0yiiEEBbz8P4p5Xg/nUsIxw9zcRrYSrI
 YdbQm6h+ykm8tcwdz+cMkwiBo6EUfrVcc4hqMrHyqjH7QM9svBPNolgDSKLUyTVy
 91YgfUz5zqRofbFljF+vStFfn6X82ghJJmTJOT3Ad9AnuabxkWu39xMES7c9BgQz
 v4/2S4Bernf6QP+KEUGYqgZ5VdVei6L6SIefaolCRy6wMHKdWKNIEWR68YdS/BOG
 F3yx5rKhnY2R75kiuij7Gs6Ibb40q8W17i6Bf6i+h8B6fRYz4Xtvj9qUeyt1OWwp
 8z9o1DQjHboawu/I/Dg76Vs59zu+oWiGvvj/87k9I549dPwz4/m3X95lO6oyDCq1
 qO3VujYZTyXZkNhYrGgNw+RPWRZWr47mQ8lHJ6f+LYooR7xpl246ucRJrbrMiOLW
 XNd25ydeEKNV0+AysLKdLMkte85iYUlj4EpvUCAu1NBfPIL9f3EeE5mpNCIbjMTD
 R8KMBJFt0LTjahUzfOe83ofczMRsJl44sLkLfRpPWPIXighSCXihhRSBNvnrrrFy
 kJq3DRteiDGU5b8/Fgy6
 =1UNW
 -----END PGP SIGNATURE-----

Merge tag 'drm-misc-next-2018-01-08' of git://anongit.freedesktop.org/drm/drm-misc into drm-next

drm-misc-next for 4.16:

Cross-subsystem Changes:

- some dt-binding changes for Ilitek and sun4i devices

Core Changes:

- panel_orientation_quirks: fix tainted kernel

Driver Changes:

- panel changes
- A83T and LVDS support to sun4i

* tag 'drm-misc-next-2018-01-08' of git://anongit.freedesktop.org/drm/drm-misc:
  drm/panel: lvds: Add support for the power-supply property
  dt-bindings: panel: lvds: Document power-supply property
  drm/sun4i: Add A83T support
  drm/sun4i: Add LVDS support
  drm/sun4i: Create minimal multipliers and dividers
  drm/sun4i: Force the mixer rate at 150MHz
  dt-bindings: display: sun4i-drm: Add A83T pipeline
  dt-bindings: display: sun4i-drm: Add LVDS properties
  drm/tinydrm: add driver for ST7735R panels
  dt-bindings: Add binding for Sitronix ST7735R display panels
  dt-bindings: add jianda vendor prefix
  drm/tinydrm: Update ILI9225 compatible string
  dt-bindings: update compatible string for ILI9225
  dt-bindings: Add "vot" vendor prefix
  drm: fix tainted kernel caused by drm_panel_orientation_quirks.c
  drm/panel: Add Ilitek ILI9322 driver
  drm/panel: Add DT bindings for Ilitek ILI9322
2018-01-09 10:24:17 +10:00
Dave Airlie
bd3c0094a1 Merge branch 'drm-next-4.16' of git://people.freedesktop.org/~agd5f/linux into drm-next
Last few updates for 4.16:
- Misc fixes for amdgpu
- Enable swapout for reserved BOs during allocation for ttm
- Misc cleanups for ttm

* 'drm-next-4.16' of git://people.freedesktop.org/~agd5f/linux: (24 commits)
  drm/amdgpu: Correct the IB size of bo update mapping.
  drm/ttm: enable swapout for reserved BOs during allocation
  drm/ttm: add new function to check if bo is allowable to evict or swapout
  drm/ttm: use an operation ctx for ttm_tt_bind
  drm/ttm: use an operation ctx for ttm_tt_populate in ttm_bo_driver (v2)
  drm/ttm: use an operation ctx for ttm_mem_global_alloc_page
  drm/ttm: use an operation ctx for ttm_mem_global_alloc
  drm/ttm: call ttm_bo_swapout directly when ttm shrink
  drm/vmwgfx: remove the default io_mem_pfn set
  drm/virtio: remove the default io_mem_pfn set
  drm/radeon: remove the default io_mem_pfn set
  drm/qxl: remove the default io_mem_pfn set
  drm/nouveau: remove the default io_mem_pfn set
  drm/mgag200: remove the default io_mem_pfn set
  drm/cirrus: remove the default io_mem_pfn set
  drm/bochs: remove the default io_mem_pfn set
  drm/ast: remove the default io_mem_pfn set
  drm/ttm: add ttm_bo_io_mem_pfn to check io_mem_pfn
  drm/amdgpu: fix VM faults with per VM BOs
  drm/ttm: drop the spin in delayed delete if the trylock doesn't work
  ...
2018-01-09 10:09:13 +10:00
Maxime Ripard
a1c55bccf6
drm/panel: lvds: Add support for the power-supply property
A significant number of panels need to power up a regulator in order to
operate properly. Add support for the power-supply property to enable and
disable such a regulator whenever needed.

Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c0819bdf88fa948188df95e57a10820a8a4548d.1513854122.git-series.maxime.ripard@free-electrons.com
2018-01-05 10:00:14 +01:00
Maxime Ripard
2e7e2ebc68
dt-bindings: panel: lvds: Document power-supply property
The power-supply property is used by a vast majority of panels, including
panel-simple. Let's document it as a common property

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0a6a3abcf1a6b7f0e66a81af8a44c5c0566ce06c.1513854122.git-series.maxime.ripard@free-electrons.com
2018-01-05 10:00:12 +01:00
Dave Airlie
b0caa1333b drm/imx: format modifier support
- Add tiled prefetch support to PRE
 - Add format modifier support to PRG and imx-drm-core
 - Use runtime PM to control PRG clock
 - Allow building ipu-v3 under COMPILE_TEST
 -----BEGIN PGP SIGNATURE-----
 
 iQJLBAABCAA1FiEEBsBxhV1FaKwXuCOBUMKIHHCeYOsFAlpLNtcXHHAuemFiZWxA
 cGVuZ3V0cm9uaXguZGUACgkQUMKIHHCeYOsBhQ/+PcWTQv8HaPI1O8qaeQ0g16C4
 XCBcpySso6uv1GbVN7PCEgkT03rBlDP6uoqOZicWlHJMlSoAL2GmxAgfsVK4kBGI
 6s/MegnWREWJVaII0pI6Gk4eFyVxEmiju5kv2XTCuV7hWIfNys70o6JDDSOL5DzI
 dPhb2h43izlqW0VwjGrePCf0drWgxPfpdt6ny89C0TnT7N96ObRf8v9Uoueeo5pS
 8C8RFBWmERROTjti6EU/jubg3ttKkXs5TenUMnM44VzUQ9kA7P6MfX5vkbLx93Hq
 0U3gfglfmyZ2Vr3cOcZbu2fivYCc/++Z3vxTOfcOsyN+nzZAtDSUlZT6Wer/8+Tf
 2EWeNGYnTRZRh/4QYnoEzr2Ifh0PNJ4P8c9m7NmfPpiUNL3trer7sekzHlxaUgUu
 KipFNDxnkSEddha2DxkQ/1kzr0q3DnoMF/y16nytXILO/EeLa7nmUbei7nZU2xcn
 Yhho513sEqCi7WCx3nLeO9DIVh1jOjld5uCUGwlZ2KzwKf0VnC8VURv8ZR28bzk2
 r8N9TINPgt7WF8V1zzrh5IN3PIszzeQeT7npGSOX8kUTzT5UN9VX8ctRFXxDCdyF
 X9CD9vT5mqGe80e2X5NZ1KyGruT8tCpGrxPhz7SKUxh/IWRsLskU6+fEqu11l2/H
 WYlwv4KlTteIN/5cM5w=
 =dt6o
 -----END PGP SIGNATURE-----

Merge tag 'imx-drm-next-2018-01-02' of git://git.pengutronix.de/git/pza/linux into drm-next

drm/imx: format modifier support

- Add tiled prefetch support to PRE
- Add format modifier support to PRG and imx-drm-core
- Use runtime PM to control PRG clock
- Allow building ipu-v3 under COMPILE_TEST

* tag 'imx-drm-next-2018-01-02' of git://git.pengutronix.de/git/pza/linux:
  gpu: ipu-v3: allow to build with COMPILE_TEST
  drm/imx: advertise supported plane format modifiers
  drm/imx: add FB modifier support
  gpu: ipu-v3: prg: add modifier support
  gpu: ipu-v3: pre: add tiled prefetch support
  gpu: ipu-v3: prg: switch to runtime PM
2018-01-05 11:33:24 +10:00
Dave Airlie
bcd21a4786 Merge branch 'drm-armada-devel-4.15' of git://git.armlinux.org.uk/~rmk/linux-arm into drm-next
This series builds upon the set of fixes previously submitted to move
Armada DRM closer to atomic modeset.  We're nowhere near yet, but this
series helps to get us closer by unifying some of the differences
between the primary and overlay planes.

New features added allows userspace to disable the primary plane if
overlay is full screen and there's nothing obscuring the colorkey -
this saves having to fetch an entire buffer containing nothing but
colorkey when displaying full screen video.

[airlied: fixup for atomic plane helper rename:
a01cb8ba3f
Author: Ville Syrjälä <ville.syrjala@linux.intel.com>
Date:   Wed Nov 1 22:16:19 2017 +0200

    drm: Move drm_plane_helper_check_state() into drm_atomic_helper.c
]

* 'drm-armada-devel-4.15' of git://git.armlinux.org.uk/~rmk/linux-arm: (29 commits)
  drm/armada: expand overlay trace entry
  drm/armada: implement primary plane update
  drm/armada: extract register generation from armada_drm_primary_set()
  drm/armada: wait for previous work when moving overlay window
  drm/armada: move overlay plane register update generation
  drm/armada: re-organise overlay register update generation
  drm/armada: disable planes at next blanking period
  drm/armada: avoid work allocation
  drm/armada: allow armada_drm_plane_work_queue() to silently fail
  drm/armada: use drm_plane_helper_check_state()
  drm/armada: only enable HSMOOTH if scaling horizontally
  drm/armada: move writes of LCD_SPU_SRAM_PARA1 under lock
  drm/armada: move regs into armada_plane_work
  drm/armada: move event sending into armada_plane_work
  drm/armada: move fb retirement into armada_plane_work
  drm/armada: move overlay plane work out from under spinlock
  drm/armada: clear plane enable bit when disabling
  drm/armada: clean up armada_drm_crtc_plane_disable()
  drm/armada: allow the primary plane to be disabled
  drm/armada: wait and cancel any pending frame work at disable
  ...
2018-01-05 09:51:43 +10:00
Dave Airlie
066f9eb47d Merge branch 'etnaviv/next' of https://git.pengutronix.de/git/lst/linux into drm-next
Highlights this time:
1. Fix for a nasty Kconfig dependency chain issue from Philipp.
2. Occlusion query buffer address added to the cmdstream validator by
Christian.
3. Fixes and cleanups to the job handling from me. This allows us to
turn on the GPU performance profiling added in the last cycle.
It is also prep work for hooking in the DRM GPU scheduler, which I hope
to land for the next cycle.

* 'etnaviv/next' of https://git.pengutronix.de/git/lst/linux: (32 commits)
  drm/etnaviv: use memset32 to init pagetable
  drm/etnaviv: move submit free out of critical section
  drm/etnaviv: re-enable perfmon support
  drm/etnaviv: couple runtime PM management to submit object lifetime
  drm/etnaviv: move GPU active handling to bo pin/unpin
  drm/etnaviv: move cmdbuf into submit object
  drm/etnaviv: use submit exec_state for perfmon sampling
  drm/etnaviv: move exec_state to submit object
  drm/etnaviv: move PMRs to submit object
  drm/etnaviv: refcount the submit object
  drm/etnaviv: move ww_acquire_ctx out of submit object
  drm/etnaviv: move object unpinning to submit cleanup
  drm/etnaviv: attach in fence to submit and move fence wait to fence_sync
  drm/etnaviv: rename submit fence to out_fence
  drm/etnaviv: move object fence attachment to gem_submit path
  drm/etnaviv: simplify submit_create
  drm/etnaviv: add lockdep annotations to buffer manipulation functions
  drm/etnaviv: hold GPU lock while inserting END command
  drm/etnaviv: move workqueue to be per GPU
  drm/etnaviv: remove switch_context member from etnaviv_gpu
  ...
2018-01-05 09:42:04 +10:00
Dave Airlie
4ef0bef2ec Remove lagacy IPP driver
- This driver isn't used anymore so remove it. Marek is preparing new one
   which includes completely rewritten API so this driver will be replaced
   with the new version[1] later.
 And cleanups.
 
 [1] https://patches.linaro.org/cover/118386/
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJaStDkAAoJEFc4NIkMQxK4E0sP/iVMboqiKeZQuagJGu+Qi0eL
 VTe9wVFZJMFsHL6dDdVTTpZUul9bE05RufKLjQyA6ZxqgQd5lohu+fw3Q+ImQrzl
 zPLvX4OTxeq56CFWQt0WslTo3LsXlIUJ/LxqVq0Tr/ipmjRAd6F8H67UXtetoJhb
 39Omm0HtTgloO4OYTR9RzK9XsuZ5a8PiUN8NsH8qR2ZrUBgsEDrPsj6tTP8jj93M
 9qwLgD58e3kWiWilIZH7bqA29TQAfTNwbenjzZhkYSrNsq6EcvjPDsZxeWET1jFW
 m6QYs+glfYxNujE6Y/gelWOYA7CLCT38wDMTMTWYUY3m5Vqa8SnqHJycsjCrQmNf
 aIRk+0Ou8xqeydirMhKPVVPryo98P6sIXE4R7tIFnTQ71a1WzoECXLA2eQ7t/MGu
 CSAFovUCnYVxcqh2jSnBOuauYPb9a8RkRgtoGw0l5R5FpveUuLC1B04NQ+DKcQHQ
 YaLzhnTY4j+5u2E6Io7LfmyaLLa9ZEJfzp5K7+41cguLu6KknTDVxmvD36HyNIkH
 hfnalbOwlitLuViNLFGpGPv7ByvigaMTUBp1DtE3Oqc1YXZjgRZ+dDrrXv277yql
 3u1+OLCf2sGDrJ6XSz00E8oPDsvxTI1jNxUfMOMN2eZhHwhlYsRrxWnizr+P0JmP
 30zX80D0o1aGpl/baKav
 =pWLW
 -----END PGP SIGNATURE-----

Merge tag 'exynos-drm-next-for-v4.16' of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos into drm-next

Remove lagacy IPP driver
- This driver isn't used anymore so remove it. Marek is preparing new one
  which includes completely rewritten API so this driver will be replaced
  with the new version[1] later.
And cleanups.

[1] https://patches.linaro.org/cover/118386/

* tag 'exynos-drm-next-for-v4.16' of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos:
  drm/exynos: ipp: Remove Exynos DRM IPP subsystem
  drm/exynos/decon: Add include guard to the Exynos7 header
  drm/exynos/decon: Move headers from global to local place
  drm/exynos: decon5433: Remove unnecessary platform_get_resource() error check
2018-01-05 09:29:20 +10:00
Dave Airlie
a9742b794a Merge tag 'drm-amdkfd-next-2017-12-24' of git://people.freedesktop.org/~gabbayo/linux into drm-next
- Add CWSR (compute wave save restore) support for GFX8 (Carrizo)
- Fix SDMA user-mode queues support for GFX7 (Kaveri)
- Add SDMA user-mode queues support for GFX8 (Carrizo)
- Allow HWS (hardware scheduling) to schedule multiple processes concurrently
- Add debugfs support
- Simplify process locking and lock dependencies
- Refactoring topology code to prepare for dGPU support + fixes to that code
  - Add option to generate dummy/virtual CRAT table when its missing or deformed
  - Recognize CPUs other then APUs as compute entities
- Various clean ups and bug fixes

I have not yet sent the dGPU topology code because it depends on a patch
for the PCI subsystem that adds PCIe atomics support. Once that patch is
upstreamed we can continue with the rest of the dGPU code.

* tag 'drm-amdkfd-next-2017-12-24' of git://people.freedesktop.org/~gabbayo/linux: (53 commits)
  drm/amdgpu: Add support for reporting VRAM usage
  drm/amdkfd: Ignore ACPI CRAT for non-APU systems
  drm/amdkfd: Module option to disable CRAT table
  drm/amdkfd: Add AQL Queue Memory flag on topology
  drm/amdkfd: Fixup incorrect info in the CZ CRAT table
  drm/amdkfd: Add perf counters to topology
  drm/amdkfd: Add topology support for dGPUs
  drm/amdkfd: Add topology support for CPUs
  drm/amdkfd: Fix sibling_map[] size
  drm/amdkfd: Simplify counting of memory banks
  drm/amdkfd: Turn verbose topology messages into pr_debug
  drm/amdkfd: sync IOLINK defines to thunk spec
  drm/amdkfd: Support enumerating non-GPU devices
  drm/amdkfd: Decouple CRAT parsing from device list update
  drm/amdkfd: Reorganize CRAT fetching from ACPI
  drm/amdkfd: Group up CRAT related functions
  drm/amdkfd: Fix memory leaks in kfd topology
  drm/amdkfd: Topology: Fix location_id
  drm/amdkfd: Update number of compute unit from KGD
  drm/amd: Remove get_vmem_size from KGD-KFD interface
  ...
2018-01-05 09:27:49 +10:00
Maxime Ripard
2f0d7bb16e
drm/sun4i: Add A83T support
Add support for the A83T display pipeline.

Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Link: https://patchwork.freedesktop.org/patch/msgid/614b430adf3a67320362a75c01b01bd53013da8a.1513854122.git-series.maxime.ripard@free-electrons.com
2018-01-04 20:37:59 +01:00
Maxime Ripard
a0c1214e47
drm/sun4i: Add LVDS support
The TCON supports the LVDS interface to output to a panel or a bridge.
Let's add support for it.

Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Link: https://patchwork.freedesktop.org/patch/msgid/7fbb85f33ee1d5009fde4f0d7d236e11ca58b114.1513854122.git-series.maxime.ripard@free-electrons.com
2018-01-04 20:37:17 +01:00
Maxime Ripard
ec08d5966b
drm/sun4i: Create minimal multipliers and dividers
The various outputs the TCON can provide have different constraints on the
dotclock divider. Let's make them configurable by the various mode_set
functions.

Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Link: https://patchwork.freedesktop.org/patch/msgid/92ff5881c8f8674056d34458b2f264cd48d4e136.1513854122.git-series.maxime.ripard@free-electrons.com
2018-01-04 20:08:42 +01:00
Maxime Ripard
edea372bd2
drm/sun4i: Force the mixer rate at 150MHz
It seems like the mixer can only run properly when clocked at 150MHz. In
order to have something more robust than simply a fire-and-forget
assigned-clocks-rate, let's put that in the code.

Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Link: https://patchwork.freedesktop.org/patch/msgid/f5f05307972ed05250e8094b302d68b9e7e167f6.1513854122.git-series.maxime.ripard@free-electrons.com
2018-01-04 20:04:32 +01:00
Maxime Ripard
104fe24a5f
dt-bindings: display: sun4i-drm: Add A83T pipeline
The A83T has two video pipelines in parallel that looks quite similar to
the other SoCs.

The video planes are handled through a controller called the mixer, and the
video signal is then passed to the timing controller (TCON).

And while there is two instances of the mixers and TCONs, they have a
significant number of differences. The TCONs are quite easy to deal with,
one is supposed to generate TV (in the broader term, so including things
like HDMI) signals, the other one LCD (so RGB, LVDS, DSI) signals. And
while they are called TCON0 and TCON1 in the A83t datasheet, newer SoCs
call them TCON-TV and TCON-LCD, which seems more appropriate.

However, the mixers differ mostly by their capabilities, with some features
being available only in the first one, or the number of planes they expose,
but also through their register layout. And while the capabilities could be
represented as properties, the register layout differences would need to
express all the registers offsets as properties, which is usually quite
bad. Especially since documentation on that hardware block is close to
non-existent and we don't even have the list of all those registers in the
first place.

So let's call them mixer 0 and 1 in our compatibles, even though the name
is pretty bad...

At the moment, we only have tested the code on a board that has a single
display output, so we're leaving the tcon-tv and mixer1 out.

Reviewed-by: Rob Herring <robh@kernel.org>
Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Link: https://patchwork.freedesktop.org/patch/msgid/2702a5c1d224af1c51743492ad1b917966f2ad43.1513854122.git-series.maxime.ripard@free-electrons.com
2018-01-04 20:04:12 +01:00
Maxime Ripard
71b03a96ff
dt-bindings: display: sun4i-drm: Add LVDS properties
Some clocks and resets supposed to drive the LVDS logic in the display
engine have been overlooked when the driver was first introduced.

Add those additional resources to the binding, and we'll deal with the ABI
stability in the code.

Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Link: https://patchwork.freedesktop.org/patch/msgid/ddbde28fe2e4f21412974e4c69fbfe1c5ff9383f.1513854122.git-series.maxime.ripard@free-electrons.com
2018-01-04 20:01:47 +01:00
David Lechner
5b8ea816e8 drm/tinydrm: add driver for ST7735R panels
This adds a new driver for Sitronix ST7735R display panels.

This has been tested using an Adafruit 1.8" TFT.

Signed-off-by: David Lechner <david@lechnology.com>
Reviewed-by: Noralf Trønnes <noralf@tronnes.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Link: https://patchwork.freedesktop.org/patch/msgid/1514833336-22564-4-git-send-email-david@lechnology.com
2018-01-03 13:54:24 +01:00
David Lechner
634ab311fc dt-bindings: Add binding for Sitronix ST7735R display panels
This adds a new device tree binding for Sitronix ST7735R display panels,
such as the Adafruit 1.8" TFT.

Signed-off-by: David Lechner <david@lechnology.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Link: https://patchwork.freedesktop.org/patch/msgid/1514833336-22564-3-git-send-email-david@lechnology.com
2018-01-03 13:53:46 +01:00
David Lechner
95e2ce7b42 dt-bindings: add jianda vendor prefix
This adds a vendor prefix "jianda" for Jiandangjing Technology Co., Ltd.

Signed-off-by: David Lechner <david@lechnology.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Link: https://patchwork.freedesktop.org/patch/msgid/1514833336-22564-2-git-send-email-david@lechnology.com
2018-01-03 13:53:14 +01:00
David Lechner
f3125a545d drm/tinydrm: Update ILI9225 compatible string
This updates the compatible string for a no-name LCD panel to
"vot,v220hf01a-t", "ilitek,ili9225".

The original bindings were the generic "ilitek,ili9225-2.2in-176x220"
because I could not find a datasheet. However, after some more research,
I finally found one, so the actual vendor and model name are now known.

This previous bindings have not made it to the mainline kernel yet, so
this is not breaking backwards compatibility.

Signed-off-by: David Lechner <david@lechnology.com>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Link: https://patchwork.freedesktop.org/patch/msgid/1513881187-3197-4-git-send-email-david@lechnology.com
2018-01-03 13:52:53 +01:00
David Lechner
fe5b66c123 dt-bindings: update compatible string for ILI9225
This updates the compatible string for a no-name LCD panel to
"vot,v220hf01a-t", "ilitek,ili9225".

The original bindings [1] were the generic "ilitek,ili9225-2.2in-176x220"
because I could not find a datasheet. However, after some more research,
I finally found one, so the actual vendor and model name are now known.

This previous bindings have not made it to the mainline kernel yet, so
this is not breaking backwards compatibility.

This is also following the precedence of the ILI9322 bindings [2] by using
the pattern "vendor,specific-system-config", "vendor,ip-part";

[1]: https://patchwork.ozlabs.org/patch/839352/
[2]: https://patchwork.ozlabs.org/patch/843576/

Signed-off-by: David Lechner <david@lechnology.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Link: https://patchwork.freedesktop.org/patch/msgid/1513881187-3197-3-git-send-email-david@lechnology.com
2018-01-03 13:52:26 +01:00
David Lechner
d3151583b0 dt-bindings: Add "vot" vendor prefix
This adds a vendor prefix "vot" for Vision Optical Technology Co., Ltd.
They make LCD displays.

Signed-off-by: David Lechner <david@lechnology.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Link: https://patchwork.freedesktop.org/patch/msgid/1513881187-3197-2-git-send-email-david@lechnology.com
2018-01-03 13:51:54 +01:00
Lucas Stach
2f20fc4fc9 drm/etnaviv: use memset32 to init pagetable
Now that memset32 is available, the open-coded pagetable initialization
loop can be replaced.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
2018-01-02 17:36:53 +01:00
Lucas Stach
2e3a2dda25 drm/etnaviv: move submit free out of critical section
There is no need to hold the GPU lock while freeing the submit
object. Only move the retired submits from the GPU active list to
a temporary retire list under the GPU lock.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
2018-01-02 17:36:28 +01:00
Lucas Stach
a7cfa565d4 drm/etnaviv: re-enable perfmon support
Now that the PMR lifetime issues are solved we can safely re-enable
performance counter profiling support.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
2018-01-02 17:35:34 +01:00
Lucas Stach
8bda1516fb drm/etnaviv: couple runtime PM management to submit object lifetime
As long as there is an active submit, we want the GPU to stay awake. This
is slightly complicated by the fact that we really want to wake the GPU
at the last possible moment to achieve maximum power savings.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
2018-01-02 17:34:59 +01:00
Lucas Stach
5b223e94a8 drm/etnaviv: move GPU active handling to bo pin/unpin
The active count is used to check if the BO is idle, where idle is defined
as not active on the GPU and all VM mappings and reference counts dropped
to the initial state. As the idling of the mappings and references now only
happens in the submit cleanup, the active state handling must be moved to
the same location in order to keep the userspace semantics.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
2018-01-02 17:34:10 +01:00
Lucas Stach
2f9225dbc0 drm/etnaviv: move cmdbuf into submit object
Less dynamic allocations and slims down the cmdbuf object to only the
required information, as everything else is already available in the
submit object.

This also simplifies buffer and mappings lifetime management, as they
are now exlusively attached to the submit object and not additionally
to the cmdbuf.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
2018-01-02 17:33:36 +01:00
Lucas Stach
7a9c0fe20e drm/etnaviv: use submit exec_state for perfmon sampling
The GPU exec state may have changed at the time when the perfmon sampling
is done, as it reflects the state of the last submission, not the current
GPU execution state.

So for proper sampling we must use the submit exec_state.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
2018-01-02 17:33:01 +01:00
Lucas Stach
797b0159e6 drm/etnaviv: move exec_state to submit object
We'll need this in some places where only the submit is available. Also
this is a first step at slimming down the cmdbuf object.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
2018-01-02 17:32:40 +01:00
Lucas Stach
ef146c00e2 drm/etnaviv: move PMRs to submit object
To make them available to the event worker even after the actual
command stream execution has finished.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
2018-01-02 17:31:59 +01:00
Lucas Stach
e0329e6cfa drm/etnaviv: refcount the submit object
The submit object lifetime will get extended to the actual GPU
execution. As multiple users will depend on this, add a kref to
properly control destruction of the object.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
2018-01-02 17:31:31 +01:00
Lucas Stach
08301d73f2 drm/etnaviv: move ww_acquire_ctx out of submit object
The acquire_ctx is special in that it needs to be released from the same
thread as has been used to initialize it. This collides with the intention to
extend the submit lifetime beyond the gem_submit function with potentially
other threads doing the final cleanup.

Move the ww_acquire_ctx to the function local stack as suggested in the
documentation.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
2018-01-02 17:30:44 +01:00
Lucas Stach
33a63e68f6 drm/etnaviv: move object unpinning to submit cleanup
This is safe to call in all paths, as the BO_PINNED flag tells us if the BO
needs unpinning.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
2018-01-02 17:29:55 +01:00
Lucas Stach
9efabd7392 drm/etnaviv: attach in fence to submit and move fence wait to fence_sync
Simplifies the cleanup path and moves fence waiting to a central location.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
2018-01-02 17:29:17 +01:00
Lucas Stach
10009ea2e4 drm/etnaviv: rename submit fence to out_fence
This is the fence passed out on a sucessful GPU submit. Make the name
more clear.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
2018-01-02 17:28:09 +01:00
Lucas Stach
0236efe97e drm/etnaviv: move object fence attachment to gem_submit path
The object fencing has nothing to do with the actual GPU buffer submit,
so move it to the gem submit path to have a cleaner split.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
2018-01-02 17:27:53 +01:00
Lucas Stach
c528372380 drm/etnaviv: simplify submit_create
Use kzalloc so other code doesn't need to worry about uninitialized members.
Drop the non-standard GFP flags, as we really don't want to fail the submit
when under slight memory pressure. Remove one level of indentation by using
an early return if the allocation failed. Also remove the unused drm device
member.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
2018-01-02 17:26:59 +01:00
Lucas Stach
b6d6223f50 drm/etnaviv: add lockdep annotations to buffer manipulation functions
When manipulating the kernel command buffer the GPU mutex must be held, as
otherwise different callers might try to replace the same part of the
buffer, wreacking havok in the GPU execution.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
2018-01-02 17:25:44 +01:00
Lucas Stach
40c27bdeb0 drm/etnaviv: hold GPU lock while inserting END command
Inserting the END command when suspending the GPU is changing the
command buffer state, which requires the GPU to be held.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
2018-01-02 17:25:11 +01:00
Lucas Stach
a7790d7809 drm/etnaviv: move workqueue to be per GPU
While the etnaviv workqueue needs to be ordered, as we rely on work items
being executed in queuing order, this is only true for a single GPU.
Having a shared workqueue for all GPUs in the system limits concurrency
artificially.

Getting each GPU its own ordered workqueue still meets our ordering
expectations and enables retire workers to run concurrently.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
2018-01-02 17:24:28 +01:00
Lucas Stach
4375ffffbf drm/etnaviv: remove switch_context member from etnaviv_gpu
There is no need to store this in the gpu struct. MMU flushes are triggered
correctly in reaction to MMU maps and unmaps, independent of the current ctx.
Any required pipe switches can be infered from the current and the desired
GPU exec state.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
2018-01-02 17:21:37 +01:00
Lucas Stach
fa67ac84a3 drm/etnaviv: don't flush workqueue in etnaviv_gpu_wait_obj_inactive
There is no need to synchronize with oustanding retire jobs if the object
has gone idle. Retire jobs only ever change the object state from active to
idle, not the other way around.

The IOVA put race is uncritical, as the GEM_WAIT ioctl itself is holding
a reference to the GEM object, so the retire worker will not pull the
object into the CPU domain, which is the thing we are trying to guard
against with etnaviv_gpu_wait_obj_inactive. The ordering of the various
counts and waits may change a bit, but the userspace visible behavior at
the bounds of the syscall are unchanged.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
2018-01-02 17:17:07 +01:00
Lucas Stach
3057e3f745 drm/etnaviv: remove stale TODO in etnaviv_gpu_submit
Flush and prefetch are properly handled in the buffer code, data endianess
would need much wider changes than adding something to this single function.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
2018-01-02 17:15:56 +01:00
Lucas Stach
b7b17e5cec drm/etnaviv: remove -EAGAIN handling from submit path
Now that the userptr BO handling doesn't rely on the userspace restarting
the submit after object population, there is no need to special case the
-EAGAIN return value anymore.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
2018-01-02 17:15:13 +01:00
Lucas Stach
b2295c247c drm/etnaviv: get rid of userptr worker
All code paths which populate userptr BOs are fine with the get_pages
function taking the mmap_sem lock. This allows to get rid of the pretty
involved architecture with a worker being scheduled if the mmap_sem
needs to be taken, but instead call GUP directly and allow it to take
the lock if necessary.

This simplifies the code a lot and removes the possibility of this
function returning -EAGAIN, which complicates object population
handling at the callers.

A notable change in behavior is that we don't allow a process to populate
objects with user pages from a foreign MM anymore. This would have been an
invalid use before, as it breaks the assumptions made in the etnaviv kernel
driver to enfore cache coherence. We now disallow this by rejecting the
request to populate those objects. Well behaving userspace is unaffected by
this change.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
2018-01-02 17:09:47 +01:00
Lucas Stach
54f09288f9 drm/etnaviv: change return type of etnaviv_gem_obj_add to void
This function never fails, as it does nothing more than adding the GEM
object to the global device list. Making this explicit through the void
return type allows to drop some unnecessary error handling.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
2018-01-02 17:07:41 +01:00