From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Wilson Subject: Re: [PATCH 1/2] drm/i915/bdw: Apply workarounds in render ring init function Date: Tue, 26 Aug 2014 11:34:04 +0100 Message-ID: <20140826103404.GE5458@nuc-i3427.alporthouse.com> References: <1409045597-9679-1-git-send-email-arun.siluvery@linux.intel.com> <1409045597-9679-2-git-send-email-arun.siluvery@linux.intel.com> <20140826100908.GC5458@nuc-i3427.alporthouse.com> <53FC5E7D.5090602@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from fireflyinternet.com (mail.fireflyinternet.com [87.106.93.118]) by gabe.freedesktop.org (Postfix) with ESMTP id 4DA6A6E493 for ; Tue, 26 Aug 2014 03:34:09 -0700 (PDT) Content-Disposition: inline In-Reply-To: <53FC5E7D.5090602@linux.intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: "Siluvery, Arun" Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Tue, Aug 26, 2014 at 11:16:29AM +0100, Siluvery, Arun wrote: > On 26/08/2014 11:09, Chris Wilson wrote: > >On Tue, Aug 26, 2014 at 10:33:16AM +0100, Arun Siluvery wrote: > >>For BDW workarounds are currently initialized in init_clock_gating() but > >>they are lost during reset, suspend/resume etc; this patch moves the WAs > >>that are part of register state context to render ring init fn otherwise > >>default context ends up with incorrect values as they don't get initialized > >>until init_clock_gating fn. > >> > >>v2: Add workarounds to golden render state > >>This method has its own issues, first of all this is different for > >>each gen and it is generated using a tool so adding new workaround > >>and mainitaining them across gens is not a straightforward process. > >> > >>v3: Use LRIs to emit these workarounds (Ville) > >>Instead of modifying the golden render state the same LRIs are > >>emitted from within the driver. > >> > >>For: VIZ-4092 > >>Signed-off-by: Arun Siluvery > >>--- > >> drivers/gpu/drm/i915/i915_gem_context.c | 6 +++ > >> drivers/gpu/drm/i915/intel_pm.c | 48 -------------------- > >> drivers/gpu/drm/i915/intel_ringbuffer.c | 78 +++++++++++++++++++++++++++++++++ > >> drivers/gpu/drm/i915/intel_ringbuffer.h | 1 + > >> 4 files changed, 85 insertions(+), 48 deletions(-) > >> > >>diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c > >>index 9683e62..2debce4 100644 > >>--- a/drivers/gpu/drm/i915/i915_gem_context.c > >>+++ b/drivers/gpu/drm/i915/i915_gem_context.c > >>@@ -631,20 +631,26 @@ static int do_switch(struct intel_engine_cs *ring, > >> } > >> > >> uninitialized = !to->legacy_hw_ctx.initialized && from == NULL; > >> to->legacy_hw_ctx.initialized = true; > >> > >> done: > >> i915_gem_context_reference(to); > >> ring->last_context = to; > >> > >> if (uninitialized) { > >>+ if (IS_BROADWELL(ring->dev)) { > >>+ ret = bdw_init_workarounds(ring); > >>+ if (ret) > >>+ DRM_ERROR("init workarounds: %d\n", ret); > > > >A good rule of thumb is that if you are exporting gen specific routines, > >the layering and abstraction is fishy. > >-Chris > > > ok, so something like i915_init_workarounds() is ok? with a check > for bdw/gen8 done inside that function. Except for init_workarounds is quite useless as a function name and we already have a structure that is already customised per-engine and per-gen that you could hook into. engine->ring_init_context() ? -Chris -- Chris Wilson, Intel Open Source Technology Centre