Commit fe3a1aa239a74bcbf25211aab33b6ecc80acf0f9
Committed by
Linus Torvalds
1 parent
4410f39109
Exists in
master
and in
39 other branches
tcx: use standard fields for framebuffer physical address and length
Use standard fields fbinfo.fix.smem_start and fbinfo.fix.smem_len for physical address and length of framebuffer. This also fixes output of the 'fbset -i' command - address and length of the framebuffer are displayed correctly. Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl> Acked-by: David S. Miller <davem@davemloft.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Showing 1 changed file with 13 additions and 14 deletions Side-by-side Diff
drivers/video/tcx.c
... | ... | @@ -116,17 +116,16 @@ |
116 | 116 | u32 flags; |
117 | 117 | #define TCX_FLAG_BLANKED 0x00000001 |
118 | 118 | |
119 | - unsigned long physbase; | |
120 | 119 | unsigned long which_io; |
121 | - unsigned long fbsize; | |
122 | 120 | |
123 | 121 | struct sbus_mmap_map mmap_map[TCX_MMAP_ENTRIES]; |
124 | 122 | int lowdepth; |
125 | 123 | }; |
126 | 124 | |
127 | 125 | /* Reset control plane so that WID is 8-bit plane. */ |
128 | -static void __tcx_set_control_plane(struct tcx_par *par) | |
126 | +static void __tcx_set_control_plane(struct fb_info *info) | |
129 | 127 | { |
128 | + struct tcx_par *par = info->par; | |
130 | 129 | u32 __iomem *p, *pend; |
131 | 130 | |
132 | 131 | if (par->lowdepth) |
... | ... | @@ -135,7 +134,7 @@ |
135 | 134 | p = par->cplane; |
136 | 135 | if (p == NULL) |
137 | 136 | return; |
138 | - for (pend = p + par->fbsize; p < pend; p++) { | |
137 | + for (pend = p + info->fix.smem_len; p < pend; p++) { | |
139 | 138 | u32 tmp = sbus_readl(p); |
140 | 139 | |
141 | 140 | tmp &= 0xffffff; |
... | ... | @@ -149,7 +148,7 @@ |
149 | 148 | unsigned long flags; |
150 | 149 | |
151 | 150 | spin_lock_irqsave(&par->lock, flags); |
152 | - __tcx_set_control_plane(par); | |
151 | + __tcx_set_control_plane(info); | |
153 | 152 | spin_unlock_irqrestore(&par->lock, flags); |
154 | 153 | } |
155 | 154 | |
... | ... | @@ -304,7 +303,7 @@ |
304 | 303 | struct tcx_par *par = (struct tcx_par *)info->par; |
305 | 304 | |
306 | 305 | return sbusfb_mmap_helper(par->mmap_map, |
307 | - par->physbase, par->fbsize, | |
306 | + info->fix.smem_start, info->fix.smem_len, | |
308 | 307 | par->which_io, vma); |
309 | 308 | } |
310 | 309 | |
... | ... | @@ -316,7 +315,7 @@ |
316 | 315 | return sbusfb_ioctl_helper(cmd, arg, info, |
317 | 316 | FBTYPE_TCXCOLOR, |
318 | 317 | (par->lowdepth ? 8 : 24), |
319 | - par->fbsize); | |
318 | + info->fix.smem_len); | |
320 | 319 | } |
321 | 320 | |
322 | 321 | /* |
323 | 322 | |
... | ... | @@ -358,10 +357,10 @@ |
358 | 357 | par->bt, sizeof(struct bt_regs)); |
359 | 358 | if (par->cplane) |
360 | 359 | of_iounmap(&op->resource[4], |
361 | - par->cplane, par->fbsize * sizeof(u32)); | |
360 | + par->cplane, info->fix.smem_len * sizeof(u32)); | |
362 | 361 | if (info->screen_base) |
363 | 362 | of_iounmap(&op->resource[0], |
364 | - info->screen_base, par->fbsize); | |
363 | + info->screen_base, info->fix.smem_len); | |
365 | 364 | } |
366 | 365 | |
367 | 366 | static int __devinit tcx_probe(struct of_device *op, |
... | ... | @@ -391,7 +390,7 @@ |
391 | 390 | |
392 | 391 | linebytes = of_getintprop_default(dp, "linebytes", |
393 | 392 | info->var.xres); |
394 | - par->fbsize = PAGE_ALIGN(linebytes * info->var.yres); | |
393 | + info->fix.smem_len = PAGE_ALIGN(linebytes * info->var.yres); | |
395 | 394 | |
396 | 395 | par->tec = of_ioremap(&op->resource[7], 0, |
397 | 396 | sizeof(struct tcx_tec), "tcx tec"); |
... | ... | @@ -400,7 +399,7 @@ |
400 | 399 | par->bt = of_ioremap(&op->resource[8], 0, |
401 | 400 | sizeof(struct bt_regs), "tcx dac"); |
402 | 401 | info->screen_base = of_ioremap(&op->resource[0], 0, |
403 | - par->fbsize, "tcx ram"); | |
402 | + info->fix.smem_len, "tcx ram"); | |
404 | 403 | if (!par->tec || !par->thc || |
405 | 404 | !par->bt || !info->screen_base) |
406 | 405 | goto out_unmap_regs; |
... | ... | @@ -408,7 +407,7 @@ |
408 | 407 | memcpy(&par->mmap_map, &__tcx_mmap_map, sizeof(par->mmap_map)); |
409 | 408 | if (!par->lowdepth) { |
410 | 409 | par->cplane = of_ioremap(&op->resource[4], 0, |
411 | - par->fbsize * sizeof(u32), | |
410 | + info->fix.smem_len * sizeof(u32), | |
412 | 411 | "tcx cplane"); |
413 | 412 | if (!par->cplane) |
414 | 413 | goto out_unmap_regs; |
... | ... | @@ -419,7 +418,7 @@ |
419 | 418 | par->mmap_map[6].size = SBUS_MMAP_EMPTY; |
420 | 419 | } |
421 | 420 | |
422 | - par->physbase = op->resource[0].start; | |
421 | + info->fix.smem_start = op->resource[0].start; | |
423 | 422 | par->which_io = op->resource[0].flags & IORESOURCE_BITS; |
424 | 423 | |
425 | 424 | for (i = 0; i < TCX_MMAP_ENTRIES; i++) { |
... | ... | @@ -473,7 +472,7 @@ |
473 | 472 | printk(KERN_INFO "%s: TCX at %lx:%lx, %s\n", |
474 | 473 | dp->full_name, |
475 | 474 | par->which_io, |
476 | - par->physbase, | |
475 | + info->fix.smem_start, | |
477 | 476 | par->lowdepth ? "8-bit only" : "24-bit depth"); |
478 | 477 | |
479 | 478 | return 0; |