Lines Matching refs:irqs
112 int gem_interrupts_init(struct gem_interrupts *irqs) in gem_interrupts_init() argument
114 memset(irqs, 0, sizeof(*irqs)); in gem_interrupts_init()
116 irqs->fd = perf_i915_open(I915_PMU_INTERRUPTS); in gem_interrupts_init()
117 if (irqs->fd < 0 && interrupts_read() < 0) in gem_interrupts_init()
118 irqs->error = ENODEV; in gem_interrupts_init()
120 return irqs->error; in gem_interrupts_init()
123 int gem_interrupts_update(struct gem_interrupts *irqs) in gem_interrupts_update() argument
128 if (irqs->error) in gem_interrupts_update()
129 return irqs->error; in gem_interrupts_update()
131 if (irqs->fd < 0) { in gem_interrupts_update()
135 return irqs->error = ENODEV; in gem_interrupts_update()
141 if (read(irqs->fd, data, sizeof(data)) < 0) in gem_interrupts_update()
142 return irqs->error = errno; in gem_interrupts_update()
147 update = irqs->last_count == 0; in gem_interrupts_update()
148 irqs->last_count = irqs->count; in gem_interrupts_update()
149 irqs->count = val; in gem_interrupts_update()
150 irqs->delta = irqs->count - irqs->last_count; in gem_interrupts_update()