On 7/24/19 10:24 AM, Michel Dänzer wrote: > On 2019-07-24 4:10 p.m., Andrey Grodzovsky wrote: >> Move the logic to clear AMDGPU_GEM_CREATE_CPU_GTT_USWC in >> amdgpu_bo_do_create into standalone helper so it can be reused >> in other functions. >> >> Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@xxxxxxx> >> --- >> [...] >> >> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c >> index 989b7b5..64c45bc 100644 >> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c >> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c >> @@ -413,6 +413,41 @@ static bool amdgpu_bo_validate_size(struct amdgpu_device *adev, >> return false; >> } >> >> +void amdgpu_bo_validate_uswc(u64 *bo_flags) > This API is a bit weird. :) I'd suggest something like > > bool amdgpu_uswc_supported(void) > { > if ([various conditions]) > return false; > > return true; > } Yea, the code is confusing with all #ifdefs so i wanted minimal changes to not break anything, but i can do this way to. Andrey > >> @@ -466,33 +501,7 @@ static int amdgpu_bo_do_create(struct amdgpu_device *adev, >> [...] >> + amdgpu_bo_validate_uswc(&bo->flags); > And then > > if (!amdgpu_uswc_supported()) > bo->flags &= ~AMDGPU_GEM_CREATE_CPU_GTT_USWC; > > here. > > _______________________________________________ amd-gfx mailing list amd-gfx@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/amd-gfx