From: Jakob Bornecrantz <jakob@vmware.com>
To: Thomas Hellstrom <thellstrom@vmware.com>
Cc: linux-graphics-maintainer@vmware.com, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm/ttm: Don't move non-existing data
Date: Mon, 18 Nov 2013 03:38:08 -0800 (PST) [thread overview]
Message-ID: <1394911539.36268921.1384774688452.JavaMail.root@vmware.com> (raw)
In-Reply-To: <1384759838-3501-1-git-send-email-thellstrom@vmware.com>
----- Original Message -----
> If ttm_bo_move_memcpy was instructed to move a non-populated ttm to
> io memory, it would first populate the ttm, then move the data and then
> destroy the ttm. That's stupid. However, some drivers might have relied on
> this to clear io memory from old stuff. So instead of a NOP, which would
> be the most efficient, just clear the destination.
>
> Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Cheers, Jakob.
> ---
> drivers/gpu/drm/ttm/ttm_bo_util.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c
> b/drivers/gpu/drm/ttm/ttm_bo_util.c
> index 4834c46..15b86a9 100644
> --- a/drivers/gpu/drm/ttm/ttm_bo_util.c
> +++ b/drivers/gpu/drm/ttm/ttm_bo_util.c
> @@ -350,10 +350,13 @@ int ttm_bo_move_memcpy(struct ttm_buffer_object *bo,
> goto out2;
>
> /*
> - * Move nonexistent data. NOP.
> + * Don't move nonexistent data. Clear destination instead.
> */
> - if (old_iomap == NULL && ttm == NULL)
> + if (old_iomap == NULL &&
> + (ttm == NULL || ttm->state == tt_unpopulated)) {
> + memset_io(new_iomap, 0, new_mem->num_pages*PAGE_SIZE);
> goto out2;
> + }
>
> /*
> * TTM might be null for moves within the same region.
> --
> 1.7.10.4
>
prev parent reply other threads:[~2013-11-18 11:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-18 7:30 [PATCH] drm/ttm: Don't move non-existing data Thomas Hellstrom
2013-11-18 11:38 ` Jakob Bornecrantz [this message]
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=1394911539.36268921.1384774688452.JavaMail.root@vmware.com \
--to=jakob@vmware.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-graphics-maintainer@vmware.com \
--cc=thellstrom@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.