From: Yaodong Li <yaodong.li@intel.com>
To: Michal Wajdeczko <michal.wajdeczko@intel.com>,
intel-gfx@lists.freedesktop.org
Cc: Sujaritha Sundaresan <sujaritha.sundaresan@intel.com>
Subject: Re: [PATCH v10 3/7] drm/i915/guc: Implement dynamic GuC WOPCM offset and size
Date: Wed, 14 Feb 2018 10:25:41 -0800 [thread overview]
Message-ID: <cd43156d-ff8d-69d5-e16d-1480fcf9f681@intel.com> (raw)
In-Reply-To: <op.zefsl8qtxaggs7@mwajdecz-mobl1.ger.corp.intel.com>
On 02/14/2018 09:38 AM, Michal Wajdeczko wrote:
> On Wed, 14 Feb 2018 03:26:12 +0100, Yaodong Li <yaodong.li@intel.com>
> wrote:
>
>>
>> On 02/13/2018 07:56 AM, Michal Wajdeczko wrote:
>>>
>>> Also, comparing again your drawing with the spec I think it
>>> should look like this:
>>>
>>> +-------- +====================+ <== WOPCM top
>>> /|\ | HW RESERVED |
>>> | +------------------- +
>>> | | |
>>> | +-- +====================+ <== GuC WOPCM top
>>> | /|\ | |
>>> | | | |
>>> | GuC | |
>>> | WOPCM | GuC firmware |
>>> | size | |
>>> WOPCM | +--------------------+
>>> size \|/ | GuC reserved |
>>> | +-- +====================+ <== GuC WOPCM base (offset from
>>> WOPCM base)
>>> | | WOPCM RESERVED |
>>> | +--------------------+
>>> \|/ | HuC firmware |
>>> +-------- +====================+ <== WOPCM base
>>>
>>>
>>>> +
>>>> +/* GUC WOPCM offset needs to be 16KB aligned. */
>>>> +#define GUC_WOPCM_OFFSET_ALIGNMENT (16 << 10)
>>>> +/* 16KB reserved at the beginning of GuC WOPCM. */
>>>> +#define GUC_WOPCM_RESERVED (16 << 10)
>>>> +/* 8KB from GUC_WOPCM_RESERVED is reserved for GuC stack. */
>>>> +#define GUC_WOPCM_STACK_RESERVED (8 << 10)
>>>> +/* 24KB at the end of GuC WOPCM is reserved for RC6 CTX on BXT. */
>>>> +#define BXT_GUC_WOPCM_RC6_CTX_RESERVED (24 << 10)
>>>
>>> Hmm, I'm still not convinced that we correctly attach it to "GuC
>>> WOPCM".
>>>
>>> In the result, maybe we should stop focusing on "intel_guc_wopcm"
>>> and define
>>> everything as "intel_wopcm" as it was earlier suggested by Joonas.
>>>
>>> Then we can define our struct to match diagram above as
>>>
>>> struct intel_wopcm {
>>> u32 size;
>>> struct {
>>> u32 base;
>>> u32 size;
>>> } guc;
>>> };
>>>
>>> u32 intel_wopcm_guc_top(struct intel_wopcm *wopcm)
>>> {
>>> return wopcm->guc.base + wopcm->guc.size;
>>> }
>> More comments about the *top*:-)
>>
>> The *top* we used in driver code to verify where the non-wopcm guc
>> memory
>> allocation starts is the offset value from guc.base to WOPCM_TOP. so
>> we don't need to
>> add the guc.base to it.
>>
>> From GuC point of view the *top* (boundary between wopcm and
>> non-wopcm memory)
>> is like:
>> +------------------+ <=== GuC memory end
>>
>> Non WOPCM
>>
>> +------------------+ <=== *top* (This is actually in top of the whole
>> WOPCM)
>> CTX Rsvd
>> +------------------+ <=== *__top* (wopcm->guc.size)
>> WOPCM
>> +------------------+ <=== guc base (wopcm->guc.base)
>>
>> actually, we had a discussion whether we should set the guc wopcm and
>> non-wopcm
>> boundary to *__top* but the suggestion we got is to stick to the spec
>> description which
>> says to allocate "non-wopcm memory starts from WOPCM TOP"(even if it
>> seems
>> we could use *__top* as the boundary:-)). and it's because of this
>> reason we called the
>> wopcm from guc_base to *top* as GuC WOPCM since we count the wopcm
>> between
>> *__top* to *top* as a part of GuC address space while trying to
>> allocate non-wopcm
>> for GuC (even though GuC won't access CTX Rsvd at allO:-)).
>
> Ok, so we should program GUC_WOPCM_SIZE to wopcm->guc.size and then
> use (wopcm->size - wopcm->guc.base) as offset to i915_vma_pin, right?
>
All values of size and top are relevant to guc.base (offsets from
guc.base), and currently
we are using guc.size + hole between guc.size and ctx reserved (if any)
+ ctx reserved size
as the offset to i915_vma_pin as it's the actual WOPCM_TOP.:-)
Regards,
-Jackie
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2018-02-14 18:27 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-12 23:45 [PATCH v10 1/7] drm/i915/guc: Move GuC WOPCM related code into separate files Jackie Li
2018-02-12 23:45 ` [PATCH v10 2/7] drm/i915/guc: Rename guc_ggtt_offset to intel_guc_ggtt_offset Jackie Li
2018-02-12 23:45 ` [PATCH v10 3/7] drm/i915/guc: Implement dynamic GuC WOPCM offset and size Jackie Li
2018-02-13 15:56 ` Michal Wajdeczko
2018-02-13 20:01 ` Yaodong Li
2018-02-13 22:58 ` Michal Wajdeczko
2018-02-14 2:26 ` Yaodong Li
2018-02-14 17:38 ` Michal Wajdeczko
2018-02-14 18:25 ` Yaodong Li [this message]
2018-02-12 23:45 ` [PATCH v10 4/7] drm/i915/guc: Add support to return CNL specific reserved GuC WOPCM size Jackie Li
2018-02-12 23:45 ` [PATCH v10 5/7] drm/i915/guc: Add HuC firmware size related restriction for Gen9 and CNL A0 Jackie Li
2018-02-13 16:06 ` Michal Wajdeczko
2018-02-13 21:50 ` Yaodong Li
2018-02-13 22:59 ` Michal Wajdeczko
2018-02-14 0:41 ` Yaodong Li
2018-02-14 17:24 ` Michal Wajdeczko
2018-02-14 18:22 ` Yaodong Li
2018-02-12 23:45 ` [PATCH v10 6/7] drm/i915/guc: Check the locking status of GuC WOPCM registers Jackie Li
2018-02-13 17:39 ` Michal Wajdeczko
2018-02-14 1:18 ` Yaodong Li
2018-02-14 17:07 ` Michal Wajdeczko
2018-02-14 18:31 ` Yaodong Li
2018-02-14 18:42 ` Yaodong Li
2018-02-12 23:45 ` [PATCH v10 7/7] HAX Enable GuC Submission for CI Jackie Li
2018-02-13 0:27 ` ✗ Fi.CI.BAT: failure for series starting with [v10,1/7] drm/i915/guc: Move GuC WOPCM related code into separate files Patchwork
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=cd43156d-ff8d-69d5-e16d-1480fcf9f681@intel.com \
--to=yaodong.li@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=michal.wajdeczko@intel.com \
--cc=sujaritha.sundaresan@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