linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alex Deucher <alexdeucher@gmail.com>
To: Andy Lutomirski <luto@amacapital.net>
Cc: Jerome Glisse <j.glisse@gmail.com>,
	linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 3/7] drm: Update drm_addmap and drm_mmap to use PAT WC instead of MTRRs
Date: Tue, 07 May 2013 14:08:59 +0000	[thread overview]
Message-ID: <CADnq5_OJF5NB8r3Pj5E9VaiBLMTyHtERC4N4X0yYLwXQLqqrmw@mail.gmail.com> (raw)
In-Reply-To: <CALCETrXO7OVxjw5nJ+HrBP7yAoAXk14w1cMbWBC4ZdBmZ6-3JQ@mail.gmail.com>

On Mon, May 6, 2013 at 7:39 PM, Andy Lutomirski <luto@amacapital.net> wrote:
> On Mon, May 6, 2013 at 4:04 PM, Jerome Glisse <j.glisse@gmail.com> wrote:
>> On Mon, May 6, 2013 at 5:22 PM, Andy Lutomirski <luto@amacapital.net> wrote:
>>> On Fri, May 3, 2013 at 4:00 PM, Andy Lutomirski <luto@amacapital.net> wrote:
>>>> Signed-off-by: Andy Lutomirski <luto@amacapital.net>
>>>> ---
>>>>
>>>> This needs careful review.  I don't really know what this code does, nor
>>>> do I have the hardware.  (I don't understand AGP and the associated
>>>> caching implications.)
>>>
>>> This patch is wrong (I didn't update the matching mtrr_del), and I'm
>>> reworking this whole series.  But I may need some help on this one:
>>> why is the mtrr handle of a map (whatever a map is) exported to
>>> userspace via the ADD_MAP and GET_MAP ioctls?  What (if anything) is
>>> userspace supposed to do with it?  Do I need to return a valid MTRR
>>> register number?  Is there any userspace code at all that sets
>>> _DRM_WRITE_COMBINING in DRM_IOCTL_ADD_MAP with appropriate alignment
>>> and needs the MTRR, for which the drm driver doesn't already add the
>>> MTRR?
>>>
>>> --Andy
>>
>> From memory, even on pat system we need mtrr for VRAM is PCI BAR. We
>> cover it with a write combine MTRR. The whole ioctl is use by some ddx
>> or maybe even directly the XServer to do this mtrr mess in userspace.
>
> Egads!  So we have a _DRM_WRITE_COMBINING flag, which will continue to
> work fine, but almost nothing uses it.
>
> I'm amazed this stuff works in the current code, though.  Apparently
> the memory type (WC or UC) of a drm mapping is determined by the mtrr
> the driver set, but if one part of the BAR is textures or the
> framebuffer and another part is an outgoing command ring, won't one of
> them end up with the wrong memory type?

A lot of old chips used to put the registers and framebuffer in the
same BAR.  IIRC, the xserver and later libpciaccess had workarounds to
deal with this.

Alex

  parent reply	other threads:[~2013-05-07 14:08 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-03 23:00 [PATCH 0/7] Clean up write-combining MTRR addition Andy Lutomirski
2013-05-03 23:00 ` [PATCH 1/7] x86: Add mtrr_{add,del}_wc_if_needed Andy Lutomirski
2013-05-03 23:00 ` [PATCH 2/7] drm (ast,cirrus,mgag200,nouveau,savage,vmwgfx): Rework drm_mtrr_{add,del} Andy Lutomirski
2013-05-04 17:45   ` [PATCH 2/7] drm (ast, cirrus, mgag200, nouveau, savage, vmwgfx): Rework drm_mtrr_{add, del} Daniel Vetter
2013-05-04 17:48     ` Andy Lutomirski
2013-05-03 23:00 ` [PATCH 3/7] drm: Update drm_addmap and drm_mmap to use PAT WC instead of MTRRs Andy Lutomirski
2013-05-06 21:22   ` Andy Lutomirski
2013-05-06 23:04     ` Jerome Glisse
2013-05-06 23:39       ` Andy Lutomirski
2013-05-07  3:09         ` Dave Airlie
2013-05-07 14:08         ` Alex Deucher [this message]
2013-05-07 16:45           ` Andy Lutomirski
2013-05-03 23:00 ` [PATCH 4/7] drm: Use drm_mtrr_add_wc for the AGP aperture Andy Lutomirski
2013-05-03 23:00 ` [PATCH 5/7] i915: Use drm_mtrr_{add,del}_wc Andy Lutomirski
2013-05-03 23:00 ` [PATCH 6/7] radeon: Switch to drm_mtrr_add_wc and add a missing drm_mtrr_del_wc Andy Lutomirski
2013-05-03 23:00 ` [PATCH 7/7] uvesafb: Clean up MTRR code Andy Lutomirski

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=CADnq5_OJF5NB8r3Pj5E9VaiBLMTyHtERC4N4X0yYLwXQLqqrmw@mail.gmail.com \
    --to=alexdeucher@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=j.glisse@gmail.com \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@amacapital.net \
    /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).