Message ID | 20230818-samsung-dsim-v1-4-b39716db6b7a@pengutronix.de (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | drm/bridge: samsung-dsim: fix various modes with ADV7535 bridge | expand |
Hi Michael, On Mon, Aug 28, 2023 at 12:59 PM Michael Tretter <m.tretter@pengutronix.de> wrote: > > The porches must be rounded up to make the samsung-dsim work. The commit log could be improved here. The way it is written gives the impression that samsung-dsim does not work currently.
On Mon, Aug 28, 2023 at 1:26 PM Fabio Estevam <festevam@gmail.com> wrote: > > Hi Michael, > > On Mon, Aug 28, 2023 at 12:59 PM Michael Tretter > <m.tretter@pengutronix.de> wrote: > > > > The porches must be rounded up to make the samsung-dsim work. ...at some resolutions and refresh rates. > > The commit log could be improved here. > > The way it is written gives the impression that samsung-dsim does not > work currently. This is a big improvement in the number of resolutions and refresh rates. Reviewed-by: Adam Ford <aford173@gmail.com> #imx8mm-beacon Tested-by: Adam Ford <aford173@gmail.com> #imx8mm-beacon
On Mon, 28 Aug 2023 17:39:03 -0500, Adam Ford wrote: > On Mon, Aug 28, 2023 at 1:26 PM Fabio Estevam <festevam@gmail.com> wrote: > > > > Hi Michael, > > > > On Mon, Aug 28, 2023 at 12:59 PM Michael Tretter > > <m.tretter@pengutronix.de> wrote: > > > > > > The porches must be rounded up to make the samsung-dsim work. > > ...at some resolutions and refresh rates. I will rephrase the commit message in a v2 and list the resolutions and refresh rates that were fixed in my test. Michael > > > > > The commit log could be improved here. > > > > The way it is written gives the impression that samsung-dsim does not > > work currently. > > This is a big improvement in the number of resolutions and refresh rates. > > Reviewed-by: Adam Ford <aford173@gmail.com> #imx8mm-beacon > Tested-by: Adam Ford <aford173@gmail.com> #imx8mm-beacon >
diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/drm/bridge/samsung-dsim.c index 4de6e4f116db..459be953be55 100644 --- a/drivers/gpu/drm/bridge/samsung-dsim.c +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -974,9 +974,9 @@ static void samsung_dsim_set_display_mode(struct samsung_dsim *dsi) if (dsi->mode_flags & MIPI_DSI_MODE_VIDEO) { int byte_clk_khz = dsi->hs_clock / 1000 / 8; - int hfp = (m->hsync_start - m->hdisplay) * byte_clk_khz / m->clock; - int hbp = (m->htotal - m->hsync_end) * byte_clk_khz / m->clock; - int hsa = (m->hsync_end - m->hsync_start) * byte_clk_khz / m->clock; + int hfp = DIV_ROUND_UP((m->hsync_start - m->hdisplay) * byte_clk_khz, m->clock); + int hbp = DIV_ROUND_UP((m->htotal - m->hsync_end) * byte_clk_khz, m->clock); + int hsa = DIV_ROUND_UP((m->hsync_end - m->hsync_start) * byte_clk_khz, m->clock); /* remove packet overhead when possible */ hfp = max(hfp - 6, 0);
The porches must be rounded up to make the samsung-dsim work. Signed-off-by: Michael Tretter <m.tretter@pengutronix.de> --- drivers/gpu/drm/bridge/samsung-dsim.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)