Lines Matching full:fb
15 #include <linux/fb.h>
44 struct fb_info fb; member
51 struct goldfish_fb *fb = dev_id; in goldfish_fb_interrupt() local
54 spin_lock_irqsave(&fb->lock, irq_flags); in goldfish_fb_interrupt()
55 status = readl(fb->reg_base + FB_INT_STATUS); in goldfish_fb_interrupt()
57 fb->base_update_count++; in goldfish_fb_interrupt()
58 wake_up(&fb->wait); in goldfish_fb_interrupt()
60 spin_unlock_irqrestore(&fb->lock, irq_flags); in goldfish_fb_interrupt()
75 struct goldfish_fb *fb = container_of(info, struct goldfish_fb, fb); in goldfish_fb_setcolreg() local
78 fb->cmap[regno] = convert_bitfield(transp, &fb->fb.var.transp) | in goldfish_fb_setcolreg()
79 convert_bitfield(blue, &fb->fb.var.blue) | in goldfish_fb_setcolreg()
80 convert_bitfield(green, &fb->fb.var.green) | in goldfish_fb_setcolreg()
81 convert_bitfield(red, &fb->fb.var.red); in goldfish_fb_setcolreg()
118 struct goldfish_fb *fb = container_of(info, struct goldfish_fb, fb); in goldfish_fb_set_par() local
120 if (fb->rotation != fb->fb.var.rotate) { in goldfish_fb_set_par()
122 fb->rotation = fb->fb.var.rotate; in goldfish_fb_set_par()
123 writel(fb->rotation, fb->reg_base + FB_SET_ROTATION); in goldfish_fb_set_par()
134 struct goldfish_fb *fb = container_of(info, struct goldfish_fb, fb); in goldfish_fb_pan_display() local
136 spin_lock_irqsave(&fb->lock, irq_flags); in goldfish_fb_pan_display()
137 base_update_count = fb->base_update_count; in goldfish_fb_pan_display()
138 writel(fb->fb.fix.smem_start + fb->fb.var.xres * 2 * var->yoffset, in goldfish_fb_pan_display()
139 fb->reg_base + FB_SET_BASE); in goldfish_fb_pan_display()
140 spin_unlock_irqrestore(&fb->lock, irq_flags); in goldfish_fb_pan_display()
141 wait_event_timeout(fb->wait, in goldfish_fb_pan_display()
142 fb->base_update_count != base_update_count, HZ / 15); in goldfish_fb_pan_display()
143 if (fb->base_update_count == base_update_count) in goldfish_fb_pan_display()
150 struct goldfish_fb *fb = container_of(info, struct goldfish_fb, fb); in goldfish_fb_blank() local
154 writel(1, fb->reg_base + FB_SET_BLANK); in goldfish_fb_blank()
157 writel(0, fb->reg_base + FB_SET_BLANK); in goldfish_fb_blank()
178 struct goldfish_fb *fb; in goldfish_fb_probe() local
183 fb = kzalloc(sizeof(*fb), GFP_KERNEL); in goldfish_fb_probe()
184 if (fb == NULL) { in goldfish_fb_probe()
188 spin_lock_init(&fb->lock); in goldfish_fb_probe()
189 init_waitqueue_head(&fb->wait); in goldfish_fb_probe()
190 platform_set_drvdata(pdev, fb); in goldfish_fb_probe()
197 fb->reg_base = ioremap(r->start, PAGE_SIZE); in goldfish_fb_probe()
198 if (fb->reg_base == NULL) { in goldfish_fb_probe()
203 fb->irq = platform_get_irq(pdev, 0); in goldfish_fb_probe()
204 if (fb->irq < 0) { in goldfish_fb_probe()
205 ret = fb->irq; in goldfish_fb_probe()
209 width = readl(fb->reg_base + FB_GET_WIDTH); in goldfish_fb_probe()
210 height = readl(fb->reg_base + FB_GET_HEIGHT); in goldfish_fb_probe()
212 fb->fb.fbops = &goldfish_fb_ops; in goldfish_fb_probe()
213 fb->fb.pseudo_palette = fb->cmap; in goldfish_fb_probe()
214 fb->fb.fix.type = FB_TYPE_PACKED_PIXELS; in goldfish_fb_probe()
215 fb->fb.fix.visual = FB_VISUAL_TRUECOLOR; in goldfish_fb_probe()
216 fb->fb.fix.line_length = width * 2; in goldfish_fb_probe()
217 fb->fb.fix.accel = FB_ACCEL_NONE; in goldfish_fb_probe()
218 fb->fb.fix.ypanstep = 1; in goldfish_fb_probe()
220 fb->fb.var.xres = width; in goldfish_fb_probe()
221 fb->fb.var.yres = height; in goldfish_fb_probe()
222 fb->fb.var.xres_virtual = width; in goldfish_fb_probe()
223 fb->fb.var.yres_virtual = height * 2; in goldfish_fb_probe()
224 fb->fb.var.bits_per_pixel = 16; in goldfish_fb_probe()
225 fb->fb.var.activate = FB_ACTIVATE_NOW; in goldfish_fb_probe()
226 fb->fb.var.height = readl(fb->reg_base + FB_GET_PHYS_HEIGHT); in goldfish_fb_probe()
227 fb->fb.var.width = readl(fb->reg_base + FB_GET_PHYS_WIDTH); in goldfish_fb_probe()
228 fb->fb.var.pixclock = 0; in goldfish_fb_probe()
230 fb->fb.var.red.offset = 11; in goldfish_fb_probe()
231 fb->fb.var.red.length = 5; in goldfish_fb_probe()
232 fb->fb.var.green.offset = 5; in goldfish_fb_probe()
233 fb->fb.var.green.length = 6; in goldfish_fb_probe()
234 fb->fb.var.blue.offset = 0; in goldfish_fb_probe()
235 fb->fb.var.blue.length = 5; in goldfish_fb_probe()
238 fb->fb.screen_base = (char __force __iomem *)dma_alloc_coherent( in goldfish_fb_probe()
242 width, height, fb->fb.screen_base); in goldfish_fb_probe()
243 if (fb->fb.screen_base == NULL) { in goldfish_fb_probe()
247 fb->fb.fix.smem_start = fbpaddr; in goldfish_fb_probe()
248 fb->fb.fix.smem_len = framesize; in goldfish_fb_probe()
250 ret = fb_set_var(&fb->fb, &fb->fb.var); in goldfish_fb_probe()
254 ret = request_irq(fb->irq, goldfish_fb_interrupt, IRQF_SHARED, in goldfish_fb_probe()
255 pdev->name, fb); in goldfish_fb_probe()
259 writel(FB_INT_BASE_UPDATE_DONE, fb->reg_base + FB_INT_ENABLE); in goldfish_fb_probe()
260 goldfish_fb_pan_display(&fb->fb.var, &fb->fb); /* updates base */ in goldfish_fb_probe()
262 ret = register_framebuffer(&fb->fb); in goldfish_fb_probe()
268 free_irq(fb->irq, fb); in goldfish_fb_probe()
272 (void *)fb->fb.screen_base, in goldfish_fb_probe()
273 fb->fb.fix.smem_start); in goldfish_fb_probe()
276 iounmap(fb->reg_base); in goldfish_fb_probe()
278 kfree(fb); in goldfish_fb_probe()
286 struct goldfish_fb *fb = platform_get_drvdata(pdev); in goldfish_fb_remove() local
288 framesize = fb->fb.var.xres_virtual * fb->fb.var.yres_virtual * 2; in goldfish_fb_remove()
289 unregister_framebuffer(&fb->fb); in goldfish_fb_remove()
290 free_irq(fb->irq, fb); in goldfish_fb_remove()
292 dma_free_coherent(&pdev->dev, framesize, (void *)fb->fb.screen_base, in goldfish_fb_remove()
293 fb->fb.fix.smem_start); in goldfish_fb_remove()
294 iounmap(fb->reg_base); in goldfish_fb_remove()
295 kfree(fb); in goldfish_fb_remove()
299 { .compatible = "google,goldfish-fb", },