Oky… For the video in 6.3, I made it finally work… It was not as
simple, Nothing to do with 2 video card, the 2 radeon 7500 (AGP+PCI)
never show nothing with the configuration file, but a Nvidia GF2 MX400
AGP + a radeon 7500 PCI almost work; It’s crash the whole system after
resizing a window… So I decide to try with a RAdeon Dual-Head, one of
the supported dual-head in 6.3… and it’s work fisrt try. I’m happy with
that…
But now I must use QNX6.3 to make work the dualhead videocard, I have
to make work my Pci card on 6.3. Anyway, I prefer to use 6.3 for the
imprevement in hardware support and to don’t have many systems with
different versions.
I’ll paste here a part of my Init code, may be someone will see
something…
======================================================================
struct plx9054_info {
// PCI structure
struct pci_dev_info pinfo; /* Structure that contains all
information about the PCI board.*/
// Memory info
uint32_t dma_start_addr[NUM_DMAREGION]; / Shared memory region
for DMA and Dsp
Burst*/
uint32_t dsp_dma_size[NUM_DMAREGION];
off64_t dma_start_physaddr[NUM_DMAREGION]; /* Physical Address
of shared memory
used by the
hardware for DMA
or Burst
transfers */
uint32_t dsp_mapped_addr; / PCI Mapped address to access
DSP memory (by single
read/write /
uint32_t plx_mapped_addr; / PCI mapped address to access
PLX configuration
registers./
// Related with PCI Interrupt…
struct sigevent plx_int_event ; /* Event Signal for PCI
Interrupt (Only used
internally by the library) /
int irq_id; / (Only used internally by the library) */
};
…
board_init(uint32_t dev_id, uint8_t rev_id,
struct plx9054_info *plxinfo)
{
void *hdl;
uint32_t temp, i;
if ((temp=pci_attach(0)) < 0) {
fprintf(stderr, “Failed to access PCI Server!:”
" [%s:%d]\n",FUNCTION, LINE);
exit(EXIT_FAILURE);
}
plxinfo->pinfo.VendorId = PLX_VENDOR_ID;
if (dev_id == NULL)
plxinfo->pinfo.DeviceId = PCI_DEVICE_ID;
else
plxinfo->pinfo.DeviceId = dev_id;
for (i=0; i<6; i++) {
if ((hdl = pci_attach_device(NULL, 0, i, &plxinfo->pinfo)) == NULL) {
fprintf(stderr,
“Can not attach PCI dsp board to PCI server!:”
" [%s:%d]\n",FUNCTION, LINE);
exit(EXIT_FAILURE);
}
if (plxinfo->pinfo.Revision == rev_id) {
fprintf(stderr, “rev_id: %d, plxinfo->pinfo.Revision: %d\n”,
rev_id, plxinfo->pinfo.Revision);
if ((pci_attach_device(hdl, PCI_INIT_IRQ |
PCI_INIT_BASE0 |
PCI_INIT_BASE2,
i, &plxinfo->pinfo)) == NULL) {
fprintf(stderr,
“Can not attach PCI dsp board to PCI server!:”
" [%s:%d]\n",FUNCTION, LINE);
exit(EXIT_FAILURE);
}
goto GOT_REV_ID ;
}
}
return -1 ;
GOT_REV_ID:
/* register to kernel DMA memory region (DMA-safe memory)/
for(i=0; i<NUM_DMAREGION; i++){
if (plxinfo->dsp_dma_size _== NULL){
fprintf(stderr, "Warning, the DMA region number %d is "
“not mapped you cannot use Dsp Master "
“DMA transfer for that region.\n”,i);
} else if (dma_register_region(plxinfo, i) < 0) {
dma_unregister_region(plxinfo, i);
fprintf(stderr, “Problem with DMA region registration:”
" [%s:%d]\n”,FUNCTION, LINE);
exit(EXIT_FAILURE);
}
}
…
…
/ initializes the DSP module /
board_memmap(plxinfo); / use mmap_device_memory() to
- map the Pci board Memory.
/
…
…
return 0;
}
/
- this routine registers (pins) a certain amount of memory DMA and
- Burst transfers
/
static int
dma_register_region(struct plx9054_info plxinfo, uint32_t region_number)
{
size_t contig_len;
/ maps DMA region /
/********************************************************************
- Here, I use “region_number 0” for DMA transfers controled by the PLX
- chip and “region_number 1” for the DSP Burst. if you refer the my
- Original post. DMA work, Bust doesn’t work.
**********************************************************************/
plxinfo->dma_start_addr[region_number] =
(uint32_t *)mmap64(0, plxinfo->dsp_dma_size[region_number],
PROT_READ | PROT_WRITE | PROT_NOCACHE,
MAP_PHYS | MAP_ANON | MAP_NOX64K, NOFD, 0);
if (plxinfo->dma_start_addr[region_number] == MAP_FAILED) {
perror(“DMA registration procedure failed”);
return -1;
} else {
if (mem_offset64((uint32_t *)plxinfo->dma_start_addr[region_number],
NOFD, 4,
&plxinfo->dma_start_physaddr[region_number],
&contig_len) < 0) {
perror(“DMA virtual start addr to phys. addr. failed”);
return -1;
}
}
return 0;
}
======================================================================
On 2005-11-22, Martin Gagnon <martin@yanos.org> wrote:_
_Hi again…
My pci board still does’nt work on QNX6.3… So I’ve decide to give-up
and use QNX6.21 instead for that project. But now I have another problem
related with 6.21… Configuration of 2 videocard…
Now I’m stuck with 6.21… with no real (documented) support for 2
videocard. As the oposite with 6.3 with the new ‘-c’ for io-graphics
that permit to use a configuration file. (with differents examples in
the help.)
So I have to choice… Continue to try to make work our Pci card on 6.3
or try to make work the 2 videocard on 6.21. For sure I’d like to move
completely to 6.3 but for now… I’m looking for a fast solution because
the deadline become closer.
My setup:
Normal PC: P4, ASUS P4P800X mother board, 2 ATI Radeon 7500 videocard
(one AGP, the other PCI).
With 6.21 and the 2 videocard… I’ve make work partially and I got
stange behavior. I got similar result if I load the second one myself
after photon is load and when I try to load it from the rc.local with an
automatic login etc… To do so, I use io-graphics with “-I1” + the
option “-o1280” to give a X offset of 1280. The command with parameters
look like that:
\
/usr/photon/bin/io-graphics -g1280x1024x32 -o1280, -dldevg-radeon.so
-I1 -d0x1002,0x5159
It’s the same line that is use for the first card… exept it’s “-I0”
instead of “-I1” and there’s no “-o1280”.
After I type that line once… nothing happens… if I do it again… it’s
seems to work… the second monitor goes on and display the right things…
Now, after I tried it more… the fist video work strangely… i.e. My
program have a PtRaw with some graphics drawing, with a lot of thing
around (buttons, text field etc…) The drawing does not appear on it. I
see the window normally with the buttons, text etc… but the rectangle
where is supposed to have the drawing don’t work… If I move another
window over it… the part of the window that was over the Pt_Raw stay
drawn… In the second display… (the last one for which I io-graphics
was load) the graphics is ok… The same thing with the Help program…
for what is inside the main pane.
What’s I did wrong ? Is it possible to make it work in 6.21 properly…
with drawing fonction etc… on both display ? I did’nt try yet in 6.3
with the new options but It’s useless if I cannot make my Pci card with
Burst transfers to work properly.
Thanks again for you help…
Martin Gagnon
Martin Gagnon wrote:
Hi ,
Situation:
We made a Pci board using the PLX9054 PCI chips with a TI DSP on the
local-bus (TMS320C6103B). We start to devellop on QNX6.21 and everything
works ok. We use 2 transfert modes with that board. DMA channels of the
PLX9054 chip (PC memory to DSP memory transfers) and Burst transfert
initiated by the DSP (DSP memory to PC memory transfers) using the DSP
Dma channel).
For the first way, the PLX chip is master on both bus (PCI bus and his
localbus where is the DSP). The other way, the DSP is master for the
localbus (where the plx is slave) and the plx is master on the PCI bus.
Anyway, I don’t want to go to much in details here… I just want to give
an idea of our setup.
For both type of transfert, we reserved a shared memory with mmap using
the MAP_PHYS | MAP_ANON | MAP_NOX64K flags. I use mem_offset to give the
physical Addresses to the PLX and the DSP for their respective
source/destination memory in the PC RAM. Each block is 1M and It’s works
no problem with QNX 6.21. I made a library to access that board, I use
it on 2 different program, everything works ok.
The Problem:
I take the same program on the same computer, I run it under QNX 6.3,
the DMA channel used on the PLX work, but the Burst transfers initiated
by the DSP does’nt, I get nothing on my shared memory. I also tried to
recompile everything under 6.3, does’nt help.
The Question:
What I miss ? Is there a new function I must use in QNX 6.3 to make it
work ? Should I set something somewhere on the PCI bus registers ?
Thanks for your help.
Martin Gagnon, b.Eng._