diff options
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c | 22 | 
1 files changed, 12 insertions, 10 deletions
| diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c index d0aea5e39531..2d51b7694d1f 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c @@ -47,11 +47,13 @@ bool amdgpu_virt_mmio_blocked(struct amdgpu_device *adev)  void amdgpu_virt_init_setting(struct amdgpu_device *adev)  { +	struct drm_device *ddev = adev_to_drm(adev); +  	/* enable virtual display */  	if (adev->mode_info.num_crtc == 0)  		adev->mode_info.num_crtc = 1;  	adev->enable_virtual_display = true; -	adev_to_drm(adev)->driver->driver_features &= ~DRIVER_ATOMIC; +	ddev->driver_features &= ~DRIVER_ATOMIC;  	adev->cg_flags = 0;  	adev->pg_flags = 0;  } @@ -104,7 +106,7 @@ failed_kiq:  /**   * amdgpu_virt_request_full_gpu() - request full gpu access - * @amdgpu:	amdgpu device. + * @adev:	amdgpu device.   * @init:	is driver init time.   * When start to init/fini driver, first need to request full gpu access.   * Return: Zero if request success, otherwise will return error. @@ -127,7 +129,7 @@ int amdgpu_virt_request_full_gpu(struct amdgpu_device *adev, bool init)  /**   * amdgpu_virt_release_full_gpu() - release full gpu access - * @amdgpu:	amdgpu device. + * @adev:	amdgpu device.   * @init:	is driver init time.   * When finishing driver init/fini, need to release full gpu access.   * Return: Zero if release success, otherwise will returen error. @@ -149,7 +151,7 @@ int amdgpu_virt_release_full_gpu(struct amdgpu_device *adev, bool init)  /**   * amdgpu_virt_reset_gpu() - reset gpu - * @amdgpu:	amdgpu device. + * @adev:	amdgpu device.   * Send reset command to GPU hypervisor to reset GPU that VM is using   * Return: Zero if reset success, otherwise will return error.   */ @@ -184,7 +186,7 @@ void amdgpu_virt_request_init_data(struct amdgpu_device *adev)  /**   * amdgpu_virt_wait_reset() - wait for reset gpu completed - * @amdgpu:	amdgpu device. + * @adev:	amdgpu device.   * Wait for GPU reset completed.   * Return: Zero if reset success, otherwise will return error.   */ @@ -200,7 +202,7 @@ int amdgpu_virt_wait_reset(struct amdgpu_device *adev)  /**   * amdgpu_virt_alloc_mm_table() - alloc memory for mm table - * @amdgpu:	amdgpu device. + * @adev:	amdgpu device.   * MM table is used by UVD and VCE for its initialization   * Return: Zero if allocate success.   */ @@ -230,7 +232,7 @@ int amdgpu_virt_alloc_mm_table(struct amdgpu_device *adev)  /**   * amdgpu_virt_free_mm_table() - free mm table memory - * @amdgpu:	amdgpu device. + * @adev:	amdgpu device.   * Free MM table memory   */  void amdgpu_virt_free_mm_table(struct amdgpu_device *adev) @@ -280,8 +282,8 @@ static int amdgpu_virt_init_ras_err_handler_data(struct amdgpu_device *adev)  	if (!*data)  		return -ENOMEM; -	bps = kmalloc(align_space * sizeof((*data)->bps), GFP_KERNEL); -	bps_bo = kmalloc(align_space * sizeof((*data)->bps_bo), GFP_KERNEL); +	bps = kmalloc_array(align_space, sizeof((*data)->bps), GFP_KERNEL); +	bps_bo = kmalloc_array(align_space, sizeof((*data)->bps_bo), GFP_KERNEL);  	if (!bps || !bps_bo) {  		kfree(bps); @@ -555,7 +557,7 @@ static int amdgpu_virt_write_vf2pf_data(struct amdgpu_device *adev)  	return 0;  } -void amdgpu_virt_update_vf2pf_work_item(struct work_struct *work) +static void amdgpu_virt_update_vf2pf_work_item(struct work_struct *work)  {  	struct amdgpu_device *adev = container_of(work, struct amdgpu_device, virt.vf2pf_work.work); | 
