* [PATCH] video: ipuv3: fix framebuffer base address init with multiple IPUs
@ 2020-08-03 13:45 Anatolij Gustschin
2020-08-03 21:13 ` Soeren Moch
2020-08-04 7:45 ` Anatolij Gustschin
0 siblings, 2 replies; 3+ messages in thread
From: Anatolij Gustschin @ 2020-08-03 13:45 UTC (permalink / raw)
To: u-boot
Since commit 7812bbdc3732 ("video: Correctly handle multiple
framebuffers") the vidconsole output is missing on the primary
display on boards with two IPU units (all i.MX6Q/D based boards).
The base address of the allocated framebuffer is not correctly
programmed in the display controller. Fix it.
Reported-by: Soeren Moch <smoch@web.de>
Signed-off-by: Anatolij Gustschin <agust@denx.de>
---
drivers/video/imx/mxc_ipuv3_fb.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/drivers/video/imx/mxc_ipuv3_fb.c b/drivers/video/imx/mxc_ipuv3_fb.c
index 587d62f2d8..4c20ec5e66 100644
--- a/drivers/video/imx/mxc_ipuv3_fb.c
+++ b/drivers/video/imx/mxc_ipuv3_fb.c
@@ -66,6 +66,7 @@ static void fb_videomode_to_var(struct fb_var_screeninfo *var,
* Structure containing the MXC specific framebuffer information.
*/
struct mxcfb_info {
+ struct udevice *udev;
int blank;
ipu_channel_t ipu_ch;
int ipu_di;
@@ -381,13 +382,16 @@ static int mxcfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
static int mxcfb_map_video_memory(struct fb_info *fbi)
{
+ struct mxcfb_info *mxc_fbi = (struct mxcfb_info *)fbi->par;
+ struct video_uc_platdata *plat = dev_get_uclass_platdata(mxc_fbi->udev);
+
if (fbi->fix.smem_len < fbi->var.yres_virtual * fbi->fix.line_length) {
fbi->fix.smem_len = fbi->var.yres_virtual *
fbi->fix.line_length;
}
fbi->fix.smem_len = roundup(fbi->fix.smem_len, ARCH_DMA_MINALIGN);
- fbi->screen_base = (char *)gd->video_bottom;
+ fbi->screen_base = (char *)plat->base;
fbi->fix.smem_start = (unsigned long)fbi->screen_base;
if (fbi->screen_base == 0) {
@@ -477,8 +481,8 @@ extern struct clk *g_ipu_clk;
*
* @return Appropriate error code to the kernel common code
*/
-static int mxcfb_probe(u32 interface_pix_fmt, uint8_t disp,
- struct fb_videomode const *mode)
+static int mxcfb_probe(struct udevice *dev, u32 interface_pix_fmt,
+ uint8_t disp, struct fb_videomode const *mode)
{
struct fb_info *fbi;
struct mxcfb_info *mxcfbi;
@@ -501,6 +505,7 @@ static int mxcfb_probe(u32 interface_pix_fmt, uint8_t disp,
}
mxcfbi->ipu_di = disp;
+ mxcfbi->udev = dev;
if (!ipu_clk_enabled())
clk_enable(g_ipu_clk);
@@ -600,7 +605,7 @@ static int ipuv3_video_probe(struct udevice *dev)
if (ret < 0)
return ret;
- ret = mxcfb_probe(gpixfmt, gdisp, gmode);
+ ret = mxcfb_probe(dev, gpixfmt, gdisp, gmode);
if (ret < 0)
return ret;
--
2.17.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH] video: ipuv3: fix framebuffer base address init with multiple IPUs
2020-08-03 13:45 [PATCH] video: ipuv3: fix framebuffer base address init with multiple IPUs Anatolij Gustschin
@ 2020-08-03 21:13 ` Soeren Moch
2020-08-04 7:45 ` Anatolij Gustschin
1 sibling, 0 replies; 3+ messages in thread
From: Soeren Moch @ 2020-08-03 21:13 UTC (permalink / raw)
To: u-boot
On 03.08.20 15:45, Anatolij Gustschin wrote:
> Since commit 7812bbdc3732 ("video: Correctly handle multiple
> framebuffers") the vidconsole output is missing on the primary
> display on boards with two IPU units (all i.MX6Q/D based boards).
> The base address of the allocated framebuffer is not correctly
> programmed in the display controller. Fix it.
>
> Reported-by: Soeren Moch <smoch@web.de>
> Signed-off-by: Anatolij Gustschin <agust@denx.de>
Successfully tested on a tbs2910 board (i.MX6Q based).
Tested-by: Soeren Moch <smoch@web.de>
Thanks,
Soeren
> ---
> drivers/video/imx/mxc_ipuv3_fb.c | 13 +++++++++----
> 1 file changed, 9 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/video/imx/mxc_ipuv3_fb.c b/drivers/video/imx/mxc_ipuv3_fb.c
> index 587d62f2d8..4c20ec5e66 100644
> --- a/drivers/video/imx/mxc_ipuv3_fb.c
> +++ b/drivers/video/imx/mxc_ipuv3_fb.c
> @@ -66,6 +66,7 @@ static void fb_videomode_to_var(struct fb_var_screeninfo *var,
> * Structure containing the MXC specific framebuffer information.
> */
> struct mxcfb_info {
> + struct udevice *udev;
> int blank;
> ipu_channel_t ipu_ch;
> int ipu_di;
> @@ -381,13 +382,16 @@ static int mxcfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
>
> static int mxcfb_map_video_memory(struct fb_info *fbi)
> {
> + struct mxcfb_info *mxc_fbi = (struct mxcfb_info *)fbi->par;
> + struct video_uc_platdata *plat = dev_get_uclass_platdata(mxc_fbi->udev);
> +
> if (fbi->fix.smem_len < fbi->var.yres_virtual * fbi->fix.line_length) {
> fbi->fix.smem_len = fbi->var.yres_virtual *
> fbi->fix.line_length;
> }
> fbi->fix.smem_len = roundup(fbi->fix.smem_len, ARCH_DMA_MINALIGN);
>
> - fbi->screen_base = (char *)gd->video_bottom;
> + fbi->screen_base = (char *)plat->base;
>
> fbi->fix.smem_start = (unsigned long)fbi->screen_base;
> if (fbi->screen_base == 0) {
> @@ -477,8 +481,8 @@ extern struct clk *g_ipu_clk;
> *
> * @return Appropriate error code to the kernel common code
> */
> -static int mxcfb_probe(u32 interface_pix_fmt, uint8_t disp,
> - struct fb_videomode const *mode)
> +static int mxcfb_probe(struct udevice *dev, u32 interface_pix_fmt,
> + uint8_t disp, struct fb_videomode const *mode)
> {
> struct fb_info *fbi;
> struct mxcfb_info *mxcfbi;
> @@ -501,6 +505,7 @@ static int mxcfb_probe(u32 interface_pix_fmt, uint8_t disp,
> }
>
> mxcfbi->ipu_di = disp;
> + mxcfbi->udev = dev;
>
> if (!ipu_clk_enabled())
> clk_enable(g_ipu_clk);
> @@ -600,7 +605,7 @@ static int ipuv3_video_probe(struct udevice *dev)
> if (ret < 0)
> return ret;
>
> - ret = mxcfb_probe(gpixfmt, gdisp, gmode);
> + ret = mxcfb_probe(dev, gpixfmt, gdisp, gmode);
> if (ret < 0)
> return ret;
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] video: ipuv3: fix framebuffer base address init with multiple IPUs
2020-08-03 13:45 [PATCH] video: ipuv3: fix framebuffer base address init with multiple IPUs Anatolij Gustschin
2020-08-03 21:13 ` Soeren Moch
@ 2020-08-04 7:45 ` Anatolij Gustschin
1 sibling, 0 replies; 3+ messages in thread
From: Anatolij Gustschin @ 2020-08-04 7:45 UTC (permalink / raw)
To: u-boot
On Mon, 3 Aug 2020 15:45:33 +0200
Anatolij Gustschin agust at denx.de wrote:
> Since commit 7812bbdc3732 ("video: Correctly handle multiple
> framebuffers") the vidconsole output is missing on the primary
> display on boards with two IPU units (all i.MX6Q/D based boards).
> The base address of the allocated framebuffer is not correctly
> programmed in the display controller. Fix it.
>
> Reported-by: Soeren Moch <smoch@web.de>
> Signed-off-by: Anatolij Gustschin <agust@denx.de>
> ---
> drivers/video/imx/mxc_ipuv3_fb.c | 13 +++++++++----
> 1 file changed, 9 insertions(+), 4 deletions(-)
Applied to u-boot-video/master, thanks!
--
Anatolij
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-08-04 7:45 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-03 13:45 [PATCH] video: ipuv3: fix framebuffer base address init with multiple IPUs Anatolij Gustschin
2020-08-03 21:13 ` Soeren Moch
2020-08-04 7:45 ` Anatolij Gustschin
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.