Re: [PATCH v2 2/2] drm/ttm: Add a device flag to propagate -ENOSPC on OOM

2024-10-02 Thread Christian König
determining what error code to return or whether corrective action can be taken at the driver level. Cc: Christian König Cc: Matthew Brost Signed-off-by: Thomas Hellström Independent of how we communicate flags to the TTM device init function this looks like the right approach to me. So feel

Re: [PATCH v2 1/2] drm/ttm: Change ttm_device_init to use a struct instead of multiple bools

2024-10-02 Thread Christian König
the kernel. It obviously has some advantages, but do we have any precedence in the kernel for using that approach? Regards, Christian. This is in preparation of adding yet another bool flag parameter to the function. Cc: Christian König Cc: amd-...@lists.freedesktop.org Cc: inte

Re: RESEND Re: [RFC PATCH] dma-buf/dma-fence: Use a successful read_trylock() annotation for dma_fence_begin_signalling()

2024-09-18 Thread Christian König
Sorry, somehow completely missed that. Feel free to push it to drm-misc-next. Christian. Am 18.09.24 um 14:34 schrieb Thomas Hellström: Christian, Ping? On Wed, 2024-08-14 at 10:37 +0200, Thomas Hellström wrote: Christian, Ack to merge this through drm-misc-next, or do you want to pick it

Re: [PATCH v7 0/3] drm: Use full allocated minor range for DRM

2024-08-26 Thread Christian König
Am 23.08.24 um 18:30 schrieb Michał Winiarski: 64 DRM device nodes is not enough for everyone. Upgrade it to ~512K (which definitely is more than enough). Additionally, convert minors to use XArray instead of IDR to simplify the locking. Corresponding libdrm changes were merged in: https://gitl

Re: [PATCH 1/2] drm/ttm: fix kernel-doc typo for @trylock_only

2024-08-23 Thread Christian König
Am 23.08.24 um 16:11 schrieb Jani Nikula: s/tryock_only/trylock_only/ Fixes: da966b82bf3d ("drm/ttm: Provide a generic LRU walker helper") Cc: Thomas Hellström Cc: Christian König Signed-off-by: Jani Nikula Reviewed-by: Christian König --- include/drm/ttm/ttm_bo.h | 2 +

Re: [PATCH v7 1/2] drm/buddy: Add start address support to trim function

2024-07-24 Thread Christian König
_start alignment with min chunk_size >>    - use range_overflows() >> >> Signed-off-by: Arunpravin Paneer Selvam     mailto:arunpravin.paneersel...@amd.com>> >> Acked-by: Alex Deucher mailto:alexander.deuc...@amd.com>> >> Acked-by: Chr

Re: [PATCH v6 2/2] drm/amdgpu: Add address alignment support to DCC buffers

2024-07-18 Thread Christian König
ic hw generation. Signed-off-by: Arunpravin Paneer Selvam Acked-by: Alex Deucher Acked-by: Christian König Reviewed-by: Frank Min --- drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h | 6 +++ drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c | 39 +++- drivers/gpu/drm/amd/amdgpu/gmc_

Re: [PATCH v5 2/2] drm/amdgpu: Add address alignment support to DCC buffers

2024-07-17 Thread Christian König
G_CONTIGUOUS) && (amdgpu_ip_version(adev, GC_HWIP, 0) == IP_VERSION(12, 0, 0) || amdgpu_ip_version(adev, GC_HWIP, 0) == IP_VERSION(12, 0, 1))) { } Regards, Arun. On 7/17/2024 2:38 PM, Christian König wrote: Well that approach was discussed before and seemed to be to complicated. But I to

Re: [PATCH v5 2/2] drm/amdgpu: Add address alignment support to DCC buffers

2024-07-17 Thread Christian König
- Set the Alignment to a default value if the callback doesn't exist.   - Add the callback to amdgpu_gmc_funcs. v6:   - Fix checkpatch error reported by Intel CI. Signed-off-by: Arunpravin Paneer Selvam Acked-by: Alex Deucher Acked-by: Christian König

Re: [PATCH 1/2] drm: Add might_fault to drm_modeset_lock priming

2024-07-10 Thread Christian König
Am 10.07.24 um 13:58 schrieb Daniel Vetter: On Wed, 10 Jul 2024 at 13:39, Christian König wrote: Am 10.07.24 um 11:31 schrieb Daniel Vetter: We already teach lockdep that dma_resv nests within drm_modeset_lock, but there's a lot more: All drm kms ioctl rely on being able to put/get_user

Re: [PATCH 1/2] drm: Add might_fault to drm_modeset_lock priming

2024-07-10 Thread Christian König
axime Ripard Cc: Thomas Zimmermann Cc: Sumit Semwal Cc: "Christian König" Cc: linux-me...@vger.kernel.org Cc: linaro-mm-...@lists.linaro.org On the other hand pointing it out explicitly doesn't hurts us at all, so Reviewed-by: Christian König . Regards, Christian. -

Re: [PATCH 2/6] drm/ttm: Store the bo_kmap_type in struct iosys_map

2024-06-17 Thread Christian König
Hi, Am 17.06.24 um 14:32 schrieb Thomas Zimmermann: Hi Am 14.06.24 um 16:31 schrieb Christian König: Am 14.06.24 um 15:21 schrieb Thomas Zimmermann: For each instances of struct iosys_map set up by ttm_bo_vmap(), store the type of allocation in the instance. Use this information to unmap the

Re: [PATCH 3/6] drm/ttm: Support partial buffer mappings for ttm_bo_vmap()

2024-06-14 Thread Christian König
Am 14.06.24 um 15:21 schrieb Thomas Zimmermann: Add offset and size parameters to ttm_bo_vmap() to allow for partial mappings of a buffer object. This brings the functionality on par with ttm_bo_kmap(). Well the long term plan was to remove this functionality from ttm_bo_kmap() and nuke that f

Re: [PATCH 2/6] drm/ttm: Store the bo_kmap_type in struct iosys_map

2024-06-14 Thread Christian König
Am 14.06.24 um 15:21 schrieb Thomas Zimmermann: For each instances of struct iosys_map set up by ttm_bo_vmap(), store the type of allocation in the instance. Use this information to unmap the memory in ttm_bo_vunmap(). This change simplifies the unmap code and puts the complicated logic entirely

Re: [PATCH V2] drm/ttm: remove unused paramter

2024-04-11 Thread Christian König
: Jesse Zhang Reviewed-by: Christian König --- drivers/gpu/drm/ttm/ttm_bo.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index e059b1e1b13b..6396dece0db1 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b

Re: [PATCH] drm/ttm: remove unused paramter

2024-03-29 Thread Christian König
Am 29.03.24 um 12:10 schrieb Christian König: Am 25.03.24 um 08:45 schrieb Jesse Zhang: remove the unsed the paramter in the function ttm_bo_bounce_temp_buffer and ttm_bo_add_move_fence. Signed-off-by: Jesse Zhang Good catch, Reviewed-by: Christian König Please rebase that patch on top

Re: [PATCH] drm/ttm: remove unused paramter

2024-03-29 Thread Christian König
Am 25.03.24 um 08:45 schrieb Jesse Zhang: remove the unsed the paramter in the function ttm_bo_bounce_temp_buffer and ttm_bo_add_move_fence. Signed-off-by: Jesse Zhang Good catch, Reviewed-by: Christian König Regards, Christian. --- drivers/gpu/drm/ttm/ttm_bo.c | 10 -- 1 file

Re: [PATCH v2 09/16] drm/ttm: fix ttm_bo.h kernel-doc warnings

2024-03-08 Thread Christian König
was removed years ago. I would just write that as "@sg: external source of pages and DMA addresses, protected by the reservation lock." (or something like this). With that fixed feel free to add Reviewed-by: Christian König to this patch and the other TTM cleanup patches in t

Re: [PATCH v8 3/3] drm/buddy: Add user for defragmentation

2024-03-05 Thread Christian König
Am 05.03.24 um 12:14 schrieb Paneer Selvam, Arunpravin: On 3/5/2024 4:33 PM, Paneer Selvam, Arunpravin wrote: Hi Christian, On 3/4/2024 10:09 PM, Christian König wrote: Am 04.03.24 um 17:32 schrieb Arunpravin Paneer Selvam: Add amdgpu driver as user for the drm buddy defragmentation. Signed

Re: [PATCH v8 3/3] drm/buddy: Add user for defragmentation

2024-03-04 Thread Christian König
Am 04.03.24 um 17:32 schrieb Arunpravin Paneer Selvam: Add amdgpu driver as user for the drm buddy defragmentation. Signed-off-by: Arunpravin Paneer Selvam --- drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c | 17 +++-- drivers/gpu/drm/drm_buddy.c | 1 + 2 files c

Re: [PATCH] drm/i915: fix applying placement flag

2024-03-01 Thread Christian König
Am 01.03.24 um 17:04 schrieb Lucas De Marchi: On Thu, Feb 29, 2024 at 02:01:05PM +0100, Christian König wrote: Gentle ping. Can I get an rb for that? Thanks, Christian. Reviewed-by: Lucas De Marchi Thanks! For some reason CI failed, but can't be related with this change. I re-trig

[PATCH 2/2] drm/amdgpu: use GTT only as fallback for VRAM|GTT

2024-02-29 Thread Christian König
Try to fill up VRAM as well by setting the busy flag on GTT allocations. This fixes the issue that when VRAM was evacuated for suspend it's never filled up again unless the application is restarted. Signed-off-by: Christian König Reviewed-by: Zack Rusin --- drivers/gpu/drm/amd/a

[PATCH 1/2] drm/ttm: improve idle/busy handling v5

2024-02-29 Thread Christian König
space functionality as it is for now, only add new handling for ttm_bo_validate as suggested by Thomas v5: fix bug pointed out by Matthew Signed-off-by: Christian König Reviewed-by: Zack Rusin v3 --- drivers/gpu/drm/ttm/ttm_bo.c | 231 + drivers/gpu/dr

Re: [PATCH] drm/i915: fix applying placement flag

2024-02-29 Thread Christian König
Gentle ping. Can I get an rb for that? Thanks, Christian. Am 26.02.24 um 15:27 schrieb Christian König: Switching from a separate list to flags introduced a bug here. We were accidentially ORing the flag before initailizing the placement and not after. So this code didn't do nothing e

Re: [PATCH] drm/i915/ttm: Fix TTM_PL_FLAG_DESIRED

2024-02-27 Thread Christian König
ian. Cc: Somalapuram Amaranath Cc: Christian König Cc: Zack Rusin Cc: Thomas Zimmermann Cc: Thomas Hellström Fixes: a78a8da51b36 ("drm/ttm: replace busy placement with flags v6") Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/gem/i915_gem_ttm.c | 2 +- 1 file change

Re: [PATCH 1/2] drm/ttm: improve idle/busy handling v4

2024-02-27 Thread Christian König
Am 27.02.24 um 09:12 schrieb Matthew Auld: On 26/02/2024 20:21, Thomas Hellström wrote: Hi, Christian On Fri, 2024-02-23 at 15:30 +0100, Christian König wrote: Am 06.02.24 um 13:56 schrieb Christian König: Am 06.02.24 um 13:53 schrieb Thomas Hellström: Hi, Christian, On Fri, 2024-01-26 at

[PATCH] drm/i915: fix applying placement flag

2024-02-26 Thread Christian König
Switching from a separate list to flags introduced a bug here. We were accidentially ORing the flag before initailizing the placement and not after. So this code didn't do nothing except producing a warning. Signed-off-by: Christian König Reported-by: Stephen Rothwell Fixes: a78a8da51b36

Re: linux-next: build failure after merge of the drm-misc tree

2024-02-26 Thread Christian König
Am 25.02.24 um 22:47 schrieb Stephen Rothwell: Hi all, On Mon, 26 Feb 2024 08:41:16 +1100 Stephen Rothwell wrote: On Tue, 20 Feb 2024 08:48:21 +1100 Stephen Rothwell wrote: On Mon, 12 Feb 2024 15:15:54 +0200 Jani Nikula wrote: On Tue, 06 Feb 2024, Stephen Rothwell wrote: After merging

Re: [PATCH 1/2] drm/ttm: improve idle/busy handling v4

2024-02-23 Thread Christian König
Am 06.02.24 um 13:56 schrieb Christian König: Am 06.02.24 um 13:53 schrieb Thomas Hellström: Hi, Christian, On Fri, 2024-01-26 at 15:09 +0100, Christian König wrote: Previously we would never try to move a BO into the preferred placements when it ever landed in a busy placement since those

Re: [PATCH] drm/ttm: Fix an invalid freeing on already freed page in error path

2024-02-22 Thread Christian König
Am 22.02.24 um 08:34 schrieb Thomas Hellström: On Wed, 2024-02-21 at 11:26 +0100, Christian König wrote: Am 21.02.24 um 08:33 schrieb Thomas Hellström: If caching mode change fails due to, for example, OOM we free the allocated pages in a two-step process. First the pages for which the caching

Re: [PATCH v7 3/3] drm/buddy: Add defragmentation support

2024-02-21 Thread Christian König
Am 21.02.24 um 13:18 schrieb Arunpravin Paneer Selvam: Add a function to support defragmentation. Thinking more about it maybe you want to call this function differently. Essentially we are force merging pages even if their cleared flag doesn't match, that is something different than defragme

Re: [PATCH] drm/ttm: Fix an invalid freeing on already freed page in error path

2024-02-21 Thread Christian König
second step was incorrectly freeing the pages already freed in the first step. Fix. Signed-off-by: Thomas Hellström Fixes: 379989e7cbdc ("drm/ttm/pool: Fix ttm_pool_alloc error path") Cc: Christian König Cc: Dave Airlie Cc: Christian Koenig Cc: Huang Rui Cc: dri-de...@lists.freedesk

Re: [PATCH v6 3/3] drm/buddy: Add defragmentation support

2024-02-16 Thread Christian König
Am 16.02.24 um 15:47 schrieb Matthew Auld: On 16/02/2024 14:02, Christian König wrote: Am 16.02.24 um 14:21 schrieb Matthew Auld: On 16/02/2024 12:33, Christian König wrote: Am 16.02.24 um 13:23 schrieb Matthew Auld: On 08/02/2024 15:50, Arunpravin Paneer Selvam wrote: Add a function to

Re: [PATCH v6 3/3] drm/buddy: Add defragmentation support

2024-02-16 Thread Christian König
Am 16.02.24 um 14:21 schrieb Matthew Auld: On 16/02/2024 12:33, Christian König wrote: Am 16.02.24 um 13:23 schrieb Matthew Auld: On 08/02/2024 15:50, Arunpravin Paneer Selvam wrote: Add a function to support defragmentation. v1: Defragment the memory beginning from min_order till the

Re: [PATCH 0/6 V4] fdinfo shared stats

2024-02-16 Thread Christian König
Am 15.02.24 um 15:20 schrieb Alex Deucher: On Thu, Feb 15, 2024 at 9:18 AM Christian König wrote: Am 12.02.24 um 22:04 schrieb Alex Deucher: We had a request to add shared buffer stats to fdinfo for amdgpu and while implementing that, Christian mentioned that just looking at the GEM handle

Re: [PATCH v6 3/3] drm/buddy: Add defragmentation support

2024-02-16 Thread Christian König
Am 16.02.24 um 13:23 schrieb Matthew Auld: On 08/02/2024 15:50, Arunpravin Paneer Selvam wrote: Add a function to support defragmentation. v1: Defragment the memory beginning from min_order till the required memory space is available. Signed-off-by: Arunpravin Paneer Selvam Suggested-b

Re: [PATCH] drm/buddy: Modify duplicate list_splice_tail call

2024-02-16 Thread Christian König
Am 16.02.24 um 12:46 schrieb Arunpravin Paneer Selvam: On 2/16/2024 4:41 PM, Matthew Auld wrote: On 16/02/2024 10:00, Arunpravin Paneer Selvam wrote: Remove the duplicate list_splice_tail call when the total_allocated < size condition is true. Cc: # 6.7+ Fixes: 8746c6c9dfa3 ("drm/buddy:

Re: [PATCH 0/6 V4] fdinfo shared stats

2024-02-15 Thread Christian König
istency. v4: switch drm_gem_object_is_shared_for_memory_stats() to an inline function I'm still not sure if looking at the actual handle count is the right approach, but it's certainly better than before. So Reviewed-by: Christian König for the entire series. Should I take this through drm-misc-next? Regards,

Re: [PATCH 2/2] drm/tests/drm_buddy: add alloc_contiguous test

2024-02-13 Thread Christian König
changed the patch authorship here. Going to fix this if I get tasked with pushing this to drm-misc-fixes. But I still have hope that Arun will figure out how to do this himself. Christian. Cc: Arunpravin Paneer Selvam Cc: Limonciello Cc: Christian König Signed-off-by: Arunpravin Paneer

Re: [PATCH] drm/buddy: Fix alloc_range() error handling code

2024-02-07 Thread Christian König
allocation") Signed-off-by: Arunpravin Paneer Selvam Tested-by: Mario Limonciello Acked-by: Christian König CC: stable.. ? --- drivers/gpu/drm/drm_buddy.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/drm/drm_buddy.c b/drivers/gpu/drm/drm_buddy.c index f57e6d74fb0

Re: [PATCH 1/2] drm/ttm: improve idle/busy handling v4

2024-02-06 Thread Christian König
Am 06.02.24 um 13:53 schrieb Thomas Hellström: Hi, Christian, On Fri, 2024-01-26 at 15:09 +0100, Christian König wrote: Previously we would never try to move a BO into the preferred placements when it ever landed in a busy placement since those were considered compatible. Rework the whole

[PATCH 2/2] drm/amdgpu: use GTT only as fallback for VRAM|GTT

2024-01-26 Thread Christian König
Try to fill up VRAM as well by setting the busy flag on GTT allocations. This fixes the issue that when VRAM was evacuated for suspend it's never filled up again unless the application is restarted. Signed-off-by: Christian König Reviewed-by: Zack Rusin --- drivers/gpu/drm/amd/a

[PATCH 1/2] drm/ttm: improve idle/busy handling v4

2024-01-26 Thread Christian König
space functionality as it is for now, only add new handling for ttm_bo_validate as suggested by Thomas Signed-off-by: Christian König Reviewed-by: Zack Rusin v3 --- drivers/gpu/drm/ttm/ttm_bo.c | 231 + drivers/gpu/drm/ttm/ttm_resource.c | 16 +- include/dr

Rework TTMs busy handling

2024-01-26 Thread Christian König
Hi guys, so pushed the first few patches from this series. I hope that I correctly managed to resolve the silent Xe merge conflict in drm-tip, but would be nice if somebody could double check. Then for the two remaining patches I've implemented most of what Thomas suggest, e.g. the existing funct

Re: [PATCH] mm: Remove double faults once write a device pfn

2024-01-25 Thread Christian König
Am 24.01.24 um 12:04 schrieb Alistair Popple: "Zhou, Xianrong" writes: [AMD Official Use Only - General] The vmf_insert_pfn_prot could cause unnecessary double faults on a device pfn. Because currently the vmf_insert_pfn_prot does not make the pfn writable so the pte entry is normally read-o

Re: [PATCH] mm: Remove double faults once write a device pfn

2024-01-23 Thread Christian König
Am 24.01.24 um 03:43 schrieb Zhou, Xianrong: [AMD Official Use Only - General] The vmf_insert_pfn_prot could cause unnecessary double faults on a device pfn. Because currently the vmf_insert_pfn_prot does not make the pfn writable so the pte entry is normally read-only or dirty catching. What?

Re: [PATCH] mm: Remove double faults once write a device pfn

2024-01-23 Thread Christian König
Am 23.01.24 um 09:33 schrieb Zhou, Xianrong: [AMD Official Use Only - General] The vmf_insert_pfn_prot could cause unnecessary double faults on a device pfn. Because currently the vmf_insert_pfn_prot does not make the pfn writable so the pte entry is normally read-only or dirty catching. What?

Re: [PATCH] mm: Remove double faults once write a device pfn

2024-01-22 Thread Christian König
Am 22.01.24 um 04:32 schrieb Xianrong Zhou: The vmf_insert_pfn_prot could cause unnecessary double faults on a device pfn. Because currently the vmf_insert_pfn_prot does not make the pfn writable so the pte entry is normally read-only or dirty catching. What? How do you got to this conclusion?

Re: Rework TTMs busy handling

2024-01-16 Thread Christian König
Am 12.01.24 um 13:51 schrieb Christian König: Hi guys, just a gentle ping on this. Zack any more comments for the VMWGFX parts? Thanks, Christian. same as the last time. Things I've changed: Implemented the requirements from Zack to correctly fill in the busy placements for V

[PATCH 4/5] drm/ttm: improve idle/busy handling v3

2024-01-12 Thread Christian König
then use the busy placement if that didn't worked. Drawback is that we now always try the idle placement first for each validation which might cause some additional CPU overhead on overcommit. v2: fix kerneldoc warning and coding style v3: take care of XE as well Signed-off-by: Christian

[PATCH 5/5] drm/amdgpu: use GTT only as fallback for VRAM|GTT

2024-01-12 Thread Christian König
Try to fill up VRAM as well by setting the busy flag on GTT allocations. This fixes the issue that when VRAM was evacuated for suspend it's never filled up again unless the application is restarted. Signed-off-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 6

[PATCH 3/5] drm/ttm: replace busy placement with flags v6

2024-01-12 Thread Christian König
out by checkpatch v5: cleanup some rebase problems with VMWGFX v6: implement some missing VMWGFX functionality pointed out by Zack, rename the flags as suggested by Michel, rebase on drm-tip and adjust XE as well Signed-off-by: Christian König Signed-off-by: Somalapuram Amaranath

[PATCH 2/5] drm/ttm: return ENOSPC from ttm_bo_mem_space

2024-01-12 Thread Christian König
Only convert it to ENOMEM in ttm_bo_validate. This allows ttm_bo_validate to distinct between an out of memory situation and just out of space in a placement domain. Signed-off-by: Christian König --- drivers/gpu/drm/ttm/ttm_bo.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff

Rework TTMs busy handling

2024-01-12 Thread Christian König
Hi guys, same as the last time. Things I've changed: Implemented the requirements from Zack to correctly fill in the busy placements for VMWGFX. Renamed the placement flags to desired and fallback as suggested by Michel. Rebased on drm-tip instead of drm-misc-next and fixed XE as well. Please

[PATCH 1/5] drm/vmwgfx: remove vmw_vram_gmr_placement

2024-01-12 Thread Christian König
Seems to be unused. Signed-off-by: Christian König --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.h| 1 - drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c | 28 -- 2 files changed, 29 deletions(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h b/drivers/gpu/drm/vmwgfx

Re: Rework TTMs busy handling

2024-01-09 Thread Christian König
Am 09.01.24 um 09:14 schrieb Thomas Hellström: Hi, Christian On Tue, 2024-01-09 at 08:47 +0100, Christian König wrote: Hi guys, I'm trying to make this functionality a bit more useful for years now since we multiple reports that behavior of drivers can be suboptimal when multiple place

[PATCH 2/5] drm/ttm: return ENOSPC from ttm_bo_mem_space

2024-01-08 Thread Christian König
Only convert it to ENOMEM in ttm_bo_validate. Signed-off-by: Christian König --- drivers/gpu/drm/ttm/ttm_bo.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index edf10618fe2b..8c1eaa74fa21 100644 --- a/drivers

[PATCH 5/5] drm/amdgpu: use GTT only as fallback for VRAM|GTT

2024-01-08 Thread Christian König
Try to fill up VRAM as well by setting the busy flag on GTT allocations. This fixes the issue that when VRAM was evacuated for suspend it's never filled up again unless the application is restarted. Signed-off-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 6

[PATCH 3/5] drm/ttm: replace busy placement with flags v5

2024-01-08 Thread Christian König
out by checkpatch v5: cleanup some rebase problems with VMWGFX Signed-off-by: Christian König Signed-off-by: Somalapuram Amaranath --- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 6 +- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c| 11 +--- drivers/gpu/drm/drm_gem_vram_helper.c | 2

[PATCH 4/5] drm/ttm: improve idle/busy handling v2

2024-01-08 Thread Christian König
then use the busy placement if that didn't worked. Drawback is that we now always try the idle placement first for each validation which might cause some additional CPU overhead on overcommit. v2: fix kerneldoc warning and coding style Signed-off-by: Christian König --- drivers/gpu/drm/amd/a

[PATCH 1/5] drm/vmwgfx: remove vmw_vram_gmr_placement

2024-01-08 Thread Christian König
Seems to be unused. Signed-off-by: Christian König --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.h| 1 - drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c | 28 -- 2 files changed, 29 deletions(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h b/drivers/gpu/drm/vmwgfx

Rework TTMs busy handling

2024-01-08 Thread Christian König
Hi guys, I'm trying to make this functionality a bit more useful for years now since we multiple reports that behavior of drivers can be suboptimal when multiple placements be given. So basically instead of hacking around the TTM behavior in the driver once more I've gone ahead and changed the id

Re: [PATCH 2/4] drm/ttm: replace busy placement with flags v4

2024-01-05 Thread Christian König
Am 04.01.24 um 21:02 schrieb Zack Rusin: On Thu, Jan 4, 2024 at 10:05 AM Christian König wrote: From: Somalapuram Amaranath Instead of a list of separate busy placement add flags which indicate that a placement should only be used when there is room or if we need to evict. v2: add missing

[PATCH 2/4] drm/ttm: replace busy placement with flags v4

2024-01-04 Thread Christian König
out by checkpatch Signed-off-by: Christian König Signed-off-by: Somalapuram Amaranath --- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 6 +- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c| 11 +-- drivers/gpu/drm/drm_gem_vram_helper.c | 2 - drivers/gpu/drm/i915/gem/i915_gem_ttm.c| 37

[PATCH 4/4] drm/amdgpu: use GTT only as fallback for VRAM|GTT

2024-01-04 Thread Christian König
Try to fill up VRAM as well by setting the busy flag on GTT allocations. This fixes the issue that when VRAM was evacuated for suspend it's never filled up again unless the application is restarted. Signed-off-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 6

[PATCH 3/4] drm/ttm: improve idle/busy handling v2

2024-01-04 Thread Christian König
then use the busy placement if that didn't worked. Drawback is that we now always try the idle placement first for each validation which might cause some additional CPU overhead on overcommit. v2: fix kerneldoc warning and coding style Signed-off-by: Christian König --- drivers/gpu/drm/amd/a

[PATCH 1/4] drm/ttm: return ENOSPC from ttm_bo_mem_space

2024-01-04 Thread Christian König
Only convert it to ENOMEM in ttm_bo_validate. Signed-off-by: Christian König --- drivers/gpu/drm/ttm/ttm_bo.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index edf10618fe2b..8c1eaa74fa21 100644 --- a/drivers

Rework TTMs busy handling

2024-01-04 Thread Christian König
Hi guys, I'm trying to make this functionality a bit more useful for years now since we multiple reports that behavior of drivers can be suboptimal when multiple placements be given. So basically instead of hacking around the TTM behavior in the driver once more I've gone ahead and changed the id

[PATCH 1/4] drm/ttm: return ENOSPC from ttm_bo_mem_space

2024-01-04 Thread Christian König
Only convert it to ENOMEM in ttm_bo_validate. Signed-off-by: Christian König --- drivers/gpu/drm/ttm/ttm_bo.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index edf10618fe2b..8c1eaa74fa21 100644 --- a/drivers

Re: [PATCH 1/4] drm/ttm: return ENOSPC from ttm_bo_mem_space

2023-12-13 Thread Christian König
Before anybody wonders why no additional people are on CC: I just send that out to get feedback from the CI systems. Regards, Christian. Am 13.12.23 um 15:42 schrieb Christian König: Only convert it to ENOMEM in ttm_bo_validate. Signed-off-by: Christian König --- drivers/gpu/drm/ttm

[PATCH 4/4] drm/amdgpu: use GTT only as fallback for VRAM|GTT

2023-12-13 Thread Christian König
Try to fill up VRAM as well by setting the busy flag on GTT allocations. This fixes the issue that when VRAM was evacuated for suspend it's never filled up again unless the application is restarted. Signed-off-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 6

[PATCH 1/4] drm/ttm: return ENOSPC from ttm_bo_mem_space

2023-12-13 Thread Christian König
Only convert it to ENOMEM in ttm_bo_validate. Signed-off-by: Christian König --- drivers/gpu/drm/ttm/ttm_bo.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index edf10618fe2b..8c1eaa74fa21 100644 --- a/drivers

[PATCH 3/4] drm/ttm: improve idle/busy handling

2023-12-13 Thread Christian König
then use the busy placement if that didn't worked. Drawback is that we now always try the idle placement first for each validation which might cause some additional CPU overhead on overcommit. Signed-off-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 2 +- drivers/gp

[PATCH 2/4] drm/ttm: replace busy placement with flags v3

2023-12-13 Thread Christian König
From: Somalapuram Amaranath Instead of a list of separate busy placement add flags which indicate that a placement should only be used when there is room or if we need to evict. v2: add missing TTM_PL_FLAG_IDLE for i915 v3: fix auto build test ERROR on drm-tip/drm-tip Signed-off-by: Christian

Re: [RFC] drm/i915: Allow dmabuf mmap forwarding

2023-12-13 Thread Christian König
Am 13.12.23 um 12:46 schrieb Tvrtko Ursulin: Hi, On 12/12/2023 14:10, Christian König wrote: Hi Tvrtko, Thanks for pointing this mail out once more, I've totally missed it. That's okay, if it was really urgent I would have re-raised the thread earlier. :) As it stands so far

Re: [RFC] drm/i915: Allow dmabuf mmap forwarding

2023-12-12 Thread Christian König
i915 to mmap imported buffers using forwarding via dma_buf_mmap(), which allows the primary minigbm path of DRM_IOCTL_I915_GEM_MMAP_OFFSET / I915_MMAP_OFFSET_WB to work. Signed-off-by: Tvrtko Ursulin Cc: Daniel Vetter Cc: Christian König Cc: Matthew Auld Cc: Nirmoy Das --- 1) It is unclear

Re: [Intel-gfx] [RFC PATCH 0/6] Supporting GMEM (generalized memory management) for external memory devices

2023-12-04 Thread Christian König
Am 04.12.23 um 00:32 schrieb Alistair Popple: Christian König writes: Am 01.12.23 um 06:48 schrieb Zeng, Oak: [SNIP] Besides memory eviction/oversubscription, there are a few other pain points when I use hmm: 1) hmm doesn't support file-back memory, so it is hard to share memor

Re: [Intel-gfx] [RFC PATCH 0/6] Supporting GMEM (generalized memory management) for external memory devices

2023-12-01 Thread Christian König
emory attribute of a virtual address range? Do you need to extend vm_area_struct to save it? With hmm, we have to maintain such information at driver. This ends up with pretty complicated logic to split/merge those address range. I know core mm has similar logic to split/merge vma... Oak -Weixi

Re: [Intel-gfx] [RFC PATCH 0/6] Supporting GMEM (generalized memory management) for external memory devices

2023-11-30 Thread Christian König
MM for that. Regards, Christian. PS, hmadvise() is based on the idea of Nvidia's cudaMemAdvise() which provides abundant and useful memory policies. HMM extended mbind() instead. -Weixi -Original Message- From: Christian König Sent: Wednesday, November 29, 2023 11:22 PM To: zhu

Re: [Intel-gfx] [RFC PATCH 0/6] Supporting GMEM (generalized memory management) for external memory devices

2023-11-30 Thread Christian König
on helpers. For #3, since we have a common drm/buddy layer, I don't think it is a big problem for driver writer now. I do see #4 is something you solved more beautifully, requires new system call though. Oak -Original Message- From: dri-devel On Behalf Of Christian König Sent: T

Re: [Intel-gfx] [RFC PATCH 0/6] Supporting GMEM (generalized memory management) for external memory devices

2023-11-29 Thread Christian König
arsten Schwan. "An evolutionary study of linux memory management for fun and profit." 2016 USENIX Annual Technical Conference (USENIX ATC 16). 2016. Thanks, Weixi -Original Message- From: Dave Airlie Sent: Wednesday, November 29, 2023 1:15 PM To: Christian König Cc: zhuweixi ;

Re: [Intel-gfx] [RFC PATCH 0/6] Supporting GMEM (generalized memory management) for external memory devices

2023-11-28 Thread Christian König
Adding a few missing important people to the explicit to list. Am 28.11.23 um 13:50 schrieb Weixi Zhu: The problem: Accelerator driver developers are forced to reinvent external MM subsystems case by case, because Linux core MM only considers host memory resources. These reinvented MM subsystem

Re: [Intel-gfx] [RFC PATCH 0/6] Supporting GMEM (generalized memory management) for external memory devices

2023-11-28 Thread Christian König
Am 28.11.23 um 13:50 schrieb Weixi Zhu: The problem: Accelerator driver developers are forced to reinvent external MM subsystems case by case, because Linux core MM only considers host memory resources. These reinvented MM subsystems have similar orders of magnitude of LoC as Linux MM (80K), e.g

Re: [Intel-gfx] [PATCH 2/2] drm/amdgpu: use GTT only as fallback for VRAM|GTT

2023-11-27 Thread Christian König
Am 27.11.23 um 17:47 schrieb Bhardwaj, Rajneesh: [AMD Official Use Only - General] -Original Message- From: amd-gfx On Behalf Of Hamza Mahfooz Sent: Monday, November 27, 2023 10:53 AM To: Christian König ; jani.nik...@linux.intel.com; kher...@redhat.com; d...@redhat.com; za

[Intel-gfx] [PATCH 2/2] drm/amdgpu: use GTT only as fallback for VRAM|GTT

2023-11-27 Thread Christian König
Try to fill up VRAM as well by setting the busy flag on GTT allocations. This fixes the issue that when VRAM was evacuated for suspend it's never filled up again unless the application is restarted. Signed-off-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 6

[Intel-gfx] [PATCH 1/2] drm/ttm: replace busy placement with flags v3

2023-11-27 Thread Christian König
From: Somalapuram Amaranath Instead of a list of separate busy placement add flags which indicate that a placement should only be used when there is room or if we need to evict. v2: add missing TTM_PL_FLAG_IDLE for i915 v3: fix auto build test ERROR on drm-tip/drm-tip Signed-off-by: Christian

[Intel-gfx] TTM improvement and amdgpu fix

2023-11-27 Thread Christian König
Hi guys, TTM has a feature which allows to specify placements for normal operation as well as when all domains are "busy" and don't have free space. Not very widely used since it was a bit inflexible and required making multiple placement lists. Replace the multiple lists with flags and start t

Re: [Intel-gfx] [PATCH 0/9] drm: Annotate structs with __counted_by

2023-10-05 Thread Christian König
Am 02.10.23 um 20:22 schrieb Kees Cook: On Mon, Oct 02, 2023 at 08:11:41PM +0200, Christian König wrote: Am 02.10.23 um 20:08 schrieb Kees Cook: On Mon, Oct 02, 2023 at 08:01:57PM +0200, Christian König wrote: Am 02.10.23 um 18:53 schrieb Kees Cook: On Mon, Oct 02, 2023 at 11:06:19AM -0400

Re: [Intel-gfx] [PATCH] dma-buf: Deny copy-on-writes mmaps

2023-10-04 Thread Christian König
Am 04.10.23 um 01:03 schrieb Andi Shyti: From: Chris Wilson Enforce that an mmap of a dmabuf is always using MAP_SHARED so that all access (both read and writes) using the device memory and not a local copy-on-write page in system memory. As much as I would like to do this I fear that this wo

Re: [Intel-gfx] [PATCH 0/9] drm: Annotate structs with __counted_by

2023-10-02 Thread Christian König
Am 02.10.23 um 20:08 schrieb Kees Cook: On Mon, Oct 02, 2023 at 08:01:57PM +0200, Christian König wrote: Am 02.10.23 um 18:53 schrieb Kees Cook: On Mon, Oct 02, 2023 at 11:06:19AM -0400, Alex Deucher wrote: On Mon, Oct 2, 2023 at 5:20 AM Christian König wrote: Am 29.09.23 um 21:33 schrieb

Re: [Intel-gfx] [PATCH 0/9] drm: Annotate structs with __counted_by

2023-10-02 Thread Christian König
Am 02.10.23 um 18:53 schrieb Kees Cook: On Mon, Oct 02, 2023 at 11:06:19AM -0400, Alex Deucher wrote: On Mon, Oct 2, 2023 at 5:20 AM Christian König wrote: Am 29.09.23 um 21:33 schrieb Kees Cook: On Fri, 22 Sep 2023 10:32:05 -0700, Kees Cook wrote: This is a batch of patches touching drm

Re: [Intel-gfx] [PATCH 0/9] drm: Annotate structs with __counted_by

2023-10-02 Thread Christian König
Am 29.09.23 um 21:33 schrieb Kees Cook: On Fri, 22 Sep 2023 10:32:05 -0700, Kees Cook wrote: This is a batch of patches touching drm for preparing for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their acces

Re: [Intel-gfx] [PATCH 1/9] drm/amd/pm: Annotate struct smu10_voltage_dependency_table with __counted_by

2023-09-24 Thread Christian König
Cc: Alex Deucher Cc: "Christian König" Cc: "Pan, Xinhui" Cc: David Airlie Cc: Daniel Vetter Cc: Xiaojian Du Cc: Huang Rui Cc: Kevin Wang Cc: amd-...@lists.freedesktop.org Cc: dri-de...@lists.freedesktop.org Signed-off-by: Kees Cook Acked-by: Alex Deucher Mhm, I

Re: [Intel-gfx] [PATCH v2] drm: Update file owner during use

2023-09-20 Thread Christian König
ver had fallback even. Over the past few years, more projects have emerged which provide functionality similar (be that on API level, Dbus, or otherwise) to systemd-logind. """ v2:   * Fixed typo in commit text and added a fine historical explanation     from Emil. Signed-off-by:

Re: [Intel-gfx] [Nouveau] [RFC, drm-misc-next v4 0/9] PCI/VGA: Allowing the user to select the primary video adapter at boot time

2023-09-07 Thread Christian König
Am 07.09.23 um 18:33 schrieb suijingfeng: Hi, On 2023/9/7 17:08, Christian König wrote: I strongly suggest that you just completely drop this here Drop this is OK, no problem. Then I will go to develop something else. This version is not intended to merge originally, as it's a RFC.

Re: [Intel-gfx] [Nouveau] [RFC, drm-misc-next v4 0/9] PCI/VGA: Allowing the user to select the primary video adapter at boot time

2023-09-07 Thread Christian König
Am 07.09.23 um 17:26 schrieb suijingfeng: [SNIP] Then, I'll give you another example, see below for elaborate description. I have one AMD BC160 GPU, see[1] to get what it looks like. The GPU don't has a display connector interface exported. It actually can be seen as a render-only GPU or comp

Re: [Intel-gfx] [Nouveau] [RFC, drm-misc-next v4 0/9] PCI/VGA: Allowing the user to select the primary video adapter at boot time

2023-09-07 Thread Christian König
Am 07.09.23 um 14:32 schrieb suijingfeng: Hi, On 2023/9/7 17:08, Christian König wrote: Well, I have over 25 years of experience with display hardware and what you describe here was never an issue. I want to give you an example to let you know more. I have a ASRock AD2550B-ITX board[1

Re: [Intel-gfx] [Nouveau] [RFC, drm-misc-next v4 0/9] PCI/VGA: Allowing the user to select the primary video adapter at boot time

2023-09-07 Thread Christian König
Am 07.09.23 um 04:30 schrieb Sui Jingfeng: Hi, On 2023/9/6 17:40, Christian König wrote: Am 06.09.23 um 11:08 schrieb suijingfeng: Well, welcome to correct me if I'm wrong. You seem to have some very basic misunderstandings here. The term framebuffer describes some VRAM memory use

Re: [Intel-gfx] [Nouveau] [RFC, drm-misc-next v4 0/9] PCI/VGA: Allowing the user to select the primary video adapter at boot time

2023-09-06 Thread Christian König
Am 06.09.23 um 12:31 schrieb Sui Jingfeng: Hi, On 2023/9/6 14:45, Christian König wrote: Firmware framebuffer device already get killed by the drm_aperture_remove_conflicting_pci_framebuffers() function (or its siblings). So, this series is definitely not to interact with the firmware

Re: [Intel-gfx] [Nouveau] [RFC, drm-misc-next v4 0/9] PCI/VGA: Allowing the user to select the primary video adapter at boot time

2023-09-06 Thread Christian König
Am 06.09.23 um 11:08 schrieb suijingfeng: Well, welcome to correct me if I'm wrong. You seem to have some very basic misunderstandings here. The term framebuffer describes some VRAM memory used for scanout. This framebuffer is exposed to userspace through some framebuffer driver, on UEFI pla

  1   2   3   4   5   6   7   8   9   10   >