Loading drivers/media/platform/msm/wfd/mdp-5-subdev.c +3 −2 Original line number Original line Diff line number Diff line Loading @@ -177,11 +177,12 @@ static int mdp_dq_buffer(struct v4l2_subdev *sd, void *arg) static int mdp_set_prop(struct v4l2_subdev *sd, void *arg) static int mdp_set_prop(struct v4l2_subdev *sd, void *arg) { { struct mdp_prop *prop = (struct mdp_prop *)arg; struct mdp_prop *prop = (struct mdp_prop *)arg; struct mdp_instance *inst = prop->inst; struct mdp_instance *inst; if (!prop || !inst) { if (!prop || !prop->inst) { WFD_MSG_ERR("Invalid arguments\n"); WFD_MSG_ERR("Invalid arguments\n"); return -EINVAL; return -EINVAL; } } inst = prop->inst; inst->height = prop->height; inst->height = prop->height; inst->width = prop->width; inst->width = prop->width; return 0; return 0; Loading drivers/media/platform/msm/wfd/vsg-subdev.c +13 −3 Original line number Original line Diff line number Diff line Loading @@ -135,6 +135,9 @@ static void vsg_work_func(struct work_struct *task) } } encode_work = kmalloc(sizeof(*encode_work), GFP_KERNEL); encode_work = kmalloc(sizeof(*encode_work), GFP_KERNEL); if (!encode_work) goto err_skip_encode; encode_work->buf = buf_info; encode_work->buf = buf_info; encode_work->context = context; encode_work->context = context; INIT_WORK(&encode_work->work, vsg_encode_helper_func); INIT_WORK(&encode_work->work, vsg_encode_helper_func); Loading Loading @@ -298,6 +301,11 @@ static int vsg_open(struct v4l2_subdev *sd, void *arg) return -EINVAL; return -EINVAL; context = kzalloc(sizeof(*context), GFP_KERNEL); context = kzalloc(sizeof(*context), GFP_KERNEL); if (!context) { WFD_MSG_ERR("ERROR, failed to allocate context %s\n", __func__); return -ENOMEM; } INIT_LIST_HEAD(&context->free_queue.node); INIT_LIST_HEAD(&context->free_queue.node); INIT_LIST_HEAD(&context->busy_queue.node); INIT_LIST_HEAD(&context->busy_queue.node); Loading Loading @@ -477,10 +485,12 @@ static long vsg_queue_buffer(struct v4l2_subdev *sd, void *arg) struct vsg_work *new_work = struct vsg_work *new_work = kzalloc(sizeof(*new_work), GFP_KERNEL); kzalloc(sizeof(*new_work), GFP_KERNEL); if (new_work) { INIT_WORK(&new_work->work, vsg_work_func); INIT_WORK(&new_work->work, vsg_work_func); new_work->context = context; new_work->context = context; queue_work(context->work_queue, &new_work->work); queue_work(context->work_queue, &new_work->work); } } } mutex_unlock(&context->mutex); mutex_unlock(&context->mutex); queue_err_bad_param: queue_err_bad_param: Loading drivers/media/platform/msm/wfd/wfd-ioctl.c +21 −0 Original line number Original line Diff line number Diff line Loading @@ -294,6 +294,11 @@ static int wfd_allocate_input_buffers(struct wfd_device *wfd_dev, mpair = kzalloc(sizeof(*mpair), GFP_KERNEL); mpair = kzalloc(sizeof(*mpair), GFP_KERNEL); enc_mregion = kzalloc(sizeof(*enc_mregion), GFP_KERNEL); enc_mregion = kzalloc(sizeof(*enc_mregion), GFP_KERNEL); mdp_mregion = kzalloc(sizeof(*enc_mregion), GFP_KERNEL); mdp_mregion = kzalloc(sizeof(*enc_mregion), GFP_KERNEL); if (!mpair || !enc_mregion || !mdp_mregion) { WFD_MSG_ERR("%s: failed to alloc memory\n", __func__); goto alloc_fail; } enc_mregion->size = ALIGN(inst->input_buf_size, SZ_4K); enc_mregion->size = ALIGN(inst->input_buf_size, SZ_4K); rc = wfd_allocate_ion_buffer(wfd_dev->ion_client, rc = wfd_allocate_ion_buffer(wfd_dev->ion_client, Loading Loading @@ -543,6 +548,12 @@ static int wfd_vidbuf_buf_init(struct vb2_buffer *vb) (struct wfd_device *)video_drvdata(priv_data); (struct wfd_device *)video_drvdata(priv_data); struct mem_info *minfo = vb2_plane_cookie(vb, 0); struct mem_info *minfo = vb2_plane_cookie(vb, 0); struct mem_region mregion; struct mem_region mregion; if (!minfo || !inst) { WFD_MSG_ERR("%s: invalid arguments\n", __func__); return -EINVAL; } mregion.fd = minfo->fd; mregion.fd = minfo->fd; mregion.offset = minfo->offset; mregion.offset = minfo->offset; mregion.cookie = (u32)vb; mregion.cookie = (u32)vb; Loading Loading @@ -755,6 +766,12 @@ static void wfd_vidbuf_buf_queue(struct vb2_buffer *vb) struct wfd_inst *inst = file_to_inst(priv_data); struct wfd_inst *inst = file_to_inst(priv_data); struct mem_region mregion; struct mem_region mregion; struct mem_info *minfo = vb2_plane_cookie(vb, 0); struct mem_info *minfo = vb2_plane_cookie(vb, 0); if (!minfo) { WFD_MSG_ERR("%s: invalid minfo\n", __func__); return; } mregion.fd = minfo->fd; mregion.fd = minfo->fd; mregion.offset = minfo->offset; mregion.offset = minfo->offset; mregion.cookie = (u32)vb; mregion.cookie = (u32)vb; Loading Loading @@ -933,6 +950,10 @@ static int wfd_register_out_buf(struct wfd_inst *inst, if (!minfo) { if (!minfo) { minfo_entry = kzalloc(sizeof(struct mem_info_entry), minfo_entry = kzalloc(sizeof(struct mem_info_entry), GFP_KERNEL); GFP_KERNEL); if (!minfo_entry) { WFD_MSG_ERR("%s: failed to allocate mem\n", __func__); return -EINVAL; } if (copy_from_user(&minfo_entry->minfo, (void *)b->reserved, if (copy_from_user(&minfo_entry->minfo, (void *)b->reserved, sizeof(struct mem_info))) { sizeof(struct mem_info))) { WFD_MSG_ERR(" copy_from_user failed. Populate" WFD_MSG_ERR(" copy_from_user failed. Populate" Loading Loading
drivers/media/platform/msm/wfd/mdp-5-subdev.c +3 −2 Original line number Original line Diff line number Diff line Loading @@ -177,11 +177,12 @@ static int mdp_dq_buffer(struct v4l2_subdev *sd, void *arg) static int mdp_set_prop(struct v4l2_subdev *sd, void *arg) static int mdp_set_prop(struct v4l2_subdev *sd, void *arg) { { struct mdp_prop *prop = (struct mdp_prop *)arg; struct mdp_prop *prop = (struct mdp_prop *)arg; struct mdp_instance *inst = prop->inst; struct mdp_instance *inst; if (!prop || !inst) { if (!prop || !prop->inst) { WFD_MSG_ERR("Invalid arguments\n"); WFD_MSG_ERR("Invalid arguments\n"); return -EINVAL; return -EINVAL; } } inst = prop->inst; inst->height = prop->height; inst->height = prop->height; inst->width = prop->width; inst->width = prop->width; return 0; return 0; Loading
drivers/media/platform/msm/wfd/vsg-subdev.c +13 −3 Original line number Original line Diff line number Diff line Loading @@ -135,6 +135,9 @@ static void vsg_work_func(struct work_struct *task) } } encode_work = kmalloc(sizeof(*encode_work), GFP_KERNEL); encode_work = kmalloc(sizeof(*encode_work), GFP_KERNEL); if (!encode_work) goto err_skip_encode; encode_work->buf = buf_info; encode_work->buf = buf_info; encode_work->context = context; encode_work->context = context; INIT_WORK(&encode_work->work, vsg_encode_helper_func); INIT_WORK(&encode_work->work, vsg_encode_helper_func); Loading Loading @@ -298,6 +301,11 @@ static int vsg_open(struct v4l2_subdev *sd, void *arg) return -EINVAL; return -EINVAL; context = kzalloc(sizeof(*context), GFP_KERNEL); context = kzalloc(sizeof(*context), GFP_KERNEL); if (!context) { WFD_MSG_ERR("ERROR, failed to allocate context %s\n", __func__); return -ENOMEM; } INIT_LIST_HEAD(&context->free_queue.node); INIT_LIST_HEAD(&context->free_queue.node); INIT_LIST_HEAD(&context->busy_queue.node); INIT_LIST_HEAD(&context->busy_queue.node); Loading Loading @@ -477,10 +485,12 @@ static long vsg_queue_buffer(struct v4l2_subdev *sd, void *arg) struct vsg_work *new_work = struct vsg_work *new_work = kzalloc(sizeof(*new_work), GFP_KERNEL); kzalloc(sizeof(*new_work), GFP_KERNEL); if (new_work) { INIT_WORK(&new_work->work, vsg_work_func); INIT_WORK(&new_work->work, vsg_work_func); new_work->context = context; new_work->context = context; queue_work(context->work_queue, &new_work->work); queue_work(context->work_queue, &new_work->work); } } } mutex_unlock(&context->mutex); mutex_unlock(&context->mutex); queue_err_bad_param: queue_err_bad_param: Loading
drivers/media/platform/msm/wfd/wfd-ioctl.c +21 −0 Original line number Original line Diff line number Diff line Loading @@ -294,6 +294,11 @@ static int wfd_allocate_input_buffers(struct wfd_device *wfd_dev, mpair = kzalloc(sizeof(*mpair), GFP_KERNEL); mpair = kzalloc(sizeof(*mpair), GFP_KERNEL); enc_mregion = kzalloc(sizeof(*enc_mregion), GFP_KERNEL); enc_mregion = kzalloc(sizeof(*enc_mregion), GFP_KERNEL); mdp_mregion = kzalloc(sizeof(*enc_mregion), GFP_KERNEL); mdp_mregion = kzalloc(sizeof(*enc_mregion), GFP_KERNEL); if (!mpair || !enc_mregion || !mdp_mregion) { WFD_MSG_ERR("%s: failed to alloc memory\n", __func__); goto alloc_fail; } enc_mregion->size = ALIGN(inst->input_buf_size, SZ_4K); enc_mregion->size = ALIGN(inst->input_buf_size, SZ_4K); rc = wfd_allocate_ion_buffer(wfd_dev->ion_client, rc = wfd_allocate_ion_buffer(wfd_dev->ion_client, Loading Loading @@ -543,6 +548,12 @@ static int wfd_vidbuf_buf_init(struct vb2_buffer *vb) (struct wfd_device *)video_drvdata(priv_data); (struct wfd_device *)video_drvdata(priv_data); struct mem_info *minfo = vb2_plane_cookie(vb, 0); struct mem_info *minfo = vb2_plane_cookie(vb, 0); struct mem_region mregion; struct mem_region mregion; if (!minfo || !inst) { WFD_MSG_ERR("%s: invalid arguments\n", __func__); return -EINVAL; } mregion.fd = minfo->fd; mregion.fd = minfo->fd; mregion.offset = minfo->offset; mregion.offset = minfo->offset; mregion.cookie = (u32)vb; mregion.cookie = (u32)vb; Loading Loading @@ -755,6 +766,12 @@ static void wfd_vidbuf_buf_queue(struct vb2_buffer *vb) struct wfd_inst *inst = file_to_inst(priv_data); struct wfd_inst *inst = file_to_inst(priv_data); struct mem_region mregion; struct mem_region mregion; struct mem_info *minfo = vb2_plane_cookie(vb, 0); struct mem_info *minfo = vb2_plane_cookie(vb, 0); if (!minfo) { WFD_MSG_ERR("%s: invalid minfo\n", __func__); return; } mregion.fd = minfo->fd; mregion.fd = minfo->fd; mregion.offset = minfo->offset; mregion.offset = minfo->offset; mregion.cookie = (u32)vb; mregion.cookie = (u32)vb; Loading Loading @@ -933,6 +950,10 @@ static int wfd_register_out_buf(struct wfd_inst *inst, if (!minfo) { if (!minfo) { minfo_entry = kzalloc(sizeof(struct mem_info_entry), minfo_entry = kzalloc(sizeof(struct mem_info_entry), GFP_KERNEL); GFP_KERNEL); if (!minfo_entry) { WFD_MSG_ERR("%s: failed to allocate mem\n", __func__); return -EINVAL; } if (copy_from_user(&minfo_entry->minfo, (void *)b->reserved, if (copy_from_user(&minfo_entry->minfo, (void *)b->reserved, sizeof(struct mem_info))) { sizeof(struct mem_info))) { WFD_MSG_ERR(" copy_from_user failed. Populate" WFD_MSG_ERR(" copy_from_user failed. Populate" Loading