Re: [PATCH v2 0/2] drm/i915/mtl: Add PTE encode functions

2023-04-25 Thread Das, Nirmoy
On 4/24/2023 8:29 PM, fei.y...@intel.com wrote: From: Fei Yang Extract PTE patch from https://patchwork.freedesktop.org/series/116868/ to fix MTL boot issue caused by MOCS/PAT update. v2: address comment from Matt. Fei Yang (2): drm/i915/mtl: Add PTE encode function drm/i915/mtl: work

Re: [PATCH 0/2] Restore MTL boot

2023-04-24 Thread Das, Nirmoy
On 4/24/2023 6:09 PM, Andi Shyti wrote: Hi, The two patches reverted in this series are, together, preventing MTL from booting. Revert them until the fix is deployed. Andi Andi Shyti (2): Revert "drm/i915/mtl: fix mocs selftest" Revert "drm/i915/mtl: Define MOCS and PAT tables for MTL

Re: [Intel-gfx] [PATCH] drm/i915/mtl: workaround coherency issue for Media

2023-04-21 Thread Das, Nirmoy
On 4/20/2023 11:30 PM, Matt Roper wrote: On Thu, Apr 20, 2023 at 01:38:59PM +0200, Nirmoy Das wrote: From: Fei Yang This patch implements Wa_22016122933. In MTL, memory writes initiated by Media tile update the whole cache line even for partial writes. This creates a coherency problem for c

Re: [Intel-gfx] [PATCH 4/8] drm/i915/mtl: workaround coherency issue for Media

2023-04-20 Thread Das, Nirmoy
This is a important fix and can be pushed without depending on this series. I will send this out to mailing list separately for CI. Regards, Nirmoy On 4/20/2023 1:00 AM, fei.y...@intel.com wrote: From: Fei Yang This patch implements Wa_22016122933. In MTL, memory writes initiated by Media

Re: [Intel-gfx] [PATCH 1/8] drm/i915/mtl: Set has_llc=0

2023-04-20 Thread Das, Nirmoy
We have multiple bugs that requires this and it can be picked up irrespective of this series. I have sent a trybot patch for this and once that passes, I will push this one. https://patchwork.freedesktop.org/series/116746/ Nirmoy On 4/20/2023 1:00 AM, fei.y...@intel.com wrote: From: Fei Ya

Re: [PATCH 4/8] drm/i915/mtl: workaround coherency issue for Media

2023-04-19 Thread Das, Nirmoy
On 4/17/2023 8:24 AM, fei.y...@intel.com wrote: From: Fei Yang This patch implements Wa_22016122933. In MTL, memory writes initiated by Media tile update the whole cache line even for partial writes. This creates a coherency problem for cacheable memory if both CPU and GPU are writing data t

Re: [PATCH 3/8] drm/i915/mtl: Add PTE encode function

2023-04-19 Thread Das, Nirmoy
On 4/17/2023 8:24 AM, fei.y...@intel.com wrote: From: Fei Yang PTE encode functions are platform dependent. This patch implements PTE functions for MTL, and ensures the correct PTE encode function is used by calling pte_encode function pointer instead of the hardcoded gen8 version of PTE enco

Re: [Intel-gfx] [PATCH 2/8] drm/i915/mtl: Define MOCS and PAT tables for MTL

2023-04-19 Thread Das, Nirmoy
On 4/17/2023 8:24 AM, fei.y...@intel.com wrote: From: Madhumitha Tolakanahalli Pradeep On MTL, GT can no longer allocate on LLC - only the CPU can. This, along with addition of support for L4 cache calls a s/calls a/calls for a MOCS/PAT table update. Alos the PAT index registers are multicas

Re: [Intel-gfx] [PATCH 1/8] drm/i915/mtl: Set has_llc=0

2023-04-19 Thread Das, Nirmoy
On 4/17/2023 8:24 AM, fei.y...@intel.com wrote: From: Fei Yang On MTL, GT is no longer allocated on LLC, set has_llc=0. This statement is bit unclear to me.  I would say "On MTL, LLC is not shared between GT and CPU" Otherwise Reviewed-by: Nirmoy Das Signed-off-by: Fei Yang ---

Re: [PATCH v4 5/5] drm/i915/gt: Make sure that errors are propagated through request chains

2023-04-10 Thread Das, Nirmoy
On 3/8/2023 10:41 AM, Andi Shyti wrote: Currently, when we perform operations such as clearing or copying large blocks of memory, we generate multiple requests that are executed in a chain. However, if one of these requests fails, we may not realize it unless it happens to be the last request

Re: [PATCH v4 3/5] drm/i915: Create the locked version of the request create

2023-04-10 Thread Das, Nirmoy
On 3/8/2023 10:41 AM, Andi Shyti wrote: Make version of the request creation that doesn't hold any lock. Signed-off-by: Andi Shyti Cc: sta...@vger.kernel.org Reviewed-by: Nirmoy Das --- drivers/gpu/drm/i915/i915_request.c | 43 +++-- drivers/gpu/drm/i915/i915_r

Re: [PATCH v4 2/5] drm/i915/gt: Add intel_context_timeline_is_locked helper

2023-04-10 Thread Das, Nirmoy
On 3/8/2023 10:41 AM, Andi Shyti wrote: We have: - intel_context_timeline_lock() - intel_context_timeline_unlock() In the next patches we will also need: - intel_context_timeline_is_locked() Add it. Signed-off-by: Andi Shyti Cc: sta...@vger.kernel.org Reviewed-by: Nirmoy Das -

Re: [Intel-gfx] [PATCH 1/7] drm/i915/mtl: Define MOCS and PAT tables for MTL

2023-04-06 Thread Das, Nirmoy
Hi Fei, On 4/6/2023 4:55 PM, Yang, Fei wrote: > On 4/1/2023 8:38 AM, fei.y...@intel.com wrote: >> From: Fei Yang >> >> On MTL, GT can no longer allocate on LLC - only the CPU can. >> This, along with addition of support for ADM/L4 cache calls a >> MOCS/PAT table update. >> Also add PTE encode f

Re: [Intel-gfx] [PATCH 1/7] drm/i915/mtl: Define MOCS and PAT tables for MTL

2023-04-06 Thread Das, Nirmoy
Hi Fei, On 4/1/2023 8:38 AM, fei.y...@intel.com wrote: From: Fei Yang On MTL, GT can no longer allocate on LLC - only the CPU can. This, along with addition of support for ADM/L4 cache calls a MOCS/PAT table update. Also add PTE encode functions for MTL as it has different PAT index definition

Re: [PATCH 1/5] drm/i915/ttm: Add I915_BO_PREALLOC

2023-04-05 Thread Das, Nirmoy
Hi Andi, On 4/5/2023 1:53 PM, Andi Shyti wrote: Hi Nirmoy, Add a mechanism to keep existing data when creating a ttm object with I915_BO_ALLOC_USER flag. why do we need this mechanism? What was the logic behind? These are all questions people might have when checking this commit. Please be a

Re: [PATCH 1/5] drm/i915/ttm: Add I915_BO_PREALLOC

2023-04-05 Thread Das, Nirmoy
On 4/4/2023 6:23 PM, Andi Shyti wrote: Hi Nirmoy, On Tue, Apr 04, 2023 at 04:30:56PM +0200, Nirmoy Das wrote: Add a mechanism to keep existing data when creating a ttm object with I915_BO_ALLOC_USER flag. why do we need this mechanism? What was the logic behind? These are all questions peopl

Re: [PATCH 1/5] drm/i915/ttm: Add I915_BO_PREALLOC

2023-04-05 Thread Das, Nirmoy
On 4/4/2023 5:30 PM, Andrzej Hajda wrote: On 04.04.2023 16:30, Nirmoy Das wrote: Add a mechanism to keep existing data when creating a ttm object with I915_BO_ALLOC_USER flag. Cc: Matthew Auld Cc: Andi Shyti Cc: Andrzej Hajda Cc: Ville Syrjälä Cc: Jani Nikula Cc: Imre Deak Signed-off-

Re: [Intel-gfx] [PATCH v3] drm/i915/mtl: Disable stolen memory backed FB for A0

2023-04-04 Thread Das, Nirmoy
On 4/4/2023 8:27 PM, Ville Syrjälä wrote: On Tue, Apr 04, 2023 at 08:13:42PM +0200, Nirmoy Das wrote: Stolen memory is not usable for MTL A0 stepping beyond certain access size and we have no control over userspace access size of /dev/fb which can be backed by stolen memory. So disable stolen

Re: [PATCH 3/5] drm/i915: Add a function to mmap framebuffer obj

2023-04-04 Thread Das, Nirmoy
Hi Andi, On 4/4/2023 6:57 PM, Andi Shyti wrote: Hi Nirmoy, [...] +int i915_gem_fb_mmap(struct drm_i915_gem_object *obj, struct vm_area_struct *vma) +{ + struct drm_i915_private *i915 = to_i915(obj->base.dev); + struct drm_device *dev = &i915->drm; + struct i915_mmap_offset

Re: [PATCH] drm/i915/mtl: Fix MTL stolen memory GGTT mapping

2023-03-28 Thread Das, Nirmoy
On 3/28/2023 3:24 AM, Daniele Ceraolo Spurio wrote: The PTEs expect the offset from the base of the fake LMEM region (i.e. the base of stolen) and not from the base of the DSM. Quoting the specs: "Driver will set the Device Memory bit = 1 in the PTE when pointing to a page in DSM and program th

Re: [PATCH] drm/i915/gem: Flush lmem contents after construction

2023-03-23 Thread Das, Nirmoy
On 3/16/2023 5:59 PM, Nirmoy Das wrote: From: Chris Wilson i915_gem_object_create_lmem_from_data() lacks the flush of the data written to lmem to ensure the object is marked as dirty and the writes flushed to the backing store. Once created, we can immediately release the obj->mm.mapping cach

Re: [Intel-gfx] [PATCH v2: 1/3] drm/i915: Add a function to mmap framebuffer obj

2023-03-23 Thread Das, Nirmoy
On 3/20/2023 3:02 PM, Andrzej Hajda wrote: On 20.03.2023 11:09, Nirmoy Das wrote: Implement i915_gem_fb_mmap() to enable fb_ops.fb_mmap() callback for i915's framebuffer objects. v2: add a comment why i915_gem_object_get() needed(Andi). Cc: Matthew Auld Cc: Andi Shyti Cc: Ville Syrjälä Cc

Re: [RFC PATCH 1/2] drm/i915: Add a function to mmap framebuffer obj

2023-03-20 Thread Das, Nirmoy
On 3/20/2023 1:38 AM, Andi Shyti wrote: Hi Nirmoy, On Thu, Mar 16, 2023 at 06:22:19PM +0100, Nirmoy Das wrote: Implement i915_gem_fb_mmap() to enable fb_ops.fb_mmap() callback for i915's framebuffer objects. v2: add a comment why i915_gem_object_get() needed(Andi). Cc: Matthew Auld Cc: And

Re: [PATCH v2 2/2] drm/i915/debugfs: Enable upper layer interfaces to act on all gt's

2023-03-17 Thread Das, Nirmoy
On 3/1/2023 12:02 PM, Andi Shyti wrote: The commit 82a149a62b6b5 ('drm/i915/gt: move remaining debugfs interfaces into gt') moved gt-related debugfs files in the gtX/ directories to operate on individual gt's. However, the original files were only functioning on the root tile (tile 0) and have

Re: [RFC PATCH 2/2] drm/i915/display: Implement fb_mmap callback function

2023-03-17 Thread Das, Nirmoy
Hi Jani, On 3/17/2023 10:39 AM, Jani Nikula wrote: On Thu, 16 Mar 2023, Nirmoy Das wrote: If stolen memory allocation fails for fbdev, the driver will fallback to system memory. Calculation of smem_start is wrong for such framebuffer objs if the platform comes with no gmadr or no aperture. Sol

Re: [PATCH] drm/i915/gem: Clarify seemingly unaccounted obj refcount inc

2023-03-16 Thread Das, Nirmoy
On 3/15/2023 11:54 AM, Nirmoy Das wrote: Add a comment why there is a obj refcount inc before installing the vm_ops for the mmap call. Also remove the invalid older comment as drm API(drm_gem_prime_mmap()) will hold an obj reference before calling this driver mmap callback so we can't have 0-re

Re: [PATCH] drm/i915: Simplify vcs/bsc engine selection

2023-03-16 Thread Das, Nirmoy
On 3/16/2023 3:27 PM, Tvrtko Ursulin wrote: From: Tvrtko Ursulin No need to look at the mask of present engines when we already have a count stored ever since e2d0ff3525b9 ("drm/i915: Count engine instances per uabi class"). Signed-off-by: Tvrtko Ursulin Cc: Jonathan Cavitt Reviewed-by:

Re: [Intel-gfx] [PATCH v6 2/2] drm/i915: add guard page to ggtt->error_capture

2023-03-13 Thread Das, Nirmoy
On 3/10/2023 10:23 AM, Andrzej Hajda wrote: Write-combining memory allows speculative reads by CPU. ggtt->error_capture is WC mapped to CPU, so CPU/MMU can try to prefetch memory beyond the error_capture, ie it tries to read memory pointed by next PTE in GGTT. If this PTE points to invalid addr

Re: [PATCH v6 1/2] drm/i915/gt: introduce vm->scratch_range callback

2023-03-13 Thread Das, Nirmoy
On 3/10/2023 10:23 AM, Andrzej Hajda wrote: The callback will be responsible for setting scratch page PTEs for specified range. In contrast to clear_range it cannot be optimized to nop. It will be used by code adding guard pages. Signed-off-by: Andrzej Hajda Reviewed-by: Nirmoy Das --- d

Re: [PATCH RFC 3/3] drm/i915/display: Implement fb_mmap callback function

2023-03-07 Thread Das, Nirmoy
Hi Ville, On 3/6/2023 3:32 PM, Ville Syrjälä wrote: On Mon, Mar 06, 2023 at 11:28:50AM +0100, Nirmoy Das wrote: If stolen memory allocation fails for fbdev, the driver will fallback to system memory. Calculation of smem_start is wrong for such framebuffer objs if the platform comes with no gmad

Re: [Intel-gfx] [PATCH 1/3] drm/i915: Set I915_BO_ALLOC_USER for framebuffer

2023-03-06 Thread Das, Nirmoy
On 3/6/2023 6:30 PM, Ville Syrjälä wrote: On Mon, Mar 06, 2023 at 05:22:19PM +0100, Das, Nirmoy wrote: On 3/6/2023 3:21 PM, Ville Syrjälä wrote: On Mon, Mar 06, 2023 at 11:28:48AM +0100, Nirmoy Das wrote: Framebuffer is exposed to userspace so set I915_BO_ALLOC_USER flag for it. This also

Re: [Intel-gfx] [PATCH 1/3] drm/i915: Set I915_BO_ALLOC_USER for framebuffer

2023-03-06 Thread Das, Nirmoy
On 3/6/2023 3:21 PM, Ville Syrjälä wrote: On Mon, Mar 06, 2023 at 11:28:48AM +0100, Nirmoy Das wrote: Framebuffer is exposed to userspace so set I915_BO_ALLOC_USER flag for it. This also make sure that ttm allocates offset for lmem objects. I have no idea what that means. Sorry for poor exp

Re: [PATCH 2/3] drm/i915: Add a helper func for gem obj mmap

2023-03-06 Thread Das, Nirmoy
On 3/6/2023 3:26 PM, Ville Syrjälä wrote: On Mon, Mar 06, 2023 at 11:28:49AM +0100, Nirmoy Das wrote: Move gem obj mmap code to i915_gem_object_mmap() so that this can be used by others. Signed-off-by: Nirmoy Das --- drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c | 20 ++--- drive

Re: [Intel-gfx] [PATCH 1/3] drm/i915: Set I915_BO_ALLOC_USER for framebuffer

2023-03-06 Thread Das, Nirmoy
On 3/6/2023 2:49 PM, Matthew Auld wrote: On 06/03/2023 13:31, Das, Nirmoy wrote: Hi Matt, On 3/6/2023 1:25 PM, Matthew Auld wrote: On 06/03/2023 12:07, Nirmoy Das wrote: Framebuffer is exposed to userspace so set I915_BO_ALLOC_USER flag for it. This also make sure that ttm allocates offset

Re: [Intel-gfx] [PATCH 1/3] drm/i915: Set I915_BO_ALLOC_USER for framebuffer

2023-03-06 Thread Das, Nirmoy
Hi Matt, On 3/6/2023 1:25 PM, Matthew Auld wrote: On 06/03/2023 12:07, Nirmoy Das wrote: Framebuffer is exposed to userspace so set I915_BO_ALLOC_USER flag for it. This also make sure that ttm allocates offset for lmem objects. Signed-off-by: Nirmoy Das ---   drivers/gpu/drm/i915/display/inte

Re: [PATCH] drm/i915: Make sure dsm_size has correct granularity

2023-02-03 Thread Das, Nirmoy
Hi Lucas, On 2/3/2023 7:56 PM, Lucas De Marchi wrote: On Thu, Feb 02, 2023 at 07:02:43PM +0100, Nirmoy Das wrote: DSM granularity is 1MB so make sure we stick to that. I think we need to be a bit more verbose here, because in future we may need to refer to this commit if/when things change (e

Re: [PATCH v2 5/6] drm/ttm: stop allocating a dummy resource for pipelined gutting

2023-01-30 Thread Das, Nirmoy
On 1/30/2023 1:06 PM, Matthew Auld wrote: From: Christian König That should not be necessary any more when drivers should at least be able to handle a move without a resource. Signed-off-by: Christian König Reviewed-by: Matthew Auld Signed-off-by: Matthew Auld Acked-by: Nirmoy Das ---

Re: [PATCH v2 4/6] drm/ttm: stop allocating dummy resources during BO creation

2023-01-30 Thread Das, Nirmoy
On 1/30/2023 1:06 PM, Matthew Auld wrote: From: Christian König That should not be necessary any more when drivers should at least be able to handle the move without a resource. Signed-off-by: Christian König Reviewed-by: Matthew Auld Signed-off-by: Matthew Auld Acked-by: Nirmoy Das --

Re: [PATCH v2 3/6] drm/ttm: clear the ttm_tt when bo->resource is NULL

2023-01-30 Thread Das, Nirmoy
On 1/30/2023 1:06 PM, Matthew Auld wrote: In the next few patches, when initially creating a ttm BO, the bo->resource is NULL, and the driver is then expected to handle the initial dummy move. However, if this is created as a system resource the first ttm_tt we create will always have the clea

Re: [Intel-gfx] [PATCH v2 2/6] drm/i915/ttm: audit remaining bo->resource

2023-01-30 Thread Das, Nirmoy
On 1/30/2023 1:06 PM, Matthew Auld wrote: In the near future TTM will have NULL bo->resource when the object is initially created, plus after calling into pipeline-gutting. Try to handle the remaining cases. In practice NULL bo->resource should be taken to mean swapped-out or purged object. v2

Re: [PATCH v2 1/6] drm/i915/ttm: fix sparse warning

2023-01-30 Thread Das, Nirmoy
On 1/30/2023 1:06 PM, Matthew Auld wrote: Sparse complains with: drivers/gpu/drm/i915/gem/i915_gem_ttm.c:1066:21: sparse: expected restricted vm_fault_t [assigned] [usertype] ret drivers/gpu/drm/i915/gem/i915_gem_ttm.c:1066:21: sparse: got int Fixes: 516198d317d8 ("drm/i915: audit bo-

Re: [Intel-gfx] [PATCH 1/2] drm/drm_vma_manager: Add drm_vma_node_allow_once()

2023-01-19 Thread Das, Nirmoy
On 1/19/2023 2:25 PM, Maxime Ripard wrote: On Tue, 17 Jan 2023 18:52:35 +0100, Nirmoy Das wrote: Currently there is no easy way for a drm driver to safely check and allow drm_vma_offset_node for a drm file just once. Allow drm drivers to call non-refcounted version of drm_vma_node_allow() so t

Re: [Intel-gfx] [PATCH 2/2] drm/i915: Fix a memory leak with reused mmap_offset

2023-01-18 Thread Das, Nirmoy
On 1/18/2023 11:26 AM, Mirsad Todorovac wrote: Hi, On 1/18/23 10:19, Tvrtko Ursulin wrote: Thanks for working on this, it looks good to me and it aligns with how i915 uses the facility. Copying Mirsad who reported the issue in case he is still happy to give it a quick test. Mirsad, I don'

Re: [Intel-gfx] [PATCH 1/2] drm/drm_vma_manager: Add drm_vma_node_allow_once()

2023-01-18 Thread Das, Nirmoy
On 1/18/2023 10:38 AM, Andi Shyti wrote: On Tue, Jan 17, 2023 at 06:52:35PM +0100, Nirmoy Das wrote: Currently there is no easy way for a drm driver to safely check and allow drm_vma_offset_node for a drm file just once. Allow drm drivers to call non-refcounted version of drm_vma_node_allow()

Re: [PATCH 2/2] drm_print: Remove deprecated DRM_DEBUG_KMS_RATELIMITED()

2023-01-18 Thread Das, Nirmoy
On 1/18/2023 7:27 AM, Christian König wrote: Am 17.01.23 um 19:12 schrieb Das, Nirmoy: Hi Alex, On 1/17/2023 7:06 PM, Alex Deucher wrote: On Tue, Jan 17, 2023 at 1:05 PM Nirmoy Das wrote: There are no current users of DRM_DEBUG_KMS_RATELIMITED() so remove it. Cc: Maarten Lankhorst Cc

Re: [PATCH 2/2] drm/i915: Fix a memory leak with reused mmap_offset

2023-01-18 Thread Das, Nirmoy
Hi Tvrtko, On 1/18/2023 10:19 AM, Tvrtko Ursulin wrote: Hi, Thanks for working on this, it looks good to me and it aligns with how i915 uses the facility. Copying Mirsad who reported the issue in case he is still happy to give it a quick test. Mirsad, I don't know if you are subscribed to

Re: [PATCH 2/2] drm_print: Remove deprecated DRM_DEBUG_KMS_RATELIMITED()

2023-01-17 Thread Das, Nirmoy
Hi Alex, On 1/17/2023 7:06 PM, Alex Deucher wrote: On Tue, Jan 17, 2023 at 1:05 PM Nirmoy Das wrote: There are no current users of DRM_DEBUG_KMS_RATELIMITED() so remove it. Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: Thomas Zimmermann Cc: David Airlie Cc: Daniel Vetter Cc: Sam Ravnborg

Re: [PATCH 1/2] drm/radeon: Do not use deprecated drm log API

2023-01-17 Thread Das, Nirmoy
On 1/17/2023 6:48 PM, Alex Deucher wrote: On Tue, Jan 17, 2023 at 12:45 PM Nirmoy Das wrote: Replace deprecated DRM_DEBUG_KMS_RATELIMITED() and DRM_ERROR() with proper APIs. Cc: Alex Deucher Cc: Christian König Signed-off-by: Nirmoy Das --- drivers/gpu/drm/radeon/radeon_dp_auxch.c | 5

Re: [PATCH v2] drm/i915/selftests: Unwind hugepages to drop wakeref on error

2023-01-17 Thread Das, Nirmoy
|Reviewed-by: Nirmoy Das | On 1/17/2023 1:32 PM, Nirmoy Das wrote: From: Chris Wilson Make sure that upon error after we have acquired the wakeref we do release it again. v2: add another missing "goto out_wf"(Andi). Fixes: 027c38b4121e ("drm/i915/selftests: Grab the runtime pm in shrink_thp")

Re: [PATCH 1/2] drm/print: Add drm_dbg_ratelimited

2023-01-17 Thread Das, Nirmoy
Hi Sam, On 1/17/2023 3:49 PM, Sam Ravnborg wrote: Hi Nirmoy On Tue, Jan 17, 2023 at 12:53:49PM +0100, Nirmoy Das wrote: Add a function for ratelimitted debug print. Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: Thomas Zimmermann Cc: David Airlie Cc: Daniel Vetter Reviewed-by: Matthew Auld

Re: [PATCH] drm/ttm: fix some minor kerneldoc issues

2023-01-17 Thread Das, Nirmoy
Reviewed-by: Nirmoy Das On 1/17/2023 1:33 PM, Christian König wrote: Pointed out by the kernel test robot while merging ttm_bo_api.h and ttm_bo_driver.h. Signed-off-by: Christian König Reported-by: kernel test robot --- drivers/gpu/drm/ttm/ttm_bo_util.c | 13 ++--- 1 file changed,

Re: [PATCH] drm/i915/selftests: Unwind hugepages to drop wakeref on error

2023-01-17 Thread Das, Nirmoy
On 1/16/2023 7:49 PM, Andi Shyti wrote: Hi Nirmoy, On Fri, Jan 13, 2023 at 01:00:53PM +0100, Nirmoy Das wrote: From: Chris Wilson Make sure that upon error after we have acquired the wakeref we do release it again. Fixes: 027c38b4121e ("drm/i915/selftests: Grab the runtime pm in shrink_thp

Re: [PATCH] drm/i915/selftests: Unwind hugepages to drop wakeref on error

2023-01-13 Thread Das, Nirmoy
On 1/13/2023 1:05 PM, Matthew Auld wrote: On 13/01/2023 12:02, Das, Nirmoy wrote: Thanks Matt, I missed the Fixes tag so resent it with fixes and Cc to stable. I don't think kernel selftests are really stable material. AFAIK it's not something normal users care about. True, in

Re: [PATCH] drm/i915/selftests: Unwind hugepages to drop wakeref on error

2023-01-13 Thread Das, Nirmoy
Thanks Matt, I missed the Fixes tag so resent it with fixes and Cc to stable. On 1/13/2023 12:51 PM, Matthew Auld wrote: On 13/01/2023 11:49, Nirmoy Das wrote: From: Chris Wilson Make sure that upon error after we have acquired the wakeref we do release it again. Signed-off-by: Chris Wilson

Re: [Intel-gfx] [PATCH v3 11/11] drm/i915: replace Intel internal tracker with kernel core ref_tracker

2023-01-06 Thread Das, Nirmoy
Hi Andrzej, On 2/22/2022 12:25 AM, Andrzej Hajda wrote: Beside reusing existing code, the main advantage of ref_tracker is tracking per instance of wakeref. It allows also to catch double put. On the other side we lose information about the first acquire and the last release, but the advantages

Re: [PATCH v2 2/2] drm/i915: Never return 0 if not all requests retired

2022-11-18 Thread Das, Nirmoy
On 11/18/2022 11:42 AM, Janusz Krzysztofik wrote: Users of intel_gt_retire_requests_timeout() expect 0 return value on success. However, we have no protection from passing back 0 potentially returned by a call to dma_fence_wait_timeout() when it succedes right after its timeout has expired. R

Re: [Intel-gfx] [PATCH 1/3] drm/i915: Fix negative remaining time after retire requests

2022-11-17 Thread Das, Nirmoy
On 11/16/2022 12:25 PM, Janusz Krzysztofik wrote: Commit b97060a99b01 ("drm/i915/guc: Update intel_gt_wait_for_idle to work with GuC") extended the API of intel_gt_retire_requests_timeout() with an extra argument 'remaining_timeout', intended for passing back unconsumed portion of requested time

Re: [Intel-gfx] [PATCH 2/3] drm/i915: Never return 0 on timeout when retiring requests

2022-11-17 Thread Das, Nirmoy
Looks very relevant to  our recent hangcheck failures. Acked-by: Nirmoy Das On 11/16/2022 12:25 PM, Janusz Krzysztofik wrote: Users of intel_gt_retire_requests_timeout() expect 0 return value on success. However, we have no protection from passing back 0 potentially returned by dma_fence_wai

Re: [PATCH] drm/i915/guc: don't hardcode BCS0 in guc_hang selftest

2022-11-03 Thread Das, Nirmoy
LGTM Acked-by: Nirmoy Das On 11/2/2022 10:43 PM, Daniele Ceraolo Spurio wrote: On MTL there are no BCS engines on the media GT, so we can't always use BCS0 in the test. There is no actual reason to use a BCS engine over an engine of a different class, so switch to using any available engine. S

Re: [PATCH] drm/i915: Refactor ttm ghost obj detection

2022-10-14 Thread Das, Nirmoy
On 10/14/2022 4:58 PM, Matthew Auld wrote: On 14/10/2022 14:14, Nirmoy Das wrote: Currently i915_ttm_to_gem() returns NULL for ttm ghost object which makes it unclear when we should add a NULL check for a caller of i915_ttm_to_gem() as ttm ghost objects are expected behaviour for certain cases

Re: [PATCH] drm/i915/slpc: Use platform limits for min/max frequency

2022-10-13 Thread Das, Nirmoy
On 10/12/2022 8:26 PM, Vinay Belgaumkar wrote: GuC will set the min/max frequencies to theoretical max on ATS-M. This will break kernel ABI, so limit min/max frequency to RP0(platform max) instead. Also modify the SLPC selftest to update the min frequency when we have a server part so that we

Re: [PATCH v3 2/2] drm/i915/uapi: expose GTT alignment

2022-10-04 Thread Das, Nirmoy
On 10/4/2022 1:49 PM, Matthew Auld wrote: On some platforms we potentially have different alignment restrictions depending on the memory type. We also now have different alignment restrictions for the same region across different kernel versions. Extend the region query to return the minimum re

Re: [PATCH v2 1/2] drm/i915: enable PS64 support for DG2

2022-09-28 Thread Das, Nirmoy
On 9/27/2022 5:39 PM, Matthew Auld wrote: It turns out that on production DG2/ATS HW we should have support for PS64. This feature allows to provide a 64K TLB hint at the PTE level, which is a lot more flexible than the current method of enabling 64K GTT pages for the entire page-table, since t

Re: [PATCH] drm/i915/selftests: Remove flush_scheduled_work() from live_execlists

2022-09-23 Thread Das, Nirmoy
Reviewed-by: Nirmoy Das On 6/30/2022 2:57 PM, Tvrtko Ursulin wrote: From: Tvrtko Ursulin There are ongoing efforts to remove usages of flush_scheduled_work() from drivers in order to avoid several cases of potentential problems when flushing is done from certain contexts. Remove the call fro

Re: [PATCH] drm/i915: Improve debug print in vm_fault_ttm

2022-09-23 Thread Das, Nirmoy
On 9/22/2022 6:38 PM, Matthew Auld wrote: On 22/09/2022 13:09, Nirmoy Das wrote: Print the error code returned by __i915_ttm_migrate() for better debuggability. References: https://gitlab.freedesktop.org/drm/intel/-/issues/6889 Signed-off-by: Nirmoy Das ---   drivers/gpu/drm/i915/gem/i915_ge

Re: [Intel-gfx] [PATCH] drm/i915: Do not cleanup obj with NULL bo->resource

2022-09-21 Thread Das, Nirmoy
Hi Matt On 9/20/2022 7:06 PM, Nirmoy Das wrote: For delayed BO release i915_ttm_delete_mem_notify() gets called twice, once with proper bo->resource and another time with NULL. We shouldn't do anything for the 2nd time as we already cleanedup the obj once. References: https://gitlab.freedesktop

Re: [PATCH] drm/i915: Do not dereference NULL bo->resource

2022-09-20 Thread Das, Nirmoy
On 9/19/2022 5:29 PM, Gupta, Anshuman wrote: -Original Message- From: Das, Nirmoy Sent: Monday, September 19, 2022 8:33 PM To: intel-...@lists.freedesktop.org Cc: dri-devel@lists.freedesktop.org; Auld, Matthew ; Gupta, Anshuman Subject: [PATCH] drm/i915: Do not dereference NULL bo

Re: [PATCH] drm/i915: consider HAS_FLAT_CCS() in needs_ccs_pages

2022-09-05 Thread Das, Nirmoy
LGTM Reviewed-by: Nirmoy Das On 9/5/2022 12:53 PM, Matthew Auld wrote: Just move the HAS_FLAT_CCS() check into needs_ccs_pages. This also then fixes i915_ttm_memcpy_allowed() which was incorrectly reporting true on DG1, even though it doesn't have small-BAR or flat-CCS. References: https://git

Re: [Intel-gfx] [PATCH] drm/i915/ttm: Abort suspend on i915_ttm_backup failure

2022-09-01 Thread Das, Nirmoy
On 9/1/2022 5:57 PM, Andrzej Hajda wrote: On 31.08.2022 18:18, Nirmoy Das wrote: On system suspend when system memory is low then i915_gem_obj_copy_ttm() could fail trying to backup a lmem obj. GEM_WARN_ON() is not enough, suspend shouldn't continue if i915_ttm_backup() throws an error. Refer

Re: [Intel-gfx] [PATCH] drm/i915/ttm: Abort suspend on i915_ttm_backup failure

2022-08-31 Thread Das, Nirmoy
On 8/31/2022 5:50 PM, Matthew Auld wrote: On 29/08/2022 13:04, Nirmoy Das wrote: On system suspend when system memory is low then i915_gem_obj_copy_ttm() could fail trying to backup a lmem obj. GEM_WARN_ON() is not enough, suspend shouldn't continue if i915_ttm_backup() throws an error. Close

Re: [PATCH] drm/i915/ttm: fix 32b build

2022-07-13 Thread Das, Nirmoy
Reviewed-by: Nirmoy Das On 7/12/2022 7:40 PM, Matthew Auld wrote: Since segment_pages is no longer a compile time constant, it looks the DIV_ROUND_UP(node->size, segment_pages) breaks the 32b build. Simplest is just to use the ULL variant, but really we should need not need more than u32 for th

Re: [PATCH v2 12/39] drm/i915: gem: add kernel-doc description for some function parameters

2022-07-13 Thread Das, Nirmoy
|Reviewed-by: Nirmoy Das | On 7/13/2022 10:12 AM, Mauro Carvalho Chehab wrote: There are some parameters missing at the kernel-doc markups on some gem files. Some of those are trivial enough to be added. Document them. Signed-off-by: Mauro Carvalho Chehab --- To avoid mailbombing on a large n

Re: [PATCH v2 10/39] drm/i915: i915_gem_ttm: fix a kernel-doc markup

2022-07-13 Thread Das, Nirmoy
|Reviewed-by: Nirmoy Das| On 7/13/2022 10:11 AM, Mauro Carvalho Chehab wrote: Two new fields were added to __i915_gem_ttm_object_init() without their corresponding documentation. Document them. Fixes: 9b78b5dade2d ("drm/i915: add i915_gem_object_create_region_at()") Signed-off-by: Mauro Carval

Re: [PATCH v2 08/39] drm/i915: gem: fix some Kernel-doc issues

2022-07-13 Thread Das, Nirmoy
On 7/13/2022 10:11 AM, Mauro Carvalho Chehab wrote: There are several trivial issueson kernel-doc markups at gem: drivers/gpu/drm/i915/gem/i915_gem_create.c:146: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst

Re: [PATCH v2] drm/syncobj: Fix sync syncobj issue

2022-07-13 Thread Das, Nirmoy
Hi Christian, On 7/12/2022 12:26 PM, Christian König wrote: Ping to the Intel guys here. Especially Lucas/Nirmoy/Lionel. IIRC you stumbled over that problem as well, have you found any solution? I might be wrong but  I think you are talking about igt@syncobj_timeline@transfer-timeline-point

Re: [PATCH v3] drm/i915/ttm: fix sg_table construction

2022-07-11 Thread Das, Nirmoy
On 7/11/2022 10:58 AM, Matthew Auld wrote: If we encounter some monster sized local-memory page that exceeds the maximum sg length (UINT32_MAX), ensure that don't end up with some misaligned address in the entry that follows, leading to fireworks later. Also ensure we have some coverage of this

Re: [PATCH] drm/i915/ttm: fix sg_table construction

2022-07-08 Thread Das, Nirmoy
On 7/8/2022 9:41 AM, Matthew Auld wrote: If we encounter some monster sized local-memory page that exceeds the maximum sg length (UINT32_MAX), ensure that don't end up with some misaligned address in the entry that follows, leading to fireworks later. Also ensure we have some coverage of this i

Re: [PATCH v1] Fix: SYNCOBJ TIMELINE Test failed.

2022-06-30 Thread Das, Nirmoy
On 6/29/2022 11:12 AM, Christian König wrote: Am 29.06.22 um 08:02 schrieb jie1zhan:   The issue cause by the commit : 721255b527(drm/syncobj: flatten dma_fence_chains on transfer). Because it use the point of dma_fence incorrectly Correct the point of dma_fence by fence array Well that p

Re: [Intel-gfx] [PATCH 09/10] drm/i915: turn on small BAR support

2022-06-21 Thread Das, Nirmoy
On 6/21/2022 10:38 AM, Matthew Auld wrote: On 17/06/2022 13:33, Thomas Hellström wrote: On 5/25/22 20:43, Matthew Auld wrote: With the uAPI in place we should now have enough in place to ensure a working system on small BAR configurations. Signed-off-by: Matthew Auld Cc: Thomas Hellström

Re: [PATCH v2] drm/i915: Fix vm use-after-free in vma destruction

2022-06-20 Thread Das, Nirmoy
Acked-by: Nirmoy Das On 6/20/2022 2:36 PM, Thomas Hellström wrote: In vma destruction, the following race may occur: Thread 1: Thread 2: i915_vma_destroy(); ... list_del_init(vma->vm_link); ... mutex_unlock(vma->vm->mutex);

Re: [PATCH 02/10] drm/i915/uapi: add probed_cpu_visible_size

2022-06-01 Thread Das, Nirmoy
Acked-by: Nirmoy Das On 5/25/2022 8:43 PM, Matthew Auld wrote: Userspace wants to know the size of CPU visible portion of device local-memory, and on small BAR devices the probed_size is no longer enough. In Vulkan, for example, it would like to know the size in bytes for CPU visible VkMemoryHe

Re: [Intel-gfx] [PATCH 07/10] drm/i915/error: skip non-mappable pages

2022-06-01 Thread Das, Nirmoy
Reviewed-by: Nirmoy Das On 5/25/2022 8:43 PM, Matthew Auld wrote: Skip capturing any lmem pages that can't be copied using the CPU. This in now only best effort on platforms that have small BAR. Testcase: igt@gem-exec-capture@capture-invisible Signed-off-by: Matthew Auld Cc: Thomas Hellström

Re: [Intel-gfx] [PATCH 06/10] drm/i915/uapi: add NEEDS_CPU_ACCESS hint

2022-06-01 Thread Das, Nirmoy
LGTM Reviewed-by: Nirmoy Das On 5/25/2022 8:43 PM, Matthew Auld wrote: If set, force the allocation to be placed in the mappable portion of I915_MEMORY_CLASS_DEVICE. One big restriction here is that system memory (i.e I915_MEMORY_CLASS_SYSTEM) must be given as a potential placement for the obje

Re: [PATCH] drm/i915/gem: Make drop_pages() return bool

2022-05-03 Thread Das, Nirmoy
On 5/3/2022 8:15 AM, Lucas De Marchi wrote: Commit e4e806253003 ("drm/i915: Change shrink ordering to use locking around unbinding.") changed the return type to int without changing the return values or their meaning to "0 is success". Move it back to boolean. Signed-off-by: Lucas De Marchi

Re: [PATCH 2/2] drm/i915/selftests: tweak the misaligned_case

2022-04-21 Thread Das, Nirmoy
LGTM Reviewed-by: Nirmoy Das On 4/6/2022 9:30 PM, Matthew Auld wrote: The compact-pt layout restrictions should only apply to the ppGTT. Also make this play nice on platforms that only have the 64K GTT restriction, and not the compact-pt thing. Signed-off-by: Matthew Auld Cc: Thomas Hellström

Re: [PATCH 1/2] drm/i915/selftests: fixup min_alignment usage

2022-04-21 Thread Das, Nirmoy
Reviewed-by: Nirmoy Das On 4/6/2022 9:30 PM, Matthew Auld wrote: Trying to cast the region id into the region type doesn't work too well, since the i915_vm_min_alignment() won't give us the correct value for the stolen-lmem case. Signed-off-by: Matthew Auld Cc: Thomas Hellström Cc: Nirmoy Da

Re: [PATCH 2/2] drm/i915/buddy: sanity check the size

2022-04-07 Thread Das, Nirmoy
|Reviewed-by: Nirmoy Das | On 4/7/2022 1:06 PM, Matthew Auld wrote: Ensure we check that the size is compatible with the requested page_size. For tiny objects that are automatically annotated with TTM_PL_FLAG_CONTIGUOUS(since they fit within a single page), we currently end up silently overridin

Re: [PATCH] drm/i915: consider min_page_size when migrating

2022-04-06 Thread Das, Nirmoy
LGTM Reviewed-by: Nirmoy Das On 4/6/2022 8:19 PM, Matthew Auld wrote: We can only force migrate an object if the existing object size is compatible with the new destinations min_page_size for the region. Currently we blow up with something like: [ 2857.497462] kernel BUG at drivers/gpu/drm/i91

Re: [PATCH 1/2] dma-buf/sync-file: fix logic error in new fence merge code

2022-03-29 Thread Das, Nirmoy
I finally managed to find a machine and tested this series. If it is not too late The series is Tested-by: Nirmoy Das On 3/29/2022 9:00 AM, Christian König wrote: When the array is empty because everything is signaled we can't use add_fence() to add something because that would filter the sig

Re: [Intel-gfx] [PATCH] drm/i915: fix remaining_timeout in intel_gt_retire_requests_timeout

2022-03-28 Thread Das, Nirmoy
On 3/25/2022 9:33 PM, Ceraolo Spurio, Daniele wrote: On 3/25/2022 11:37 AM, Das, Nirmoy wrote: On 3/25/2022 6:58 PM, Daniele Ceraolo Spurio wrote: In intel_gt_wait_for_idle, we use the remaining timeout returned from intel_gt_retire_requests_timeout to wait on the GuC being idle. However

Re: [Intel-gfx] [PATCH] drm/i915: fix remaining_timeout in intel_gt_retire_requests_timeout

2022-03-25 Thread Das, Nirmoy
On 3/25/2022 6:58 PM, Daniele Ceraolo Spurio wrote: In intel_gt_wait_for_idle, we use the remaining timeout returned from intel_gt_retire_requests_timeout to wait on the GuC being idle. However, the returned variable can have a negative value if something goes wrong during the wait, leading to

Re: [Intel-gfx] [PATCH 1/2] drm/i915/ttm: limit where we apply TTM_PL_FLAG_CONTIGUOUS

2022-03-25 Thread Das, Nirmoy
On 3/25/2022 11:03 AM, Das, Nirmoy wrote: Reviewed-by: Nirmoy Das Sorry, I meant this r-b for the  2nd patch and for this one Acked-by: Nirmoy Das

Re: [PATCH 1/2] drm/i915/ttm: limit where we apply TTM_PL_FLAG_CONTIGUOUS

2022-03-25 Thread Das, Nirmoy
On 3/25/2022 8:16 AM, Thomas Hellström wrote: On 3/24/22 18:21, Matthew Auld wrote: We only need this when allocating device local-memory, where this influences the drm_buddy. Currently there is some funny behaviour where an "in limbo" system memory object is lacking the relevant placement fl

Re: [Intel-gfx] [PATCH] drm/i915/guc: Correctly free guc capture struct on error

2022-03-24 Thread Das, Nirmoy
Reviewed-by: Nirmoy Das On 3/24/2022 1:04 AM, Daniele Ceraolo Spurio wrote: On error the "new" allocation is not freed, so add the required kfree. Fixes: 247f8071d5893 ("drm/i915/guc: Pre-allocate output nodes for extraction") Signed-off-by: Daniele Ceraolo Spurio Cc: Alan Previn Cc: John Ha

Re: [Intel-gfx] [PATCH v4 6/8] drm/ttm: Add a parameter to add extra pages into ttm_tt

2022-03-21 Thread Das, Nirmoy
In the previous version I replied only to the mailing list email so probably my email slipped through. Reviewed-by: Nirmoy Das for patch 6-7 On 3/19/2022 9:42 PM, Ramalingam C wrote: Add a parameter called "extra_pages" for ttm_tt_init, to indicate that driver needs extra pages in ttm_tt. v2

Re: [Intel-gfx] [PATCH v2 0/7] drm/i915: Use the memcpy_from_wc function from drm

2022-03-21 Thread Das, Nirmoy
looks good to me overall but I would get others r-b. Patches 1-3 Reviewed-by: Nirmoy Das Patches 4-7 Acked-by: Nirmoy Das On 03/03/2022 19:00, Balasubramani Vivekanandan wrote: drm_memcpy_from_wc() performs fast copy from WC memory type using non-temporal instructions. Now there are two simi

Re: [PATCH v3 7/7] drm/i915: fixup the initial fb base on DGFX

2022-03-15 Thread Das, Nirmoy
|This seems more natural to me than the previous version. Acked-by: Nirmoy Das | Nirmoy On 14/03/2022 12:28, Matthew Auld wrote: On integrated it looks like the GGTT base should always 1:1 maps to somewhere within DSM. On discrete the base seems to be pre-programmed with a normal lmem

Re: [Intel-gfx] [PATCH v2 0/8] Some more bits for small BAR enabling

2022-03-11 Thread Das, Nirmoy
The series is Acked-by: Nirmoy Das On 10/03/2022 13:27, Matthew Auld wrote: The leftover bits around dealing with stolen-local memory + small BAR, plus some related fixes. v2: some tweaks based on feedback from Ville

Re: [Intel-gfx] [PATCH] drm/i915/gtt: reduce overzealous alignment constraints for GGTT

2022-03-08 Thread Das, Nirmoy
|Acked-by: Nirmoy Das | On 03/03/2022 11:02, Matthew Auld wrote: Currently this will enforce both 2M alignment and padding for any LMEM pages inserted into the GGTT. However, this was only meant to be applied to the compact-pt layout with the ppGTT. For the GGTT we can reduce the alignment and p

Re: [Intel-gfx] [PATCH 0/7] drm/i915: Use the memcpy_from_wc function from drm

2022-02-23 Thread Das, Nirmoy
On 23/02/2022 12:08, Balasubramani Vivekanandan wrote: On 23.02.2022 10:02, Das, Nirmoy wrote: On 22/02/2022 15:51, Balasubramani Vivekanandan wrote: drm_memcpy_from_wc() performs fast copy from WC memory type using non-temporal instructions. Now there are two similar implementations of this

  1   2   >