Re: [Nouveau] [PATCH] drm/nouveau: Only recalculate PBN/VCPI on mode/connector changes

2019-08-08 Thread Lyude Paul
On Thu, 2019-08-08 at 20:46 -0400, Lyude Paul wrote: > On Thu, 2019-08-08 at 18:17 +, William Lewis wrote: > > On 8/8/19 1:04 PM, Lyude Paul wrote: > > > I -thought- I had fixed this entirely, but it looks like that I didn't > > > test this thoroughly enough as we apparently still make one big

[Nouveau] [PATCH v2] drm/nouveau: Only recalculate PBN/VCPI on mode/connector changes

2019-08-08 Thread Lyude Paul
I -thought- I had fixed this entirely, but it looks like that I didn't test this thoroughly enough as we apparently still make one big mistake with nv50_msto_atomic_check() - we don't handle the following scenario: * CRTC #1 has n VCPI allocated to it, is attached to connector DP-4 which is

Re: [Nouveau] [PATCH] drm/nouveau: Only recalculate PBN/VCPI on mode/connector changes

2019-08-08 Thread Lyude Paul
On Thu, 2019-08-08 at 18:17 +, William Lewis wrote: > On 8/8/19 1:04 PM, Lyude Paul wrote: > > I -thought- I had fixed this entirely, but it looks like that I didn't > > test this thoroughly enough as we apparently still make one big mistake > > with nv50_msto_atomic_check() - we don't handle

Re: [PATCH] nouveau/hmm: map pages after migration

2019-08-08 Thread Ralph Campbell
On 8/8/19 12:07 AM, Christoph Hellwig wrote: On Wed, Aug 07, 2019 at 08:02:14AM -0700, Ralph Campbell wrote: When memory is migrated to the GPU it is likely to be accessed by GPU code soon afterwards. Instead of waiting for a GPU fault, map the migrated memory into the GPU page tables with

Re: [PATCH 6/9] nouveau: simplify nouveau_dmem_migrate_to_ram

2019-08-08 Thread Ralph Campbell
On 8/8/19 8:33 AM, Christoph Hellwig wrote: Factor the main copy page to ram routine out into a helper that acts on a single page and which doesn't require the nouveau_dmem_fault structure for argument passing. Also remove the loop over multiple pages as we only handle one at the moment,

Re: [Nouveau] [PATCH] drm/nouveau: Only recalculate PBN/VCPI on mode/connector changes

2019-08-08 Thread William Lewis
On 8/8/19 1:04 PM, Lyude Paul wrote: > I -thought- I had fixed this entirely, but it looks like that I didn't > test this thoroughly enough as we apparently still make one big mistake > with nv50_msto_atomic_check() - we don't handle the following scenario: > > * CRTC #1 has n VCPI allocated to

[Nouveau] [PATCH] drm/nouveau: Only recalculate PBN/VCPI on mode/connector changes

2019-08-08 Thread Lyude Paul
I -thought- I had fixed this entirely, but it looks like that I didn't test this thoroughly enough as we apparently still make one big mistake with nv50_msto_atomic_check() - we don't handle the following scenario: * CRTC #1 has n VCPI allocated to it, is attached to connector DP-4 which is

[PATCH 9/9] mm: remove the unused MIGRATE_PFN_DEVICE flag

2019-08-08 Thread Christoph Hellwig
No one ever checks this flag, and we could easily get that information from the page if needed. Signed-off-by: Christoph Hellwig Reviewed-by: Ralph Campbell --- drivers/gpu/drm/nouveau/nouveau_dmem.c | 3 +-- include/linux/migrate.h| 1 - mm/migrate.c

[Nouveau] [PATCH 7/9] nouveau: simplify nouveau_dmem_migrate_vma

2019-08-08 Thread Christoph Hellwig
Factor the main copy page to vram routine out into a helper that acts on a single page and which doesn't require the nouveau_dmem_migrate structure for argument passing. As an added benefit the new version only allocates the dma address array once and reuses it for each subsequent chunk of work.

[Nouveau] [PATCH 8/9] mm: remove the unused MIGRATE_PFN_ERROR flag

2019-08-08 Thread Christoph Hellwig
Now that we can rely errors in the normal control flow there is no need for this flag, remove it. Signed-off-by: Christoph Hellwig Reviewed-by: Ralph Campbell --- include/linux/migrate.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/linux/migrate.h b/include/linux/migrate.h index

[Nouveau] [PATCH 6/9] nouveau: simplify nouveau_dmem_migrate_to_ram

2019-08-08 Thread Christoph Hellwig
Factor the main copy page to ram routine out into a helper that acts on a single page and which doesn't require the nouveau_dmem_fault structure for argument passing. Also remove the loop over multiple pages as we only handle one at the moment, although the structure of the main worker function

[Nouveau] [PATCH 5/9] nouveau: remove a few function stubs

2019-08-08 Thread Christoph Hellwig
nouveau_dmem_migrate_vma and nouveau_dmem_convert_pfn are only called when CONFIG_DRM_NOUVEAU_SVM is enabled, so there is no need to provide !CONFIG_DRM_NOUVEAU_SVM stubs for them. Signed-off-by: Christoph Hellwig --- drivers/gpu/drm/nouveau/nouveau_dmem.h | 11 --- 1 file changed, 11

[PATCH 4/9] nouveau: factor out dmem fence completion

2019-08-08 Thread Christoph Hellwig
Factor out the end of fencing logic from the two migration routines. Signed-off-by: Christoph Hellwig Reviewed-by: Ralph Campbell --- drivers/gpu/drm/nouveau/nouveau_dmem.c | 33 -- 1 file changed, 15 insertions(+), 18 deletions(-) diff --git

[Nouveau] [PATCH 2/9] nouveau: reset dma_nr in nouveau_dmem_migrate_alloc_and_copy

2019-08-08 Thread Christoph Hellwig
When we start a new batch of dma_map operations we need to reset dma_nr, as we start filling a newly allocated array. Signed-off-by: Christoph Hellwig Reviewed-by: Ralph Campbell --- drivers/gpu/drm/nouveau/nouveau_dmem.c | 1 + 1 file changed, 1 insertion(+) diff --git

[Nouveau] [PATCH 3/9] nouveau: factor out device memory address calculation

2019-08-08 Thread Christoph Hellwig
Factor out the repeated device memory address calculation into a helper. Signed-off-by: Christoph Hellwig Reviewed-by: Ralph Campbell --- drivers/gpu/drm/nouveau/nouveau_dmem.c | 42 +++--- 1 file changed, 17 insertions(+), 25 deletions(-) diff --git

[Nouveau] [PATCH 1/9] mm: turn migrate_vma upside down

2019-08-08 Thread Christoph Hellwig
There isn't any good reason to pass callbacks to migrate_vma. Instead we can just export the three steps done by this function to drivers and let them sequence the operation without callbacks. This removes a lot of boilerplate code as-is, and will allow the drivers to drastically improve code

turn hmm migrate_vma upside down v2

2019-08-08 Thread Christoph Hellwig
Hi Jérôme, Ben and Jason, below is a series against the hmm tree which starts revamping the migrate_vma functionality. The prime idea is to export three slightly lower level functions and thus avoid the need for migrate_vma_ops callbacks. Diffstat: 5 files changed, 281 insertions(+), 607

[Nouveau] [Bug 111218] Segmentation fault in nv50_ir::NVC0LegalizeSSA::handleDIV when dividing result of textureSize

2019-08-08 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=111218 --- Comment #9 from Timo Aaltonen --- for the record, we already set '-Db_ndebug=true' which was supposed to disable debug builds (and asserts) with meson -- You are receiving this mail because: You are the assignee for the bug. You are the

Re: [Nouveau] [PATCH] nouveau/hmm: map pages after migration

2019-08-08 Thread Christoph Hellwig
On Wed, Aug 07, 2019 at 08:02:14AM -0700, Ralph Campbell wrote: > When memory is migrated to the GPU it is likely to be accessed by GPU > code soon afterwards. Instead of waiting for a GPU fault, map the > migrated memory into the GPU page tables with the same access permissions > as the source

Re: [Nouveau] [PATCH 04/15] mm: remove the pgmap field from struct hmm_vma_walk

2019-08-08 Thread Christoph Hellwig
On Wed, Aug 07, 2019 at 11:47:22AM -0700, Dan Williams wrote: > > Unrelated to this patch, but what is the point of getting checking > > that the pgmap exists for the page and then immediately releasing it? > > This code has this pattern in several places. > > > > It feels racy > > Agree, not