diff options
author | Bryan Freed <bfreed@chromium.org> | 2010-10-14 04:14:51 -0400 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2010-10-19 04:17:24 -0400 |
commit | 6d139a87b747aaebc969ac5f4eb8db766fcd9cbd (patch) | |
tree | 62e4a8aa1b01f0b3ba6e11b989be4d64c0057fae /drivers/gpu | |
parent | e60a0b107b3df072e23cb6d68510aa2615b059ce (diff) |
drm/i915: Initialize panel timing registers if VBIOS did not
The time between start of the pixel clock and backlight enable is a basic
panel timing constraint. If the Panel Power On/Off registers are found
to be 0, assume we are booting without VBIOS initialization and set these
registers to something reasonable.
Change-Id: Ibed6cc10d46bf52fd92e0beb25ae3525b5eef99d
Signed-off-by: Bryan Freed <bfreed@chromium.org>
[ickle: rearranged into a separate function to distinguish its role from
simply parsing the VBIOS tables.]
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/i915/i915_dma.c | 5 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_bios.c | 21 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_bios.h | 3 |
3 files changed, 25 insertions, 4 deletions
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c index 2caf43de8a6a..35d121c70a1f 100644 --- a/drivers/gpu/drm/i915/i915_dma.c +++ b/drivers/gpu/drm/i915/i915_dma.c | |||
@@ -1235,7 +1235,7 @@ static int i915_load_modeset_init(struct drm_device *dev, | |||
1235 | */ | 1235 | */ |
1236 | dev_priv->allow_batchbuffer = 1; | 1236 | dev_priv->allow_batchbuffer = 1; |
1237 | 1237 | ||
1238 | ret = intel_init_bios(dev); | 1238 | ret = intel_parse_bios(dev); |
1239 | if (ret) | 1239 | if (ret) |
1240 | DRM_INFO("failed to find VBIOS tables\n"); | 1240 | DRM_INFO("failed to find VBIOS tables\n"); |
1241 | 1241 | ||
@@ -2001,6 +2001,9 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags) | |||
2001 | intel_setup_gmbus(dev); | 2001 | intel_setup_gmbus(dev); |
2002 | intel_opregion_setup(dev); | 2002 | intel_opregion_setup(dev); |
2003 | 2003 | ||
2004 | /* Make sure the bios did its job and set up vital registers */ | ||
2005 | intel_setup_bios(dev); | ||
2006 | |||
2004 | i915_gem_load(dev); | 2007 | i915_gem_load(dev); |
2005 | 2008 | ||
2006 | /* Init HWS */ | 2009 | /* Init HWS */ |
diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c index cc15447eff41..b9560f3cbb3d 100644 --- a/drivers/gpu/drm/i915/intel_bios.c +++ b/drivers/gpu/drm/i915/intel_bios.c | |||
@@ -577,7 +577,7 @@ init_vbt_defaults(struct drm_i915_private *dev_priv) | |||
577 | } | 577 | } |
578 | 578 | ||
579 | /** | 579 | /** |
580 | * intel_init_bios - initialize VBIOS settings & find VBT | 580 | * intel_parse_bios - find VBT and initialize settings from the BIOS |
581 | * @dev: DRM device | 581 | * @dev: DRM device |
582 | * | 582 | * |
583 | * Loads the Video BIOS and checks that the VBT exists. Sets scratch registers | 583 | * Loads the Video BIOS and checks that the VBT exists. Sets scratch registers |
@@ -586,7 +586,7 @@ init_vbt_defaults(struct drm_i915_private *dev_priv) | |||
586 | * Returns 0 on success, nonzero on failure. | 586 | * Returns 0 on success, nonzero on failure. |
587 | */ | 587 | */ |
588 | bool | 588 | bool |
589 | intel_init_bios(struct drm_device *dev) | 589 | intel_parse_bios(struct drm_device *dev) |
590 | { | 590 | { |
591 | struct drm_i915_private *dev_priv = dev->dev_private; | 591 | struct drm_i915_private *dev_priv = dev->dev_private; |
592 | struct pci_dev *pdev = dev->pdev; | 592 | struct pci_dev *pdev = dev->pdev; |
@@ -647,3 +647,20 @@ intel_init_bios(struct drm_device *dev) | |||
647 | 647 | ||
648 | return 0; | 648 | return 0; |
649 | } | 649 | } |
650 | |||
651 | /* Ensure that vital registers have been initialised, even if the BIOS | ||
652 | * is absent or just failing to do its job. | ||
653 | */ | ||
654 | void intel_setup_bios(struct drm_device *dev) | ||
655 | { | ||
656 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
657 | |||
658 | /* Set the Panel Power On/Off timings if uninitialized. */ | ||
659 | if ((I915_READ(PP_ON_DELAYS) == 0) && (I915_READ(PP_OFF_DELAYS) == 0)) { | ||
660 | /* Set T2 to 40ms and T5 to 200ms */ | ||
661 | I915_WRITE(PP_ON_DELAYS, 0x019007d0); | ||
662 | |||
663 | /* Set T3 to 35ms and Tx to 200ms */ | ||
664 | I915_WRITE(PP_OFF_DELAYS, 0x015e07d0); | ||
665 | } | ||
666 | } | ||
diff --git a/drivers/gpu/drm/i915/intel_bios.h b/drivers/gpu/drm/i915/intel_bios.h index e1a598f2a966..5f8e4edcbbb9 100644 --- a/drivers/gpu/drm/i915/intel_bios.h +++ b/drivers/gpu/drm/i915/intel_bios.h | |||
@@ -467,7 +467,8 @@ struct bdb_edp { | |||
467 | struct edp_link_params link_params[16]; | 467 | struct edp_link_params link_params[16]; |
468 | } __attribute__ ((packed)); | 468 | } __attribute__ ((packed)); |
469 | 469 | ||
470 | bool intel_init_bios(struct drm_device *dev); | 470 | void intel_setup_bios(struct drm_device *dev); |
471 | bool intel_parse_bios(struct drm_device *dev); | ||
471 | 472 | ||
472 | /* | 473 | /* |
473 | * Driver<->VBIOS interaction occurs through scratch bits in | 474 | * Driver<->VBIOS interaction occurs through scratch bits in |