All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: zhangzhijie <zhangzhijie@bosc.ac.cn>
Cc: jani.nikula@linux.intel.com, jeff@jeffgeerling.com,
	wangran@bosc.ac.cn, zhangjian@bosc.ac.cn, daniel@ffwll.ch,
	rodrigo.vivi@intel.com, joonas.lahtinen@linux.intel.com,
	tursulin@ursulin.net, airlied@gmail.com,
	intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] i915: Support Intel GPU porting on any non-x86 system.
Date: Mon, 24 Nov 2025 23:05:53 +0200	[thread overview]
Message-ID: <aSTIsRbrtEfJQzWU@intel.com> (raw)
In-Reply-To: <20251124065612.1920389-1-zhangzhijie@bosc.ac.cn>

On Mon, Nov 24, 2025 at 02:56:12PM +0800, zhangzhijie wrote:
> inb/outb speccial wire not support on other ARCH.
> Should detect whether arch platform support or not.
> 
> Signed-off-by: zhangzhijie <zhangzhijie@bosc.ac.cn>
> ---
>  drivers/gpu/drm/i915/display/intel_vga.c | 27 ++++++++++++++++++------
>  1 file changed, 20 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_vga.c b/drivers/gpu/drm/i915/display/intel_vga.c
> index 6e125564db34..d5d6c4ba6434 100644
> --- a/drivers/gpu/drm/i915/display/intel_vga.c
> +++ b/drivers/gpu/drm/i915/display/intel_vga.c
> @@ -41,6 +41,15 @@ static bool has_vga_pipe_sel(struct intel_display *display)
>  	return DISPLAY_VER(display) < 7;
>  }
>  
> +static bool intel_arch_support_vga_pm(struct intel_display *display)

whatis "pm"?

> +{
> +#if defined(CONFIG_X86) || defined(CONFIG_X86_64)
> +	return true;
> +#else
> +	return false;
> +#endif

Isn't there already some kind of ARCH_HAS_PORTIO thing?
Does that not work?

> +}
> +
>  /* Disable the VGA plane that we never use */
>  void intel_vga_disable(struct intel_display *display)
>  {
> @@ -66,11 +75,13 @@ void intel_vga_disable(struct intel_display *display)
>  

I wouldn't expect us to get this far. The VGA plane should
never have been enabled in the first place.

>  	/* WaEnableVGAAccessThroughIOPort:ctg,elk,ilk,snb,ivb,vlv,hsw */
>  	vga_get_uninterruptible(pdev, VGA_RSRC_LEGACY_IO);

Why are you leaving the vga_get() outside the check?

> -	outb(0x01, VGA_SEQ_I);
> -	sr1 = inb(VGA_SEQ_D);
> -	outb(sr1 | VGA_SR01_SCREEN_OFF, VGA_SEQ_D);
> -	vga_put(pdev, VGA_RSRC_LEGACY_IO);
> -	udelay(300);
> +	if (likely(intel_arch_support_vga_pm(display))) {
> +		outb(0x01, VGA_SEQ_I);
> +		sr1 = inb(VGA_SEQ_D);
> +		outb(sr1 | VGA_SR01_SCREEN_OFF, VGA_SEQ_D);
> +		vga_put(pdev, VGA_RSRC_LEGACY_IO);
> +		udelay(300);
> +	}
>  
>  	intel_de_write(display, vga_reg, VGA_DISP_DISABLE);
>  	intel_de_posting_read(display, vga_reg);
> @@ -91,8 +102,10 @@ void intel_vga_reset_io_mem(struct intel_display *display)
>  	 * and error messages.
>  	 */
>  	vga_get_uninterruptible(pdev, VGA_RSRC_LEGACY_IO);
> -	outb(inb(VGA_MIS_R), VGA_MIS_W);
> -	vga_put(pdev, VGA_RSRC_LEGACY_IO);
> +	if (likely(intel_arch_support_vga_pm(display))) {
> +		outb(inb(VGA_MIS_R), VGA_MIS_W);
> +		vga_put(pdev, VGA_RSRC_LEGACY_IO);
> +	}
>  }
>  
>  int intel_vga_register(struct intel_display *display)
> -- 
> 2.34.1

-- 
Ville Syrjälä
Intel

  reply	other threads:[~2025-11-24 21:06 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-24  6:56 [PATCH v2] i915: Support Intel GPU porting on any non-x86 system zhangzhijie
2025-11-24 21:05 ` Ville Syrjälä [this message]
2025-11-25  3:31   ` ZhangZhiJie
2025-11-25  0:47 ` ✗ LGCI.VerificationFailed: failure for i915: Support Intel GPU porting on any non-x86 system. (rev2) Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2025-11-24  6:56 [PATCH v2] i915: Support Intel GPU porting on any non-x86 system zhangzhijie
2025-11-24 12:24 ` Jani Nikula
2025-11-25  9:55   ` ZhangZhiJie
2025-11-25 10:13     ` Jani Nikula
2025-11-25 10:20       ` ZhangZhiJie
2025-11-25 21:54         ` Lucas De Marchi
2025-11-26  1:39           ` ZhangZhiJie
2025-11-25 13:18 ` Simon Richter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aSTIsRbrtEfJQzWU@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=airlied@gmail.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    --cc=jeff@jeffgeerling.com \
    --cc=joonas.lahtinen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rodrigo.vivi@intel.com \
    --cc=tursulin@ursulin.net \
    --cc=wangran@bosc.ac.cn \
    --cc=zhangjian@bosc.ac.cn \
    --cc=zhangzhijie@bosc.ac.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.