|
@@ -231,17 +231,9 @@ static int bru_enum_frame_size(struct v4l2_subdev *subdev,
|
|
|
|
|
|
static struct v4l2_rect *bru_get_compose(struct vsp1_bru *bru,
|
|
static struct v4l2_rect *bru_get_compose(struct vsp1_bru *bru,
|
|
struct v4l2_subdev_pad_config *cfg,
|
|
struct v4l2_subdev_pad_config *cfg,
|
|
- unsigned int pad, u32 which)
|
|
|
|
|
|
+ unsigned int pad)
|
|
{
|
|
{
|
|
- switch (which) {
|
|
|
|
- case V4L2_SUBDEV_FORMAT_TRY:
|
|
|
|
- return v4l2_subdev_get_try_compose(&bru->entity.subdev, cfg,
|
|
|
|
- pad);
|
|
|
|
- case V4L2_SUBDEV_FORMAT_ACTIVE:
|
|
|
|
- return &bru->inputs[pad].compose;
|
|
|
|
- default:
|
|
|
|
- return NULL;
|
|
|
|
- }
|
|
|
|
|
|
+ return v4l2_subdev_get_try_compose(&bru->entity.subdev, cfg, pad);
|
|
}
|
|
}
|
|
|
|
|
|
static int bru_get_format(struct v4l2_subdev *subdev,
|
|
static int bru_get_format(struct v4l2_subdev *subdev,
|
|
@@ -310,7 +302,7 @@ static int bru_set_format(struct v4l2_subdev *subdev,
|
|
if (fmt->pad != bru->entity.source_pad) {
|
|
if (fmt->pad != bru->entity.source_pad) {
|
|
struct v4l2_rect *compose;
|
|
struct v4l2_rect *compose;
|
|
|
|
|
|
- compose = bru_get_compose(bru, cfg, fmt->pad, fmt->which);
|
|
|
|
|
|
+ compose = bru_get_compose(bru, config, fmt->pad);
|
|
compose->left = 0;
|
|
compose->left = 0;
|
|
compose->top = 0;
|
|
compose->top = 0;
|
|
compose->width = format->width;
|
|
compose->width = format->width;
|
|
@@ -336,6 +328,7 @@ static int bru_get_selection(struct v4l2_subdev *subdev,
|
|
struct v4l2_subdev_selection *sel)
|
|
struct v4l2_subdev_selection *sel)
|
|
{
|
|
{
|
|
struct vsp1_bru *bru = to_bru(subdev);
|
|
struct vsp1_bru *bru = to_bru(subdev);
|
|
|
|
+ struct v4l2_subdev_pad_config *config;
|
|
|
|
|
|
if (sel->pad == bru->entity.source_pad)
|
|
if (sel->pad == bru->entity.source_pad)
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
@@ -349,7 +342,12 @@ static int bru_get_selection(struct v4l2_subdev *subdev,
|
|
return 0;
|
|
return 0;
|
|
|
|
|
|
case V4L2_SEL_TGT_COMPOSE:
|
|
case V4L2_SEL_TGT_COMPOSE:
|
|
- sel->r = *bru_get_compose(bru, cfg, sel->pad, sel->which);
|
|
|
|
|
|
+ config = vsp1_entity_get_pad_config(&bru->entity, cfg,
|
|
|
|
+ sel->which);
|
|
|
|
+ if (!config)
|
|
|
|
+ return -EINVAL;
|
|
|
|
+
|
|
|
|
+ sel->r = *bru_get_compose(bru, config, sel->pad);
|
|
return 0;
|
|
return 0;
|
|
|
|
|
|
default:
|
|
default:
|
|
@@ -391,7 +389,7 @@ static int bru_set_selection(struct v4l2_subdev *subdev,
|
|
sel->r.width = format->width;
|
|
sel->r.width = format->width;
|
|
sel->r.height = format->height;
|
|
sel->r.height = format->height;
|
|
|
|
|
|
- compose = bru_get_compose(bru, cfg, sel->pad, sel->which);
|
|
|
|
|
|
+ compose = bru_get_compose(bru, config, sel->pad);
|
|
*compose = sel->r;
|
|
*compose = sel->r;
|
|
|
|
|
|
return 0;
|
|
return 0;
|