dri-devel Archive on 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: Mon, 24 Oct 2011 16:48:04 +0200	[thread overview]
Message-ID: <4EA57AA4.6040600@shipmail.org> (raw)
In-Reply-To: <CAAxE2A6uJzg0Uvvehzd2YVYZtAAE-hBBik2G77QAEfZ9bU5wJg@mail.gmail.com>

On 10/08/2011 12:03 AM, Marek Olšák wrote:
> On Fri, Oct 7, 2011 at 10:00 AM, Thomas Hellstrom<thomas@shipmail.org>  wrote:
>    
>> OK. First I think we need to make a distinction: bo sync objects vs driver
>> fences. The bo sync obj api is there to strictly provide functionality that
>> the ttm bo subsystem is using, and that follows a simple set of rules:
>>
>> 1) the bo subsystem does never assume sync objects are ordered. That means
>> the bo subsystem needs to wait on a sync object before removing it from a
>> buffer. Any other assumption is buggy and must be fixed. BUT, if that
>> assumption takes place in the driver unknowingly from the ttm bo subsystem
>> (which is usually the case), it's OK.
>>
>> 2) When the sync object(s) attached to the bo are signaled the ttm bo
>> subsystem is free to copy the bo contents and to unbind the bo.
>>
>> 3) The ttm bo system allows sync objects to be signaled in different ways
>> opaque to the subsystem using sync_obj_arg. The driver is responsible for
>> setting up that argument.
>>
>> 4) Driver fences may be used for or expose other functionality or adaptions
>> to APIs as long as the sync obj api exported to the bo sybsystem follows the
>> above rules.
>>
>> This means the following w r t the patch.
>>
>> A) it violates 1). This is a bug that must be fixed. Assumptions that if one
>> sync object is singnaled, another sync object is also signaled must be done
>> in the driver and not in the bo subsystem. Hence we need to explicitly wait
>> for a fence to remove it from the bo.
>>
>> B) the sync_obj_arg carries *per-sync-obj* information on how it should be
>> signaled. If we need to attach multiple sync objects to a buffer object, we
>> also need multiple sync_obj_args. This is a bug and needs to be fixed.
>>
>> C) There is really only one reason that the ttm bo subsystem should care
>> about multiple sync objects, and that is because the driver can't order them
>> efficiently. A such example would be hardware with multiple pipes reading
>> simultaneously from the same texture buffer. Currently we don't support this
>> so only the *last* sync object needs to be know by the bo subsystem. Keeping
>> track of multiple fences generates a lot of completely unnecessary code in
>> the ttm_bo_util file, the ttm_bo_vm file, and will be a nightmare if / when
>> we truly support pipelined moves.
>>
>> As I understand it from your patches, you want to keep multiple fences
>> around only to track rendering history. If we want to do that generically, i
>> suggest doing it in the execbuf util code in the following way:
>>
>> struct ttm_eu_rendering_history {
>>     void *last_read_sync_obj;
>>     void *last_read_sync_obj_arg;
>>     void *last_write_sync_obj;
>>     void *last_write_sync_obj_arg;
>> }
>>
>> Embed this structure in the radeon_bo, and build a small api around it,
>> including *optionally* passing it to the existing execbuf utilities, and you
>> should be done. The bo_util code and bo_vm code doesn't care about the
>> rendering history. Only that the bo is completely idle.
>>
>> Note also that when an accelerated bo move is scheduled, the driver needs to
>> update this struct
>>      
> OK, sounds good. I'll fix what should be fixed and send a patch when
> it's ready. I am now not so sure whether doing this generically is a
> good idea. :)
>
> Marek
>    

Marek,
Any progress on this. The merge window is about to open soon I guess and 
we need a fix by then.

/Thomas



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

  reply	other threads:[~2011-10-24 14: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
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 [this message]
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=4EA57AA4.6040600@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox