diff options
author | Koji Matsuoka <koji.matsuoka.xm@renesas.com> | 2019-01-11 12:21:05 +0900 |
---|---|---|
committer | Ryo Kataoka <ryo.kataoka.wt@renesas.com> | 2019-03-22 20:50:26 +0900 |
commit | 5a5e59b87990d7f3d91a9e19ccaecbec0896cd1f (patch) | |
tree | 180b2425743509889034464bfc7c6d4968787725 | |
parent | 352918e939cd8eb409e1ec70a1f47f322a4ea0d9 (diff) | |
download | renesas-bsp-5a5e59b87990d7f3d91a9e19ccaecbec0896cd1f.tar.gz |
drm: rcar-du: Fix loop procedure in scatter gather page set
Originally the variable of "i" is used for the loop count of
the number of format planes in rcar_du_vsp_plane_prepare_fb
function and should be not used the same "i" as the loop count
of sg_set_page.
It is affected when the number of format planes is 2 (NV12 format
etc.) and 3 (YUV420 format etc.).
For the number of format planes is 1 (RGB565, ARGB888, YUYV etc),
this function works fine.
This patch solves its problem.
Fixes: c424cd4724 ("drm: rcar-du: Allow importing non-contiguous
dma-buf with VSP")
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Koji Matsuoka <koji.matsuoka.xm@renesas.com>
-rw-r--r-- | drivers/gpu/drm/rcar-du/rcar_du_vsp.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_vsp.c b/drivers/gpu/drm/rcar-du/rcar_du_vsp.c index db32c2023f165..c44d336e8572c 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_vsp.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_vsp.c @@ -1,7 +1,7 @@ /* - * rcar_du_vsp.h -- R-Car Display Unit VSP-Based Compositor + * rcar_du_vsp.c -- R-Car Display Unit VSP-Based Compositor * - * Copyright (C) 2015-2018 Renesas Electronics Corporation + * Copyright (C) 2015-2019 Renesas Electronics Corporation * * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com) * @@ -227,7 +227,7 @@ static int rcar_du_vsp_plane_prepare_fb(struct drm_plane *plane, struct rcar_du_vsp_plane_state *rstate = to_rcar_vsp_plane_state(state); struct rcar_du_vsp *vsp = to_rcar_vsp_plane(plane)->vsp; struct rcar_du_device *rcdu = vsp->dev; - unsigned int i; + unsigned int i, j; int ret; /* @@ -260,7 +260,7 @@ static int rcar_du_vsp_plane_prepare_fb(struct drm_plane *plane, src = gem->sgt->sgl; dst = sgt->sgl; - for (i = 0; i < gem->sgt->orig_nents; ++i) { + for (j = 0; j < gem->sgt->orig_nents; ++j) { sg_set_page(dst, sg_page(src), src->length, src->offset); src = sg_next(src); |