#include <linux/module.h>
#include <linux/device.h>
#include <trace/events/host1x.h>
#define SYNCPT_CHECK_PERIOD (2 * HZ)
#define MAX_STUCK_CHECK_COUNT 15
static struct host1x_syncpt_base *
host1x_syncpt_base_request(struct host1x *host)
struct host1x_syncpt_base *bases = host->bases;
for (i = 0; i < host->info->nb_bases; i++)
if (i >= host->info->nb_bases)
bases[i].requested = true;
static void host1x_syncpt_base_free(struct host1x_syncpt_base *base)
static struct host1x_syncpt *host1x_syncpt_alloc(struct host1x *host,
struct host1x_client *client,
struct host1x_syncpt *sp = host->syncpt;
mutex_lock(&host->syncpt_mutex);
for (i = 0; i < host->info->nb_pts && sp->name; i++, sp++)
if (i >= host->info->nb_pts)
if (flags & HOST1X_SYNCPT_HAS_BASE) {
sp->base = host1x_syncpt_base_request(host);