public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Mika Kuoppala <mika.kuoppala@linux.intel.com>
To: Jani Nikula <jani.nikula@linux.intel.com>,
	intel-gfx@lists.freedesktop.org
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Subject: Re: [PATCH 4/5] drm/i915: Let number of workarounds	more	clear
Date: Fri, 26 Sep 2014 17:16:57 +0300	[thread overview]
Message-ID: <87mw9mlb52.fsf@gaia.fi.intel.com> (raw)
In-Reply-To: <87r3yylevx.fsf@intel.com>

Jani Nikula <jani.nikula@linux.intel.com> writes:

> On Fri, 26 Sep 2014, Mika Kuoppala <mika.kuoppala@linux.intel.com> wrote:
>> Rodrigo Vivi <rodrigo.vivi@intel.com> writes:
>>
>>> This helps when including or removing cs workarounds.
>>> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
>>> ---
>>>  drivers/gpu/drm/i915/intel_ringbuffer.c | 16 ++++++++++++----
>>>  1 file changed, 12 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
>>> index 7c3d17a..39fbea6 100644
>>> --- a/drivers/gpu/drm/i915/intel_ringbuffer.c
>>> +++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
>>> @@ -694,6 +694,7 @@ static int bdw_init_workarounds(struct intel_engine_cs *ring)
>>>  	int ret;
>>>  	struct drm_device *dev = ring->dev;
>>>  	struct drm_i915_private *dev_priv = dev->dev_private;
>>> +	int wa_amount;
>>>  
>>>  	/*
>>>  	 * workarounds applied in this fn are part of register state context,
>>> @@ -704,10 +705,11 @@ static int bdw_init_workarounds(struct intel_engine_cs *ring)
>>>  	memset(dev_priv->intel_wa_regs, 0, sizeof(dev_priv->intel_wa_regs));
>>>  
>>>  	/*
>>> -	 * update the number of dwords required based on the
>>> -	 * actual number of workarounds applied
>>> +	 * update the number of workarounds when adding or removing was
>>> +	 * in order the have propper dwords
>>>  	 */
>>> -	ret = intel_ring_begin(ring, 24);
>>> +	wa_amount = 8;
>>> +	ret = intel_ring_begin(ring, 3 * wa_amount);
>>>  	if (ret)
>>>  		return ret;
>>>  
>>
>> I have a bit mixed feelings with this patch as I have tripped
>> around here myself recently.
>>
>> I think we should just drop this patch and use:
>> ret = intel_ring_begin(ring, 3 * <amount>) on the subsequent
>> patches that modify the amount.
>>
>> This way the intel_ring_begin will always be the one that
>> shows in a diff. And raises alarm if it doesnt. We don't want
>> this to be too transparent and looking too easy for the next reader.
>> As the reviewer is the only and last line of defense ensuring
>> symmetry between intel_ring_begin and amount of emits.
>
> Considering intel_ring_emit_wa() adds all the needed information to
> dev_priv->intel_wa_regs and dev_priv->num_wa_regs anyway, we could
> trivially split this into constructing dev_priv->intel_wa_regs first,
> and doing intel_ring_begin() and the intel_ring_emit()s next, and not
> worry about this again.

My RFC series of fixing the workarounds after reset/suspend does this.

-Mika

> BR,
> Jani.
>
>>
>> -Mika
>>
>>> @@ -775,6 +777,7 @@ static int chv_init_workarounds(struct intel_engine_cs *ring)
>>>  	int ret;
>>>  	struct drm_device *dev = ring->dev;
>>>  	struct drm_i915_private *dev_priv = dev->dev_private;
>>> +	int wa_amount;
>>>  
>>>  	/*
>>>  	 * workarounds applied in this fn are part of register state context,
>>> @@ -784,7 +787,12 @@ static int chv_init_workarounds(struct intel_engine_cs *ring)
>>>  	dev_priv->num_wa_regs = 0;
>>>  	memset(dev_priv->intel_wa_regs, 0, sizeof(dev_priv->intel_wa_regs));
>>>  
>>> -	ret = intel_ring_begin(ring, 12);
>>> +	/*
>>> +	 * update the number of workarounds when adding or removing was
>>> +	 * in order the have propper dwords
>>> +	 */
>>> +	wa_amount = 4;
>>> +	ret = intel_ring_begin(ring, 3 * wa_amount);
>>>  	if (ret)
>>>  		return ret;
>>>  
>>> -- 
>>> 1.9.3
>>>
>>> _______________________________________________
>>> 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
>
> -- 
> Jani Nikula, Intel Open Source Technology Center

  parent reply	other threads:[~2014-09-26 14:17 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-20  0:16 [PATCH 1/5] drm/i915: Add IS_BDW_GT3 macro Rodrigo Vivi
2014-09-20  0:16 ` [PATCH 2/5] drm/i915/bdw: WaDisableFenceDestinationToSLM Rodrigo Vivi
2014-09-25 12:37   ` Mika Kuoppala
2014-09-29 12:32     ` Daniel Vetter
2014-09-29 12:49       ` Daniel Vetter
2014-09-30 15:02         ` Mika Kuoppala
2014-09-30 16:27           ` Daniel Vetter
2014-09-20  0:16 ` [PATCH 3/5] drm/i915/bdw: WaProgramL3SqcReg1Default Rodrigo Vivi
2014-09-26 12:03   ` Mika Kuoppala
2014-09-26 18:32     ` Rodrigo Vivi
2014-09-26 19:06     ` Ville Syrjälä
2014-09-30 15:11       ` [PATCH] " Rodrigo Vivi
2014-10-01 13:46         ` Mika Kuoppala
2014-09-20  0:16 ` [PATCH 4/5] drm/i915: Let number of workarounds more clear Rodrigo Vivi
2014-09-24 22:44   ` [PATCH] " Rodrigo Vivi
2014-09-26 12:22   ` [PATCH 4/5] " Mika Kuoppala
2014-09-26 12:56     ` Jani Nikula
2014-09-26 12:58       ` Chris Wilson
2014-09-26 13:02         ` Damien Lespiau
2014-09-26 14:16       ` Mika Kuoppala [this message]
2014-09-26 14:56         ` Chris Wilson
2014-09-30 22:13           ` Rodrigo Vivi
2014-09-20  0:16 ` [PATCH 5/5] drm/i915/bdw: Remove BDW preproduction W/As until C stepping Rodrigo Vivi
2014-09-24 22:46   ` [PATCH] " Rodrigo Vivi
2014-09-30 22:14     ` Rodrigo Vivi
2014-10-01 14:11     ` Mika Kuoppala
2014-10-09 14:11       ` Rodrigo Vivi
2014-10-19 12:14         ` Daniel Vetter
2014-09-29 19:58 ` [PATCH 1/5] drm/i915: Add IS_BDW_GT3 macro Jesse Barnes

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=87mw9mlb52.fsf@gaia.fi.intel.com \
    --to=mika.kuoppala@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    --cc=rodrigo.vivi@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox