intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Paulo Zanoni <przanoni@gmail.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: flush system agent TLBs on SNB so we can WC map the PTEs
Date: Tue, 16 Oct 2012 21:50:49 +0200	[thread overview]
Message-ID: <CAKMK7uHWPLTfymVpfQQWFzNOoh1yRuwbk6ghWoZMKDxWh21Dsg@mail.gmail.com> (raw)
In-Reply-To: <CA+gsUGThMEXBLCJ01y+0xThwph+nqqSqaO0kv90SoroNhd4_UQ@mail.gmail.com>

On Tue, Oct 16, 2012 at 9:11 PM, Paulo Zanoni <przanoni@gmail.com> wrote:
> 2012/10/11 Jesse Barnes <jbarnes@virtuousgeek.org>:
>> I've only lightly tested this so far, but the corruption seems to be
>> gone if I write the GFX_FLSH_CNTL reg after binding an object.  This
>> register should control the TLB for the system agent, which is what CPU
>> mapped objects will go through.
>>
>> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
>>
>> diff --git a/drivers/char/agp/intel-agp.h b/drivers/char/agp/intel-agp.h
>> index 6ec0fff..95f0d4d 100644
>> --- a/drivers/char/agp/intel-agp.h
>> +++ b/drivers/char/agp/intel-agp.h
>> @@ -99,6 +99,9 @@
>>  #define GFX_FLSH_CNTL          0x2170 /* 915+ */
>>  #define GFX_FLSH_CNTL_VLV      0x101008
>>
>> +#define GFX_FLSH_CNTL          0x101008
>> +#define   GFX_FLSH_CNTL_EN     (1<<0)
>
> Notice that there's a redefinition of GFX_FLSH_CNTL with a different
> value just 3 lines above. We're probably fixing gen6+ and breaking
> gen5-

Yeah, Jesse needs to fix up this patch (or me, since it'll conflict
anyway with -fixes, so I need a backmerge first).

> We write 0 to this reg in some places, but I believe that shouldn't matter.

This is one of the magic registers we have: Read always returns 0, it
doesn't matter what you write into it, but something special happens
as a side-effect of writing to it. In this case we flush the cpu gtt
tlb. We have a few others of this kind.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

  reply	other threads:[~2012-10-16 19:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-11 17:32 [PATCH] drm/i915: flush system agent TLBs on SNB so we can WC map the PTEs Jesse Barnes
2012-10-11 23:29 ` Paulo Zanoni
2012-10-11 23:54   ` Jesse Barnes
2012-10-12  7:54     ` Dave Airlie
2012-10-12  8:18       ` Daniel Vetter
2012-10-12 17:21         ` Paulo Zanoni
2012-10-16 19:11 ` Paulo Zanoni
2012-10-16 19:50   ` Daniel Vetter [this message]
2012-10-22 12:46 ` Daniel Vetter

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=CAKMK7uHWPLTfymVpfQQWFzNOoh1yRuwbk6ghWoZMKDxWh21Dsg@mail.gmail.com \
    --to=daniel@ffwll.ch \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=przanoni@gmail.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;
as well as URLs for NNTP newsgroup(s).