Subject: Re: Video sync problems
To: Markus Baeurle <emw4maba@gp.fht-esslingen.de>
From: Jasper Wallace <jasper@staff.argonet.co.uk>
List: port-arm32
Date: 11/05/1998 13:39:17
On Wed, 4 Nov 1998, Markus Baeurle wrote:

> Hi folks!
> 
> I'm wondering if RiscBSD is treating the separate/common sync issue
> differently than RISC OS.
> The story goes like this:
> Recently, I bought a cheap PC, mainly to run FreeBSD on it (and to play
> games too :-) ).
> I tried to connect it to the second input of the monitor, a 4-plug BNC.
> This doesn't work because the PC won't output composite sync as needed by
> the BNC input, the screen will always rotate thorugh vertically.
> 
> So I swapped the two computers. PC works fine now because the other
> connector on the monitor, a 9-pin D-Sub, has separate sync lines.
> For the Risc PC I looked up the pin assignment in the Welcome Guide
> (IIRC). It says that you should feed back HSync from pin 13 to pin 11
> (Monitor ID 0) to tell the computer to output CSync on the VSync line (pin
> 14). I did so and it works well for RISC OS, no difference to a connection
> on the D-Sub input.
> But in RiscBSD, the screen rotates through vertically because the monitor
> can't lock on the vertical sync! Even if I turn the vhold adjuster on
> the monitor, the screen still won't lock. My self-compiled kernel has the
> same mode compiled in that I'm using in RISC OS. And I tried an install
> kernel too - same result.
> 
> Questions:
> How is the switching between separate and common sync done by the Risc PC?
> I would assume it's hardware but I`m not so sure because there is a bit in
> the VIDC control register to control this. (I only have a datasheet for
> the old VIDC but I don't think it was dropped in the VIDC20.)
> Maybe RISC OS checks pin 11 of the VGA connector and sets the bit in the
> VIDC control register accordingly? Would seem like a strange way to me,
> though. Can somebody with a tech manual please look where pin 11 on the
> VGA connector is going?
> If so, maybe RiscBSD doesn't do this?
> What would be a good place to set this bit from the RiscBSD kernel? I
> could hardwire this in my custom kernels.

I had exactly the same problem, i fixed it by commenting out the bits of
code in NetBSD that change screen mode so it uses whatever mode you where
in when you where in Risc OS. You need to make sure the the monitor
defination file you are using under Risc OS and NetBSD are the same
otherwise the console can get a bit confused as to where the cursor should
go.

I don't have the patch with me, but in:

src/sys/arch/arm32/vidc/console/vidc.c

try commenting out line 151 (this is from -current on ftp.netbsd.org)

*** vidc.c      Thu Nov  5 12:38:27 1998
--- vidc.c~     Thu Nov  5 12:37:16 1998
***************
*** 148,154 ****
  
        for ( counter=INITVALUE; counter<= sizeof(struct vidc_state);
counter++ ) {
                if ( reg==tab[counter] ) {
!                       /*WriteWord ( VIDC_BASE, reg | value );*/
                        current[counter] = value;
                        return 0;
                }
--- 148,154 ----
  
        for ( counter=INITVALUE; counter<= sizeof(struct vidc_state);
counter++ ) {
                if ( reg==tab[counter] ) {
!                       WriteWord ( VIDC_BASE, reg | value );
                        current[counter] = value;
                        return 0;
                }


This is crude, but it might just work...

> Does anybody have another hypothesis why I`m getting a stable picture in
> RISC OS but not in RiscBSD?



-- 
Jasper Wallace                                Argo Interactive Group PLC
+44 (0)1243 815815                                 Unix Systems support,
+44 (0)411  264753                       Integration and Administration.