[PATCH 11/18] drm/amdgpu: export mmhub sw_init into gmc

Huang Rui ray.huang at amd.com
Thu Jun 1 01:42:58 UTC 2017


On Thu, Jun 01, 2017 at 01:04:52AM +0800, Koenig, Christian wrote:
> Am 31.05.2017 um 18:14 schrieb Huang Rui:
> > Signed-off-by: Huang Rui <ray.huang at amd.com>
> > ---
> >   drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c   |  1 +
> >   drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c | 27 +++++++++++++++------------
> >   drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.h |  1 +
> >   3 files changed, 17 insertions(+), 12 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c b/drivers/gpu/drm/amd/
> amdgpu/gmc_v9_0.c
> > index 2fee1c6..077b7ce 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
> > @@ -552,6 +552,7 @@ static int gmc_v9_0_sw_init(void *handle)
> >        struct amdgpu_device *adev = (struct amdgpu_device *)handle;
> >  
> >        gfxhub_v1_0_init(adev);
> > +     mmhub_v1_0_init(adev);
> >  
> >        spin_lock_init(&adev->mc.invalidate_lock);
> >  
> > diff --git a/drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c b/drivers/gpu/drm/amd/
> amdgpu/mmhub_v1_0.c
> > index 2f85647..20d8d2c 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c
> > @@ -347,19 +347,8 @@ void mmhub_v1_0_set_fault_enable_default(struct
> amdgpu_device *adev, bool value)
> >        WREG32(SOC15_REG_OFFSET(MMHUB, 0, mmVM_L2_PROTECTION_FAULT_CNTL),
> tmp);
> >   }
> >  
> > -static int mmhub_v1_0_early_init(void *handle)
> > +void mmhub_v1_0_init(struct amdgpu_device *adev)
> >   {
> > -     return 0;
> > -}
> > -
> > -static int mmhub_v1_0_late_init(void *handle)
> > -{
> > -     return 0;
> > -}
> > -
> > -static int mmhub_v1_0_sw_init(void *handle)
> > -{
> > -     struct amdgpu_device *adev = (struct amdgpu_device *)handle;
> >        struct amdgpu_vmhub *hub = &adev->vmhub[AMDGPU_MMHUB];
> >  
> >        hub->ctx0_ptb_addr_lo32 =
> > @@ -379,6 +368,20 @@ static int mmhub_v1_0_sw_init(void *handle)
> >        hub->vm_l2_pro_fault_cntl =
> >                SOC15_REG_OFFSET(MMHUB, 0, mmVM_L2_PROTECTION_FAULT_CNTL);
> >  
> > +}
> > +
> > +static int mmhub_v1_0_early_init(void *handle)
> > +{
> > +     return 0;
> > +}
> > +
> > +static int mmhub_v1_0_late_init(void *handle)
> > +{
> > +     return 0;
> > +}
> > +
> > +static int mmhub_v1_0_sw_init(void *handle)
> > +{
> >        return 0;
> 
> Return with a value in a function returning void?
> 
> Check the compile log for warnings introduced by the patch set.
> 

The diff log doesn't show it well.
Actually, I just define new function named mmhub_v1_0_init as "void" and
its return type is also "void". And mmhub_v1_0_sw_init returning value
should be "0" here.

Yes, I checked compile log, no warning introduced.

Thanks,
Ray


More information about the amd-gfx mailing list