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

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

File Facts

System
Linux kernel
Corpus path
drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c
Extension
.c
Size
115921 bytes
Lines
3924
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

if (v1_4->number_of_path > i) {
			/* If display_objid is generic object id,  the encoderObj
			 * /extencoderobjId should be 0
			 */
			if (v1_4->display_path[i].encoderobjid != 0 &&
			    v1_4->display_path[i].display_objid != 0)
				object_id = object_id_from_bios_object_id(
					v1_4->display_path[i].display_objid);
		}
		break;

	case 5:
		if (v1_5->number_of_path > i) {
			/* If display_objid is generic object id,  the encoderObjId
		 * should be 0
		 */
			if (v1_5->display_path[i].encoderobjid != 0 &&
			    v1_5->display_path[i].display_objid != 0)
				object_id = object_id_from_bios_object_id(
					v1_5->display_path[i].display_objid);
		}
		break;
	}
	return object_id;
}

static enum bp_result bios_parser_get_src_obj(struct dc_bios *dcb,
	struct graphics_object_id object_id, uint32_t index,
	struct graphics_object_id *src_object_id)
{
	(void)index;
	struct bios_parser *bp = BP_FROM_DCB(dcb);
	unsigned int i;
	enum bp_result bp_result = BP_RESULT_BADINPUT;
	struct graphics_object_id obj_id = { 0 };
	struct object_info_table *tbl = &bp->object_info_tbl;

	if (!src_object_id)
		return bp_result;

	switch (object_id.type) {
	/* Encoder's Source is GPU.  BIOS does not provide GPU, since all
	 * displaypaths point to same GPU (0x1100).  Hardcode GPU object type
	 */
	case OBJECT_TYPE_ENCODER:
		/* TODO: since num of src must be less than 2.
		 * If found in for loop, should break.
		 * DAL2 implementation may be changed too
		 */
		switch (bp->object_info_tbl.revision.minor) {
		default:
		case 4:
			for (i = 0; i < tbl->v1_4->number_of_path; i++) {
				obj_id = object_id_from_bios_object_id(
					tbl->v1_4->display_path[i].encoderobjid);
				if (object_id.type == obj_id.type &&
				    object_id.id == obj_id.id &&
				    object_id.enum_id == obj_id.enum_id) {
					*src_object_id =
						object_id_from_bios_object_id(
							0x1100);
					/* break; */
				}
			}
			bp_result = BP_RESULT_OK;
			break;

		case 5:
			for (i = 0; i < tbl->v1_5->number_of_path; i++) {
				obj_id = object_id_from_bios_object_id(
					tbl->v1_5->display_path[i].encoderobjid);
				if (object_id.type == obj_id.type &&
				    object_id.id == obj_id.id &&
				    object_id.enum_id == obj_id.enum_id) {
					*src_object_id =
						object_id_from_bios_object_id(
							0x1100);
					/* break; */
				}
			}
			bp_result = BP_RESULT_OK;
			break;
		}
		break;
	case OBJECT_TYPE_CONNECTOR:
		switch (bp->object_info_tbl.revision.minor) {
		default:
		case 4:
			for (i = 0; i < tbl->v1_4->number_of_path; i++) {
				obj_id = object_id_from_bios_object_id(

Annotation

Implementation Notes