[RFC 05/12] [media] tc358743: fix lane number calculation to include blanking

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Instead of only using the visible width and height, also add the
horizontal and vertical blanking to calculate the bit rate.

Signed-off-by: Philipp Zabel <p.zabel@xxxxxxxxxxxxxx>
---
 drivers/media/i2c/tc358743.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/media/i2c/tc358743.c b/drivers/media/i2c/tc358743.c
index dd2ea16..74e83c5 100644
--- a/drivers/media/i2c/tc358743.c
+++ b/drivers/media/i2c/tc358743.c
@@ -713,9 +713,11 @@ static unsigned tc358743_num_csi_lanes_needed(struct v4l2_subdev *sd)
 {
 	struct tc358743_state *state = to_state(sd);
 	struct v4l2_bt_timings *bt = &state->timings.bt;
+	u32 htotal = bt->width + bt->hfrontporch + bt->hsync + bt->hbackporch;
+	u32 vtotal = bt->height + bt->vfrontporch + bt->vsync + bt->vbackporch;
 	u32 bits_pr_pixel =
 		(state->mbus_fmt_code == MEDIA_BUS_FMT_UYVY8_1X16) ?  16 : 24;
-	u32 bps = bt->width * bt->height * fps(bt) * bits_pr_pixel;
+	u32 bps = htotal * vtotal * fps(bt) * bits_pr_pixel;
 
 	return DIV_ROUND_UP(bps, state->pdata.bps_pr_lane);
 }
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux