All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: Jani Nikula <jani.nikula@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 2/4] drm/i915: abstract virtual PCH id detection
Date: Mon, 5 Feb 2018 14:22:44 -0800	[thread overview]
Message-ID: <20180205222244.piualheppvcybuxs@intel.com> (raw)
In-Reply-To: <38ee1ac06c6724e888679eb287af36c221bd399b.1517851783.git.jani.nikula@intel.com>

On Mon, Feb 05, 2018 at 05:31:37PM +0000, Jani Nikula wrote:
> Make the code slightly more pleasant to look at.

indeed

> No functional changes.
> 
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>


Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

> ---
>  drivers/gpu/drm/i915/i915_drv.c | 19 ++++++++++++-------
>  1 file changed, 12 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> index 08e97b6e976b..52666c6cbbcc 100644
> --- a/drivers/gpu/drm/i915/i915_drv.c
> +++ b/drivers/gpu/drm/i915/i915_drv.c
> @@ -192,6 +192,16 @@ intel_pch_type(const struct drm_i915_private *dev_priv, unsigned short id)
>  	}
>  }
>  
> +static bool intel_is_virt_pch(unsigned short id,
> +			      unsigned short svendor, unsigned short sdevice)
> +{
> +	return (id == INTEL_PCH_P2X_DEVICE_ID_TYPE ||
> +		id == INTEL_PCH_P3X_DEVICE_ID_TYPE ||
> +		(id == INTEL_PCH_QEMU_DEVICE_ID_TYPE &&
> +		 svendor == PCI_SUBVENDOR_ID_REDHAT_QUMRANET &&
> +		 sdevice == PCI_SUBDEVICE_ID_QEMU));
> +}
> +
>  static enum intel_pch intel_virt_detect_pch(struct drm_i915_private *dev_priv)
>  {
>  	enum intel_pch ret = PCH_NOP;
> @@ -264,13 +274,8 @@ static void intel_detect_pch(struct drm_i915_private *dev_priv)
>  		pch_type = intel_pch_type(dev_priv, id);
>  		if (pch_type != PCH_NONE) {
>  			dev_priv->pch_type = pch_type;
> -		} else if (id == INTEL_PCH_P2X_DEVICE_ID_TYPE ||
> -			   id == INTEL_PCH_P3X_DEVICE_ID_TYPE ||
> -			   (id == INTEL_PCH_QEMU_DEVICE_ID_TYPE &&
> -			    pch->subsystem_vendor ==
> -			    PCI_SUBVENDOR_ID_REDHAT_QUMRANET &&
> -			    pch->subsystem_device ==
> -			    PCI_SUBDEVICE_ID_QEMU)) {
> +		} else if (intel_is_virt_pch(id, pch->subsystem_vendor,
> +					     pch->subsystem_device)) {
>  			dev_priv->pch_type = intel_virt_detect_pch(dev_priv);
>  		} else {
>  			continue;
> -- 
> 2.11.0
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2018-02-05 22:22 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-05 17:31 [PATCH 0/4] drm/i915: pch detection refactoring Jani Nikula
2018-02-05 17:31 ` [PATCH 1/4] drm/i915: abstract PCH type detection from PCH id Jani Nikula
2018-02-05 22:21   ` Rodrigo Vivi
2018-02-13 15:35     ` Jani Nikula
2018-02-13 15:55       ` Ville Syrjälä
2018-02-05 17:31 ` [PATCH 2/4] drm/i915: abstract virtual PCH id detection Jani Nikula
2018-02-05 22:22   ` Rodrigo Vivi [this message]
2018-02-05 17:31 ` [PATCH 3/4] drm/i915: have virtual PCH detection return a PCH id Jani Nikula
2018-02-05 22:27   ` Rodrigo Vivi
2018-02-05 17:31 ` [PATCH 4/4] drm/i915: introduce INTEL_PCH_ID() and use it Jani Nikula
2018-02-05 22:28   ` Rodrigo Vivi
2018-02-05 18:20 ` ✓ Fi.CI.BAT: success for drm/i915: pch detection refactoring Patchwork
2018-02-05 20:39 ` ✗ Fi.CI.IGT: warning " Patchwork
2018-02-06 11:06 ` ✗ Fi.CI.BAT: " Patchwork
2018-02-07 12:43 ` ✓ Fi.CI.BAT: success " 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=20180205222244.piualheppvcybuxs@intel.com \
    --to=rodrigo.vivi@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@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.