aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/drm/i915/i915_drv.h5
-rw-r--r--drivers/gpu/drm/i915/i915_gem.c3
-rw-r--r--kernel/time/time.c1
3 files changed, 8 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index bb1892d72efe..be910d249ea1 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -3032,6 +3032,11 @@ static inline unsigned long msecs_to_jiffies_timeout(const unsigned int m)
3032 return min_t(unsigned long, MAX_JIFFY_OFFSET, j + 1); 3032 return min_t(unsigned long, MAX_JIFFY_OFFSET, j + 1);
3033} 3033}
3034 3034
3035static inline unsigned long nsecs_to_jiffies_timeout(const u64 n)
3036{
3037 return min_t(u64, MAX_JIFFY_OFFSET, nsecs_to_jiffies64(n) + 1);
3038}
3039
3035static inline unsigned long 3040static inline unsigned long
3036timespec_to_jiffies_timeout(const struct timespec *value) 3041timespec_to_jiffies_timeout(const struct timespec *value)
3037{ 3042{
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index d2ba315f4c92..820bc984082e 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -1227,7 +1227,8 @@ int __i915_wait_seqno(struct intel_engine_cs *ring, u32 seqno,
1227 if (i915_seqno_passed(ring->get_seqno(ring, true), seqno)) 1227 if (i915_seqno_passed(ring->get_seqno(ring, true), seqno))
1228 return 0; 1228 return 0;
1229 1229
1230 timeout_expire = timeout ? jiffies + nsecs_to_jiffies((u64)*timeout) : 0; 1230 timeout_expire = timeout ?
1231 jiffies + nsecs_to_jiffies_timeout((u64)*timeout) : 0;
1231 1232
1232 if (INTEL_INFO(dev)->gen >= 6 && ring->id == RCS && can_wait_boost(file_priv)) { 1233 if (INTEL_INFO(dev)->gen >= 6 && ring->id == RCS && can_wait_boost(file_priv)) {
1233 gen6_rps_boost(dev_priv); 1234 gen6_rps_boost(dev_priv);
diff --git a/kernel/time/time.c b/kernel/time/time.c
index a9ae20fb0b11..8fae82ca5cbf 100644
--- a/kernel/time/time.c
+++ b/kernel/time/time.c
@@ -745,6 +745,7 @@ u64 nsecs_to_jiffies64(u64 n)
745 return div_u64(n * 9, (9ull * NSEC_PER_SEC + HZ / 2) / HZ); 745 return div_u64(n * 9, (9ull * NSEC_PER_SEC + HZ / 2) / HZ);
746#endif 746#endif
747} 747}
748EXPORT_SYMBOL(nsecs_to_jiffies64);
748 749
749/** 750/**
750 * nsecs_to_jiffies - Convert nsecs in u64 to jiffies 751 * nsecs_to_jiffies - Convert nsecs in u64 to jiffies