diff options
Diffstat (limited to 'drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c')
-rw-r--r-- | drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c | 38 |
1 files changed, 36 insertions, 2 deletions
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c b/drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c index 4defdcf1c72e..6deaf2f8bab1 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c | |||
@@ -394,6 +394,7 @@ static struct drm_crtc_funcs vmw_screen_object_crtc_funcs = { | |||
394 | .gamma_set = vmw_du_crtc_gamma_set, | 394 | .gamma_set = vmw_du_crtc_gamma_set, |
395 | .destroy = vmw_sou_crtc_destroy, | 395 | .destroy = vmw_sou_crtc_destroy, |
396 | .set_config = vmw_sou_crtc_set_config, | 396 | .set_config = vmw_sou_crtc_set_config, |
397 | .page_flip = vmw_du_page_flip, | ||
397 | }; | 398 | }; |
398 | 399 | ||
399 | /* | 400 | /* |
@@ -448,8 +449,8 @@ static int vmw_sou_init(struct vmw_private *dev_priv, unsigned unit) | |||
448 | sou->active_implicit = false; | 449 | sou->active_implicit = false; |
449 | 450 | ||
450 | sou->base.pref_active = (unit == 0); | 451 | sou->base.pref_active = (unit == 0); |
451 | sou->base.pref_width = 800; | 452 | sou->base.pref_width = dev_priv->initial_width; |
452 | sou->base.pref_height = 600; | 453 | sou->base.pref_height = dev_priv->initial_height; |
453 | sou->base.pref_mode = NULL; | 454 | sou->base.pref_mode = NULL; |
454 | sou->base.is_implicit = true; | 455 | sou->base.is_implicit = true; |
455 | 456 | ||
@@ -535,3 +536,36 @@ int vmw_kms_close_screen_object_display(struct vmw_private *dev_priv) | |||
535 | 536 | ||
536 | return 0; | 537 | return 0; |
537 | } | 538 | } |
539 | |||
540 | /** | ||
541 | * Returns if this unit can be page flipped. | ||
542 | * Must be called with the mode_config mutex held. | ||
543 | */ | ||
544 | bool vmw_kms_screen_object_flippable(struct vmw_private *dev_priv, | ||
545 | struct drm_crtc *crtc) | ||
546 | { | ||
547 | struct vmw_screen_object_unit *sou = vmw_crtc_to_sou(crtc); | ||
548 | |||
549 | if (!sou->base.is_implicit) | ||
550 | return true; | ||
551 | |||
552 | if (dev_priv->sou_priv->num_implicit != 1) | ||
553 | return false; | ||
554 | |||
555 | return true; | ||
556 | } | ||
557 | |||
558 | /** | ||
559 | * Update the implicit fb to the current fb of this crtc. | ||
560 | * Must be called with the mode_config mutex held. | ||
561 | */ | ||
562 | void vmw_kms_screen_object_update_implicit_fb(struct vmw_private *dev_priv, | ||
563 | struct drm_crtc *crtc) | ||
564 | { | ||
565 | struct vmw_screen_object_unit *sou = vmw_crtc_to_sou(crtc); | ||
566 | |||
567 | BUG_ON(!sou->base.is_implicit); | ||
568 | |||
569 | dev_priv->sou_priv->implicit_fb = | ||
570 | vmw_framebuffer_to_vfb(sou->base.crtc.fb); | ||
571 | } | ||