linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marcin Slusarz <marcin.slusarz@gmail.com>
To: Dave Airlie <airlied@redhat.com>
Cc: linux-fbdev@vger.kernel.org, nouveau@lists.freedesktop.org,
	LKML <linux-kernel@vger.kernel.org>,
	dri-devel <dri-devel@lists.freedesktop.org>,
	Peter Jones <pjones@redhat.com>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH 1/3] fbmem: fix aperture overlapping check
Date: Mon, 12 Apr 2010 21:33:27 +0000	[thread overview]
Message-ID: <20100412213327.GA4463@joi.lan> (raw)
In-Reply-To: <1271104101.5726.3.camel@t60prh>

On Tue, Apr 13, 2010 at 06:28:21AM +1000, Dave Airlie wrote:
> On Mon, 2010-04-12 at 13:34 +0200, Marcin Slusarz wrote:
> > On Mon, Apr 12, 2010 at 09:54:28AM +1000, Dave Airlie wrote:
> > > On Sat, 2010-04-10 at 21:55 +0200, marcin.slusarz@gmail.com wrote:
> > > > fb_do_apertures_overlap is returning wrong value when one aperture
> > > > is completely whithin the other. Add generic ranges_overlap macro
> > > > (probably kernel.h candidate) and use it here.
> > > > 
> > > 
> > > That doesn't seem right.
> > > 
> > > The rules are:
> > > 
> > > the generic aperture has to be equal or smaller than the hw aperture,
> > > otherwise the generic driver will be trashing random hw pieces on the
> > > machine.
> 
> > Why "it has to"? Why generic aperture can't start one byte before hw?
> 
> Think about how it works a bit more, the answer is obvious.
> 
> The hw aperture is defined by the actual hardware, not by the OS or my
> code. The PCI apertures are well defined. Now for a generic driver like
> vesa or offb to access the hardware it needs to access the hw apertures.
> 
> It can't go accessing one byte before the hw aperture, as that will
> crash the machine, or write to some other devices hw.

Ok, thanks for explanation. I'll drop this patch and rebase the others.

> > > So with that in mind, the check makes sure the generic aperture starts
> > > somewhere inside the hw aperture, which the test clearly gets right.
> > 
> > So your only objection is that it's impossible with the current code?
> > 
> > > Have you got a pointer to a machine where it fails?
> > 
> > No, it failed with an artifical test while I was working on vga16fb handoff
> > (unfinished).
> 
> You won't be able to make this work for vga16fb from what I can see
> since it access 0xa000 directly, not via any of the defined apertures
> that vesafb/offb use. vga16fb will need a different approach I suspect.

Yeah, there's an idea to claim 0xa0000 as an aperture of vga16fb and then
do the same in KMS driver but only if it's the primary card. 
(You hinted to use SHADOW resource bit to check whether card is primary)
I think I'll try this approach soon.

Marcin


  reply	other threads:[~2010-04-12 21:33 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-10 19:55 [PATCH 1/3] fbmem: fix aperture overlapping check marcin.slusarz
2010-04-10 19:55 ` [PATCH 2/3] fbdev: allow passing more than one aperture for handoff marcin.slusarz
2010-04-10 19:55 ` [PATCH 3/3] fbmem, drm/nouveau: kick firmware framebuffers as soon as possible marcin.slusarz
2010-04-11 17:09   ` [PATCH 3/3] fbmem, drm/nouveau: kick firmware framebuffers as Marcin Slusarz
2010-04-11 23:54 ` [PATCH 1/3] fbmem: fix aperture overlapping check Dave Airlie
2010-04-12 11:34   ` Marcin Slusarz
2010-04-12 20:28     ` Dave Airlie
2010-04-12 21:33       ` Marcin Slusarz [this message]
2010-04-12 22:32         ` Dave Airlie
2010-04-13 19:50         ` [PATCH] vga16fb, drm/nouveau: vga16fb->nouveau handoff Marcin Slusarz
2010-04-18 21:57           ` [PATCH] vga16fb, drm: vga16fb->drm handoff Marcin Slusarz
2010-04-19 16:20             ` James Simmons
2010-04-20 19:54               ` Marcin Slusarz

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=20100412213327.GA4463@joi.lan \
    --to=marcin.slusarz@gmail.com \
    --cc=airlied@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nouveau@lists.freedesktop.org \
    --cc=pjones@redhat.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).