Re: Color support for wsfb/Amiga
David Brownlee <[email protected]> Thu, 23 Jun 2022 11:00:47 +0100
| Newsgroups | gmane.os.netbsd.ports.luna68k,gmane.os.netbsd.devel.x11,gmane.os.netbsd.ports.amiga |
|---|---|
| Message-ID | <CAGN_6pZe0Tb6yH9qvxhfBaM34NkZVuddD=aYuQPO0P-H0pq2Cg@mail.gmail.com> |
On Thu, 23 Jun 2022 at 07:05, Rin Okuyama <[email protected]> wrote: > > (CC added to port-luna68k) > > On 2022/06/23 1:26, Jukka Andberg wrote: > > The wsfb driver has been working only in monochrome with Amiga > > native graphics mode due to the driver not supporting the Amiga's > > planar video memory format. > > > > But actually I found out that there is a c2p routine [1] included > > with xorg-server that works with shadowfb to convert the pixels into Amiga > > planar format. Enabling it for 8-bit depth looks pretty simple. In > > practice with this we could get 256 color mode on AGA chipsets. > > > > For other depths I didn't have much success so it is still > > monochrome for non-AGA. Performance is also not that great, but it > > is somewhat usable. > > > > Patch attached. Any thoughts before I commit? Nice find! :) > > [1] http://cvsweb.netbsd.org/bsdweb.cgi/xsrc/external/mit/xorg-server/dist/miext/shadow/shafb8.c > > > > P.S. With these wsfb changes the fake 1 bit depth hack can be removed > > from kernel side. Is it reasonable to leave it in as a compat for older X servers? > Excellent! It works just fine on my A1200: > > https://twitter.com/LabDrunker/status/1539847364730822656 > > It would be great if we can support color X server on luna68k, which > also has "planer" framebuffer. > > A minor concern: With your patch, WSDISPLAYIO_GTYPE ioctl becomes > mandatory even if the driver supports WSDISPLAYIO_GET_FBINFO. But, > we can probably find broken drivers during beta test for netbsd-10, > if such a driver is actually present/used ;) I'm almost certain that every driver that supports WSDISPLAYIO_GET_FBINFO also supports WSDISPLAYIO_GTYPE - I had a pass through last Christmas when I was poking at the TURBOchannel X server for pmax/alpha/vax. It might be worth using another wsdisplayio_fbinfo.fbi_flags bit https://nxr.netbsd.org/xref/src/sys/dev/wscons/wsconsio.h#681 to represent planarAfb, rather than checking WSDISPLAY_TYPE_AMIGACC (but even it it was, that doesn't block this commit in any way). Actually it would have been nice if wsdisplayio_fbinfo had wstype, but it's probably not worth versioning it for that alone :) David