From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, Intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 1/7] drm/i915: Record GT workarounds in a list
Date: Mon, 3 Dec 2018 12:44:23 +0000 [thread overview]
Message-ID: <baf0b6c3-8322-94f1-4278-7db67efa7914@linux.intel.com> (raw)
In-Reply-To: <154384073005.21484.8120250366675842889@skylake-alporthouse-com>
On 03/12/2018 12:38, Chris Wilson wrote:
> Quoting Tvrtko Ursulin (2018-12-03 12:34:24)
>>
>> On 03/12/2018 11:54, Chris Wilson wrote:
>>> Quoting Tvrtko Ursulin (2018-12-03 11:46:11)
>>>> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>>>> @@ -575,160 +587,240 @@ int intel_ctx_workarounds_emit(struct i915_request *rq)
>>>> return 0;
>>>> }
>>>>
>>>> -static void bdw_gt_workarounds_apply(struct drm_i915_private *dev_priv)
>>>> +static void
>>>> +wal_add(struct i915_wa_list *wal, const struct i915_wa *wa)
>>>> +{
>>>> + const unsigned int grow = 1 << 4;
>>>> +
>>>> + GEM_BUG_ON(!is_power_of_2(grow));
>>>> +
>>>> + if (IS_ALIGNED(wal->count, grow)) { /* Either uninitialized or full. */
>>>
>>> Neat.
>>>
>>>> + struct i915_wa *list;
>>>> +
>>>> + list = kcalloc(ALIGN(wal->count + 1, grow), sizeof(*wa),
>>>> + GFP_KERNEL);
>>>
>>> (Quietly comments on the calloc here ;)
>>
>> Oh I don't want to complicate things with zeroing the tail. Or you
>> wouldn't bother with zeroing at all since I always copy over used
>> entries? So unused, who cares about them?
>
> Exactly, nothing after wal->count is accessed, so no need to zero it as
> it will always be initialised by wal_add().
Ok.
>>>> +struct i915_wa_list {
>>>> + const char *name;
>>>> + unsigned int count;
>>>> + struct i915_wa *list;
>>>
>>> Oh well, didn't save anything after all.
>>
>> How nothing, one unsigned int per wa_list instance! :)
>
> struct is padded to 8 bytes for the pointer. There's a hole after count,
> even if we place it at the end. :|
Another unsigned int gets in there later in the series - for the benefit
of being able to log the exact, and not merged, number of workarounds.
But it makes sense to move the count at the end anyway so I'll do that.
Regards,
Tvrtko
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2018-12-03 12:44 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-03 11:46 [PATCH v3 0/7] Restore workarounds after engine reset and unify their handling Tvrtko Ursulin
2018-12-03 11:46 ` [PATCH 1/7] drm/i915: Record GT workarounds in a list Tvrtko Ursulin
2018-12-03 11:54 ` Chris Wilson
2018-12-03 12:34 ` Tvrtko Ursulin
2018-12-03 12:38 ` Chris Wilson
2018-12-03 12:44 ` Tvrtko Ursulin [this message]
2018-12-03 11:46 ` [PATCH 2/7] drm/i915: Introduce per-engine workarounds Tvrtko Ursulin
2018-12-03 11:46 ` [PATCH 3/7] drm/i915: Verify GT workaround state after GPU init Tvrtko Ursulin
2018-12-03 11:46 ` [PATCH 4/7] drm/i915/selftests: Add tests for GT and engine workaround verification Tvrtko Ursulin
2018-12-03 11:57 ` Chris Wilson
2018-12-03 11:46 ` [PATCH 5/7] drm/i915: Move register white-listing to the common workaround framework Tvrtko Ursulin
2018-12-03 11:46 ` [PATCH 6/7] drm/i915: Fuse per-context workaround handling with the common framework Tvrtko Ursulin
2018-12-03 12:01 ` Chris Wilson
2018-12-03 11:46 ` [PATCH 7/7] drm/i915: Trim unused workaround list entries Tvrtko Ursulin
2018-12-03 12:03 ` Chris Wilson
2018-12-03 12:20 ` ✗ Fi.CI.CHECKPATCH: warning for Restore workarounds after engine reset and unify their handling (rev3) Patchwork
2018-12-03 12:23 ` ✗ Fi.CI.SPARSE: " Patchwork
2018-12-03 12:43 ` ✓ Fi.CI.BAT: success " Patchwork
-- strict thread matches above, loose matches on Subject: below --
2018-12-03 12:50 [PATCH v4 0/7] Restore workarounds after engine reset and unify their handling Tvrtko Ursulin
2018-12-03 12:50 ` [PATCH 1/7] drm/i915: Record GT workarounds in a list Tvrtko Ursulin
2018-12-03 12:53 ` Chris Wilson
2018-12-03 13:33 ` Tvrtko Ursulin
2018-11-30 17:44 [PATCH v2 0/8] Restore workarounds after engine reset and unify their handling Tvrtko Ursulin
2018-11-30 17:44 ` [PATCH 1/7] drm/i915: Record GT workarounds in a list Tvrtko Ursulin
2018-11-30 21:51 ` Chris Wilson
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=baf0b6c3-8322-94f1-4278-7db67efa7914@linux.intel.com \
--to=tvrtko.ursulin@linux.intel.com \
--cc=Intel-gfx@lists.freedesktop.org \
--cc=chris@chris-wilson.co.uk \
/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