static int mdp_close(struct v4l2_subdev *sd, void *arg)
{
	struct mdp_instance *inst = arg;
	if (inst) {
		if (inst->secure)
			msm_fb_writeback_set_secure(inst->mdp, false);
		msm_fb_writeback_terminate(inst->mdp);
		kfree(inst);
	}
	return 0;
}
Esempio n. 2
0
int mdp_close(struct v4l2_subdev *sd, void *arg)
{
	struct mdp_instance *inst = arg;
	struct fb_info *fbi = NULL;
	if (inst) {
		fbi = (struct fb_info *)inst->mdp;
		msm_fb_writeback_terminate(fbi);
		kfree(inst);
	}
	return 0;
}
Esempio n. 3
0
int mdp_close(struct v4l2_subdev *sd, void *arg)
{
    struct mdp_instance *inst = arg;
    struct fb_info *fbi = NULL;
    if (inst) {
        fbi = (struct fb_info *)inst->mdp;
        msm_fb_writeback_terminate(fbi);
        /* Releasing the instance after unregistering */
        kfree(inst);
    }
    return 0;
}
Esempio n. 4
0
int mdp_close(struct v4l2_subdev *sd, void *arg)
{
	struct mdp_instance *inst = arg;
	struct fb_info *fbi = NULL;
	if (inst) {
		fbi = (struct fb_info *)inst->mdp;
		msm_fb_writeback_terminate(fbi);
		kfree(inst);
		/* Unregister wfd node from switch driver */
		switch_dev_unregister(&inst->sdev);
	}
	return 0;
}
int mdp_open(struct v4l2_subdev *sd, void *arg)
{
	struct mdp_instance *inst = kzalloc(sizeof(struct mdp_instance),
					GFP_KERNEL);
	struct mdp_msg_ops *mops = arg;
	int rc = 0;
	struct fb_info *fbi = NULL;

	if (!inst) {
		WFD_MSG_ERR("Out of memory\n");
		rc = -ENOMEM;
		goto mdp_open_fail;
	} else if (!mops) {
		WFD_MSG_ERR("Invalid arguments\n");
		rc = -EINVAL;
		goto mdp_open_fail;
	}

	fbi = msm_fb_get_writeback_fb();
	if (!fbi) {
		WFD_MSG_ERR("Failed to acquire mdp instance\n");
		rc = -ENODEV;
		goto mdp_open_fail;
	}

	msm_fb_writeback_init(fbi);

	inst->mdp = fbi;
	inst->secure = mops->secure;
	if (mops->secure) {
		rc = mdp_secure(sd, inst);
		if (rc) {
			WFD_MSG_ERR("Couldn't secure MDP\n");
			goto mdp_secure_fail;
		}
	}


	mops->cookie = inst;
	return 0;
mdp_secure_fail:
	msm_fb_writeback_terminate(fbi);
mdp_open_fail:
	kfree(inst);
	return rc;
}