Page 1 of 2

PCI Express video

Posted: Sun Feb 16, 2020 12:50 pm
by Ruptor
There has been some discussion of using PCI but what about using a PCI express connector or interface so the internal ram based video can be eliminated and a bottom end PCI video card used instead. The QL CPU could write to a high speed serial line like a one line PCI express connection instead of writing to ram and the video card solves all the external video connection problems. In theory and hardware wise it doesn't seem very difficult but I suppose not all the information is readily available for the Express video cards on what instructions they need to write to pixels so the QL position could be translated.

Re: PCI Express video

Posted: Sun Feb 16, 2020 9:41 pm
by Nasta
Ruptor wrote:There has been some discussion of using PCI but what about using a PCI express connector or interface so the internal ram based video can be eliminated and a bottom end PCI video card used instead. The QL CPU could write to a high speed serial line like a one line PCI express connection instead of writing to ram and the video card solves all the external video connection problems. In theory and hardware wise it doesn't seem very difficult but I suppose not all the information is readily available for the Express video cards on what instructions they need to write to pixels so the QL position could be translated.
There is a whole lot of wishful thinking type assumptions here.
First of all, the QL treats graphics as a bitmap at some RAM address. The OS does not care exactly where this is located, but the takeaway idea here is that either way, this bitmap, with a size dependent on resolution and bits per pixel, MUST be mapped somewhere in the CPUs memory map, which also means the size of the CPU memory map must have enough space for it. You can't map 4M of video RAM to the bus of a CPU that has a total addressing range of 1M.
Secondly, 'the CPU should be able to write to a fast serial bus' contains about 12 steps of sophisticated hardware and software steps in that sentence. PCIX serial communication is NOT at all simple, it's a fairly high level protocol, and for homework, look up the speed at which a single PCIX lane operates. It's not as simple as 'writing data' - the serial line contains data, address and control information as well as response to it, according to a fairly complex protocol and hardware structure. It is FAR more complex than the simple 68k bus, not to mention it operates at frequencies that are a couple of orders of magnitude higher.
Thirdly, the actual data structure IS known at least for the regular VGA, though it's anything but simple. In the end, it has to again look to the OS as a flat packed bitmap. Even using a simple old SVGA chip requires a LOT of footwork until you can get to that point. Most of the stuff the driver has to do in setting up the chip is to actually avoid old PC related concepts on how to get to a bitmap through a 16k sized window, which would make all existing drivers and most software on the QL unusable.
Sooo it all looks simple and it certainly should be possible, so why not explore what is involved and learn, and tell the rest of us how it could be done step by step, rather than just saying 'it should be possible' for someone else to do the huge amount of work, and waiting for it to be done. We do need people who can pore over the large amount of literature and separate the wheat from the chaff so when the job actually has to be done, it can be done simpler, and faster.

Re: PCI Express video

Posted: Mon Feb 17, 2020 9:17 am
by Dave
GAME OVER

Would you like to play a different game?


Ok, I know that was harsh, but as someone who has spent seven years trying to develop a video card, and not yet matching Nasta's Aurora, I think that I am not definitely qualified to answer this, but I know who is.

If Nasta says you're smoking crack, you're smoking crack.

No PC card is going to fit this task. Even if it was a physical match, it's not a logical match. That's the end of it.

I banged my head against the wall with a different chipset that was physically capable, but there still would need to be a non-obvious FPGA to do the translation. Nasta said this on day one but I did not listen!

It was game over for me too. :P

PCI Express or Pi zero QL replacement possibly

Posted: Mon Feb 17, 2020 1:01 pm
by Ruptor
Dave wrote:GAME OVER Would you like to play a different game?
I don't like games I like progress. :) At the moment I have a dead QL and looking for an easy alternative to either a fix or replacement. I assume everybody has been through everything I am likely to think of and dissuade me from stupid thoughts but I like to think up things without other people guiding my thoughts.
Dave wrote:I banged my head against the wall with a different chipset that was physically capable, but there still would need to be a non-obvious FPGA to do the translation. Nasta said this on day one but I did not listen!
My view was that the serial interface just required a couple of differential drivers for transmit and receive and maybe clocked, the video ram would be on the PCI board and the 68008 would update that on each screen write so no bitmap in RAM just like PCs. However my independent view before reading the post by Nasta is that the speed issue of having the 68008 doing the translation in its driver software and then having to send multiple bytes to the PCI serial line would actually be slower than the original so no point in that. :roll: There are many other negative things like PCI cards are all different and soon out of date so not future proof, the power requirements :shock: , size & fitting and lastly the software.
If I want a QL replacement I think my final solution is a Raspberry PI zero set up as a total QL system emulator that gives HDMI, SD and even a USB and costs peanuts requiring no hardware. 8-) A lot of the software is already done even though it runs under an OS but I contemplate not using an OS at this point just have the RPI run as a 68000. Has someone already used an RPI to replace the QL motherboard?

Re: PCI Express video

Posted: Mon Feb 17, 2020 1:05 pm
by tofro
Your requirements seem to fit a Q68 much better than an RPI - Why don't you look into that?

The RPi will only offer uQLX for emulation, which is a pretty old emulator with noone really actually supporting it.

Tobias

Re: PCI Express video

Posted: Mon Feb 17, 2020 2:03 pm
by Pr0f
My musings on this...

I have been thinking about this for some time too, and trying to figure out a way of getting QL video out of an HDMI socket.

There are several hurdles and problems, but some thoughts below:

1) QL screen memory use is a little strange in the layout - so that tends to rule out all but a large CPLD or FPGA to do the video so that compatibility is maintained

2) Access to the screen RAM causes the CPU to have to wait, so keeping screen RAM only for screen would be the ideal, RAM shadowing so that reads are being done from faster RAM and not from the screen would allow some speed gain - so this makes the screen RAM effectively write only as far as the QL processor is concerned.

3) Allowing the writes to video RAM to be interleaved with video generator reading the video RAM - one way I thought this could be done is to write to a set of fast latches (using a voltage translating part gives the possibility to use 5v on the QL side and 3.3V on the video generation side). A flip flop indicating that data is present to read into RAM would avoid wasting cycles writing into video RAM and allow a possible co processor a look in. Also - this flip flop could be used to generate dtack back to the QL - if for some reason the last written byte to the latches was not cleared out by the video generator - the next write would just be delayed by holding off dtack.

4) The video generator would spend alternate cycles reading the video RAM, and would check for data in the latches to write into the video RAM during the other half. Using a fast static RAM would eliminate any refresh worries, and offer something like 12-13ns cycle time for a 10ns part.

5) Further speed improvement and bandwidth increase could be done by using 16 bit video RAM, and allowing the latch side to be accessed upper byte, lower byte or both bytes depending on interface width. This means the video generator would get a full 16 bits per access, which allows for mode 4 and mode 8 to be easily accommodated, and if a 16 bit or 32 bit processor was in use, the writes to video RAM would also be 16 bits.

6) output from the video generator could drive a simple resistor DAC and offer a VGA style connector, or it could drive digital inputs to a DVI/HDMI conversion chip.

7) Mapping QL screen resolutions to video timings that will work with VGA / HDMI monitors, and allowing possible extra resolutions (1024 horizontal) and (512 / 768) vertical and more colours.

8) Using a mechanism like the Aurora where additional video RAM space is provided at the top end of memory and shadowed by normal RAM for read / write will allow for additional resolutions and colour depths - a 256K or 512K RAM could be used but clearly the standard 1Mb QL memory map would not work too well with 512K, and 256K of video RAM is expensive on memory for a stock QL - 4MB card of Dave's is a good way out of that issue ;-)

Re: PCI Express video

Posted: Tue Feb 18, 2020 11:03 am
by Peter
Ruptor wrote:In theory and hardware wise it doesn't seem very difficult but I suppose not all the information is readily available for the Express video cards on what instructions they need to write to pixels so the QL position could be translated.
PCI Express being "not very difficult" hardware-wise is relative. Even in a commercial environment, it requires a high degree of expertise to design an individual solution - and a QL bus coupler would not be something that can just be copied from a reference design. In addition to that, very expensive tools are required to even measure the highspeed signals, and PCI express chips usually come in BGA packages that most of us hobbyists can not solder for prototyping. Even a complete Q68-style video controller with SDRAM is easier to design than a QL-to-PCI express bridge!

Assuming you had a PCI express bridge already, you'd still be far from a solution! The situation could be compared to the Atari clone "Milan" in 1998, which also provided connectivity to PC graphic cards. There were efforts to get native graphics drivers for the "Milan". But even back then, when we had far more QL development manpower and our original QL OS genius still active, those efforts failed. Realistically, the likelyhood of someone writing native QL drivers for a PC graphics card is below 1% today.

Now lets even assume we had both a QL to PCI express bridge and the native driver software: What would be the gain, compared to a direct graphics controller?
Zero. Even less than zero, because there is more software overhead and the classic QL modes would not be there.
Ruptor wrote:If I want a QL replacement I think my final solution is a Raspberry PI zero set up as a total QL system emulator that gives HDMI, SD and even a USB and costs peanuts requiring no hardware. 8-) A lot of the software is already done even though it runs under an OS but I contemplate not using an OS at this point just have the RPI run as a 68000. Has someone already used an RPI to replace the QL motherboard?
The point is: As soon as the emulator doesn't run under an OS, you lose video, SD and USB, because you no longer have easy-to-use drivers! "Bare metal" solutions to make them accessible could be developed, but the effort would be high, and I can not imagine any of the QL emulator authors being interested in such a job.

In the end it comes down to this decision:

Do you want a different OS to be the base of your machine, so you can emulate in software?
Or do you accept the inconvenience & costs to get a piece of native hardware like SGC/Aurora/Q68?

Re: PCI Express video

Posted: Tue Feb 18, 2020 12:22 pm
by Ruptor
Peter wrote:I can not imagine any of the QL emulator authors being interested in such a job.
I am not asking anybody else to do it I am looking at my options and what I might be able to do.
Peter wrote:Do you want a different OS to be the base of your machine, so you can emulate in software?
Maybe what I require is already here. If you boot an RPI as a QL emulator how would you know it was an emulator? It would still require microdrive software to be able to fit it inside a QL box and look like a QL but the software is available off of microdrives anyway.

Re: PCI Express video

Posted: Wed Feb 19, 2020 8:35 am
by Peter
Ruptor wrote:
Peter wrote:Do you want a different OS to be the base of your machine, so you can emulate in software?
Maybe what I require is already here. If you boot an RPI as a QL emulator how would you know it was an emulator?
I know what you mean, and if you are not into native hardware as a philosophy, the tempting aspect of emulation would be the higher speed compared to current affordable hardware solutions (not necessarily future ones).

But again: What you want is definitely not here! A bare-metal Raspberry QL emulator not requiring an ARM OS, but providing USB, video, etc. is a large amount of work, needing expertise. The idea is not new - if it was easy, I'm sure someone would have done it. My recommendation is just to be realistic here. Also I'm not sure what is your motivation? Just so save the price difference between a Q68 and a RPi?

Re: PCI Express video

Posted: Wed Feb 19, 2020 10:58 am
by Peter
tofro wrote:The RPi will only offer uQLX for emulation, which is a pretty old emulator with noone really actually supporting it.
Let alone the fact that Ruptor apparently wants a bare-metal Raspberry behaving like a QL, not a Linux machine. From which even UQLX is miles away.