From: Francisco Jerez <currojerez@riseup.net>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 1/6] drm/i915: Implement L3 partitioning set-up from the workaround list.
Date: Wed, 07 Oct 2015 16:30:35 +0300 [thread overview]
Message-ID: <87wpuyiz5w.fsf@riseup.net> (raw)
In-Reply-To: <20151007124226.GE27939@nuc-i3427.alporthouse.com>
[-- Attachment #1.1.1: Type: text/plain, Size: 3919 bytes --]
Chris Wilson <chris@chris-wilson.co.uk> writes:
> On Wed, Oct 07, 2015 at 02:44:00PM +0300, Francisco Jerez wrote:
>> This programs the L3 configuration based on the sizes given for each
>> partition as arguments. The relevant register writes are added to the
>> workaround list so that they are re-applied to each context while it's
>> initialized, preventing state leaks from other userspace processes
>> which may have modified the L3 partitioning from its boot-up state,
>> since all relevant registers are part of the software and hardware
>> command checker whitelists.
>>
>> Some userspace clients (DDX and current versions of Mesa not patched
>> with my L3 partitioning series [1]) assume that the L3 configuration,
>> in particular the URB size, comes up in certain state when a context
>> is created, but nothing in the kernel guarantees this assumption, the
>> registers that control the partitioning of the L3 cache were being
>> left untouched.
>>
>> Note that the VLV_L3SQCREG1_SQGHPCI_DEFAULT macro defined here has the
>> same value as the previously defined VLV_B0_WA_L3SQCREG1_VALUE, but
>> the latter will be removed in a future commit.
>>
>> [1] http://lists.freedesktop.org/archives/mesa-dev/2015-September/093550.html
>
> Merge this with 1 + 5 (or was it 4?)- not only does it introduce a
> temporary unused function, but we have to jump between patches to see
> whether the function is safe (especially given those BUGs), and you add
> all w/a in the same patch so bisection is not improved.
>
What do you want me to merge it with? This *is* PATCH 1, and PATCH 5 is
largely unrelated. I wouldn't have any objection to squashing PATCH 4
into this commit though.
> Looking at the function itself, I am not convinced that it actually adds
> anything over calling setting up the WA from the vfuncs - at least the
> bdw/gen7 split is redundant (we split at the vfunc then call one
> function where we replit again, but with nasty constraints on the
> interface of the function for different gen, it's not a function for the
> faint of heart).
>
The constraints are just the hardware's constraints on the L3
partitioning. The function is meant to implement the details of
programming the L3 configuration, which is different for different gens
even though the overall structure of the L3 partitioning is the same.
Of course the constraints set by specific hardware on the partition
sizes cannot be abstracted out.
I guess that splitting this out into two functions (one for gen7 and
another for gen8) wouldn't hurt much, but open-coding the function in
all its uses (5) would involve duplicating quite some code.
Assuming I split the function into gen7 and gen8 variants, would you
like them to implement a common consistent interface (i.e. the same
prototype that my init_l3_partitioning_workarounds() implements), or
would you like the variant for each gen to implement an ad-hoc interface
according to the partition configs actually needed on each gen? I
suspect the former would be cleaner.
>> +static int init_l3_partitioning_workarounds(struct intel_engine_cs *ring,
>> + unsigned int n_urb,
>> + unsigned int n_ro,
>> + unsigned int n_dc,
>> + unsigned int n_all)
>> +{
>> + struct drm_device *dev = ring->dev;
>> + struct drm_i915_private *dev_priv = dev->dev_private;
>> +
>> + if (INTEL_INFO(dev)->gen >= 8) {
>
> Why use dev here? You already have dev_priv, so why chase the pointer
> again?
Sorry? Does INTEL_INFO() take a drm_device or a drm_i915_private
pointer as argument? The two types don't seem to be related by an
inheritance relationship or anything similar AFAICT, and most other uses
in this file seem to pass a drm_device as argument even where a
drm_i915_private is available.
> -Chris
>
> --
> Chris Wilson, Intel Open Source Technology Centre
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 212 bytes --]
[-- Attachment #2: Type: text/plain, Size: 159 bytes --]
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2015-10-07 13:31 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-07 11:44 [PATCH 1/6] drm/i915: Implement L3 partitioning set-up from the workaround list Francisco Jerez
2015-10-07 11:44 ` [PATCH 2/6] drm/i915: Don't warn if the workaround list is empty Francisco Jerez
2015-10-07 14:37 ` Daniel Vetter
2015-10-07 11:44 ` [PATCH 3/6] drm/i915: Hook up ring workaround writes at context creation time on Gen6-7 Francisco Jerez
2015-10-07 14:38 ` Daniel Vetter
2015-10-07 11:44 ` [PATCH 4/6] drm/i915: Program the L3 configuration to hardware defaults on context init Francisco Jerez
2015-10-07 11:44 ` [PATCH 5/6] drm/i915/hsw: Move L3 atomics workaround to the workaround list Francisco Jerez
2015-10-07 11:44 ` [PATCH 6/6] drm/i915/vlv: Remove WaIncreaseL3CreditsForVLVB0 from init_clock_gating Francisco Jerez
2015-10-07 12:42 ` [PATCH 1/6] drm/i915: Implement L3 partitioning set-up from the workaround list Chris Wilson
2015-10-07 13:30 ` Francisco Jerez [this message]
2015-10-08 9:17 ` 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=87wpuyiz5w.fsf@riseup.net \
--to=currojerez@riseup.net \
--cc=chris@chris-wilson.co.uk \
--cc=intel-gfx@lists.freedesktop.org \
/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