Commit aef8cc90 authored by Dave Airlie's avatar Dave Airlie

Merge branch 'drm-fixes-4.3' of git://people.freedesktop.org/~agd5f/linux

Two regression fixes and a memory leak fix for amdgpu and radeon.

* 'drm-fixes-4.3' of git://people.freedesktop.org/~agd5f/linux:
  drm/amdgpu: don't try to recreate sysfs entries on resume
  drm/radeon: don't try to recreate sysfs entries on resume
  drm/amdgpu: stop leaking page flip fence
parents 01815536 c86f5ebf
...@@ -1654,6 +1654,7 @@ struct amdgpu_pm { ...@@ -1654,6 +1654,7 @@ struct amdgpu_pm {
u8 fan_max_rpm; u8 fan_max_rpm;
/* dpm */ /* dpm */
bool dpm_enabled; bool dpm_enabled;
bool sysfs_initialized;
struct amdgpu_dpm dpm; struct amdgpu_dpm dpm;
const struct firmware *fw; /* SMC firmware */ const struct firmware *fw; /* SMC firmware */
uint32_t fw_version; uint32_t fw_version;
......
...@@ -184,10 +184,6 @@ int amdgpu_crtc_page_flip(struct drm_crtc *crtc, ...@@ -184,10 +184,6 @@ int amdgpu_crtc_page_flip(struct drm_crtc *crtc,
goto cleanup; goto cleanup;
} }
fence_get(work->excl);
for (i = 0; i < work->shared_count; ++i)
fence_get(work->shared[i]);
amdgpu_bo_get_tiling_flags(new_rbo, &tiling_flags); amdgpu_bo_get_tiling_flags(new_rbo, &tiling_flags);
amdgpu_bo_unreserve(new_rbo); amdgpu_bo_unreserve(new_rbo);
......
...@@ -695,6 +695,9 @@ int amdgpu_pm_sysfs_init(struct amdgpu_device *adev) ...@@ -695,6 +695,9 @@ int amdgpu_pm_sysfs_init(struct amdgpu_device *adev)
{ {
int ret; int ret;
if (adev->pm.sysfs_initialized)
return 0;
if (adev->pm.funcs->get_temperature == NULL) if (adev->pm.funcs->get_temperature == NULL)
return 0; return 0;
adev->pm.int_hwmon_dev = hwmon_device_register_with_groups(adev->dev, adev->pm.int_hwmon_dev = hwmon_device_register_with_groups(adev->dev,
...@@ -723,6 +726,8 @@ int amdgpu_pm_sysfs_init(struct amdgpu_device *adev) ...@@ -723,6 +726,8 @@ int amdgpu_pm_sysfs_init(struct amdgpu_device *adev)
return ret; return ret;
} }
adev->pm.sysfs_initialized = true;
return 0; return 0;
} }
......
...@@ -1658,6 +1658,7 @@ struct radeon_pm { ...@@ -1658,6 +1658,7 @@ struct radeon_pm {
u8 fan_max_rpm; u8 fan_max_rpm;
/* dpm */ /* dpm */
bool dpm_enabled; bool dpm_enabled;
bool sysfs_initialized;
struct radeon_dpm dpm; struct radeon_dpm dpm;
}; };
......
...@@ -1528,19 +1528,23 @@ int radeon_pm_late_init(struct radeon_device *rdev) ...@@ -1528,19 +1528,23 @@ int radeon_pm_late_init(struct radeon_device *rdev)
if (rdev->pm.pm_method == PM_METHOD_DPM) { if (rdev->pm.pm_method == PM_METHOD_DPM) {
if (rdev->pm.dpm_enabled) { if (rdev->pm.dpm_enabled) {
ret = device_create_file(rdev->dev, &dev_attr_power_dpm_state); if (!rdev->pm.sysfs_initialized) {
if (ret) ret = device_create_file(rdev->dev, &dev_attr_power_dpm_state);
DRM_ERROR("failed to create device file for dpm state\n"); if (ret)
ret = device_create_file(rdev->dev, &dev_attr_power_dpm_force_performance_level); DRM_ERROR("failed to create device file for dpm state\n");
if (ret) ret = device_create_file(rdev->dev, &dev_attr_power_dpm_force_performance_level);
DRM_ERROR("failed to create device file for dpm state\n"); if (ret)
/* XXX: these are noops for dpm but are here for backwards compat */ DRM_ERROR("failed to create device file for dpm state\n");
ret = device_create_file(rdev->dev, &dev_attr_power_profile); /* XXX: these are noops for dpm but are here for backwards compat */
if (ret) ret = device_create_file(rdev->dev, &dev_attr_power_profile);
DRM_ERROR("failed to create device file for power profile\n"); if (ret)
ret = device_create_file(rdev->dev, &dev_attr_power_method); DRM_ERROR("failed to create device file for power profile\n");
if (ret) ret = device_create_file(rdev->dev, &dev_attr_power_method);
DRM_ERROR("failed to create device file for power method\n"); if (ret)
DRM_ERROR("failed to create device file for power method\n");
if (!ret)
rdev->pm.sysfs_initialized = true;
}
mutex_lock(&rdev->pm.mutex); mutex_lock(&rdev->pm.mutex);
ret = radeon_dpm_late_enable(rdev); ret = radeon_dpm_late_enable(rdev);
...@@ -1556,7 +1560,8 @@ int radeon_pm_late_init(struct radeon_device *rdev) ...@@ -1556,7 +1560,8 @@ int radeon_pm_late_init(struct radeon_device *rdev)
} }
} }
} else { } else {
if (rdev->pm.num_power_states > 1) { if ((rdev->pm.num_power_states > 1) &&
(!rdev->pm.sysfs_initialized)) {
/* where's the best place to put these? */ /* where's the best place to put these? */
ret = device_create_file(rdev->dev, &dev_attr_power_profile); ret = device_create_file(rdev->dev, &dev_attr_power_profile);
if (ret) if (ret)
...@@ -1564,6 +1569,8 @@ int radeon_pm_late_init(struct radeon_device *rdev) ...@@ -1564,6 +1569,8 @@ int radeon_pm_late_init(struct radeon_device *rdev)
ret = device_create_file(rdev->dev, &dev_attr_power_method); ret = device_create_file(rdev->dev, &dev_attr_power_method);
if (ret) if (ret)
DRM_ERROR("failed to create device file for power method\n"); DRM_ERROR("failed to create device file for power method\n");
if (!ret)
rdev->pm.sysfs_initialized = true;
} }
} }
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment