From: "Siluvery, Arun" <arun.siluvery@linux.intel.com>
To: "Ville Syrjälä" <ville.syrjala@linux.intel.com>,
"Chris Wilson" <chris@chris-wilson.co.uk>,
"Damien Lespiau" <damien.lespiau@intel.com>,
"Daniel Vetter" <daniel@ffwll.ch>,
intel-gfx@lists.freedesktop.org,
"Mika Kuoppala" <mika.kuoppala@intel.com>
Subject: Re: [PATCH] drm/i915: Emit even number of dwords when emitting LRIs
Date: Thu, 23 Oct 2014 14:55:27 +0100 [thread overview]
Message-ID: <544908CF.9060107@linux.intel.com> (raw)
In-Reply-To: <20141023134142.GZ4284@intel.com>
On 23/10/2014 14:41, Ville Syrjälä wrote:
> On Thu, Oct 23, 2014 at 01:50:23PM +0100, Chris Wilson wrote:
>> On Thu, Oct 23, 2014 at 01:42:38PM +0100, Damien Lespiau wrote:
>>> On Thu, Oct 23, 2014 at 02:21:02PM +0200, Daniel Vetter wrote:
>>>> On Wed, Oct 22, 2014 at 06:59:52PM +0100, Arun Siluvery wrote:
>>>>> The number of DWords should be even when doing ring emits as
>>>>> command sequences require QWord alignment.
>>>>>
>>>>> v2: user LRI variant that can write multiple regs in one go (Damien).
>>>>> We can simply insert one NOP at the end instead of one per register write.
>>>>>
>>>>> Cc: Mika Kuoppala <mika.kuoppala@intel.com>
>>>>> Signed-off-by: Arun Siluvery <arun.siluvery@linux.intel.com>
>>>>> ---
>>>>> drivers/gpu/drm/i915/intel_ringbuffer.c | 5 +++--
>>>>> 1 file changed, 3 insertions(+), 2 deletions(-)
>>>>>
>>>>> diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
>>>>> index 497b836..a8f72e8 100644
>>>>> --- a/drivers/gpu/drm/i915/intel_ringbuffer.c
>>>>> +++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
>>>>> @@ -680,15 +680,16 @@ static int intel_ring_workarounds_emit(struct intel_engine_cs *ring)
>>>>> if (ret)
>>>>> return ret;
>>>>>
>>>>> - ret = intel_ring_begin(ring, w->count * 3);
>>>>> + ret = intel_ring_begin(ring, (w->count * 2 + 2));
>>>>> if (ret)
>>>>> return ret;
>>>>>
>>>>> + intel_ring_emit(ring, MI_LOAD_REGISTER_IMM(w->count));
>>>>
>>>> Afaik there's a limit to the size of an MI_LRI. Where's the check for
>>>> that (probably with a WARN_ON for now to avoid unecessary complexity)?
>>>
>>> I guess there's always the size of the length field, I don't see any
>>> other indication. Note that I can find the documentation of the
>>> multi-registers version of LRI either. So, well, we probably should
>>> double check it does work.
>>
>> It does work. The max is around 60 iirc (the max length of the
>> command).
>
> The maximum length seems to be 0xff on gen6+ and 0x3f before that,
> which would mean at most 128 or 32 registers.
>
> Also the context image is full of these multi register LRIs. Based on a
> quick glance the longest LRI in there is 0x5f on IVB, 0xcf on HSW, and
> 0xdf on BDW, which translate to 48, 104, and 108 registers per LRI. So
> we know at least those must work or context restore would not work.
> Before gen7 the context doesn't seem to resemble a batch, so I can't
> tell anything about those platforms based on the context image.
>
w->count is already checked against max workarounds which is 16 now so
we are well within the limit; I think additional check would be
redundant here and it is unlikely to have more than 128 workarounds.
regards
Arun
next prev parent reply other threads:[~2014-10-23 13:55 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-22 17:59 [PATCH] drm/i915: Emit even number of dwords when emitting LRIs Arun Siluvery
2014-10-22 21:59 ` Damien Lespiau
2014-10-23 12:21 ` Daniel Vetter
2014-10-23 12:42 ` Damien Lespiau
2014-10-23 12:50 ` Chris Wilson
2014-10-23 13:41 ` Ville Syrjälä
2014-10-23 13:55 ` Siluvery, Arun [this message]
2014-10-23 14:42 ` Mika Kuoppala
2014-10-23 15:49 ` Daniel Vetter
-- strict thread matches above, loose matches on Subject: below --
2014-10-22 9:09 Arun Siluvery
2014-10-22 10:40 ` Damien Lespiau
2014-10-22 10:54 ` Damien Lespiau
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=544908CF.9060107@linux.intel.com \
--to=arun.siluvery@linux.intel.com \
--cc=chris@chris-wilson.co.uk \
--cc=damien.lespiau@intel.com \
--cc=daniel@ffwll.ch \
--cc=intel-gfx@lists.freedesktop.org \
--cc=mika.kuoppala@intel.com \
--cc=ville.syrjala@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox