Commit b911605d authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Mauro Carvalho Chehab

[media] v4l: vsp1: Use __vsp1_video_try_format to initialize format at init time

Reuse the runtime logic to initialize the default format instead of
open-coding it. This ensures coherency between intialization and
runtime.
Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent c6c8efb6
...@@ -958,17 +958,10 @@ struct vsp1_video *vsp1_video_create(struct vsp1_device *vsp1, ...@@ -958,17 +958,10 @@ struct vsp1_video *vsp1_video_create(struct vsp1_device *vsp1,
return ERR_PTR(ret); return ERR_PTR(ret);
/* ... and the format ... */ /* ... and the format ... */
rwpf->fmtinfo = vsp1_get_format_info(VSP1_VIDEO_DEF_FORMAT); rwpf->format.pixelformat = VSP1_VIDEO_DEF_FORMAT;
rwpf->format.pixelformat = rwpf->fmtinfo->fourcc;
rwpf->format.colorspace = V4L2_COLORSPACE_SRGB;
rwpf->format.field = V4L2_FIELD_NONE;
rwpf->format.width = VSP1_VIDEO_DEF_WIDTH; rwpf->format.width = VSP1_VIDEO_DEF_WIDTH;
rwpf->format.height = VSP1_VIDEO_DEF_HEIGHT; rwpf->format.height = VSP1_VIDEO_DEF_HEIGHT;
rwpf->format.num_planes = 1; __vsp1_video_try_format(video, &rwpf->format, &rwpf->fmtinfo);
rwpf->format.plane_fmt[0].bytesperline =
rwpf->format.width * rwpf->fmtinfo->bpp[0] / 8;
rwpf->format.plane_fmt[0].sizeimage =
rwpf->format.plane_fmt[0].bytesperline * rwpf->format.height;
/* ... and the video node... */ /* ... and the video node... */
video->video.v4l2_dev = &video->vsp1->v4l2_dev; video->video.v4l2_dev = &video->vsp1->v4l2_dev;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment