FreeBSD/sys/dev/drm2/radeon/radeon_device.c
/**
 * radeon_card_posted - check if the hw has already been initialized
 *
 * @rdev: radeon_device pointer
 *
 * Check if the asic has been initialized (all asics).
 * Used at driver startup.
 * Returns true if initialized or false if not.
 */
check if the hw has already been initialized
@rdev: radeon_device pointer

Check if the asic has been initialized (all asics).
Used at driver startup.
Returns true if initialized or false if not.
check if the hw has already been initialized @rdev : radeon_device pointer Check if the asic has been initialized ( all asics ) . Used at driver startup . Returns true if initialized or false if not .
bool radeon_card_posted(struct radeon_device *rdev)
{
	uint32_t reg;
#ifdef FREEBSD_WIP
	if (efi_enabled(EFI_BOOT) &&
	    rdev->dev->pci_subvendor == PCI_VENDOR_ID_APPLE)
		return false;
#endif 
	if (ASIC_IS_DCE41(rdev)) {
		reg = RREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC0_REGISTER_OFFSET) |
			RREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC1_REGISTER_OFFSET);
		if (reg & EVERGREEN_CRTC_MASTER_EN)
			return true;
	} else if (ASIC_IS_DCE4(rdev)) {
		reg = RREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC0_REGISTER_OFFSET) |
			RREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC1_REGISTER_OFFSET) |
			RREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC2_REGISTER_OFFSET) |
			RREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC3_REGISTER_OFFSET) |
			RREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC4_REGISTER_OFFSET) |
			RREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC5_REGISTER_OFFSET);
		if (reg & EVERGREEN_CRTC_MASTER_EN)
			return true;
	} else if (ASIC_IS_AVIVO(rdev)) {
		reg = RREG32(AVIVO_D1CRTC_CONTROL) |
		      RREG32(AVIVO_D2CRTC_CONTROL);
		if (reg & AVIVO_CRTC_EN) {
			return true;
		}
	} else {
		reg = RREG32(RADEON_CRTC_GEN_CNTL) |
		      RREG32(RADEON_CRTC2_GEN_CNTL);
		if (reg & RADEON_CRTC_EN) {
			return true;
		}
	}
	if (rdev->family >= CHIP_R600)
		reg = RREG32(R600_CONFIG_MEMSIZE);
	else
		reg = RREG32(RADEON_CONFIG_MEMSIZE);
	if (reg)
		return true;
	return false;
}
bool radeon_card_posted ( struct radeon_device * rdev ) { uint32_t reg ; #ifdef FREEBSD_WIP if ( efi_enabled ( EFI_BOOT ) && rdev -> dev -> pci_subvendor == PCI_VENDOR_ID_APPLE ) return false ; #endif if ( ASIC_IS_DCE41 ( rdev ) ) { reg = RREG32 ( EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC0_REGISTER_OFFSET ) | RREG32 ( EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC1_REGISTER_OFFSET ) ; if ( reg & EVERGREEN_CRTC_MASTER_EN ) return true ; } else if ( ASIC_IS_DCE4 ( rdev ) ) { reg = RREG32 ( EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC0_REGISTER_OFFSET ) | RREG32 ( EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC1_REGISTER_OFFSET ) | RREG32 ( EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC2_REGISTER_OFFSET ) | RREG32 ( EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC3_REGISTER_OFFSET ) | RREG32 ( EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC4_REGISTER_OFFSET ) | RREG32 ( EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC5_REGISTER_OFFSET ) ; if ( reg & EVERGREEN_CRTC_MASTER_EN ) return true ; } else if ( ASIC_IS_AVIVO ( rdev ) ) { reg = RREG32 ( AVIVO_D1CRTC_CONTROL ) | RREG32 ( AVIVO_D2CRTC_CONTROL ) ; if ( reg & AVIVO_CRTC_EN ) { return true ; } } else { reg = RREG32 ( RADEON_CRTC_GEN_CNTL ) | RREG32 ( RADEON_CRTC2_GEN_CNTL ) ; if ( reg & RADEON_CRTC_EN ) { return true ; } } if ( rdev -> family >= CHIP_R600 ) reg = RREG32 ( R600_CONFIG_MEMSIZE ) ; else reg = RREG32 ( RADEON_CONFIG_MEMSIZE ) ; if ( reg ) return true ; return false ; }
radeon_card_posted - check if the hw has already been initialized
 @rdev: radeon_device pointer
radeon_card_posted - check if the hw has already been initialized @rdev : radeon_device pointer
/* FREEBSD_WIP */ /* first check CRTCs */ /* then check MEM_SIZE, in case the crtcs are off */