Skip to content

Commit a055d97

Browse files
Sylwester NawrockiMauro Carvalho Chehab
authored andcommitted
[media] exynos4-is: Set valid initial format at FIMC-LITE
Ensure the image resolution and crop rectangle on the FIMC-LITE.n subdevs and fimc-lite.n.capture video nodes is properly configured upon the driver's initialization. Signed-off-by: Sylwester Nawrocki <[email protected]> Signed-off-by: Kyungmin Park <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent b1d2dc5 commit a055d97

File tree

2 files changed

+22
-3
lines changed

2 files changed

+22
-3
lines changed

drivers/media/platform/exynos4-is/fimc-lite.c

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1281,9 +1281,6 @@ static int fimc_lite_subdev_registered(struct v4l2_subdev *sd)
12811281
int ret;
12821282

12831283
memset(vfd, 0, sizeof(*vfd));
1284-
1285-
fimc->inp_frame.fmt = &fimc_lite_formats[0];
1286-
fimc->out_frame.fmt = &fimc_lite_formats[0];
12871284
atomic_set(&fimc->out_path, FIMC_IO_DMA);
12881285

12891286
snprintf(vfd->name, sizeof(vfd->name), "fimc-lite.%d.capture",
@@ -1399,6 +1396,23 @@ static const struct v4l2_ctrl_config fimc_lite_ctrl = {
13991396
.step = 1,
14001397
};
14011398

1399+
static void fimc_lite_set_default_config(struct fimc_lite *fimc)
1400+
{
1401+
struct flite_frame *sink = &fimc->inp_frame;
1402+
struct flite_frame *source = &fimc->out_frame;
1403+
1404+
sink->fmt = &fimc_lite_formats[0];
1405+
sink->f_width = FLITE_DEFAULT_WIDTH;
1406+
sink->f_height = FLITE_DEFAULT_HEIGHT;
1407+
1408+
sink->rect.width = FLITE_DEFAULT_WIDTH;
1409+
sink->rect.height = FLITE_DEFAULT_HEIGHT;
1410+
sink->rect.left = 0;
1411+
sink->rect.top = 0;
1412+
1413+
*source = *sink;
1414+
}
1415+
14021416
static int fimc_lite_create_capture_subdev(struct fimc_lite *fimc)
14031417
{
14041418
struct v4l2_ctrl_handler *handler = &fimc->ctrl_handler;
@@ -1544,8 +1558,11 @@ static int fimc_lite_probe(struct platform_device *pdev)
15441558
ret = PTR_ERR(fimc->alloc_ctx);
15451559
goto err_pm;
15461560
}
1561+
15471562
pm_runtime_put(dev);
15481563

1564+
fimc_lite_set_default_config(fimc);
1565+
15491566
dev_dbg(dev, "FIMC-LITE.%d registered successfully\n",
15501567
fimc->index);
15511568
return 0;

drivers/media/platform/exynos4-is/fimc-lite.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
#define FLITE_CLK_NAME "flite"
3030
#define FIMC_LITE_MAX_DEVS 3
3131
#define FLITE_REQ_BUFS_MIN 2
32+
#define FLITE_DEFAULT_WIDTH 640
33+
#define FLITE_DEFAULT_HEIGHT 480
3234

3335
/* Bit index definitions for struct fimc_lite::state */
3436
enum {

0 commit comments

Comments
 (0)