tech-x11 archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

radeon 6450, bios init first to nvidia geforce



Hi,

My box with NetBSD-current works well with the new driver.
However radeon drmkms is not fully stable at the moment, I'm using wsfb,
which compared to available vesa driver is much better choice for
my display's native resolution. I was courious, how the new kernel's graphic 
subsystem works with 2 cards, mentioned earlier radeon hd 6450 
and old nvidia geforce (8500?), which I set in bios as primary 
(to make things more difficult :).

I made my gigabyte-p31ds3l motherboard 2 head capable by "adjusting" one 
of my pcie x1 slot, to let it cooperate with nividia's peg, but it's not 
very important now.

With current sources at boot the kernel stops setting drm with error 22,
being unable to load radeon's bios rom. I checked radeon_bios.c and
judged (with not so good knowledge of programming), that only method of
loading bios rom for this card is radeon_read_bios (igp could work, 
but radeon in this 2-head configuration is discrete and not posted,
acpi method doesn't work because of absent 'AE' in bios). Obviously
it returns false.

Today I found on internet patch for one more method, which loads
bios from file. I know, that all methods from radeon_bios.c 
should be enough in their stable state, but as the author of the patch
(Wilfried Klaebe) said,  if above methods fail, this one could do the trick.

After some modifications (corrections needed) added this method to
radeon_bios.c, 
and (in the meantime) I discovered, that all the stuff needed to service
bios binary is in the place (e.g. linux/firmware.h). 

In short:

static bool radeon_read_bios_from_firmware(struct radeon_device *rdev)
{
        const uint8_t __iomem *bios;
        resource_size_t size;
        const struct firmware *fw = NULL;
        char *err = NULL;

        request_firmware(&fw, "radeon/vbios.bin", rdev->dev);
        if (!fw) {
                err = "firmware request returned NULL\n";
                goto out;
        }
        size = fw->size;
        bios = fw->data;

        if (size == 0 || !bios) {
                err = "firmware request returned zero sized or NULL data\n";
                goto out;
        }

        if (bios[0] != 0x55 || bios[1] != 0xaa) {
                err = "wrong signature on firmware\n";
                goto out;
        }

        rdev->bios = kmemdup(bios, size, GFP_KERNEL);
        if (rdev->bios == NULL) {
                /*pci_unmap_rom(rdev->pdev, bios);*/
                return false;
        }

        return true;

out:
        if (err)
                DRM_ERROR(err);
        if (fw)
                release_firmware(fw);
        return false;
}

and 


if (r == false)
         r = radeon_read_bios_from_firmware(rdev);
         
         
added to radeon_get_bios


vbios.bin was created by dumping card's memory (I did it under linux: 
echo 1 > rom; cat rom > vbios.bin in pci devices tree (found by lspci)) 
and later copied to /usr/libdata/firmware/radeon/


With this "addition" kernel build fails at radeon_bios.c, but removing 
-Werror lets it continue.


I was able to see radeon as secondary (and primary too) display after 
changing to:


vga0 			at pci1 	dev 0 function 0
wsdisplay0 		at vga0 	console ?
wsdisplay0      at wsemuldisplaydev?
radeon*         at pci1 	dev ? function ?
radeondrmkmsfb* at radeonfbbus?



Thanks, Taylor. Thanks, guys.




Home | Main Index | Thread Index | Old Index