Lines Matching full:fb
24 #include <linux/fb.h>
53 struct fb_info fb; member
60 struct goldfish_fb *fb = dev_id; in goldfish_fb_interrupt() local
63 spin_lock_irqsave(&fb->lock, irq_flags); in goldfish_fb_interrupt()
64 status = readl(fb->reg_base + FB_INT_STATUS); in goldfish_fb_interrupt()
66 fb->base_update_count++; in goldfish_fb_interrupt()
67 wake_up(&fb->wait); in goldfish_fb_interrupt()
69 spin_unlock_irqrestore(&fb->lock, irq_flags); in goldfish_fb_interrupt()
84 struct goldfish_fb *fb = container_of(info, struct goldfish_fb, fb); in goldfish_fb_setcolreg() local
87 fb->cmap[regno] = convert_bitfield(transp, &fb->fb.var.transp) | in goldfish_fb_setcolreg()
88 convert_bitfield(blue, &fb->fb.var.blue) | in goldfish_fb_setcolreg()
89 convert_bitfield(green, &fb->fb.var.green) | in goldfish_fb_setcolreg()
90 convert_bitfield(red, &fb->fb.var.red); in goldfish_fb_setcolreg()
127 struct goldfish_fb *fb = container_of(info, struct goldfish_fb, fb); in goldfish_fb_set_par() local
129 if (fb->rotation != fb->fb.var.rotate) { in goldfish_fb_set_par()
131 fb->rotation = fb->fb.var.rotate; in goldfish_fb_set_par()
132 writel(fb->rotation, fb->reg_base + FB_SET_ROTATION); in goldfish_fb_set_par()
143 struct goldfish_fb *fb = container_of(info, struct goldfish_fb, fb); in goldfish_fb_pan_display() local
145 spin_lock_irqsave(&fb->lock, irq_flags); in goldfish_fb_pan_display()
146 base_update_count = fb->base_update_count; in goldfish_fb_pan_display()
147 writel(fb->fb.fix.smem_start + fb->fb.var.xres * 2 * var->yoffset, in goldfish_fb_pan_display()
148 fb->reg_base + FB_SET_BASE); in goldfish_fb_pan_display()
149 spin_unlock_irqrestore(&fb->lock, irq_flags); in goldfish_fb_pan_display()
150 wait_event_timeout(fb->wait, in goldfish_fb_pan_display()
151 fb->base_update_count != base_update_count, HZ / 15); in goldfish_fb_pan_display()
152 if (fb->base_update_count == base_update_count) in goldfish_fb_pan_display()
159 struct goldfish_fb *fb = container_of(info, struct goldfish_fb, fb); in goldfish_fb_blank() local
163 writel(1, fb->reg_base + FB_SET_BLANK); in goldfish_fb_blank()
166 writel(0, fb->reg_base + FB_SET_BLANK); in goldfish_fb_blank()
189 struct goldfish_fb *fb; in goldfish_fb_probe() local
194 fb = kzalloc(sizeof(*fb), GFP_KERNEL); in goldfish_fb_probe()
195 if (fb == NULL) { in goldfish_fb_probe()
199 spin_lock_init(&fb->lock); in goldfish_fb_probe()
200 init_waitqueue_head(&fb->wait); in goldfish_fb_probe()
201 platform_set_drvdata(pdev, fb); in goldfish_fb_probe()
208 fb->reg_base = ioremap(r->start, PAGE_SIZE); in goldfish_fb_probe()
209 if (fb->reg_base == NULL) { in goldfish_fb_probe()
214 fb->irq = platform_get_irq(pdev, 0); in goldfish_fb_probe()
215 if (fb->irq <= 0) { in goldfish_fb_probe()
220 width = readl(fb->reg_base + FB_GET_WIDTH); in goldfish_fb_probe()
221 height = readl(fb->reg_base + FB_GET_HEIGHT); in goldfish_fb_probe()
223 fb->fb.fbops = &goldfish_fb_ops; in goldfish_fb_probe()
224 fb->fb.flags = FBINFO_FLAG_DEFAULT; in goldfish_fb_probe()
225 fb->fb.pseudo_palette = fb->cmap; in goldfish_fb_probe()
226 fb->fb.fix.type = FB_TYPE_PACKED_PIXELS; in goldfish_fb_probe()
227 fb->fb.fix.visual = FB_VISUAL_TRUECOLOR; in goldfish_fb_probe()
228 fb->fb.fix.line_length = width * 2; in goldfish_fb_probe()
229 fb->fb.fix.accel = FB_ACCEL_NONE; in goldfish_fb_probe()
230 fb->fb.fix.ypanstep = 1; in goldfish_fb_probe()
232 fb->fb.var.xres = width; in goldfish_fb_probe()
233 fb->fb.var.yres = height; in goldfish_fb_probe()
234 fb->fb.var.xres_virtual = width; in goldfish_fb_probe()
235 fb->fb.var.yres_virtual = height * 2; in goldfish_fb_probe()
236 fb->fb.var.bits_per_pixel = 16; in goldfish_fb_probe()
237 fb->fb.var.activate = FB_ACTIVATE_NOW; in goldfish_fb_probe()
238 fb->fb.var.height = readl(fb->reg_base + FB_GET_PHYS_HEIGHT); in goldfish_fb_probe()
239 fb->fb.var.width = readl(fb->reg_base + FB_GET_PHYS_WIDTH); in goldfish_fb_probe()
240 fb->fb.var.pixclock = 0; in goldfish_fb_probe()
242 fb->fb.var.red.offset = 11; in goldfish_fb_probe()
243 fb->fb.var.red.length = 5; in goldfish_fb_probe()
244 fb->fb.var.green.offset = 5; in goldfish_fb_probe()
245 fb->fb.var.green.length = 6; in goldfish_fb_probe()
246 fb->fb.var.blue.offset = 0; in goldfish_fb_probe()
247 fb->fb.var.blue.length = 5; in goldfish_fb_probe()
250 fb->fb.screen_base = (char __force __iomem *)dma_alloc_coherent( in goldfish_fb_probe()
254 width, height, fb->fb.screen_base); in goldfish_fb_probe()
255 if (fb->fb.screen_base == NULL) { in goldfish_fb_probe()
259 fb->fb.fix.smem_start = fbpaddr; in goldfish_fb_probe()
260 fb->fb.fix.smem_len = framesize; in goldfish_fb_probe()
262 ret = fb_set_var(&fb->fb, &fb->fb.var); in goldfish_fb_probe()
266 ret = request_irq(fb->irq, goldfish_fb_interrupt, IRQF_SHARED, in goldfish_fb_probe()
267 pdev->name, fb); in goldfish_fb_probe()
271 writel(FB_INT_BASE_UPDATE_DONE, fb->reg_base + FB_INT_ENABLE); in goldfish_fb_probe()
272 goldfish_fb_pan_display(&fb->fb.var, &fb->fb); /* updates base */ in goldfish_fb_probe()
274 ret = register_framebuffer(&fb->fb); in goldfish_fb_probe()
280 free_irq(fb->irq, fb); in goldfish_fb_probe()
284 (void *)fb->fb.screen_base, in goldfish_fb_probe()
285 fb->fb.fix.smem_start); in goldfish_fb_probe()
288 iounmap(fb->reg_base); in goldfish_fb_probe()
290 kfree(fb); in goldfish_fb_probe()
298 struct goldfish_fb *fb = platform_get_drvdata(pdev); in goldfish_fb_remove() local
300 framesize = fb->fb.var.xres_virtual * fb->fb.var.yres_virtual * 2; in goldfish_fb_remove()
301 unregister_framebuffer(&fb->fb); in goldfish_fb_remove()
302 free_irq(fb->irq, fb); in goldfish_fb_remove()
304 dma_free_coherent(&pdev->dev, framesize, (void *)fb->fb.screen_base, in goldfish_fb_remove()
305 fb->fb.fix.smem_start); in goldfish_fb_remove()
306 iounmap(fb->reg_base); in goldfish_fb_remove()
307 kfree(fb); in goldfish_fb_remove()
312 { .compatible = "google,goldfish-fb", },