diff mbox

Revert "drm/i915: Preserve VGACNTR bits from the BIOS"

Message ID 1418747917-21349-1-git-send-email-ville.syrjala@linux.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Ville Syrjälä Dec. 16, 2014, 4:38 p.m. UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

The VGA_2X_MODE bit apparently affects the display even when the VGA
plane is disabled. The bit will set by the BIOS when the panel width
is at least 1280 pixels. So by preserving the bit from the BIOS we
end up with corrupted display on machines with such high res panels.
I only have 1024x768 panels on my gen2 machines so never ran into
this problem.

The original reason for preserving the VGACNTR register was to make
my 830 survive S3 with acpi_sleep=s3_bios option. However after
further 830 fixes that option is no longer needed to make S3 work
and preserving VGACNTR doesn't seem to be necessary without it,
so we can just revert the entire patch.

This reverts commit 69769f9a422bfc62e17399da3590c5e31ac37f24.

Cc: bonbons67@internet.lu
Cc: stable@vger.kernel.org
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=87171
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/i915_drv.h      | 2 --
 drivers/gpu/drm/i915/intel_display.c | 8 +-------
 2 files changed, 1 insertion(+), 9 deletions(-)

Comments

Bruno Prémont Dec. 16, 2014, 4:53 p.m. UTC | #1
Hi Ville,

On Tue, 16 Dec 2014 18:38:37 +0200 ville.syrjala@linux.intel.com wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> The VGA_2X_MODE bit apparently affects the display even when the VGA
> plane is disabled. The bit will set by the BIOS when the panel width
> is at least 1280 pixels. So by preserving the bit from the BIOS we
> end up with corrupted display on machines with such high res panels.
> I only have 1024x768 panels on my gen2 machines so never ran into
> this problem.
> 
> The original reason for preserving the VGACNTR register was to make
> my 830 survive S3 with acpi_sleep=s3_bios option. However after
> further 830 fixes that option is no longer needed to make S3 work
> and preserving VGACNTR doesn't seem to be necessary without it,
> so we can just revert the entire patch.
> 
> This reverts commit 69769f9a422bfc62e17399da3590c5e31ac37f24.
>
> Cc: bonbons67@internet.lu

Please swap my old "bugzilla e-mail" address with
  Bruno Prémont <bonbons@linux-vserver.org>

Thanks,
Bruno


> Cc: stable@vger.kernel.org
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=87171
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/i915_drv.h      | 2 --
>  drivers/gpu/drm/i915/intel_display.c | 8 +-------
>  2 files changed, 1 insertion(+), 9 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 16a6f6d..fd2d433 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -1665,8 +1665,6 @@ struct drm_i915_private {
>  	 */
>  	struct workqueue_struct *dp_wq;
>  
> -	uint32_t bios_vgacntr;
> -
>  	/* Old dri1 support infrastructure, beware the dragons ya fools entering
>  	 * here! */
>  	struct i915_dri1_state dri1;
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 9cb5c95..cadc3bc 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -12933,11 +12933,7 @@ static void i915_disable_vga(struct drm_device *dev)
>  	vga_put(dev->pdev, VGA_RSRC_LEGACY_IO);
>  	udelay(300);
>  
> -	/*
> -	 * Fujitsu-Siemens Lifebook S6010 (830) has problems resuming
> -	 * from S3 without preserving (some of?) the other bits.
> -	 */
> -	I915_WRITE(vga_reg, dev_priv->bios_vgacntr | VGA_DISP_DISABLE);
> +	I915_WRITE(vga_reg, VGA_DISP_DISABLE);
>  	POSTING_READ(vga_reg);
>  }
>  
> @@ -13026,8 +13022,6 @@ void intel_modeset_init(struct drm_device *dev)
>  
>  	intel_shared_dpll_init(dev);
>  
> -	/* save the BIOS value before clobbering it */
> -	dev_priv->bios_vgacntr = I915_READ(i915_vgacntrl_reg(dev));
>  	/* Just disable it once at startup */
>  	i915_disable_vga(dev);
>  	intel_setup_outputs(dev);
Jani Nikula Dec. 18, 2014, 1:49 p.m. UTC | #2
On Tue, 16 Dec 2014, ville.syrjala@linux.intel.com wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> The VGA_2X_MODE bit apparently affects the display even when the VGA
> plane is disabled. The bit will set by the BIOS when the panel width
> is at least 1280 pixels. So by preserving the bit from the BIOS we
> end up with corrupted display on machines with such high res panels.
> I only have 1024x768 panels on my gen2 machines so never ran into
> this problem.
>
> The original reason for preserving the VGACNTR register was to make
> my 830 survive S3 with acpi_sleep=s3_bios option. However after
> further 830 fixes that option is no longer needed to make S3 work
> and preserving VGACNTR doesn't seem to be necessary without it,
> so we can just revert the entire patch.
>
> This reverts commit 69769f9a422bfc62e17399da3590c5e31ac37f24.
>
> Cc: bonbons67@internet.lu
> Cc: stable@vger.kernel.org
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=87171
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Pushed to drm-intel-next-fixes, thanks for the patch.

BR,
Jani.

> ---
>  drivers/gpu/drm/i915/i915_drv.h      | 2 --
>  drivers/gpu/drm/i915/intel_display.c | 8 +-------
>  2 files changed, 1 insertion(+), 9 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 16a6f6d..fd2d433 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -1665,8 +1665,6 @@ struct drm_i915_private {
>  	 */
>  	struct workqueue_struct *dp_wq;
>  
> -	uint32_t bios_vgacntr;
> -
>  	/* Old dri1 support infrastructure, beware the dragons ya fools entering
>  	 * here! */
>  	struct i915_dri1_state dri1;
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 9cb5c95..cadc3bc 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -12933,11 +12933,7 @@ static void i915_disable_vga(struct drm_device *dev)
>  	vga_put(dev->pdev, VGA_RSRC_LEGACY_IO);
>  	udelay(300);
>  
> -	/*
> -	 * Fujitsu-Siemens Lifebook S6010 (830) has problems resuming
> -	 * from S3 without preserving (some of?) the other bits.
> -	 */
> -	I915_WRITE(vga_reg, dev_priv->bios_vgacntr | VGA_DISP_DISABLE);
> +	I915_WRITE(vga_reg, VGA_DISP_DISABLE);
>  	POSTING_READ(vga_reg);
>  }
>  
> @@ -13026,8 +13022,6 @@ void intel_modeset_init(struct drm_device *dev)
>  
>  	intel_shared_dpll_init(dev);
>  
> -	/* save the BIOS value before clobbering it */
> -	dev_priv->bios_vgacntr = I915_READ(i915_vgacntrl_reg(dev));
>  	/* Just disable it once at startup */
>  	i915_disable_vga(dev);
>  	intel_setup_outputs(dev);
> -- 
> 2.0.4
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 16a6f6d..fd2d433 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -1665,8 +1665,6 @@  struct drm_i915_private {
 	 */
 	struct workqueue_struct *dp_wq;
 
-	uint32_t bios_vgacntr;
-
 	/* Old dri1 support infrastructure, beware the dragons ya fools entering
 	 * here! */
 	struct i915_dri1_state dri1;
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 9cb5c95..cadc3bc 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -12933,11 +12933,7 @@  static void i915_disable_vga(struct drm_device *dev)
 	vga_put(dev->pdev, VGA_RSRC_LEGACY_IO);
 	udelay(300);
 
-	/*
-	 * Fujitsu-Siemens Lifebook S6010 (830) has problems resuming
-	 * from S3 without preserving (some of?) the other bits.
-	 */
-	I915_WRITE(vga_reg, dev_priv->bios_vgacntr | VGA_DISP_DISABLE);
+	I915_WRITE(vga_reg, VGA_DISP_DISABLE);
 	POSTING_READ(vga_reg);
 }
 
@@ -13026,8 +13022,6 @@  void intel_modeset_init(struct drm_device *dev)
 
 	intel_shared_dpll_init(dev);
 
-	/* save the BIOS value before clobbering it */
-	dev_priv->bios_vgacntr = I915_READ(i915_vgacntrl_reg(dev));
 	/* Just disable it once at startup */
 	i915_disable_vga(dev);
 	intel_setup_outputs(dev);