* Move bios_info into shared info
* Pull pci_rom base address from pci subsystem * Point AtomBIOS parser to pci rom address to set up and malloc atom_context * This is untested! Don't run on an expensive card until I test it on a cheaper one! git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42541 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -71,6 +71,9 @@ struct radeon_shared_info {
|
||||
area_id mode_list_area; // area containing display mode list
|
||||
uint32 mode_count;
|
||||
|
||||
uint32 rom_base; // AtomBIOS base location
|
||||
uint32 rom_size; // AtomBIOS size
|
||||
|
||||
display_mode current_mode;
|
||||
uint32 bytes_per_row;
|
||||
uint32 bits_per_pixel;
|
||||
|
||||
@@ -37,7 +37,6 @@ extern "C" void _sPrintf(const char *format, ...);
|
||||
|
||||
|
||||
struct accelerant_info *gInfo;
|
||||
struct bios_info *gBIOS;
|
||||
display_info *gDisplay[MAX_DISPLAY];
|
||||
|
||||
|
||||
@@ -100,13 +99,11 @@ init_common(int device, bool isClone)
|
||||
// initialize global accelerant info structure
|
||||
|
||||
gInfo = (accelerant_info *)malloc(sizeof(accelerant_info));
|
||||
gBIOS = (bios_info *)malloc(sizeof(bios_info));
|
||||
|
||||
if (gInfo == NULL || gBIOS == NULL)
|
||||
if (gInfo == NULL)
|
||||
return B_NO_MEMORY;
|
||||
|
||||
memset(gInfo, 0, sizeof(accelerant_info));
|
||||
memset(gBIOS, 0, sizeof(bios_info));
|
||||
|
||||
for (uint32 id = 0; id < MAX_DISPLAY; id++) {
|
||||
gDisplay[id] = (display_info *)malloc(sizeof(display_info));
|
||||
@@ -131,7 +128,6 @@ init_common(int device, bool isClone)
|
||||
if (ioctl(device, RADEON_GET_PRIVATE_DATA, &data,
|
||||
sizeof(radeon_get_private_data)) != 0) {
|
||||
free(gInfo);
|
||||
free(gBIOS);
|
||||
return B_ERROR;
|
||||
}
|
||||
|
||||
@@ -142,7 +138,6 @@ init_common(int device, bool isClone)
|
||||
status_t status = sharedCloner.InitCheck();
|
||||
if (status < B_OK) {
|
||||
free(gInfo);
|
||||
free(gBIOS);
|
||||
TRACE("%s, failed shared area%i, %i\n",
|
||||
__func__, data.shared_info_area, gInfo->shared_info_area);
|
||||
return status;
|
||||
@@ -155,7 +150,6 @@ init_common(int device, bool isClone)
|
||||
status = regsCloner.InitCheck();
|
||||
if (status < B_OK) {
|
||||
free(gInfo);
|
||||
free(gBIOS);
|
||||
return status;
|
||||
}
|
||||
|
||||
@@ -189,8 +183,6 @@ uninit_common(void)
|
||||
free(gInfo);
|
||||
}
|
||||
|
||||
free(gBIOS);
|
||||
|
||||
for (uint32 id = 0; id < MAX_DISPLAY; id++) {
|
||||
if (gDisplay[id] != NULL) {
|
||||
free(gDisplay[id]->regs);
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#define RADEON_HD_ACCELERANT_H
|
||||
|
||||
|
||||
#include "atom.h"
|
||||
#include "mode.h"
|
||||
#include "radeon_hd.h"
|
||||
#include "pll.h"
|
||||
@@ -112,6 +113,7 @@ typedef struct {
|
||||
|
||||
|
||||
extern accelerant_info *gInfo;
|
||||
extern atom_context *gAtomBIOS;
|
||||
extern display_info *gDisplay[MAX_DISPLAY];
|
||||
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#endif
|
||||
|
||||
|
||||
// AtomBios related calls
|
||||
atom_context *gAtomBIOS;
|
||||
|
||||
|
||||
status_t
|
||||
@@ -54,10 +54,14 @@ bios_init()
|
||||
atom_card_info->pll_read = _read32;
|
||||
atom_card_info->pll_write = _write32;
|
||||
|
||||
// System VGA shadow bios? Why not (temporary)
|
||||
atom_parse(atom_card_info, (void*)0xC0000);
|
||||
// Point AtomBIOS parser to card bios and malloc gAtomBIOS
|
||||
gAtomBIOS = atom_parse(atom_card_info, (void*)gInfo->shared_info->rom_base);
|
||||
|
||||
if (gAtomBIOS == NULL) {
|
||||
TRACE("%s: couldn't parse system AtomBIOS\n", __func__);
|
||||
return B_ERROR;
|
||||
}
|
||||
|
||||
// TODO : we need to get a copy of the VGA bios :(
|
||||
#if 0
|
||||
rdev->mode_info.atom_context = atom_parse(atom_card_info, rdev->bios);
|
||||
mutex_init(&rdev->mode_info.atom_context->mutex);
|
||||
|
||||
@@ -14,12 +14,6 @@
|
||||
#include "atom.h"
|
||||
|
||||
|
||||
struct bios_info {
|
||||
uint32 location;
|
||||
uint32 size;
|
||||
};
|
||||
|
||||
|
||||
status_t bios_init();
|
||||
|
||||
|
||||
|
||||
@@ -102,6 +102,9 @@ radeon_hd_init(radeon_info &info)
|
||||
info.shared_info->frame_buffer_int
|
||||
= read32(info.registers + R6XX_CONFIG_FB_BASE);
|
||||
|
||||
info.shared_info->rom_base = info.pci->u.h0.rom_base;
|
||||
// Grab ROM base from PCI (AtomBIOS location for card)
|
||||
|
||||
strcpy(info.shared_info->device_identifier, info.device_identifier);
|
||||
|
||||
// Pull active monitor VESA EDID from boot loader
|
||||
|
||||
Reference in New Issue
Block a user