OSDN Git Service

android-x86/kernel.git
6 years agoMerge branch 'etnaviv/next' of https://git.pengutronix.de/git/lst/linux into drm...
Dave Airlie [Mon, 21 Aug 2017 04:34:15 +0000 (14:34 +1000)]
Merge branch 'etnaviv/next' of https://git.pengutronix.de/git/lst/linux into drm-next

this cycle has been fairly calm in etnaviv land with most of the action
happening on the userspace side.

Notable changes:
- Improvements to CONFIG option handling to make it harder for users to
shoot themselves in the foot due to kernel misconfiguration.
- Tweaked GEM object population, so that userspace can take considerate
action when memory allocation fails, rather than waking the raging OOM
killer beast.

* 'etnaviv/next' of https://git.pengutronix.de/git/lst/linux:
  drm/etnaviv: switch GEM allocations to __GFP_RETRY_MAYFAIL
  drm/etnaviv: don't fail GPU bind when CONFIG_THERMAL isn't enabled
  drm/etnaviv: switch to drm_*{get,put} helpers
  drm/etnaviv: select CMA and DMA_CMA if available
  drm/etnaviv: populate GEM objects on cpu_prep
  drm/etnaviv: reduce allocation failure message severity
  drm/etnaviv: don't trigger OOM killer when page allocation fails

6 years agoMerge tag 'drm-amdkfd-next-2017-08-18' of git://people.freedesktop.org/~gabbayo/linux...
Dave Airlie [Mon, 21 Aug 2017 00:49:48 +0000 (10:49 +1000)]
Merge tag 'drm-amdkfd-next-2017-08-18' of git://people.freedesktop.org/~gabbayo/linux into drm-next

This is the amdkfd pull request for 4.14 merge window.
AMD has started cleaning the pipe and sending patches from their internal
development to the upstream community.

The plan as I understand it is to first get all the non-dGPU patches to
upstream and then move to upstream dGPU support.

The patches here are relevant only for Kaveri and Carrizo.

The following is a summary of the changes:
- Add new IOCTL to set a Scratch memory VA
- Update PM4 headers for new firmware that support scratch memory
- Support image tiling mode
- Remove all uses of BUG_ON
- Various Bug fixes and coding style fixes

* tag 'drm-amdkfd-next-2017-08-18' of git://people.freedesktop.org/~gabbayo/linux: (24 commits)
  drm/amdkfd: Implement image tiling mode support v2
  drm/amdgpu: Add kgd kfd interface get_tile_config() v2
  drm/amdkfd: Adding new IOCTL for scratch memory v2
  drm/amdgpu: Add kgd/kfd interface to support scratch memory v2
  drm/amdgpu: Program SH_STATIC_MEM_CONFIG globally, not per-VMID
  drm/amd: Update MEC HQD loading code for KFD
  drm/amdgpu: Disable GFX PG on CZ
  drm/amdkfd: Update PM4 packet headers
  drm/amdkfd: Clamp EOP queue size correctly on Gfx8
  drm/amdkfd: Add more error printing to help bringup v2
  drm/amdkfd: Handle remaining BUG_ONs more gracefully v2
  drm/amdkfd: Allocate gtt_sa_bitmap in long units
  drm/amdkfd: Fix doorbell initialization and finalization
  drm/amdkfd: Remove BUG_ONs for NULL pointer arguments
  drm/amdkfd: Remove usage of alloc(sizeof(struct...
  drm/amdkfd: Fix goto usage v2
  drm/amdkfd: Change x==NULL/false references to !x
  drm/amdkfd: Consolidate and clean up log commands
  drm/amdkfd: Clean up KFD style errors and warnings v2
  drm/amdgpu: Remove hard-coded assumptions about compute pipes
  ...

6 years agoMerge tag 'sunxi-drm-for-4.14' of https://git.kernel.org/pub/scm/linux/kernel/git...
Dave Airlie [Sun, 20 Aug 2017 23:05:01 +0000 (09:05 +1000)]
Merge tag 'sunxi-drm-for-4.14' of https://git./linux/kernel/git/mripard/linux into drm-next

Allwinner DRM changes for 4.14

A few changes, but most notably improving the HDMI support merged in 4.13,
by reporting the DDC adapter as an i2c bus, and by adding CEC support
through the CEC framework.

* tag 'sunxi-drm-for-4.14' of https://git.kernel.org/pub/scm/linux/kernel/git/mripard/linux:
  sun4i_hdmi: add CEC support
  dt-bindings: display: sunxi: Improve endpoint ID scheme readability
  drm/sun4i: tcon: remove unused function
  drm/sun4i: Remove useless atomic_check
  drm/sun4i: Add if statement instead of depends on
  drm/sun4i: hdmi: Implement I2C adapter for A10s DDC bus
  drm/sun4i: constify drm_plane_helper_funcs

6 years agoMerge branch 'drm-next-4.14' of git://people.freedesktop.org/~agd5f/linux into drm...
Dave Airlie [Sun, 20 Aug 2017 20:22:17 +0000 (06:22 +1000)]
Merge branch 'drm-next-4.14' of git://people.freedesktop.org/~agd5f/linux into drm-next

More changes for 4.14.  Highlights:
- command submission overhead improvements
- Huge page support for vega10
- physical mode support for mjpeg for asics that don't support UVD vm
- improve ttm_mem_type_manager_func debug
- misc ttm fixes, cleanups
- misc gpuvm cleanups

* 'drm-next-4.14' of git://people.freedesktop.org/~agd5f/linux: (26 commits)
  drm/ttm: use reservation_object_trylock in ttm_bo_individualize_resv v2
  drm/amdgpu: fix vega10 graphic hang issue in S3 test
  drm/amdgpu: bump version for support of UVD MJPEG decode
  drm/amdgpu: add MJPEG check for UVD physical mode msg buffer
  drm/ttm: Fix accounting error when fail to get pages for pool
  drm/amd/amdgpu: expose fragment size as module parameter (v2)
  drm/amd/amdgpu: store fragment_size in vm_manager
  drm/amdgpu: rename VM invalidated to moved
  drm/amdgpu: separate bo_va structure
  drm/amdgpu: drop the extra VM huge page flag v2
  drm/amdgpu: remove superflous amdgpu_bo_kmap in the VM
  drm/amdgpu: cleanup static CSA handling
  drm/amdgpu: SHADOW and VRAM_CONTIGUOUS flags shouldn't be used by userspace
  drm/amdgpu: save list length when fence is signaled
  drm/amdgpu: move vram usage tracking into the vram manager v2
  drm/amdgpu: move gtt usage tracking into the gtt manager v2
  drm/amdgpu: move debug print into the MM managers
  drm/amdgpu: fix incorrect use of the lru_lock
  drm/radeon: fix incorrect use of the lru_lock
  drm/ttm: make ttm_mem_type_manager_func debug more useful
  ...

6 years agoMerge tag 'drm-misc-next-2017-08-18' of git://anongit.freedesktop.org/git/drm-misc...
Dave Airlie [Sun, 20 Aug 2017 19:52:26 +0000 (05:52 +1000)]
Merge tag 'drm-misc-next-2017-08-18' of git://anongit.freedesktop.org/git/drm-misc into drm-next

Cross-subsystem Changes:
- Add tinydrm to MAINTAINERS using -misc tree and Noralf as maintainer (Noralf)

Core Changes:
- Finish dumb_mmap_offset cleanup by removing gem_cma_dumb_map_offset() (Noralf)
- Add gem_framebuffer helper to facilitate removal of fb_cma cargo cult (Noralf)

Driver Changes:
- Various trivial patches

Cc: Noralf Trønnes <noralf@tronnes.org>
* tag 'drm-misc-next-2017-08-18' of git://anongit.freedesktop.org/git/drm-misc:
  drm: udl: constify usb_device_id
  drm/gma500: fix potential NULL pointer dereference dereference
  drm/tinydrm: make function st7586_pipe_enable static
  MAINTAINERS: Add drm/tinydrm maintainer entry
  drm/vc4: Use drm_gem_fb_create()
  drm/pl111: Use drm_gem_fb_create() and drm_gem_fb_prepare_fb()
  drm/fb-cma-helper: Use drm_gem_framebuffer_helper
  drm: Add GEM backed framebuffer library

6 years agodrm/ttm: use reservation_object_trylock in ttm_bo_individualize_resv v2
Christian König [Thu, 17 Aug 2017 10:23:51 +0000 (12:23 +0200)]
drm/ttm: use reservation_object_trylock in ttm_bo_individualize_resv v2

Fixes a false positive from might_sleep(). The reservation object is freshly
initialized, so nobody else can hold the mutex but the function is
called from atomic context.

v2: Correctly invert the check as well.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amdgpu: fix vega10 graphic hang issue in S3 test
Ken Wang [Tue, 15 Aug 2017 09:16:08 +0000 (17:16 +0800)]
drm/amdgpu: fix vega10 graphic hang issue in S3 test

mmVGT_INDEX_TYPE has no default value, need to make sure
it's initialized when gfx is initialized.

Signed-off-by: Ken Wang <Ken.Wang@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agoMerge airlied/drm-next into drm-misc-next
Sean Paul [Fri, 18 Aug 2017 14:52:44 +0000 (10:52 -0400)]
Merge airlied/drm-next into drm-misc-next

Archit requested this backmerge to facilitate merging some patches
depending on changes between -rc2 & -rc5

Signed-off-by: Sean Paul <seanpaul@chromium.org>
6 years agodrm: udl: constify usb_device_id
Arvind Yadav [Sat, 12 Aug 2017 08:35:19 +0000 (14:05 +0530)]
drm: udl: constify usb_device_id

usb_device_id are not supposed to change at runtime. All functions
working with usb_device_id provided by <linux/usb.h> work with
const usb_device_id. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/22fa8ca67a6d4a59997f463bf241ed56596fbcfa.1502526524.git.arvind.yadav.cs@gmail.com
6 years agodrm/gma500: fix potential NULL pointer dereference dereference
Gustavo A. R. Silva [Sat, 12 Aug 2017 01:55:15 +0000 (20:55 -0500)]
drm/gma500: fix potential NULL pointer dereference dereference

NULL check at line 528: if (!sender || !data_out || !len_out) {, implies
that pointer _sender_ might be NULL.

Move pointer _sender_ dereference after NULL check in order to avoid a
potential NULL pointer dereference.

This issue was detected with the help of Coccinelle.

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20170812015515.GA8360@embeddedgus
6 years agodrm/amdgpu: bump version for support of UVD MJPEG decode
Leo Liu [Wed, 16 Aug 2017 14:18:28 +0000 (10:18 -0400)]
drm/amdgpu: bump version for support of UVD MJPEG decode

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amdgpu: add MJPEG check for UVD physical mode msg buffer
Leo Liu [Tue, 15 Aug 2017 14:57:34 +0000 (10:57 -0400)]
drm/amdgpu: add MJPEG check for UVD physical mode msg buffer

Signed-off-by: Leo Liu <leo.liu@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>
6 years agodrm/ttm: Fix accounting error when fail to get pages for pool
Xiangliang.Yu [Wed, 16 Aug 2017 06:25:51 +0000 (14:25 +0800)]
drm/ttm: Fix accounting error when fail to get pages for pool

When fail to get needed page for pool, need to put allocated pages
into pool. But current code has a miscalculation of allocated pages,
correct it.

Signed-off-by: Xiangliang.Yu <Xiangliang.Yu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Monk Liu <monk.liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
6 years agodrm/amd/amdgpu: expose fragment size as module parameter (v2)
Roger He [Tue, 15 Aug 2017 08:05:59 +0000 (16:05 +0800)]
drm/amd/amdgpu: expose fragment size as module parameter (v2)

Allow overrides on the command line.

v2: agd: sqaush in spelling fix and bogus default value warning

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Roger He <Hongbo.He@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/amdgpu: store fragment_size in vm_manager
Roger He [Fri, 11 Aug 2017 12:00:41 +0000 (20:00 +0800)]
drm/amd/amdgpu: store fragment_size in vm_manager

adds fragment_size in the vm_manager structure and
implements hardware setup for it.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Roger He <Hongbo.He@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amdgpu: rename VM invalidated to moved
Christian König [Tue, 1 Aug 2017 09:27:36 +0000 (11:27 +0200)]
drm/amdgpu: rename VM invalidated to moved

That better describes what happens here with the BO.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amdgpu: separate bo_va structure
Christian König [Tue, 1 Aug 2017 08:51:43 +0000 (10:51 +0200)]
drm/amdgpu: separate bo_va structure

Split that into vm_bo_base and bo_va to allow other uses as well.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amdgpu: drop the extra VM huge page flag v2
Christian König [Thu, 3 Aug 2017 18:30:50 +0000 (20:30 +0200)]
drm/amdgpu: drop the extra VM huge page flag v2

Just add the flags to the addr field as well.

v2: add some more comments that the flag is for huge pages.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amdgpu: remove superflous amdgpu_bo_kmap in the VM
Christian König [Thu, 3 Aug 2017 17:24:06 +0000 (19:24 +0200)]
drm/amdgpu: remove superflous amdgpu_bo_kmap in the VM

We now properly kmap all BOs after validation.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amdgpu: cleanup static CSA handling
Christian König [Mon, 31 Jul 2017 13:32:40 +0000 (15:32 +0200)]
drm/amdgpu: cleanup static CSA handling

Move the CSA bo_va from the VM to the fpriv structure.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amdgpu: SHADOW and VRAM_CONTIGUOUS flags shouldn't be used by userspace
Christian König [Wed, 9 Aug 2017 13:33:49 +0000 (15:33 +0200)]
drm/amdgpu: SHADOW and VRAM_CONTIGUOUS flags shouldn't be used by userspace

The shadow handling isn't implemented completely for userspace BOs and
the kernel sets the VRAM_CONTIGUOUS as necessary.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amdgpu: save list length when fence is signaled
Chunming Zhou [Fri, 11 Aug 2017 01:34:33 +0000 (09:34 +0800)]
drm/amdgpu: save list length when fence is signaled

update the list first to avoid redundant checks.

Signed-off-by: Chunming Zhou <David1.Zhou@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
6 years agodrm/amdgpu: move vram usage tracking into the vram manager v2
Christian König [Mon, 7 Aug 2017 15:46:49 +0000 (17:46 +0200)]
drm/amdgpu: move vram usage tracking into the vram manager v2

Looks like a better place for this.

v2: use atomic64_t members instead

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amdgpu: move gtt usage tracking into the gtt manager v2
Christian König [Mon, 7 Aug 2017 15:11:33 +0000 (17:11 +0200)]
drm/amdgpu: move gtt usage tracking into the gtt manager v2

It doesn't make much sense to count those numbers twice.

v2: use and atomic64_t instead

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amdgpu: move debug print into the MM managers
Christian König [Mon, 7 Aug 2017 13:47:51 +0000 (15:47 +0200)]
drm/amdgpu: move debug print into the MM managers

Instead of the separate switch/case in the calling function.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amdgpu: fix incorrect use of the lru_lock
Christian König [Mon, 7 Aug 2017 12:07:43 +0000 (14:07 +0200)]
drm/amdgpu: fix incorrect use of the lru_lock

The BO manager has its own lock and doesn't use the lru_lock.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/radeon: fix incorrect use of the lru_lock
Christian König [Mon, 7 Aug 2017 12:03:54 +0000 (14:03 +0200)]
drm/radeon: fix incorrect use of the lru_lock

The BO manager has its own lock and doesn't use the lru_lock.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/ttm: make ttm_mem_type_manager_func debug more useful
Christian König [Mon, 7 Aug 2017 09:13:41 +0000 (11:13 +0200)]
drm/ttm: make ttm_mem_type_manager_func debug more useful

Provide the drm printer directly instead of just the callback.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/amdgpu: Add tracepoint for DMA page mapping (v4)
Tom St Denis [Mon, 31 Jul 2017 13:35:24 +0000 (09:35 -0400)]
drm/amd/amdgpu: Add tracepoint for DMA page mapping (v4)

This helps map DMA addresses back to physical addresses.

Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(v2):  Added tracepoints for USERPTR, SG mappings, and
     SWIOTBL mappings.  Reformatted trace call perform
     PCI decoding internal to the trace.

(v3):  Add unmap tracepoints as well

(v4):  Move traces into separate functions

6 years agodrm/amdgpu: fix Vega10 HW config for 2MB pages
Christian König [Sat, 29 Jul 2017 11:28:55 +0000 (13:28 +0200)]
drm/amdgpu: fix Vega10 HW config for 2MB pages

Those values weren't correct. This should result in quite some speedup.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Acked-by: Chunming Zhou <david1.zhou@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amdgpu: only bind VM shadows after validation v2
Christian König [Thu, 13 Jul 2017 10:51:31 +0000 (12:51 +0200)]
drm/amdgpu: only bind VM shadows after validation v2

No need to do this on every CS.

v2: remove all other bind, reorder code

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Acked-by: Chunming Zhou <david1.zhou@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amdgpu: only move VM BOs in the LRU during validation v2
Christian König [Thu, 3 Aug 2017 15:44:01 +0000 (11:44 -0400)]
drm/amdgpu: only move VM BOs in the LRU during validation v2

This should save us a bunch of command submission overhead.

v2: move the LRU move to the right place to avoid the move for the root BO
    and handle the shadow BOs as well. This turned out to be a bug fix because
    the move needs to happen before the kmap.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Acked-by: Chunming Zhou <david1.zhou@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/ttm: individualize BO reservation obj when they are freed
Christian König [Thu, 20 Jul 2017 18:55:06 +0000 (20:55 +0200)]
drm/ttm: individualize BO reservation obj when they are freed

Use the BOs reservation object when it is put on the ddelete list. This way we
avoid delaying freeing up the BO because of new fences on the reservation object.

This is used by dma-buf and amdgpu's VM page tables.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/ttm: remove nonsense wait in ttm_bo_cleanup_refs_and_unlock
Christian König [Wed, 26 Jul 2017 12:59:10 +0000 (14:59 +0200)]
drm/ttm: remove nonsense wait in ttm_bo_cleanup_refs_and_unlock

With shared reservation objects the assumption that no fence
could have been added isn't true any more.

Additional to that the BO is about to be destroyed, so removing the
fences now has no advantage whatsoever.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agoMerge tag 'omapdrm-4.14' of git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux...
Dave Airlie [Thu, 17 Aug 2017 19:41:32 +0000 (05:41 +1000)]
Merge tag 'omapdrm-4.14' of git://git./linux/kernel/git/tomba/linux into drm-next

omapdrm changes for v4.14

* HDMI hot plug IRQ support (instead of polling)
* Big driver cleanup from Laurent (no functional changes)
* OMAP5 DSI support (only the pinmuxing was missing)

* tag 'omapdrm-4.14' of git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux: (60 commits)
  drm/omap: Potential NULL deref in omap_crtc_duplicate_state()
  drm/omap: remove no-op cleanup code
  drm/omap: rename omapdrm device back
  drm: omapdrm: Remove omapdrm platform data
  ARM: OMAP2+: Don't register omapdss device for omapdrm
  ARM: OMAP2+: Remove unused omapdrm platform device
  drm: omapdrm: Remove the omapdss driver
  drm: omapdrm: Register omapdrm platform device in omapdss driver
  drm: omapdrm: hdmi: Don't allocate PHY features dynamically
  drm: omapdrm: hdmi: Configure the PHY from the HDMI core version
  drm: omapdrm: hdmi: Configure the PLL from the HDMI core version
  drm: omapdrm: hdmi: Pass HDMI core version as integer to HDMI audio
  drm: omapdrm: hdmi: Replace OMAP SoC model check with HDMI xmit version
  drm: omapdrm: hdmi: Rename functions and structures to use hdmi_ prefix
  drm/omap: add OMAP5 DSIPHY lane-enable support
  drm/omap: use regmap_update_bit() when muxing DSI pads
  drm: omapdrm: Remove dss_features.h
  drm: omapdrm: Move supported outputs feature to dss driver
  drm: omapdrm: Move DSS_FCK feature to dss driver
  drm: omapdrm: Move PCD, LINEWIDTH and DOWNSCALE features to dispc driver
  ...

6 years agoMerge branch 'drm-next-4.14' of git://people.freedesktop.org/~agd5f/linux into drm...
Dave Airlie [Thu, 17 Aug 2017 19:30:53 +0000 (05:30 +1000)]
Merge branch 'drm-next-4.14' of git://people.freedesktop.org/~agd5f/linux into drm-next

More features for 4.14.  Nothing too major here.  I have a few more additional
patches for large page support in vega10 among other things, but they require
some resevation object patches from drm-misc-next, so I'll send that request
once you've pulled the latest drm-misc-next.  Highlights:
- Fixes for ACP audio on stoney
- SR-IOV fixes for vega10
- various powerplay fixes
- lots of code clean up

* 'drm-next-4.14' of git://people.freedesktop.org/~agd5f/linux: (62 commits)
  drm/amdgpu/gfx7: fix function name
  drm/amd/amdgpu: Disabling Power Gating for Stoney platform
  drm/amd/amdgpu: Added a quirk for Stoney platform
  drm/amdgpu: jt_size was wrongly counted twice
  drm/amdgpu: fix missing endian-safe guard
  drm/amdgpu: ignore digest_size when loading sdma fw for raven
  drm/amdgpu: Uninitialized variable in amdgpu_ttm_backend_bind()
  drm/amd/powerplay: fix coding style in hwmgr.c
  drm/amd/powerplay: refine dmesg info under powerplay.
  drm/amdgpu: don't finish the ring if not initialized
  drm/radeon: Fix preferred typo
  drm/amdgpu: Fix preferred typo
  drm/radeon: Fix stolen typo
  drm/amdgpu: Fix stolen typo
  drm/amd/powerplay: fix coccinelle warnings in vega10_hwmgr.c
  drm/amdgpu: set gfx_v9_0_ip_funcs as static
  drm/radeon: switch to drm_*{get,put} helpers
  drm/amdgpu: switch to drm_*{get,put} helpers
  drm/amd/powerplay: add CZ profile support
  drm/amd/powerplay: fix PSI not enabled by kmd
  ...

6 years agoMerge tag 'drm-misc-next-2017-08-16' of git://anongit.freedesktop.org/git/drm-misc...
Dave Airlie [Wed, 16 Aug 2017 21:33:41 +0000 (07:33 +1000)]
Merge tag 'drm-misc-next-2017-08-16' of git://anongit.freedesktop.org/git/drm-misc into drm-next

UAPI Changes:
- vc4: Allow userspace to dictate rendering order in submit_cl ioctl (Eric)

Cross-subsystem Changes:
- vboxvideo: One of Cihangir's patches applies to vboxvideo which is maintained
     in staging

Core Changes:
- atomic_legacy_backoff is officially killed (Daniel)
- Extract drm_device.h (Daniel)
- Unregister drm device on unplug (Daniel)
- Rename deprecated drm_*_(un)?reference functions to drm_*_{get|put} (Cihangir)

Driver Changes:
- vc4: Error/destroy path cleanups, log level demotion, edid leak (Eric)
- various: Make various drm_*_funcs structs const (Bhumika)
- tinydrm: add support for LEGO MINDSTORMS EV3 LCD (David)
- various: Second half of .dumb_{map_offset|destroy} defaults set (Noralf)

Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Eric Anholt <eric@anholt.net>
Cc: Bhumika Goyal <bhumirks@gmail.com>
Cc: Cihangir Akturk <cakturk@gmail.com>
Cc: David Lechner <david@lechnology.com>
Cc: Noralf Trønnes <noralf@tronnes.org>
* tag 'drm-misc-next-2017-08-16' of git://anongit.freedesktop.org/git/drm-misc: (50 commits)
  drm/gem-cma-helper: Remove drm_gem_cma_dumb_map_offset()
  drm/virtio: Use the drm_driver.dumb_destroy default
  drm/bochs: Use the drm_driver.dumb_destroy default
  drm/mgag200: Use the drm_driver.dumb_destroy default
  drm/exynos: Use .dumb_map_offset and .dumb_destroy defaults
  drm/msm: Use the drm_driver.dumb_destroy default
  drm/ast: Use the drm_driver.dumb_destroy default
  drm/qxl: Use the drm_driver.dumb_destroy default
  drm/udl: Use the drm_driver.dumb_destroy default
  drm/cirrus: Use the drm_driver.dumb_destroy default
  drm/tegra: Use .dumb_map_offset and .dumb_destroy defaults
  drm/gma500: Use .dumb_map_offset and .dumb_destroy defaults
  drm/mxsfb: Use .dumb_map_offset and .dumb_destroy defaults
  drm/meson: Use .dumb_map_offset and .dumb_destroy defaults
  drm/kirin: Use .dumb_map_offset and .dumb_destroy defaults
  drm/vc4: Continue the switch to drm_*_put() helpers
  drm/vc4: Fix leak of HDMI EDID
  dma-buf: fix reservation_object_wait_timeout_rcu to wait correctly v2
  dma-buf: add reservation_object_copy_fences (v2)
  drm/tinydrm: add support for LEGO MINDSTORMS EV3 LCD
  ...

6 years agodrm/tinydrm: make function st7586_pipe_enable static
Colin Ian King [Wed, 16 Aug 2017 09:23:06 +0000 (10:23 +0100)]
drm/tinydrm: make function st7586_pipe_enable static

The function st7586_pipe_enable  is local to the source
and does not need to be in global scope, so make it static.

Cleans up sparse warning:
symbol 'st7586_pipe_enable' was not declared. Should it be static?

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-By: David Lechner <david@lechnology.com>
[noralf: fixed: Alignment should match open parenthesis]
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20170816092306.10969-1-colin.king@canonical.com
6 years agoMAINTAINERS: Add drm/tinydrm maintainer entry
Noralf Trønnes [Sun, 13 Aug 2017 17:36:30 +0000 (19:36 +0200)]
MAINTAINERS: Add drm/tinydrm maintainer entry

Add myself as drivers/gpu/drm/tinydrm maintainer.

Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/1502645790-14944-1-git-send-email-noralf@tronnes.org
6 years agodrm/vc4: Use drm_gem_fb_create()
Noralf Trønnes [Sun, 13 Aug 2017 13:32:03 +0000 (15:32 +0200)]
drm/vc4: Use drm_gem_fb_create()

drm_fb_cma_create() is just a wrapper around drm_gem_fb_create() now,
so use the function directly.

Cc: Eric Anholt <eric@anholt.net>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Link: https://patchwork.freedesktop.org/patch/msgid/1502631125-13557-21-git-send-email-noralf@tronnes.org
6 years agodrm/pl111: Use drm_gem_fb_create() and drm_gem_fb_prepare_fb()
Noralf Trønnes [Sun, 13 Aug 2017 13:31:56 +0000 (15:31 +0200)]
drm/pl111: Use drm_gem_fb_create() and drm_gem_fb_prepare_fb()

drm_fb_cma_create() and drm_fb_cma_prepare_fb() are just wrappers now,
use drm_gem_fb_create() and drm_gem_fb_prepare_fb() directly.

Cc: Eric Anholt <eric@anholt.net>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Link: https://patchwork.freedesktop.org/patch/msgid/1502631125-13557-14-git-send-email-noralf@tronnes.org
6 years agodrm/fb-cma-helper: Use drm_gem_framebuffer_helper
Noralf Trønnes [Sun, 13 Aug 2017 13:31:45 +0000 (15:31 +0200)]
drm/fb-cma-helper: Use drm_gem_framebuffer_helper

Use the new drm_gem_framebuffer_helper who's code was copied
from this helper.

Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Link: https://patchwork.freedesktop.org/patch/msgid/1502631125-13557-3-git-send-email-noralf@tronnes.org
6 years agodrm: Add GEM backed framebuffer library
Noralf Trønnes [Sun, 13 Aug 2017 13:31:44 +0000 (15:31 +0200)]
drm: Add GEM backed framebuffer library

This library provides helpers for drivers that don't subclass
drm_framebuffer and are backed by drm_gem_object. The code is
taken from drm_fb_cma_helper.

Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Eric Anholt <eric@anholt.net>
Link: https://patchwork.freedesktop.org/patch/msgid/1502631125-13557-2-git-send-email-noralf@tronnes.org
6 years agodrm/gem-cma-helper: Remove drm_gem_cma_dumb_map_offset()
Noralf Trønnes [Sun, 6 Aug 2017 15:41:08 +0000 (17:41 +0200)]
drm/gem-cma-helper: Remove drm_gem_cma_dumb_map_offset()

There are no more users of drm_gem_cma_dumb_map_offset(), so remove it.

Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/1502034068-51384-20-git-send-email-noralf@tronnes.org
6 years agodrm/virtio: Use the drm_driver.dumb_destroy default
Noralf Trønnes [Sun, 6 Aug 2017 15:41:07 +0000 (17:41 +0200)]
drm/virtio: Use the drm_driver.dumb_destroy default

virtio_gpu_mode_dumb_destroy() is the same as drm_gem_dumb_destroy()
which is the drm_driver.dumb_destroy default, so no need to set it.

Cc: David Airlie <airlied@linux.ie>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/1502034068-51384-19-git-send-email-noralf@tronnes.org
6 years agodrm/bochs: Use the drm_driver.dumb_destroy default
Noralf Trønnes [Sun, 6 Aug 2017 15:41:05 +0000 (17:41 +0200)]
drm/bochs: Use the drm_driver.dumb_destroy default

drm_gem_dumb_destroy() is the drm_driver.dumb_destroy default,
so no need to set it.

Cc: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/1502034068-51384-17-git-send-email-noralf@tronnes.org
6 years agodrm/mgag200: Use the drm_driver.dumb_destroy default
Noralf Trønnes [Sun, 6 Aug 2017 15:41:03 +0000 (17:41 +0200)]
drm/mgag200: Use the drm_driver.dumb_destroy default

drm_gem_dumb_destroy() is the drm_driver.dumb_destroy default,
so no need to set it.

Cc: Dave Airlie <airlied@redhat.com>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/1502034068-51384-15-git-send-email-noralf@tronnes.org
6 years agodrm/exynos: Use .dumb_map_offset and .dumb_destroy defaults
Noralf Trønnes [Sun, 6 Aug 2017 15:41:02 +0000 (17:41 +0200)]
drm/exynos: Use .dumb_map_offset and .dumb_destroy defaults

This driver can use the drm_driver.dumb_destroy and
drm_driver.dumb_map_offset defaults, so no need to set them.
Use drm_gem_dumb_map_offset() in exynos_drm_gem_map_ioctl() and
remove exynos_drm_gem_dumb_map_offset().

Cc: Joonyoung Shim <jy0922.shim@samsung.com>
Cc: Seung-Woo Kim <sw0312.kim@samsung.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/1502034068-51384-14-git-send-email-noralf@tronnes.org
6 years agodrm/msm: Use the drm_driver.dumb_destroy default
Noralf Trønnes [Sun, 6 Aug 2017 15:41:01 +0000 (17:41 +0200)]
drm/msm: Use the drm_driver.dumb_destroy default

drm_gem_dumb_destroy() is the drm_driver.dumb_destroy default,
so no need to set it.

Cc: Rob Clark <robdclark@gmail.com>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/1502034068-51384-13-git-send-email-noralf@tronnes.org
6 years agodrm/ast: Use the drm_driver.dumb_destroy default
Noralf Trønnes [Sun, 6 Aug 2017 15:40:59 +0000 (17:40 +0200)]
drm/ast: Use the drm_driver.dumb_destroy default

drm_gem_dumb_destroy() is the drm_driver.dumb_destroy default,
so no need to set it.

Cc: Dave Airlie <airlied@redhat.com>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/1502034068-51384-11-git-send-email-noralf@tronnes.org
6 years agodrm/qxl: Use the drm_driver.dumb_destroy default
Noralf Trønnes [Sun, 6 Aug 2017 15:40:58 +0000 (17:40 +0200)]
drm/qxl: Use the drm_driver.dumb_destroy default

drm_gem_dumb_destroy() is the drm_driver.dumb_destroy default,
so no need to set it.

Cc: Dave Airlie <airlied@redhat.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/1502034068-51384-10-git-send-email-noralf@tronnes.org
6 years agodrm/udl: Use the drm_driver.dumb_destroy default
Noralf Trønnes [Sun, 6 Aug 2017 15:40:57 +0000 (17:40 +0200)]
drm/udl: Use the drm_driver.dumb_destroy default

drm_gem_dumb_destroy() is the drm_driver.dumb_destroy default,
so no need to set it.

Cc: Dave Airlie <airlied@redhat.com>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/1502034068-51384-9-git-send-email-noralf@tronnes.org
6 years agodrm/cirrus: Use the drm_driver.dumb_destroy default
Noralf Trønnes [Sun, 6 Aug 2017 15:40:56 +0000 (17:40 +0200)]
drm/cirrus: Use the drm_driver.dumb_destroy default

drm_gem_dumb_destroy() is the drm_driver.dumb_destroy default,
so no need to set it.

Cc: Dave Airlie <airlied@redhat.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/1502034068-51384-8-git-send-email-noralf@tronnes.org
6 years agodrm/tegra: Use .dumb_map_offset and .dumb_destroy defaults
Noralf Trønnes [Sun, 6 Aug 2017 15:40:55 +0000 (17:40 +0200)]
drm/tegra: Use .dumb_map_offset and .dumb_destroy defaults

This driver can use the drm_driver.dumb_destroy and
drm_driver.dumb_map_offset defaults, so no need to set them.

Cc: Thierry Reding <thierry.reding@gmail.com>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/1502034068-51384-7-git-send-email-noralf@tronnes.org
6 years agodrm/gma500: Use .dumb_map_offset and .dumb_destroy defaults
Noralf Trønnes [Sun, 6 Aug 2017 15:40:54 +0000 (17:40 +0200)]
drm/gma500: Use .dumb_map_offset and .dumb_destroy defaults

This driver can use the drm_driver.dumb_destroy and
drm_driver.dumb_map_offset defaults, so no need to set them.

Cc: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/1502034068-51384-6-git-send-email-noralf@tronnes.org
6 years agodrm/mxsfb: Use .dumb_map_offset and .dumb_destroy defaults
Noralf Trønnes [Sun, 6 Aug 2017 15:40:52 +0000 (17:40 +0200)]
drm/mxsfb: Use .dumb_map_offset and .dumb_destroy defaults

This driver can use the drm_driver.dumb_destroy and
drm_driver.dumb_map_offset defaults, so no need to set them.

Cc: Marek Vasut <marex@denx.de>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/1502034068-51384-4-git-send-email-noralf@tronnes.org
6 years agodrm/meson: Use .dumb_map_offset and .dumb_destroy defaults
Noralf Trønnes [Sun, 6 Aug 2017 15:40:51 +0000 (17:40 +0200)]
drm/meson: Use .dumb_map_offset and .dumb_destroy defaults

This driver can use the drm_driver.dumb_destroy and
drm_driver.dumb_map_offset defaults, so no need to set them.

Cc: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/1502034068-51384-3-git-send-email-noralf@tronnes.org
6 years agodrm/kirin: Use .dumb_map_offset and .dumb_destroy defaults
Noralf Trønnes [Sun, 6 Aug 2017 15:40:50 +0000 (17:40 +0200)]
drm/kirin: Use .dumb_map_offset and .dumb_destroy defaults

This driver can use the drm_driver.dumb_destroy and
drm_driver.dumb_map_offset defaults, so no need to set them.

Cc: Xinliang Liu <z.liuxinliang@hisilicon.com>
Cc: Rongrong Zou <zourongrong@gmail.com>
Cc: Xinwei Kong <kong.kongxinwei@hisilicon.com>
Cc: Chen Feng <puck.chen@hisilicon.com>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/1502034068-51384-2-git-send-email-noralf@tronnes.org
6 years agodrm/omap: Potential NULL deref in omap_crtc_duplicate_state()
Dan Carpenter [Fri, 11 Aug 2017 20:16:06 +0000 (23:16 +0300)]
drm/omap: Potential NULL deref in omap_crtc_duplicate_state()

If the kmalloc() fails then we dereference "state" when we set
"state->zpos".

Fixes: 3dfeb631a15d ("drm/omap: Rework the rotation-on-crtc hack")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
6 years agodrm/omap: remove no-op cleanup code
Tomi Valkeinen [Tue, 15 Aug 2017 13:04:20 +0000 (16:04 +0300)]
drm/omap: remove no-op cleanup code

The driver sets crtc and plane rotation properties back to 0 degrees in
dev_lastclose() using drm_object_property_set_value().
drm_object_property_set_value() doesn't do anything with atomic drivers,
and a recent change added WARN_ON() when atomic driver calls the
function.

So remove the code.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
6 years agodrm/omap: rename omapdrm device back
Tomi Valkeinen [Wed, 16 Aug 2017 09:43:55 +0000 (12:43 +0300)]
drm/omap: rename omapdrm device back

Now that creating the omapdrm device from the platform code has been
removed, we can rename the omapdrm device back to "omapdrm".

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
6 years agodrm: omapdrm: Remove omapdrm platform data
Laurent Pinchart [Fri, 11 Aug 2017 13:49:12 +0000 (16:49 +0300)]
drm: omapdrm: Remove omapdrm platform data

The omapdrm platform data are not used anymore, remove them.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
6 years agoARM: OMAP2+: Don't register omapdss device for omapdrm
Laurent Pinchart [Fri, 11 Aug 2017 13:49:11 +0000 (16:49 +0300)]
ARM: OMAP2+: Don't register omapdss device for omapdrm

The omapdrm driver doesn't need the omapdss device anymore. Although it
can't be removed completely as the fbdev driver still requires it, we
can condition its registration to the usage of the omapfb driver.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
6 years agoARM: OMAP2+: Remove unused omapdrm platform device
Laurent Pinchart [Fri, 11 Aug 2017 13:49:10 +0000 (16:49 +0300)]
ARM: OMAP2+: Remove unused omapdrm platform device

The omapdrm platform device is unused, as a replacement is now
registered in the omapdss driver. Remove it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
6 years agodrm: omapdrm: Remove the omapdss driver
Laurent Pinchart [Fri, 11 Aug 2017 13:49:09 +0000 (16:49 +0300)]
drm: omapdrm: Remove the omapdss driver

The omapdss driver (not to be confused with the omapdss_dss driver) is
now a dummy driver with empty probe and remove functions. Remove it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
6 years agodrm: omapdrm: Register omapdrm platform device in omapdss driver
Laurent Pinchart [Fri, 11 Aug 2017 13:49:08 +0000 (16:49 +0300)]
drm: omapdrm: Register omapdrm platform device in omapdss driver

The omapdrm platform device is a virtual device created for the sole
purpose of handling the omapdss/omapdrm driver split. It should
eventually be removed. As a first step to ease refactoring move its
registration from platform code to driver code.

The omapdrm driver name must be changed internally to avoid probing both
the device registered in platform code and the device registered in the
omapdss driver, as that would otherwise break bisection.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
6 years agodrm: omapdrm: hdmi: Don't allocate PHY features dynamically
Laurent Pinchart [Fri, 11 Aug 2017 13:49:07 +0000 (16:49 +0300)]
drm: omapdrm: hdmi: Don't allocate PHY features dynamically

There's no need to allocate memory dynamically to duplicate the contents
of a const structure, only to store the memory pointer in a const
pointer field. Just use the original structures directly.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
6 years agodrm: omapdrm: hdmi: Configure the PHY from the HDMI core version
Laurent Pinchart [Fri, 11 Aug 2017 13:49:06 +0000 (16:49 +0300)]
drm: omapdrm: hdmi: Configure the PHY from the HDMI core version

The OMAP4 and OMAP5 HDMI PHYs have different properties that require
specific handling in the HDMI PHY driver. This needs knowledge of the
PHY version, which is currently inferred from the DSS version. As part
of the effort to remove usage of the DSS version, use the HDMI
controller version instead.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
6 years agodrm: omapdrm: hdmi: Configure the PLL from the HDMI core version
Laurent Pinchart [Fri, 11 Aug 2017 13:49:05 +0000 (16:49 +0300)]
drm: omapdrm: hdmi: Configure the PLL from the HDMI core version

The OMAP4 and OMAP5 PLLs have different properties that require specific
handling in the HDMI PLL driver. This needs knowledge of the PLL
version, which is currently inferred from the DSS version. AS part of
the effort to remove usage of the DSS version, use the HDMI controller
version instead.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
6 years agodrm: omapdrm: hdmi: Pass HDMI core version as integer to HDMI audio
Laurent Pinchart [Fri, 11 Aug 2017 13:49:04 +0000 (16:49 +0300)]
drm: omapdrm: hdmi: Pass HDMI core version as integer to HDMI audio

The HDMI audio driver only needs to know which generation of HDMI
transmitter it deals with, not the detailed SoC model. Pass the version
number as an integer to prepare for removal of the OMAP SoC version from
the omapdrm driver.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Mark Brown <broonie@kernel.org>
Acked-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
6 years agodrm: omapdrm: hdmi: Replace OMAP SoC model check with HDMI xmit version
Laurent Pinchart [Fri, 11 Aug 2017 13:49:03 +0000 (16:49 +0300)]
drm: omapdrm: hdmi: Replace OMAP SoC model check with HDMI xmit version

The HDMI wrapper code only needs to differentiate between major OMAP
revisions, which can be obtained from the HDMI transmitter compatible
string. Replace the OMAP SoC model checks to prepare for removal of the
OMAP SoC version platform data.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
6 years agodrm: omapdrm: hdmi: Rename functions and structures to use hdmi_ prefix
Laurent Pinchart [Fri, 11 Aug 2017 13:49:02 +0000 (16:49 +0300)]
drm: omapdrm: hdmi: Rename functions and structures to use hdmi_ prefix

The dsi_pll_ops structure and dsi_init_pll_data() function incorrectly
use a dsi_ prefix, likely due to copy & paste. Fix it by using the
correct hdmi_ prefix.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
6 years agodrm/omap: add OMAP5 DSIPHY lane-enable support
Tomi Valkeinen [Thu, 10 Aug 2017 06:33:07 +0000 (09:33 +0300)]
drm/omap: add OMAP5 DSIPHY lane-enable support

We are missing OMAP5 DSIPHY lane-enable support, which has prevented
OMAP5 DSI working in mainline. This patch adds the lane-enable similarly
to the recently added OMAP4 version.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
6 years agodrm/omap: use regmap_update_bit() when muxing DSI pads
Tomi Valkeinen [Thu, 10 Aug 2017 12:11:03 +0000 (15:11 +0300)]
drm/omap: use regmap_update_bit() when muxing DSI pads

Use regmap_update_bits instead of regmap_read/write, which simplifies
the code.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
6 years agodrm/amdkfd: Implement image tiling mode support v2
Yong Zhao [Wed, 16 Aug 2017 03:00:22 +0000 (23:00 -0400)]
drm/amdkfd: Implement image tiling mode support v2

v2: Removed hole in ioctl number space

Signed-off-by: Yong Zhao <yong.zhao@amd.com>
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Reviewed-by: Oded Gabbay <oded.gabbay@gmail.com>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
6 years agodrm/amdgpu: Add kgd kfd interface get_tile_config() v2
Yong Zhao [Wed, 16 Aug 2017 03:00:21 +0000 (23:00 -0400)]
drm/amdgpu: Add kgd kfd interface get_tile_config() v2

v2:
* Removed amdgpu_amdkfd prefix from static functions
* Documented get_tile_config in kgd_kfd_interface.h

Signed-off-by: Yong Zhao <yong.zhao@amd.com>
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Acked-by: Oded Gabbay <oded.gabbay@gmail.com>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
6 years agodrm/amdkfd: Adding new IOCTL for scratch memory v2
Moses Reuben [Wed, 16 Aug 2017 03:00:20 +0000 (23:00 -0400)]
drm/amdkfd: Adding new IOCTL for scratch memory v2

v2:
* Renamed ALLOC_MEMORY_OF_SCRATCH to SET_SCRATCH_BACKING_VA
* Removed size parameter from the ioctl, it was unused
* Removed hole in ioctl number space
* No more call to write_config_static_mem
* Return correct error code from ioctl

Signed-off-by: Moses Reuben <moses.reuben@amd.com>
Signed-off-by: Ben Goz <ben.goz@amd.com>
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
6 years agodrm/amdgpu: Add kgd/kfd interface to support scratch memory v2
Moses Reuben [Wed, 16 Aug 2017 03:00:19 +0000 (23:00 -0400)]
drm/amdgpu: Add kgd/kfd interface to support scratch memory v2

v2:
* Shortened headline
* Removed write_config_static_mem, it gets initialized by gfx_v?_0_gpu_init
* Renamed alloc_memory_of_scratch to set_scratch_backing_va
* Made set_scratch_backing_va a void function
* Documented set_scratch_backing in kgd_kfd_interface.h

Signed-off-by: Moses Reuben <moses.reuben@amd.com>
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
6 years agodrm/amdgpu: Program SH_STATIC_MEM_CONFIG globally, not per-VMID
Felix Kuehling [Wed, 16 Aug 2017 03:00:18 +0000 (23:00 -0400)]
drm/amdgpu: Program SH_STATIC_MEM_CONFIG globally, not per-VMID

This register only has a single instance in the hardware. Its value
applies to all VMIDS.

Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
6 years agodrm/amd: Update MEC HQD loading code for KFD
Felix Kuehling [Wed, 16 Aug 2017 03:00:17 +0000 (23:00 -0400)]
drm/amd: Update MEC HQD loading code for KFD

Various bug fixes and improvements that accumulated over the last two
years.

Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Acked-by: Oded Gabbay <oded.gabbay@gmail.com>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
6 years agodrm/amdgpu: Disable GFX PG on CZ
Felix Kuehling [Wed, 16 Aug 2017 03:00:16 +0000 (23:00 -0400)]
drm/amdgpu: Disable GFX PG on CZ

It's causing problems with user mode queues and the HIQ, and can
lead to hard hangs during boot after programming RLC_CP_SCHEDULERS.

Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
6 years agodrm/amdkfd: Update PM4 packet headers
Felix Kuehling [Wed, 16 Aug 2017 03:00:15 +0000 (23:00 -0400)]
drm/amdkfd: Update PM4 packet headers

To match current firmware. The map process packet has been extended
to support scratch. This is a non-backwards compatible change and
it's about two years old. So no point keeping the old version around
conditionally.

Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Reviewed-by: Oded Gabbay <oded.gabbay@gmail.com>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
6 years agodrm/amdkfd: Clamp EOP queue size correctly on Gfx8
Jay Cornwall [Wed, 16 Aug 2017 03:00:14 +0000 (23:00 -0400)]
drm/amdkfd: Clamp EOP queue size correctly on Gfx8

Gfx8 HW incorrectly clamps CP_HQD_EOP_CONTROL.EOP_SIZE, which can
lead to scheduling deadlock due to SE EOP done counter overflow.

Enforce a EOP queue size limit which prevents the CP from sending
more than 0xFF events at a time.

Signed-off-by: Jay Cornwall <Jay.Cornwall@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Acked-by: Oded Gabbay <oded.gabbay@gmail.com>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
6 years agodrm/amdkfd: Add more error printing to help bringup v2
Yong Zhao [Wed, 16 Aug 2017 03:00:13 +0000 (23:00 -0400)]
drm/amdkfd: Add more error printing to help bringup v2

v2: Turned WARN into dev_warn and made the message more helpful

Signed-off-by: Yong Zhao <Yong.Zhao@amd.com>
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
6 years agodrm/amdkfd: Handle remaining BUG_ONs more gracefully v2
Felix Kuehling [Wed, 16 Aug 2017 03:00:12 +0000 (23:00 -0400)]
drm/amdkfd: Handle remaining BUG_ONs more gracefully v2

In most cases, BUG_ONs can be replaced with WARN_ON with an error
return. In some void functions just turn them into a WARN_ON and
possibly an early exit.

v2:
* Cleaned up error handling in pm_send_unmap_queue
* Removed redundant WARN_ON in kfd_process_destroy_delayed

Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
6 years agodrm/amdkfd: Allocate gtt_sa_bitmap in long units
Felix Kuehling [Wed, 16 Aug 2017 03:00:11 +0000 (23:00 -0400)]
drm/amdkfd: Allocate gtt_sa_bitmap in long units

gtt_sa_bitmap is accessed by bitmap functions, which operate on longs.
Therefore the array should be allocated in long units. Also round up
in case the number of bits is not a multiple of BITS_PER_LONG.

Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Reviewed-by: Oded Gabbay <oded.gabbay@gmail.com>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
6 years agodrm/amdkfd: Fix doorbell initialization and finalization
Felix Kuehling [Wed, 16 Aug 2017 03:00:10 +0000 (23:00 -0400)]
drm/amdkfd: Fix doorbell initialization and finalization

Handle errors in doorbell aperture initialization instead of BUG_ON.
iounmap doorbell aperture during finalization.

Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Reviewed-by: Oded Gabbay <oded.gabbay@gmail.com>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
6 years agodrm/amdkfd: Remove BUG_ONs for NULL pointer arguments
Felix Kuehling [Wed, 16 Aug 2017 03:00:09 +0000 (23:00 -0400)]
drm/amdkfd: Remove BUG_ONs for NULL pointer arguments

Remove BUG_ONs that check for NULL pointer arguments that are
dereferenced in the same function. Dereferencing the NULL pointer
will generate a BUG anyway, so the explicit check is redundant and
unnecessary overhead.

Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Reviewed-by: Oded Gabbay <oded.gabbay@gmail.com>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
6 years agodrm/amdkfd: Remove usage of alloc(sizeof(struct...
Kent Russell [Wed, 16 Aug 2017 03:00:08 +0000 (23:00 -0400)]
drm/amdkfd: Remove usage of alloc(sizeof(struct...

See https://kernel.org/doc/html/latest/process/coding-style.html
under "14) Allocating Memory" for rationale behind removing the
x=alloc(sizeof(struct) style and using x=alloc(sizeof(*x) instead

Signed-off-by: Kent Russell <kent.russell@amd.com>
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Reviewed-by: Oded Gabbay <oded.gabbay@gmail.com>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
6 years agodrm/amdkfd: Fix goto usage v2
Kent Russell [Wed, 16 Aug 2017 03:00:07 +0000 (23:00 -0400)]
drm/amdkfd: Fix goto usage v2

Remove gotos that do not feature any common cleanup, and use gotos
instead of repeating cleanup commands.

According to kernel.org: "The goto statement comes in handy when a
function exits from multiple locations and some common work such as
cleanup has to be done. If there is no cleanup needed then just return
directly."

v2: Applied review suggestions in create_queue_nocpsch

Signed-off-by: Kent Russell <kent.russell@amd.com>
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Reviewed-by: Oded Gabbay <oded.gabbay@gmail.com>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
6 years agodrm/amdkfd: Change x==NULL/false references to !x
Kent Russell [Wed, 16 Aug 2017 03:00:06 +0000 (23:00 -0400)]
drm/amdkfd: Change x==NULL/false references to !x

Upstream prefers the !x notation to x==NULL or x==false. Along those lines
change the ==true or !=NULL references as well. Also make the references
to !x the same, excluding () for readability.

Signed-off-by: Kent Russell <kent.russell@amd.com>
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Reviewed-by: Oded Gabbay <oded.gabbay@gmail.com>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
6 years agodrm/amdkfd: Consolidate and clean up log commands
Kent Russell [Wed, 16 Aug 2017 03:00:05 +0000 (23:00 -0400)]
drm/amdkfd: Consolidate and clean up log commands

Consolidate log commands so that dev_info(NULL, "Error...") uses the more
accurate pr_err, remove the module name from the log (can be seen via
dynamic debugging with +m), and the function name (can be seen via
dynamic debugging with +f). We also don't need debug messages saying
what function we're in. Those can be added by devs when needed

Don't print vendor and device ID in error messages. They are typically
the same for all GPUs in a multi-GPU system. So this doesn't add any
value to the message.

Lastly, remove parentheses around %d, %i and 0x%llX.
According to kernel.org:
"Printing numbers in parentheses (%d) adds no value and should be
avoided."

Signed-off-by: Kent Russell <kent.russell@amd.com>
Signed-off-by: Yong Zhao <Yong.Zhao@amd.com>
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Reviewed-by: Oded Gabbay <oded.gabbay@gmail.com>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
6 years agodrm/amdkfd: Clean up KFD style errors and warnings v2
Kent Russell [Wed, 16 Aug 2017 03:00:04 +0000 (23:00 -0400)]
drm/amdkfd: Clean up KFD style errors and warnings v2

Using checkpatch.pl -f <file> showed a number of style issues. This
patch addresses as many of them as possible. Some long lines have been
left for readability, but attempts to minimize them have been made.

v2: Broke long lines in gfx_v7 get_fw_version

Signed-off-by: Kent Russell <kent.russell@amd.com>
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
6 years agodrm/amdgpu: Remove hard-coded assumptions about compute pipes
Felix Kuehling [Wed, 16 Aug 2017 03:00:03 +0000 (23:00 -0400)]
drm/amdgpu: Remove hard-coded assumptions about compute pipes

Remove hard-coded assumption that the first compute pipe is
reserved for amdgpu. Pipe 0 actually means pipe 0 now.

Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Reviewed-by: Oded Gabbay <oded.gabbay@gmail.com>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
6 years agodrm/amdkfd: Fix allocated_queues bitmap initialization
Felix Kuehling [Wed, 16 Aug 2017 03:00:02 +0000 (23:00 -0400)]
drm/amdkfd: Fix allocated_queues bitmap initialization

Use shared_resources.queue_bitmap to determine the queues available
for KFD in each pipe.

Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Reviewed-by: Oded Gabbay <oded.gabbay@gmail.com>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
6 years agodrm/amdkfd: Remove bogus divide-by-sizeof(uint32_t)
Felix Kuehling [Wed, 16 Aug 2017 03:00:01 +0000 (23:00 -0400)]
drm/amdkfd: Remove bogus divide-by-sizeof(uint32_t)

kfd2kgd->address_watch_get_offset returns dword register offsets.

Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
6 years agodrm/radeon: Return dword offsets of address watch registers
Felix Kuehling [Wed, 16 Aug 2017 03:00:00 +0000 (23:00 -0400)]
drm/radeon: Return dword offsets of address watch registers

Dword offsets are what KFD really needs and what amdgpu already returns.

Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
6 years agodrm/amdkfd: Fix typo in dbgdev_wave_reset_wavefronts
Felix Kuehling [Wed, 16 Aug 2017 02:59:59 +0000 (22:59 -0400)]
drm/amdkfd: Fix typo in dbgdev_wave_reset_wavefronts

Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Reviewed-by: Oded Gabbay <oded.gabbay@gmail.com>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
6 years agodrm/nouveau: Fix merge commit
Maarten Lankhorst [Tue, 15 Aug 2017 08:52:50 +0000 (10:52 +0200)]
drm/nouveau: Fix merge commit

The most recent merge commit in airlied/drm-next has problems with
confusing old_crtc_state and new_crtc_state. Use the
for_each_oldnew_crtc_in_state macros to clean up the confusion,
and explicitly look at the correct state instead of looking at
asyh->state.

With these fixes it becomes more obvious what the code is trying to do,
which will hopefully prevent future confusion.

Cc: Dave Airlie <airlied@redhat.com>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
6 years agodrm/amdgpu/gfx7: fix function name
Alex Deucher [Tue, 15 Aug 2017 14:34:55 +0000 (10:34 -0400)]
drm/amdgpu/gfx7: fix function name

Was using the wrong prefix (gmc rather than gfx).  The function
is related to the gfx hw, not gmc.  This also makes it consistent
with the naming in gfx8.

Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>