AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: "Christian König" <ckoenig.leichtzumerken@gmail.com>
Cc: daniel@ffwll.ch, amd-gfx@lists.freedesktop.org,
	dri-devel@lists.freedesktop.org,
	"Christian König" <christian.koenig@amd.com>
Subject: Re: [PATCH 8/8] drm: move ttm_execbuf_util into vmwgfx
Date: Mon, 9 May 2022 16:33:16 +0200	[thread overview]
Message-ID: <YnkmLI1C7yc31eW2@phenom.ffwll.local> (raw)
In-Reply-To: <20220504074739.2231-9-christian.koenig@amd.com>

On Wed, May 04, 2022 at 09:47:39AM +0200, Christian König wrote:
> VMWGFX is the only remaining user of this and should probably moved over
> to drm_exec when it starts using GEM as well.
> 
> Signed-off-by: Christian König <christian.koenig@amd.com>

I guess this is a bit annoying since it means we can't require drm_exec in
ttm eviction, but we can make it an optional pointer in the ttm ctx. Needs
to be optional anyway since we won't roll this out to all drivers, and
then we can optionally use it to handle the locking in eviction instead of
the current lock dropping tricks.

I'm assuming at least that's your goal here, or is there a different one?
-Daniel

> ---
>  drivers/gpu/drm/ttm/Makefile                                  | 4 ++--
>  drivers/gpu/drm/vmwgfx/Makefile                               | 2 +-
>  drivers/gpu/drm/{ttm => vmwgfx}/ttm_execbuf_util.c            | 3 ++-
>  .../drm/ttm => drivers/gpu/drm/vmwgfx}/ttm_execbuf_util.h     | 2 +-
>  drivers/gpu/drm/vmwgfx/vmwgfx_drv.h                           | 2 +-
>  drivers/gpu/drm/vmwgfx/vmwgfx_validation.h                    | 2 +-
>  6 files changed, 8 insertions(+), 7 deletions(-)
>  rename drivers/gpu/drm/{ttm => vmwgfx}/ttm_execbuf_util.c (99%)
>  rename {include/drm/ttm => drivers/gpu/drm/vmwgfx}/ttm_execbuf_util.h (99%)
> 
> diff --git a/drivers/gpu/drm/ttm/Makefile b/drivers/gpu/drm/ttm/Makefile
> index f906b22959cf..b05a8477d0d0 100644
> --- a/drivers/gpu/drm/ttm/Makefile
> +++ b/drivers/gpu/drm/ttm/Makefile
> @@ -3,8 +3,8 @@
>  # Makefile for the drm device driver.  This driver provides support for the
>  
>  ttm-y := ttm_tt.o ttm_bo.o ttm_bo_util.o ttm_bo_vm.o ttm_module.o \
> -	ttm_execbuf_util.o ttm_range_manager.o ttm_resource.o ttm_pool.o \
> -	ttm_device.o ttm_sys_manager.o
> +	ttm_range_manager.o ttm_resource.o ttm_pool.o ttm_device.o \
> +	ttm_sys_manager.o
>  ttm-$(CONFIG_AGP) += ttm_agp_backend.o
>  
>  obj-$(CONFIG_DRM_TTM) += ttm.o
> diff --git a/drivers/gpu/drm/vmwgfx/Makefile b/drivers/gpu/drm/vmwgfx/Makefile
> index eee73b9aa404..c2c836103b23 100644
> --- a/drivers/gpu/drm/vmwgfx/Makefile
> +++ b/drivers/gpu/drm/vmwgfx/Makefile
> @@ -1,6 +1,6 @@
>  # SPDX-License-Identifier: GPL-2.0
>  vmwgfx-y := vmwgfx_execbuf.o vmwgfx_gmr.o vmwgfx_hashtab.o vmwgfx_kms.o vmwgfx_drv.o \
> -	    vmwgfx_ioctl.o vmwgfx_resource.o vmwgfx_ttm_buffer.o \
> +	    vmwgfx_ioctl.o vmwgfx_resource.o vmwgfx_ttm_buffer.o ttm_execbuf_util.o \
>  	    vmwgfx_cmd.o vmwgfx_irq.o vmwgfx_ldu.o vmwgfx_ttm_glue.o \
>  	    vmwgfx_overlay.o vmwgfx_gmrid_manager.o vmwgfx_fence.o \
>  	    vmwgfx_bo.o vmwgfx_scrn.o vmwgfx_context.o \
> diff --git a/drivers/gpu/drm/ttm/ttm_execbuf_util.c b/drivers/gpu/drm/vmwgfx/ttm_execbuf_util.c
> similarity index 99%
> rename from drivers/gpu/drm/ttm/ttm_execbuf_util.c
> rename to drivers/gpu/drm/vmwgfx/ttm_execbuf_util.c
> index dbee34a058df..1030f263ba07 100644
> --- a/drivers/gpu/drm/ttm/ttm_execbuf_util.c
> +++ b/drivers/gpu/drm/vmwgfx/ttm_execbuf_util.c
> @@ -26,13 +26,14 @@
>   *
>   **************************************************************************/
>  
> -#include <drm/ttm/ttm_execbuf_util.h>
>  #include <drm/ttm/ttm_bo_driver.h>
>  #include <drm/ttm/ttm_placement.h>
>  #include <linux/wait.h>
>  #include <linux/sched.h>
>  #include <linux/module.h>
>  
> +#include "ttm_execbuf_util.h"
> +
>  static void ttm_eu_backoff_reservation_reverse(struct list_head *list,
>  					      struct ttm_validate_buffer *entry)
>  {
> diff --git a/include/drm/ttm/ttm_execbuf_util.h b/drivers/gpu/drm/vmwgfx/ttm_execbuf_util.h
> similarity index 99%
> rename from include/drm/ttm/ttm_execbuf_util.h
> rename to drivers/gpu/drm/vmwgfx/ttm_execbuf_util.h
> index a99d7fdf2964..47553bf31c73 100644
> --- a/include/drm/ttm/ttm_execbuf_util.h
> +++ b/drivers/gpu/drm/vmwgfx/ttm_execbuf_util.h
> @@ -33,7 +33,7 @@
>  
>  #include <linux/list.h>
>  
> -#include "ttm_bo_api.h"
> +#include <drm/ttm/ttm_bo_api.h>
>  
>  /**
>   * struct ttm_validate_buffer
> diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
> index be19aa6e1f13..cae306c60af9 100644
> --- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
> +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
> @@ -37,8 +37,8 @@
>  #include <drm/drm_rect.h>
>  
>  #include <drm/ttm/ttm_bo_driver.h>
> -#include <drm/ttm/ttm_execbuf_util.h>
>  
> +#include "ttm_execbuf_util.h"
>  #include "ttm_object.h"
>  
>  #include "vmwgfx_fence.h"
> diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_validation.h b/drivers/gpu/drm/vmwgfx/vmwgfx_validation.h
> index f21df053882b..3613a3d52528 100644
> --- a/drivers/gpu/drm/vmwgfx/vmwgfx_validation.h
> +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_validation.h
> @@ -31,7 +31,7 @@
>  #include <linux/list.h>
>  #include <linux/ww_mutex.h>
>  
> -#include <drm/ttm/ttm_execbuf_util.h>
> +#include "ttm_execbuf_util.h"
>  
>  #include "vmwgfx_hashtab.h"
>  
> -- 
> 2.25.1
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

  reply	other threads:[~2022-05-09 14:33 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-04  7:47 [RFC] Common DRM execution context v2 Christian König
2022-05-04  7:47 ` [PATCH 1/8] drm: execution context for GEM buffers v2 Christian König
2022-05-09 14:31   ` Daniel Vetter
2022-05-09 15:01     ` Christian König
2022-05-11 15:23       ` Daniel Vetter
2022-06-09  0:05   ` Felix Kuehling
2022-06-09  7:18     ` Christian König
2022-06-09 14:28       ` Felix Kuehling
2022-05-04  7:47 ` [PATCH 2/8] drm: add drm_exec selftests Christian König
2022-05-04  7:47 ` [PATCH 3/8] drm/amdkfd: switch over to using drm_exec Christian König
2022-06-09  0:04   ` Felix Kuehling
2022-05-04  7:47 ` [PATCH 4/8] drm/amdgpu: use drm_exec for GEM and CSA handling Christian König
2022-05-04  7:47 ` [PATCH 5/8] drm/amdgpu: use the new drm_exec object for CS Christian König
2022-05-04  7:47 ` [PATCH 6/8] drm/radeon: switch over to drm_exec Christian König
2022-05-04  7:47 ` [PATCH 7/8] drm/qxl: switch to using drm_exec Christian König
2022-05-04  7:47 ` [PATCH 8/8] drm: move ttm_execbuf_util into vmwgfx Christian König
2022-05-09 14:33   ` Daniel Vetter [this message]
2022-05-09 15:02     ` Christian König

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YnkmLI1C7yc31eW2@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@amd.com \
    --cc=ckoenig.leichtzumerken@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox