Commit a6be7570 authored by Emily Deng's avatar Emily Deng Committed by Alex Deucher

drm/amdgpu: Set ip_blocks according variable amdgpu_virtual_display.

For virtual display feature, if user set the option "amdgpu.virtual_display=1"
when load amdgpu.ko. Then need to set the ip_blocks with virtual display ip
blocks. And when enable virtual display, the amdgpu_dal need to be set to zero.
Signed-off-by: default avatarEmily Deng <Emily.Deng@amd.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent e443059d
...@@ -1185,6 +1185,8 @@ static int amdgpu_early_init(struct amdgpu_device *adev) ...@@ -1185,6 +1185,8 @@ static int amdgpu_early_init(struct amdgpu_device *adev)
{ {
int i, r; int i, r;
DRM_INFO("virtual display enabled:%d\n", amdgpu_virtual_display);
switch (adev->asic_type) { switch (adev->asic_type) {
case CHIP_TOPAZ: case CHIP_TOPAZ:
case CHIP_TONGA: case CHIP_TONGA:
......
...@@ -2323,30 +2323,59 @@ static const struct amdgpu_ip_block_version kaveri_ip_blocks_vd[] = ...@@ -2323,30 +2323,59 @@ static const struct amdgpu_ip_block_version kaveri_ip_blocks_vd[] =
int cik_set_ip_blocks(struct amdgpu_device *adev) int cik_set_ip_blocks(struct amdgpu_device *adev)
{ {
switch (adev->asic_type) { if (amdgpu_virtual_display) {
case CHIP_BONAIRE: adev->mode_info.vsync_timer_enabled = AMDGPU_IRQ_STATE_DISABLE;
adev->ip_blocks = bonaire_ip_blocks; switch (adev->asic_type) {
adev->num_ip_blocks = ARRAY_SIZE(bonaire_ip_blocks); case CHIP_BONAIRE:
break; adev->ip_blocks = bonaire_ip_blocks_vd;
case CHIP_HAWAII: adev->num_ip_blocks = ARRAY_SIZE(bonaire_ip_blocks_vd);
adev->ip_blocks = hawaii_ip_blocks; break;
adev->num_ip_blocks = ARRAY_SIZE(hawaii_ip_blocks); case CHIP_HAWAII:
break; adev->ip_blocks = hawaii_ip_blocks_vd;
case CHIP_KAVERI: adev->num_ip_blocks = ARRAY_SIZE(hawaii_ip_blocks_vd);
adev->ip_blocks = kaveri_ip_blocks; break;
adev->num_ip_blocks = ARRAY_SIZE(kaveri_ip_blocks); case CHIP_KAVERI:
break; adev->ip_blocks = kaveri_ip_blocks_vd;
case CHIP_KABINI: adev->num_ip_blocks = ARRAY_SIZE(kaveri_ip_blocks_vd);
adev->ip_blocks = kabini_ip_blocks; break;
adev->num_ip_blocks = ARRAY_SIZE(kabini_ip_blocks); case CHIP_KABINI:
break; adev->ip_blocks = kabini_ip_blocks_vd;
case CHIP_MULLINS: adev->num_ip_blocks = ARRAY_SIZE(kabini_ip_blocks_vd);
adev->ip_blocks = mullins_ip_blocks; break;
adev->num_ip_blocks = ARRAY_SIZE(mullins_ip_blocks); case CHIP_MULLINS:
break; adev->ip_blocks = mullins_ip_blocks_vd;
default: adev->num_ip_blocks = ARRAY_SIZE(mullins_ip_blocks_vd);
/* FIXME: not supported yet */ break;
return -EINVAL; default:
/* FIXME: not supported yet */
return -EINVAL;
}
} else {
switch (adev->asic_type) {
case CHIP_BONAIRE:
adev->ip_blocks = bonaire_ip_blocks;
adev->num_ip_blocks = ARRAY_SIZE(bonaire_ip_blocks);
break;
case CHIP_HAWAII:
adev->ip_blocks = hawaii_ip_blocks;
adev->num_ip_blocks = ARRAY_SIZE(hawaii_ip_blocks);
break;
case CHIP_KAVERI:
adev->ip_blocks = kaveri_ip_blocks;
adev->num_ip_blocks = ARRAY_SIZE(kaveri_ip_blocks);
break;
case CHIP_KABINI:
adev->ip_blocks = kabini_ip_blocks;
adev->num_ip_blocks = ARRAY_SIZE(kabini_ip_blocks);
break;
case CHIP_MULLINS:
adev->ip_blocks = mullins_ip_blocks;
adev->num_ip_blocks = ARRAY_SIZE(mullins_ip_blocks);
break;
default:
/* FIXME: not supported yet */
return -EINVAL;
}
} }
return 0; return 0;
......
...@@ -1387,32 +1387,64 @@ static const struct amdgpu_ip_block_version cz_ip_blocks_vd[] = ...@@ -1387,32 +1387,64 @@ static const struct amdgpu_ip_block_version cz_ip_blocks_vd[] =
int vi_set_ip_blocks(struct amdgpu_device *adev) int vi_set_ip_blocks(struct amdgpu_device *adev)
{ {
switch (adev->asic_type) { if (amdgpu_virtual_display) {
case CHIP_TOPAZ: adev->mode_info.vsync_timer_enabled = AMDGPU_IRQ_STATE_DISABLE;
adev->ip_blocks = topaz_ip_blocks; switch (adev->asic_type) {
adev->num_ip_blocks = ARRAY_SIZE(topaz_ip_blocks); case CHIP_TOPAZ:
break; adev->ip_blocks = topaz_ip_blocks;
case CHIP_FIJI: adev->num_ip_blocks = ARRAY_SIZE(topaz_ip_blocks);
adev->ip_blocks = fiji_ip_blocks; break;
adev->num_ip_blocks = ARRAY_SIZE(fiji_ip_blocks); case CHIP_FIJI:
break; adev->ip_blocks = fiji_ip_blocks_vd;
case CHIP_TONGA: adev->num_ip_blocks = ARRAY_SIZE(fiji_ip_blocks_vd);
adev->ip_blocks = tonga_ip_blocks; break;
adev->num_ip_blocks = ARRAY_SIZE(tonga_ip_blocks); case CHIP_TONGA:
break; adev->ip_blocks = tonga_ip_blocks_vd;
case CHIP_POLARIS11: adev->num_ip_blocks = ARRAY_SIZE(tonga_ip_blocks_vd);
case CHIP_POLARIS10: break;
adev->ip_blocks = polaris11_ip_blocks; case CHIP_POLARIS11:
adev->num_ip_blocks = ARRAY_SIZE(polaris11_ip_blocks); case CHIP_POLARIS10:
break; adev->ip_blocks = polaris11_ip_blocks_vd;
case CHIP_CARRIZO: adev->num_ip_blocks = ARRAY_SIZE(polaris11_ip_blocks_vd);
case CHIP_STONEY: break;
adev->ip_blocks = cz_ip_blocks;
adev->num_ip_blocks = ARRAY_SIZE(cz_ip_blocks); case CHIP_CARRIZO:
break; case CHIP_STONEY:
default: adev->ip_blocks = cz_ip_blocks_vd;
/* FIXME: not supported yet */ adev->num_ip_blocks = ARRAY_SIZE(cz_ip_blocks_vd);
return -EINVAL; break;
default:
/* FIXME: not supported yet */
return -EINVAL;
}
} else {
switch (adev->asic_type) {
case CHIP_TOPAZ:
adev->ip_blocks = topaz_ip_blocks;
adev->num_ip_blocks = ARRAY_SIZE(topaz_ip_blocks);
break;
case CHIP_FIJI:
adev->ip_blocks = fiji_ip_blocks;
adev->num_ip_blocks = ARRAY_SIZE(fiji_ip_blocks);
break;
case CHIP_TONGA:
adev->ip_blocks = tonga_ip_blocks;
adev->num_ip_blocks = ARRAY_SIZE(tonga_ip_blocks);
break;
case CHIP_POLARIS11:
case CHIP_POLARIS10:
adev->ip_blocks = polaris11_ip_blocks;
adev->num_ip_blocks = ARRAY_SIZE(polaris11_ip_blocks);
break;
case CHIP_CARRIZO:
case CHIP_STONEY:
adev->ip_blocks = cz_ip_blocks;
adev->num_ip_blocks = ARRAY_SIZE(cz_ip_blocks);
break;
default:
/* FIXME: not supported yet */
return -EINVAL;
}
} }
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment