media: platform: synopsys: hdmirx: Fix compilation on 32bit arches
Dmitry Osipenko
maintainerPATCH 1/1 media: platform: synopsys: hdmirx: Fix compilation on 32bit arches
The pixelclock is specified as 64bit integer and for this driver it won't be above 600MHz. Fix the 64bit division of the pixclock for 32bit kernel builds.
--- drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c +1 -1
@@ -291,7 +291,7 @@ static void hdmirx_get_timings(struct snps_hdmirx_dev *hdmirx_dev, hfp = htotal - hact - hs - hbp; vfp = vtotal - vact - vs - vbp; - fps = (bt->pixelclock + (htotal * vtotal) /2 ) / (htotal * vtotal); + fps = ((u32 )bt->pixelclock + (htotal * vtotal) /2 ) / (htotal * vtotal); bt->width = hact; bt->height = vact; bt->hfrontporch = hfp;
Signature · 1 line
2.48.1
Hi Dmitry,
Quoted 16 lines · Dmitry Osipenko
The pixelclock is specified as 64bit integer and for this driver it won't be above 600MHz. Fix the 64bit division of the pixclock for 32bit kernel builds.
Reported-by kernel test robot <[email protected]>Signed-off-by Dmitry Osipenko <[email protected]>--- drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c +0
-0
drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c static void hdmirx_get_timings(struct snps_hdmirx_dev *hdmirx_dev, · line 294
Quoted 5 lines
drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c +1
-1@@ -291,7 +291,7 @@ static void hdmirx_get_timings(struct snps_hdmirx_dev *hdmirx_dev, hfp = htotal - hact - hs - hbp; vfp = vtotal - vact - vs - vbp; - fps = (bt->pixelclock + (htotal * vtotal) /2 ) / (htotal * vtotal); + fps = ((u32 )bt->pixelclock + (htotal * vtotal) /2 ) / (htotal * vtotal);
I just merged:
https://patchwork.linuxtv.org/project/linux-media/patch/[email protected]/
So you can either leave that patch in, or provide a patch on top.
Regards,
Hans
Quoted 3 lines
drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c +0
-0bt->width = hact; bt->height = vact; bt->hfrontporch = hfp;
Dmitry Osipenko
maintainerQuoted 22 lines · Hans Verkuil
Hi Dmitry,
Quoted 19 lines · Dmitry Osipenko
The pixelclock is specified as 64bit integer and for this driver it won't be above 600MHz. Fix the 64bit division of the pixclock for 32bit kernel builds.
Reported-by kernel test robot <[email protected]>Signed-off-by Dmitry Osipenko <[email protected]>--- drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c +0
-0@@ -291,7 +291,7 @@ static void hdmirx_get_timings(struct snps_hdmirx_dev *hdmirx_dev, hfp = htotal - hact - hs - hbp; vfp = vtotal - vact - vs - vbp;
Quoted 8 lines
drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c static void hdmirx_get_timings(struct snps_hdmirx_dev *hdmirx_dev, · line 294
Quoted 2 lines
drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c +1
-1- fps = (bt->pixelclock + (htotal * vtotal) /2 ) / (htotal * vtotal); + fps = ((u32 )bt->pixelclock + (htotal * vtotal) /2 ) / (htotal * vtotal);I just merged:
https://patchwork.linuxtv.org/project/linux-media/patch/[email protected]/
So you can either leave that patch in, or provide a patch on top.
Missed that patch you merged. No need to do anything then, thanks!
Signature · 7 lines
Best regards, Dmitry _______________________________________________ Linux-rockchip mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-rockchip