• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ FB2OFB函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中FB2OFB函数的典型用法代码示例。如果您正苦于以下问题:C++ FB2OFB函数的具体用法?C++ FB2OFB怎么用?C++ FB2OFB使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了FB2OFB函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: omapfb_setup_mem

static int omapfb_setup_mem(struct fb_info *fbi, struct omapfb_mem_info *mi)
{
    struct omapfb_info *ofbi = FB2OFB(fbi);
    struct omapfb2_device *fbdev = ofbi->fbdev;
    struct omap_dss_device *display = fb2display(fbi);
    struct omapfb2_mem_region *rg;
    int r = 0, i;
    size_t size;

    if (mi->type != OMAPFB_MEMTYPE_SDRAM)
        return -EINVAL;

    size = PAGE_ALIGN(mi->size);

    if (display && display->driver->sync)
        display->driver->sync(display);

    rg = ofbi->region;

    down_write_nested(&rg->lock, rg->id);
    atomic_inc(&rg->lock_count);

    if (rg->size == size && rg->type == mi->type)
        goto out;

    if (atomic_read(&rg->map_count)) {
        r = -EBUSY;
        goto out;
    }

    for (i = 0; i < fbdev->num_fbs; i++) {
        struct omapfb_info *ofbi2 = FB2OFB(fbdev->fbs[i]);
        int j;

        if (ofbi2->region != rg)
            continue;

        for (j = 0; j < ofbi2->num_overlays; j++) {
            struct omap_overlay *ovl;
            ovl = ofbi2->overlays[j];
            if (ovl->is_enabled(ovl)) {
                r = -EBUSY;
                goto out;
            }
        }
    }

    r = omapfb_realloc_fbmem(fbi, size, mi->type);
    if (r) {
        dev_err(fbdev->dev, "realloc fbmem failed\n");
        goto out;
    }

out:
    atomic_dec(&rg->lock_count);
    up_write(&rg->lock);

    return r;
}
开发者ID:mhei,项目名称:linux,代码行数:59,代码来源:omapfb-ioctl.c


示例2: omapfb_setup_mem

static int omapfb_setup_mem(struct fb_info *fbi, struct omapfb_mem_info *mi)
{
	struct omapfb_info *ofbi = FB2OFB(fbi);
	struct omapfb2_device *fbdev = ofbi->fbdev;
	struct omapfb2_mem_region *rg;
	int r, i;
	size_t size;

	if (mi->type > OMAPFB_MEMTYPE_MAX)
		return -EINVAL;

	size = PAGE_ALIGN(mi->size);

	rg = &ofbi->region;

	for (i = 0; i < ofbi->num_overlays; i++) {
		if (ofbi->overlays[i]->info.enabled)
			return -EBUSY;
	}

	if (rg->size != size || rg->type != mi->type) {
		r = omapfb_realloc_fbmem(fbi, size, mi->type);
		if (r) {
			dev_err(fbdev->dev, "realloc fbmem failed\n");
			return r;
		}
	}

	return 0;
}
开发者ID:12rafael,项目名称:jellytimekernel,代码行数:30,代码来源:omapfb-ioctl.c


示例3: store_size

static ssize_t store_size(struct device *dev, struct device_attribute *attr,
		const char *buf, size_t count)
{
	struct fb_info *fbi = dev_get_drvdata(dev);
	struct omapfb_info *ofbi = FB2OFB(fbi);
	unsigned long size;
	int r;
	int i;

	size = PAGE_ALIGN(simple_strtoul(buf, NULL, 0));

	if (!lock_fb_info(fbi))
		return -ENODEV;

	for (i = 0; i < ofbi->num_overlays; i++) {
		if (ofbi->overlays[i]->info.enabled) {
			r = -EBUSY;
			goto out;
		}
	}

	if (size != ofbi->region.size) {
		r = omapfb_realloc_fbmem(fbi, size, ofbi->region.type);
		if (r) {
			dev_err(dev, "realloc fbmem failed\n");
			goto out;
		}
	}

	r = count;
out:
	unlock_fb_info(fbi);

	return r;
}
开发者ID:12rafael,项目名称:jellytimekernel,代码行数:35,代码来源:omapfb-sysfs.c


示例4: show_overlays

static ssize_t show_overlays(struct device *dev,
		struct device_attribute *attr, char *buf)
{
	struct fb_info *fbi = dev_get_drvdata(dev);
	struct omapfb_info *ofbi = FB2OFB(fbi);
	struct omapfb2_device *fbdev = ofbi->fbdev;
	ssize_t l = 0;
	int t;

	if (!lock_fb_info(fbi))
		return -ENODEV;
	omapfb_lock(fbdev);

	for (t = 0; t < ofbi->num_overlays; t++) {
		struct omap_overlay *ovl = ofbi->overlays[t];
		int ovlnum;

		for (ovlnum = 0; ovlnum < fbdev->num_overlays; ++ovlnum)
			if (ovl == fbdev->overlays[ovlnum])
				break;

		l += snprintf(buf + l, PAGE_SIZE - l, "%s%d",
				t == 0 ? "" : ",", ovlnum);
	}

	l += snprintf(buf + l, PAGE_SIZE - l, "\n");

	omapfb_unlock(fbdev);
	unlock_fb_info(fbi);

	return l;
}
开发者ID:mikuhatsune001,项目名称:linux2.6.32,代码行数:32,代码来源:omapfb-sysfs.c


示例5: show_mirror

static ssize_t show_mirror(struct device *dev,
		struct device_attribute *attr, char *buf)
{
	struct fb_info *fbi = dev_get_drvdata(dev);
	struct omapfb_info *ofbi = FB2OFB(fbi);

	return snprintf(buf, PAGE_SIZE, "%d\n", ofbi->mirror);
}
开发者ID:mikuhatsune001,项目名称:linux2.6.32,代码行数:8,代码来源:omapfb-sysfs.c


示例6: show_phys

static ssize_t show_phys(struct device *dev,
		struct device_attribute *attr, char *buf)
{
	struct fb_info *fbi = dev_get_drvdata(dev);
	struct omapfb_info *ofbi = FB2OFB(fbi);

	return snprintf(buf, PAGE_SIZE, "%0x\n", ofbi->region->paddr);
}
开发者ID:mikuhatsune001,项目名称:linux2.6.32,代码行数:8,代码来源:omapfb-sysfs.c


示例7: OMAPLFBFlip

void OMAPLFBFlip(OMAPLFB_SWAPCHAIN *psSwapChain, unsigned long aPhyAddr)
{
	OMAPLFB_DEVINFO *psDevInfo = (OMAPLFB_DEVINFO *)psSwapChain->pvDevInfo;
	struct fb_info *framebuffer = psDevInfo->psLINFBInfo;
	struct omapfb_info *ofbi = FB2OFB(framebuffer);
	struct omapfb2_device *fbdev = ofbi->fbdev;

	omapfb_lock(fbdev);
	OMAPLFBFlipNoLock(psSwapChain, aPhyAddr);
	omapfb_unlock(fbdev);
}
开发者ID:mik9,项目名称:android_kernel_acclaim,代码行数:11,代码来源:omaplfb_linux.c


示例8: omapfb_query_mem

static int omapfb_query_mem(struct fb_info *fbi, struct omapfb_mem_info *mi)
{
	struct omapfb_info *ofbi = FB2OFB(fbi);
	struct omapfb2_mem_region *rg;

	rg = &ofbi->region;
	memset(mi, 0, sizeof(*mi));

	mi->size = rg->size;
	mi->type = rg->type;

	return 0;
}
开发者ID:12rafael,项目名称:jellytimekernel,代码行数:13,代码来源:omapfb-ioctl.c


示例9: OMAPLFBFlipNoLock

/*
 * Presents the flip in the display with the DSS2 overlay API
 * in: psSwapChain, aPhyAddr
 */
static void OMAPLFBFlipNoLock(OMAPLFB_SWAPCHAIN *psSwapChain,
	unsigned long aPhyAddr)
{
	OMAPLFB_DEVINFO *psDevInfo = (OMAPLFB_DEVINFO *)psSwapChain->pvDevInfo;
	struct fb_info * framebuffer = psDevInfo->psLINFBInfo;
	struct omapfb_info *ofbi = FB2OFB(framebuffer);
	unsigned long fb_offset;
	int i;

	fb_offset = aPhyAddr - psDevInfo->sSystemBuffer.sSysAddr.uiAddr;

	for(i = 0; i < ofbi->num_overlays ; i++)
	{
		struct omap_dss_device *display = NULL;
		struct omap_dss_driver *driver = NULL;
		struct omap_overlay_manager *manager;
		struct omap_overlay *overlay;
		struct omap_overlay_info overlay_info;

		overlay = ofbi->overlays[i];
		manager = overlay->manager;
		overlay->get_overlay_info( overlay, &overlay_info );

		overlay_info.paddr = framebuffer->fix.smem_start + fb_offset;
		overlay_info.vaddr = framebuffer->screen_base + fb_offset;
		overlay->set_overlay_info(overlay, &overlay_info);

		if (manager) {
			display = manager->device;
			/* No display attached to this overlay, don't update */
			if (!display)
				continue;
			driver = display->driver;
			manager->set_manager_info(manager, &manager->info);
			manager->apply(manager);
		}

		if (dss_ovl_manually_updated(overlay)) {
			if (driver->sched_update)
				driver->sched_update(display, 0, 0,
							overlay_info.width,
							overlay_info.height);
			else if (driver->update)
				driver->update(display, 0, 0,
							overlay_info.width,
							overlay_info.height);

		}

	}
}
开发者ID:mik9,项目名称:android_kernel_acclaim,代码行数:55,代码来源:omaplfb_linux.c


示例10: omapfb_setup_plane

static int omapfb_setup_plane(struct fb_info *fbi, struct omapfb_plane_info *pi)
{
	struct omapfb_info *ofbi = FB2OFB(fbi);
	struct omapfb2_device *fbdev = ofbi->fbdev;
	struct omap_overlay *ovl;
	struct omap_overlay_info info;
	int r = 0;

	DBG("omapfb_setup_plane\n");

	if (ofbi->num_overlays != 1) {
		r = -EINVAL;
		goto out;
	}

	/* XXX uses only the first overlay */
	ovl = ofbi->overlays[0];

	if (pi->enabled && !ofbi->region.size) {
		/*
		 * This plane's memory was freed, can't enable it
		 * until it's reallocated.
		 */
		r = -EINVAL;
		goto out;
	}

	ovl->get_overlay_info(ovl, &info);

	info.pos_x = pi->pos_x;
	info.pos_y = pi->pos_y;
	info.out_width = pi->out_width;
	info.out_height = pi->out_height;
	info.enabled = pi->enabled;

	r = ovl->set_overlay_info(ovl, &info);
	if (r)
		goto out;

	if (ovl->manager) {
		r = ovl->manager->apply(ovl->manager);
		if (r)
			goto out;
	}

out:
	if (r)
		dev_err(fbdev->dev, "setup_plane failed\n");
	return r;
}
开发者ID:12rafael,项目名称:jellytimekernel,代码行数:50,代码来源:omapfb-ioctl.c


示例11: FB2OFB

static struct omapfb_info *get_overlay_fb(struct omapfb2_device *fbdev,
		struct omap_overlay *ovl)
{
	int i, t;

	for (i = 0; i < fbdev->num_fbs; i++) {
		struct omapfb_info *ofbi = FB2OFB(fbdev->fbs[i]);

		for (t = 0; t < ofbi->num_overlays; t++) {
			if (ofbi->overlays[t] == ovl)
				return ofbi;
		}
	}

	return NULL;
}
开发者ID:mikuhatsune001,项目名称:linux2.6.32,代码行数:16,代码来源:omapfb-sysfs.c


示例12: OMAPLFBFlip

void OMAPLFBFlip(OMAPLFB_SWAPCHAIN *psSwapChain, unsigned long aPhyAddr)
{
struct omap_overlay* overlay;
	struct omap_overlay_info overlay_info;
	struct fb_info * framebuffer;
	OMAPLFB_DEVINFO	*psDevInfo;
	struct omapfb_info *ofbi;
	struct omapfb2_device *fbdev;
	int i;
	unsigned long fb_offset;

	psDevInfo = (OMAPLFB_DEVINFO *) psSwapChain->pvDevInfo;
	framebuffer = psDevInfo->psLINFBInfo;
	ofbi = FB2OFB(framebuffer);
	fb_offset = aPhyAddr - psDevInfo->sSystemBuffer.sSysAddr.uiAddr;
	fbdev = ofbi->fbdev;

	omapfb_lock(fbdev);

	for(i = 0; i < ofbi->num_overlays ; i++)
	{
		overlay = ofbi->overlays[i];
		overlay->get_overlay_info( overlay, &overlay_info );
		/* If the overlay is not enabled don't update it */
		if(!overlay_info.enabled)
			continue;

		overlay_info.paddr = framebuffer->fix.smem_start + fb_offset;
		overlay_info.vaddr = framebuffer->screen_base + fb_offset;
		overlay->set_overlay_info(overlay, &overlay_info);
		overlay->manager->apply(overlay->manager);

		if(overlay->manager->device->update)
		{
			overlay->manager->device->update(
				overlay->manager->device, 0, 0,
				overlay_info.width,
				overlay_info.height);
		}
	}

	omapfb_unlock(fbdev);

}
开发者ID:CyanogenDefy,项目名称:hardware-ti-sgx,代码行数:44,代码来源:omaplfb_linux.c


示例13: store_rotate_type

static ssize_t store_rotate_type(struct device *dev,
		struct device_attribute *attr,
		const char *buf, size_t count)
{
	struct fb_info *fbi = dev_get_drvdata(dev);
	struct omapfb_info *ofbi = FB2OFB(fbi);
	struct omapfb2_mem_region *rg;
	int rot_type;
	int r;

	r = kstrtoint(buf, 0, &rot_type);
	if (r)
		return r;

	if (rot_type != OMAP_DSS_ROT_DMA && rot_type != OMAP_DSS_ROT_VRFB)
		return -EINVAL;

	if (!lock_fb_info(fbi))
		return -ENODEV;

	r = 0;
	if (rot_type == ofbi->rotation_type)
		goto out;

	rg = omapfb_get_mem_region(ofbi->region);

	if (rg->size) {
		r = -EBUSY;
		goto put_region;
	}

	ofbi->rotation_type = rot_type;

	/*
	 * Since the VRAM for this FB is not allocated at the moment we don't
	 * need to do any further parameter checking at this point.
	 */
put_region:
	omapfb_put_mem_region(rg);
out:
	unlock_fb_info(fbi);

	return r ? r : count;
}
开发者ID:mikuhatsune001,项目名称:linux2.6.32,代码行数:44,代码来源:omapfb-sysfs.c


示例14: store_mirror

static ssize_t store_mirror(struct device *dev,
		struct device_attribute *attr,
		const char *buf, size_t count)
{
	struct fb_info *fbi = dev_get_drvdata(dev);
	struct omapfb_info *ofbi = FB2OFB(fbi);
	int mirror;
	int r;
	struct fb_var_screeninfo new_var;

	r = kstrtoint(buf, 0, &mirror);
	if (r)
		return r;

	mirror = !!mirror;

	if (!lock_fb_info(fbi))
		return -ENODEV;

	ofbi->mirror = mirror;

	omapfb_get_mem_region(ofbi->region);

	memcpy(&new_var, &fbi->var, sizeof(new_var));
	r = check_fb_var(fbi, &new_var);
	if (r)
		goto out;
	memcpy(&fbi->var, &new_var, sizeof(fbi->var));

	set_fb_fix(fbi);

	r = omapfb_apply_changes(fbi, 0);
	if (r)
		goto out;

	r = count;
out:
	omapfb_put_mem_region(ofbi->region);

	unlock_fb_info(fbi);

	return r;
}
开发者ID:119-org,项目名称:hi3518-osdrv,代码行数:43,代码来源:omapfb-sysfs.c



注:本文中的FB2OFB函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ FCEU_printf函数代码示例发布时间:2022-05-30
下一篇:
C++ FAssertMsg函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap