From b31adb005afc5553fb30aa2c1710faee299bc730 Mon Sep 17 00:00:00 2001
From: Dave Airlie <airlied@redhat.com>
Date: Thu, 5 Jun 2008 15:55:03 +1000
Subject: drm/modesetting: more fb interface cleanups

---
 linux-core/i915_drv.c      | 2 +-
 linux-core/intel_display.c | 1 +
 linux-core/intel_fb.c      | 9 ++++++---
 3 files changed, 8 insertions(+), 4 deletions(-)

(limited to 'linux-core')

diff --git a/linux-core/i915_drv.c b/linux-core/i915_drv.c
index f4c50752..f755dcd4 100644
--- a/linux-core/i915_drv.c
+++ b/linux-core/i915_drv.c
@@ -42,7 +42,7 @@ static struct pci_device_id pciidlist[] = {
 unsigned int i915_modeset = 0;
 module_param_named(modeset, i915_modeset, int, 0400);
 
-unsigned int i915_fbpercrtc = 1;
+unsigned int i915_fbpercrtc = 0;
 module_param_named(fbpercrtc, i915_fbpercrtc, int, 0400);
 
 unsigned int i915_rightof = 1;
diff --git a/linux-core/intel_display.c b/linux-core/intel_display.c
index 8baae1b3..e1d9d4d0 100644
--- a/linux-core/intel_display.c
+++ b/linux-core/intel_display.c
@@ -1519,6 +1519,7 @@ struct drm_framebuffer *intel_user_framebuffer_create(struct drm_device *dev,
 static const struct drm_mode_config_funcs intel_mode_funcs = {
 	.resize_fb = NULL,
 	.fb_create = intel_user_framebuffer_create,
+	.fb_changed = intelfb_probe,
 };
 
 void intel_modeset_init(struct drm_device *dev)
diff --git a/linux-core/intel_fb.c b/linux-core/intel_fb.c
index 2355bf3d..b4afb155 100644
--- a/linux-core/intel_fb.c
+++ b/linux-core/intel_fb.c
@@ -200,9 +200,7 @@ static int intelfb_check_var(struct fb_var_screeninfo *var,
 static int intelfb_set_par(struct fb_info *info)
 {
 	struct intelfb_par *par = info->par;
-	struct drm_device *dev = par->dev;
 	struct fb_var_screeninfo *var = &info->var;
-	int found = 0;
 
 	DRM_DEBUG("%d %d\n", var->xres, var->pixclock);
 
@@ -215,6 +213,9 @@ static int intelfb_set_par(struct fb_info *info)
 		struct drm_framebuffer *fb = &intel_fb->base;
 		struct drm_display_mode *drm_mode, *search_mode;
 		struct drm_connector *connector = NULL;
+		struct drm_device *dev = par->dev;
+
+		int found = 0;
 
 		switch (var->bits_per_pixel) {
 		case 16:
@@ -756,6 +757,7 @@ static int intelfb_create_crtcmodesets(struct intel_framebuffer *intel_fb, int n
 		modeset->connectors = (struct drm_connector **)(modeset + 1);
 		list_add_tail(&modeset->head, &par->mode_set_list);
 	}
+	return 0;
 
 fail:
 	list_for_each_entry(modeset, &par->mode_set_list, head) {
@@ -860,7 +862,8 @@ static int intelfb_single_fb_probe(struct drm_device *dev)
 		info->var.pixclock = -1;
 		if (register_framebuffer(info) < 0)
 			return -EINVAL;
-	}
+	} else
+		intelfb_set_par(info);
 		
 	printk(KERN_INFO "fb%d: %s frame buffer device\n", info->node,
 	       info->fix.id);
-- 
cgit v1.2.3