rgb[] is already calculated in the right order, there is no need to swap the blue and red channels in it for BGR images. Hence give right rgb channels to the src_frame. Signed-off-by: Kaaira Gupta <kgupta@xxxxxxxxxxxxx> --- drivers/media/test-drivers/vimc/vimc-debayer.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/drivers/media/test-drivers/vimc/vimc-debayer.c b/drivers/media/test-drivers/vimc/vimc-debayer.c index c3f6fef34f68..d41d9f6180df 100644 --- a/drivers/media/test-drivers/vimc/vimc-debayer.c +++ b/drivers/media/test-drivers/vimc/vimc-debayer.c @@ -318,21 +318,11 @@ static void vimc_deb_process_rgb_frame(struct vimc_deb_device *vdeb, unsigned int col, unsigned int rgb[3]) { - const struct vimc_pix_map *vpix; unsigned int i, index; - vpix = vimc_pix_map_by_code(vdeb->src_code); index = VIMC_FRAME_INDEX(lin, col, vdeb->sink_fmt.width, 3); - for (i = 0; i < 3; i++) { - switch (vpix->pixelformat) { - case V4L2_PIX_FMT_RGB24: - vdeb->src_frame[index + i] = rgb[i]; - break; - case V4L2_PIX_FMT_BGR24: - vdeb->src_frame[index + i] = rgb[2 - i]; - break; - } - } + for (i = 0; i < 3; i++) + vdeb->src_frame[index + i] = rgb[i]; } static int vimc_deb_s_stream(struct v4l2_subdev *sd, int enable) -- 2.17.1