diff options
Diffstat (limited to 'drivers/video/omap2/omapfb/omapfb-ioctl.c')
-rw-r--r-- | drivers/video/omap2/omapfb/omapfb-ioctl.c | 42 |
1 files changed, 22 insertions, 20 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 | } |