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

Thanks for the feedback

I'll take a look at the PCI ID's tonight


On Mon, 8 Feb 2016, 9:54 a.= m.=C2=A0Christian K=C3=B6nig <deathsimple@vodafone.de> wrote:
Am 08.02.2016 um 03:45 schrieb Mike Lothian:
> This will allow us to disable CIK support in the radeon driver, so bot= h
> radeon and amdgpu can be around at the same time without conflicting >
> Signed-of-by: Mike Lothian <mike@fireburn.co.uk>
> ---
>
> I've tested this on my Kabini system radeon doesn't initalise = when compiled in but
> I do get these messages in my dmesg:
>
> [drm] radeon kernel modesetting enabled.
> [drm] initializing kernel modesetting (KABINI 0x1002:0x9832 0x1025:0x0= 800).
> radeon 0000:00:01.0: Fatal error during GPU init
> radeon: probe of 0000:00:01.0 failed with error -22
>
> Am I going down the right route with this?

Well, probably not but it's at least start.

First of all the CIK support in AMDGPU isn't really mature at the
moment. We only used it for bringup of the initial driver and it still
has some bugs. So at least currently we don't want to encourage people<= br> to use amdgpu over radeon for CIK parts.

Additional to that the amdgpu support compiles perfectly fine even when
radeon has CIK support, so a Kconfig dependency between the two is
clearly not what we want.

Last, but not least you need to make the PCI IDs in
include/drm/drm_pciids.h for CIK parts depend on the new configuration
option as well. This is why you run into an error with your patch.

Regards,
Christian.

>
>=C2=A0 =C2=A0drivers/gpu/drm/amd/amdgpu/Kconfig=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0|=C2=A0 1 +
>=C2=A0 =C2=A0drivers/gpu/drm/radeon/Kconfig=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0| 11 +++++++++++
>=C2=A0 =C2=A0drivers/gpu/drm/radeon/Makefile=C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 | 11 +++++++----
>=C2=A0 =C2=A0drivers/gpu/drm/radeon/atombios_encoders.c |=C2=A0 5 +++++=
>=C2=A0 =C2=A0drivers/gpu/drm/radeon/evergreen.c=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0| 24 ++++++++++++++++++++++++
>=C2=A0 =C2=A0drivers/gpu/drm/radeon/radeon_asic.c=C2=A0 =C2=A0 =C2=A0 = =C2=A0| 13 +++++++++++++
>=C2=A0 =C2=A06 files changed, 61 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/Kconfig b/drivers/gpu/drm/amd/= amdgpu/Kconfig
> index b30fcfa..bb58f17 100644
> --- a/drivers/gpu/drm/amd/amdgpu/Kconfig
> +++ b/drivers/gpu/drm/amd/amdgpu/Kconfig
> @@ -1,6 +1,7 @@
>=C2=A0 =C2=A0config DRM_AMDGPU_CIK
>=C2=A0 =C2=A0 =C2=A0 =C2=A0bool "Enable amdgpu support for CIK par= ts"
>=C2=A0 =C2=A0 =C2=A0 =C2=A0depends on DRM_AMDGPU
> +=C2=A0 =C2=A0 =C2=A0depends on !DRM_RADEON_CIK
>=C2=A0 =C2=A0 =C2=A0 =C2=A0help
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Choose this option if you want to ena= ble experimental support
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0for CIK asics.
> diff --git a/drivers/gpu/drm/radeon/Kconfig b/drivers/gpu/drm/radeon/K= config
> index 9909f5c..32bc77e 100644
> --- a/drivers/gpu/drm/radeon/Kconfig
> +++ b/drivers/gpu/drm/radeon/Kconfig
> @@ -1,3 +1,14 @@
> +config DRM_RADEON_CIK
> +=C2=A0 =C2=A0 =C2=A0bool "Enable radeon support for CIK parts&qu= ot;
> +=C2=A0 =C2=A0 =C2=A0depends on DRM_RADEON
> +=C2=A0 =C2=A0 =C2=A0default y
> +=C2=A0 =C2=A0 =C2=A0help
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0Choose this option if you want to enable s= upport for CIK
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0asics.
> +
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0Consider disabling this option if you wish= to enable CIK
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0in the amdgpu driver.
> +
>=C2=A0 =C2=A0config DRM_RADEON_USERPTR
>=C2=A0 =C2=A0 =C2=A0 =C2=A0bool "Always enable userptr support&quo= t;
>=C2=A0 =C2=A0 =C2=A0 =C2=A0depends on DRM_RADEON
> diff --git a/drivers/gpu/drm/radeon/Makefile b/drivers/gpu/drm/radeon/= Makefile
> index 08bd17d..6c43901 100644
> --- a/drivers/gpu/drm/radeon/Makefile
> +++ b/drivers/gpu/drm/radeon/Makefile
> @@ -72,13 +72,15 @@ radeon-y +=3D radeon_device.o radeon_asic.o radeon= _kms.o \
>=C2=A0 =C2=A0 =C2=A0 =C2=A0evergreen.o evergreen_cs.o evergreen_blit_sh= aders.o \
>=C2=A0 =C2=A0 =C2=A0 =C2=A0evergreen_hdmi.o radeon_trace_points.o ni.o = cayman_blit_shaders.o \
>=C2=A0 =C2=A0 =C2=A0 =C2=A0atombios_encoders.o radeon_semaphore.o radeo= n_sa.o atombios_i2c.o si.o \
> -=C2=A0 =C2=A0 =C2=A0si_blit_shaders.o radeon_prime.o cik.o cik_blit_s= haders.o \
> +=C2=A0 =C2=A0 =C2=A0si_blit_shaders.o radeon_prime.o \
>=C2=A0 =C2=A0 =C2=A0 =C2=A0r600_dpm.o rs780_dpm.o rv6xx_dpm.o rv770_dpm= .o rv730_dpm.o rv740_dpm.o \
>=C2=A0 =C2=A0 =C2=A0 =C2=A0rv770_smc.o cypress_dpm.o btc_dpm.o sumo_dpm= .o sumo_smc.o trinity_dpm.o \
> -=C2=A0 =C2=A0 =C2=A0trinity_smc.o ni_dpm.o si_smc.o si_dpm.o kv_smc.o= kv_dpm.o ci_smc.o \
> -=C2=A0 =C2=A0 =C2=A0ci_dpm.o dce6_afmt.o radeon_vm.o radeon_ucode.o r= adeon_ib.o \
> +=C2=A0 =C2=A0 =C2=A0trinity_smc.o ni_dpm.o si_smc.o si_dpm.o \
> +=C2=A0 =C2=A0 =C2=A0dce6_afmt.o radeon_vm.o radeon_ucode.o radeon_ib.= o \
>=C2=A0 =C2=A0 =C2=A0 =C2=A0radeon_sync.o radeon_audio.o radeon_dp_auxch= .o radeon_dp_mst.o
>
> +radeon-$(CONFIG_DRM_RADEON_CIK) +=3D cik.o cik_blit_shaders.o kv_smc.= o kv_dpm.o ci_smc.o ci_dpm.o
> +
>=C2=A0 =C2=A0radeon-$(CONFIG_MMU_NOTIFIER) +=3D radeon_mn.o
>
>=C2=A0 =C2=A0# add async DMA block
> @@ -88,7 +90,8 @@ radeon-y +=3D \
>=C2=A0 =C2=A0 =C2=A0 =C2=A0evergreen_dma.o \
>=C2=A0 =C2=A0 =C2=A0 =C2=A0ni_dma.o \
>=C2=A0 =C2=A0 =C2=A0 =C2=A0si_dma.o \
> -=C2=A0 =C2=A0 =C2=A0cik_sdma.o \
> +
> +radeon-$(CONFIG_DRM_RADEON_CIK) +=3D cik_sdma.o
>
>=C2=A0 =C2=A0# add UVD block
>=C2=A0 =C2=A0radeon-y +=3D \
> diff --git a/drivers/gpu/drm/radeon/atombios_encoders.c b/drivers/gpu/= drm/radeon/atombios_encoders.c
> index 01b20e1..2bb81d2 100644
> --- a/drivers/gpu/drm/radeon/atombios_encoders.c
> +++ b/drivers/gpu/drm/radeon/atombios_encoders.c
> @@ -2506,10 +2506,15 @@ static void radeon_atom_encoder_prepare(struct= drm_encoder *encoder)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0/* this is needed for the pll/ss setup to wo= rk correctly in some cases */
>=C2=A0 =C2=A0 =C2=A0 =C2=A0atombios_set_encoder_crtc_source(encoder); >=C2=A0 =C2=A0 =C2=A0 =C2=A0/* set up the FMT blocks */
> +#ifdef CONFIG_DRM_RADEON_CIK
>=C2=A0 =C2=A0 =C2=A0 =C2=A0if (ASIC_IS_DCE8(rdev))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0dce8_program_fmt= (encoder);
>=C2=A0 =C2=A0 =C2=A0 =C2=A0else if (ASIC_IS_DCE4(rdev))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0dce4_program_fmt= (encoder);
> +#else
> +=C2=A0 =C2=A0 =C2=A0if (ASIC_IS_DCE4(rdev))
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0dce4_program_fmt(enco= der);
> +#endif
>=C2=A0 =C2=A0 =C2=A0 =C2=A0else if (ASIC_IS_DCE3(rdev))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0dce3_program_fmt= (encoder);
>=C2=A0 =C2=A0 =C2=A0 =C2=A0else if (ASIC_IS_AVIVO(rdev))
> diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/rade= on/evergreen.c
> index 2ad4628..f431946 100644
> --- a/drivers/gpu/drm/radeon/evergreen.c
> +++ b/drivers/gpu/drm/radeon/evergreen.c
> @@ -209,12 +209,19 @@ extern void cayman_cp_int_cntl_setup(struct rade= on_device *rdev,
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 int ring, u32 cp_in= t_cntl);
>=C2=A0 =C2=A0extern void cayman_vm_decode_fault(struct radeon_device *r= dev,
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 u32 status, u32 addr);
> +
> +#ifdef CONFIG_DRM_RADEON_CIK
>=C2=A0 =C2=A0void cik_init_cp_pg_table(struct radeon_device *rdev);
> +#endif
>
>=C2=A0 =C2=A0extern u32 si_get_csb_size(struct radeon_device *rdev); >=C2=A0 =C2=A0extern void si_get_csb_buffer(struct radeon_device *rdev, = volatile u32 *buffer);
> +
> +#ifdef CONFIG_DRM_RADEON_CIK
>=C2=A0 =C2=A0extern u32 cik_get_csb_size(struct radeon_device *rdev); >=C2=A0 =C2=A0extern void cik_get_csb_buffer(struct radeon_device *rdev,= volatile u32 *buffer);
> +#endif
> +
>=C2=A0 =C2=A0extern void rv770_set_clk_bypass_mode(struct radeon_device= *rdev);
>
>=C2=A0 =C2=A0static const u32 evergreen_golden_registers[] =3D
> @@ -4160,11 +4167,17 @@ int sumo_rlc_init(struct radeon_device *rdev)<= br> >
>=C2=A0 =C2=A0 =C2=A0 =C2=A0if (cs_data) {
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0/* clear state b= lock */
> +#ifdef CONFIG_DRM_RADEON_CIK
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (rdev->fam= ily >=3D CHIP_BONAIRE) {
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0rdev->rlc.clear_state_size =3D dws =3D cik_get_csb_size(rde= v);
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0} else if (rdev-= >family >=3D CHIP_TAHITI) {
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0rdev->rlc.clear_state_size =3D si_get_csb_size(rdev);
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0dws =3D rdev->rlc.clear_state_size + (256 / 4);
> +#else
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (rdev->family &= gt;=3D CHIP_TAHITI) {
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0rdev->rlc.clear_state_size =3D si_get_csb_size(rdev);
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0dws =3D rdev->rlc.clear_state_size + (256 / 4);
> +#endif
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0} else {
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0reg_list_num =3D 0;
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0dws =3D 0;
> @@ -4211,6 +4224,7 @@ int sumo_rlc_init(struct radeon_device *rdev) >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0/* set up the cs= buffer */
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0dst_ptr =3D rdev= ->rlc.cs_ptr;
> +#ifdef CONFIG_DRM_RADEON_CIK
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (rdev->fam= ily >=3D CHIP_BONAIRE) {
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0cik_get_csb_buffer(rdev, dst_ptr);
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0} else if (rdev-= >family >=3D CHIP_TAHITI) {
> @@ -4219,6 +4233,14 @@ int sumo_rlc_init(struct radeon_device *rdev) >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0dst_ptr[1] =3D cpu_to_le32(lower_32_bits(reg_list_mc_addr)); >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0dst_ptr[2] =3D cpu_to_le32(rdev->rlc.clear_state_size);
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0si_get_csb_buffer(rdev, &dst_ptr[(256/4)]);
> +#else
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (rdev->family &= gt;=3D CHIP_TAHITI) {
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0reg_list_mc_addr =3D rdev->rlc.clear_state_gpu_addr + 256;
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0dst_ptr[0] =3D cpu_to_le32(upper_32_bits(reg_list_mc_addr));
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0dst_ptr[1] =3D cpu_to_le32(lower_32_bits(reg_list_mc_addr));
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0dst_ptr[2] =3D cpu_to_le32(rdev->rlc.clear_state_size);
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0si_get_csb_buffer(rdev, &dst_ptr[(256/4)]);
> +#endif
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0} else {
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0reg_list_hdr_blk_index =3D 0;
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0reg_list_mc_addr =3D rdev->rlc.clear_state_gpu_addr + (reg_= list_blk_index * 4);
> @@ -4288,7 +4310,9 @@ int sumo_rlc_init(struct radeon_device *rdev) >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0return r;
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}
>
> +#ifdef CONFIG_DRM_RADEON_CIK
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0cik_init_cp_pg_t= able(rdev);
> +#endif
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0radeon_bo_kunmap= (rdev->rlc.cp_table_obj);
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0radeon_bo_unrese= rve(rdev->rlc.cp_table_obj);
> diff --git a/drivers/gpu/drm/radeon/radeon_asic.c b/drivers/gpu/drm/ra= deon/radeon_asic.c
> index 7d5a36d..2f4beff 100644
> --- a/drivers/gpu/drm/radeon/radeon_asic.c
> +++ b/drivers/gpu/drm/radeon/radeon_asic.c
> @@ -126,6 +126,7 @@ static void radeon_register_accessor_init(struct r= adeon_device *rdev)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0rdev->mc_wreg= =3D &rs780_mc_wreg;
>=C2=A0 =C2=A0 =C2=A0 =C2=A0}
>
> +#ifdef CONFIG_DRM_RADEON_CIK
>=C2=A0 =C2=A0 =C2=A0 =C2=A0if (rdev->family >=3D CHIP_BONAIRE) {<= br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0rdev->pciep_r= reg =3D &cik_pciep_rreg;
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0rdev->pciep_w= reg =3D &cik_pciep_wreg;
> @@ -133,6 +134,12 @@ static void radeon_register_accessor_init(struct = radeon_device *rdev)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0rdev->pciep_r= reg =3D &r600_pciep_rreg;
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0rdev->pciep_w= reg =3D &r600_pciep_wreg;
>=C2=A0 =C2=A0 =C2=A0 =C2=A0}
> +#else
> +=C2=A0 =C2=A0 =C2=A0if (rdev->family >=3D CHIP_R600) {
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0rdev->pciep_rreg = =3D &r600_pciep_rreg;
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0rdev->pciep_wreg = =3D &r600_pciep_wreg;
> +=C2=A0 =C2=A0 =C2=A0}
> +#endif
>=C2=A0 =C2=A0}
>
>=C2=A0 =C2=A0static int radeon_invalid_get_allowed_info_register(struct= radeon_device *rdev,
> @@ -2023,6 +2030,8 @@ static struct radeon_asic si_asic =3D {
>=C2=A0 =C2=A0 =C2=A0 =C2=A0},
>=C2=A0 =C2=A0};
>
> +#ifdef CONFIG_DRM_RADEON_CIK
> +
>=C2=A0 =C2=A0static const struct radeon_asic_ring ci_gfx_ring =3D {
>=C2=A0 =C2=A0 =C2=A0 =C2=A0.ib_execute =3D &cik_ring_ib_execute, >=C2=A0 =C2=A0 =C2=A0 =C2=A0.ib_parse =3D &cik_ib_parse,
> @@ -2303,6 +2312,8 @@ static struct radeon_asic kv_asic =3D {
>=C2=A0 =C2=A0 =C2=A0 =C2=A0},
>=C2=A0 =C2=A0};
>
> +#endif
> +
>=C2=A0 =C2=A0/**
>=C2=A0 =C2=A0 * radeon_asic_init - register asic specific callbacks
>=C2=A0 =C2=A0 *
> @@ -2573,6 +2584,7 @@ int radeon_asic_init(struct radeon_device *rdev)=
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0break;
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0break;
> +#ifdef CONFIG_DRM_RADEON_CIK
>=C2=A0 =C2=A0 =C2=A0 =C2=A0case CHIP_BONAIRE:
>=C2=A0 =C2=A0 =C2=A0 =C2=A0case CHIP_HAWAII:
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0rdev->asic = =3D &ci_asic;
> @@ -2679,6 +2691,7 @@ int radeon_asic_init(struct radeon_device *rdev)=
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0rdev->has_uvd= =3D true;
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0break;
> +#endif
>=C2=A0 =C2=A0 =C2=A0 =C2=A0default:
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0/* FIXME: not su= pported yet */
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return -EINVAL;<= br>
--001a113dbd1aa966e7052b3f68c3-- --===============1614544144== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVsCg== --===============1614544144==--