-/* $OpenBSD: drm_linux.h,v 1.28 2015/06/24 08:32:39 kettenis Exp $ */
+/* $OpenBSD: drm_linux.h,v 1.29 2015/06/24 17:59:42 kettenis Exp $ */
/*
* Copyright (c) 2013, 2014 Mark Kettenis
*
extern int64_t timeval_to_ns(const struct timeval *);
extern struct timeval ns_to_timeval(const int64_t);
+extern int ticks;
+#define jiffies ticks
#define HZ hz
static inline unsigned long
-/* $OpenBSD: i915_drv.h,v 1.64 2015/06/24 08:32:39 kettenis Exp $ */
+/* $OpenBSD: i915_drv.h,v 1.65 2015/06/24 17:59:42 kettenis Exp $ */
/* i915_drv.h -- Private header for the I915 driver -*- linux-c -*-
*/
/*
u32 tail;
/** Time at which this request was emitted, in jiffies. */
- unsigned long emitted_ticks;
+ unsigned long emitted_jiffies;
/** global list entry for this request */
struct list_head list;
-/* $OpenBSD: i915_gem.c,v 1.96 2015/06/24 08:32:39 kettenis Exp $ */
+/* $OpenBSD: i915_gem.c,v 1.97 2015/06/24 17:59:42 kettenis Exp $ */
/*
* Copyright (c) 2008-2009 Owain G. Ainsworth <oga@openbsd.org>
*
#endif
static void i915_gem_object_truncate(struct drm_i915_gem_object *obj);
-extern int ticks;
-
static inline void i915_gem_object_fence_lost(struct drm_i915_gem_object *obj)
{
if (obj->tiling_mode)
request->seqno = intel_ring_get_seqno(ring);
request->ring = ring;
request->tail = request_ring_position;
- request->emitted_ticks = ticks;
+ request->emitted_jiffies = jiffies;
was_empty = list_empty(&ring->request_list);
list_add_tail(&request->list, &ring->request_list);
request->file_priv = NULL;
{
struct drm_i915_private *dev_priv = dev->dev_private;
struct drm_i915_file_private *file_priv = file->driver_priv;
- unsigned long recent_enough = ticks - msecs_to_jiffies(20);
+ unsigned long recent_enough = jiffies - msecs_to_jiffies(20);
struct drm_i915_gem_request *request;
struct intel_ring_buffer *ring = NULL;
u32 seqno = 0;
spin_lock(&file_priv->mm.lock);
list_for_each_entry(request, &file_priv->mm.request_list, client_list) {
- if (time_after_eq(request->emitted_ticks, recent_enough))
+ if (time_after_eq(request->emitted_jiffies, recent_enough))
break;
ring = request->ring;
-/* $OpenBSD: intel_display.c,v 1.51 2015/06/24 08:32:39 kettenis Exp $ */
+/* $OpenBSD: intel_display.c,v 1.52 2015/06/24 17:59:42 kettenis Exp $ */
/*
* Copyright © 2006-2007 Intel Corporation
*
} else {
u32 last_line, line_mask;
int reg = PIPEDSL(pipe);
- unsigned long timeout = ticks + msecs_to_jiffies(100);
+ unsigned long timeout = jiffies + msecs_to_jiffies(100);
if (IS_GEN2(dev))
line_mask = DSL_LINEMASK_GEN2;
last_line = I915_READ(reg) & line_mask;
mdelay(5);
} while (((I915_READ(reg) & line_mask) != last_line) &&
- time_after(timeout, ticks));
- if (time_after(ticks, timeout))
+ time_after(timeout, jiffies));
+ if (time_after(jiffies, timeout))
WARN(1, "pipe_off wait timed out\n");
}
}
-/* $OpenBSD: intel_pm.c,v 1.35 2015/06/24 08:32:39 kettenis Exp $ */
+/* $OpenBSD: intel_pm.c,v 1.36 2015/06/24 17:59:42 kettenis Exp $ */
/*
* Copyright © 2012 Intel Corporation
*
bool i915_gpu_turbo_disable(void);
bool i915_gpu_busy(void);
-extern int ticks;
-
static bool intel_crtc_active(struct drm_crtc *crtc)
{
/* Be paranoid as we can arrive here with only partial
dev_priv->ips.last_count1 = I915_READ(0x112e4) + I915_READ(0x112e8) +
I915_READ(0x112e0);
- dev_priv->ips.last_time1 = jiffies_to_msecs(ticks);
+ dev_priv->ips.last_time1 = jiffies_to_msecs(jiffies);
dev_priv->ips.last_count2 = I915_READ(0x112f4);
getrawmonotonic(&dev_priv->ips.last_time2);
{
u64 total_count, diff, ret;
u32 count1, count2, count3, m = 0, c = 0;
- unsigned long now = jiffies_to_msecs(ticks), diff1;
+ unsigned long now = jiffies_to_msecs(jiffies), diff1;
int i;
assert_spin_locked(&mchdev_lock);
-/* $OpenBSD: intel_ringbuffer.c,v 1.28 2015/04/12 17:10:07 kettenis Exp $ */
+/* $OpenBSD: intel_ringbuffer.c,v 1.29 2015/06/24 17:59:42 kettenis Exp $ */
/*
* Copyright © 2008-2010 Intel Corporation
*
u32 gtt_offset;
};
-extern int ticks;
-
static inline int ring_space(struct intel_ring_buffer *ring)
{
int space = (ring->head & HEAD_ADDR) - (ring->tail + I915_RING_FREE_SPACE);
* to running on almost untested codepaths). But on resume
* timers don't work yet, so prevent a complete hang in that
* case by choosing an insanely large timeout. */
- end = ticks + 60 * hz;
+ end = jiffies + 60 * HZ;
do {
ring->head = I915_READ_HEAD(ring);
ret = i915_gem_check_wedge(dev_priv, dev_priv->mm.interruptible);
if (ret)
return ret;
- } while (!time_after(ticks, end));
+ } while (!time_after(jiffies, end));
trace_i915_ring_wait_end(ring);
return -EBUSY;
}