FreeBSD/sys/dev/drm2/drm_agpsupport.c
/**
 * Initialize the AGP resources.
 *
 * \return pointer to a drm_agp_head structure.
 *
 * Gets the drm_agp_t structure which is made available by the agpgart module
 * via the inter_module_* functions. Creates and initializes a drm_agp_head
 * structure.
 */
Initialize the AGP resources.
\return pointer to a drm_agp_head structure.

Gets the drm_agp_t structure which is made available by the agpgart module
via the inter_module_* functions. Creates and initializes a drm_agp_head
structure.
Initialize the AGP resources . \ return pointer to a drm_agp_head structure . Gets the drm_agp_t structure which is made available by the agpgart module via the inter_module_ * functions . Creates and initializes a drm_agp_head structure .
struct drm_agp_head *drm_agp_init(struct drm_device *dev)
{
	struct drm_agp_head *head = NULL;
	if (!(head = malloc(sizeof(*head), DRM_MEM_AGPLISTS, M_NOWAIT)))
		return NULL;
	memset((void *)head, 0, sizeof(*head));
	head->bridge = agp_find_device();
	if (!head->bridge) {
		free(head, DRM_MEM_AGPLISTS);
		return NULL;
	} else {
		agp_get_info(head->bridge, &head->agp_info);
	}
	INIT_LIST_HEAD(&head->memory);
	head->cant_use_aperture = 0;
	head->base = head->agp_info.ai_aperture_base;
	return head;
}
struct drm_agp_head * drm_agp_init ( struct drm_device * dev ) { struct drm_agp_head * head = NULL ; if ( ! ( head = malloc ( sizeof ( * head ) , DRM_MEM_AGPLISTS , M_NOWAIT ) ) ) return NULL ; memset ( ( void * ) head , 0 , sizeof ( * head ) ) ; head -> bridge = agp_find_device ( ) ; if ( ! head -> bridge ) { free ( head , DRM_MEM_AGPLISTS ) ; return NULL ; } else { agp_get_info ( head -> bridge , & head -> agp_info ) ; } INIT_LIST_HEAD ( & head -> memory ) ; head -> cant_use_aperture = 0 ; head -> base = head -> agp_info . ai_aperture_base ; return head ; }
Initialize the AGP resources.
Initialize the AGP resources .