@@ -290,6 +290,7 @@ static struct drm_fb_helper_funcs ast_fb_helper_funcs = {
.gamma_set = ast_fb_gamma_set,
.gamma_get = ast_fb_gamma_get,
.fb_probe = astfb_create,
+ .restore_fbdev_mode = drm_fb_helper_restore_fbdev_mode,
};
static void ast_fbdev_destroy(struct drm_device *dev,
@@ -288,6 +288,7 @@ static struct drm_fb_helper_funcs cirrus_fb_helper_funcs = {
.gamma_set = cirrus_crtc_fb_gamma_set,
.gamma_get = cirrus_crtc_fb_gamma_get,
.fb_probe = cirrusfb_create,
+ .restore_fbdev_mode = drm_fb_helper_restore_fbdev_mode,
};
int cirrus_fbdev_init(struct cirrus_device *cdev)
@@ -330,6 +330,7 @@ err_drm_gem_cma_free_object:
static struct drm_fb_helper_funcs drm_fb_cma_helper_funcs = {
.fb_probe = drm_fbdev_cma_create,
+ .restore_fbdev_mode = drm_fb_helper_restore_fbdev_mode,
};
/**
@@ -318,7 +318,7 @@ static bool drm_fb_helper_force_kernel_mode(void)
if (helper->dev->switch_power_state == DRM_SWITCH_POWER_OFF)
continue;
- ret = drm_fb_helper_restore_fbdev_mode(helper);
+ ret = helper->funcs->restore_fbdev_mode(helper);
if (ret)
error = true;
}
@@ -228,6 +228,7 @@ out:
static struct drm_fb_helper_funcs exynos_drm_fb_helper_funcs = {
.fb_probe = exynos_drm_fbdev_create,
+ .restore_fbdev_mode = drm_fb_helper_restore_fbdev_mode,
};
int exynos_drm_fbdev_init(struct drm_device *dev)
@@ -567,6 +567,7 @@ static struct drm_fb_helper_funcs psb_fb_helper_funcs = {
.gamma_set = psbfb_gamma_set,
.gamma_get = psbfb_gamma_get,
.fb_probe = psbfb_probe,
+ .restore_fbdev_mode = drm_fb_helper_restore_fbdev_mode,
};
static int psb_fbdev_destroy(struct drm_device *dev, struct psb_fbdev *fbdev)
@@ -187,6 +187,7 @@ static struct drm_fb_helper_funcs intel_fb_helper_funcs = {
.gamma_set = intel_crtc_fb_gamma_set,
.gamma_get = intel_crtc_fb_gamma_get,
.fb_probe = intelfb_create,
+ .restore_fbdev_mode = drm_fb_helper_restore_fbdev_mode,
};
static void intel_fbdev_destroy(struct drm_device *dev,
@@ -275,6 +275,7 @@ static struct drm_fb_helper_funcs mga_fb_helper_funcs = {
.gamma_set = mga_crtc_fb_gamma_set,
.gamma_get = mga_crtc_fb_gamma_get,
.fb_probe = mgag200fb_create,
+ .restore_fbdev_mode = drm_fb_helper_restore_fbdev_mode,
};
int mgag200_fbdev_init(struct mga_device *mdev)
@@ -435,6 +435,7 @@ static struct drm_fb_helper_funcs nouveau_fbcon_helper_funcs = {
.gamma_set = nouveau_fbcon_gamma_set,
.gamma_get = nouveau_fbcon_gamma_get,
.fb_probe = nouveau_fbcon_create,
+ .restore_fbdev_mode = drm_fb_helper_restore_fbdev_mode,
};
@@ -283,6 +283,7 @@ fail:
static struct drm_fb_helper_funcs omap_fb_helper_funcs = {
.fb_probe = omap_fbdev_create,
+ .restore_fbdev_mode = drm_fb_helper_restore_fbdev_mode,
};
static struct drm_fb_helper *get_fb(struct fb_info *fbi)
@@ -521,6 +521,7 @@ static int qxl_fbdev_destroy(struct drm_device *dev, struct qxl_fbdev *qfbdev)
static struct drm_fb_helper_funcs qxl_fb_helper_funcs = {
.fb_probe = qxl_fb_find_or_create_single,
+ .restore_fbdev_mode = drm_fb_helper_restore_fbdev_mode,
};
int qxl_fbdev_init(struct qxl_device *qdev)
@@ -335,6 +335,7 @@ static struct drm_fb_helper_funcs radeon_fb_helper_funcs = {
.gamma_set = radeon_crtc_fb_gamma_set,
.gamma_get = radeon_crtc_fb_gamma_get,
.fb_probe = radeonfb_create,
+ .restore_fbdev_mode = drm_fb_helper_restore_fbdev_mode,
};
int radeon_fbdev_init(struct radeon_device *rdev)
@@ -546,6 +546,7 @@ out:
static struct drm_fb_helper_funcs udl_fb_helper_funcs = {
.fb_probe = udlfb_create,
+ .restore_fbdev_mode = drm_fb_helper_restore_fbdev_mode,
};
static void udl_fbdev_destroy(struct drm_device *dev,
@@ -58,6 +58,7 @@ struct drm_fb_helper_surface_size {
* structure. Futhermore it also needs to allocate the drm
* framebuffer used to back the fbdev.
* @initial_config: Setup an initial fbdev display configuration
+ * @restore_fbdev_mode: Restore the fbdev display configuration (eg. to show an oops)
*
* Driver callbacks used by the fbdev emulation helper library.
*/
@@ -73,6 +74,7 @@ struct drm_fb_helper_funcs {
struct drm_fb_helper_crtc **crtcs,
struct drm_display_mode **modes,
bool *enabled, int width, int height);
+ bool (*restore_fbdev_mode)(struct drm_fb_helper *fb_helper);
};
struct drm_fb_helper_connector {