public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: chris@chris-wilson.co.uk
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: drm/i915: Inline feature detection into sanitize_enable_ppgtt
Date: Tue, 28 Oct 2014 13:52:51 +0300	[thread overview]
Message-ID: <20141028105251.GA7932@mwanda> (raw)

Hello Chris Wilson,

The patch 1893a71b1eba: "drm/i915: Inline feature detection into
sanitize_enable_ppgtt" from Sep 19, 2014, leads to the following
static checker warning:

	drivers/gpu/drm/i915/i915_gem_gtt.c:70 sanitize_enable_ppgtt()
	warn: we tested 'has_aliasing_ppgtt' before and it was 'true'

drivers/gpu/drm/i915/i915_gem_gtt.c
    36  static int sanitize_enable_ppgtt(struct drm_device *dev, int enable_ppgtt)
    37  {
    38          bool has_aliasing_ppgtt;
    39          bool has_full_ppgtt;
    40  
    41          has_aliasing_ppgtt = INTEL_INFO(dev)->gen >= 6;
    42          has_full_ppgtt = INTEL_INFO(dev)->gen >= 7;
    43          if (IS_GEN8(dev))
    44                  has_full_ppgtt = false; /* XXX why? */
    45  
    46          if (enable_ppgtt == 0 || !has_aliasing_ppgtt)
                                         ^^^^^^^^^^^^^^^^^^^
The patch introduces this condition.

    47                  return 0;
    48  
    49          if (enable_ppgtt == 1)
    50                  return 1;
    51  
    52          if (enable_ppgtt == 2 && has_full_ppgtt)
    53                  return 2;
    54  
    55  #ifdef CONFIG_INTEL_IOMMU
    56          /* Disable ppgtt on SNB if VT-d is on. */
    57          if (INTEL_INFO(dev)->gen == 6 && intel_iommu_gfx_mapped) {
    58                  DRM_INFO("Disabling PPGTT because VT-d is on\n");
    59                  return 0;
    60          }
    61  #endif
    62  
    63          /* Early VLV doesn't have this */
    64          if (IS_VALLEYVIEW(dev) && !IS_CHERRYVIEW(dev) &&
    65              dev->pdev->revision < 0xb) {
    66                  DRM_DEBUG_DRIVER("disabling PPGTT on pre-B3 step VLV\n");
    67                  return 0;
    68          }
    69  
    70          return has_aliasing_ppgtt ? 1 : 0;
                       ^^^^^^^^^^^^^^^^^^
The patch introduces this already known condition.

    71  }



regards,
dan carpenter
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

                 reply	other threads:[~2014-10-28 10:53 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20141028105251.GA7932@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox