Skip to content

Commit

Permalink
drm/sun4i: dsi: Rework a bit the hblk calculation
Browse files Browse the repository at this point in the history
It turns out that the hblk calculation actually follows a similar pattern
than the other packets. Rework a bit the calculation and add a comment.

Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Reviewed-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Link: https://patchwork.freedesktop.org/patch/msgid/d79a21b09847579ce907212a59737af21a729dd0.1549896081.git-series.maxime.ripard@bootlin.com
  • Loading branch information
Maxime Ripard committed Feb 19, 2019
1 parent 2cfdc24 commit 62e7511
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -489,9 +489,13 @@ static void sun6i_dsi_setup_timings(struct sun6i_dsi *dsi,
(mode->hsync_start - mode->hdisplay) * Bpp - HFP_PACKET_OVERHEAD);

/*
* hblk seems to be the line + porches length.
* The blanking is set using a sync event (4 bytes) and a
* blanking packet (4 bytes + payload + 2 bytes). Its minimal
* size is therefore 10 bytes.
*/
hblk = mode->htotal * Bpp - hsa;
#define HBLK_PACKET_OVERHEAD 10
hblk = max((unsigned int)HBLK_PACKET_OVERHEAD,
(mode->htotal - (mode->hsync_end - mode->hsync_start)) * Bpp - HBLK_PACKET_OVERHEAD);

/*
* And I'm not entirely sure what vblk is about. The driver in
Expand Down

0 comments on commit 62e7511

Please sign in to comment.