drivers/gpu/drm/amd/display/dc/bios/bios_parser_helper.c

Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/display/dc/bios/bios_parser_helper.c

File Facts

System
Linux kernel
Corpus path
drivers/gpu/drm/amd/display/dc/bios/bios_parser_helper.c
Extension
.c
Size
2256 bytes
Lines
84
Domain
Driver Families
Bucket
drivers/gpu
Inferred role
Driver Families: implementation source
Status
source implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

#include "dm_services.h"

#include "atom.h"

#include "include/bios_parser_types.h"
#include "bios_parser_helper.h"
#include "command_table_helper.h"
#include "command_table.h"
#include "bios_parser_types_internal.h"

uint8_t *bios_get_image(struct dc_bios *bp,
	uint32_t offset,
	uint32_t size)
{
	if (!bp->bios)
		return NULL;

	if (offset > bp->bios_size || size > bp->bios_size - offset)
		return NULL;

	return bp->bios + offset;
}

#include "reg_helper.h"

#define CTX \
	bios->ctx
#define REG(reg)\
	(bios->regs->reg)

#undef FN
#define FN(reg_name, field_name) \
		ATOM_ ## field_name ## _SHIFT, ATOM_ ## field_name

bool bios_is_accelerated_mode(
	struct dc_bios *bios)
{
	uint32_t acc_mode;
	REG_GET(BIOS_SCRATCH_6, S6_ACC_MODE, &acc_mode);
	return (acc_mode == 1);
}


void bios_set_scratch_acc_mode_change(
	struct dc_bios *bios,
	uint32_t state)
{
	REG_UPDATE(BIOS_SCRATCH_6, S6_ACC_MODE, state);
}


void bios_set_scratch_critical_state(
	struct dc_bios *bios,
	bool state)
{
	uint32_t critial_state = state ? 1 : 0;
	REG_UPDATE(BIOS_SCRATCH_6, S6_CRITICAL_STATE, critial_state);
}

Annotation

Implementation Notes