Lines Matching refs:fb
100 struct fb_info fb; member
107 struct goldfish_fb *fb = dev_id; in goldfish_fb_interrupt() local
110 spin_lock_irqsave(&fb->lock, irq_flags); in goldfish_fb_interrupt()
111 status = readl(fb->reg_base + FB_INT_STATUS); in goldfish_fb_interrupt()
113 fb->base_update_count++; in goldfish_fb_interrupt()
114 wake_up(&fb->wait); in goldfish_fb_interrupt()
116 spin_unlock_irqrestore(&fb->lock, irq_flags); in goldfish_fb_interrupt()
131 struct goldfish_fb *fb = container_of(info, struct goldfish_fb, fb); in goldfish_fb_setcolreg() local
134 fb->cmap[regno] = convert_bitfield(transp, &fb->fb.var.transp) | in goldfish_fb_setcolreg()
135 convert_bitfield(blue, &fb->fb.var.blue) | in goldfish_fb_setcolreg()
136 convert_bitfield(green, &fb->fb.var.green) | in goldfish_fb_setcolreg()
137 convert_bitfield(red, &fb->fb.var.red); in goldfish_fb_setcolreg()
174 struct goldfish_fb *fb = container_of(info, struct goldfish_fb, fb); in goldfish_fb_set_par() local
176 if (fb->rotation != fb->fb.var.rotate) { in goldfish_fb_set_par()
178 (fb->fb.var.bits_per_pixel / CHAR_BIT); in goldfish_fb_set_par()
179 fb->rotation = fb->fb.var.rotate; in goldfish_fb_set_par()
180 writel(fb->rotation, fb->reg_base + FB_SET_ROTATION); in goldfish_fb_set_par()
191 struct goldfish_fb *fb = container_of(info, struct goldfish_fb, fb); in goldfish_fb_pan_display() local
193 spin_lock_irqsave(&fb->lock, irq_flags); in goldfish_fb_pan_display()
194 base_update_count = fb->base_update_count; in goldfish_fb_pan_display()
195 writel(fb->fb.fix.smem_start + in goldfish_fb_pan_display()
196 fb->fb.var.xres * in goldfish_fb_pan_display()
197 (fb->fb.var.bits_per_pixel / CHAR_BIT) * in goldfish_fb_pan_display()
199 fb->reg_base + FB_SET_BASE); in goldfish_fb_pan_display()
200 spin_unlock_irqrestore(&fb->lock, irq_flags); in goldfish_fb_pan_display()
201 wait_event_timeout(fb->wait, in goldfish_fb_pan_display()
202 fb->base_update_count != base_update_count, HZ / 15); in goldfish_fb_pan_display()
203 if (fb->base_update_count == base_update_count) in goldfish_fb_pan_display()
211 struct goldfish_fb *fb = container_of(info, struct goldfish_fb, fb); in goldfish_fb_blank() local
215 writel(1, fb->reg_base + FB_SET_BLANK); in goldfish_fb_blank()
218 writel(0, fb->reg_base + FB_SET_BLANK); in goldfish_fb_blank()
241 struct goldfish_fb *fb; in goldfish_fb_probe() local
248 fb = kzalloc(sizeof(*fb), GFP_KERNEL); in goldfish_fb_probe()
249 if (fb == NULL) { in goldfish_fb_probe()
253 spin_lock_init(&fb->lock); in goldfish_fb_probe()
254 init_waitqueue_head(&fb->wait); in goldfish_fb_probe()
255 platform_set_drvdata(pdev, fb); in goldfish_fb_probe()
262 fb->reg_base = ioremap(r->start, PAGE_SIZE); in goldfish_fb_probe()
263 if (fb->reg_base == NULL) { in goldfish_fb_probe()
268 fb->irq = platform_get_irq(pdev, 0); in goldfish_fb_probe()
269 if (fb->irq <= 0) { in goldfish_fb_probe()
274 width = readl(fb->reg_base + FB_GET_WIDTH); in goldfish_fb_probe()
275 height = readl(fb->reg_base + FB_GET_HEIGHT); in goldfish_fb_probe()
276 format = readl(fb->reg_base + FB_GET_FORMAT); in goldfish_fb_probe()
284 fb->fb.fbops = &goldfish_fb_ops; in goldfish_fb_probe()
285 fb->fb.flags = FBINFO_FLAG_DEFAULT; in goldfish_fb_probe()
286 fb->fb.pseudo_palette = fb->cmap; in goldfish_fb_probe()
287 fb->fb.fix.type = FB_TYPE_PACKED_PIXELS; in goldfish_fb_probe()
288 fb->fb.fix.visual = FB_VISUAL_TRUECOLOR; in goldfish_fb_probe()
289 fb->fb.fix.line_length = width * bytes_per_pixel; in goldfish_fb_probe()
290 fb->fb.fix.accel = FB_ACCEL_NONE; in goldfish_fb_probe()
291 fb->fb.fix.ypanstep = 1; in goldfish_fb_probe()
293 fb->fb.var.xres = width; in goldfish_fb_probe()
294 fb->fb.var.yres = height; in goldfish_fb_probe()
295 fb->fb.var.xres_virtual = width; in goldfish_fb_probe()
296 fb->fb.var.yres_virtual = height * 2; in goldfish_fb_probe()
297 fb->fb.var.bits_per_pixel = bytes_per_pixel * CHAR_BIT; in goldfish_fb_probe()
298 fb->fb.var.activate = FB_ACTIVATE_NOW; in goldfish_fb_probe()
299 fb->fb.var.height = readl(fb->reg_base + FB_GET_PHYS_HEIGHT); in goldfish_fb_probe()
300 fb->fb.var.width = readl(fb->reg_base + FB_GET_PHYS_WIDTH); in goldfish_fb_probe()
301 fb->fb.var.pixclock = 0; in goldfish_fb_probe()
303 fb->fb.var.red.offset = fb_config->red_offset; in goldfish_fb_probe()
304 fb->fb.var.red.length = fb_config->red_length; in goldfish_fb_probe()
305 fb->fb.var.green.offset = fb_config->green_offset; in goldfish_fb_probe()
306 fb->fb.var.green.length = fb_config->green_length; in goldfish_fb_probe()
307 fb->fb.var.blue.offset = fb_config->blue_offset; in goldfish_fb_probe()
308 fb->fb.var.blue.length = fb_config->blue_length; in goldfish_fb_probe()
309 fb->fb.var.transp.offset = fb_config->transp_offset; in goldfish_fb_probe()
310 fb->fb.var.transp.length = fb_config->transp_length; in goldfish_fb_probe()
313 fb->fb.screen_base = (char __force __iomem *)dma_alloc_coherent( in goldfish_fb_probe()
317 width, height, fb->fb.screen_base); in goldfish_fb_probe()
318 if (fb->fb.screen_base == NULL) { in goldfish_fb_probe()
322 fb->fb.fix.smem_start = fbpaddr; in goldfish_fb_probe()
323 fb->fb.fix.smem_len = framesize; in goldfish_fb_probe()
325 ret = fb_set_var(&fb->fb, &fb->fb.var); in goldfish_fb_probe()
329 ret = request_irq(fb->irq, goldfish_fb_interrupt, IRQF_SHARED, in goldfish_fb_probe()
330 pdev->name, fb); in goldfish_fb_probe()
334 writel(FB_INT_BASE_UPDATE_DONE, fb->reg_base + FB_INT_ENABLE); in goldfish_fb_probe()
335 goldfish_fb_pan_display(&fb->fb.var, &fb->fb); /* updates base */ in goldfish_fb_probe()
337 ret = register_framebuffer(&fb->fb); in goldfish_fb_probe()
343 free_irq(fb->irq, fb); in goldfish_fb_probe()
347 (void *)fb->fb.screen_base, in goldfish_fb_probe()
348 fb->fb.fix.smem_start); in goldfish_fb_probe()
351 iounmap(fb->reg_base); in goldfish_fb_probe()
353 kfree(fb); in goldfish_fb_probe()
361 struct goldfish_fb *fb = platform_get_drvdata(pdev); in goldfish_fb_remove() local
363 framesize = fb->fb.var.xres_virtual * fb->fb.var.yres_virtual * in goldfish_fb_remove()
364 (fb->fb.var.bits_per_pixel / CHAR_BIT); in goldfish_fb_remove()
365 unregister_framebuffer(&fb->fb); in goldfish_fb_remove()
366 free_irq(fb->irq, fb); in goldfish_fb_remove()
368 dma_free_coherent(&pdev->dev, framesize, (void *)fb->fb.screen_base, in goldfish_fb_remove()
369 fb->fb.fix.smem_start); in goldfish_fb_remove()
370 iounmap(fb->reg_base); in goldfish_fb_remove()
371 kfree(fb); in goldfish_fb_remove()