From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Wilson Subject: Re: [PATCH 1/2] drm/i915: enable semaphores on per-device defaults Date: Mon, 21 Nov 2011 13:33:40 +0000 Message-ID: References: <1321881730-21254-1-git-send-email-eugeni.dodonov@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTP id F0A099E8CC for ; Mon, 21 Nov 2011 05:33:50 -0800 (PST) In-Reply-To: <1321881730-21254-1-git-send-email-eugeni.dodonov@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: intel-gfx@lists.freedesktop.org Cc: Daniel Vetter , Ben Widawsky , Eugeni Dodonov List-Id: intel-gfx@lists.freedesktop.org On Mon, 21 Nov 2011 11:22:09 -0200, Eugeni Dodonov wrote: > We should enable semaphores on IVB by default, and on SNB in cases where > dma remapping is disabled or iommu is not enabled. > > v2: adapt patch according to the feedback, and put it in line with Keith's > rc6 enabling patch. > > v3: move the generation check into intel_enable_semaphores function, and > fix variable type for i915_semaphores. > > CC: Daniel Vetter > CC: Ben Widawsky > CC: Keith Packard > CC: Jesse Barnes > CC: Chris Wilson > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42696 > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=40564 > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41353 > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38862 > Signed-off-by: Eugeni Dodonov > > +static bool > +intel_enable_semaphores(struct drm_device *dev) > +{ > + if (INTEL_INFO(dev)->gen < 6) > + return 0; > + > + if (i915_semaphores >= 0) > + return i915_semaphores; > + > + if (INTEL_INFO(dev)->gen >= 7) > + return 1; > +#ifdef CONFIG_INTEL_IOMMU > + /* On gen6, we only enable semaphores if dma remapping is disabled, > + * or if there is no iommu. > + */ > + if (INTEL_INFO(dev)->gen == 6) > + return no_iommu || dmar_disabled; > +#endif > + > + return 1; > +} Now this function can be written more compactly by just removing the gen >= 7 check. Otherwise, Reviewed-by: Chris Wilson -Chris -- Chris Wilson, Intel Open Source Technology Centre