<p dir="ltr">Thanks for the feedback</p>
<p dir="ltr">I'll take a look at the PCI ID's tonight</p>
<br><div class="gmail_quote"><div dir="ltr">On Mon, 8 Feb 2016, 9:54 a.m. Christian König <<a href="mailto:deathsimple@vodafone.de">deathsimple@vodafone.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Am 08.02.2016 um 03:45 schrieb Mike Lothian:<br>
> This will allow us to disable CIK support in the radeon driver, so both<br>
> radeon and amdgpu can be around at the same time without conflicting<br>
><br>
> Signed-of-by: Mike Lothian <<a href="mailto:mike@fireburn.co.uk" target="_blank">mike@fireburn.co.uk</a>><br>
> ---<br>
><br>
> I've tested this on my Kabini system radeon doesn't initalise when compiled in but<br>
> I do get these messages in my dmesg:<br>
><br>
> [drm] radeon kernel modesetting enabled.<br>
> [drm] initializing kernel modesetting (KABINI 0x1002:0x9832 0x1025:0x0800).<br>
> radeon 0000:00:01.0: Fatal error during GPU init<br>
> radeon: probe of 0000:00:01.0 failed with error -22<br>
><br>
> Am I going down the right route with this?<br>
<br>
Well, probably not but it's at least start.<br>
<br>
First of all the CIK support in AMDGPU isn't really mature at the<br>
moment. We only used it for bringup of the initial driver and it still<br>
has some bugs. So at least currently we don't want to encourage people<br>
to use amdgpu over radeon for CIK parts.<br>
<br>
Additional to that the amdgpu support compiles perfectly fine even when<br>
radeon has CIK support, so a Kconfig dependency between the two is<br>
clearly not what we want.<br>
<br>
Last, but not least you need to make the PCI IDs in<br>
include/drm/drm_pciids.h for CIK parts depend on the new configuration<br>
option as well. This is why you run into an error with your patch.<br>
<br>
Regards,<br>
Christian.<br>
<br>
><br>
> drivers/gpu/drm/amd/amdgpu/Kconfig | 1 +<br>
> drivers/gpu/drm/radeon/Kconfig | 11 +++++++++++<br>
> drivers/gpu/drm/radeon/Makefile | 11 +++++++----<br>
> drivers/gpu/drm/radeon/atombios_encoders.c | 5 +++++<br>
> drivers/gpu/drm/radeon/evergreen.c | 24 ++++++++++++++++++++++++<br>
> drivers/gpu/drm/radeon/radeon_asic.c | 13 +++++++++++++<br>
> 6 files changed, 61 insertions(+), 4 deletions(-)<br>
><br>
> diff --git a/drivers/gpu/drm/amd/amdgpu/Kconfig b/drivers/gpu/drm/amd/amdgpu/Kconfig<br>
> index b30fcfa..bb58f17 100644<br>
> --- a/drivers/gpu/drm/amd/amdgpu/Kconfig<br>
> +++ b/drivers/gpu/drm/amd/amdgpu/Kconfig<br>
> @@ -1,6 +1,7 @@<br>
> config DRM_AMDGPU_CIK<br>
> bool "Enable amdgpu support for CIK parts"<br>
> depends on DRM_AMDGPU<br>
> + depends on !DRM_RADEON_CIK<br>
> help<br>
> Choose this option if you want to enable experimental support<br>
> for CIK asics.<br>
> diff --git a/drivers/gpu/drm/radeon/Kconfig b/drivers/gpu/drm/radeon/Kconfig<br>
> index 9909f5c..32bc77e 100644<br>
> --- a/drivers/gpu/drm/radeon/Kconfig<br>
> +++ b/drivers/gpu/drm/radeon/Kconfig<br>
> @@ -1,3 +1,14 @@<br>
> +config DRM_RADEON_CIK<br>
> + bool "Enable radeon support for CIK parts"<br>
> + depends on DRM_RADEON<br>
> + default y<br>
> + help<br>
> + Choose this option if you want to enable support for CIK<br>
> + asics.<br>
> +<br>
> + Consider disabling this option if you wish to enable CIK<br>
> + in the amdgpu driver.<br>
> +<br>
> config DRM_RADEON_USERPTR<br>
> bool "Always enable userptr support"<br>
> depends on DRM_RADEON<br>
> diff --git a/drivers/gpu/drm/radeon/Makefile b/drivers/gpu/drm/radeon/Makefile<br>
> index 08bd17d..6c43901 100644<br>
> --- a/drivers/gpu/drm/radeon/Makefile<br>
> +++ b/drivers/gpu/drm/radeon/Makefile<br>
> @@ -72,13 +72,15 @@ radeon-y += radeon_device.o radeon_asic.o radeon_kms.o \<br>
> evergreen.o evergreen_cs.o evergreen_blit_shaders.o \<br>
> evergreen_hdmi.o radeon_trace_points.o ni.o cayman_blit_shaders.o \<br>
> atombios_encoders.o radeon_semaphore.o radeon_sa.o atombios_i2c.o si.o \<br>
> - si_blit_shaders.o radeon_prime.o cik.o cik_blit_shaders.o \<br>
> + si_blit_shaders.o radeon_prime.o \<br>
> r600_dpm.o rs780_dpm.o rv6xx_dpm.o rv770_dpm.o rv730_dpm.o rv740_dpm.o \<br>
> rv770_smc.o cypress_dpm.o btc_dpm.o sumo_dpm.o sumo_smc.o trinity_dpm.o \<br>
> - trinity_smc.o ni_dpm.o si_smc.o si_dpm.o kv_smc.o kv_dpm.o ci_smc.o \<br>
> - ci_dpm.o dce6_afmt.o radeon_vm.o radeon_ucode.o radeon_ib.o \<br>
> + trinity_smc.o ni_dpm.o si_smc.o si_dpm.o \<br>
> + dce6_afmt.o radeon_vm.o radeon_ucode.o radeon_ib.o \<br>
> radeon_sync.o radeon_audio.o radeon_dp_auxch.o radeon_dp_mst.o<br>
><br>
> +radeon-$(CONFIG_DRM_RADEON_CIK) += cik.o cik_blit_shaders.o kv_smc.o kv_dpm.o ci_smc.o ci_dpm.o<br>
> +<br>
> radeon-$(CONFIG_MMU_NOTIFIER) += radeon_mn.o<br>
><br>
> # add async DMA block<br>
> @@ -88,7 +90,8 @@ radeon-y += \<br>
> evergreen_dma.o \<br>
> ni_dma.o \<br>
> si_dma.o \<br>
> - cik_sdma.o \<br>
> +<br>
> +radeon-$(CONFIG_DRM_RADEON_CIK) += cik_sdma.o<br>
><br>
> # add UVD block<br>
> radeon-y += \<br>
> diff --git a/drivers/gpu/drm/radeon/atombios_encoders.c b/drivers/gpu/drm/radeon/atombios_encoders.c<br>
> index 01b20e1..2bb81d2 100644<br>
> --- a/drivers/gpu/drm/radeon/atombios_encoders.c<br>
> +++ b/drivers/gpu/drm/radeon/atombios_encoders.c<br>
> @@ -2506,10 +2506,15 @@ static void radeon_atom_encoder_prepare(struct drm_encoder *encoder)<br>
> /* this is needed for the pll/ss setup to work correctly in some cases */<br>
> atombios_set_encoder_crtc_source(encoder);<br>
> /* set up the FMT blocks */<br>
> +#ifdef CONFIG_DRM_RADEON_CIK<br>
> if (ASIC_IS_DCE8(rdev))<br>
> dce8_program_fmt(encoder);<br>
> else if (ASIC_IS_DCE4(rdev))<br>
> dce4_program_fmt(encoder);<br>
> +#else<br>
> + if (ASIC_IS_DCE4(rdev))<br>
> + dce4_program_fmt(encoder);<br>
> +#endif<br>
> else if (ASIC_IS_DCE3(rdev))<br>
> dce3_program_fmt(encoder);<br>
> else if (ASIC_IS_AVIVO(rdev))<br>
> diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c<br>
> index 2ad4628..f431946 100644<br>
> --- a/drivers/gpu/drm/radeon/evergreen.c<br>
> +++ b/drivers/gpu/drm/radeon/evergreen.c<br>
> @@ -209,12 +209,19 @@ extern void cayman_cp_int_cntl_setup(struct radeon_device *rdev,<br>
> int ring, u32 cp_int_cntl);<br>
> extern void cayman_vm_decode_fault(struct radeon_device *rdev,<br>
> u32 status, u32 addr);<br>
> +<br>
> +#ifdef CONFIG_DRM_RADEON_CIK<br>
> void cik_init_cp_pg_table(struct radeon_device *rdev);<br>
> +#endif<br>
><br>
> extern u32 si_get_csb_size(struct radeon_device *rdev);<br>
> extern void si_get_csb_buffer(struct radeon_device *rdev, volatile u32 *buffer);<br>
> +<br>
> +#ifdef CONFIG_DRM_RADEON_CIK<br>
> extern u32 cik_get_csb_size(struct radeon_device *rdev);<br>
> extern void cik_get_csb_buffer(struct radeon_device *rdev, volatile u32 *buffer);<br>
> +#endif<br>
> +<br>
> extern void rv770_set_clk_bypass_mode(struct radeon_device *rdev);<br>
><br>
> static const u32 evergreen_golden_registers[] =<br>
> @@ -4160,11 +4167,17 @@ int sumo_rlc_init(struct radeon_device *rdev)<br>
><br>
> if (cs_data) {<br>
> /* clear state block */<br>
> +#ifdef CONFIG_DRM_RADEON_CIK<br>
> if (rdev->family >= CHIP_BONAIRE) {<br>
> rdev->rlc.clear_state_size = dws = cik_get_csb_size(rdev);<br>
> } else if (rdev->family >= CHIP_TAHITI) {<br>
> rdev->rlc.clear_state_size = si_get_csb_size(rdev);<br>
> dws = rdev->rlc.clear_state_size + (256 / 4);<br>
> +#else<br>
> + if (rdev->family >= CHIP_TAHITI) {<br>
> + rdev->rlc.clear_state_size = si_get_csb_size(rdev);<br>
> + dws = rdev->rlc.clear_state_size + (256 / 4);<br>
> +#endif<br>
> } else {<br>
> reg_list_num = 0;<br>
> dws = 0;<br>
> @@ -4211,6 +4224,7 @@ int sumo_rlc_init(struct radeon_device *rdev)<br>
> }<br>
> /* set up the cs buffer */<br>
> dst_ptr = rdev->rlc.cs_ptr;<br>
> +#ifdef CONFIG_DRM_RADEON_CIK<br>
> if (rdev->family >= CHIP_BONAIRE) {<br>
> cik_get_csb_buffer(rdev, dst_ptr);<br>
> } else if (rdev->family >= CHIP_TAHITI) {<br>
> @@ -4219,6 +4233,14 @@ int sumo_rlc_init(struct radeon_device *rdev)<br>
> dst_ptr[1] = cpu_to_le32(lower_32_bits(reg_list_mc_addr));<br>
> dst_ptr[2] = cpu_to_le32(rdev->rlc.clear_state_size);<br>
> si_get_csb_buffer(rdev, &dst_ptr[(256/4)]);<br>
> +#else<br>
> + if (rdev->family >= CHIP_TAHITI) {<br>
> + reg_list_mc_addr = rdev->rlc.clear_state_gpu_addr + 256;<br>
> + dst_ptr[0] = cpu_to_le32(upper_32_bits(reg_list_mc_addr));<br>
> + dst_ptr[1] = cpu_to_le32(lower_32_bits(reg_list_mc_addr));<br>
> + dst_ptr[2] = cpu_to_le32(rdev->rlc.clear_state_size);<br>
> + si_get_csb_buffer(rdev, &dst_ptr[(256/4)]);<br>
> +#endif<br>
> } else {<br>
> reg_list_hdr_blk_index = 0;<br>
> reg_list_mc_addr = rdev->rlc.clear_state_gpu_addr + (reg_list_blk_index * 4);<br>
> @@ -4288,7 +4310,9 @@ int sumo_rlc_init(struct radeon_device *rdev)<br>
> return r;<br>
> }<br>
><br>
> +#ifdef CONFIG_DRM_RADEON_CIK<br>
> cik_init_cp_pg_table(rdev);<br>
> +#endif<br>
><br>
> radeon_bo_kunmap(rdev->rlc.cp_table_obj);<br>
> radeon_bo_unreserve(rdev->rlc.cp_table_obj);<br>
> diff --git a/drivers/gpu/drm/radeon/radeon_asic.c b/drivers/gpu/drm/radeon/radeon_asic.c<br>
> index 7d5a36d..2f4beff 100644<br>
> --- a/drivers/gpu/drm/radeon/radeon_asic.c<br>
> +++ b/drivers/gpu/drm/radeon/radeon_asic.c<br>
> @@ -126,6 +126,7 @@ static void radeon_register_accessor_init(struct radeon_device *rdev)<br>
> rdev->mc_wreg = &rs780_mc_wreg;<br>
> }<br>
><br>
> +#ifdef CONFIG_DRM_RADEON_CIK<br>
> if (rdev->family >= CHIP_BONAIRE) {<br>
> rdev->pciep_rreg = &cik_pciep_rreg;<br>
> rdev->pciep_wreg = &cik_pciep_wreg;<br>
> @@ -133,6 +134,12 @@ static void radeon_register_accessor_init(struct radeon_device *rdev)<br>
> rdev->pciep_rreg = &r600_pciep_rreg;<br>
> rdev->pciep_wreg = &r600_pciep_wreg;<br>
> }<br>
> +#else<br>
> + if (rdev->family >= CHIP_R600) {<br>
> + rdev->pciep_rreg = &r600_pciep_rreg;<br>
> + rdev->pciep_wreg = &r600_pciep_wreg;<br>
> + }<br>
> +#endif<br>
> }<br>
><br>
> static int radeon_invalid_get_allowed_info_register(struct radeon_device *rdev,<br>
> @@ -2023,6 +2030,8 @@ static struct radeon_asic si_asic = {<br>
> },<br>
> };<br>
><br>
> +#ifdef CONFIG_DRM_RADEON_CIK<br>
> +<br>
> static const struct radeon_asic_ring ci_gfx_ring = {<br>
> .ib_execute = &cik_ring_ib_execute,<br>
> .ib_parse = &cik_ib_parse,<br>
> @@ -2303,6 +2312,8 @@ static struct radeon_asic kv_asic = {<br>
> },<br>
> };<br>
><br>
> +#endif<br>
> +<br>
> /**<br>
> * radeon_asic_init - register asic specific callbacks<br>
> *<br>
> @@ -2573,6 +2584,7 @@ int radeon_asic_init(struct radeon_device *rdev)<br>
> break;<br>
> }<br>
> break;<br>
> +#ifdef CONFIG_DRM_RADEON_CIK<br>
> case CHIP_BONAIRE:<br>
> case CHIP_HAWAII:<br>
> rdev->asic = &ci_asic;<br>
> @@ -2679,6 +2691,7 @@ int radeon_asic_init(struct radeon_device *rdev)<br>
> }<br>
> rdev->has_uvd = true;<br>
> break;<br>
> +#endif<br>
> default:<br>
> /* FIXME: not supported yet */<br>
> return -EINVAL;<br>
<br>
</blockquote></div>