1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26#include "dm_services.h"
27
28#include "atom.h"
29
30#include "include/bios_parser_types.h"
31#include "bios_parser_helper.h"
32#include "command_table_helper.h"
33#include "command_table.h"
34#include "bios_parser_types_internal.h"
35
36uint8_t *bios_get_image(struct dc_bios *bp,
37 uint32_t offset,
38 uint32_t size)
39{
40 if (bp->bios && offset + size < bp->bios_size)
41 return bp->bios + offset;
42 else
43 return NULL;
44}
45
46#include "reg_helper.h"
47
48#define CTX \
49 bios->ctx
50#define REG(reg)\
51 (bios->regs->reg)
52
53#undef FN
54#define FN(reg_name, field_name) \
55 ATOM_ ## field_name ## _SHIFT, ATOM_ ## field_name
56
57bool bios_is_accelerated_mode(
58 struct dc_bios *bios)
59{
60 uint32_t acc_mode;
61 REG_GET(BIOS_SCRATCH_6, S6_ACC_MODE, &acc_mode);
62 return (acc_mode == 1);
63}
64
65
66void bios_set_scratch_acc_mode_change(
67 struct dc_bios *bios)
68{
69 REG_UPDATE(BIOS_SCRATCH_6, S6_ACC_MODE, 1);
70}
71
72
73void bios_set_scratch_critical_state(
74 struct dc_bios *bios,
75 bool state)
76{
77 uint32_t critial_state = state ? 1 : 0;
78 REG_UPDATE(BIOS_SCRATCH_6, S6_CRITICAL_STATE, critial_state);
79}
80
81uint32_t bios_get_vga_enabled_displays(
82 struct dc_bios *bios)
83{
84 uint32_t active_disp = 1;
85
86 active_disp = REG_READ(BIOS_SCRATCH_3) & 0XFFFF;
87 return active_disp;
88}
89
90