Lines Matching refs:fb
95 struct fb_info fb; member
102 struct goldfish_fb *fb = dev_id; in goldfish_fb_interrupt() local
105 spin_lock_irqsave(&fb->lock, irq_flags); in goldfish_fb_interrupt()
106 status = readl(fb->reg_base + FB_INT_STATUS); in goldfish_fb_interrupt()
108 fb->base_update_count++; in goldfish_fb_interrupt()
109 wake_up(&fb->wait); in goldfish_fb_interrupt()
111 spin_unlock_irqrestore(&fb->lock, irq_flags); in goldfish_fb_interrupt()
126 struct goldfish_fb *fb = container_of(info, struct goldfish_fb, fb); in goldfish_fb_setcolreg() local
129 fb->cmap[regno] = convert_bitfield(transp, &fb->fb.var.transp) | in goldfish_fb_setcolreg()
130 convert_bitfield(blue, &fb->fb.var.blue) | in goldfish_fb_setcolreg()
131 convert_bitfield(green, &fb->fb.var.green) | in goldfish_fb_setcolreg()
132 convert_bitfield(red, &fb->fb.var.red); in goldfish_fb_setcolreg()
169 struct goldfish_fb *fb = container_of(info, struct goldfish_fb, fb); in goldfish_fb_set_par() local
170 if (fb->rotation != fb->fb.var.rotate) { in goldfish_fb_set_par()
172 (fb->fb.var.bits_per_pixel / 8); in goldfish_fb_set_par()
173 fb->rotation = fb->fb.var.rotate; in goldfish_fb_set_par()
174 writel(fb->rotation, fb->reg_base + FB_SET_ROTATION); in goldfish_fb_set_par()
185 struct goldfish_fb *fb = container_of(info, struct goldfish_fb, fb); in goldfish_fb_pan_display() local
187 spin_lock_irqsave(&fb->lock, irq_flags); in goldfish_fb_pan_display()
188 base_update_count = fb->base_update_count; in goldfish_fb_pan_display()
189 writel(fb->fb.fix.smem_start + in goldfish_fb_pan_display()
190 fb->fb.var.xres * (fb->fb.var.bits_per_pixel / 8) * var->yoffset, in goldfish_fb_pan_display()
191 fb->reg_base + FB_SET_BASE); in goldfish_fb_pan_display()
192 spin_unlock_irqrestore(&fb->lock, irq_flags); in goldfish_fb_pan_display()
193 wait_event_timeout(fb->wait, in goldfish_fb_pan_display()
194 fb->base_update_count != base_update_count, HZ / 15); in goldfish_fb_pan_display()
195 if (fb->base_update_count == base_update_count) in goldfish_fb_pan_display()
202 struct goldfish_fb *fb = container_of(info, struct goldfish_fb, fb); in goldfish_fb_blank() local
205 writel(1, fb->reg_base + FB_SET_BLANK); in goldfish_fb_blank()
208 writel(0, fb->reg_base + FB_SET_BLANK); in goldfish_fb_blank()
231 struct goldfish_fb *fb; in goldfish_fb_probe() local
238 fb = kzalloc(sizeof(*fb), GFP_KERNEL); in goldfish_fb_probe()
239 if (fb == NULL) { in goldfish_fb_probe()
243 spin_lock_init(&fb->lock); in goldfish_fb_probe()
244 init_waitqueue_head(&fb->wait); in goldfish_fb_probe()
245 platform_set_drvdata(pdev, fb); in goldfish_fb_probe()
252 fb->reg_base = ioremap(r->start, PAGE_SIZE); in goldfish_fb_probe()
253 if (fb->reg_base == NULL) { in goldfish_fb_probe()
258 fb->irq = platform_get_irq(pdev, 0); in goldfish_fb_probe()
259 if (fb->irq <= 0) { in goldfish_fb_probe()
264 width = readl(fb->reg_base + FB_GET_WIDTH); in goldfish_fb_probe()
265 height = readl(fb->reg_base + FB_GET_HEIGHT); in goldfish_fb_probe()
266 format = readl(fb->reg_base + FB_GET_FORMAT); in goldfish_fb_probe()
274 fb->fb.fbops = &goldfish_fb_ops; in goldfish_fb_probe()
275 fb->fb.flags = FBINFO_FLAG_DEFAULT; in goldfish_fb_probe()
276 fb->fb.pseudo_palette = fb->cmap; in goldfish_fb_probe()
277 fb->fb.fix.type = FB_TYPE_PACKED_PIXELS; in goldfish_fb_probe()
278 fb->fb.fix.visual = FB_VISUAL_TRUECOLOR; in goldfish_fb_probe()
279 fb->fb.fix.line_length = width * bytes_per_pixel; in goldfish_fb_probe()
280 fb->fb.fix.accel = FB_ACCEL_NONE; in goldfish_fb_probe()
281 fb->fb.fix.ypanstep = 1; in goldfish_fb_probe()
283 fb->fb.var.xres = width; in goldfish_fb_probe()
284 fb->fb.var.yres = height; in goldfish_fb_probe()
285 fb->fb.var.xres_virtual = width; in goldfish_fb_probe()
286 fb->fb.var.yres_virtual = height * 2; in goldfish_fb_probe()
287 fb->fb.var.bits_per_pixel = bytes_per_pixel * 8; in goldfish_fb_probe()
288 fb->fb.var.activate = FB_ACTIVATE_NOW; in goldfish_fb_probe()
289 fb->fb.var.height = readl(fb->reg_base + FB_GET_PHYS_HEIGHT); in goldfish_fb_probe()
290 fb->fb.var.width = readl(fb->reg_base + FB_GET_PHYS_WIDTH); in goldfish_fb_probe()
291 fb->fb.var.pixclock = 0; in goldfish_fb_probe()
293 fb->fb.var.red.offset = fb_config->red_offset; in goldfish_fb_probe()
294 fb->fb.var.red.length = fb_config->red_length; in goldfish_fb_probe()
295 fb->fb.var.green.offset = fb_config->green_offset; in goldfish_fb_probe()
296 fb->fb.var.green.length = fb_config->green_length; in goldfish_fb_probe()
297 fb->fb.var.blue.offset = fb_config->blue_offset; in goldfish_fb_probe()
298 fb->fb.var.blue.length = fb_config->blue_length; in goldfish_fb_probe()
299 fb->fb.var.transp.offset = fb_config->transp_offset; in goldfish_fb_probe()
300 fb->fb.var.transp.length = fb_config->transp_length; in goldfish_fb_probe()
303 fb->fb.screen_base = (char __force __iomem *)dma_alloc_coherent( in goldfish_fb_probe()
307 width, height, fb->fb.screen_base); in goldfish_fb_probe()
308 if (fb->fb.screen_base == NULL) { in goldfish_fb_probe()
312 fb->fb.fix.smem_start = fbpaddr; in goldfish_fb_probe()
313 fb->fb.fix.smem_len = framesize; in goldfish_fb_probe()
315 ret = fb_set_var(&fb->fb, &fb->fb.var); in goldfish_fb_probe()
319 ret = request_irq(fb->irq, goldfish_fb_interrupt, IRQF_SHARED, in goldfish_fb_probe()
320 pdev->name, fb); in goldfish_fb_probe()
324 writel(FB_INT_BASE_UPDATE_DONE, fb->reg_base + FB_INT_ENABLE); in goldfish_fb_probe()
325 goldfish_fb_pan_display(&fb->fb.var, &fb->fb); /* updates base */ in goldfish_fb_probe()
327 ret = register_framebuffer(&fb->fb); in goldfish_fb_probe()
333 free_irq(fb->irq, fb); in goldfish_fb_probe()
337 (void *)fb->fb.screen_base, in goldfish_fb_probe()
338 fb->fb.fix.smem_start); in goldfish_fb_probe()
341 iounmap(fb->reg_base); in goldfish_fb_probe()
343 kfree(fb); in goldfish_fb_probe()
351 struct goldfish_fb *fb = platform_get_drvdata(pdev); in goldfish_fb_remove() local
353 framesize = fb->fb.var.xres_virtual * fb->fb.var.yres_virtual * in goldfish_fb_remove()
354 (fb->fb.var.bits_per_pixel / 8); in goldfish_fb_remove()
355 unregister_framebuffer(&fb->fb); in goldfish_fb_remove()
356 free_irq(fb->irq, fb); in goldfish_fb_remove()
358 dma_free_coherent(&pdev->dev, framesize, (void *)fb->fb.screen_base, in goldfish_fb_remove()
359 fb->fb.fix.smem_start); in goldfish_fb_remove()
360 iounmap(fb->reg_base); in goldfish_fb_remove()