Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion drivers/gpu/drm/arise/cbios/Device/CBiosShare.h
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ static inline CBIOS_U32 cb_swab32(CBIOS_U32 x)
#define cbmemset(s1, v, n) CBIOS_NULL
#define cbmemcpy(s1, s2, n) CBIOS_NULL
#define cbmemcmp(s1, s2, n) 0
#define cbdo_div(a, b) ((a)/(b))
#define cbdo_div(a, b) 0
#define cbvsprintf(s, f, ...) 0

#else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,7 @@ unsigned long long engine_update_vcp_fence_id_e3k(vidsch_mgr_t *sch_mgr)
unsigned long long update_timestamp; /* THE time update fence id */
unsigned long long time_interval;
gf_get_nsecs(&update_timestamp);
time_interval = (update_timestamp - \
sch_mgr->adapter->vcp_task_info[i].vcp_inc_timestamp)/1000000;
time_interval = gf_do_div(update_timestamp - sch_mgr->adapter->vcp_task_info[i].vcp_inc_timestamp, 1000000);
sch_mgr->adapter->vcp_info[j].TotalDecodetime += time_interval;
sch_mgr->adapter->vcp_info[j].TotalDecodeFrameNum++;
sch_mgr->last_returned_fence_id = sch_mgr->returned_fence_id;
Expand Down
4 changes: 0 additions & 4 deletions drivers/gpu/drm/arise/core/e3k/vidsch/vidsch_setup_e3k.c
Original file line number Diff line number Diff line change
Expand Up @@ -463,13 +463,9 @@ static void vidsch_get_set_reg_e3k(adapter_t *adapter, gf_query_info_t *info)

reg_offset = (CHIP_ARISE1020 <= adapter->chip_id) ? Reg_Csp_Ref_Total_Gpu_Timestamp_Offset_Arise1020 : Reg_Csp_Ms_Total_Gpu_Timestamp_Offset;

#ifdef __aarch64__
time_stamp_lo = gf_read32(adapter->mmio + MMIO_CSP_START_ADDRESS + reg_offset * 4);
time_stamp_hi = gf_read32(adapter->mmio + MMIO_CSP_START_ADDRESS + reg_offset * 4 + 4);
info->value64 = time_stamp_lo | (time_stamp_hi << 32);
#else
info->value64 = gf_read64(adapter->mmio + MMIO_CSP_START_ADDRESS + reg_offset * 4);
#endif
}
break;

Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/arise/core/kernel_interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -1311,7 +1311,7 @@ static void krnl_task_timeout_update(void* data, unsigned long long *value, int
if (update)
adapter->hw_hang_fast_timeout_ns = *value * 1000000;
else
*value = adapter->hw_hang_fast_timeout_ns / 1000000;
*value = gf_do_div(adapter->hw_hang_fast_timeout_ns, 1000000);
}

static void krnl_reset_dvfs_power_flag(void* data)
Expand Down
14 changes: 8 additions & 6 deletions drivers/gpu/drm/arise/core/perfevent/perfevent.c
Original file line number Diff line number Diff line change
Expand Up @@ -922,7 +922,7 @@ int hwq_process_vsync_event(adapter_t *adapter, unsigned long long time)
}
p_hwq_event->idle_time+=(e_idle_time - s_idle_time);
}
p_hwq_event->engine_usage=100-((p_hwq_event->idle_time)*100/((time-hwq_event_mgr->start_time)));
p_hwq_event->engine_usage = 100 - gf_do_div(p_hwq_event->idle_time*100, time - hwq_event_mgr->start_time);
//gf_info("\n EngineNum=%d engine_usage ALL=%llu%%\n",engine,p_hwq_event->engine_usage);

p_hwq_event->idle_time=0;
Expand Down Expand Up @@ -1099,11 +1099,13 @@ int hwq_get_video_info(void *adp, gf_video_info *video_info)
decode_framenum[i] = adapter->vcp_info[i].TotalDecodeFrameNum;
return ret;
}
interval_ms = (time - last_time[i]) / 1000000;
if (interval_ms < 1 || adapter->vcp_info[i].TotalDecodetime == last_decodetime[i]) return 0; //
video_info->presentspeed[i] = (adapter->vcp_info[i].TotalRenderFrameNum - frame_num[i]) * 1000 / interval_ms;
video_info->decodespeed[i] = (adapter->vcp_info[i].TotalDecodeFrameNum - decode_framenum[i]) * 1000 /(adapter->vcp_info[i].TotalDecodetime -last_decodetime[i]);
video_info->bitrate[i] = (adapter->vcp_info[i].TotalBitstreamSize - bit_size[i]) * 8 * 1000/ interval_ms / 1024;
interval_ms = gf_do_div(time - last_time[i], 1000000);
if (interval_ms < 1 || adapter->vcp_info[i].TotalDecodetime == last_decodetime[i])
return 0;

video_info->presentspeed[i] = gf_do_div((adapter->vcp_info[i].TotalRenderFrameNum - frame_num[i]) * 1000, interval_ms);
video_info->decodespeed[i] = gf_do_div((adapter->vcp_info[i].TotalDecodeFrameNum - decode_framenum[i]) * 1000, adapter->vcp_info[i].TotalDecodetime -last_decodetime[i]);
video_info->bitrate[i] = gf_do_div((adapter->vcp_info[i].TotalBitstreamSize - bit_size[i]) * 8 * 1000, interval_ms * 1024);
last_time[i] = time;
frame_num[i] = adapter->vcp_info[i].TotalRenderFrameNum;
bit_size[i] = adapter->vcp_info[i].TotalBitstreamSize;
Expand Down
4 changes: 4 additions & 0 deletions drivers/gpu/drm/arise/linux/os_interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,11 @@ unsigned long gf_strlen(char *s)

unsigned long long GF_API_CALL gf_read64(void* addr)
{
#ifdef CONFIG_64BIT
return readq(addr);
#else
return 0ull;
#endif
}

unsigned int GF_API_CALL gf_read32(void* addr)
Expand Down