gpu: host1x: Enable VI syncpoint pool

Create VI specific syncpoint pool based on
PCT configured VI syncpoint range. VI module shall
allocate syncpoint only from this pool.

Jira HOSTX-5827

Change-Id: I2d6014de2033f0878492d0243010cc7ca507c383
Signed-off-by: Mainak Sen <msen@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3290562
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
This commit is contained in:
Mainak Sen
2025-01-24 11:02:26 +00:00
committed by Jon Hunter
parent 38d739c860
commit b45d59c4a6
2 changed files with 11 additions and 4 deletions

View File

@@ -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 *sp = host->syncpt + host->syncpt_base;
struct host1x_syncpt_pool *pool = NULL; struct host1x_syncpt_pool *pool = NULL;
const char *pool_name = NULL;
char *full_name; char *full_name;
unsigned int i; unsigned int i;
if (!name) if (!name)
return NULL; 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++) { 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]; pool = &host->pools[i];
break; 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); mutex_lock(&host->syncpt_mutex);
for (i = host->syncpt_base; i < host->syncpt_end; i++, sp++) { for (i = host->syncpt_base; i < host->syncpt_end; i++, sp++) {

View File

@@ -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_CLIENT_MANAGED (1 << 0)
#define HOST1X_SYNCPT_HAS_BASE (1 << 1) #define HOST1X_SYNCPT_HAS_BASE (1 << 1)
#define HOST1X_SYNCPT_GPU (1 << 2) #define HOST1X_SYNCPT_GPU (1 << 2)
#define HOST1X_SYNCPT_VI (1 << 3)
#define HOST1X_GLOBAL_TO_LOCAL_SYNCPOINT(global_syncpoint_id) \ #define HOST1X_GLOBAL_TO_LOCAL_SYNCPOINT(global_syncpoint_id) \
(global_syncpoint_id & 0xFFFFFF) (global_syncpoint_id & 0xFFFFFF)