summaryrefslogtreecommitdiffstats
path: root/recipes/linux/linux-openmoko-2.6.32/0011-Don-t-choke-if-userspace-provides-a-pixel-clock-valu.patch
blob: 0d47c1263fd5cc7774295bbfd03d27f68ccedcd1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
From 73abadc5bbbc94f4ca67effc5f5c3174c2a3ac48 Mon Sep 17 00:00:00 2001
From: Thomas White <taw@bitwiz.org.uk>
Date: Sun, 28 Feb 2010 15:40:13 +0100
Subject: [PATCH 2/2] Don't choke if userspace provides a pixel clock value

Don't choke if userspace provides a pixel clock value

Signed-off-by: Thomas White <taw@bitwiz.org.uk>
---
 drivers/mfd/glamo/glamo-kms-fb.c |   46 ++++++++++++++++++-------------------
 1 files changed, 22 insertions(+), 24 deletions(-)

diff --git a/drivers/mfd/glamo/glamo-kms-fb.c b/drivers/mfd/glamo/glamo-kms-fb.c
index 57680ed..6d4b9ea 100644
--- a/drivers/mfd/glamo/glamo-kms-fb.c
+++ b/drivers/mfd/glamo/glamo-kms-fb.c
@@ -177,37 +177,35 @@ static int glamofb_set_par(struct fb_info *info)
 	struct drm_device *dev = par->dev;
 	struct fb_var_screeninfo *var = &info->var;
 	int i;
+	struct drm_crtc *crtc;
+	int ret;
 
 	DRM_DEBUG("%d %d\n", var->xres, var->pixclock);
 
 	if (var->pixclock != -1) {
+		DRM_ERROR("Warning: userspace gave me a pixel clock value (%i)"
+		          "- I'm ignoring it.\n", var->pixclock);
+	}
 
-		DRM_ERROR("PIXEL CLOCK SET\n");
-		return -EINVAL;
-	} else {
-		struct drm_crtc *crtc;
-		int ret;
-
-		list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
-			struct glamo_crtc *glamo_crtc = to_glamo_crtc(crtc);
-
-			for (i = 0; i < par->crtc_count; i++)
-				if (crtc->base.id == par->crtc_ids[i])
-					break;
-
-			if (i == par->crtc_count)
-				continue;
-
-			if (crtc->fb == glamo_crtc->mode_set.fb) {
-				mutex_lock(&dev->mode_config.mutex);
-				ret = crtc->funcs->set_config(&glamo_crtc->mode_set);
-				mutex_unlock(&dev->mode_config.mutex);
-				if (ret)
-					return ret;
-			}
+	list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
+		struct glamo_crtc *glamo_crtc = to_glamo_crtc(crtc);
+
+		for (i = 0; i < par->crtc_count; i++)
+			if (crtc->base.id == par->crtc_ids[i])
+				break;
+
+		if (i == par->crtc_count)
+			continue;
+
+		if (crtc->fb == glamo_crtc->mode_set.fb) {
+			mutex_lock(&dev->mode_config.mutex);
+			ret = crtc->funcs->set_config(&glamo_crtc->mode_set);
+			mutex_unlock(&dev->mode_config.mutex);
+			if (ret)
+				return ret;
 		}
-		return 0;
 	}
+	return 0;
 }
 
 static int glamofb_pan_display(struct fb_var_screeninfo *var,
-- 
1.7.0