H A D | matroxfb_crtc2.c | 33 #define m2info (container_of(info, struct matroxfb_dh_fb_info, fbcon)) matroxfb_dh_setcolreg() macro 37 if (m2info->fbcon.var.grayscale) { matroxfb_dh_setcolreg() 41 red = CNVT_TOHW(red, m2info->fbcon.var.red.length); matroxfb_dh_setcolreg() 42 green = CNVT_TOHW(green, m2info->fbcon.var.green.length); matroxfb_dh_setcolreg() 43 blue = CNVT_TOHW(blue, m2info->fbcon.var.blue.length); matroxfb_dh_setcolreg() 44 transp = CNVT_TOHW(transp, m2info->fbcon.var.transp.length); matroxfb_dh_setcolreg() 46 col = (red << m2info->fbcon.var.red.offset) | matroxfb_dh_setcolreg() 47 (green << m2info->fbcon.var.green.offset) | matroxfb_dh_setcolreg() 48 (blue << m2info->fbcon.var.blue.offset) | matroxfb_dh_setcolreg() 49 (transp << m2info->fbcon.var.transp.offset); matroxfb_dh_setcolreg() 51 switch (m2info->fbcon.var.bits_per_pixel) { matroxfb_dh_setcolreg() 53 m2info->cmap[regno] = col | (col << 16); matroxfb_dh_setcolreg() 56 m2info->cmap[regno] = col; matroxfb_dh_setcolreg() 60 #undef m2info matroxfb_dh_setcolreg() macro 63 static void matroxfb_dh_restore(struct matroxfb_dh_fb_info* m2info, matroxfb_dh_restore() argument 69 struct matrox_fb_info *minfo = m2info->primary_dev; matroxfb_dh_restore() 122 u_int32_t linelen = m2info->fbcon.var.xres_virtual * (m2info->fbcon.var.bits_per_pixel >> 3); matroxfb_dh_restore() 128 m2info->interlaced = 1; matroxfb_dh_restore() 131 m2info->interlaced = 0; matroxfb_dh_restore() 160 static void matroxfb_dh_disable(struct matroxfb_dh_fb_info* m2info) { matroxfb_dh_disable() argument 161 struct matrox_fb_info *minfo = m2info->primary_dev; matroxfb_dh_disable() 167 static void matroxfb_dh_pan_var(struct matroxfb_dh_fb_info* m2info, matroxfb_dh_pan_var() argument 172 struct matrox_fb_info *minfo = m2info->primary_dev; matroxfb_dh_pan_var() 174 m2info->fbcon.var.xoffset = var->xoffset; matroxfb_dh_pan_var() 175 m2info->fbcon.var.yoffset = var->yoffset; matroxfb_dh_pan_var() 176 pixelsize = m2info->fbcon.var.bits_per_pixel >> 3; matroxfb_dh_pan_var() 177 linelen = m2info->fbcon.var.xres_virtual * pixelsize; matroxfb_dh_pan_var() 178 pos = m2info->fbcon.var.yoffset * linelen + m2info->fbcon.var.xoffset * pixelsize; matroxfb_dh_pan_var() 179 pos += m2info->video.offbase; matroxfb_dh_pan_var() 180 if (m2info->interlaced) { matroxfb_dh_pan_var() 188 static int matroxfb_dh_decode_var(struct matroxfb_dh_fb_info* m2info, matroxfb_dh_decode_var() argument 204 vramlen = m2info->video.len_usable; matroxfb_dh_decode_var() 263 #define m2info (container_of(info, struct matroxfb_dh_fb_info, fbcon)) matroxfb_dh_open() macro 264 struct matrox_fb_info *minfo = m2info->primary_dev; matroxfb_dh_open() 278 #undef m2info matroxfb_dh_open() macro 282 #define m2info (container_of(info, struct matroxfb_dh_fb_info, fbcon)) matroxfb_dh_release() macro 284 struct matrox_fb_info *minfo = m2info->primary_dev; matroxfb_dh_release() 290 #undef m2info matroxfb_dh_release() macro 297 static void matroxfb_dh_init_fix(struct matroxfb_dh_fb_info *m2info) matroxfb_dh_init_fix() argument 299 struct fb_fix_screeninfo *fix = &m2info->fbcon.fix; matroxfb_dh_init_fix() 303 fix->smem_start = m2info->video.base; matroxfb_dh_init_fix() 304 fix->smem_len = m2info->video.len_usable; matroxfb_dh_init_fix() 308 fix->mmio_start = m2info->mmio.base; matroxfb_dh_init_fix() 309 fix->mmio_len = m2info->mmio.len; matroxfb_dh_init_fix() 314 #define m2info (container_of(info, struct matroxfb_dh_fb_info, fbcon)) matroxfb_dh_check_var() macro 319 return matroxfb_dh_decode_var(m2info, var, &visual, &cmap_len, &mode); matroxfb_dh_check_var() 320 #undef m2info matroxfb_dh_check_var() macro 324 #define m2info (container_of(info, struct matroxfb_dh_fb_info, fbcon)) matroxfb_dh_set_par() macro 330 struct matrox_fb_info *minfo = m2info->primary_dev; matroxfb_dh_set_par() 332 if ((err = matroxfb_dh_decode_var(m2info, var, &visual, &cmap_len, &mode)) != 0) matroxfb_dh_set_par() 336 m2info->fbcon.screen_base = vaddr_va(m2info->video.vbase); matroxfb_dh_set_par() 337 m2info->fbcon.fix.visual = visual; matroxfb_dh_set_par() 338 m2info->fbcon.fix.type = FB_TYPE_PACKED_PIXELS; matroxfb_dh_set_par() 339 m2info->fbcon.fix.type_aux = 0; matroxfb_dh_set_par() 340 m2info->fbcon.fix.line_length = (var->xres_virtual * var->bits_per_pixel) >> 3; matroxfb_dh_set_par() 348 matroxfb_var2my(&m2info->fbcon.var, &mt); matroxfb_dh_set_par() 353 pos = (m2info->fbcon.var.yoffset * m2info->fbcon.var.xres_virtual + m2info->fbcon.var.xoffset) * m2info->fbcon.var.bits_per_pixel >> 3; matroxfb_dh_set_par() 354 pos += m2info->video.offbase; matroxfb_dh_set_par() 369 matroxfb_dh_restore(m2info, &mt, mode, pos); matroxfb_dh_set_par() 371 matroxfb_dh_disable(m2info); matroxfb_dh_set_par() 390 m2info->initialized = 1; matroxfb_dh_set_par() 392 #undef m2info matroxfb_dh_set_par() macro 396 #define m2info (container_of(info, struct matroxfb_dh_fb_info, fbcon)) matroxfb_dh_pan_display() macro 397 matroxfb_dh_pan_var(m2info, var); matroxfb_dh_pan_display() 399 #undef m2info matroxfb_dh_pan_display() macro 402 static int matroxfb_dh_get_vblank(const struct matroxfb_dh_fb_info* m2info, struct fb_vblank* vblank) { matroxfb_dh_get_vblank() argument 403 struct matrox_fb_info *minfo = m2info->primary_dev; matroxfb_dh_get_vblank() 411 if (vblank->vcount >= m2info->fbcon.var.yres) matroxfb_dh_get_vblank() 426 #define m2info (container_of(info, struct matroxfb_dh_fb_info, fbcon)) matroxfb_dh_ioctl() macro 427 struct matrox_fb_info *minfo = m2info->primary_dev; matroxfb_dh_ioctl() 437 err = matroxfb_dh_get_vblank(m2info, &vblank); DBG() 548 #undef m2info macro 552 #define m2info (container_of(info, struct matroxfb_dh_fb_info, fbcon)) matroxfb_dh_blank() macro 562 #undef m2info matroxfb_dh_blank() macro 599 struct matroxfb_dh_fb_info *m2info) matroxfb_dh_regit() 601 #define minfo (m2info->primary_dev) matroxfb_dh_regit() 604 m2info->fbcon.fbops = &matroxfb_dh_ops; matroxfb_dh_regit() 605 m2info->fbcon.flags = FBINFO_FLAG_DEFAULT; matroxfb_dh_regit() 606 m2info->fbcon.flags |= FBINFO_HWACCEL_XPAN | matroxfb_dh_regit() 608 m2info->fbcon.pseudo_palette = m2info->cmap; matroxfb_dh_regit() 609 fb_alloc_cmap(&m2info->fbcon.cmap, 256, 1); matroxfb_dh_regit() 617 m2info->video.offbase = minfo->video.len - mem; matroxfb_dh_regit() 621 m2info->video.borrowed = mem; matroxfb_dh_regit() 623 m2info->video.offbase = minfo->video.len_usable; matroxfb_dh_regit() 625 m2info->video.base = minfo->video.base + m2info->video.offbase; matroxfb_dh_regit() 626 m2info->video.len = m2info->video.len_usable = m2info->video.len_maximum = mem; matroxfb_dh_regit() 627 m2info->video.vbase.vaddr = vaddr_va(minfo->video.vbase) + m2info->video.offbase; matroxfb_dh_regit() 628 m2info->mmio.base = minfo->mmio.base; matroxfb_dh_regit() 629 m2info->mmio.vbase = minfo->mmio.vbase; matroxfb_dh_regit() 630 m2info->mmio.len = minfo->mmio.len; matroxfb_dh_regit() 632 matroxfb_dh_init_fix(m2info); matroxfb_dh_regit() 633 if (register_framebuffer(&m2info->fbcon)) { matroxfb_dh_regit() 636 if (!m2info->initialized) matroxfb_dh_regit() 637 fb_set_var(&m2info->fbcon, &matroxfb_dh_defined); matroxfb_dh_regit() 640 minfo->crtc2.info = m2info; matroxfb_dh_regit() 652 static int matroxfb_dh_registerfb(struct matroxfb_dh_fb_info* m2info) { matroxfb_dh_registerfb() argument 653 #define minfo (m2info->primary_dev) matroxfb_dh_registerfb() 654 if (matroxfb_dh_regit(minfo, m2info)) { matroxfb_dh_registerfb() 659 minfo->fbcon.node, m2info->fbcon.node); matroxfb_dh_registerfb() 660 m2info->fbcon_registered = 1; matroxfb_dh_registerfb() 665 static void matroxfb_dh_deregisterfb(struct matroxfb_dh_fb_info* m2info) { matroxfb_dh_deregisterfb() argument 666 #define minfo (m2info->primary_dev) matroxfb_dh_deregisterfb() 667 if (m2info->fbcon_registered) { matroxfb_dh_deregisterfb() 673 if (crtc2 == m2info) matroxfb_dh_deregisterfb() 676 if (crtc2 != m2info) { matroxfb_dh_deregisterfb() 678 crtc2, m2info); matroxfb_dh_deregisterfb() 682 id = m2info->fbcon.node; matroxfb_dh_deregisterfb() 683 unregister_framebuffer(&m2info->fbcon); matroxfb_dh_deregisterfb() 685 minfo->video.len_usable += m2info->video.borrowed; matroxfb_dh_deregisterfb() 687 m2info->fbcon_registered = 0; matroxfb_dh_deregisterfb() 693 struct matroxfb_dh_fb_info* m2info; matroxfb_crtc2_probe() local 698 m2info = kzalloc(sizeof(*m2info), GFP_KERNEL); matroxfb_crtc2_probe() 699 if (!m2info) { matroxfb_crtc2_probe() 703 m2info->primary_dev = minfo; matroxfb_crtc2_probe() 704 if (matroxfb_dh_registerfb(m2info)) { matroxfb_crtc2_probe() 705 kfree(m2info); matroxfb_crtc2_probe() 709 return m2info; matroxfb_crtc2_probe() 598 matroxfb_dh_regit(const struct matrox_fb_info *minfo, struct matroxfb_dh_fb_info *m2info) matroxfb_dh_regit() argument
|