<html>
    <head>
      <base href="https://bugs.freedesktop.org/">
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Xorg segfault on cpu which does not support PAT"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=110774#c2">Comment # 2</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Xorg segfault on cpu which does not support PAT"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=110774">bug 110774</a>
              from <span class="vcard"><a class="email" href="mailto:chris@chris-wilson.co.uk" title="Chris Wilson <chris@chris-wilson.co.uk>"> <span class="fn">Chris Wilson</span></a>
</span></b>
        <pre>If you want the full detection method,

static bool test_has_wc_mmap(struct kgem *kgem)
{
        struct local_i915_gem_mmap2 wc;
        bool ret;

        if (DBG_NO_WC_MMAP)
                return false;

        /* XXX See <a class="bz_bug_link 
          bz_status_CLOSED  bz_closed"
   title="CLOSED FIXED - [gen3 4.0] mmap(wc) batch incoherence"
   href="show_bug.cgi?id=90841">https://bugs.freedesktop.org/show_bug.cgi?id=90841</a> */
        if (kgem->gen < 033)
                return false;

        if (gem_param(kgem, LOCAL_I915_PARAM_MMAP_VERSION) < 1)
                return false;

        VG_CLEAR(wc);
        wc.handle = gem_create(kgem->fd, 1);
        wc.offset = 0;
        wc.size = 4096;
        wc.flags = I915_MMAP_WC;
        ret = do_ioctl(kgem->fd, LOCAL_IOCTL_I915_GEM_MMAP_v2, &wc) == 0;
        gem_close(kgem->fd, wc.handle);

        return ret;
}

The parameter just said which version of the struct was supported; you were
then meant to query which flags were supported by trial-and-error.

At this point, I would just refuse to run unless WC mmaps were available.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the QA Contact for the bug.</li>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>