aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/drm/drm_crtc_helper.c19
-rw-r--r--include/drm/drm_crtc_helper.h2
2 files changed, 17 insertions, 4 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 */
945int drm_helper_resume_force_mode(struct drm_device *dev) 956void 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}
986EXPORT_SYMBOL(drm_helper_resume_force_mode); 999EXPORT_SYMBOL(drm_helper_resume_force_mode);
987 1000
diff --git a/include/drm/drm_crtc_helper.h b/include/drm/drm_crtc_helper.h
index b6c17980cd00..0bb34ca2ad2b 100644
--- a/include/drm/drm_crtc_helper.h
+++ b/include/drm/drm_crtc_helper.h
@@ -160,7 +160,7 @@ static inline void drm_connector_helper_add(struct drm_connector *connector,
160 connector->helper_private = (void *)funcs; 160 connector->helper_private = (void *)funcs;
161} 161}
162 162
163extern int drm_helper_resume_force_mode(struct drm_device *dev); 163extern void drm_helper_resume_force_mode(struct drm_device *dev);
164extern void drm_kms_helper_poll_init(struct drm_device *dev); 164extern void drm_kms_helper_poll_init(struct drm_device *dev);
165extern void drm_kms_helper_poll_fini(struct drm_device *dev); 165extern void drm_kms_helper_poll_fini(struct drm_device *dev);
166extern bool drm_helper_hpd_irq_event(struct drm_device *dev); 166extern bool drm_helper_hpd_irq_event(struct drm_device *dev);