Subject: Re: Does Xsun24 work?
To: der Mouse <mouse@Rodents.Montreal.QC.CA>
From: David C. Myers <myers@iname.com>
List: port-sparc
Date: 01/02/2000 21:11:03
> Um, then something is wrong with either your debugging printfs or the
> way you've hooked into the VM machinery; note that the mmap() call is
> done on fd 6, the fd returned for /dev/fb - check into how your driver
> handles mmap.



Hmm.  I'll take that as an endorsement that Xsun24 actually does work...

Here's pllxmmap():


int pllxmmap(dev, off, prot)
     dev_t dev;
     int off, prot;
{
    struct pllx_softc *sc = pllx_cd.cd_devs[minor(dev)];
    bus_space_handle_t bh;

    printf("pllxmmap(): offset = %d\n", off);

    if (off & PGOFSET)
	panic("pllxmmap");

    if (off < 0)
	return (-1);

    if (bus_space_mmap(sc->sc_bustag,
		       sc->sc_btype,
		       sc->sc_paddr + off,
		       BUS_SPACE_MAP_LINEAR, &bh))
	return (-1);
    
    return ((int) bh);
}


As I said, it's mostly cribbed from p9100.c and cgfourteen.c.  And I may
well be doing some things wrong, but if Xsun24 is calling my mmap
routine, that printf should get executed.  It doesn't.

dmesg shows the device attached to /dev/fb:

   pllx0 at sbus0 slot 1 offset 0x40000 level 5: Parallax tvtwo, 1152 x
900
   pllx0: attached to /dev/fb

(And note that I didn't write the bit about "attached to /dev/fb" -- the
existing fb code picked up pllx0 properly.)  So I assume this means my
driver is being called when /dev/fb is opened.  What sort of scenario
would lead to my open, close, and ioctl routines being properly wired
in, but my mmap routine failing to be called?

Many thanks for responding; I assume I'm doing something dumb, but can't
see what it is.

-David.