Re: [PATCH 4/4] drm/vmwgfx: move ttm_bo_swapout_all into vmwgfx

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Oct 2, 2020 at 10:47 AM Christian König
<ckoenig.leichtzumerken@xxxxxxxxx> wrote:
>
> It is the sole user of this.
>
> Signed-off-by: Christian König <christian.koenig@xxxxxxx>

Patches 1, 3&4: Acked-by: Daniel Vetter <daniel.vetter@xxxxxxxx>

Patch 1 is maybe a bit big and shouldn't be all smashed, but whatever.
-Daniel

> ---
>  drivers/gpu/drm/ttm/ttm_bo.c        | 11 -----------
>  drivers/gpu/drm/vmwgfx/vmwgfx_drv.c |  6 +++++-
>  include/drm/ttm/ttm_bo_api.h        |  1 -
>  3 files changed, 5 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
> index 5c5836c4284e..74708dd4a8e9 100644
> --- a/drivers/gpu/drm/ttm/ttm_bo.c
> +++ b/drivers/gpu/drm/ttm/ttm_bo.c
> @@ -1308,17 +1308,6 @@ int ttm_bo_swapout(struct ttm_operation_ctx *ctx)
>  }
>  EXPORT_SYMBOL(ttm_bo_swapout);
>
> -void ttm_bo_swapout_all(void)
> -{
> -       struct ttm_operation_ctx ctx = {
> -               .interruptible = false,
> -               .no_wait_gpu = false
> -       };
> -
> -       while (ttm_bo_swapout(&ctx) == 0);
> -}
> -EXPORT_SYMBOL(ttm_bo_swapout_all);
> -
>  void ttm_bo_tt_destroy(struct ttm_buffer_object *bo)
>  {
>         if (bo->ttm == NULL)
> diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
> index 2f99079e122b..dcbcb04ff27c 100644
> --- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
> +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
> @@ -1364,6 +1364,10 @@ static int vmw_pm_freeze(struct device *kdev)
>         struct pci_dev *pdev = to_pci_dev(kdev);
>         struct drm_device *dev = pci_get_drvdata(pdev);
>         struct vmw_private *dev_priv = vmw_priv(dev);
> +       struct ttm_operation_ctx ctx = {
> +               .interruptible = false,
> +               .no_wait_gpu = false
> +       };
>         int ret;
>
>         /*
> @@ -1384,7 +1388,7 @@ static int vmw_pm_freeze(struct device *kdev)
>         vmw_execbuf_release_pinned_bo(dev_priv);
>         vmw_resource_evict_all(dev_priv);
>         vmw_release_device_early(dev_priv);
> -       ttm_bo_swapout_all();
> +       while (ttm_bo_swapout(&ctx) == 0);
>         if (dev_priv->enable_fb)
>                 vmw_fifo_resource_dec(dev_priv);
>         if (atomic_read(&dev_priv->num_fifo_resources) != 0) {
> diff --git a/include/drm/ttm/ttm_bo_api.h b/include/drm/ttm/ttm_bo_api.h
> index f0fbef7817c6..630ce2288de7 100644
> --- a/include/drm/ttm/ttm_bo_api.h
> +++ b/include/drm/ttm/ttm_bo_api.h
> @@ -542,7 +542,6 @@ ssize_t ttm_bo_io(struct ttm_device *bdev, struct file *filp,
>                   size_t count, loff_t *f_pos, bool write);
>
>  int ttm_bo_swapout(struct ttm_operation_ctx *ctx);
> -void ttm_bo_swapout_all(void);
>
>  /**
>   * ttm_bo_uses_embedded_gem_object - check if the given bo uses the
> --
> 2.17.1
>


-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux