diff --git a/drivers/gpu/host1x/syncpt.c b/drivers/gpu/host1x/syncpt.c index ce4ebcd8..6337a736 100644 --- a/drivers/gpu/host1x/syncpt.c +++ b/drivers/gpu/host1x/syncpt.c @@ -64,23 +64,29 @@ struct host1x_syncpt *host1x_syncpt_alloc(struct host1x *host, { struct host1x_syncpt *sp = host->syncpt + host->syncpt_base; struct host1x_syncpt_pool *pool = NULL; + const char *pool_name = NULL; char *full_name; unsigned int i; if (!name) return NULL; - if (flags & HOST1X_SYNCPT_GPU) { + if (flags & HOST1X_SYNCPT_GPU) + pool_name = "gpu"; + else if (flags & HOST1X_SYNCPT_VI) + pool_name = "vi"; + + if (pool_name) { for (i = 0; i < host->num_pools; i++) { - if (!strcmp(host->pools[i].name, "gpu")) { + if (!strcmp(host->pools[i].name, pool_name)) { pool = &host->pools[i]; break; } } - - /* If no GPU pool configured, any syncpoint is OK. */ } + /* If no GPU or VI pool configured, any syncpoint is OK. */ + mutex_lock(&host->syncpt_mutex); for (i = host->syncpt_base; i < host->syncpt_end; i++, sp++) { diff --git a/include/linux/host1x-next.h b/include/linux/host1x-next.h index e548ec57..80207f48 100644 --- a/include/linux/host1x-next.h +++ b/include/linux/host1x-next.h @@ -217,6 +217,7 @@ static inline void host1x_bo_munmap(struct host1x_bo *bo, void *addr) #define HOST1X_SYNCPT_CLIENT_MANAGED (1 << 0) #define HOST1X_SYNCPT_HAS_BASE (1 << 1) #define HOST1X_SYNCPT_GPU (1 << 2) +#define HOST1X_SYNCPT_VI (1 << 3) #define HOST1X_GLOBAL_TO_LOCAL_SYNCPOINT(global_syncpoint_id) \ (global_syncpoint_id & 0xFFFFFF)