media: staging: rkisp1: use consistent bus_info string for media_dev
Subsystems (3)
PATCH 1/1 media: staging: rkisp1: use consistent bus_info string for media_dev
Media device is using a slightly different bus_info string "platform: rkisp1" (with a space) instead of "platform:rkisp1" used by the rest of rkisp1 code.
This causes errors when using v4l2-util tools that uses the bus_info string to identify the device.
--- drivers/staging/media/rkisp1/rkisp1-dev.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/media/rkisp1/rkisp1-dev.c +1 -2
@@ -502,8 +502,7 @@ static int rkisp1_probe(struct platform_device *pdev)strscpy (rkisp1->media_dev.model,RKISP1_DRIVER_NAME ,sizeof (rkisp1->media_dev.model)); rkisp1->media_dev.dev = &pdev->dev; -strscpy (rkisp1->media_dev.bus_info, -"platform: " RKISP1_DRIVER_NAME , +strscpy (rkisp1->media_dev.bus_info,RKISP1_BUS_INFO ,sizeof (rkisp1->media_dev.bus_info));media_device_init (&rkisp1->media_dev);
Signature · 1 line
2.24.0
PATCH 1/1 media: staging: rkisp1: stats: use consistent bus_info string
Stats entity is using a slightly different bus_info string "platform: rkisp1" (with a space) instead of "platform:rkisp1" used by the rest of rkisp1 code.
This causes errors when using v4l2-util tools that uses the bus_info string to identify the device.
--- drivers/staging/media/rkisp1/rkisp1-stats.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/media/rkisp1/rkisp1-stats.c +1 -2
@@ -70,8 +70,7 @@ static int rkisp1_stats_querycap(struct file *file,strscpy (cap->driver,RKISP1_DRIVER_NAME ,sizeof (cap->driver));strscpy (cap->card, vdev->name,sizeof (cap->card)); -strscpy (cap->bus_info,"platform: " RKISP1_DRIVER_NAME , -sizeof (cap->bus_info)); +strscpy (cap->bus_info,RKISP1_BUS_INFO ,sizeof (cap->bus_info));return 0 ; }
Signature · 1 line
2.24.0
PATCH 1/1 media: staging: rkisp1: rsz: don't ignore set format in bayer mainpath
In reply to Helen KoikeFix issue when, in case of raw bayer format in mainpath, VIDIOC_SUBDEV_S_FMT ioctl didn't have any effect, is wasn't updating the format of the pad.
There is no crop for mainpath bayer raw data. Remove leftover check in set_format, since check is already done in crop rkisp1_rsz_set_sink_crop() function.
--- drivers/staging/media/rkisp1/rkisp1-resizer.c | 9 --------- 1 file changed, 9 deletions(-)
drivers/staging/media/rkisp1/rkisp1-resizer.c +0 -9
@@ -537,15 +537,6 @@ static void rkisp1_rsz_set_sink_fmt(struct rkisp1_resizer *rsz,if (which ==V4L2_SUBDEV_FORMAT_ACTIVE ) rsz->fmt_type = mbus_info->fmt_type; -if (rsz->id ==RKISP1_MAINPATH && - mbus_info->fmt_type ==RKISP1_FMT_BAYER ) { - sink_crop->left =0 ; - sink_crop->top =0 ; - sink_crop->width = sink_fmt->width; - sink_crop->height = sink_fmt->height; -return ; - } -/* Propagete to source pad */ src_fmt->code = sink_fmt->code;
Signature · 1 line
2.24.0
PATCH 1/1 media: staging: rkisp1: rsz: return to userspace the crop value in bayer mainpath
In reply to Helen KoikeIf bayer format is set in mainpath, then crop is not supported. The core was just reseting crop but wasn't returning the values back to user space.
Return values taken in consideration by the driver to userpace.
--- drivers/staging/media/rkisp1/rkisp1-resizer.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/staging/media/rkisp1/rkisp1-resizer.c +2 -0
@@ -503,6 +503,8 @@ static void rkisp1_rsz_set_sink_crop(struct rkisp1_resizer *rsz, sink_crop->top =0 ; sink_crop->width = sink_fmt->width; sink_crop->height = sink_fmt->height; + + *r = *sink_crop;return ; }
Signature · 1 line
2.24.0
PATCH 1/1 media: staging: rkisp1: isp: do not set invalid mbus code for pad
In reply to Helen KoikeWhen setting source pad, check if the given mbus code is indeed valid for source pad, if not, then set the default code.
Same for sink pad.
--- drivers/staging/media/rkisp1/rkisp1-isp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/media/rkisp1/rkisp1-isp.c +2 -2
@@ -683,7 +683,7 @@ static void rkisp1_isp_set_src_fmt(struct rkisp1_isp *isp, src_fmt->code = format->code; mbus_info =rkisp1_isp_mbus_info_get (src_fmt->code); -if (!mbus_info) { +if (!mbus_info || !(mbus_info->direction &RKISP1_DIR_SRC )) { src_fmt->code =RKISP1_DEF_SRC_PAD_FMT ; mbus_info =rkisp1_isp_mbus_info_get (src_fmt->code); }
@@ -767,7 +767,7 @@ static void rkisp1_isp_set_sink_fmt(struct rkisp1_isp *isp, which); sink_fmt->code = format->code; mbus_info =rkisp1_isp_mbus_info_get (sink_fmt->code); -if (!mbus_info) { +if (!mbus_info || !(mbus_info->direction &RKISP1_DIR_SINK )) { sink_fmt->code =RKISP1_DEF_SINK_PAD_FMT ; mbus_info =rkisp1_isp_mbus_info_get (sink_fmt->code); }
Signature · 1 line
2.24.0