From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Siluvery, Arun" Subject: Re: [PATCH 1/2] drm/i915/bdw: Apply workarounds in render ring init function Date: Tue, 26 Aug 2014 11:16:29 +0100 Message-ID: <53FC5E7D.5090602@linux.intel.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> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" 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 1369F6E13A for ; Tue, 26 Aug 2014 03:16:40 -0700 (PDT) In-Reply-To: <20140826100908.GC5458@nuc-i3427.alporthouse.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: Chris Wilson , intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org 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. regards Arun