Re: X vesa driver distorted display on startup

2022-07-27 Thread Matthieu Herrb
On Tue, Jul 26, 2022 at 11:51:31PM +, Bill Chatfield wrote:

> Thank you so much. That is just the kind of information I needed to
> get me started. Yeah, it would be a fun project just for my own
> personal interest and education. I can understand you wouldn't want
> to make the kernel bigger for basically a one-off piece of old
> hardware. :-) If I can do this or something similar, maybe it'll
> teach me how to implement something that would be more useful to the
> whole community.

Back in 2015 I mentored a Google Summer of Code student on a similar
project for the Cirrus graphics cards (interesting because available
in qemu).

The code was almost finished but somehow he lost interest after the
initial GSoC period and for various reasons thw work never got merged.
It's still on-line : 
https://lab.knightsofnii.com/kristaba/openbsd (check the
cirrusdrm-current branch)

He also started some documentation on the internals there : 
http://lab.knightsofnii.com/kristaba/openbsd-drm-howto.git

*warning* : all this is 7 years old so a lot have changed in the Linux
DRM code since then and merging this code in -current is probably
more work than starting over.
-- 
Matthieu Herrb



Re: X vesa driver distorted display on startup

2022-07-26 Thread Matthieu Herrb
On Tue, Jul 26, 2022 at 04:22:46PM +, Bill Chatfield wrote:
> I apologize if this is a stupid question, but would it be possible
> to write a new driver for the i810 that works with drm/dri? I would
> be interested in giving it a try. I don't know what the blockers
> might be though. I know a GPU driver is really hard, but I believe I
> could figure it out. There's a lot of code I could reference. 
> 

Hi,

You'd need to write a *kernel* driver that presents a minimal drm/kms
interface to userland so that the modesetting X driver can be used.
the rkdrm(4) driver is an example of such a driver, although it
doesn't do any video mode management (it only uses the available mode
from the boot loader)

Another approach would be to write a bit-mapped wsdisplay(4) kernel
driver in order to use the wsfb X driver.

In both cases you need to be able to switch the i810 to graphics mode,
probe the output for supported frequencies and handle the resolution
in terms of VESA modes and present the framebuffer as a linear array
of pixels to the kernel. drm/kms offers more flexibility than
wsdisplay if you want to support a wide range of outputs (dual
monitors,... )

That said, I think the reason that it stopped working at some point
with Mesa and Linux DRM drivers is that i810 was a strange beast and
getting these simple functions to work may require some work. At some
point I had 2 machines with different variants of i810 and they each
had their own set of bugs / mis-features.

Also I think this one of the reason why the vesa X driver doesn't work
too well (or at all) on these GPUs, it may be that the BIOS vendor
didn't bother to support anything but text modes correctly. (the vesa
driver relies on the card's BIOS (well the motherboard BIOS in the
i810 case) to do all the modes management I mentionned above).

And I'm not sure there is interest to make the OpenBSD grow by some kB
to support those ancient cards. But it can be a fun project.
-- 
Matthieu Herrb



Re: X vesa driver distorted display on startup

2022-07-26 Thread Jonathan Gray
On Tue, Jul 26, 2022 at 04:08:17AM +, Bill Chatfield wrote:
> You can consider this request canceled. I doubt it's going to get picked up 
> by anybody. I can understand that support for a 22 year old graphics card is 
> not a priority. But, I like OpenBSD so much I'm going to install it on a more 
> modern laptop. I find it to be better organized that Linux and friendlier 
> that other BSDs.

i810 is a special case.  Too old for inteldrm.  Not sure why it doesn't
work with vesa.  A PCI video card should be less trouble if you have one.

> 
> 
> 
>  On Monday, July 25, 2022, 03:51:14 AM EDT, Bill Chatfield 
>  wrote: 
> 
> >Synopsis:     >display on startup>
> >Category:    
> >Environment:
>     System  : OpenBSD 7.1
>     Details : OpenBSD 7.1 (GENERIC) #151: Mon Apr 11 18:57:52 MDT 2022
>              dera...@i386.openbsd.org:/usr/src/sys/arch/i386/compile/GENERIC
> 
>     Architecture: OpenBSD.i386
>     Machine : i386
> 
>