Re: [PATCH 1/2] drm/amdgpu: Moved fault hash table to amdgpu vm

2018-09-13 Thread Christian König
I think I'm missing something. Actually I'm thinking more that I'm missing something :) But the result is the same. You're raising some potential problems that I think must be about swapping out page tables that don't have fences on them (otherwise they wouldn't be evicted) and that are mana

Re: [PATCH 1/3] drm/amd: Add ucode DMCU support

2018-09-13 Thread Huang Rui
On Tue, Sep 11, 2018 at 03:15:11PM -0400, David Francis wrote: > DMCU (Display Microcontroller Unit) is a GPU chip involved in > eDP features like Adaptive Backlight Modulation and Panel Self > Refresh. > > DMCU has two pieces of firmware: the ERAM and the interrupt > vectors, which must be loaded

Re: [PATCH 2/3] drm/amd: Add PSP DMCU support

2018-09-13 Thread Huang Rui
On Tue, Sep 11, 2018 at 03:15:12PM -0400, David Francis wrote: > DMCU (Display Microcontroller Unit) is a GPU chip involved in > eDP features like Adaptive Backlight Modulation and Panel Self > Refresh. > > PSP is already equipped to handle DMCU firmware loading, all > that is needed is to transla

Re: [PATCH 3/3] drm/amd: Add DM DMCU support

2018-09-13 Thread Huang Rui
On Tue, Sep 11, 2018 at 03:15:13PM -0400, David Francis wrote: > DMCU (Display Microcontroller Unit) is a GPU chip involved in > eDP features like Adaptive Backlight Modulation and Panel Self > Refresh. > > DC is already fully equipped to initialize DMCU as long as the > firmware is loaded. > > A

RE: [PATCH 1/3] [RFC]drm: add syncobj timeline support v4

2018-09-13 Thread Zhou, David(ChunMing)
> -Original Message- > From: Koenig, Christian > Sent: Thursday, September 13, 2018 2:56 PM > To: Zhou, David(ChunMing) ; Zhou, > David(ChunMing) ; dri- > de...@lists.freedesktop.org > Cc: Dave Airlie ; Rakos, Daniel > ; amd-gfx@lists.freedesktop.org > Subject: Re: [PATCH 1/3] [RFC]drm: a

Re: [PATCH] drm/ttm: once more fix ttm_bo_bulk_move_lru_tail

2018-09-13 Thread Huang Rui
On Wed, Sep 12, 2018 at 09:23:55PM +0200, Christian König wrote: > While cutting the lists we sometimes accidentally added a list_head from > the stack to the LRUs, effectively corrupting the list. > > Remove the list cutting and use explicit list manipulation instead. This patch actually fixes t

Re: [PATCH] drm/amdgpu: reserve GDS resources statically

2018-09-13 Thread Christian König
As discussed internally that doesn't work because threads don't necessary get the same VMID assigned. Christian. Am 12.09.2018 um 22:33 schrieb Marek Olšák: From: Marek Olšák I've chosen to do it like this because it's easy and allows an arbitrary number of processes. Signed-off-by: Marek O

Re: [PATCH] drm/amdgpu: use HMM mirror callback to replace mmu notifier (v2)

2018-09-13 Thread Christian König
Am 13.09.2018 um 00:02 schrieb Philip Yang: Replace our MMU notifier with hmm_mirror_ops.sync_cpu_device_pagetables callback. Enable CONFIG_HMM and CONFIG_HMM_MIRROR as a dependency in DRM_AMDGPU_USERPTR Kconfig. It supports both KFD userptr and gfx userptr paths. This depends on several HMM pa

Re: [PATCH 1/3] [RFC]drm: add syncobj timeline support v4

2018-09-13 Thread Christian König
Am 13.09.2018 um 09:43 schrieb Zhou, David(ChunMing): -Original Message- From: Koenig, Christian Sent: Thursday, September 13, 2018 2:56 PM To: Zhou, David(ChunMing) ; Zhou, David(ChunMing) ; dri- de...@lists.freedesktop.org Cc: Dave Airlie ; Rakos, Daniel ; amd-gfx@lists.freedesktop.or

RE: [PATCH 1/3] [RFC]drm: add syncobj timeline support v4

2018-09-13 Thread Zhou, David(ChunMing)
> -Original Message- > From: Christian König > Sent: Thursday, September 13, 2018 4:50 PM > To: Zhou, David(ChunMing) ; Koenig, Christian > ; dri-de...@lists.freedesktop.org > Cc: Dave Airlie ; Rakos, Daniel > ; amd-gfx@lists.freedesktop.org > Subject: Re: [PATCH 1/3] [RFC]drm: add synco

Re: [PATCH 1/3] [RFC]drm: add syncobj timeline support v4

2018-09-13 Thread Christian König
Am 13.09.2018 um 11:11 schrieb Zhou, David(ChunMing): -Original Message- From: Christian König Sent: Thursday, September 13, 2018 4:50 PM To: Zhou, David(ChunMing) ; Koenig, Christian ; dri-de...@lists.freedesktop.org Cc: Dave Airlie ; Rakos, Daniel ; amd-gfx@lists.freedesktop.org Subj

Re: [PATCH 1/5] drm/amdgpu: stop pipelining VM PDs/PTs moves

2018-09-13 Thread Zhang, Jerry(Junwei)
On 09/11/2018 05:55 PM, Christian König wrote: We are going to need this for recoverable page fault handling and it makes shadow handling during GPU reset much more easier. Signed-off-by: Christian König Acked-by: Junwei Zhang --- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 2 +- driver

Re: [PATCH 4/5] drm/amdgpu: always recover VRAM during GPU recovery

2018-09-13 Thread Zhang, Jerry(Junwei)
On 09/11/2018 05:56 PM, Christian König wrote: It shouldn't add much overhead and we should make sure that critical VRAM content is always restored. Signed-off-by: Christian König Acked-by: Junwei Zhang --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 10 +- 1 file changed, 5 inse

Re: [PATCH 3/5] drm/amdgpu: shadow BOs don't need any alignment

2018-09-13 Thread Zhang, Jerry(Junwei)
On 09/11/2018 05:56 PM, Christian König wrote: They aren't directly used by the hardware. Signed-off-by: Christian König Reviewed-by: Junwei Zhang --- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/am

Re: [PATCH 5/5] drm/amdgpu: fix shadow BO restoring

2018-09-13 Thread Zhang, Jerry(Junwei)
On 09/11/2018 05:56 PM, Christian König wrote: Don't grab the reservation lock any more and simplify the handling quite a bit. Signed-off-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 109 - drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 46 +

RE: [PATCH 1/3] [RFC]drm: add syncobj timeline support v4

2018-09-13 Thread Zhou, David(ChunMing)
> -Original Message- > From: Koenig, Christian > Sent: Thursday, September 13, 2018 5:20 PM > To: Zhou, David(ChunMing) ; dri- > de...@lists.freedesktop.org > Cc: Dave Airlie ; Rakos, Daniel > ; amd-gfx@lists.freedesktop.org > Subject: Re: [PATCH 1/3] [RFC]drm: add syncobj timeline suppor

[PATCH xf86-video-amdgpu] Bail from drmmode_cm_init if there's no CRTC

2018-09-13 Thread Michel Dänzer
From: Michel Dänzer We would crash due to dereferencing the NULL mode_res->crtc pointer. Bugzilla: https://bugs.freedesktop.org/107913 Signed-off-by: Michel Dänzer --- src/drmmode_display.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/drmmode_display.c b/src/drmmode_display.c ind

Re: [PATCH 1/3] [RFC]drm: add syncobj timeline support v4

2018-09-13 Thread Christian König
Am 13.09.2018 um 11:35 schrieb Zhou, David(ChunMing): -Original Message- From: Koenig, Christian Sent: Thursday, September 13, 2018 5:20 PM To: Zhou, David(ChunMing) ; dri- de...@lists.freedesktop.org Cc: Dave Airlie ; Rakos, Daniel ; amd-gfx@lists.freedesktop.org Subject: Re: [PATCH 1/

[PATCH 1/2] list: introduce list_bulk_move_tail helper

2018-09-13 Thread Christian König
Move all entries between @first and including @last before @head. This is useful for LRU lists where a whole block of entries should be moved to the end of an list. Signed-off-by: Christian König --- include/linux/list.h | 23 +++ 1 file changed, 23 insertions(+) diff --git

[PATCH 2/2] drm/ttm: once more fix ttm_bo_bulk_move_lru_tail v2

2018-09-13 Thread Christian König
While cutting the lists we sometimes accidentally added a list_head from the stack to the LRUs, effectively corrupting the list. Remove the list cutting and use explicit list manipulation instead. v2: separate out new list_bulk_move_tail helper Signed-off-by: Christian König --- drivers/gpu/dr

Re: [PATCH] drm/ttm: once more fix ttm_bo_bulk_move_lru_tail

2018-09-13 Thread Christian König
Am 13.09.2018 um 10:31 schrieb Huang Rui: On Wed, Sep 12, 2018 at 09:23:55PM +0200, Christian König wrote: While cutting the lists we sometimes accidentally added a list_head from the stack to the LRUs, effectively corrupting the list. Remove the list cutting and use explicit list manipulation

Re: [PATCH 2/2] drm/amdgpu: use a single linked list for amdgpu_vm_bo_base

2018-09-13 Thread Christian König
Am 13.09.2018 um 00:58 schrieb Felix Kuehling: Is the small reduction in memory footprint (8 bytes per page table on a 64-bit kernel) really worth the trouble of open-coding a single-linked list implementation? Well the key point is it is now a power of two again. So we don't waste 28KB per pa

[PATCH 5/5] drm/amd: rename ADOBE to OP

2018-09-13 Thread Hans Verkuil
From: Hans Verkuil The CTA-861 standard renamed ADOBE to OP, so do the same to remain in sync with the standard. Signed-off-by: Hans Verkuil Cc: amd-gfx@lists.freedesktop.org --- drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c | 4 ++-- drivers/gpu/drm/amd/display/dc/core/dc_resour

Re: [PATCH libdrm] tests/amdgpu: add unaligned VM test

2018-09-13 Thread Christian König
Am 11.09.2018 um 04:06 schrieb Zhang, Jerry (Junwei): On 09/10/2018 05:33 PM, Christian König wrote: Am 10.09.2018 um 04:44 schrieb Zhang, Jerry (Junwei): On 09/10/2018 02:04 AM, Christian König wrote: Make a VM mapping which is as unaligned as possible. Is it going to test unaligned address

Re: [PATCH xf86-video-amdgpu] Bail from drmmode_cm_init if there's no CRTC

2018-09-13 Thread Deucher, Alexander
Reviewed-by: Alex Deucher From: amd-gfx on behalf of Michel Dänzer Sent: Thursday, September 13, 2018 5:47:29 AM To: amd-gfx@lists.freedesktop.org Subject: [PATCH xf86-video-amdgpu] Bail from drmmode_cm_init if there's no CRTC From: Michel Dänzer We would cr

Re: [PATCH] drm/ttm: once more fix ttm_bo_bulk_move_lru_tail

2018-09-13 Thread Alex Deucher
On Wed, Sep 12, 2018 at 3:25 PM Christian König wrote: > > While cutting the lists we sometimes accidentally added a list_head from > the stack to the LRUs, effectively corrupting the list. > > Remove the list cutting and use explicit list manipulation instead. > > Signed-off-by: Christian König

Re: [PATCH] drm/amdgpu: reserve GDS resources statically

2018-09-13 Thread Marek Olšák
That's OK. We don't need IBs to get the same VMID. Marek On Thu, Sep 13, 2018 at 4:40 AM, Christian König wrote: > As discussed internally that doesn't work because threads don't necessary > get the same VMID assigned. > > Christian. > > Am 12.09.2018 um 22:33 schrieb Marek Olšák: >> >> From: Ma

Re: [PATCH] drm/amd/display: Fix pflip IRQ status after gpu reset.

2018-09-13 Thread Harry Wentland
On 2018-09-12 04:51 PM, Andrey Grodzovsky wrote: > Problem: > After GPU reset pflip completion IRQ is disabled and hence > any subsequent mode set or plane update leads to hang. > > Fix: > Unless acrtc->otg_inst is initialized to -1 during display > block initializtion then durng resume from GPU r

Re: [PATCH 2/2] drm/ttm: once more fix ttm_bo_bulk_move_lru_tail v2

2018-09-13 Thread Mike Lothian
Hi This fixes a boot issue I had on Raven ( https://bugs.freedesktop.org/show_bug.cgi?id=107922) Feel free to add to both patches: Tested-by: Mike Lothian Cheers Mike On Thu, 13 Sep 2018 at 12:22 Christian König < ckoenig.leichtzumer...@gmail.com> wrote: > While cutting the lists we sometim

Re: [PATCH] drm/amdgpu: use HMM mirror callback to replace mmu notifier (v2)

2018-09-13 Thread Philip Yang
On 2018-09-13 04:45 AM, Christian König wrote: Am 13.09.2018 um 00:02 schrieb Philip Yang: Replace our MMU notifier with hmm_mirror_ops.sync_cpu_device_pagetables callback. Enable CONFIG_HMM and CONFIG_HMM_MIRROR as a dependency in DRM_AMDGPU_USERPTR Kconfig. It supports both KFD userptr and gf

Re: [PATCH 2/6] drm/amdgpu/sriov: Correct the setting about sdma doorbell offset of Vega10

2018-09-13 Thread Alex Deucher
On Wed, Sep 12, 2018 at 10:06 PM Felix Kuehling wrote: > > On 2018-09-12 09:55 PM, Alex Deucher wrote: > > On Wed, Sep 12, 2018 at 9:45 PM Felix Kuehling > > wrote: > >> From: Emily Deng > >> > >> Correct the format > >> > >> For vega10 sriov, the sdma doorbell must be fixed as follow to keep t

Re: [PATCH] drm/ttm: once more fix ttm_bo_bulk_move_lru_tail

2018-09-13 Thread Michel Dänzer
[ Moving to dri-devel, where TTM patches are reviewed ] On 2018-09-12 9:23 p.m., Christian König wrote: > While cutting the lists we sometimes accidentally added a list_head from > the stack to the LRUs, effectively corrupting the list. > > Remove the list cutting and use explicit list manipulat

[PATCH] drm/amdgpu/display: return proper error codes in dm

2018-09-13 Thread Alex Deucher
Replace -1 with proper error codes. Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

Re: [PATCH] drm/amdgpu: reserve GDS resources statically

2018-09-13 Thread Christian König
Are you sure of that? I mean it is rather pointless to have a Global Data Share when it can't be used to share anything? On the other hand I'm not opposed to get rid of all that stuff if we really don't need it. Christian. Am 13.09.2018 um 17:27 schrieb Marek Olšák: That's OK. We don't need

Re: [PATCH] drm/ttm: once more fix ttm_bo_bulk_move_lru_tail

2018-09-13 Thread Christian König
Am 13.09.2018 um 16:25 schrieb Alex Deucher: On Wed, Sep 12, 2018 at 3:25 PM Christian König wrote: While cutting the lists we sometimes accidentally added a list_head from the stack to the LRUs, effectively corrupting the list. Remove the list cutting and use explicit list manipulation instea

Re: [PATCH 1/2] drm/amdgpu: remove amdgpu_bo_list_entry.robj

2018-09-13 Thread Christian König
Am 12.09.2018 um 22:21 schrieb Felix Kuehling: On 2018-09-12 04:55 AM, Christian König wrote: We can get that just by casting tv.bo. Signed-off-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c | 42 - drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.h | 1 -

[PATCH] drm/amdgpu: use HMM mirror callback to replace mmu notifier v3

2018-09-13 Thread Philip Yang
Replace our MMU notifier with hmm_mirror_ops.sync_cpu_device_pagetables callback. Enable CONFIG_HMM and CONFIG_HMM_MIRROR as a dependency in DRM_AMDGPU_USERPTR Kconfig. It supports both KFD userptr and gfx userptr paths. This depends on several HMM patchset from Jérôme Glisse queued for upstream.

Re: [PATCH 1/2] drm/amdgpu: remove amdgpu_bo_list_entry.robj

2018-09-13 Thread Felix Kuehling
On 2018-09-13 01:50 PM, Christian König wrote: > Am 12.09.2018 um 22:21 schrieb Felix Kuehling: >> On 2018-09-12 04:55 AM, Christian König wrote: >>> We can get that just by casting tv.bo. >>> >>> Signed-off-by: Christian König >>> --- >>>   drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c | 42 >>> +++

Re: [PATCH] drm/amdgpu: reserve GDS resources statically

2018-09-13 Thread Marek Olšák
GDS is a temporary memory. Its purpose depends on the job, but most of the time, the idea is: - beginning of IB - initialize GDS variables - dispatch compute that works with GDS variables - when done, copy GDS variables to memory - repeat ... - end of IB GDS is like a pool of global shader GPRs.

Re: [PATCH] drm/amdgpu: use HMM mirror callback to replace mmu notifier v3

2018-09-13 Thread Christian König
Am 13.09.2018 um 20:00 schrieb Philip Yang: Replace our MMU notifier with hmm_mirror_ops.sync_cpu_device_pagetables callback. Enable CONFIG_HMM and CONFIG_HMM_MIRROR as a dependency in DRM_AMDGPU_USERPTR Kconfig. It supports both KFD userptr and gfx userptr paths. This depends on several HMM pa

Re: [PATCH] drm/amdgpu: reserve GDS resources statically

2018-09-13 Thread Marek Olšák
I was thinking about that too, but it would be too much trouble for something we don't need. Marek On Thu, Sep 13, 2018 at 2:57 PM, Deucher, Alexander wrote: > Why don't we just fix up the current GDS code so it works the same as vram > and then we can add a new CS or context flag to ignore the

[PATCH 0/2] DMCU firmware version storing and access

2018-09-13 Thread David Francis
David Francis (2): drm/amd/display: Add DMCU firmware version drm/amdgpu: Add DMCU to firmware query interface drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 12 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 ++ drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h | 1

[PATCH 2/2] drm/amdgpu: Add DMCU to firmware query interface

2018-09-13 Thread David Francis
DMCU firmware version can be read using the AMDGPU_INFO ioctl or the amdgpu_firmware_info debugfs entry Signed-off-by: David Francis --- drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 12 include/uapi/drm/amdgpu_drm.h | 2 ++ 2 files changed, 14 insertions(+) diff --git a/dri

[PATCH 1/2] drm/amd/display: Add DMCU firmware version

2018-09-13 Thread David Francis
Read the version number from the common firmware header and store it in the dm struct Signed-off-by: David Francis --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 ++ drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h | 1 + 2 files changed, 3 insertions(+) diff --git a/drivers/gpu/drm

[PATCH] drm/amdgpu/soc15: clean up picasso support

2018-09-13 Thread Alex Deucher
It's the same as raven so remove the duplicate case. Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/soc15.c | 17 - 1 file changed, 17 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/soc15.c b/drivers/gpu/drm/amd/amdgpu/soc15.c index f5a44d1fe5da..f930e09071d4

[PATCH] drm/amdgpu: simplify Raven, Raven2, and Picasso handling

2018-09-13 Thread Alex Deucher
Treat them all as Raven rather than adding a new picasso asic type. This simplifies a lot of code and also handles the case of rv2 chips with the 0x15d8 pci id. It also fixes dmcu fw handling for picasso. Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 10 +

Re: [PATCH] drm/amdgpu: use HMM mirror callback to replace mmu notifier v3

2018-09-13 Thread Philip Yang
On 2018-09-13 02:24 PM, Christian König wrote: Am 13.09.2018 um 20:00 schrieb Philip Yang: Replace our MMU notifier with hmm_mirror_ops.sync_cpu_device_pagetables callback. Enable CONFIG_HMM and CONFIG_HMM_MIRROR as a dependency in DRM_AMDGPU_USERPTR Kconfig. It supports both KFD userptr and gf

[PATCH] drm/amdgpu: use HMM mirror callback to replace mmu notifier v4

2018-09-13 Thread Philip Yang
Replace our MMU notifier with hmm_mirror_ops.sync_cpu_device_pagetables callback. Enable CONFIG_HMM and CONFIG_HMM_MIRROR as a dependency in DRM_AMDGPU_USERPTR Kconfig. It supports both KFD userptr and gfx userptr paths. This depends on several HMM patchset from Jérôme Glisse queued for upstream.

[PATCH v2] drm/amdgpu:No action when VCN PG state is unchanged

2018-09-13 Thread James Zhu
When VCN PG state is unchanged, it is unnecessary to reset power gate state Signed-off-by: James Zhu --- drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h | 1 + drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 12 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/

Re: [PATCH] drm/amdgpu: reserve GDS resources statically

2018-09-13 Thread Marek Olšák
To be fair, since we have only 7 user VMIDs and 8 chunks of GDS, we can make the 8th GDS chunk global and allocatable and use it based on a CS flag. It would need more work and a lot of testing though. I don't think we can do the testing part now because of the complexity of interactions between pe

Re: [PATCH] drm/amdgpu: use HMM mirror callback to replace mmu notifier v4

2018-09-13 Thread Felix Kuehling
On 2018-09-13 04:52 PM, Philip Yang wrote: > Replace our MMU notifier with hmm_mirror_ops.sync_cpu_device_pagetables > callback. Enable CONFIG_HMM and CONFIG_HMM_MIRROR as a dependency in > DRM_AMDGPU_USERPTR Kconfig. > > It supports both KFD userptr and gfx userptr paths. > > This depends on sever