Re: wdisplay pixel format

2011-09-16 Thread Martin Husemann
On Thu, Sep 15, 2011 at 09:20:56PM -0400, Michael wrote:
 So, most wsdisplay drivers will hand you an 8bit colour-indexed framebuffer, 
 if you get higher colour depth it will be RGB unless you're on a Sun or SGI.

Aren't the mmap() details inherently MD anyway?
Though we should have some query ioctls to get at least basic infos...

Martin


Re: wdisplay pixel format

2011-09-16 Thread Izumi Tsutsui
 We do, and that's how the xf86-video-wsfb driver works.

I had to fix wsfb driver for 1bpp framebuffer
http://mail-index.NetBSD.org/source-changes/2011/07/22/msg024891.html

and I still wonder what is a generic format of 4bpp framebuffers
that common dix part expects...

---
Izumi Tsutsui


Re: wdisplay pixel format

2011-09-16 Thread Martin Husemann
On Fri, Sep 16, 2011 at 08:10:35AM -0400, Michael wrote:
 We do, and that's how the xf86-video-wsfb driver works.

And why does that not include the pixel format?

Martin


wdisplay pixel format

2011-09-15 Thread Frank Zerangue
I am implementing a device driver using wscons for my display device.

Does anyone know how a user land program that opens the device (such as X11) 
will know what the pixel format will be for the frame buffer?

I  see there is an ioctl tag WSDISPLAYIO_GTYPE to get display type, 
WSDISPLAYIO_GINFO to get frame buffer metrics height, width, depth, cmsize, and 
WSDISPLAYIO_LINEBYTES to get the stride. But how does the program that opens 
the device know the pixel format?

I can seem to find this documented anywhere, nor can I find any code to discern 
this from.

--
Frank Zerangue
frank.zeran...@gmail.com





Re: wdisplay pixel format

2011-09-15 Thread Michael
Hello,

On Thu, 15 Sep 2011 19:05:47 -0500
Frank Zerangue frank.zeran...@gmail.com wrote:

 I am implementing a device driver using wscons for my display device.
 
 Does anyone know how a user land program that opens the device (such as X11) 
 will know what the pixel format will be for the frame buffer?
 
 I  see there is an ioctl tag WSDISPLAYIO_GTYPE to get display type, 
 WSDISPLAYIO_GINFO to get frame buffer metrics height, width, depth, cmsize, 
 and WSDISPLAYIO_LINEBYTES to get the stride. But how does the program that 
 opens the device know the pixel format?

You'll have to guess:
- anything in 8 bit or less is colour indexed
- anything 16 bit is either (extremely likely) RGB565 or (I know of no 
wsdisplay driver using this format) RGB555
- anything 24 or 32bit is RGB888 or XRGB on most hardware. Exceptions are:
   - SBus and UPA framebuffers tend to run in XBGR ( AG-10e is an exception 
but that's really a glint behind and sbus-pci bridge )
   - SGI graphics hardware may use RGBX but things are more complicated 
there anyway, in most cases you won't be able to map the framebuffer anyway or 
what you'll get may not be linear
   - some Sun firmware likes to initialize 24bit modes as BGR even on PCI 
hardware but we run in 8 bit on all of these and you have to jump through some 
extra hoops to get there
So, most wsdisplay drivers will hand you an 8bit colour-indexed framebuffer, if 
you get higher colour depth it will be RGB unless you're on a Sun or SGI.

have fun
Michael