From: Ben Widawsky Subject: Re: [PATCH 1/2] intel: Add support for overriding the PCI ID via an environment variable Date: Tue, 21 Feb 2012 23:43:18 +0100 Message-ID: <20120221234318.793ffdc7@bwidawsk.net> References: <1329857978-30626-1-git-send-email-kenneth@whitecape.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from cloud01.chad-versace.us (184-106-247-128.static.cloud-ips.com [184.106.247.128]) by gabe.freedesktop.org (Postfix) with ESMTP id A2A729EFF6 for ; Tue, 21 Feb 2012 14:44:27 -0800 (PST) In-Reply-To: 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: Chris Wilson Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Tue, 21 Feb 2012 21:11:07 +0000 Chris Wilson wrote: > On Tue, 21 Feb 2012 12:59:37 -0800, Kenneth Graunke wrote: > > @@ -1828,6 +1829,9 @@ drm_intel_gem_bo_mrb_exec2(drm_intel_bo *bo, int used, > > execbuf.rsvd1 = 0; > > execbuf.rsvd2 = 0; > > > > + if (getenv("INTEL_DEVID_OVERRIDE")) > > + goto skip_execution; > > I'm not thrilled about calling getenv() for every execbuffer. And what > about the original execbuffer path? > -Chris > I agree. I think the right way to do this is if the environment variable is set, you can override the function pointer in drm_intel_bufmgr_gem_init or something like that. Also, I think it's a bit misleading that the effect of overriding the devid is to not emit batches. If nothing else because we may actually want to override the devid and have it do something in the future, and expecting the override to not emit could be bad.