diff options
| -rw-r--r-- | drivers/media/platform/tegra/camera/vi/vi4_fops.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/media/platform/tegra/camera/vi/vi4_fops.c b/drivers/media/platform/tegra/camera/vi/vi4_fops.c index d6c6860ae..3d56dd685 100644 --- a/drivers/media/platform/tegra/camera/vi/vi4_fops.c +++ b/drivers/media/platform/tegra/camera/vi/vi4_fops.c | |||
| @@ -672,11 +672,12 @@ static int tegra_channel_update_clknbw(struct tegra_channel *chan, u8 on) | |||
| 672 | unsigned long request_pixelrate; | 672 | unsigned long request_pixelrate; |
| 673 | struct v4l2_subdev_frame_interval fie; | 673 | struct v4l2_subdev_frame_interval fie; |
| 674 | unsigned long csi_freq = 0; | 674 | unsigned long csi_freq = 0; |
| 675 | unsigned int num_ppc = NUM_PPC; | 675 | unsigned int ppc_multiplier = 1; |
| 676 | 676 | ||
| 677 | /* if bytes per pixel is greater than 2, then num_ppc is 4 */ | 677 | /* if bytes per pixel is greater than 2, then num_ppc is 4 */ |
| 678 | /* since num_ppc in nvhost framework is always 8, use multiplier */ | ||
| 678 | if (chan->fmtinfo->bpp.numerator > 2) | 679 | if (chan->fmtinfo->bpp.numerator > 2) |
| 679 | num_ppc = (NUM_PPC >> 1); | 680 | ppc_multiplier = 2; |
| 680 | 681 | ||
| 681 | fie.interval.denominator = DEFAULT_FRAMERATE; | 682 | fie.interval.denominator = DEFAULT_FRAMERATE; |
| 682 | fie.interval.numerator = 1; | 683 | fie.interval.numerator = 1; |
| @@ -713,6 +714,7 @@ static int tegra_channel_update_clknbw(struct tegra_channel *chan, u8 on) | |||
| 713 | return ret; | 714 | return ret; |
| 714 | request_pixelrate = csi_freq * PG_BITRATE / | 715 | request_pixelrate = csi_freq * PG_BITRATE / |
| 715 | chan->fmtinfo->width; | 716 | chan->fmtinfo->width; |
| 717 | request_pixelrate *= ppc_multiplier; | ||
| 716 | } else { | 718 | } else { |
| 717 | /** | 719 | /** |
| 718 | * TODO: use real sensor pixelrate | 720 | * TODO: use real sensor pixelrate |
| @@ -721,10 +723,7 @@ static int tegra_channel_update_clknbw(struct tegra_channel *chan, u8 on) | |||
| 721 | request_pixelrate = (long long)(chan->format.width | 723 | request_pixelrate = (long long)(chan->format.width |
| 722 | * chan->format.height | 724 | * chan->format.height |
| 723 | * fie.interval.denominator / 100) | 725 | * fie.interval.denominator / 100) |
| 724 | * VI_CSI_CLK_SCALE; | 726 | * VI_CSI_CLK_SCALE * ppc_multiplier; |
| 725 | csi_freq = ((long long)chan->format.width | ||
| 726 | * chan->format.height | ||
| 727 | * fie.interval.denominator) / num_ppc; | ||
| 728 | } | 727 | } |
| 729 | 728 | ||
| 730 | /* VI clk should be slightly faster than CSI clk*/ | 729 | /* VI clk should be slightly faster than CSI clk*/ |
