All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Siluvery, Arun" <arun.siluvery@linux.intel.com>
To: Mika Kuoppala <mika.kuoppala@linux.intel.com>,
	intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v2 1/4] drm/i915: Enable WA batch buffers for Gen9
Date: Fri, 10 Jul 2015 17:16:09 +0100	[thread overview]
Message-ID: <559FEFC9.90709@linux.intel.com> (raw)
In-Reply-To: <874mlcnh79.fsf@gaia.fi.intel.com>

On 10/07/2015 16:52, Mika Kuoppala wrote:
> Arun Siluvery <arun.siluvery@linux.intel.com> writes:
>
>> This patch only enables support for Gen9, the actual WA will be
>> initialized in subsequent patches.
>>
>> The WARN that we use to warn user if WA batch support is not available
>> for a particular Gen is replaced with DRM_ERROR as warning here doesn't
>> really add much value.
>>
>> v2: include all infrastructure bits in this patch so that subsequent
>> changes only correspond the WA added (Chris)
>>
>> Cc: Imre Deak <imre.deak@intel.com>
>> Signed-off-by: Arun Siluvery <arun.siluvery@linux.intel.com>
>
> The wa_ctx_emits need index as second param now. With those,
>
> Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com>
>
Thanks Mika, I will send the updated patches.
Your r-b tag is for all patches correct?
Should I include the tag while sending the patches?

regards
Arun

>> ---
>>   drivers/gpu/drm/i915/intel_lrc.c | 50 +++++++++++++++++++++++++++++++++++++---
>>   1 file changed, 47 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
>> index 23ff018..1e88b3b 100644
>> --- a/drivers/gpu/drm/i915/intel_lrc.c
>> +++ b/drivers/gpu/drm/i915/intel_lrc.c
>> @@ -1269,6 +1269,35 @@ static int gen8_init_perctx_bb(struct intel_engine_cs *ring,
>>   	return wa_ctx_end(wa_ctx, *offset = index, 1);
>>   }
>>
>> +static int gen9_init_indirectctx_bb(struct intel_engine_cs *ring,
>> +				    struct i915_wa_ctx_bb *wa_ctx,
>> +				    uint32_t *const batch,
>> +				    uint32_t *offset)
>> +{
>> +	uint32_t index = wa_ctx_start(wa_ctx, *offset, CACHELINE_DWORDS);
>> +
>> +	/* FIXME: Replace me with WA */
>> +	wa_ctx_emit(batch, MI_NOOP);
>> +
>> +	/* Pad to end of cacheline */
>> +	while (index % CACHELINE_DWORDS)
>> +		wa_ctx_emit(batch, MI_NOOP);
>> +
>> +	return wa_ctx_end(wa_ctx, *offset = index, CACHELINE_DWORDS);
>> +}
>> +
>> +static int gen9_init_perctx_bb(struct intel_engine_cs *ring,
>> +			       struct i915_wa_ctx_bb *wa_ctx,
>> +			       uint32_t *const batch,
>> +			       uint32_t *offset)
>> +{
>> +	uint32_t index = wa_ctx_start(wa_ctx, *offset, CACHELINE_DWORDS);
>> +
>> +	wa_ctx_emit(batch, MI_BATCH_BUFFER_END);
>> +
>> +	return wa_ctx_end(wa_ctx, *offset = index, 1);
>> +}
>> +
>>   static int lrc_setup_wa_ctx_obj(struct intel_engine_cs *ring, u32 size)
>>   {
>>   	int ret;
>> @@ -1310,10 +1339,11 @@ static int intel_init_workaround_bb(struct intel_engine_cs *ring)
>>   	WARN_ON(ring->id != RCS);
>>
>>   	/* update this when WA for higher Gen are added */
>> -	if (WARN(INTEL_INFO(ring->dev)->gen > 8,
>> -		 "WA batch buffer is not initialized for Gen%d\n",
>> -		 INTEL_INFO(ring->dev)->gen))
>> +	if (INTEL_INFO(ring->dev)->gen > 9) {
>> +		DRM_ERROR("WA batch buffer is not initialized for Gen%d\n",
>> +			  INTEL_INFO(ring->dev)->gen);
>>   		return 0;
>> +	}
>>
>>   	/* some WA perform writes to scratch page, ensure it is valid */
>>   	if (ring->scratch.obj == NULL) {
>> @@ -1345,6 +1375,20 @@ static int intel_init_workaround_bb(struct intel_engine_cs *ring)
>>   					  &offset);
>>   		if (ret)
>>   			goto out;
>> +	} else if (INTEL_INFO(ring->dev)->gen == 9) {
>> +		ret = gen9_init_indirectctx_bb(ring,
>> +					       &wa_ctx->indirect_ctx,
>> +					       batch,
>> +					       &offset);
>> +		if (ret)
>> +			goto out;
>> +
>> +		ret = gen9_init_perctx_bb(ring,
>> +					  &wa_ctx->per_ctx,
>> +					  batch,
>> +					  &offset);
>> +		if (ret)
>> +			goto out;
>>   	}
>>
>>   out:
>> --
>> 1.9.1
>>
>> _______________________________________________
>> Intel-gfx mailing list
>> Intel-gfx@lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
>

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2015-07-10 16:16 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-06 16:12 [PATCH v2 0/4] Gen9 WA Batch patches Arun Siluvery
2015-07-06 16:12 ` [PATCH v2 1/4] drm/i915: Enable WA batch buffers for Gen9 Arun Siluvery
2015-07-10 15:52   ` Mika Kuoppala
2015-07-10 16:16     ` Siluvery, Arun [this message]
2015-07-06 16:12 ` [PATCH v2 2/4] drm/i915/gen9: Add WaDisableCtxRestoreArbitration workaround Arun Siluvery
2015-07-07 17:41   ` Arun Siluvery
2015-07-13 12:31     ` Mika Kuoppala
2015-07-13 14:49       ` Daniel Vetter
2015-07-13 14:52         ` Daniel Vetter
2015-07-06 16:12 ` [PATCH v2 3/4] drm/i915/gen9: Add WaFlushCoherentL3CacheLinesAtContextSwitch workaround Arun Siluvery
2015-07-13 10:36   ` Arun Siluvery
2015-07-13 13:08     ` Mika Kuoppala
2015-07-06 16:12 ` [PATCH v2 4/4] drm/i915/gen9: Add WaSetDisablePixMaskCammingAndRhwoInCommonSliceChicken Arun Siluvery
2015-07-07 17:43   ` Arun Siluvery
2015-07-13 13:16     ` Mika Kuoppala
2015-07-14  9:34       ` Dave Gordon
2015-07-14  9:52         ` Mika Kuoppala

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=559FEFC9.90709@linux.intel.com \
    --to=arun.siluvery@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=mika.kuoppala@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.