Re: [PATCH] dma-buf: Add DmaBufTotal counter in meminfo

2021-04-16 Thread Matthew Wilcox
On Fri, Apr 16, 2021 at 11:37:19AM +0200, Peter Enderborg wrote: > diff --git a/fs/proc/meminfo.c b/fs/proc/meminfo.c > index 6fa761c9cc78..3c1a82b51a6f 100644 > --- a/fs/proc/meminfo.c > +++ b/fs/proc/meminfo.c > @@ -16,6 +16,7 @@ > #ifdef CONFIG_CMA > #include > #endif > +#include > #includ

Re: [Intel-gfx] [PATCH 06/19] drm/i915/stolen: pass the allocation flags

2021-04-16 Thread Matthew Auld
On 14/04/2021 16:09, Tvrtko Ursulin wrote: On 12/04/2021 10:05, Matthew Auld wrote: From: CQ Tang Stolen memory is always allocated as physically contiguous pages, mark the object flags as such. Signed-off-by: CQ Tang Signed-off-by: Matthew Auld ---   drivers/gpu/drm/i915/gem

Re: [Intel-gfx] [PATCH 12/19] drm/i915/lmem: Bypass aperture when lmem is available

2021-04-16 Thread Matthew Auld
On 14/04/2021 16:33, Tvrtko Ursulin wrote: On 12/04/2021 10:05, Matthew Auld wrote: From: Anusha Srivatsa In the scenario where local memory is available, we have rely on CPU access via lmem directly instead of aperture. v2: gmch is only relevant for much older hw, therefore we can drop the

Re: [Intel-gfx] [PATCH 03/19] drm/i915: Create stolen memory region from local memory

2021-04-16 Thread Matthew Auld
On 14/04/2021 16:01, Tvrtko Ursulin wrote: On 12/04/2021 10:05, Matthew Auld wrote: From: CQ Tang Add "REGION_STOLEN" device info to dg1, create stolen memory region from upper portion of local device memory, starting from DSMBASE. v2: - s/drm_info/drm_dbg; userspace like

[PATCH v2 1/4] drm/i915/uapi: fix kernel doc warnings

2021-04-19 Thread Matthew Auld
Fix the cases where it is almost already valid kernel doc, for the others just nerf the warnings for now. Signed-off-by: Matthew Auld Cc: Joonas Lahtinen Cc: Jordan Justen Cc: Daniel Vetter Cc: Kenneth Graunke Cc: Jason Ekstrand Cc: Dave Airlie Cc: dri-devel@lists.freedesktop.org Cc: mesa

[PATCH v2 2/4] drm/doc: add section for driver uAPI

2021-04-19 Thread Matthew Auld
Add section for drm/i915 uAPI and pull in i915_drm.h. Suggested-by: Daniel Vetter Signed-off-by: Matthew Auld Cc: Joonas Lahtinen Cc: Jordan Justen Cc: Daniel Vetter Cc: Kenneth Graunke Cc: Jason Ekstrand Cc: Dave Airlie Cc: dri-devel@lists.freedesktop.org Cc: mesa

[PATCH v2 3/4] drm/i915/uapi: convert i915_user_extension to kernel doc

2021-04-19 Thread Matthew Auld
Add some example usage for the extension chaining also, which is quite nifty. v2: (Daniel) - clarify that the name is just some integer, also document that the name space is not global v3: prefer kernel-doc references for structs Suggested-by: Daniel Vetter Signed-off-by: Matthew Auld Cc

[PATCH v2 4/4] drm/i915/uapi: convert i915_query and friend to kernel doc

2021-04-19 Thread Matthew Auld
Vetter Signed-off-by: Matthew Auld Cc: Joonas Lahtinen Cc: Tvrtko Ursulin Cc: Jordan Justen Cc: Daniel Vetter Cc: Kenneth Graunke Cc: Jason Ekstrand Cc: Dave Airlie Cc: dri-devel@lists.freedesktop.org Cc: mesa-...@lists.freedesktop.org Reviewed-by: Daniel Vetter Reviewed-by: Jason Ekstrand

Re: [Intel-gfx] [PATCH 11/19] drm/i915: Update the helper to set correct mapping

2021-04-19 Thread Matthew Auld
On 15/04/2021 12:05, Tvrtko Ursulin wrote: On 15/04/2021 10:23, Matthew Auld wrote: On Thu, 15 Apr 2021 at 09:21, Tvrtko Ursulin wrote: On 14/04/2021 17:20, Matthew Auld wrote: On Wed, 14 Apr 2021 at 16:22, Tvrtko Ursulin wrote: On 12/04/2021 10:05, Matthew Auld wrote: From: Venkata

Re: [PATCH v3 4/4] drm/doc/rfc: i915 DG1 uAPI

2021-04-19 Thread Matthew Auld
On 16/04/2021 17:38, Jason Ekstrand wrote: On Thu, Apr 15, 2021 at 11:04 AM Matthew Auld wrote: Add an entry for the new uAPI needed for DG1. v2(Daniel): - include the overall upstreaming plan - add a note for mmap, there are differences here for TTM vs i915 - bunch of other

Re: [Intel-gfx] [PATCH 11/19] drm/i915: Update the helper to set correct mapping

2021-04-19 Thread Matthew Auld
On 19/04/2021 15:07, Tvrtko Ursulin wrote: On 19/04/2021 12:30, Matthew Auld wrote: On 15/04/2021 12:05, Tvrtko Ursulin wrote: On 15/04/2021 10:23, Matthew Auld wrote: On Thu, 15 Apr 2021 at 09:21, Tvrtko Ursulin wrote: On 14/04/2021 17:20, Matthew Auld wrote: On Wed, 14 Apr 2021 at 16

[PATCH v4] drm/doc/rfc: i915 DG1 uAPI

2021-04-19 Thread Matthew Auld
region_query and region_info, just keep the bare minimum needed for padding Signed-off-by: Matthew Auld Cc: Joonas Lahtinen Cc: Thomas Hellström Cc: Daniele Ceraolo Spurio Cc: Lionel Landwerlin Cc: Jon Bloomfield Cc: Jordan Justen Cc: Daniel Vetter Cc: Kenneth Graunke Cc: Jason Ekstrand

[PATCH 1/5] drm/i915: Create stolen memory region from local memory

2021-04-20 Thread Matthew Auld
7;t be needed anymore. v3: - split stolen lmem vs smem ops(Tvrtko) - add shortcut for stolen region in i915(Tvrtko) - sanity check dsm base vs bar size(Xinyun) Signed-off-by: CQ Tang Signed-off-by: Matthew Auld Cc: Tvrtko Ursulin Cc: Xinyun Liu --- drivers/gpu/drm/i

[PATCH 3/5] drm/i915/stolen: enforce the min_page_size contract

2021-04-20 Thread Matthew Auld
From: CQ Tang Since stolen can now be device local-memory underneath, we should try to enforce any min_page_size restrictions when allocating pages. Signed-off-by: CQ Tang Signed-off-by: Matthew Auld Reviewed-by: Tvrtko Ursulin --- drivers/gpu/drm/i915/gem/i915_gem_stolen.c | 7 --- 1

[PATCH 2/5] drm/i915/stolen: treat stolen local as normal local memory

2021-04-20 Thread Matthew Auld
Underneath it's the same stuff, so things like the PTE_LM bits for the GTT should just keep working as-is. Signed-off-by: Matthew Auld Reviewed-by: Tvrtko Ursulin --- drivers/gpu/drm/i915/gem/i915_gem_lmem.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/driver

[PATCH 4/5] drm/i915/stolen: pass the allocation flags

2021-04-20 Thread Matthew Auld
From: CQ Tang Stolen memory is always allocated as physically contiguous pages, mark the object flags as such. v2: move setting I915_BO_ALLOC_CONTIGUOUS into create_stolen Signed-off-by: CQ Tang Signed-off-by: Matthew Auld Cc: Tvrtko Ursulin --- drivers/gpu/drm/i915/gem/i915_gem_stolen.c

[PATCH 5/5] drm/i915/lmem: Fail driver init if LMEM training failed

2021-04-20 Thread Matthew Auld
(all GT registers will read back as 0, forcewake requests will timeout, etc.) so we should abort driver initialization if this happens. We can confirm that LMEM was initialized successfully via sgunit register GU_CNTL. Bspec: 53111 Signed-off-by: Matt Roper Cc: Caz Yokoyama Reviewed-by: Matthew

Re: [PATCH 1/5] drm/i915: Create stolen memory region from local memory

2021-04-21 Thread Matthew Auld
On 20/04/2021 17:06, Tvrtko Ursulin wrote: On 20/04/2021 14:18, Matthew Auld wrote: From: CQ Tang Add "REGION_STOLEN" device info to dg1, create stolen memory region from upper portion of local device memory, starting from DSMBASE. v2: - s/drm_info/drm_dbg; userspace like

Re: [PATCH 4/5] drm/i915/stolen: pass the allocation flags

2021-04-21 Thread Matthew Auld
On 20/04/2021 17:14, Tvrtko Ursulin wrote: On 20/04/2021 14:18, Matthew Auld wrote: From: CQ Tang Stolen memory is always allocated as physically contiguous pages, mark the object flags as such. v2: move setting I915_BO_ALLOC_CONTIGUOUS into create_stolen Signed-off-by: CQ Tang Signed-off

[PATCH v2 1/4] drm/i915: Create stolen memory region from local memory

2021-04-21 Thread Matthew Auld
7;t be needed anymore. v3: - split stolen lmem vs smem ops(Tvrtko) - add shortcut for stolen region in i915(Tvrtko) - sanity check dsm base vs bar size(Xinyun) v4(Tvrtko): - more cleanup - add some TODOs Signed-off-by: CQ Tang Signed-off-by: Matthew Auld Cc: Tvrtko Ursulin Cc: X

[PATCH v2 2/4] drm/i915/stolen: treat stolen local as normal local memory

2021-04-21 Thread Matthew Auld
Underneath it's the same stuff, so things like the PTE_LM bits for the GTT should just keep working as-is. Signed-off-by: Matthew Auld Reviewed-by: Tvrtko Ursulin --- drivers/gpu/drm/i915/gem/i915_gem_lmem.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/driver

[PATCH v2 4/4] drm/i915/stolen: actually mark as contiguous

2021-04-21 Thread Matthew Auld
we don't have a use for that. Signed-off-by: Matthew Auld Cc: Tvrtko Ursulin --- drivers/gpu/drm/i915/gem/i915_gem_stolen.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/gem/i915_gem_stolen.c b/drivers/gpu/drm/i915/gem/i915_gem_sto

[PATCH v2 3/4] drm/i915/stolen: enforce the min_page_size contract

2021-04-21 Thread Matthew Auld
From: CQ Tang Since stolen can now be device local-memory underneath, we should try to enforce any min_page_size restrictions when allocating pages. Signed-off-by: CQ Tang Signed-off-by: Matthew Auld Reviewed-by: Tvrtko Ursulin --- drivers/gpu/drm/i915/gem/i915_gem_stolen.c | 7 --- 1

Re: [Intel-gfx] [PATCH 11/19] drm/i915: Update the helper to set correct mapping

2021-04-21 Thread Matthew Auld
On 19/04/2021 16:01, Tvrtko Ursulin wrote: On 19/04/2021 15:37, Matthew Auld wrote: On 19/04/2021 15:07, Tvrtko Ursulin wrote: On 19/04/2021 12:30, Matthew Auld wrote: On 15/04/2021 12:05, Tvrtko Ursulin wrote: On 15/04/2021 10:23, Matthew Auld wrote: On Thu, 15 Apr 2021 at 09:21, Tvrtko

Re: [Intel-gfx] [PATCH 11/19] drm/i915: Update the helper to set correct mapping

2021-04-21 Thread Matthew Auld
On Wed, 21 Apr 2021 at 16:41, Tvrtko Ursulin wrote: > > > On 21/04/2021 12:42, Matthew Auld wrote: > > On 19/04/2021 16:01, Tvrtko Ursulin wrote: > >> > >> On 19/04/2021 15:37, Matthew Auld wrote: > >>> On 19/04/2021 15:07, Tvrtko Ursulin wrote: &g

Re: [PATCH] drm/amd/amdgpu/amdgpu_drv.c: Replace drm_modeset_lock_all with drm_modeset_lock

2021-04-22 Thread Matthew Wilcox
} > > - drm_modeset_unlock_all(drm_dev); > - I might remove the {} around ret = -EBUSY, but this is good. Reviewed-by: Matthew Wilcox (Oracle) ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [Intel-gfx] [PATCH 11/19] drm/i915: Update the helper to set correct mapping

2021-04-26 Thread Matthew Auld
On Wed, 21 Apr 2021 at 20:13, Matthew Auld wrote: > > On Wed, 21 Apr 2021 at 16:41, Tvrtko Ursulin > wrote: > > > > > > On 21/04/2021 12:42, Matthew Auld wrote: > > > On 19/04/2021 16:01, Tvrtko Ursulin wrote: > > >> > > >> On 19/04

[PATCH 1/9] drm/doc/rfc: i915 DG1 uAPI

2021-04-26 Thread Matthew Auld
region_query and region_info, just keep the bare minimum needed for padding Signed-off-by: Matthew Auld Cc: Joonas Lahtinen Cc: Thomas Hellström Cc: Daniele Ceraolo Spurio Cc: Lionel Landwerlin Cc: Jon Bloomfield Cc: Jordan Justen Cc: Daniel Vetter Cc: Kenneth Graunke Cc: Jason Ekstrand

[PATCH 5/9] drm/i915/uapi: introduce drm_i915_gem_create_ext

2021-04-26 Thread Matthew Auld
apply our extensions to. v3:(Daniel & Jason) - drop I915_GEM_CREATE_EXT_SETPARAM. Instead just have each extension do one thing only, instead of generic setparam which can cover various use cases. - add some kernel-doc. Signed-off-by: Matthew Auld Signed-off-by: CQ Ta

[PATCH 4/9] drm/i915: rework gem_create flow for upcoming extensions

2021-04-26 Thread Matthew Auld
Signed-off-by: Matthew Auld Cc: Joonas Lahtinen Cc: Thomas Hellström Cc: Daniele Ceraolo Spurio Cc: Lionel Landwerlin Cc: Jon Bloomfield Cc: Jordan Justen Cc: Daniel Vetter Cc: Kenneth Graunke Cc: Jason Ekstrand Cc: Dave Airlie Cc: dri-devel@lists.freedesktop.org Cc: mesa-...@lists.freed

[PATCH 2/9] drm/i915: mark stolen as private

2021-04-26 Thread Matthew Auld
In the next patch we want to expose the supported regions to userspace, which can then be fed into the gem_create_ext placement extensions. For now treat stolen memory as private from userspace pov. Signed-off-by: Matthew Auld Cc: Joonas Lahtinen Cc: Thomas Hellström Cc: Daniele Ceraolo Spurio

[PATCH 6/9] drm/i915/uapi: implement object placement extension

2021-04-26 Thread Matthew Auld
ason): - Add a bunch of kernel-doc - Simplify design for placements extension Testcase: igt/gem_create/create-ext-placement-sanity-check Testcase: igt/gem_create/create-ext-placement-each Testcase: igt/gem_create/create-ext-placement-all Signed-off-by: Matthew Auld Signed-off-by: CQ Tang

[PATCH 3/9] drm/i915/query: Expose memory regions through the query uAPI

2021-04-26 Thread Matthew Auld
From: Abdiel Janulgue Returns the available memory region areas supported by the HW. v2(Daniel & Jason): - Add some kernel-doc, including example usage. - Drop all the extra rsvd Signed-off-by: Abdiel Janulgue Signed-off-by: Matthew Auld Cc: Joonas Lahtinen Cc: Thomas Hellström

[PATCH 7/9] drm/i915/lmem: support optional CPU clearing for special internal use

2021-04-26 Thread Matthew Auld
For some internal device local-memory objects it would be useful to have an option to CPU clear the pages upon gathering the backing store. Note that this might be before the blitter is useable, which is the case for some internal GuC objects. Signed-off-by: Matthew Auld Cc: Joonas Lahtinen Cc

[PATCH 8/9] drm/i915/gem: clear userspace buffers for LMEM

2021-04-26 Thread Matthew Auld
: Matthew Auld Cc: Joonas Lahtinen Cc: Thomas Hellström Cc: Daniele Ceraolo Spurio Cc: Lionel Landwerlin Cc: Jon Bloomfield Cc: Jordan Justen Cc: Daniel Vetter Cc: Kenneth Graunke Cc: Jason Ekstrand Cc: Dave Airlie Cc: dri-devel@lists.freedesktop.org Cc: mesa-...@lists.freedesktop.org

[PATCH 9/9] drm/i915/gem: hide new uAPI behind CONFIG_BROKEN

2021-04-26 Thread Matthew Auld
Treat it the same as the fake local-memory stuff, where it is disabled for normal kernels, in case some random UMD is tempted to use this. Once we have all the other bits and pieces in place, like the TTM conversion, we can turn this on for real. Signed-off-by: Matthew Auld Cc: Joonas Lahtinen

[PATCH 2/7] drm/i915: Update the helper to set correct mapping

2021-04-26 Thread Matthew Auld
From: Venkata Sandeep Dhanalakota Determine the possible coherent map type based on object location, and if target has llc or if user requires an always coherent mapping. Cc: Matthew Auld Cc: CQ Tang Suggested-by: Michal Wajdeczko Signed-off-by: Venkata Sandeep Dhanalakota Signed-off-by

[PATCH 1/7] drm/i915/dg1: Fix mapping type for default state object

2021-04-26 Thread Matthew Auld
From: Venkata Ramana Nayana Use I915_MAP_WC when default state object is allocated in LMEM. Signed-off-by: Venkata Ramana Nayana Reviewed-by: Matthew Auld Signed-off-by: Matthew Auld --- drivers/gpu/drm/i915/gt/shmem_utils.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff

[PATCH 4/7] drm/i915/gtt/dgfx: place the PD in LMEM

2021-04-26 Thread Matthew Auld
It's a requirement that for dgfx we place all the paging structures in device local-memory. v2: use i915_coherent_map_type() Signed-off-by: Matthew Auld Cc: Tvrtko Ursulin --- drivers/gpu/drm/i915/gt/gen8_ppgtt.c | 5 - drivers/gpu/drm/i915/gt/intel_gtt.c

[PATCH 3/7] drm/i915/gtt: map the PD up front

2021-04-26 Thread Matthew Auld
simple single page shmemfs object will return a plain kmap, that is then kept for the lifetime of the page directory. v2: (Thomas) Rebase on dma_resv and obj->mm.lock removal. Signed-off-by: Matthew Auld Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin --- .../drm/i915/gem/selfte

[PATCH 5/7] drm/i915/fbdev: Use lmem physical addresses for fb_mmap() on discrete

2021-04-26 Thread Matthew Auld
From: Mohammed Khajapasha Use local memory io BAR address for fbdev's fb_mmap() operation on discrete, fbdev uses the physical address of our framebuffer for its fb_mmap() fn. Signed-off-by: Mohammed Khajapasha Reviewed-by: Matthew Auld Signed-off-by: Matthew Auld --- drivers/gpu/drm

[PATCH 6/7] drm/i915/lmem: Bypass aperture when lmem is available

2021-04-26 Thread Matthew Auld
: Ville Syrjälä Cc: Dhinakaran Pandiyan Cc: Maarten Lankhorst Cc: Chris P Wilson Cc: Daniel Vetter Cc: Joonas Lahtinen Cc: Daniele Ceraolo Spurio Cc: CQ Tang Signed-off-by: Anusha Srivatsa Signed-off-by: Matthew Auld Reviewed-by: Tvrtko Ursulin --- drivers/gpu/drm/i915/display/intel_fbdev.c

[PATCH 7/7] drm/i915: Return error value when bo not in LMEM for discrete

2021-04-26 Thread Matthew Auld
From: Mohammed Khajapasha Return EREMOTE value when frame buffer object is not backed by LMEM for discrete. If Local memory is supported by hardware the framebuffer backing gem objects should be from local memory. Signed-off-by: Mohammed Khajapasha Signed-off-by: Matthew Auld Reviewed-by

Re: [PATCH 1/9] drm/doc/rfc: i915 DG1 uAPI

2021-04-26 Thread Matthew Auld
On 26/04/2021 16:11, Jason Ekstrand wrote: On Mon, Apr 26, 2021 at 4:42 AM Matthew Auld wrote: Add an entry for the new uAPI needed for DG1. Also add the overall upstream plan, including some notes for the TTM conversion. v2(Daniel): - include the overall upstreaming plan - add a note

Re: [PATCH 3/7] drm/i915/gtt: map the PD up front

2021-04-26 Thread Matthew Auld
On 26/04/2021 16:20, Tvrtko Ursulin wrote: On 26/04/2021 11:18, Matthew Auld wrote: We need to general our accessor for the page directories and tables from Generalise? using the simple kmap_atomic to support local memory, and this setup must be done on acquisition of the backing storage

Re: [PATCH 4/7] drm/i915/gtt/dgfx: place the PD in LMEM

2021-04-26 Thread Matthew Auld
On 26/04/2021 16:22, Tvrtko Ursulin wrote: On 26/04/2021 11:18, Matthew Auld wrote: It's a requirement that for dgfx we place all the paging structures in device local-memory. v2: use i915_coherent_map_type() Signed-off-by: Matthew Auld Cc: Tvrtko Ursulin ---   drivers/gpu/drm/i9

[PATCH v2 1/7] drm/i915/dg1: Fix mapping type for default state object

2021-04-27 Thread Matthew Auld
From: Venkata Ramana Nayana Use I915_MAP_WC when default state object is allocated in LMEM. Signed-off-by: Venkata Ramana Nayana Reviewed-by: Matthew Auld Signed-off-by: Matthew Auld --- drivers/gpu/drm/i915/gt/shmem_utils.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff

[PATCH v2 3/7] drm/i915/gtt: map the PD up front

2021-04-27 Thread Matthew Auld
ff-by: Matthew Auld Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin --- .../drm/i915/gem/selftests/i915_gem_context.c | 11 + drivers/gpu/drm/i915/gt/gen6_ppgtt.c | 11 ++--- drivers/gpu/drm/i915/gt/gen8_ppgtt.c | 26 -- drivers/gpu/drm/i915/gt/intel_ggtt.c

[PATCH v2 7/7] drm/i915: Return error value when bo not in LMEM for discrete

2021-04-27 Thread Matthew Auld
From: Mohammed Khajapasha Return EREMOTE value when frame buffer object is not backed by LMEM for discrete. If Local memory is supported by hardware the framebuffer backing gem objects should be from local memory. Signed-off-by: Mohammed Khajapasha Signed-off-by: Matthew Auld Reviewed-by

[PATCH v2 6/7] drm/i915/lmem: Bypass aperture when lmem is available

2021-04-27 Thread Matthew Auld
: Ville Syrjälä Cc: Dhinakaran Pandiyan Cc: Maarten Lankhorst Cc: Chris P Wilson Cc: Daniel Vetter Cc: Joonas Lahtinen Cc: Daniele Ceraolo Spurio Cc: CQ Tang Signed-off-by: Anusha Srivatsa Signed-off-by: Matthew Auld Reviewed-by: Tvrtko Ursulin --- drivers/gpu/drm/i915/display/intel_fbdev.c

[PATCH v2 2/7] drm/i915: Update the helper to set correct mapping

2021-04-27 Thread Matthew Auld
From: Venkata Sandeep Dhanalakota Determine the possible coherent map type based on object location, and if target has llc or if user requires an always coherent mapping. Cc: Matthew Auld Cc: CQ Tang Suggested-by: Michal Wajdeczko Signed-off-by: Venkata Sandeep Dhanalakota Signed-off-by

[PATCH v2 5/7] drm/i915/fbdev: Use lmem physical addresses for fb_mmap() on discrete

2021-04-27 Thread Matthew Auld
From: Mohammed Khajapasha Use local memory io BAR address for fbdev's fb_mmap() operation on discrete, fbdev uses the physical address of our framebuffer for its fb_mmap() fn. Signed-off-by: Mohammed Khajapasha Reviewed-by: Matthew Auld Signed-off-by: Matthew Auld --- drivers/gpu/drm

[PATCH v2 4/7] drm/i915/gtt/dgfx: place the PD in LMEM

2021-04-27 Thread Matthew Auld
It's a requirement that for dgfx we place all the paging structures in device local-memory. v2: use i915_coherent_map_type() v3: improve the shared dma-resv object comment Signed-off-by: Matthew Auld Cc: Tvrtko Ursulin --- drivers/gpu/drm/i915/gt/gen8_ppgtt.c | 5 - drivers/gpu/drm

Re: [PATCH] drm/i9i5/gt: Fix a double free in gen8_preallocate_top_level_pdp

2021-04-27 Thread Matthew Auld
it is better to remove the first put? > > Fixes: 82adf901138cc ("drm/i915/gt: Shrink i915_page_directory's slab bucket") > Signed-off-by: Lv Yunlong Yes, it looks like this fixes a potential use-after-free. Thanks for the patch, Reviewed-by: Matthew Auld Pushed to drm-intel-gt

Re: [Intel-gfx] [PATCH v2 4/7] drm/i915/gtt/dgfx: place the PD in LMEM

2021-04-27 Thread Matthew Auld
On 27/04/2021 14:34, Tang, CQ wrote: -Original Message- From: Intel-gfx On Behalf Of Matthew Auld Sent: Tuesday, April 27, 2021 1:54 AM To: intel-...@lists.freedesktop.org Cc: dri-devel@lists.freedesktop.org Subject: [Intel-gfx] [PATCH v2 4/7] drm/i915/gtt/dgfx: place the PD in LMEM

Re: [PATCH 1/9] drm/doc/rfc: i915 DG1 uAPI

2021-04-28 Thread Matthew Auld
On 28/04/2021 16:16, Kenneth Graunke wrote: On Monday, April 26, 2021 2:38:53 AM PDT Matthew Auld wrote: +Existing uAPI issues + +Some potential issues we still need to resolve. + +I915 MMAP +- +In i915 there are multiple ways to MMAP GEM object, including mapping

Re: [PATCH 1/9] drm/doc/rfc: i915 DG1 uAPI

2021-04-28 Thread Matthew Auld
On 28/04/2021 16:51, Jason Ekstrand wrote: On Mon, Apr 26, 2021 at 4:42 AM Matthew Auld wrote: Add an entry for the new uAPI needed for DG1. Also add the overall upstream plan, including some notes for the TTM conversion. v2(Daniel): - include the overall upstreaming plan - add a note

Re: [Intel-gfx] [PATCH 08/21] drm/i915/gem: Disallow bonding of virtual engines

2021-04-28 Thread Matthew Brost
On Wed, Apr 28, 2021 at 12:18:29PM -0500, Jason Ekstrand wrote: > On Wed, Apr 28, 2021 at 5:13 AM Daniel Vetter wrote: > > > > On Tue, Apr 27, 2021 at 08:51:08AM -0500, Jason Ekstrand wrote: > > > On Fri, Apr 23, 2021 at 5:31 PM Jason Ekstrand > > > wrote: > > > > > > > > This adds a bunch of co

Re: [Intel-gfx] [PATCH 08/21] drm/i915/gem: Disallow bonding of virtual engines

2021-04-28 Thread Matthew Brost
On Wed, Apr 28, 2021 at 12:46:07PM -0500, Jason Ekstrand wrote: > On Wed, Apr 28, 2021 at 12:26 PM Matthew Brost > wrote: > > > > On Wed, Apr 28, 2021 at 12:18:29PM -0500, Jason Ekstrand wrote: > > > On Wed, Apr 28, 2021 at 5:13 AM Daniel Vetter wrote: > > >

[PATCH v2 1/9] drm/doc/rfc: i915 DG1 uAPI

2021-04-29 Thread Matthew Auld
(Kenneth) - improve the comment for the smem+lmem mmap mode and caching Signed-off-by: Matthew Auld Cc: Joonas Lahtinen Cc: Thomas Hellström Cc: Daniele Ceraolo Spurio Cc: Lionel Landwerlin Cc: Jon Bloomfield Cc: Jordan Justen Cc: Daniel Vetter Cc: Kenneth Graunke Cc: Jason Ekstrand Cc: Dave

[PATCH v2 2/9] drm/i915: mark stolen as private

2021-04-29 Thread Matthew Auld
In the next patch we want to expose the supported regions to userspace, which can then be fed into the gem_create_ext placement extensions. For now treat stolen memory as private from userspace pov. Signed-off-by: Matthew Auld Cc: Joonas Lahtinen Cc: Thomas Hellström Cc: Daniele Ceraolo Spurio

[PATCH v2 3/9] drm/i915/query: Expose memory regions through the query uAPI

2021-04-29 Thread Matthew Auld
From: Abdiel Janulgue Returns the available memory region areas supported by the HW. v2(Daniel & Jason): - Add some kernel-doc, including example usage. - Drop all the extra rsvd v3(Jason & Tvrtko) - add back rsvd Signed-off-by: Abdiel Janulgue Signed-off-by: Matthew

[PATCH v2 4/9] drm/i915: rework gem_create flow for upcoming extensions

2021-04-29 Thread Matthew Auld
Signed-off-by: Matthew Auld Cc: Joonas Lahtinen Cc: Thomas Hellström Cc: Daniele Ceraolo Spurio Cc: Lionel Landwerlin Cc: Jon Bloomfield Cc: Jordan Justen Cc: Daniel Vetter Cc: Kenneth Graunke Cc: Jason Ekstrand Cc: Dave Airlie Cc: dri-devel@lists.freedesktop.org Cc: mesa-...@lists.freed

[PATCH v2 5/9] drm/i915/uapi: introduce drm_i915_gem_create_ext

2021-04-29 Thread Matthew Auld
apply our extensions to. v3:(Daniel & Jason) - drop I915_GEM_CREATE_EXT_SETPARAM. Instead just have each extension do one thing only, instead of generic setparam which can cover various use cases. - add some kernel-doc. Signed-off-by: Matthew Auld Signed-off-by: CQ Ta

[PATCH v2 6/9] drm/i915/uapi: implement object placement extension

2021-04-29 Thread Matthew Auld
ason): - Add a bunch of kernel-doc - Simplify design for placements extension Testcase: igt/gem_create/create-ext-placement-sanity-check Testcase: igt/gem_create/create-ext-placement-each Testcase: igt/gem_create/create-ext-placement-all Signed-off-by: Matthew Auld Signed-off-by: CQ Tang

[PATCH v2 7/9] drm/i915/lmem: support optional CPU clearing for special internal use

2021-04-29 Thread Matthew Auld
For some internal device local-memory objects it would be useful to have an option to CPU clear the pages upon gathering the backing store. Note that this might be before the blitter is useable, which is the case for some internal GuC objects. Signed-off-by: Matthew Auld Cc: Joonas Lahtinen Cc

[PATCH v2 8/9] drm/i915/gem: clear userspace buffers for LMEM

2021-04-29 Thread Matthew Auld
: Matthew Auld Cc: Joonas Lahtinen Cc: Thomas Hellström Cc: Daniele Ceraolo Spurio Cc: Lionel Landwerlin Cc: Jon Bloomfield Cc: Jordan Justen Cc: Daniel Vetter Cc: Kenneth Graunke Cc: Jason Ekstrand Cc: Dave Airlie Cc: dri-devel@lists.freedesktop.org Cc: mesa-...@lists.freedesktop.org Reviewed

[PATCH v2 9/9] drm/i915/gem: hide new uAPI behind CONFIG_BROKEN

2021-04-29 Thread Matthew Auld
Treat it the same as the fake local-memory stuff, where it is disabled for normal kernels, in case some random UMD is tempted to use this. Once we have all the other bits and pieces in place, like the TTM conversion, we can turn this on for real. Signed-off-by: Matthew Auld Cc: Joonas Lahtinen

Re: [Intel-gfx] [PATCH 08/21] drm/i915/gem: Disallow bonding of virtual engines

2021-04-29 Thread Matthew Brost
On Thu, Apr 29, 2021 at 02:14:19PM +0200, Daniel Vetter wrote: > On Wed, Apr 28, 2021 at 01:17:27PM -0500, Jason Ekstrand wrote: > > On Wed, Apr 28, 2021 at 1:02 PM Matthew Brost > > wrote: > > > > > > On Wed, Apr 28, 2021 at 12:46:07PM -0500, Jason Ekstrand wr

Re: [PATCH 01/13] drm/ttm: add ttm_sys_manager v2

2021-04-30 Thread Matthew Auld
m_sys_man_alloc, > + .free = ttm_sys_man_free, > +}; > + > +int ttm_sys_man_init(struct ttm_device *bdev) > +{ > + struct ttm_resource_manager *man = &bdev->sysman; > + > + /* > +* Initialize the system memory buffer type. > +* Other types need to be driver / IOCTL initialized. > +*/ > + man->use_tt = true; > + man->func = &ttm_sys_manager_func; > + > + ttm_resource_manager_init(man, 0); > + ttm_set_driver_manager(bdev, TTM_PL_SYSTEM, man); > + ttm_resource_manager_set_used(man, true); > + return 0; > +} Can this return non-zero value later in the series? If not, we can maybe just make this void. Either way, Reviewed-by: Matthew Auld > -- > 2.25.1 > ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH 03/13] drm/ttm: properly allocate sys resource during swapout

2021-04-30 Thread Matthew Auld
On Fri, 30 Apr 2021 at 10:25, Christian König wrote: > > Drop the special handling here. > > Signed-off-by: Christian König Reviewed-by: Matthew Auld ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop

Re: [PATCH 05/13] drm/ttm: allocate resource object instead of embedding it

2021-04-30 Thread Matthew Auld
On Fri, 30 Apr 2021 at 10:25, Christian König wrote: > > To improve the handling we want the establish the resource object as base > class for the backend allocations. > > Signed-off-by: Christian König > --- > drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 4 +- > drivers/gpu/drm/amd/amdgpu/amdg

Re: [PATCH 02/13] drm/ttm: always initialize the full ttm_resource

2021-04-30 Thread Matthew Auld
On Fri, 30 Apr 2021 at 10:25, Christian König wrote: > > Init all fields in ttm_resource_alloc() when we create a new resource. > > Signed-off-by: Christian König > Reviewed-by: Matthew Auld > --- > drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 2 -- > drivers/gpu/drm/ttm/

Re: [PATCH 06/13] drm/ttm: flip over the range manager to self allocated nodes

2021-04-30 Thread Matthew Auld
de/drm/ttm/ttm_range_manager.h > b/include/drm/ttm/ttm_range_manager.h > new file mode 100644 > index ..e02b6c8d355e > --- /dev/null > +++ b/include/drm/ttm/ttm_range_manager.h > @@ -0,0 +1,43 @@ > +/* SPDX-License-Identifier: GPL-2.0 OR MIT */ > + > +#ifndef _TTM_RANGE_MANAGER_H_ > +#define _TTM_RANGE_MANAGER_H_ > + > +#include > +#include > + > +/** > + * struct ttm_range_mgr_node > + * > + * @base: base clase we extend > + * @mm_nodes: MM nodes, usually 1 > + * > + * Extending the ttm_resource object to manage an address space allocation > with > + * one or more drm_mm_nodes. > + */ > +struct ttm_range_mgr_node { > + struct ttm_resource base; > + struct drm_mm_node mm_nodes[]; > +}; > + > +/** > + * to_ttm_range_mgr_node > + * > + * @res: the resource to upcast > + * > + * Upcast the ttm_resource object into a ttm_range_mgr_node object. > + */ > +static inline struct ttm_range_mgr_node * > +to_ttm_range_mgr_node(struct ttm_resource *res) > +{ > + return container_of(res->mm_node, struct ttm_range_mgr_node, > + mm_nodes[1]); Should be mm_nodes[0]? Otherwise I think looks good, Reviewed-by: Matthew Auld ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH 07/13] drm/ttm: flip over the sys manager to self allocated nodes

2021-04-30 Thread Matthew Auld
On Fri, 30 Apr 2021 at 10:25, Christian König wrote: > > Make sure to allocate a resource object here. > > Signed-off-by: Christian König Ok, I guess I have to keep reading, Reviewed-by: Matthew Auld > --- > drivers/gpu/drm/ttm/ttm_sys_manager.c | 7 +++ > 1 file

Re: [PATCH 09/13] drm/amdgpu: switch the GTT backend to self alloc

2021-04-30 Thread Matthew Auld
On Fri, 30 Apr 2021 at 10:25, Christian König wrote: > > Similar to the TTM range manager. > > Signed-off-by: Christian König Reviewed-by: Matthew Auld ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop

Re: [PATCH 10/13] drm/amdgpu: switch the VRAM backend to self alloc

2021-04-30 Thread Matthew Auld
; > struct amdgpu_device *adev = to_amdgpu_device(mgr); > - struct drm_mm_node *nodes = mem->mm_node; > + struct ttm_range_mgr_node *node; > uint64_t usage = 0, vis_usage = 0; > unsigned pages = mem->num_pages; > + struct drm_mm_node *nodes; >

Re: [PATCH 11/13] drm/nouveau: switch the TTM backends to self alloc

2021-04-30 Thread Matthew Auld
On Fri, 30 Apr 2021 at 10:25, Christian König wrote: > > Similar to the TTM range manager. > > Signed-off-by: Christian König > --- > drivers/gpu/drm/nouveau/nouveau_mem.h | 1 + > drivers/gpu/drm/nouveau/nouveau_ttm.c | 4 > 2 files changed, 5 insertions(+) > > diff --git a/drivers/gpu/drm

Re: [PATCH 07/13] drm/ttm: flip over the sys manager to self allocated nodes

2021-04-30 Thread Matthew Auld
On Fri, 30 Apr 2021 at 10:25, Christian König wrote: > > Make sure to allocate a resource object here. > > Signed-off-by: Christian König > --- > drivers/gpu/drm/ttm/ttm_sys_manager.c | 7 +++ > 1 file changed, 7 insertions(+) > > diff --git a/drivers/gpu/drm/ttm/ttm_sys_manager.c > b/drive

Re: [Intel-gfx] [PATCH 08/21] drm/i915/gem: Disallow bonding of virtual engines

2021-05-01 Thread Matthew Brost
On Fri, Apr 30, 2021 at 12:11:07PM +0200, Daniel Vetter wrote: > On Thu, Apr 29, 2021 at 09:03:48PM -0700, Matthew Brost wrote: > > On Thu, Apr 29, 2021 at 02:14:19PM +0200, Daniel Vetter wrote: > > > On Wed, Apr 28, 2021 at 01:17:27PM -0500, Jason Ekstrand wrote: > > >

[PATCH 01/46] drm/i915/guc: Allow flexible number of context ids

2021-08-03 Thread Matthew Brost
Number of available GuC contexts ids might be limited. Stop referring in code to macro and use variable instead. Signed-off-by: Michal Wajdeczko Signed-off-by: Matthew Brost --- drivers/gpu/drm/i915/gt/uc/intel_guc.h | 2 ++ .../gpu/drm/i915/gt/uc/intel_guc_submission.c| 16

[PATCH 21/46] drm/i915/guc: Add guc_child_context_destroy

2021-08-03 Thread Matthew Brost
Since child contexts do not own the guc_ids or GuC context registration, child contexts can simply be freed on destroy. Add guc_child_context_destroy context operation to do this. Signed-off-by: Matthew Brost --- drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c | 7 +++ 1 file changed, 7

[PATCH 30/46] drm/i915/guc: Implement no mid batch preemption for multi-lrc

2021-08-03 Thread Matthew Brost
a context is configured by set parallel extension. Signed-off-by: Matthew Brost --- drivers/gpu/drm/i915/gt/intel_context.c | 2 +- drivers/gpu/drm/i915/gt/intel_context_types.h | 3 + drivers/gpu/drm/i915/gt/uc/intel_guc_fwif.h | 2 +- .../gpu/drm/i915/gt/uc/intel_guc_submissio

[PATCH 26/46] drm/i915: Connect UAPI to GuC multi-lrc interface

2021-08-03 Thread Matthew Brost
Introduce 'set parallel submit' extension to connect UAPI to GuC multi-lrc interface. Kernel doc in new uAPI should explain it all. Cc: Tvrtko Ursulin Signed-off-by: Matthew Brost --- drivers/gpu/drm/i915/gem/i915_gem_context.c | 157 +- .../gpu/dr

[PATCH 28/46] drm/i915/guc: Add basic GuC multi-lrc selftest

2021-08-03 Thread Matthew Brost
Add very basic (single submission) multi-lrc selftest. Signed-off-by: Matthew Brost --- .../gpu/drm/i915/gt/uc/intel_guc_submission.c | 1 + .../drm/i915/gt/uc/selftest_guc_multi_lrc.c | 168 ++ .../drm/i915/selftests/i915_live_selftests.h | 1 + 3 files changed, 170

[PATCH 37/46] drm/i915: Teach execbuf there can be more than one batch in the objects list

2021-08-03 Thread Matthew Brost
will enable multiple do_execbuf calls with a single exec object array in a later patch. Suggested-by: Tvrtko Ursulin Signed-off-by: Matthew Brost --- .../gpu/drm/i915/gem/i915_gem_execbuffer.c| 31 +-- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/drivers/gpu

[PATCH 27/46] drm/i915/doc: Update parallel submit doc to point to i915_drm.h

2021-08-03 Thread Matthew Brost
Update parallel submit doc to point to i915_drm.h Signed-off-by: Matthew Brost --- Documentation/gpu/rfc/i915_parallel_execbuf.h | 122 -- Documentation/gpu/rfc/i915_scheduler.rst | 4 +- 2 files changed, 2 insertions(+), 124 deletions(-) delete mode 100644 Documentation

[PATCH 45/46] drm/i915/execlists: Weak parallel submission support for execlists

2021-08-03 Thread Matthew Brost
meantime. Signed-off-by: Matthew Brost --- drivers/gpu/drm/i915/gem/i915_gem_context.c | 9 +- drivers/gpu/drm/i915/gt/intel_context.c | 1 - .../drm/i915/gt/intel_execlists_submission.c | 201 +- 3 files changed, 205 insertions(+), 6 deletions(-) diff --git a/drivers/gpu

[PATCH 43/46] drm/i915/guc: Handle errors in multi-lrc requests

2021-08-03 Thread Matthew Brost
. If all the requests are not present this handshake doesn't work. To work around this, if multi-lrc request has an error we skip the handshake but still emit the breadcrumbs seqno. Signed-off-by: Matthew Brost --- .../gpu/drm/i915/gt/uc/intel_guc_submission.c | 61 ++- 1

[PATCH 44/46] drm/i915: Enable multi-bb execbuf

2021-08-03 Thread Matthew Brost
Enable multi-bb execbuf by enabling the set_parallel extension. Signed-off-by: Matthew Brost --- drivers/gpu/drm/i915/gem/i915_gem_context.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/gpu/drm/i915/gem/i915_gem_context.c b/drivers/gpu/drm/i915/gem/i915_gem_context.c index

[PATCH 31/46] drm/i915: Move secure execbuf check to execbuf2

2021-08-03 Thread Matthew Brost
Goal is to remove all input sanity checks from the core submission. Signed-off-by: Tvrtko Ursulin Signed-off-by: Matthew Brost --- .../gpu/drm/i915/gem/i915_gem_execbuffer.c| 35 +++ 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/drivers/gpu/drm/i915/gem

[PATCH 35/46] drm/i915: Store batch index in struct i915_execbuffer

2021-08-03 Thread Matthew Brost
This will help with upcoming extensions where more than 1 batch can be submitted in a single execbuf IOCTL. Signed-off-by: Tvrtko Ursulin Signed-off-by: Matthew Brost --- .../gpu/drm/i915/gem/i915_gem_execbuffer.c| 19 +-- 1 file changed, 9 insertions(+), 10 deletions

[PATCH 33/46] drm/i915: Move output fence handling to i915_gem_execbuffer2

2021-08-03 Thread Matthew Brost
Move the job of creating a new file descriptor and passing it back to userspace to i915_gem_execbuffer2. Signed-off-by: Tvrtko Ursulin Signed-off-by: Matthew Brost --- .../gpu/drm/i915/gem/i915_gem_execbuffer.c| 45 ++- 1 file changed, 25 insertions(+), 20 deletions

[PATCH 40/46] drm/i915: Multi-batch execbuffer2

2021-08-03 Thread Matthew Brost
d put into the dma reseveration excl fence slot. Suggested-by: Tvrtko Ursulin Signed-off-by: Matthew Brost --- .../gpu/drm/i915/gem/i915_gem_execbuffer.c| 262 +++--- drivers/gpu/drm/i915/gt/intel_context.c | 5 + drivers/gpu/drm/i915/gt/intel_context_types.h | 9 + driver

[PATCH 38/46] drm/i915: Only track object dependencies on first request

2021-08-03 Thread Matthew Brost
Only track object dependencies on the first request generated from the execbuf, this help with the upcoming multi-bb execbuf extension. Signed-off-by: Matthew Brost --- drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a

[PATCH 41/46] drm/i915: Eliminate unnecessary VMA calls for multi-BB submission

2021-08-03 Thread Matthew Brost
Certain VMA functions in the execbuf IOCTL only need to be called on first or last BB of a multi-BB submission. eb_relocate() on the first and eb_release_vmas() on the last. Doing so will save CPU / GPU cycles. Signed-off-by: Matthew Brost --- .../gpu/drm/i915/gem/i915_gem_execbuffer.c| 127

[PATCH 42/46] drm/i915: Hold all parallel requests until last request, properly handle error

2021-08-03 Thread Matthew Brost
Hold all parallel requests, via a submit fence, until the last request is generated. If an error occurs in the middle of generating the requests, skip the requests signal the backend of the error via a request flag. Signed-off-by: Matthew Brost --- .../gpu/drm/i915/gem/i915_gem_execbuffer.c

[PATCH 46/46] drm/i915/guc: Add delay before disabling scheduling on contexts

2021-08-03 Thread Matthew Brost
likely cause many selftests to fail. Follow up patches will fix all the selftests and enable the delay period. Signed-off-by: Matthew Brost --- drivers/gpu/drm/i915/gem/i915_gem_context.c | 2 +- .../i915/gem/selftests/i915_gem_coherency.c | 2 +- .../drm/i915/gem/selftests

Re: [Intel-gfx] [PATCH 1/4] drm/i915: Do not define vma on stack

2021-08-04 Thread Matthew Brost
On Mon, Aug 02, 2021 at 10:11:18PM -0700, Matthew Brost wrote: > From: Venkata Sandeep Dhanalakota > > Defining vma on stack can cause stack overflow, if > vma gets populated with new fields. > > Cc: Daniele Ceraolo Spurio > Cc: Tvrtko Ursulin > Signed-off-by: Ven

Re: [Intel-gfx] [PATCH] drm/i915: Be more gentle when exiting non-persistent contexts

2021-08-05 Thread Matthew Brost
On Thu, Aug 05, 2021 at 01:05:09PM +0100, Tvrtko Ursulin wrote: > From: Tvrtko Ursulin > > When a non-persistent context exits we currently mark it as banned in > order to trigger fast termination of any outstanding GPU jobs it may have > left running. > > In doing so we apply a very strict 1ms

<    1   2   3   4   5   6   7   8   9   10   >