Example #1
0
mali_sync_pt *mali_stream_create_point(int tl_fd)
{
	struct sync_timeline *tl;
	struct sync_pt * pt;
	struct file *tl_file;

	tl_file = fget(tl_fd);
	if (tl_file == NULL)
		return NULL;

	if (tl_file->f_op != &stream_fops)
	{
		pt = NULL;
		goto out;
	}

	tl = tl_file->private_data;

	pt = mali_sync_pt_alloc(tl);
	if (!pt)
	{
		pt = NULL;
		goto out;
	}

out:
	fput(tl_file);

	return pt;
}
Example #2
0
static mali_sync_pt *mali_stream_create_point_internal(int tl_fd, mali_bool timed)
{
	struct sync_timeline *tl;
	struct sync_pt * pt;
	struct file *tl_file;

	tl_file = fget(tl_fd);
	if (tl_file == NULL)
		return NULL;

	if (tl_file->f_op != &stream_fops)
	{
		pt = NULL;
		goto out;
	}

	tl = tl_file->private_data;

	if (unlikely(timed))
	{
		pt = mali_sync_timed_pt_alloc(tl);
	}
	else
	{
		pt = mali_sync_pt_alloc(tl);
	}

	if (!pt)
	{
		pt = NULL;
		goto out;
	}

out:
	fput(tl_file);

	return pt;
}