[Intel-gfx] [PATCH] drm/i915: only disable default vga device

Ville Syrjälä ville.syrjala at linux.intel.com
Mon May 17 17:24:01 UTC 2021


On Sun, May 16, 2021 at 06:14:32PM +0100, Emil Velikov wrote:
> From: Vivek Das Mohapatra <vivek at collabora.com>
> 
> This patch is to do with seamless handover, eg when the sequence is
> bootloader → plymouth → desktop.
> 
> It switches the vga arbiter from the "other" GPU to the default one
> (intel in this case), so the driver can issue some io().

I don't understand what this commit message is trying to say.

> 
> Signed-off-by: Vivek Das Mohapatra <vivek at collabora.com>
> Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
> ---
> Greetings all,
> 
> This patch has been downstream for a while now yet it seems perfectly
> reasonable thing to have in the Linux kernel.
> 
> https://github.com/ValveSoftware/steamos_kernel/commit/5431b5b1999c3d3b5efee817fb3373fbbd473063
> 
> 
>  drivers/gpu/drm/i915/display/intel_vga.c | 14 ++++++++------
>  1 file changed, 8 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_vga.c b/drivers/gpu/drm/i915/display/intel_vga.c
> index be333699c515..4f07b5ad5fa0 100644
> --- a/drivers/gpu/drm/i915/display/intel_vga.c
> +++ b/drivers/gpu/drm/i915/display/intel_vga.c
> @@ -30,12 +30,14 @@ void intel_vga_disable(struct drm_i915_private *dev_priv)
>  	u8 sr1;
>  
>  	/* WaEnableVGAAccessThroughIOPort:ctg,elk,ilk,snb,ivb,vlv,hsw */
> -	vga_get_uninterruptible(pdev, VGA_RSRC_LEGACY_IO);
> -	outb(SR01, VGA_SR_INDEX);
> -	sr1 = inb(VGA_SR_DATA);
> -	outb(sr1 | 1 << 5, VGA_SR_DATA);
> -	vga_put(pdev, VGA_RSRC_LEGACY_IO);
> -	udelay(300);
> +	if (pdev == vga_default_device()) {
> +		vga_get_uninterruptible(pdev, VGA_RSRC_LEGACY_IO);
> +		outb(SR01, VGA_SR_INDEX);
> +		sr1 = inb(VGA_SR_DATA);
> +		outb(sr1 | 1 << 5, VGA_SR_DATA);
> +		vga_put(pdev, VGA_RSRC_LEGACY_IO);
> +		udelay(300);
> +	}
>  
>  	intel_de_write(dev_priv, vga_reg, VGA_DISP_DISABLE);
>  	intel_de_posting_read(dev_priv, vga_reg);
> -- 
> 2.27.0

-- 
Ville Syrjälä
Intel


More information about the Intel-gfx mailing list