diff options
author | Archit Taneja <archit@ti.com> | 2014-04-11 03:23:31 -0400 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2014-04-15 06:35:28 -0400 |
commit | f2cff0f34ff2c51f703880a2b883ea0c9de4a5ac (patch) | |
tree | 2144c9cbb81a5b60746632763a67ba9f6dd0238f /drivers/gpu/drm/omapdrm | |
parent | 15ec2ca964d7a52e7e0a452fe0f9c409d2f3eec6 (diff) |
drm/omap: gem sync: wait on correct events
A waiter of the type OMAP_GEM_READ should wait for a buffer to be completely
written, and only then proceed with reading it. A similar logic applies for
waiters with OMAP_GEM_WRITE flag.
Currently the function is_waiting() waits on the read_complete/read_target
counts in the sync object.
This should be the other way round, as a reader should wait for users who are
'writing' to this buffer, and vice versa.
Make readers of the buffer(OMAP_GEM_READ) wait on the write counters, and
writers to the buffer(OMAP_GEM_WRITE) wait on the read counters in is_waiting()
Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/gpu/drm/omapdrm')
-rw-r--r-- | drivers/gpu/drm/omapdrm/omap_gem.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/omapdrm/omap_gem.c b/drivers/gpu/drm/omapdrm/omap_gem.c index 9a68e9a28438..95dbce286a41 100644 --- a/drivers/gpu/drm/omapdrm/omap_gem.c +++ b/drivers/gpu/drm/omapdrm/omap_gem.c | |||
@@ -1047,10 +1047,10 @@ static inline bool is_waiting(struct omap_gem_sync_waiter *waiter) | |||
1047 | { | 1047 | { |
1048 | struct omap_gem_object *omap_obj = waiter->omap_obj; | 1048 | struct omap_gem_object *omap_obj = waiter->omap_obj; |
1049 | if ((waiter->op & OMAP_GEM_READ) && | 1049 | if ((waiter->op & OMAP_GEM_READ) && |
1050 | (omap_obj->sync->read_complete < waiter->read_target)) | 1050 | (omap_obj->sync->write_complete < waiter->write_target)) |
1051 | return true; | 1051 | return true; |
1052 | if ((waiter->op & OMAP_GEM_WRITE) && | 1052 | if ((waiter->op & OMAP_GEM_WRITE) && |
1053 | (omap_obj->sync->write_complete < waiter->write_target)) | 1053 | (omap_obj->sync->read_complete < waiter->read_target)) |
1054 | return true; | 1054 | return true; |
1055 | return false; | 1055 | return false; |
1056 | } | 1056 | } |