* [PATCH 0/3] drm: rcar-du: Update DU support @ 2018-08-31 18:12 Kieran Bingham 2018-08-31 18:12 ` [PATCH 1/3] drm: rcar-du: Update Gen3 output limitations Kieran Bingham ` (2 more replies) 0 siblings, 3 replies; 9+ messages in thread From: Kieran Bingham @ 2018-08-31 18:12 UTC (permalink / raw) To: Laurent Pinchart Cc: David Airlie, dri-devel, linux-renesas-soc, linux-kernel, Kieran Bingham 3 patches to remove current limitations in the DU. Image formats that the hardware is capable of were not listed in the driver, and are added by Koji Masuoka. Frame sizes on Gen3 platforms were artificially limited to the Gen2 framesizes, and so this has been lifted to support larger displays such as 4K outputs. Finally restrictions on the framebuffer strides and alignments are lifted due to the greater flexibility of the VSP. Kieran Bingham (1): drm: rcar-du: Update Gen3 output limitations Koji Matsuoka (1): drm: rcar-du: Add pixel format support Laurent Pinchart (1): drm: rcar-du: Update framebuffer pitch and alignment limits for Gen3 drivers/gpu/drm/rcar-du/rcar_du_kms.c | 81 ++++++++++++++++++++++----- 1 file changed, 67 insertions(+), 14 deletions(-) -- 2.17.1 ^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 1/3] drm: rcar-du: Update Gen3 output limitations 2018-08-31 18:12 [PATCH 0/3] drm: rcar-du: Update DU support Kieran Bingham @ 2018-08-31 18:12 ` Kieran Bingham 2018-09-14 11:05 ` Laurent Pinchart 2018-08-31 18:12 ` [PATCH 2/3] drm: rcar-du: Add pixel format support Kieran Bingham 2018-08-31 18:12 ` [PATCH 3/3] drm: rcar-du: Update framebuffer pitch and alignment limits for Gen3 Kieran Bingham 2 siblings, 1 reply; 9+ messages in thread From: Kieran Bingham @ 2018-08-31 18:12 UTC (permalink / raw) To: Laurent Pinchart Cc: David Airlie, dri-devel, linux-renesas-soc, linux-kernel, Kieran Bingham The R-Car Gen3 DU utilises the VSP1 hardware for memory access. The limits on the RPF and WPF in this pipeline are 8190x8190. Update the supported maximum sizes accordingly. Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> --- drivers/gpu/drm/rcar-du/rcar_du_kms.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/rcar-du/rcar_du_kms.c b/drivers/gpu/drm/rcar-du/rcar_du_kms.c index ed7fa3204892..7c7aff8cdf77 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_kms.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_kms.c @@ -512,12 +512,22 @@ int rcar_du_modeset_init(struct rcar_du_device *rcdu) dev->mode_config.min_width = 0; dev->mode_config.min_height = 0; - dev->mode_config.max_width = 4095; - dev->mode_config.max_height = 2047; dev->mode_config.normalize_zpos = true; dev->mode_config.funcs = &rcar_du_mode_config_funcs; dev->mode_config.helper_private = &rcar_du_mode_config_helper; + if (rcdu->info->gen < 3) { + dev->mode_config.max_width = 4095; + dev->mode_config.max_height = 2047; + } else { + /* + * The Gen3 DU uses the VSP1 for memory access, and is limited + * to frame sizes of 8190x8190. + */ + dev->mode_config.max_width = 8190; + dev->mode_config.max_height = 8190; + } + rcdu->num_crtcs = hweight8(rcdu->info->channels_mask); ret = rcar_du_properties_init(rcdu); -- 2.17.1 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 1/3] drm: rcar-du: Update Gen3 output limitations 2018-08-31 18:12 ` [PATCH 1/3] drm: rcar-du: Update Gen3 output limitations Kieran Bingham @ 2018-09-14 11:05 ` Laurent Pinchart 0 siblings, 0 replies; 9+ messages in thread From: Laurent Pinchart @ 2018-09-14 11:05 UTC (permalink / raw) To: Kieran Bingham; +Cc: David Airlie, dri-devel, linux-renesas-soc, linux-kernel Hi Kieran, Thank you for the patch. On Friday, 31 August 2018 21:12:57 EEST Kieran Bingham wrote: > The R-Car Gen3 DU utilises the VSP1 hardware for memory access. The > limits on the RPF and WPF in this pipeline are 8190x8190. > > Update the supported maximum sizes accordingly. > > Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> and applied to my tree. > --- > drivers/gpu/drm/rcar-du/rcar_du_kms.c | 14 ++++++++++++-- > 1 file changed, 12 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/rcar-du/rcar_du_kms.c > b/drivers/gpu/drm/rcar-du/rcar_du_kms.c index ed7fa3204892..7c7aff8cdf77 > 100644 > --- a/drivers/gpu/drm/rcar-du/rcar_du_kms.c > +++ b/drivers/gpu/drm/rcar-du/rcar_du_kms.c > @@ -512,12 +512,22 @@ int rcar_du_modeset_init(struct rcar_du_device *rcdu) > > dev->mode_config.min_width = 0; > dev->mode_config.min_height = 0; > - dev->mode_config.max_width = 4095; > - dev->mode_config.max_height = 2047; > dev->mode_config.normalize_zpos = true; > dev->mode_config.funcs = &rcar_du_mode_config_funcs; > dev->mode_config.helper_private = &rcar_du_mode_config_helper; > > + if (rcdu->info->gen < 3) { > + dev->mode_config.max_width = 4095; > + dev->mode_config.max_height = 2047; > + } else { > + /* > + * The Gen3 DU uses the VSP1 for memory access, and is limited > + * to frame sizes of 8190x8190. > + */ > + dev->mode_config.max_width = 8190; > + dev->mode_config.max_height = 8190; > + } > + > rcdu->num_crtcs = hweight8(rcdu->info->channels_mask); > > ret = rcar_du_properties_init(rcdu); -- Regards, Laurent Pinchart ^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 2/3] drm: rcar-du: Add pixel format support 2018-08-31 18:12 [PATCH 0/3] drm: rcar-du: Update DU support Kieran Bingham 2018-08-31 18:12 ` [PATCH 1/3] drm: rcar-du: Update Gen3 output limitations Kieran Bingham @ 2018-08-31 18:12 ` Kieran Bingham 2018-09-14 11:11 ` Laurent Pinchart 2018-09-14 11:17 ` Laurent Pinchart 2018-08-31 18:12 ` [PATCH 3/3] drm: rcar-du: Update framebuffer pitch and alignment limits for Gen3 Kieran Bingham 2 siblings, 2 replies; 9+ messages in thread From: Kieran Bingham @ 2018-08-31 18:12 UTC (permalink / raw) To: Laurent Pinchart Cc: David Airlie, dri-devel, linux-renesas-soc, linux-kernel, Koji Matsuoka, Kieran Bingham From: Koji Matsuoka <koji.matsuoka.xm@renesas.com> This patch supports pixel format of RGB332, ARGB4444, XRGB4444, BGR888, RGB888, BGRA8888, BGRX8888 and YVYU. VYUY pixel format is not supported by H/W specification. Signed-off-by: Koji Matsuoka <koji.matsuoka.xm@renesas.com> Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> --- This patch does not remove existing support for multiplanar YVUY, even though the hardware does not explicitly provide it, because we support it through software by swapping the plane buffers. drivers/gpu/drm/rcar-du/rcar_du_kms.c | 32 +++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/drivers/gpu/drm/rcar-du/rcar_du_kms.c b/drivers/gpu/drm/rcar-du/rcar_du_kms.c index 7c7aff8cdf77..d1bd174ec893 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_kms.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_kms.c @@ -124,6 +124,38 @@ static const struct rcar_du_format_info rcar_du_format_infos[] = { .fourcc = DRM_FORMAT_YVU444, .bpp = 24, .planes = 3, + }, { + .fourcc = DRM_FORMAT_RGB332, + .bpp = 8, + .planes = 1, + }, { + .fourcc = DRM_FORMAT_ARGB4444, + .bpp = 16, + .planes = 1, + }, { + .fourcc = DRM_FORMAT_XRGB4444, + .bpp = 16, + .planes = 1, + }, { + .fourcc = DRM_FORMAT_BGR888, + .bpp = 24, + .planes = 1, + }, { + .fourcc = DRM_FORMAT_RGB888, + .bpp = 24, + .planes = 1, + }, { + .fourcc = DRM_FORMAT_BGRA8888, + .bpp = 32, + .planes = 1, + }, { + .fourcc = DRM_FORMAT_BGRX8888, + .bpp = 32, + .planes = 1, + }, { + .fourcc = DRM_FORMAT_YVYU, + .bpp = 16, + .planes = 1, }, }; -- 2.17.1 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 2/3] drm: rcar-du: Add pixel format support 2018-08-31 18:12 ` [PATCH 2/3] drm: rcar-du: Add pixel format support Kieran Bingham @ 2018-09-14 11:11 ` Laurent Pinchart 2018-09-14 13:02 ` Kieran Bingham 2018-09-14 11:17 ` Laurent Pinchart 1 sibling, 1 reply; 9+ messages in thread From: Laurent Pinchart @ 2018-09-14 11:11 UTC (permalink / raw) To: Kieran Bingham Cc: David Airlie, dri-devel, linux-renesas-soc, linux-kernel, Koji Matsuoka Hi Kieran, Thank you for the patch. How about renaming the subject line to "Add support for missing pixel formats" ? On Friday, 31 August 2018 21:12:58 EEST Kieran Bingham wrote: > From: Koji Matsuoka <koji.matsuoka.xm@renesas.com> > > This patch supports pixel format of RGB332, ARGB4444, XRGB4444, > BGR888, RGB888, BGRA8888, BGRX8888 and YVYU. > VYUY pixel format is not supported by H/W specification. > > Signed-off-by: Koji Matsuoka <koji.matsuoka.xm@renesas.com> > Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> > > --- > > This patch does not remove existing support for multiplanar YVUY, even > though the hardware does not explicitly provide it, because we support > it through software by swapping the plane buffers. > > drivers/gpu/drm/rcar-du/rcar_du_kms.c | 32 +++++++++++++++++++++++++++ > 1 file changed, 32 insertions(+) > > diff --git a/drivers/gpu/drm/rcar-du/rcar_du_kms.c > b/drivers/gpu/drm/rcar-du/rcar_du_kms.c index 7c7aff8cdf77..d1bd174ec893 > 100644 > --- a/drivers/gpu/drm/rcar-du/rcar_du_kms.c > +++ b/drivers/gpu/drm/rcar-du/rcar_du_kms.c > @@ -124,6 +124,38 @@ static const struct rcar_du_format_info > rcar_du_format_infos[] = { .fourcc = DRM_FORMAT_YVU444, > .bpp = 24, > .planes = 3, > + }, { > + .fourcc = DRM_FORMAT_RGB332, > + .bpp = 8, > + .planes = 1, > + }, { > + .fourcc = DRM_FORMAT_ARGB4444, > + .bpp = 16, > + .planes = 1, > + }, { > + .fourcc = DRM_FORMAT_XRGB4444, > + .bpp = 16, > + .planes = 1, > + }, { > + .fourcc = DRM_FORMAT_BGR888, > + .bpp = 24, > + .planes = 1, > + }, { > + .fourcc = DRM_FORMAT_RGB888, > + .bpp = 24, > + .planes = 1, > + }, { > + .fourcc = DRM_FORMAT_BGRA8888, > + .bpp = 32, > + .planes = 1, > + }, { > + .fourcc = DRM_FORMAT_BGRX8888, > + .bpp = 32, > + .planes = 1, > + }, { > + .fourcc = DRM_FORMAT_YVYU, > + .bpp = 16, > + .planes = 1, > }, > }; I would list the RGB formats first, followed by the packed YUV format, and then the multiplanar YUV formats. With this changed, Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> If you're fine with the changes there's no need to resubmit. -- Regards, Laurent Pinchart ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 2/3] drm: rcar-du: Add pixel format support 2018-09-14 11:11 ` Laurent Pinchart @ 2018-09-14 13:02 ` Kieran Bingham 0 siblings, 0 replies; 9+ messages in thread From: Kieran Bingham @ 2018-09-14 13:02 UTC (permalink / raw) To: Laurent Pinchart Cc: David Airlie, dri-devel, linux-renesas-soc, linux-kernel, Koji Matsuoka Hi Laurent, On 14/09/18 12:11, Laurent Pinchart wrote: > Hi Kieran, > > Thank you for the patch. > > How about renaming the subject line to "Add support for missing pixel formats" > ? > Ack. > On Friday, 31 August 2018 21:12:58 EEST Kieran Bingham wrote: >> From: Koji Matsuoka <koji.matsuoka.xm@renesas.com> >> >> This patch supports pixel format of RGB332, ARGB4444, XRGB4444, >> BGR888, RGB888, BGRA8888, BGRX8888 and YVYU. >> VYUY pixel format is not supported by H/W specification. >> >> Signed-off-by: Koji Matsuoka <koji.matsuoka.xm@renesas.com> >> Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> >> >> --- >> >> This patch does not remove existing support for multiplanar YVUY, even >> though the hardware does not explicitly provide it, because we support >> it through software by swapping the plane buffers. >> >> drivers/gpu/drm/rcar-du/rcar_du_kms.c | 32 +++++++++++++++++++++++++++ >> 1 file changed, 32 insertions(+) >> >> diff --git a/drivers/gpu/drm/rcar-du/rcar_du_kms.c >> b/drivers/gpu/drm/rcar-du/rcar_du_kms.c index 7c7aff8cdf77..d1bd174ec893 >> 100644 >> --- a/drivers/gpu/drm/rcar-du/rcar_du_kms.c >> +++ b/drivers/gpu/drm/rcar-du/rcar_du_kms.c >> @@ -124,6 +124,38 @@ static const struct rcar_du_format_info >> rcar_du_format_infos[] = { .fourcc = DRM_FORMAT_YVU444, >> .bpp = 24, >> .planes = 3, >> + }, { >> + .fourcc = DRM_FORMAT_RGB332, >> + .bpp = 8, >> + .planes = 1, >> + }, { >> + .fourcc = DRM_FORMAT_ARGB4444, >> + .bpp = 16, >> + .planes = 1, >> + }, { >> + .fourcc = DRM_FORMAT_XRGB4444, >> + .bpp = 16, >> + .planes = 1, >> + }, { >> + .fourcc = DRM_FORMAT_BGR888, >> + .bpp = 24, >> + .planes = 1, >> + }, { >> + .fourcc = DRM_FORMAT_RGB888, >> + .bpp = 24, >> + .planes = 1, >> + }, { >> + .fourcc = DRM_FORMAT_BGRA8888, >> + .bpp = 32, >> + .planes = 1, >> + }, { >> + .fourcc = DRM_FORMAT_BGRX8888, >> + .bpp = 32, >> + .planes = 1, >> + }, { >> + .fourcc = DRM_FORMAT_YVYU, >> + .bpp = 16, >> + .planes = 1, >> }, >> }; > > I would list the RGB formats first, followed by the packed YUV format, and > then the multiplanar YUV formats. With this changed, > Ack. > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > > If you're fine with the changes there's no need to resubmit. That's fine by me. Thanks -- Kieran ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 2/3] drm: rcar-du: Add pixel format support 2018-08-31 18:12 ` [PATCH 2/3] drm: rcar-du: Add pixel format support Kieran Bingham 2018-09-14 11:11 ` Laurent Pinchart @ 2018-09-14 11:17 ` Laurent Pinchart 2018-09-14 13:20 ` Kieran Bingham 1 sibling, 1 reply; 9+ messages in thread From: Laurent Pinchart @ 2018-09-14 11:17 UTC (permalink / raw) To: Kieran Bingham Cc: David Airlie, dri-devel, linux-renesas-soc, linux-kernel, Koji Matsuoka Hi Kieran, On Friday, 31 August 2018 21:12:58 EEST Kieran Bingham wrote: > From: Koji Matsuoka <koji.matsuoka.xm@renesas.com> > > This patch supports pixel format of RGB332, ARGB4444, XRGB4444, > BGR888, RGB888, BGRA8888, BGRX8888 and YVYU. > VYUY pixel format is not supported by H/W specification. Should VYUY be removed from rcar_du_vsp.c ? This can be done in a separate patch. > Signed-off-by: Koji Matsuoka <koji.matsuoka.xm@renesas.com> > Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> > > --- > > This patch does not remove existing support for multiplanar YVUY, even > though the hardware does not explicitly provide it, because we support > it through software by swapping the plane buffers. > > drivers/gpu/drm/rcar-du/rcar_du_kms.c | 32 +++++++++++++++++++++++++++ > 1 file changed, 32 insertions(+) > > diff --git a/drivers/gpu/drm/rcar-du/rcar_du_kms.c > b/drivers/gpu/drm/rcar-du/rcar_du_kms.c index 7c7aff8cdf77..d1bd174ec893 > 100644 > --- a/drivers/gpu/drm/rcar-du/rcar_du_kms.c > +++ b/drivers/gpu/drm/rcar-du/rcar_du_kms.c > @@ -124,6 +124,38 @@ static const struct rcar_du_format_info > rcar_du_format_infos[] = { .fourcc = DRM_FORMAT_YVU444, > .bpp = 24, > .planes = 3, > + }, { > + .fourcc = DRM_FORMAT_RGB332, > + .bpp = 8, > + .planes = 1, > + }, { > + .fourcc = DRM_FORMAT_ARGB4444, > + .bpp = 16, > + .planes = 1, > + }, { > + .fourcc = DRM_FORMAT_XRGB4444, > + .bpp = 16, > + .planes = 1, > + }, { > + .fourcc = DRM_FORMAT_BGR888, > + .bpp = 24, > + .planes = 1, > + }, { > + .fourcc = DRM_FORMAT_RGB888, > + .bpp = 24, > + .planes = 1, > + }, { > + .fourcc = DRM_FORMAT_BGRA8888, > + .bpp = 32, > + .planes = 1, > + }, { > + .fourcc = DRM_FORMAT_BGRX8888, > + .bpp = 32, > + .planes = 1, > + }, { > + .fourcc = DRM_FORMAT_YVYU, > + .bpp = 16, > + .planes = 1, > }, > }; -- Regards, Laurent Pinchart ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 2/3] drm: rcar-du: Add pixel format support 2018-09-14 11:17 ` Laurent Pinchart @ 2018-09-14 13:20 ` Kieran Bingham 0 siblings, 0 replies; 9+ messages in thread From: Kieran Bingham @ 2018-09-14 13:20 UTC (permalink / raw) To: Laurent Pinchart Cc: David Airlie, dri-devel, linux-renesas-soc, linux-kernel, Koji Matsuoka Hi Laurent, On 14/09/18 12:17, Laurent Pinchart wrote: > Hi Kieran, > > On Friday, 31 August 2018 21:12:58 EEST Kieran Bingham wrote: >> From: Koji Matsuoka <koji.matsuoka.xm@renesas.com> >> >> This patch supports pixel format of RGB332, ARGB4444, XRGB4444, >> BGR888, RGB888, BGRA8888, BGRX8888 and YVYU. >> VYUY pixel format is not supported by H/W specification. > > Should VYUY be removed from rcar_du_vsp.c ? This can be done in a separate > patch. On further consideration - yes, I believe it should. Removal patch generated, and doesn't negatively affect the current kms-tests, so expect it in your inbox imminently. -- Regards Kieran > >> Signed-off-by: Koji Matsuoka <koji.matsuoka.xm@renesas.com> >> Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> >> >> --- >> >> This patch does not remove existing support for multiplanar YVUY, even >> though the hardware does not explicitly provide it, because we support >> it through software by swapping the plane buffers. >> >> drivers/gpu/drm/rcar-du/rcar_du_kms.c | 32 +++++++++++++++++++++++++++ >> 1 file changed, 32 insertions(+) >> >> diff --git a/drivers/gpu/drm/rcar-du/rcar_du_kms.c >> b/drivers/gpu/drm/rcar-du/rcar_du_kms.c index 7c7aff8cdf77..d1bd174ec893 >> 100644 >> --- a/drivers/gpu/drm/rcar-du/rcar_du_kms.c >> +++ b/drivers/gpu/drm/rcar-du/rcar_du_kms.c >> @@ -124,6 +124,38 @@ static const struct rcar_du_format_info >> rcar_du_format_infos[] = { .fourcc = DRM_FORMAT_YVU444, >> .bpp = 24, >> .planes = 3, >> + }, { >> + .fourcc = DRM_FORMAT_RGB332, >> + .bpp = 8, >> + .planes = 1, >> + }, { >> + .fourcc = DRM_FORMAT_ARGB4444, >> + .bpp = 16, >> + .planes = 1, >> + }, { >> + .fourcc = DRM_FORMAT_XRGB4444, >> + .bpp = 16, >> + .planes = 1, >> + }, { >> + .fourcc = DRM_FORMAT_BGR888, >> + .bpp = 24, >> + .planes = 1, >> + }, { >> + .fourcc = DRM_FORMAT_RGB888, >> + .bpp = 24, >> + .planes = 1, >> + }, { >> + .fourcc = DRM_FORMAT_BGRA8888, >> + .bpp = 32, >> + .planes = 1, >> + }, { >> + .fourcc = DRM_FORMAT_BGRX8888, >> + .bpp = 32, >> + .planes = 1, >> + }, { >> + .fourcc = DRM_FORMAT_YVYU, >> + .bpp = 16, >> + .planes = 1, >> }, >> }; > > ^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 3/3] drm: rcar-du: Update framebuffer pitch and alignment limits for Gen3 2018-08-31 18:12 [PATCH 0/3] drm: rcar-du: Update DU support Kieran Bingham 2018-08-31 18:12 ` [PATCH 1/3] drm: rcar-du: Update Gen3 output limitations Kieran Bingham 2018-08-31 18:12 ` [PATCH 2/3] drm: rcar-du: Add pixel format support Kieran Bingham @ 2018-08-31 18:12 ` Kieran Bingham 2 siblings, 0 replies; 9+ messages in thread From: Kieran Bingham @ 2018-08-31 18:12 UTC (permalink / raw) To: Laurent Pinchart Cc: David Airlie, dri-devel, linux-renesas-soc, linux-kernel, Laurent Pinchart, Kieran Bingham From: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> The framebuffer pitch and alignment constraints reflect the limitations of the Gen2 DU hardware. On Gen3, the DU has no memory interface and thus doesn't impose any constraint. The limitations come instead from the VSP that has a limit of 65535 bytes for the pitch and no alignment constraint. Update the checks accordingly. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> --- drivers/gpu/drm/rcar-du/rcar_du_kms.c | 35 ++++++++++++++++++--------- 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/rcar-du/rcar_du_kms.c b/drivers/gpu/drm/rcar-du/rcar_du_kms.c index d1bd174ec893..1d5f49503b93 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_kms.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_kms.c @@ -204,7 +204,6 @@ rcar_du_fb_create(struct drm_device *dev, struct drm_file *file_priv, const struct rcar_du_format_info *format; unsigned int max_pitch; unsigned int align; - unsigned int bpp; unsigned int i; format = rcar_du_format_info(mode_cmd->pixel_format); @@ -214,20 +213,32 @@ rcar_du_fb_create(struct drm_device *dev, struct drm_file *file_priv, return ERR_PTR(-EINVAL); } - /* - * The pitch and alignment constraints are expressed in pixels on the - * hardware side and in bytes in the DRM API. - */ - bpp = format->planes == 1 ? format->bpp / 8 : 1; - max_pitch = 4096 * bpp; + if (rcdu->info->gen < 3) { + /* + * On Gen2 the DU limits the pitch to 4095 pixels and requires + * buffers to be aligned to a 16 pixels boundary (or 128 bytes + * on some platforms). + */ + unsigned int bpp = format->planes == 1 ? format->bpp / 8 : 1; - if (rcar_du_needs(rcdu, RCAR_DU_QUIRK_ALIGN_128B)) - align = 128; - else - align = 16 * bpp; + max_pitch = 4095 * bpp; + + if (rcar_du_needs(rcdu, RCAR_DU_QUIRK_ALIGN_128B)) + align = 128; + else + align = 16 * bpp; + } else { + /* + * On Gen3 the memory interface is handled by the VSP that + * limits the pitch to 65535 bytes and has no alignment + * constraint. + */ + max_pitch = 65535; + align = 1; + } if (mode_cmd->pitches[0] & (align - 1) || - mode_cmd->pitches[0] >= max_pitch) { + mode_cmd->pitches[0] > max_pitch) { dev_dbg(dev->dev, "invalid pitch value %u\n", mode_cmd->pitches[0]); return ERR_PTR(-EINVAL); -- 2.17.1 ^ permalink raw reply related [flat|nested] 9+ messages in thread
end of thread, other threads:[~2018-09-14 13:20 UTC | newest] Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2018-08-31 18:12 [PATCH 0/3] drm: rcar-du: Update DU support Kieran Bingham 2018-08-31 18:12 ` [PATCH 1/3] drm: rcar-du: Update Gen3 output limitations Kieran Bingham 2018-09-14 11:05 ` Laurent Pinchart 2018-08-31 18:12 ` [PATCH 2/3] drm: rcar-du: Add pixel format support Kieran Bingham 2018-09-14 11:11 ` Laurent Pinchart 2018-09-14 13:02 ` Kieran Bingham 2018-09-14 11:17 ` Laurent Pinchart 2018-09-14 13:20 ` Kieran Bingham 2018-08-31 18:12 ` [PATCH 3/3] drm: rcar-du: Update framebuffer pitch and alignment limits for Gen3 Kieran Bingham
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).