Fix for Theater200 on Radeon x600 VIVO

Maciej Cencora m.cencora at
Fri Sep 7 10:20:42 PDT 2007

Hi all,

If you are interested only in the solution, scroll to bottom.

My name is Maciej Cencora. I've been using Linux since couple of years
and since mainly I'm a programmer (mostly PHP/HTML, but also C/C++) I
decided to start contributing a month ago. At that moment I knew nothing
about how to write a kernel driver or how radeon or theater chip is build.

I decided to choose one of my i-work-only-on-windows devices. First was
bluetooth usb dongle, but after kernel upgrade it started working.
Second - scanner in Lexmark x1195 - hmm, not very interesting. So I've
chosen Rage Theater on my X600 Pro VIVO HDTV(rv380) card (in xorg.log it
showed no response from all VIP buses).

I began with reading "Linux Device Drivers" e-book, and studying xorg
ati driver source code. I wrote small kernel module, that was supposed
to check if theater chip exists (almost ripped off from theater_detect.c
:) Unfortunatly it didn't worked.

Using SoftIce I was investigating 2 regs (VIPH_REG_DATA, VIPH_REG_ADDR)
in Windows, and with help of theater_detect source code I found out that
theater chip is connected to second VIP bus (nr 1). Then my module was
torturing that bus in Linux, but no success. I thought that there are
some timing issues, that I won't be able to deal with without a
documentation. I was very disappointed, and almost were about to abandon
this short linux developer adventure.
But after a week I decided to try one more time, with hope that it's not
a timing issue. Logically thinking if I got no response from any bus,
maybe those buses are disabled by default to save power. So there must
be some register that controls those buses and surprisingly its called
VIPH_CONTROL ;) In Linux that reg contains value 0x003F0004, and in
Windows it is 0x003F000D. And that's it! Change two bits, and it works:)
The rest was piece of cake: find where to program that reg and recompile
radeon driver.

Additional case statement in RADEONVIP_reset function (radeon_vip.c)
with OUTREG(VIPH_CONTROL, 0x003F000D) (remaining OUTREGS copied from
default case).

I've checked it using avview. Composite input works almost perfectly
(image vibrates a little), and s-video input gives very corrupted image
(but works). Are there any other programs like avview?

What I think about is a kernel V4L theater driver, that would use 3
functions (reset, read or write to VIP bus) exported by radeonfb or
modesetting driver (once it goes to kernel). Is it doable, or maybe I
should live it alone. Any ideas?

What about licenses, because there will be much copy and paste from xorg
ati driver code which is MIT, and I want kernel module to be GPL2, maybe

Maciej Cencora

More information about the xorg mailing list