Пример #1
0
MALI_STATIC_INLINE void mali_gp_scheduler_unlock(void)
{
    MALI_DEBUG_PRINT(5, ("Mali GP scheduler: Releasing GP scheduler lock\n"));
#if defined(MALI_UPPER_HALF_SCHEDULING)
    _mali_osk_spinlock_irq_unlock(gp_scheduler_lock);
#else
    _mali_osk_spinlock_unlock(gp_scheduler_lock);
#endif /* defined(MALI_UPPER_HALF_SCHEDULING) */
}
Пример #2
0
void _mali_osk_bitmap_free_range(struct _mali_osk_bitmap *bitmap, u32 obj, int cnt)
{
	MALI_DEBUG_ASSERT_POINTER(bitmap);

	_mali_osk_spinlock_lock(bitmap->lock);
	bitmap_clear(bitmap->table, obj, cnt);
	bitmap->last = min(bitmap->last, obj);

	bitmap->avail += cnt;
	_mali_osk_spinlock_unlock(bitmap->lock);
}
Пример #3
0
_mali_osk_errcode_t mali_dma_start(struct mali_dma_core* dma, mali_dma_cmd_buf *buf)
{
	_mali_osk_errcode_t err = _MALI_OSK_ERR_OK;

	_mali_osk_spinlock_lock(dma->lock);

	if (mali_dma_is_busy(dma)) {
		err = _MALI_OSK_ERR_BUSY;
		goto out;
	}

	mali_dma_start_transfer(dma, buf);

out:
	_mali_osk_spinlock_unlock(dma->lock);
	return err;
}
Пример #4
0
u32 _mali_osk_bitmap_alloc_range(struct _mali_osk_bitmap *bitmap, int cnt)
{
	u32 obj;

	MALI_DEBUG_ASSERT_POINTER(bitmap);

	if (0 >= cnt) {
		return -1;
	}

	if (1 == cnt) {
		return _mali_osk_bitmap_alloc(bitmap);
	}

	_mali_osk_spinlock_lock(bitmap->lock);
	obj = bitmap_find_next_zero_area(bitmap->table, bitmap->max,
					 bitmap->last, cnt, 0);

	if (obj >= bitmap->max) {
		obj = bitmap_find_next_zero_area(bitmap->table, bitmap->max,
						 bitmap->reserve, cnt, 0);
	}

	if (obj < bitmap->max) {
		bitmap_set(bitmap->table, obj, cnt);

		bitmap->last = (obj + cnt);
		if (bitmap->last >= bitmap->max) {
			bitmap->last = bitmap->reserve;
		}
	} else {
		obj = -1;
	}

	if (obj != -1) {
		bitmap->avail -= cnt;
	}

	_mali_osk_spinlock_unlock(bitmap->lock);

	return obj;
}
Пример #5
0
u32 _mali_osk_bitmap_alloc(struct _mali_osk_bitmap *bitmap)
{
	u32 obj;

	MALI_DEBUG_ASSERT_POINTER(bitmap);

	_mali_osk_spinlock_lock(bitmap->lock);

	obj = find_next_zero_bit(bitmap->table, bitmap->max, bitmap->reserve);

	if (obj < bitmap->max) {
		set_bit(obj, bitmap->table);
	} else {
		obj = -1;
	}

	if (obj != -1)
		--bitmap->avail;
	_mali_osk_spinlock_unlock(bitmap->lock);

	return obj;
}
static void mali_pmu_unlock(struct mali_pmu_core *pmu)
{
	_mali_osk_spinlock_unlock(pmu->lock);
}