diff options
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 35 | 
1 files changed, 21 insertions, 14 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c index 60591dbc2097..fd1dc3236eca 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c @@ -88,9 +88,6 @@ void amdgpu_driver_unload_kms(struct drm_device *dev)  	if (adev->rmmio == NULL)  		goto done_free; -	if (amdgpu_sriov_vf(adev)) -		amdgpu_virt_request_full_gpu(adev, false); -  	if (adev->runpm) {  		pm_runtime_get_sync(dev->dev);  		pm_runtime_forbid(dev->dev); @@ -170,10 +167,17 @@ int amdgpu_driver_load_kms(struct drm_device *dev, unsigned long flags)  	}  	if (amdgpu_device_supports_boco(dev) && -	    (amdgpu_runtime_pm != 0)) /* enable runpm by default */ +	    (amdgpu_runtime_pm != 0)) /* enable runpm by default for boco */ +		adev->runpm = true; +	else if (amdgpu_device_supports_baco(dev) && +		 (amdgpu_runtime_pm != 0) && +		 (adev->asic_type >= CHIP_TOPAZ) && +		 (adev->asic_type != CHIP_VEGA10) && +		 (adev->asic_type != CHIP_VEGA20) && +		 (adev->asic_type != CHIP_ARCTURUS)) /* enable runpm on VI+ */  		adev->runpm = true;  	else if (amdgpu_device_supports_baco(dev) && -		 (amdgpu_runtime_pm > 0)) /* enable runpm if runpm=1 */ +		 (amdgpu_runtime_pm > 0))  /* enable runpm if runpm=1 on CI */  		adev->runpm = true;  	/* Call ACPI methods: require modeset init @@ -1110,14 +1114,15 @@ void amdgpu_driver_postclose_kms(struct drm_device *dev,  /**   * amdgpu_get_vblank_counter_kms - get frame count   * - * @dev: drm dev pointer - * @pipe: crtc to get the frame count from + * @crtc: crtc to get the frame count from   *   * Gets the frame count on the requested crtc (all asics).   * Returns frame count on success, -EINVAL on failure.   */ -u32 amdgpu_get_vblank_counter_kms(struct drm_device *dev, unsigned int pipe) +u32 amdgpu_get_vblank_counter_kms(struct drm_crtc *crtc)  { +	struct drm_device *dev = crtc->dev; +	unsigned int pipe = crtc->index;  	struct amdgpu_device *adev = dev->dev_private;  	int vpos, hpos, stat;  	u32 count; @@ -1177,14 +1182,15 @@ u32 amdgpu_get_vblank_counter_kms(struct drm_device *dev, unsigned int pipe)  /**   * amdgpu_enable_vblank_kms - enable vblank interrupt   * - * @dev: drm dev pointer - * @pipe: crtc to enable vblank interrupt for + * @crtc: crtc to enable vblank interrupt for   *   * Enable the interrupt on the requested crtc (all asics).   * Returns 0 on success, -EINVAL on failure.   */ -int amdgpu_enable_vblank_kms(struct drm_device *dev, unsigned int pipe) +int amdgpu_enable_vblank_kms(struct drm_crtc *crtc)  { +	struct drm_device *dev = crtc->dev; +	unsigned int pipe = crtc->index;  	struct amdgpu_device *adev = dev->dev_private;  	int idx = amdgpu_display_crtc_idx_to_irq_type(adev, pipe); @@ -1194,13 +1200,14 @@ int amdgpu_enable_vblank_kms(struct drm_device *dev, unsigned int pipe)  /**   * amdgpu_disable_vblank_kms - disable vblank interrupt   * - * @dev: drm dev pointer - * @pipe: crtc to disable vblank interrupt for + * @crtc: crtc to disable vblank interrupt for   *   * Disable the interrupt on the requested crtc (all asics).   */ -void amdgpu_disable_vblank_kms(struct drm_device *dev, unsigned int pipe) +void amdgpu_disable_vblank_kms(struct drm_crtc *crtc)  { +	struct drm_device *dev = crtc->dev; +	unsigned int pipe = crtc->index;  	struct amdgpu_device *adev = dev->dev_private;  	int idx = amdgpu_display_crtc_idx_to_irq_type(adev, pipe);  |