Re: Rework TTMs busy handling

2024-01-16 Thread Zack Rusin
n fact the entire series looks good to me. For the series: Reviewed-by: Zack Rusin z

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

2024-01-09 Thread Zack Rusin
t; if (res->placement & TTM_PL_FLAG_TEMPORARY) > return false; > > - for (i = 0; i < num_placement; i++) { > - const struct ttm_place *heap = [i]; > + for (i = 0; i < placement->num_placement; i++) { > + const struct ttm_place *place = >placement[i]; > + struct ttm_resource_manager *man; > > - if (!ttm_resource_compatible(bdev, res, heap, bo->base.size)) > + if (res->mem_type != place->mem_type) > + continue; > + > + man = ttm_manager_type(bdev, res->mem_type); > + if (man->func->compatible && > + !man->func->compatible(man, res, place, bo->base.size)) > continue; > > - if ((res->mem_type == heap->mem_type) && > - (!(heap->flags & TTM_PL_FLAG_CONTIGUOUS) || > + if ((!(place->flags & TTM_PL_FLAG_CONTIGUOUS) || > (res->placement & TTM_PL_FLAG_CONTIGUOUS))) > return true; > } > return false; > } > > -/** > - * ttm_resource_compat - check if resource is compatible with placement > - * > - * @res: the resource to check > - * @placement: the placement to check against > - * > - * Returns true if the placement is compatible. > - */ > -bool ttm_resource_compat(struct ttm_resource *res, > -struct ttm_placement *placement) > -{ > - if (ttm_resource_places_compat(res, placement->placement, > - placement->num_placement)) > - return true; > - > - if ((placement->busy_placement != placement->placement || > -placement->num_busy_placement > placement->num_placement) && > - ttm_resource_places_compat(res, placement->busy_placement, > - placement->num_busy_placement)) > - return true; > - > - return false; > -} > - > void ttm_resource_set_bo(struct ttm_resource *res, > struct ttm_buffer_object *bo) > { > diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_bo.c > b/drivers/gpu/drm/vmwgfx/vmwgfx_bo.c > index 2bfac3aad7b7..7d7b33fcb5cf 100644 > --- a/drivers/gpu/drm/vmwgfx/vmwgfx_bo.c > +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_bo.c > @@ -821,8 +821,6 @@ void vmw_bo_placement_set(struct vmw_bo *bo, u32 domain, > u32 busy_domain) > __func__, bo->tbo.resource->mem_type, > domain); > } > > - pl->busy_placement = bo->busy_places; > - pl->num_busy_placement = set_placement_list(bo->busy_places, > busy_domain); > } Sorry, one last thing. Could you add the exact same code you've added to nouveau_bo.c here or add a fixme mentioning that it should be done? With that, for the series: Reviewed-by: Zack Rusin z

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

2024-01-04 Thread 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 TTM_PL_FLAG_IDLE for i915 > v3:

Re: [Intel-gfx] [PATCH 8/9] drm/vmwgfx: Annotate struct vmw_surface_dirty with __counted_by

2023-09-22 Thread Zack Rusin
; (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family > functions). > > As found with Coccinelle[1], add __counted_by for struct vmw_surface_dirty. > > [1] > https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci > > Cc: Zack Ru

Re: [Intel-gfx] [PATCH 4/5] drm/vmwgfx: Remove redundant framebuffer format check

2023-01-11 Thread Zack Rusin
mat %p4cc / modifier 0x%llx\n", > -   _cmd->pixel_format, mode_cmd->modifier[0]); > -   return -EINVAL; > -   } > - > vfbd = kzalloc(sizeof(*vfbd), GFP_KERNEL); > if (!vfbd) { > ret = -ENOMEM; That's a nice cleanup. Thanks. Reviewed-by: Zack Rusin

Re: [Intel-gfx] linux-next: build failure after merge of the drm-misc tree

2022-10-20 Thread Zack Rusin
On Fri, 2022-10-21 at 11:02 +1100, Stephen Rothwell wrote: > Hi all, > > After merging the drm-misc tree, today's linux-next build (x86_64 > allmodconfig) failed like this: > > drivers/gpu/drm/nouveau/nouveau_display.c: In function > 'nouveau_display_create': >

Re: [Intel-gfx] [PATCH v2 1/4] drm/vmwgfx: Stop using 'TRUE'

2022-07-05 Thread Zack Rusin
ther headers. drm_crtc.h is part of that chain, and I'm trying to eliminate all unnecessary includes from it to avoid pointless rebuilds. v2: Split out from the bigger patch Cc: Zack Rusin mailto:za...@vmware.com>> Cc: VMware Graphics Reviewers mailto:linux-graphics-maintai...@vmware.com>>

Re: [Intel-gfx] [PATCH 03/15] dma-buf & drm/amdgpu: remove dma_resv workaround

2022-04-21 Thread Zack Rusin
On Thu, 2022-04-21 at 12:17 +0200, Christian König wrote: > ⚠ External Email > > Am 20.04.22 um 21:28 schrieb Zack Rusin: > > [SNIP] > > > To figure out what it is could you try the following code > > > fragment: > > > > > > diff --git a/drivers

Re: [Intel-gfx] [PATCH 03/15] dma-buf & drm/amdgpu: remove dma_resv workaround

2022-04-20 Thread Zack Rusin
On Wed, 2022-04-20 at 20:56 +0200, Christian König wrote: > ⚠ External Email > > Am 20.04.22 um 20:49 schrieb Christian König: > > Am 20.04.22 um 20:41 schrieb Zack Rusin: > > > On Wed, 2022-04-20 at 19:40 +0200, Christian König wrote: > > > > Am

Re: [Intel-gfx] [PATCH 03/15] dma-buf & drm/amdgpu: remove dma_resv workaround

2022-04-20 Thread Zack Rusin
On Wed, 2022-04-20 at 19:40 +0200, Christian König wrote: > > Am 20.04.22 um 19:38 schrieb Zack Rusin: > > On Wed, 2022-04-20 at 09:37 +0200, Christian König wrote: > > > ⚠ External Email > > > > > > Hi Zack, > > > > > > Am 20.04.22 um 0

Re: [Intel-gfx] [PATCH 03/15] dma-buf & drm/amdgpu: remove dma_resv workaround

2022-04-20 Thread Zack Rusin
On Wed, 2022-04-20 at 09:37 +0200, Christian König wrote: > ⚠ External Email > > Hi Zack, > > Am 20.04.22 um 05:56 schrieb Zack Rusin: > > On Thu, 2022-04-07 at 10:59 +0200, Christian König wrote: > > > Rework the internals of the dma_resv object to allow ad

Re: [Intel-gfx] [PATCH 03/15] dma-buf & drm/amdgpu: remove dma_resv workaround

2022-04-19 Thread Zack Rusin
On Thu, 2022-04-07 at 10:59 +0200, Christian König wrote: > Rework the internals of the dma_resv object to allow adding more than > one > write fence and remember for each fence what purpose it had. > > This allows removing the workaround from amdgpu which used a container > for > this instead. >

Re: [Intel-gfx] [PATCH 11/11] drm/vmwgfx: remove vmw_wait_dma_fence

2022-01-24 Thread Zack Rusin
On Mon, 2022-01-24 at 14:03 +0100, Christian König wrote: > Decomposing fence containers don't seem to make any sense here. > > So just remove the function entirely and call dma_fence_wait() > directly. > > Signed-off-by: Christian König > Cc: VMware Graphics > Cc:

Re: [Intel-gfx] [PATCH 3/3] drm/vmwgfx: fix potential UAF in vmwgfx_surface.c

2021-07-22 Thread Zack Rusin
ctl and vmw_gb_surface_define_internal. This is fixed by replacing drm_master_get with drm_file_get_master. Signed-off-by: Desmond Cheong Zhi Xi Reviewed-by: Zack Rusin Thanks for taking the time to fix this. Apart from the clear logic error, do you happen to know under what circumstances would this be hit?

Re: [Intel-gfx] [PATCH v4 25/27] drm/vmwgfx: Don't set struct drm_device.irq_enabled

2021-06-25 Thread Zack Rusin
immermann > Reviewed-by: Laurent Pinchart > Acked-by: Daniel Vetter Looks good. Reviewed-by: Zack Rusin ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Re: [Intel-gfx] [patch 2/7] drm/vmgfx: Replace kmap_atomic()

2021-03-04 Thread Zack Rusin
usage with the given pgprot. > > Remove the NULL pointer check for the map. These functions return a valid > address for valid pages and the return was bogus anyway as it would have > left preemption and pagefaults disabled. > > Signed-off-by: Thomas Gleixner > Cc: VMware Grap

Re: [Intel-gfx] [PATCH 00/29] [Set 15] Finally rid W=1 warnings from GPU!

2021-01-19 Thread Zack Rusin
> On Jan 19, 2021, at 03:29, Lee Jones wrote: > > On Mon, 18 Jan 2021, Daniel Vetter wrote: > >> On Mon, Jan 18, 2021 at 03:09:45PM +, Lee Jones wrote: >>> On Mon, 18 Jan 2021, Daniel Vetter wrote: >>> >>>> On Fri, Jan 15, 2021 at 06:27:15

Re: [Intel-gfx] [PATCH v4 5/6] drm/vmwgfx: Remove reference to struct drm_device.pdev

2021-01-18 Thread Zack Rusin
x: Switch to a managed drm device") > Cc: Zack Rusin > Cc: Martin Krastev > Cc: Roland Scheidegger > Cc: VMware Graphics > Cc: dri-de...@lists.freedesktop.org > --- > drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/dr

Re: [Intel-gfx] [PATCH 00/29] [Set 15] Finally rid W=1 warnings from GPU!

2021-01-15 Thread Zack Rusin
x86. Thanks! For all the vmwgfx bits: Reviewed-by: Zack Rusin z ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Re: [Intel-gfx] [PATCH 14/15] drm/vmwgfx: Remove references to struct drm_device.pdev

2020-12-03 Thread Zack Rusin
> On Dec 3, 2020, at 10:12, Daniel Vetter wrote: > > On Thu, Dec 03, 2020 at 03:06:20AM +0000, Zack Rusin wrote: >> >> >>> On Dec 2, 2020, at 11:03, Daniel Vetter wrote: >>> >>> On Wed, Dec 2, 2020 at 4:37 PM Zack Rusin wrote: >>

Re: [Intel-gfx] [PATCH 14/15] drm/vmwgfx: Remove references to struct drm_device.pdev

2020-12-02 Thread Zack Rusin
> On Dec 2, 2020, at 11:03, Daniel Vetter wrote: > > On Wed, Dec 2, 2020 at 4:37 PM Zack Rusin wrote: >> >> >> >>> On Dec 2, 2020, at 09:27, Thomas Zimmermann wrote: >>> >>> Hi >>> >>> Am 02.12.20 um 09:01 schrieb

Re: [Intel-gfx] [PATCH 14/15] drm/vmwgfx: Remove references to struct drm_device.pdev

2020-12-02 Thread Zack Rusin
> On Dec 2, 2020, at 09:27, Thomas Zimmermann wrote: > > Hi > > Am 02.12.20 um 09:01 schrieb Thomas Zimmermann: >> Hi >> Am 30.11.20 um 21:59 schrieb Zack Rusin: >>> >>> >>>> On Nov 24, 2020, at 06:38, Thomas Zimmermann wrote: >&

Re: [Intel-gfx] [PATCH 14/15] drm/vmwgfx: Remove references to struct drm_device.pdev

2020-11-30 Thread Zack Rusin
vmwgfx/vmwgfx_cmdbuf.c | 8 > drivers/gpu/drm/vmwgfx/vmwgfx_drv.c| 27 +- > drivers/gpu/drm/vmwgfx/vmwgfx_fb.c | 2 +- Reviewed-by: Zack Rusin z ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http