diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2014-11-19 06:28:12 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2014-11-19 20:27:31 -0500 |
commit | 3ce733b909764a3ee17b35d7a2c940fd0bc45d5b (patch) | |
tree | 5e3c27767a8e6adc1e48349dd0ba1e1c786183c5 /drivers/gpu/drm/bochs | |
parent | 49b70a31c166a6da12f60ec85da608c064555406 (diff) |
bochs: add page_flip
Implement crtc page_flip callback for bochsdrm. The qemu stdvga has no
vblank signaling, so we have to fake it. We do so by instantly calling
drm_send_vblank_event. Tested with kmscon.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/bochs')
-rw-r--r-- | drivers/gpu/drm/bochs/bochs_kms.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/gpu/drm/bochs/bochs_kms.c b/drivers/gpu/drm/bochs/bochs_kms.c index 5ffd4895d040..85f0f8cf1fb8 100644 --- a/drivers/gpu/drm/bochs/bochs_kms.c +++ b/drivers/gpu/drm/bochs/bochs_kms.c | |||
@@ -109,11 +109,32 @@ static void bochs_crtc_gamma_set(struct drm_crtc *crtc, u16 *red, u16 *green, | |||
109 | { | 109 | { |
110 | } | 110 | } |
111 | 111 | ||
112 | static int bochs_crtc_page_flip(struct drm_crtc *crtc, | ||
113 | struct drm_framebuffer *fb, | ||
114 | struct drm_pending_vblank_event *event, | ||
115 | uint32_t page_flip_flags) | ||
116 | { | ||
117 | struct bochs_device *bochs = | ||
118 | container_of(crtc, struct bochs_device, crtc); | ||
119 | struct drm_framebuffer *old_fb = crtc->primary->fb; | ||
120 | unsigned long irqflags; | ||
121 | |||
122 | crtc->primary->fb = fb; | ||
123 | bochs_crtc_mode_set_base(crtc, 0, 0, old_fb); | ||
124 | if (event) { | ||
125 | spin_lock_irqsave(&bochs->dev->event_lock, irqflags); | ||
126 | drm_send_vblank_event(bochs->dev, -1, event); | ||
127 | spin_unlock_irqrestore(&bochs->dev->event_lock, irqflags); | ||
128 | } | ||
129 | return 0; | ||
130 | } | ||
131 | |||
112 | /* These provide the minimum set of functions required to handle a CRTC */ | 132 | /* These provide the minimum set of functions required to handle a CRTC */ |
113 | static const struct drm_crtc_funcs bochs_crtc_funcs = { | 133 | static const struct drm_crtc_funcs bochs_crtc_funcs = { |
114 | .gamma_set = bochs_crtc_gamma_set, | 134 | .gamma_set = bochs_crtc_gamma_set, |
115 | .set_config = drm_crtc_helper_set_config, | 135 | .set_config = drm_crtc_helper_set_config, |
116 | .destroy = drm_crtc_cleanup, | 136 | .destroy = drm_crtc_cleanup, |
137 | .page_flip = bochs_crtc_page_flip, | ||
117 | }; | 138 | }; |
118 | 139 | ||
119 | static const struct drm_crtc_helper_funcs bochs_helper_funcs = { | 140 | static const struct drm_crtc_helper_funcs bochs_helper_funcs = { |