FreeBSD/sys/dev/drm2/radeon/radeon_device.c
/**
 * radeon_check_arguments - validate module params
 *
 * @rdev: radeon_device pointer
 *
 * Validates certain module parameters and updates
 * the associated values used by the driver (all asics).
 */
validate module params
@rdev: radeon_device pointer

Validates certain module parameters and updates
the associated values used by the driver (all asics).
validate module params @rdev : radeon_device pointer Validates certain module parameters and updates the associated values used by the driver ( all asics ) .
static void radeon_check_arguments(struct radeon_device *rdev)
{
	if (!radeon_check_pot_argument(radeon_vram_limit)) {
		dev_warn(rdev->dev, "vram limit (%d) must be a power of 2\n",
				radeon_vram_limit);
		radeon_vram_limit = 0;
	}
	if (radeon_gart_size < 32) {
		dev_warn(rdev->dev, "gart size (%d) too small forcing to 512M\n",
				radeon_gart_size);
		radeon_gart_size = 512;
	} else if (!radeon_check_pot_argument(radeon_gart_size)) {
		dev_warn(rdev->dev, "gart size (%d) must be a power of 2\n",
				radeon_gart_size);
		radeon_gart_size = 512;
	}
	rdev->mc.gtt_size = (uint64_t)radeon_gart_size << 20;
	switch (radeon_agpmode) {
	case -1:
	case 0:
	case 1:
	case 2:
	case 4:
	case 8:
		break;
	default:
		dev_warn(rdev->dev, "invalid AGP mode %d (valid mode: "
				"-1, 0, 1, 2, 4, 8)\n", radeon_agpmode);
		radeon_agpmode = 0;
		break;
	}
}
static void radeon_check_arguments ( struct radeon_device * rdev ) { if ( ! radeon_check_pot_argument ( radeon_vram_limit ) ) { dev_warn ( rdev -> dev , " \n " , radeon_vram_limit ) ; radeon_vram_limit = 0 ; } if ( radeon_gart_size < 32 ) { dev_warn ( rdev -> dev , " \n " , radeon_gart_size ) ; radeon_gart_size = 512 ; } else if ( ! radeon_check_pot_argument ( radeon_gart_size ) ) { dev_warn ( rdev -> dev , " \n " , radeon_gart_size ) ; radeon_gart_size = 512 ; } rdev -> mc . gtt_size = ( uint64_t ) radeon_gart_size << 20 ; switch ( radeon_agpmode ) { case -1 : case 0 : case 1 : case 2 : case 4 : case 8 : break ; default : dev_warn ( rdev -> dev , " " " \n " , radeon_agpmode ) ; radeon_agpmode = 0 ; break ; } }
radeon_check_arguments - validate module params
 @rdev: radeon_device pointer
radeon_check_arguments - validate module params @rdev : radeon_device pointer
/* vramlimit must be a power of two */ /* gtt size must be power of two and greater or equal to 32M */ /* AGP mode can only be -1, 1, 2, 4, 8 */