XenevaOS
Loading...
Searching...
No Matches
drm_vblank.h
Go to the documentation of this file.
1/*
2 * Copyright 2016 Intel Corp.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
13 * Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
19 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
20 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
21 * OTHER DEALINGS IN THE SOFTWARE.
22 */
23
24#ifndef _DRM_VBLANK_H_
25#define _DRM_VBLANK_H_
26
27#include <linux/seqlock.h>
28#include <linux/hrtimer.h>
29#include <linux/idr.h>
30#include <linux/poll.h>
31#include <linux/kthread.h>
32
33#include <drm/drm_file.h>
34#include <drm/drm_modes.h>
35
36struct drm_device;
37struct drm_crtc;
38struct drm_vblank_work;
39
51 unsigned int pipe;
59 union {
64
73 struct drm_event_vblank vbl;
74
80};
81
106
128
286
288int drm_vblank_init(struct drm_device *dev, unsigned int num_crtcs);
292 ktime_t *vblanktime);
295 struct drm_pending_vblank_event *e);
297 struct drm_pending_vblank_event *e);
299 u64 *seq,
300 ktime_t *now);
301bool drm_handle_vblank(struct drm_device *dev, unsigned int pipe);
309 const struct drm_vblank_crtc_config *config);
313
315 const struct drm_display_mode *mode);
319
323
324/*
325 * Helpers for struct drm_crtc_funcs
326 */
327
329 bool in_vblank_irq,
330 int *vpos, int *hpos,
331 ktime_t *stime,
332 ktime_t *etime,
333 const struct drm_display_mode *mode);
334
335bool
337 int *max_error,
338 ktime_t *vblank_time,
339 bool in_vblank_irq,
340 drm_vblank_get_scanout_position_func get_scanout_position);
342 int *max_error,
343 ktime_t *vblank_time,
344 bool in_vblank_irq);
345
346#endif
#define bool
Definition stdbool.h:35
struct drm_crtc * crtc
Definition drm_crtc.h:1238
const struct device * dev
Definition drm_print.h:519
void drm_crtc_vblank_reset(struct drm_crtc *crtc)
void drm_crtc_vblank_on_config(struct drm_crtc *crtc, const struct drm_vblank_crtc_config *config)
int drm_vblank_init(struct drm_device *dev, unsigned int num_crtcs)
void drm_crtc_vblank_get_vblank_timeout(struct drm_crtc *crtc, ktime_t *vblank_time)
bool drm_dev_has_vblank(const struct drm_device *dev)
bool drm_crtc_vblank_helper_get_vblank_timestamp(struct drm_crtc *crtc, int *max_error, ktime_t *vblank_time, bool in_vblank_irq)
int drm_crtc_wait_one_vblank(struct drm_crtc *crtc)
u64 drm_crtc_vblank_count_and_time(struct drm_crtc *crtc, ktime_t *vblanktime)
bool(* drm_vblank_get_scanout_position_func)(struct drm_crtc *crtc, bool in_vblank_irq, int *vpos, int *hpos, ktime_t *stime, ktime_t *etime, const struct drm_display_mode *mode)
Definition drm_vblank.h:328
void drm_vblank_set_event(struct drm_pending_vblank_event *e, u64 *seq, ktime_t *now)
bool drm_crtc_handle_vblank(struct drm_crtc *crtc)
void drm_crtc_vblank_on(struct drm_crtc *crtc)
u64 drm_crtc_accurate_vblank_count(struct drm_crtc *crtc)
struct drm_vblank_crtc * drm_crtc_vblank_crtc(struct drm_crtc *crtc)
int drm_crtc_vblank_get(struct drm_crtc *crtc)
void drm_crtc_vblank_off(struct drm_crtc *crtc)
void drm_crtc_vblank_restore(struct drm_crtc *crtc)
int drm_crtc_next_vblank_start(struct drm_crtc *crtc, ktime_t *vblanktime)
void drm_crtc_send_vblank_event(struct drm_crtc *crtc, struct drm_pending_vblank_event *e)
void drm_calc_timestamping_constants(struct drm_crtc *crtc, const struct drm_display_mode *mode)
bool drm_handle_vblank(struct drm_device *dev, unsigned int pipe)
int drm_crtc_vblank_start_timer(struct drm_crtc *crtc)
wait_queue_head_t * drm_crtc_vblank_waitqueue(struct drm_crtc *crtc)
void drm_crtc_vblank_put(struct drm_crtc *crtc)
bool drm_crtc_vblank_helper_get_vblank_timestamp_internal(struct drm_crtc *crtc, int *max_error, ktime_t *vblank_time, bool in_vblank_irq, drm_vblank_get_scanout_position_func get_scanout_position)
void drm_crtc_arm_vblank_event(struct drm_crtc *crtc, struct drm_pending_vblank_event *e)
u64 drm_crtc_vblank_count(struct drm_crtc *crtc)
void drm_crtc_set_max_vblank_count(struct drm_crtc *crtc, u32 max_vblank_count)
void drm_crtc_vblank_cancel_timer(struct drm_crtc *crtc)
struct i915_user_extension base
Definition i915_drm.h:0
uint64_t u64
Definition kernel.h:17
int64_t ktime_t
Definition kernel.h:404
int spinlock_t
Definition kernel.h:44
uint32_t u32
Definition kernel.h:16
struct seqlock seqlock_t
Definition seqlock_types.h:108
Definition atomic.h:45
Definition atomic.h:31
Definition drm_crtc.h:955
Definition drm_device.h:75
Definition drm_modes.h:252
Definition drm.h:1424
Definition drm.h:1412
Definition drm.h:1380
Definition drm_file.h:96
Definition drm_vblank.h:43
union drm_pending_vblank_event::@54 event
unsigned int pipe
Definition drm_vblank.h:51
u64 sequence
Definition drm_vblank.h:55
struct drm_pending_event base
Definition drm_vblank.h:47
Definition drm_vblank.h:85
int offdelay_ms
Definition drm_vblank.h:92
bool disable_immediate
Definition drm_vblank.h:104
Definition drm_vblank.h:110
spinlock_t interval_lock
Definition drm_vblank.h:118
struct hrtimer timer
Definition drm_vblank.h:114
struct drm_crtc * crtc
Definition drm_vblank.h:126
ktime_t interval
Definition drm_vblank.h:122
Definition drm_vblank.h:139
wait_queue_head_t work_wait_queue
Definition drm_vblank.h:279
unsigned int pipe
Definition drm_vblank.h:224
u32 max_vblank_count
Definition drm_vblank.h:210
atomic_t refcount
Definition drm_vblank.h:186
struct drm_vblank_crtc_timer vblank_timer
Definition drm_vblank.h:284
struct kthread_worker * worker
Definition drm_vblank.h:266
u32 last
Definition drm_vblank.h:190
struct drm_vblank_crtc_config config
Definition drm_vblank.h:253
wait_queue_head_t queue
Definition drm_vblank.h:147
struct drm_display_mode hwmode
Definition drm_vblank.h:247
int linedur_ns
Definition drm_vblank.h:236
struct timer_list disable_timer
Definition drm_vblank.h:154
ktime_t time
Definition drm_vblank.h:179
struct list_head pending_work
Definition drm_vblank.h:272
struct drm_device * dev
Definition drm_vblank.h:143
unsigned int inmodeset
Definition drm_vblank.h:219
seqlock_t seqlock
Definition drm_vblank.h:159
int framedur_ns
Definition drm_vblank.h:230
bool enabled
Definition drm_vblank.h:261
atomic64_t count
Definition drm_vblank.h:175
Definition drm_vblank_work.h:22
Definition hrtimer.h:95
Definition kthread.h:144
Definition list.h:11
Definition timer.h:6
Definition wait.h:75
#define mode(x)