All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Hellstrom <thomas@shipmail.org>
To: "Marek Olšák" <maraeo@gmail.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 1/2] drm/ttm: add a way to bo_wait for either the last read or	last write
Date: Tue, 04 Oct 2011 13:48:06 +0200	[thread overview]
Message-ID: <4E8AF276.2060500@shipmail.org> (raw)
In-Reply-To: <1312749544-22052-1-git-send-email-maraeo@gmail.com>

On 08/07/2011 10:39 PM, Marek Olšák wrote:
> Sometimes we want to know whether a buffer is busy and wait for it (bo_wait).
> However, sometimes it would be more useful to be able to query whether
> a buffer is busy and being either read or written, and wait until it's stopped
> being either read or written. The point of this is to be able to avoid
> unnecessary waiting, e.g. if a GPU has written something to a buffer and is now
> reading that buffer, and a CPU wants to map that buffer for read, it needs to
> only wait for the last write. If there were no write, there wouldn't be any
> waiting needed.
>
> This, or course, requires user space drivers to send read/write flags
> with each relocation (like we have read/write domains in radeon, so we can
> actually use those for something useful now).
>
> Now how this patch works:
>
> The read/write flags should passed to ttm_validate_buffer. TTM maintains
> separate sync objects of the last read and write for each buffer, in addition
> to the sync object of the last use of a buffer. ttm_bo_wait then operates
> with one the sync objects.
>
> Signed-off-by: Marek Olšák<maraeo@gmail.com>
>    

Bah, I totally missed this patch and thus never reviewed it :( Probably 
on vacation.

There are a couple of things I'd like to point out.

1) The bo subsystem may never assume that fence objects are ordered, so 
that when we unref
bo::sync_obj, we may never assume that previously attached fence objects 
are signaled and can be unref'd
Think for example fence objects submitted to different command streams. 
This is a bug and must be fixed.
We can detach fence objects from buffers in the driver validation code, 
because that code knows whether fences are implicitly ordered, or can 
order them either by inserting a barrier (semaphore in NV languange) or 
waiting for the fence to expire. (For example if the new validation is 
READ and the fence currently attached is WRITE, we might need to 
schedule a gpu cache flush before detaching the write fence).

2) Can't we say that a write_sync_obj is simply a sync_obj? What's the 
difference between those two? I think we should remove the 
write_sync_obj bo member.

3) Ideally we should have a linked list of read sync objects, with their 
own sync_obj_arg, but since there apparently aren't any consumers yet, 
we could wait with that.

/Thomas



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

  parent reply	other threads:[~2011-10-04 11:50 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-07 20:39 [PATCH 1/2] drm/ttm: add a way to bo_wait for either the last read or last write Marek Olšák
2011-08-07 20:39 ` [PATCH 2/2] drm/radeon/kms: add a new gem_wait ioctl with read/write flags Marek Olšák
2011-08-12 17:22   ` Jerome Glisse
2011-08-12 17:21 ` [PATCH 1/2] drm/ttm: add a way to bo_wait for either the last read or last write Jerome Glisse
2011-08-13 20:32   ` Marek Olšák
2011-10-04 11:48 ` Thomas Hellstrom [this message]
2011-10-05  2:08   ` Marek Olšák
2011-10-05  5:54     ` Thomas Hellstrom
2011-10-06 22:42       ` Marek Olšák
2011-10-07  8:00         ` Thomas Hellstrom
2011-10-07 13:24           ` Alex Deucher
2011-10-07 14:05             ` Thomas Hellstrom
2011-10-07 14:14               ` Alex Deucher
2011-10-07 13:38           ` Jerome Glisse
2011-10-07 13:42             ` Jerome Glisse
2011-10-07 21:07               ` Marek Olšák
2011-10-07 14:09             ` Thomas Hellstrom
2011-10-07 21:30             ` Marek Olšák
2011-10-08  8:14               ` Thomas Hellstrom
2011-10-07 22:03           ` Marek Olšák
2011-10-24 14:48             ` Thomas Hellstrom
2011-10-24 17:10               ` Marek Olšák
2011-10-24 17:28                 ` Thomas Hellstrom
2011-10-24 17:39                   ` Marek Olšák
2011-10-07  8:58 ` Thomas Hellstrom
2011-10-08 10:26   ` Ville Syrjälä
2011-10-08 11:10     ` Thomas Hellstrom
2011-10-08 11:27       ` Ville Syrjälä
2011-10-08 11:32         ` Thomas Hellstrom
2011-10-24 16:42           ` Marek Olšák
2011-10-24 16:47             ` Thomas Hellstrom

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=4E8AF276.2060500@shipmail.org \
    --to=thomas@shipmail.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=maraeo@gmail.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.