On Tue, Jun 2, 2020 at 9:56 AM Liang, Prike <prike.li...@amd.com> wrote:
>
> [AMD Official Use Only - Internal Distribution Only]
>
> Ah not aware the enable patch before. But the already enable patch seems 
> can't fallback to legacy gpuinfo FW load method when not support discovery 
> and also may miss destroy the discovery_bin object when driver shut down.
>

I think it's already handled.  See these patches:
https://cgit.freedesktop.org/~agd5f/linux/commit/?h=amd-staging-drm-next&id=4d09621cc55bcec9ec0aa038c8ffcffd2017837f
https://cgit.freedesktop.org/~agd5f/linux/commit/?h=amd-staging-drm-next&id=6206aa0f74e7d22ca43975bd8f2979cdfd128b40

Alex

> Thanks,
> Prike
> > -----Original Message-----
> > From: Alex Deucher <alexdeuc...@gmail.com>
> > Sent: Tuesday, June 2, 2020 9:35 PM
> > To: Liang, Prike <prike.li...@amd.com>
> > Cc: amd-gfx@lists.freedesktop.org; Deucher, Alexander
> > <alexander.deuc...@amd.com>; Huang, Ray <ray.hu...@amd.com>
> > Subject: Re: [PATCH] drm/amdgpu: enable renoir discovery for gc info
> > retrieved
> >
> > On Mon, Jun 1, 2020 at 10:14 PM Liang, Prike <prike.li...@amd.com> wrote:
> > >
> > > [AMD Official Use Only - Internal Distribution Only]
> > >
> > > Ping...
> >
> > Already enabled:
> > https://nam11.safelinks.protection.outlook.com/?url=https:%2F%2Fcgit.free
> > desktop.org%2F~agd5f%2Flinux%2Fcommit%2F%3Fh%3Damd-staging-drm-
> > next%26id%3De467ab869f5783cf93d4cf24c6ac647cc29d1fb5&amp;data=02%
> > 7C01%7CPrike.Liang%40amd.com%7C5bcc45116bb042163cec08d806f9bd58
> > %7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637267016987033
> > 430&amp;sdata=KJ0xmSPXwlZ4LEfhAYoFzAwaWyx3laoLAsQccMM0pcs%3D&
> > amp;reserved=0
> >
> > Alex
> >
> > >
> > > Thanks,
> > > > -----Original Message-----
> > > > From: Liang, Prike <prike.li...@amd.com>
> > > > Sent: Friday, May 29, 2020 11:28 AM
> > > > To: amd-gfx@lists.freedesktop.org
> > > > Cc: Deucher, Alexander <alexander.deuc...@amd.com>; Huang, Ray
> > > > <ray.hu...@amd.com>; Liang, Prike <prike.li...@amd.com>
> > > > Subject: [PATCH] drm/amdgpu: enable renoir discovery for gc info
> > > > retrieved
> > > >
> > > > Use ip discovery GC table instead of gpu info firmware for exporting
> > > > gpu info to inquire interface.As Renoir discovery has same version
> > > > with Navi1x therefore just enable it same way as Navi1x.
> > > >
> > > > Signed-off-by: Prike.Liang <prike.li...@amd.com>
> > > > ---
> > > >  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 23
> > > > ++++++++++++++++++++---
> > > >  1 file changed, 20 insertions(+), 3 deletions(-)
> > > >
> > > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> > > > b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> > > > index 2f0e8da..bff740ccd 100644
> > > > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> > > > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> > > > @@ -1528,7 +1528,7 @@ static int
> > > > amdgpu_device_parse_gpu_info_fw(struct amdgpu_device *adev)  {
> > > > const char *chip_name;  char fw_name[30]; -int err;
> > > > +int err, r;
> > > >  const struct gpu_info_firmware_header_v1_0 *hdr;
> > > >
> > > >  adev->firmware.gpu_info_fw = NULL;
> > > > @@ -1578,6 +1578,23 @@ static int
> > > > amdgpu_device_parse_gpu_info_fw(struct amdgpu_device *adev)
> > > > chip_name = "arcturus";  break;  case CHIP_RENOIR:
> > > > +if (amdgpu_discovery) {
> > > > +/**
> > > > + * For RENOIR series seems needn't reinitialize the reg base
> > > > again as it already set during
> > > > + * early init,if any concern here will need export
> > > > amdgpu_discovery_init() for this case.
> > > > + */
> > > > +r = amdgpu_discovery_reg_base_init(adev);
> > > > +if (r) {
> > > > +DRM_WARN("failed to get ip discovery table,
> > > > "
> > > > +"fallback to get gpu info in legacy
> > > > method\n");
> > > > +goto legacy_gpuinfo;
> > > > +}
> > > > +
> > > > +amdgpu_discovery_get_gfx_info(adev);
> > > > +
> > > > +return 0;
> > > > +}
> > > > +legacy_gpuinfo:
> > > >  chip_name = "renoir";
> > > >  break;
> > > >  case CHIP_NAVI10:
> > > > @@ -1617,7 +1634,7 @@ static int
> > > > amdgpu_device_parse_gpu_info_fw(struct amdgpu_device *adev)  (const
> > > > struct gpu_info_firmware_v1_0 *)(adev-
> > > > >firmware.gpu_info_fw->data +
> > > >
> > > > le32_to_cpu(hdr->header.ucode_array_offset_bytes));
> > > >
> > > > -if (amdgpu_discovery && adev->asic_type >= CHIP_NAVI10) {
> > > > +if (amdgpu_discovery && adev->asic_type >= CHIP_RENOIR
> > > > && !r) {
> > > >  amdgpu_discovery_get_gfx_info(adev);
> > > >  goto parse_soc_bounding_box;
> > > >  }
> > > > @@ -3364,7 +3381,7 @@ void amdgpu_device_fini(struct
> > amdgpu_device
> > > > *adev)
> > > >  sysfs_remove_files(&adev->dev->kobj, amdgpu_dev_attributes);  if
> > > > (IS_ENABLED(CONFIG_PERF_EVENTS))  amdgpu_pmu_fini(adev); -if
> > > > (amdgpu_discovery && adev->asic_type >= CHIP_NAVI10)
> > > > +if (amdgpu_discovery && adev->asic_type >= CHIP_RENOIR)
> > > >  amdgpu_discovery_fini(adev);
> > > >  }
> > > >
> > > > --
> > > > 2.7.4
> > >
> > > _______________________________________________
> > > amd-gfx mailing list
> > > amd-gfx@lists.freedesktop.org
> > > https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flist
> > > s.freedesktop.org%2Fmailman%2Flistinfo%2Famd-
> > gfx&amp;data=02%7C01%7CPr
> > >
> > ike.Liang%40amd.com%7C5bcc45116bb042163cec08d806f9bd58%7C3dd896
> > 1fe4884
> > >
> > e608e11a82d994e183d%7C0%7C0%7C637267016987033430&amp;sdata=R%
> > 2F%2BY%2B
> > >
> > z%2BKHh09WazkQqS%2FbwH%2BeBM97%2Fx5hvqWAjUYEtM%3D&amp;res
> > erved=0
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reply via email to