Exemple #1
0
void __init s3cfb_set_platdata(struct s3c_platform_fb *pd)
{
	struct s3c_platform_fb *npd;
	int i;

	if (!pd)
		pd = &default_fb_data;

	npd = kmemdup(pd, sizeof(struct s3c_platform_fb), GFP_KERNEL);
	if (!npd)
		printk(KERN_ERR "%s: no memory for platform data\n", __func__);
	else {
		for (i = 0; i < npd->nr_wins; i++)
			npd->nr_buffers[i] = 1;

		npd->nr_buffers[npd->default_win] = CONFIG_FB_S3C_NR_BUFFERS;

		s3cfb_get_clk_name(npd->clk_name);
		npd->backlight_onoff = NULL;
		npd->clk_on = s3cfb_clk_on;
		npd->clk_off = s3cfb_clk_off;

		/* starting physical address of memory region */
		npd->pmem_start = s5p_get_media_memory_bank(S5P_MDEV_FIMD, 1);
		/* size of memory region */
		npd->pmem_size = s5p_get_media_memsize_bank(S5P_MDEV_FIMD, 1);

		s3c_device_fb.dev.platform_data = npd;
	}
}
Exemple #2
0
void __init s3cfb_set_platdata(struct s3c_platform_fb *pd)
{
	struct s3c_platform_fb *npd;
	int i;

	if (!pd)
		pd = &default_fb_data;

	npd = kmemdup(pd, sizeof(struct s3c_platform_fb), GFP_KERNEL);
	if (!npd)
		printk(KERN_ERR "%s: no memory for platform data\n", __func__);
	else {
		for (i = 0; i < npd->nr_wins; i++)
			npd->nr_buffers[i] = 1;

#if defined(CONFIG_FB_S5P_NR_BUFFERS)
		npd->nr_buffers[npd->default_win] = CONFIG_FB_S5P_NR_BUFFERS;
#else
		npd->nr_buffers[npd->default_win] = 1;
#endif

		s3cfb_get_clk_name(npd->clk_name);
		npd->set_display_path = s3cfb_set_display_path;
		npd->cfg_gpio = s3cfb_cfg_gpio;
		npd->backlight_on = s3cfb_backlight_on;
		npd->backlight_off = s3cfb_backlight_off;
		npd->lcd_on = s3cfb_lcd_on;
		npd->lcd_off = s3cfb_lcd_off;
		npd->clk_on = s3cfb_clk_on;
		npd->clk_off = s3cfb_clk_off;

		s3c_device_fb.dev.platform_data = npd;
	}
}
Exemple #3
0
void __init s3cfb_set_platdata(struct s3c_platform_fb *pd)
{
    struct s3c_platform_fb *npd;
    int i;

    if (!pd)
        pd = &default_fb_data;

    npd = kmemdup(pd, sizeof(struct s3c_platform_fb), GFP_KERNEL);
    if (!npd)
        printk(KERN_ERR "%s: no memory for platform data\n", __func__);
    else {
        for (i = 0; i < npd->nr_wins; i++)
            npd->nr_buffers[i] = 1;

        npd->nr_buffers[npd->default_win] = CONFIG_FB_S3C_YPANSTEP + 1;

        s3cfb_get_clk_name(npd->clk_name);
        npd->cfg_gpio = s3cfb_cfg_gpio;
        npd->backlight_on = s3cfb_backlight_on;
        npd->reset_lcd = s3cfb_reset_lcd;
        npd->clk_on = s3cfb_clk_on;
        npd->clk_off = s3cfb_clk_off;

        s3c_device_fb.dev.platform_data = npd;
    }
}
Exemple #4
0
void __init s3cfb_set_platdata(struct s3c_platform_fb *pd)
{
	struct s3c_platform_fb *npd;
	struct s3cfb_lcd *lcd;
	phys_addr_t pmem_start;
	int i, default_win, num_overlay_win;
	int frame_size;

	if (!pd)
		pd = &default_fb_data;

	npd = kmemdup(pd, sizeof(struct s3c_platform_fb), GFP_KERNEL);
	if (!npd)
		printk(KERN_ERR "%s: no memory for platform data\n", __func__);
	else {
		for (i = 0; i < npd->nr_wins; i++)
			npd->nr_buffers[i] = 1;

		default_win = npd->default_win;
		num_overlay_win = CONFIG_FB_S3C_NUM_OVLY_WIN;

		if (num_overlay_win >= default_win) {
			printk(KERN_WARNING "%s: NUM_OVLY_WIN should be less than default \
					window number. set to 0.\n", __func__);
			num_overlay_win = 0;
		}

		for (i = 0; i < num_overlay_win; i++)
			npd->nr_buffers[i] = CONFIG_FB_S3C_NUM_BUF_OVLY_WIN;
		npd->nr_buffers[default_win] = CONFIG_FB_S3C_NR_BUFFERS;

		lcd = (struct s3cfb_lcd *)npd->lcd;
		frame_size = (lcd->width * lcd->height * 4);

		s3cfb_get_clk_name(npd->clk_name);
		npd->backlight_onoff = NULL;
		npd->clk_on = s3cfb_clk_on;
		npd->clk_off = s3cfb_clk_off;

		/* set starting physical address & size of memory region for overlay
		 * window */
		pmem_start = s5p_get_media_memory_bank(S5P_MDEV_FIMD, 1);
		for (i = 0; i < num_overlay_win; i++) {
			npd->pmem_start[i] = pmem_start;
			npd->pmem_size[i] = frame_size * npd->nr_buffers[i];
			pmem_start += npd->pmem_size[i];
		}

		/* set starting physical address & size of memory region for default
		 * window */
		npd->pmem_start[default_win] = pmem_start;
		npd->pmem_size[default_win] = frame_size * npd->nr_buffers[default_win];

		s3c_device_fb.dev.platform_data = npd;
	}
Exemple #5
0
void __init s3c_fb_set_platdata(struct s3c_platform_fb *pd)
{
	struct s3c_platform_fb *npd;
	struct s3cfb_lcd *lcd;
	phys_addr_t pmem_start;
	int i, default_win, num_overlay_win;
	int frame_size;
	if (!pd)
		pd = &default_fb_data;

	npd = kmemdup(pd, sizeof(struct s3c_platform_fb), GFP_KERNEL);
	if (!npd) {
		printk(KERN_ERR "%s: no memory for platform data\n", __func__);
	} else {
//		for (i = 0; i < npd->nr_wins; i++) {
		for (i = 0; i < npd->nr_wins && i < NR_BUFFERS; i++) {
			npd->nr_buffers[i] = 1;
		}

		default_win = npd->default_win;
		num_overlay_win = CONFIG_FB_S3C_NUM_OVLY_WIN;

		if (num_overlay_win >= default_win) {
			printk(KERN_WARNING "%s: NUM_OVLY_WIN should be less than default \
					window number. set to 0.\n", __func__);
			num_overlay_win = 0;
		}
#if 0
		for (i = 0; i < num_overlay_win; i++)
			npd->nr_buffers[i] = CONFIG_FB_S3C_NUM_BUF_OVLY_WIN;
		npd->nr_buffers[default_win] = CONFIG_FB_S3C_NR_BUFFERS;
#endif

		lcd = (struct s3cfb_lcd *)npd->lcd;
//		frame_size = (lcd->width * lcd->height * 4);
		frame_size = ALIGN(lcd->width * lcd->height * 4, PAGE_SIZE);

		s3cfb_get_clk_name(npd->clk_name);
		npd->backlight_onoff = NULL;
		npd->clk_on = s3cfb_clk_on;
		npd->clk_off = s3cfb_clk_off;

		/* set starting physical address & size of memory region for overlay
		  * window */
		pmem_start = s5p_get_media_memory_bank(S5P_MDEV_FIMD, 1);
//		printk("---pmem_start is 0x%x\n",pmem_start);

		for (i = 0; i < num_overlay_win; i++) {
			npd->nr_buffers[i] = CONFIG_FB_S3C_NUM_BUF_OVLY_WIN;
			npd->pmem_start[i] = pmem_start;
			npd->pmem_size[i] = frame_size * npd->nr_buffers[i];
			pmem_start += npd->pmem_size[i];
		}

		npd->nr_buffers[default_win] = CONFIG_FB_S3C_NR_BUFFERS;
		/* set starting physical address & size of memory region for default
 *		  * window */
		npd->pmem_start[default_win] = pmem_start;
		npd->pmem_size[default_win] = frame_size * npd->nr_buffers[default_win];

#if defined(CONFIG_MACH_TQ210)
		npd->pmem_size[default_win] += ALIGN(1280*720, PAGE_SIZE) * 3;
		npd->pmem_size[default_win] += ALIGN(1280*360, PAGE_SIZE) * 3 + PAGE_SIZE;

		if (frame_size > 0x200000) {
			pmem_start += npd->pmem_size[default_win];
			for (; i < npd->nr_wins; i++) {
				if (i != default_win) {
					npd->nr_buffers[i] = 2;
					npd->pmem_start[i] = pmem_start;
					npd->pmem_size[i] = frame_size * npd->nr_buffers[i];
					break;
				}
			}
		}
#endif

		s3c_device_fb.dev.platform_data = npd;
	}