diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2014-01-23 16:28:30 -0500 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2014-03-13 07:48:48 -0400 |
commit | 00d762cbd1fb5df63bf005ffa1c8d0275f79890e (patch) | |
tree | 545d202710a20b67701c7a42c00bcb7338dfa1c6 /drivers/gpu/drm/drm_crtc_helper.c | |
parent | 62ff94a5492175759546f8bc61383189d6b49122 (diff) |
drm: drop error code for drm_helper_resume_force_mode
No driver cares, and it should generally work. Add a big comment
when drivers can't use this for recompense.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/drm_crtc_helper.c')
-rw-r--r-- | drivers/gpu/drm/drm_crtc_helper.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c index 44d50f56afa3..0f60150adfc3 100644 --- a/drivers/gpu/drm/drm_crtc_helper.c +++ b/drivers/gpu/drm/drm_crtc_helper.c | |||
@@ -941,13 +941,25 @@ EXPORT_SYMBOL(drm_helper_mode_fill_fb_struct); | |||
941 | * force-restore the mode setting configuration e.g. on resume or when something | 941 | * force-restore the mode setting configuration e.g. on resume or when something |
942 | * else might have trampled over the hw state (like some overzealous old BIOSen | 942 | * else might have trampled over the hw state (like some overzealous old BIOSen |
943 | * tended to do). | 943 | * tended to do). |
944 | * | ||
945 | * This helper doesn't provide a error return value since restoring the old | ||
946 | * config should never fail due to resource allocation issues since the driver | ||
947 | * has successfully set the restored configuration already. Hence this should | ||
948 | * boil down to the equivalent of a few dpms on calls, which also don't provide | ||
949 | * an error code. | ||
950 | * | ||
951 | * Drivers where simply restoring an old configuration again might fail (e.g. | ||
952 | * due to slight differences in allocating shared resources when the | ||
953 | * configuration is restored in a different order than when userspace set it up) | ||
954 | * need to use their own restore logic. | ||
944 | */ | 955 | */ |
945 | int drm_helper_resume_force_mode(struct drm_device *dev) | 956 | void drm_helper_resume_force_mode(struct drm_device *dev) |
946 | { | 957 | { |
947 | struct drm_crtc *crtc; | 958 | struct drm_crtc *crtc; |
948 | struct drm_encoder *encoder; | 959 | struct drm_encoder *encoder; |
949 | struct drm_crtc_helper_funcs *crtc_funcs; | 960 | struct drm_crtc_helper_funcs *crtc_funcs; |
950 | int ret, encoder_dpms; | 961 | int encoder_dpms; |
962 | bool ret; | ||
951 | 963 | ||
952 | list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { | 964 | list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { |
953 | 965 | ||
@@ -957,6 +969,7 @@ int drm_helper_resume_force_mode(struct drm_device *dev) | |||
957 | ret = drm_crtc_helper_set_mode(crtc, &crtc->mode, | 969 | ret = drm_crtc_helper_set_mode(crtc, &crtc->mode, |
958 | crtc->x, crtc->y, crtc->fb); | 970 | crtc->x, crtc->y, crtc->fb); |
959 | 971 | ||
972 | /* Restoring the old config should never fail! */ | ||
960 | if (ret == false) | 973 | if (ret == false) |
961 | DRM_ERROR("failed to set mode on crtc %p\n", crtc); | 974 | DRM_ERROR("failed to set mode on crtc %p\n", crtc); |
962 | 975 | ||
@@ -979,9 +992,9 @@ int drm_helper_resume_force_mode(struct drm_device *dev) | |||
979 | drm_helper_choose_crtc_dpms(crtc)); | 992 | drm_helper_choose_crtc_dpms(crtc)); |
980 | } | 993 | } |
981 | } | 994 | } |
995 | |||
982 | /* disable the unused connectors while restoring the modesetting */ | 996 | /* disable the unused connectors while restoring the modesetting */ |
983 | drm_helper_disable_unused_functions(dev); | 997 | drm_helper_disable_unused_functions(dev); |
984 | return 0; | ||
985 | } | 998 | } |
986 | EXPORT_SYMBOL(drm_helper_resume_force_mode); | 999 | EXPORT_SYMBOL(drm_helper_resume_force_mode); |
987 | 1000 | ||