[MPlayer-dev-eng] vidix: problems with rivatv_lock_nv04()

Guillaume LECERF foxcore at gmail.com
Sun Aug 5 14:24:46 CEST 2007


Hi all,

I explained in my precedent mail that I trusted the rivatv devs, but I
have to admit that it's not always true.
While trying to get my geforce 6200 tc working with the xvidix vo, I
found this piece of code :

static void rivatv_lock_nv03 (struct rivatv_chip *chip, int LockUnlock){
	VID_WR08 (chip->PVIO, 0x3C4, 0x06);
	VID_WR08 (chip->PVIO, 0x3C5, LockUnlock ? 0x99 : 0x57);
}

static void rivatv_lock_nv04 (struct rivatv_chip *chip, int LockUnlock){
	VID_WR08 (chip->PCIO, 0x3C4, 0x06);
	VID_WR08 (chip->PCIO, 0x3C5, LockUnlock ? 0x99 : 0x57);
 	VID_WR08 (chip->PCIO, 0x3D4, 0x1F);
 	VID_WR08 (chip->PCIO, 0x3D5, LockUnlock ? 0x99 : 0x57);
}

After testing this a bit, I insolated a problem near the lock/unlock routine.
So I tried to find some lock related code in others nvidia oss sources.
I found a recurrent implementation (here from
linux-2.6.22.1/drivers/video/riva/riva_hw.c) :

static void vgaLockUnlock (RIVA_HW_INST *chip, int Lock)
{
    U008 cr11;
    VGA_WR08(chip->PCIO, 0x3D4, 0x11);
    cr11 = VGA_RD08(chip->PCIO, 0x3D5);
    if(Lock) cr11 |= 0x80;
    else cr11 &= ~0x80;
    VGA_WR08(chip->PCIO, 0x3D5, cr11);
}
static void nv3LockUnlock (RIVA_HW_INST *chip, int Lock)
{
    VGA_WR08(chip->PVIO, 0x3C4, 0x06);
    VGA_WR08(chip->PVIO, 0x3C5, Lock ? 0x99 : 0x57);
    vgaLockUnlock(chip, Lock);
}
static void nv4LockUnlock (RIVA_HW_INST *chip, int Lock)
{
    VGA_WR08(chip->PCIO, 0x3D4, 0x1F);
    VGA_WR08(chip->PCIO, 0x3D5, Lock ? 0x99 : 0x57);
    vgaLockUnlock(chip, Lock);
}

But I never found code using registers 0x3c4/0x3c5 with chip->PCIO.
When looking at rivatv_lock_nv03, it uses the same 0x3c4/0x3c5 pair,
but with chip->PVIO.

The current behavior of writing to 0x3c4/0x3c5 on chip->PCIO results
in a black screen, and the only solution you have to get back to
current X display is to quit mplayer, and switch console with
ctrl+alt+F1 and then back with ctrl+alt+F7.

The attached patch is not fixing the display of the vidix overlay, but
the black screen problem is fixed. The only remaining problem is that
the displayed window is filled with green color (the overlay key, I
think) so there must be a problem elsewhere.

I'd appreciated any help on this one, because I'd like to use vidix
acceleration with my video card.


-- 
Guillaume LECERF
GeeXboX developer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lock.diff
Type: text/x-patch
Size: 566 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20070805/babf80a0/attachment.bin>


More information about the MPlayer-dev-eng mailing list