aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c')
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c27
1 files changed, 17 insertions, 10 deletions
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c b/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c
index 7083b1a24df..11cb39e3acc 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c
@@ -27,6 +27,8 @@
27 27
28#include "vmwgfx_kms.h" 28#include "vmwgfx_kms.h"
29 29
30#define VMWGFX_LDU_NUM_DU 8
31
30#define vmw_crtc_to_ldu(x) \ 32#define vmw_crtc_to_ldu(x) \
31 container_of(x, struct vmw_legacy_display_unit, base.crtc) 33 container_of(x, struct vmw_legacy_display_unit, base.crtc)
32#define vmw_encoder_to_ldu(x) \ 34#define vmw_encoder_to_ldu(x) \
@@ -536,6 +538,10 @@ static int vmw_ldu_init(struct vmw_private *dev_priv, unsigned unit)
536 538
537int vmw_kms_init_legacy_display_system(struct vmw_private *dev_priv) 539int vmw_kms_init_legacy_display_system(struct vmw_private *dev_priv)
538{ 540{
541 struct drm_device *dev = dev_priv->dev;
542 int i;
543 int ret;
544
539 if (dev_priv->ldu_priv) { 545 if (dev_priv->ldu_priv) {
540 DRM_INFO("ldu system already on\n"); 546 DRM_INFO("ldu system already on\n");
541 return -EINVAL; 547 return -EINVAL;
@@ -553,23 +559,24 @@ int vmw_kms_init_legacy_display_system(struct vmw_private *dev_priv)
553 559
554 drm_mode_create_dirty_info_property(dev_priv->dev); 560 drm_mode_create_dirty_info_property(dev_priv->dev);
555 561
556 vmw_ldu_init(dev_priv, 0);
557 /* for old hardware without multimon only enable one display */
558 if (dev_priv->capabilities & SVGA_CAP_MULTIMON) { 562 if (dev_priv->capabilities & SVGA_CAP_MULTIMON) {
559 vmw_ldu_init(dev_priv, 1); 563 for (i = 0; i < VMWGFX_LDU_NUM_DU; ++i)
560 vmw_ldu_init(dev_priv, 2); 564 vmw_ldu_init(dev_priv, i);
561 vmw_ldu_init(dev_priv, 3); 565 ret = drm_vblank_init(dev, VMWGFX_LDU_NUM_DU);
562 vmw_ldu_init(dev_priv, 4); 566 } else {
563 vmw_ldu_init(dev_priv, 5); 567 /* for old hardware without multimon only enable one display */
564 vmw_ldu_init(dev_priv, 6); 568 vmw_ldu_init(dev_priv, 0);
565 vmw_ldu_init(dev_priv, 7); 569 ret = drm_vblank_init(dev, 1);
566 } 570 }
567 571
568 return 0; 572 return ret;
569} 573}
570 574
571int vmw_kms_close_legacy_display_system(struct vmw_private *dev_priv) 575int vmw_kms_close_legacy_display_system(struct vmw_private *dev_priv)
572{ 576{
577 struct drm_device *dev = dev_priv->dev;
578
579 drm_vblank_cleanup(dev);
573 if (!dev_priv->ldu_priv) 580 if (!dev_priv->ldu_priv)
574 return -ENOSYS; 581 return -ENOSYS;
575 582