Commit dd4821ba authored by Jani Nikula's avatar Jani Nikula

drm/i915/lrc: move lrc_get_runtime() to intel_lrc.c

Move the static inline next to the only caller.
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Reviewed-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220214173810.2108975-1-jani.nikula@intel.com
parent d8b746ea
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include "intel_engine_pm.h" #include "intel_engine_pm.h"
#include "intel_gpu_commands.h" #include "intel_gpu_commands.h"
#include "intel_lrc.h" #include "intel_lrc.h"
#include "intel_lrc_reg.h"
#include "intel_ring.h" #include "intel_ring.h"
#include "intel_sseu.h" #include "intel_sseu.h"
......
...@@ -1688,6 +1688,17 @@ static void st_update_runtime_underflow(struct intel_context *ce, s32 dt) ...@@ -1688,6 +1688,17 @@ static void st_update_runtime_underflow(struct intel_context *ce, s32 dt)
#endif #endif
} }
static u32 lrc_get_runtime(const struct intel_context *ce)
{
/*
* We can use either ppHWSP[16] which is recorded before the context
* switch (and so excludes the cost of context switches) or use the
* value from the context image itself, which is saved/restored earlier
* and so includes the cost of the save.
*/
return READ_ONCE(ce->lrc_reg_state[CTX_TIMESTAMP]);
}
void lrc_update_runtime(struct intel_context *ce) void lrc_update_runtime(struct intel_context *ce)
{ {
u32 old; u32 old;
......
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
#include <linux/types.h> #include <linux/types.h>
#include "intel_context.h" #include "intel_context.h"
#include "intel_lrc_reg.h"
struct drm_i915_gem_object; struct drm_i915_gem_object;
struct intel_engine_cs; struct intel_engine_cs;
...@@ -68,15 +67,5 @@ void lrc_check_regs(const struct intel_context *ce, ...@@ -68,15 +67,5 @@ void lrc_check_regs(const struct intel_context *ce,
const char *when); const char *when);
void lrc_update_runtime(struct intel_context *ce); void lrc_update_runtime(struct intel_context *ce);
static inline u32 lrc_get_runtime(const struct intel_context *ce)
{
/*
* We can use either ppHWSP[16] which is recorded before the context
* switch (and so excludes the cost of context switches) or use the
* value from the context image itself, which is saved/restored earlier
* and so includes the cost of the save.
*/
return READ_ONCE(ce->lrc_reg_state[CTX_TIMESTAMP]);
}
#endif /* __INTEL_LRC_H__ */ #endif /* __INTEL_LRC_H__ */
...@@ -206,6 +206,7 @@ ...@@ -206,6 +206,7 @@
#include "gt/intel_gt_clock_utils.h" #include "gt/intel_gt_clock_utils.h"
#include "gt/intel_gt_regs.h" #include "gt/intel_gt_regs.h"
#include "gt/intel_lrc.h" #include "gt/intel_lrc.h"
#include "gt/intel_lrc_reg.h"
#include "gt/intel_ring.h" #include "gt/intel_ring.h"
#include "i915_drv.h" #include "i915_drv.h"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment