int osddev_ext_setcolreg(unsigned regno, u16 red, u16 green, u16 blue,
                         u16 transp, struct myfb_dev *fbdev)
{
	struct fb_info *info = fbdev->fb_info;

	if ((fbdev->color->color_index == COLOR_INDEX_02_PAL4) ||
	    (fbdev->color->color_index == COLOR_INDEX_04_PAL16) ||
	    (fbdev->color->color_index == COLOR_INDEX_08_PAL256)) {

		fbdev_lock(fbdev);

		osd_ext_setpal_hw(regno, red, green, blue, transp, fbdev->fb_info->node - 2);

		fbdev_unlock(fbdev);
	}

	if (info->fix.visual == FB_VISUAL_TRUECOLOR) {
		u32 v, r, g, b, a;

		if (regno >= 16) {
			return 1;
		}

		r = red    >> (16 - info->var.red.length);
		g = green  >> (16 - info->var.green.length);
		b = blue   >> (16 - info->var.blue.length);
		a = transp >> (16 - info->var.transp.length);

		v = (r << info->var.red.offset)   |
		    (g << info->var.green.offset) |
		    (b << info->var.blue.offset)  |
		    (a << info->var.transp.offset);

		((u32*)(info->pseudo_palette))[regno] = v;
	}
예제 #2
0
파일: osd_dev.c 프로젝트: osmc/vero2-linux
void osddev_set(struct myfb_dev *fbdev)
{
	
    fbdev_lock(fbdev);

    //memset((char*) fbdev->fb_mem,0x0,fbdev->fb_len);

    osd_setup(&fbdev->osd_ctl,
               fbdev->fb_info->var.xoffset,
               fbdev->fb_info->var.yoffset,
               fbdev->fb_info->var.xres,
               fbdev->fb_info->var.yres,
               fbdev->fb_info->var.xres_virtual,
               fbdev->fb_info->var.yres_virtual,
               fbdev->osd_ctl.disp_start_x,
               fbdev->osd_ctl.disp_start_y,
               fbdev->osd_ctl.disp_end_x,
               fbdev->osd_ctl.disp_end_y,
               fbdev->fb_mem_paddr,
               fbdev->color,
               fbdev->fb_info->node);	



    fbdev_unlock(fbdev);
    	
    return;
}