All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@intel.com>
To: Uma Shankar <uma.shankar@intel.com>, intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH] drm/i915/display: Add a wrapper function for vga decode setup
Date: Fri, 22 Sep 2023 12:22:34 +0300	[thread overview]
Message-ID: <8734z6pnol.fsf@intel.com> (raw)
In-Reply-To: <20230922091102.1030418-1-uma.shankar@intel.com>

On Fri, 22 Sep 2023, Uma Shankar <uma.shankar@intel.com> wrote:
> Some of the VGA functionality is not needed by the proposed
> Intel Xe driver. Adding a wrapper function for VGA decode setup.

This should also use it in i915, not just add duplicated code.

>
> Signed-off-by: Uma Shankar <uma.shankar@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_vga.c |  3 ---
>  drivers/gpu/drm/i915/soc/intel_gmch.c    | 14 ++++++++++++++
>  drivers/gpu/drm/i915/soc/intel_gmch.h    |  2 ++
>  3 files changed, 16 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_vga.c b/drivers/gpu/drm/i915/display/intel_vga.c
> index 286a0bdd28c6..bf84d01339b9 100644
> --- a/drivers/gpu/drm/i915/display/intel_vga.c
> +++ b/drivers/gpu/drm/i915/display/intel_vga.c
> @@ -3,11 +3,8 @@
>   * Copyright © 2019 Intel Corporation
>   */
>  
> -#include <linux/pci.h>
>  #include <linux/vgaarb.h>
> -
>  #include <video/vga.h>
> -

There should remain a blank line after the system includes and before
the rest.

>  #include "soc/intel_gmch.h"
>  
>  #include "i915_drv.h"
> diff --git a/drivers/gpu/drm/i915/soc/intel_gmch.c b/drivers/gpu/drm/i915/soc/intel_gmch.c
> index 49c7fb16e934..818f0b7f62a2 100644
> --- a/drivers/gpu/drm/i915/soc/intel_gmch.c
> +++ b/drivers/gpu/drm/i915/soc/intel_gmch.c
> @@ -12,6 +12,7 @@
>  #include "i915_drv.h"
>  #include "intel_gmch.h"
>  #include "intel_pci_config.h"
> +#include <linux/vgaarb.h>

<linux/...> and <drm/...> includes go before the rest.

>  
>  static void intel_gmch_bridge_release(struct drm_device *dev, void *bridge)
>  {
> @@ -167,3 +168,16 @@ int intel_gmch_vga_set_state(struct drm_i915_private *i915, bool enable_decode)
>  
>  	return 0;
>  }
> +
> +unsigned int intel_gmch_vga_set_decode(struct pci_dev *pdev, bool enable_decode)
> +{
> +	struct drm_i915_private *i915 = pdev_to_i915(pdev);
> +
> +	intel_gmch_vga_set_state(i915, enable_decode);
> +
> +	if (enable_decode)
> +		return VGA_RSRC_LEGACY_IO | VGA_RSRC_LEGACY_MEM |
> +		       VGA_RSRC_NORMAL_IO | VGA_RSRC_NORMAL_MEM;
> +	else
> +		return VGA_RSRC_NORMAL_IO | VGA_RSRC_NORMAL_MEM;
> +}
> diff --git a/drivers/gpu/drm/i915/soc/intel_gmch.h b/drivers/gpu/drm/i915/soc/intel_gmch.h
> index d0133eedc720..5ab2552ceb1a 100644
> --- a/drivers/gpu/drm/i915/soc/intel_gmch.h
> +++ b/drivers/gpu/drm/i915/soc/intel_gmch.h
> @@ -7,6 +7,7 @@
>  #define __INTEL_GMCH_H__
>  
>  #include <linux/types.h>
> +#include <linux/pci.h>

You don't need that, just a forward declaration for struct pci_dev.

>  
>  struct drm_i915_private;
>  
> @@ -14,5 +15,6 @@ int intel_gmch_bridge_setup(struct drm_i915_private *i915);
>  void intel_gmch_bar_setup(struct drm_i915_private *i915);
>  void intel_gmch_bar_teardown(struct drm_i915_private *i915);
>  int intel_gmch_vga_set_state(struct drm_i915_private *i915, bool enable_decode);
> +unsigned int intel_gmch_vga_set_decode(struct pci_dev *pdev, bool enable_decode);
>  
>  #endif /* __INTEL_GMCH_H__ */

-- 
Jani Nikula, Intel

  reply	other threads:[~2023-09-22  9:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-22  9:11 [Intel-gfx] [PATCH] drm/i915/display: Add a wrapper function for vga decode setup Uma Shankar
2023-09-22  9:22 ` Jani Nikula [this message]
2023-09-25  6:47   ` Shankar, Uma
2023-09-22 21:09 ` [Intel-gfx] ✓ Fi.CI.BAT: success for " Patchwork
2023-09-24  1:43 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork

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=8734z6pnol.fsf@intel.com \
    --to=jani.nikula@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=uma.shankar@intel.com \
    /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.