From 1543e317f1da31b75942316931e8f491a8920811 Mon Sep 17 00:00:00 2001 From: hc <hc@nodka.com> Date: Thu, 04 Jan 2024 10:08:02 +0000 Subject: [PATCH] disable FB --- kernel/drivers/gpu/arm/bifrost/device/mali_kbase_device.h | 70 +++++++++++++++++++++++++++-------- 1 files changed, 54 insertions(+), 16 deletions(-) diff --git a/kernel/drivers/gpu/arm/bifrost/device/mali_kbase_device.h b/kernel/drivers/gpu/arm/bifrost/device/mali_kbase_device.h index 517c16b..f025011 100644 --- a/kernel/drivers/gpu/arm/bifrost/device/mali_kbase_device.h +++ b/kernel/drivers/gpu/arm/bifrost/device/mali_kbase_device.h @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ /* * - * (C) COPYRIGHT 2019-2021 ARM Limited. All rights reserved. + * (C) COPYRIGHT 2019-2022 ARM Limited. All rights reserved. * * This program is free software and is provided to you under the terms of the * GNU General Public License version 2 as published by the Free Software @@ -23,7 +23,6 @@ /** * kbase_device_get_list - get device list. - * * Get access to device list. * * Return: Pointer to the linked list head. @@ -40,7 +39,7 @@ void kbase_device_put_list(const struct list_head *dev_list); /** - * Kbase_increment_device_id - increment device id. + * kbase_increment_device_id - increment device id. * * Used to increment device id on successful initialization of the device. */ @@ -55,17 +54,17 @@ * When a device file is opened for the first time, * load firmware and initialize hardware counter components. * - * @return 0 on success. An error code on failure. + * Return: 0 on success. An error code on failure. */ int kbase_device_firmware_init_once(struct kbase_device *kbdev); /** * kbase_device_init - Device initialisation. * + * @kbdev: The kbase device structure for the device (must be a valid pointer) + * * This is called from device probe to initialise various other * components needed. - * - * @kbdev: The kbase device structure for the device (must be a valid pointer) * * Return: 0 on success and non-zero value on failure. */ @@ -74,11 +73,10 @@ /** * kbase_device_term - Device termination. * - * This is called from device remove to terminate various components that - * were initialised during kbase_device_init. - * * @kbdev: The kbase device structure for the device (must be a valid pointer) * + * This is called from device remove to terminate various components that + * were initialised during kbase_device_init. */ void kbase_device_term(struct kbase_device *kbdev); @@ -118,22 +116,62 @@ bool kbase_is_gpu_removed(struct kbase_device *kbdev); /** + * kbase_gpu_cache_flush_pa_range_and_busy_wait() - Start a cache physical range flush + * and busy wait + * + * @kbdev: kbase device to issue the MMU operation on. + * @phys: Starting address of the physical range to start the operation on. + * @nr_bytes: Number of bytes to work on. + * @flush_op: Flush command register value to be sent to HW + * + * Issue a cache flush physical range command, then busy wait an irq status. + * This function will clear FLUSH_PA_RANGE_COMPLETED irq mask bit + * and busy-wait the rawstat register. + * + * Return: 0 if successful or a negative error code on failure. + */ +#if MALI_USE_CSF +int kbase_gpu_cache_flush_pa_range_and_busy_wait(struct kbase_device *kbdev, phys_addr_t phys, + size_t nr_bytes, u32 flush_op); +#endif /* MALI_USE_CSF */ + +/** + * kbase_gpu_cache_flush_and_busy_wait - Start a cache flush and busy wait + * @kbdev: Kbase device + * @flush_op: Flush command register value to be sent to HW + * + * Issue a cache flush command to hardware, then busy wait an irq status. + * This function will clear CLEAN_CACHES_COMPLETED irq mask bit set by other + * threads through kbase_gpu_start_cache_clean(), and wake them up manually + * after the busy-wait is done. Any pended cache flush commands raised by + * other thread are handled in this function. + * hwaccess_lock must be held by the caller. + * + * Return: 0 if successful or a negative error code on failure. + */ +int kbase_gpu_cache_flush_and_busy_wait(struct kbase_device *kbdev, + u32 flush_op); + +/** * kbase_gpu_start_cache_clean - Start a cache clean * @kbdev: Kbase device + * @flush_op: Flush command register value to be sent to HW * - * Issue a cache clean and invalidate command to hardware. This function will - * take hwaccess_lock. + * Issue a given cache flush command to hardware. + * This function will take hwaccess_lock. */ -void kbase_gpu_start_cache_clean(struct kbase_device *kbdev); +void kbase_gpu_start_cache_clean(struct kbase_device *kbdev, u32 flush_op); /** * kbase_gpu_start_cache_clean_nolock - Start a cache clean * @kbdev: Kbase device + * @flush_op: Flush command register value to be sent to HW * - * Issue a cache clean and invalidate command to hardware. hwaccess_lock - * must be held by the caller. + * Issue a given cache flush command to hardware. + * hwaccess_lock must be held by the caller. */ -void kbase_gpu_start_cache_clean_nolock(struct kbase_device *kbdev); +void kbase_gpu_start_cache_clean_nolock(struct kbase_device *kbdev, + u32 flush_op); /** * kbase_gpu_wait_cache_clean - Wait for cache cleaning to finish @@ -170,7 +208,7 @@ void kbase_gpu_cache_clean_wait_complete(struct kbase_device *kbdev); /** - * kbase_clean_caches_done - Issue preiously queued cache clean request or + * kbase_clean_caches_done - Issue previously queued cache clean request or * wake up the requester that issued cache clean. * @kbdev: Kbase device * -- Gitblit v1.6.2