* add required atombios.h from drm driver from linux 3.0 with a few tweaks

(we aren't taking ownership of this one.. yikes)
* add first AtomBIOS call to test the waters


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42578 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Alexander von Gluck IV 2011-08-05 02:37:05 +00:00
parent cdb351d4a4
commit d77ff85e1f
5 changed files with 7077 additions and 9 deletions

View File

@ -25,6 +25,8 @@
#define ATOM_H
#include "atombios.h"
#include <String.h>
#include <SupportDefs.h>

File diff suppressed because it is too large Load Diff

View File

@ -28,6 +28,52 @@
atom_context *gAtomContext;
void
atombios_crtc_power(uint8 crt_id, int state)
{
int index = GetIndexIntoMasterTable(COMMAND, EnableCRTC);
ENABLE_CRTC_PS_ALLOCATION args;
memset(&args, 0, sizeof(args));
args.ucCRTC = crt_id;
args.ucEnable = state;
atom_execute_table(gAtomContext, index, (uint32*)&args);
}
void
radeon_bios_init_scratch()
{
radeon_shared_info &info = *gInfo->shared_info;
uint32 bios_2_scratch;
uint32 bios_6_scratch;
if (info.device_chipset >= RADEON_R600) {
bios_2_scratch = Read32(OUT, R600_BIOS_2_SCRATCH);
bios_6_scratch = Read32(OUT, R600_BIOS_6_SCRATCH);
} else {
bios_2_scratch = Read32(OUT, RADEON_BIOS_2_SCRATCH);
bios_6_scratch = Read32(OUT, RADEON_BIOS_6_SCRATCH);
}
bios_2_scratch &= ~ATOM_S2_VRI_BRIGHT_ENABLE;
// bios should control backlight
bios_6_scratch |= ATOM_S6_ACC_BLOCK_DISPLAY_SWITCH;
// bios shouldn't handle mode switching
if (info.device_chipset >= RADEON_R600) {
Write32(OUT, R600_BIOS_2_SCRATCH, bios_2_scratch);
Write32(OUT, R600_BIOS_6_SCRATCH, bios_6_scratch);
} else {
Write32(OUT, RADEON_BIOS_2_SCRATCH, bios_2_scratch);
Write32(OUT, RADEON_BIOS_6_SCRATCH, bios_6_scratch);
}
}
status_t
radeon_init_bios(uint8* bios)
{
@ -69,12 +115,8 @@ radeon_init_bios(uint8* bios)
return B_ERROR;
}
#if 0
rdev->mode_info.atom_context = atom_parse(atom_card_info, rdev->bios);
mutex_init(&rdev->mode_info.atom_context->mutex);
radeon_atom_initialize_bios_scratch_regs(rdev->ddev);
atom_allocate_fb_scratch(rdev->mode_info.atom_context);
#endif
// mutex_init(&rdev->mode_info.atom_context->mutex);
radeon_bios_init_scratch();
return B_OK;
}

View File

@ -14,6 +14,7 @@
#include "atom.h"
void atombios_crtc_power(uint8 crt_id, int state);
status_t radeon_init_bios(uint8* bios);

View File

@ -13,6 +13,7 @@
#include "accelerant_protos.h"
#include "accelerant.h"
#include "bios.h"
#include "utility.h"
#include "mode.h"
#include "display.h"
@ -343,7 +344,8 @@ radeon_set_display_mode(display_mode *mode)
// Skip if display is inactive
if (gDisplay[id]->active == false) {
CardBlankSet(id, true);
display_power(id, RHD_POWER_SHUTDOWN);
// LEGACY : display_power(id, RHD_POWER_SHUTDOWN);
atombios_crtc_power(id, ATOM_DISABLE);
continue;
}
@ -352,7 +354,7 @@ radeon_set_display_mode(display_mode *mode)
CardModeSet(id, mode);
CardModeScale(id, mode);
display_power(id, RHD_POWER_RESET);
// LEGACY : display_power(id, RHD_POWER_RESET);
// Program connector controllers
switch (gDisplay[id]->connection_type) {
@ -370,7 +372,8 @@ radeon_set_display_mode(display_mode *mode)
}
// Power CRT Controller
display_power(id, RHD_POWER_ON);
// LEGACY : display_power(id, RHD_POWER_ON);
atombios_crtc_power(id, ATOM_ENABLE);
CardBlankSet(id, false);
// Power connector controllers