Skip to content

Commit f2cff0f

Browse files
Archit Tanejatomba
authored andcommitted
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>
1 parent 15ec2ca commit f2cff0f

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎drivers/gpu/drm/omapdrm/omap_gem.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1047,10 +1047,10 @@ static inline bool is_waiting(struct omap_gem_sync_waiter *waiter)
10471047
{
10481048
struct omap_gem_object *omap_obj = waiter->omap_obj;
10491049
if ((waiter->op & OMAP_GEM_READ) &&
1050-
(omap_obj->sync->read_complete < waiter->read_target))
1050+
(omap_obj->sync->write_complete < waiter->write_target))
10511051
return true;
10521052
if ((waiter->op & OMAP_GEM_WRITE) &&
1053-
(omap_obj->sync->write_complete < waiter->write_target))
1053+
(omap_obj->sync->read_complete < waiter->read_target))
10541054
return true;
10551055
return false;
10561056
}

0 commit comments

Comments
 (0)