aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/omap2/omapfb
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-01-14 18:11:19 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-01-14 18:11:19 -0500
commit51be08419dc86c72486ac556aa39bc01026a403d (patch)
tree50ac35ac89f207d2a732b67eb2f1e9b671e5c064 /drivers/video/omap2/omapfb
parentec8013beddd717d1740cfefb1a9b900deef85462 (diff)
parentf787f32e67e00b072f46b2ae3c454d2c0a1fcdb7 (diff)
Merge branch 'fbdev-next' of git://github.com/schandinat/linux-2.6
* 'fbdev-next' of git://github.com/schandinat/linux-2.6: (175 commits) module_param: make bool parameters really bool (drivers/video/i810) Revert "atmel_lcdfb: Adjust HFP calculation so it matches the manual." OMAPDSS: HDMI: Disable DDC internal pull up OMAPDSS: HDMI: Move duplicate code from boardfile OMAPDSS: add OrtusTech COM43H4M10XTC display support OMAP: DSS2: Support for UMSH-8173MD TFT panel ASoC: OMAP: HDMI: Move HDMI codec trigger function to generic HDMI driver OMAPDSS: HDMI: Create function to enable HDMI audio ASoC: OMAP: HDMI: Correct signature of ASoC functions ASoC: OMAP: HDMI: Introduce driver data for audio codec grvga: fix section mismatch warnings video: s3c-fb: Don't keep device runtime active when open video: s3c-fb: Hold runtime PM references when touching registers video: s3c-fb: Take a runtime PM reference when unblanked video: s3c-fb: Disable runtime PM in error paths from probe video: s3c-fb: Use s3c_fb_enable() to enable the framebuffer video: s3c-fb: Make runtime PM functional again drivers/video: fsl-diu-fb: merge fsl_diu_alloc() into map_video_memory() drivers/video: fsl-diu-fb: add default platform ops functions drivers/video: fsl-diu-fb: remove broken reference count enabling the display ...
Diffstat (limited to 'drivers/video/omap2/omapfb')
-rw-r--r--drivers/video/omap2/omapfb/omapfb-ioctl.c42
-rw-r--r--drivers/video/omap2/omapfb/omapfb-main.c14
-rw-r--r--drivers/video/omap2/omapfb/omapfb-sysfs.c4
-rw-r--r--drivers/video/omap2/omapfb/omapfb.h11
4 files changed, 39 insertions, 32 deletions
diff --git a/drivers/video/omap2/omapfb/omapfb-ioctl.c b/drivers/video/omap2/omapfb/omapfb-ioctl.c
index df7bcce5b107..16ba6196f330 100644
--- a/drivers/video/omap2/omapfb/omapfb-ioctl.c
+++ b/drivers/video/omap2/omapfb/omapfb-ioctl.c
@@ -111,28 +111,22 @@ static int omapfb_setup_plane(struct fb_info *fbi, struct omapfb_plane_info *pi)
111 set_fb_fix(fbi); 111 set_fb_fix(fbi);
112 } 112 }
113 113
114 if (pi->enabled) { 114 if (!pi->enabled) {
115 struct omap_overlay_info info; 115 r = ovl->disable(ovl);
116 if (r)
117 goto undo;
118 }
116 119
120 if (pi->enabled) {
117 r = omapfb_setup_overlay(fbi, ovl, pi->pos_x, pi->pos_y, 121 r = omapfb_setup_overlay(fbi, ovl, pi->pos_x, pi->pos_y,
118 pi->out_width, pi->out_height); 122 pi->out_width, pi->out_height);
119 if (r) 123 if (r)
120 goto undo; 124 goto undo;
121
122 ovl->get_overlay_info(ovl, &info);
123
124 if (!info.enabled) {
125 info.enabled = pi->enabled;
126 r = ovl->set_overlay_info(ovl, &info);
127 if (r)
128 goto undo;
129 }
130 } else { 125 } else {
131 struct omap_overlay_info info; 126 struct omap_overlay_info info;
132 127
133 ovl->get_overlay_info(ovl, &info); 128 ovl->get_overlay_info(ovl, &info);
134 129
135 info.enabled = pi->enabled;
136 info.pos_x = pi->pos_x; 130 info.pos_x = pi->pos_x;
137 info.pos_y = pi->pos_y; 131 info.pos_y = pi->pos_y;
138 info.out_width = pi->out_width; 132 info.out_width = pi->out_width;
@@ -146,6 +140,12 @@ static int omapfb_setup_plane(struct fb_info *fbi, struct omapfb_plane_info *pi)
146 if (ovl->manager) 140 if (ovl->manager)
147 ovl->manager->apply(ovl->manager); 141 ovl->manager->apply(ovl->manager);
148 142
143 if (pi->enabled) {
144 r = ovl->enable(ovl);
145 if (r)
146 goto undo;
147 }
148
149 /* Release the locks in a specific order to keep lockdep happy */ 149 /* Release the locks in a specific order to keep lockdep happy */
150 if (old_rg->id > new_rg->id) { 150 if (old_rg->id > new_rg->id) {
151 omapfb_put_mem_region(old_rg); 151 omapfb_put_mem_region(old_rg);
@@ -189,19 +189,19 @@ static int omapfb_query_plane(struct fb_info *fbi, struct omapfb_plane_info *pi)
189 memset(pi, 0, sizeof(*pi)); 189 memset(pi, 0, sizeof(*pi));
190 } else { 190 } else {
191 struct omap_overlay *ovl; 191 struct omap_overlay *ovl;
192 struct omap_overlay_info *ovli; 192 struct omap_overlay_info ovli;
193 193
194 ovl = ofbi->overlays[0]; 194 ovl = ofbi->overlays[0];
195 ovli = &ovl->info; 195 ovl->get_overlay_info(ovl, &ovli);
196 196
197 pi->pos_x = ovli->pos_x; 197 pi->pos_x = ovli.pos_x;
198 pi->pos_y = ovli->pos_y; 198 pi->pos_y = ovli.pos_y;
199 pi->enabled = ovli->enabled; 199 pi->enabled = ovl->is_enabled(ovl);
200 pi->channel_out = 0; /* xxx */ 200 pi->channel_out = 0; /* xxx */
201 pi->mirror = 0; 201 pi->mirror = 0;
202 pi->mem_idx = get_mem_idx(ofbi); 202 pi->mem_idx = get_mem_idx(ofbi);
203 pi->out_width = ovli->out_width; 203 pi->out_width = ovli.out_width;
204 pi->out_height = ovli->out_height; 204 pi->out_height = ovli.out_height;
205 } 205 }
206 206
207 return 0; 207 return 0;
@@ -238,7 +238,9 @@ static int omapfb_setup_mem(struct fb_info *fbi, struct omapfb_mem_info *mi)
238 continue; 238 continue;
239 239
240 for (j = 0; j < ofbi2->num_overlays; j++) { 240 for (j = 0; j < ofbi2->num_overlays; j++) {
241 if (ofbi2->overlays[j]->info.enabled) { 241 struct omap_overlay *ovl;
242 ovl = ofbi2->overlays[j];
243 if (ovl->is_enabled(ovl)) {
242 r = -EBUSY; 244 r = -EBUSY;
243 goto out; 245 goto out;
244 } 246 }
diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c
index 68ba1f800082..ce158311ff59 100644
--- a/drivers/video/omap2/omapfb/omapfb-main.c
+++ b/drivers/video/omap2/omapfb/omapfb-main.c
@@ -970,16 +970,20 @@ int omapfb_apply_changes(struct fb_info *fbi, int init)
970 outh = var->yres; 970 outh = var->yres;
971 } 971 }
972 } else { 972 } else {
973 outw = ovl->info.out_width; 973 struct omap_overlay_info info;
974 outh = ovl->info.out_height; 974 ovl->get_overlay_info(ovl, &info);
975 outw = info.out_width;
976 outh = info.out_height;
975 } 977 }
976 978
977 if (init) { 979 if (init) {
978 posx = 0; 980 posx = 0;
979 posy = 0; 981 posy = 0;
980 } else { 982 } else {
981 posx = ovl->info.pos_x; 983 struct omap_overlay_info info;
982 posy = ovl->info.pos_y; 984 ovl->get_overlay_info(ovl, &info);
985 posx = info.pos_x;
986 posy = info.pos_y;
983 } 987 }
984 988
985 r = omapfb_setup_overlay(fbi, ovl, posx, posy, outw, outh); 989 r = omapfb_setup_overlay(fbi, ovl, posx, posy, outw, outh);
@@ -2067,6 +2071,8 @@ static int omapfb_create_framebuffers(struct omapfb2_device *fbdev)
2067 if (ofbi->num_overlays > 0) { 2071 if (ofbi->num_overlays > 0) {
2068 struct omap_overlay *ovl = ofbi->overlays[0]; 2072 struct omap_overlay *ovl = ofbi->overlays[0];
2069 2073
2074 ovl->manager->apply(ovl->manager);
2075
2070 r = omapfb_overlay_enable(ovl, 1); 2076 r = omapfb_overlay_enable(ovl, 1);
2071 2077
2072 if (r) { 2078 if (r) {
diff --git a/drivers/video/omap2/omapfb/omapfb-sysfs.c b/drivers/video/omap2/omapfb/omapfb-sysfs.c
index 1694d5148f32..e8d8cc76a435 100644
--- a/drivers/video/omap2/omapfb/omapfb-sysfs.c
+++ b/drivers/video/omap2/omapfb/omapfb-sysfs.c
@@ -473,7 +473,9 @@ static ssize_t store_size(struct device *dev, struct device_attribute *attr,
473 continue; 473 continue;
474 474
475 for (j = 0; j < ofbi2->num_overlays; j++) { 475 for (j = 0; j < ofbi2->num_overlays; j++) {
476 if (ofbi2->overlays[j]->info.enabled) { 476 struct omap_overlay *ovl;
477 ovl = ofbi2->overlays[j];
478 if (ovl->is_enabled(ovl)) {
477 r = -EBUSY; 479 r = -EBUSY;
478 goto out; 480 goto out;
479 } 481 }
diff --git a/drivers/video/omap2/omapfb/omapfb.h b/drivers/video/omap2/omapfb/omapfb.h
index e12d384ea520..c0bdc9b54ecf 100644
--- a/drivers/video/omap2/omapfb/omapfb.h
+++ b/drivers/video/omap2/omapfb/omapfb.h
@@ -181,13 +181,10 @@ static inline void omapfb_unlock(struct omapfb2_device *fbdev)
181static inline int omapfb_overlay_enable(struct omap_overlay *ovl, 181static inline int omapfb_overlay_enable(struct omap_overlay *ovl,
182 int enable) 182 int enable)
183{ 183{
184 struct omap_overlay_info info; 184 if (enable)
185 185 return ovl->enable(ovl);
186 ovl->get_overlay_info(ovl, &info); 186 else
187 if (info.enabled == enable) 187 return ovl->disable(ovl);
188 return 0;
189 info.enabled = enable;
190 return ovl->set_overlay_info(ovl, &info);
191} 188}
192 189
193static inline struct omapfb2_mem_region * 190static inline struct omapfb2_mem_region *