mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 11:50:43 +09:00
MALI: bifrost_for_linux: adjust source codes for kernel v4.19
Signed-off-by: Caesar Wang <wxt@rock-chips.com> Change-Id: Icd0b7085a5e19d8c40b7c2762b2286c89af0197c
This commit is contained in:
@@ -322,6 +322,7 @@ static int kbase_devfreq_init_core_mask_table(struct kbase_device *kbdev)
|
||||
int kbase_devfreq_init(struct kbase_device *kbdev)
|
||||
{
|
||||
struct devfreq_dev_profile *dp;
|
||||
struct dev_pm_opp *opp;
|
||||
unsigned long opp_rate;
|
||||
int err;
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ static int kbase_simple_power_model_get_dummy_temp(
|
||||
struct thermal_zone_device *tz,
|
||||
unsigned long *temp)
|
||||
{
|
||||
*temp = ACCESS_ONCE(dummy_temp);
|
||||
*temp = READ_ONCE(dummy_temp);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ static int kbase_simple_power_model_get_dummy_temp(
|
||||
struct thermal_zone_device *tz,
|
||||
int *dummy_temp)
|
||||
{
|
||||
*temp = ACCESS_ONCE(dummy_temp);
|
||||
*temp = READ_ONCE(dummy_temp);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
@@ -63,7 +63,7 @@ static int kbase_simple_power_model_get_dummy_temp(
|
||||
|
||||
void kbase_simple_power_model_set_dummy_temp(int temp)
|
||||
{
|
||||
ACCESS_ONCE(dummy_temp) = temp;
|
||||
WRITE_ONCE(dummy_temp, temp);
|
||||
}
|
||||
KBASE_EXPORT_TEST_API(kbase_simple_power_model_set_dummy_temp);
|
||||
|
||||
@@ -152,7 +152,7 @@ static int poll_temperature(void *data)
|
||||
set_freezable();
|
||||
|
||||
while (!kthread_should_stop()) {
|
||||
struct thermal_zone_device *tz = ACCESS_ONCE(model_data->gpu_tz);
|
||||
struct thermal_zone_device *tz = READ_ONCE(model_data->gpu_tz);
|
||||
|
||||
if (tz) {
|
||||
int ret;
|
||||
@@ -167,9 +167,9 @@ static int poll_temperature(void *data)
|
||||
temp = FALLBACK_STATIC_TEMPERATURE;
|
||||
}
|
||||
|
||||
ACCESS_ONCE(model_data->current_temperature) = temp;
|
||||
WRITE_ONCE(model_data->current_temperature, temp);
|
||||
|
||||
msleep_interruptible(ACCESS_ONCE(model_data->temperature_poll_interval_ms));
|
||||
msleep_interruptible(READ_ONCE(model_data->temperature_poll_interval_ms));
|
||||
|
||||
try_to_freeze();
|
||||
}
|
||||
@@ -185,7 +185,7 @@ static int model_static_coeff(struct kbase_ipa_model *model, u32 *coeffp)
|
||||
u64 coeff_big;
|
||||
int temp;
|
||||
|
||||
temp = ACCESS_ONCE(model_data->current_temperature);
|
||||
temp = READ_ONCE(model_data->current_temperature);
|
||||
|
||||
/* Range: 0 <= temp_scaling_factor < 2^24 */
|
||||
temp_scaling_factor = calculate_temp_scaling_factor(model_data->ts,
|
||||
@@ -301,7 +301,7 @@ static int kbase_simple_power_model_recalculate(struct kbase_ipa_model *model)
|
||||
}
|
||||
}
|
||||
|
||||
ACCESS_ONCE(model_data->gpu_tz) = tz;
|
||||
WRITE_ONCE(model_data->gpu_tz, tz);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -24,11 +24,11 @@ static ktime_t dummy_time;
|
||||
#ifdef ktime_get
|
||||
#undef ktime_get
|
||||
#endif
|
||||
#define ktime_get() (ACCESS_ONCE(dummy_time))
|
||||
#define ktime_get() (READ_ONCE(dummy_time))
|
||||
|
||||
void kbase_ipa_set_dummy_time(ktime_t t)
|
||||
{
|
||||
ACCESS_ONCE(dummy_time) = t;
|
||||
WRITE_ONCE(dummy_time, t);
|
||||
}
|
||||
KBASE_EXPORT_TEST_API(kbase_ipa_set_dummy_time);
|
||||
|
||||
|
||||
@@ -213,7 +213,7 @@ int kbase_soft_event_update(struct kbase_context *kctx,
|
||||
|
||||
bool kbase_replay_process(struct kbase_jd_atom *katom);
|
||||
|
||||
void kbasep_soft_job_timeout_worker(unsigned long data);
|
||||
void kbasep_soft_job_timeout_worker(struct timer_list *t);
|
||||
void kbasep_complete_triggered_soft_events(struct kbase_context *kctx, u64 evt);
|
||||
|
||||
/* api used internally for register access. Contains validation and tracing */
|
||||
|
||||
@@ -168,9 +168,9 @@ kbase_create_context(struct kbase_device *kbdev, bool is_compat)
|
||||
|
||||
mutex_init(&kctx->vinstr_cli_lock);
|
||||
|
||||
setup_timer(&kctx->soft_job_timeout,
|
||||
timer_setup(&kctx->soft_job_timeout,
|
||||
kbasep_soft_job_timeout_worker,
|
||||
(uintptr_t)kctx);
|
||||
0);
|
||||
|
||||
return kctx;
|
||||
|
||||
|
||||
@@ -595,7 +595,7 @@ void kbase_mem_pool_free_pages(struct kbase_mem_pool *pool, size_t nr_pages,
|
||||
*/
|
||||
static inline size_t kbase_mem_pool_size(struct kbase_mem_pool *pool)
|
||||
{
|
||||
return ACCESS_ONCE(pool->cur_size);
|
||||
return READ_ONCE(pool->cur_size);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -370,9 +370,9 @@ static void kbase_fence_debug_timeout(struct kbase_jd_atom *katom)
|
||||
}
|
||||
#endif /* CONFIG_MALI_BIFROST_FENCE_DEBUG */
|
||||
|
||||
void kbasep_soft_job_timeout_worker(unsigned long data)
|
||||
void kbasep_soft_job_timeout_worker(struct timer_list *t)
|
||||
{
|
||||
struct kbase_context *kctx = (struct kbase_context *)data;
|
||||
struct kbase_context *kctx = from_timer(kctx, t, soft_job_timeout);
|
||||
u32 timeout_ms = (u32)atomic_read(
|
||||
&kctx->kbdev->js_data.soft_job_timeout_ms);
|
||||
struct timer_list *timer = &kctx->soft_job_timeout;
|
||||
|
||||
@@ -156,7 +156,7 @@ void kbase_sync_fence_out_remove(struct kbase_jd_atom *katom);
|
||||
*/
|
||||
static inline void kbase_sync_fence_close_fd(int fd)
|
||||
{
|
||||
sys_close(fd);
|
||||
ksys_close(fd);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1042,13 +1042,11 @@ static void kbasep_tlstream_flush_stream(enum tl_stream_type stype)
|
||||
* Timer is executed periodically to check if any of the stream contains
|
||||
* buffer ready to be submitted to user space.
|
||||
*/
|
||||
static void kbasep_tlstream_autoflush_timer_callback(unsigned long data)
|
||||
static void kbasep_tlstream_autoflush_timer_callback(struct timer_list *t)
|
||||
{
|
||||
enum tl_stream_type stype;
|
||||
int rcode;
|
||||
|
||||
CSTD_UNUSED(data);
|
||||
|
||||
for (stype = 0; stype < TL_STREAM_TYPE_COUNT; stype++) {
|
||||
struct tl_stream *stream = tl_stream[stype];
|
||||
unsigned long flags;
|
||||
@@ -1370,10 +1368,9 @@ int kbase_tlstream_init(void)
|
||||
}
|
||||
|
||||
/* Initialize autoflush timer. */
|
||||
atomic_set(&autoflush_timer_active, 0);
|
||||
setup_timer(&autoflush_timer,
|
||||
kbasep_tlstream_autoflush_timer_callback,
|
||||
0);
|
||||
timer_setup(&autoflush_timer,
|
||||
kbasep_tlstream_autoflush_timer_callback,
|
||||
0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user