All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Zimmermann <tzimmermann@suse.de>
To: "Christian König" <ckoenig.leichtzumerken@gmail.com>,
	airlied@linux.ie, daniel@ffwll.ch, kraxel@redhat.com,
	zackr@vmware.com, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 1/4] drm/vram-helper: cleanup drm_gem_vram_bo_driver_move_notify
Date: Thu, 11 Feb 2021 15:52:59 +0100	[thread overview]
Message-ID: <365e99a6-24c4-33b5-ae9c-15904b056b89@suse.de> (raw)
In-Reply-To: <20210211131659.276275-1-christian.koenig@amd.com>


[-- Attachment #1.1.1: Type: text/plain, Size: 2571 bytes --]

Hi

Am 11.02.21 um 14:16 schrieb Christian König:
> Swapping bo->mem was completely unecessary. Cleanup the function which
> is just a leftover from a TTM cleanup.

Yes this was introduced in a recent cleanup effort. Can you explain what 
the code intends to do? It seems as if it tries to "re-unmap the BO" if 
the move_memcpy fails.

If the move_memcpy fails now, it seems like we can live without 
reverting that call to drm_gem_vram_bo_driver_move_notify(). (?)

Best regards
Thomas

> 
> Signed-off-by: Christian König <christian.koenig@amd.com>
> ---
>   drivers/gpu/drm/drm_gem_vram_helper.c | 18 ++++--------------
>   1 file changed, 4 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_gem_vram_helper.c b/drivers/gpu/drm/drm_gem_vram_helper.c
> index a0992f0b8afd..0c2233ee6029 100644
> --- a/drivers/gpu/drm/drm_gem_vram_helper.c
> +++ b/drivers/gpu/drm/drm_gem_vram_helper.c
> @@ -564,9 +564,7 @@ static void drm_gem_vram_bo_driver_evict_flags(struct drm_gem_vram_object *gbo,
>   	*pl = gbo->placement;
>   }
>   
> -static void drm_gem_vram_bo_driver_move_notify(struct drm_gem_vram_object *gbo,
> -					       bool evict,
> -					       struct ttm_resource *new_mem)
> +static void drm_gem_vram_bo_driver_move_notify(struct drm_gem_vram_object *gbo)
>   {
>   	struct ttm_buffer_object *bo = &gbo->bo;
>   	struct drm_device *dev = bo->base.dev;
> @@ -582,16 +580,8 @@ static int drm_gem_vram_bo_driver_move(struct drm_gem_vram_object *gbo,
>   				       struct ttm_operation_ctx *ctx,
>   				       struct ttm_resource *new_mem)
>   {
> -	int ret;
> -
> -	drm_gem_vram_bo_driver_move_notify(gbo, evict, new_mem);
> -	ret = ttm_bo_move_memcpy(&gbo->bo, ctx, new_mem);
> -	if (ret) {
> -		swap(*new_mem, gbo->bo.mem);
> -		drm_gem_vram_bo_driver_move_notify(gbo, false, new_mem);
> -		swap(*new_mem, gbo->bo.mem);
> -	}
> -	return ret;
> +	drm_gem_vram_bo_driver_move_notify(gbo);
> +	return ttm_bo_move_memcpy(&gbo->bo, ctx, new_mem);
>   }
>   
>   /*
> @@ -947,7 +937,7 @@ static void bo_driver_delete_mem_notify(struct ttm_buffer_object *bo)
>   
>   	gbo = drm_gem_vram_of_bo(bo);
>   
> -	drm_gem_vram_bo_driver_move_notify(gbo, false, NULL);
> +	drm_gem_vram_bo_driver_move_notify(gbo);
>   }
>   
>   static int bo_driver_move(struct ttm_buffer_object *bo,
> 

-- 
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer


[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2021-02-11 14:53 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-11 13:16 [PATCH 1/4] drm/vram-helper: cleanup drm_gem_vram_bo_driver_move_notify Christian König
2021-02-11 13:16 ` [PATCH 2/4] drm/qxl: clean up qxl_bo_move_notify Christian König
2021-02-11 14:53   ` Thomas Zimmermann
2021-02-11 13:16 ` [PATCH 3/4] drm/nouveau: clean up nouveau_bo_move_ntfy Christian König
2021-02-11 13:16 ` [PATCH 4/4] drm/vmwgfx: clean up vmw_move_notify Christian König
2021-02-11 14:59   ` Alex Deucher
2021-02-11 14:52 ` Thomas Zimmermann [this message]
2021-02-11 15:05   ` [PATCH 1/4] drm/vram-helper: cleanup drm_gem_vram_bo_driver_move_notify Christian König
2021-02-11 15:12     ` Thomas Zimmermann
2021-02-12  8:26 ` Thomas Zimmermann

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=365e99a6-24c4-33b5-ae9c-15904b056b89@suse.de \
    --to=tzimmermann@suse.de \
    --cc=airlied@linux.ie \
    --cc=ckoenig.leichtzumerken@gmail.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kraxel@redhat.com \
    --cc=zackr@vmware.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.