Enable R8A7794 DU VSPD compositor
Subsystems (3)
cover Enable R8A7794 DU VSPD compositor
Hello.
Here's the set of 2 patches against the 'drm-next' branch of David Airlie's
'linux.git' repo. We're switching to the DU compositor for the DU driver on the Renesas R8A7794 SoC.
[1/2] drm: rcar-du: support less VSPs than CRTCs
[2/2] drm: rcar-du: enable VSPD on R8A7794
MBR, Sergei
PATCH 1/2 drm: rcar-du: support less VSPs than CRTCs
Renesas R-Car E2 (R8A7791) SoC only has 1 VSPD but still 2 DU ports. Since we are going to use the R-Car gen2 VSPDs as the DU compositors, we'll have to also support this case. Now that the number of VSPDs can be less than the number of the DU ports, 'struct rcar_du_device_info' needs a new field which we'll have to set for the SoCs where we've already used the VSPD compositor...
--- drivers/gpu/drm/rcar-du/rcar_du_crtc.c | 17 ++++++- drivers/gpu/drm/rcar-du/rcar_du_drv.c | 2 drivers/gpu/drm/rcar-du/rcar_du_drv.h | 2 drivers/gpu/drm/rcar-du/rcar_du_kms.c | 2 drivers/gpu/drm/rcar-du/rcar_du_vsp.c | 76 ++++++++++++++++++++++----------- drivers/gpu/drm/rcar-du/rcar_du_vsp.h | 2 6 files changed, 75 insertions(+), 26 deletions(-)
drivers/gpu/drm/rcar-du/rcar_du_crtc.c +15 -2
@@ -255,8 +255,21 @@ static void rcar_du_crtc_update_planes(s/* If VSP+DU integration is enabled the plane assignment is fixed. */ if (rcar_du_has (rcdu,RCAR_DU_FEATURE_VSP1_SOURCE )) {if (rcdu->info->gen <3 ) { - dspr = (rcrtc->index %2 ) +1 ; - hwplanes =1 << (rcrtc->index %2 ); +if (rcrtc->vsp->vsp) { + dspr = (rcrtc->index %2 ) +1 ; + hwplanes =1 << (rcrtc->index %2 ); + }else { +for (i =0 ; i < rcrtc->vsp->num_planes; ++i) { +struct rcar_du_vsp_plane *plane = + &rcrtc->vsp->planes[i]; + +if (plane->plane.state->crtc != + &rcrtc->crtc) +continue ; + dspr |= (plane->index +5 ) <<4 * i; + hwplanes |=1 << (plane->index +4 ); + } + } }else { dspr = (rcrtc->index %2 ) ?3 :1 ; hwplanes =1 << ((rcrtc->index %2 ) ?2 :0 );
drivers/gpu/drm/rcar-du/rcar_du_drv.c +2 -0
@@ -109,6 +109,7 @@ static const struct rcar_du_device_info }, }, .num_lvds = 1, + .num_vspds = 2, };static const struct rcar_du_device_info rcar_du_r8a7792_info = {
@@ -201,6 +202,7 @@ static const struct rcar_du_device_info }, }, .num_lvds = 1, + .num_vspds = 4, };static const struct of_device_id rcar_du_of_table[] = {
drivers/gpu/drm/rcar-du/rcar_du_drv.h +2 -0
@@ -59,6 +59,7 @@ struct rcar_du_output_routing {* @num_crtcs: total number of CRTCs * @routes: array of CRTC to output routes, indexed by output (RCAR_DU_OUTPUT_*) * @num_lvds: number of internal LVDS encoders +* @num_vspds: number of VSPDs */ struct rcar_du_device_info {unsigned int gen;
@@ -67,6 +68,7 @@ struct rcar_du_device_info {unsigned int num_crtcs;struct rcar_du_output_routing routes[RCAR_DU_OUTPUT_MAX ];unsigned int num_lvds; +unsigned int num_vspds; };#define RCAR_DU_MAX_CRTCS 4
drivers/gpu/drm/rcar-du/rcar_du_kms.c +2 -0
@@ -611,6 +611,8 @@ int rcar_du_modeset_init(struct rcar_du_ vsp->index = i; vsp->dev = rcdu; + vsp->group = &rcdu->groups[i /2 ]; + rcdu->crtcs[i].vsp = vsp; ret =rcar_du_vsp_init (vsp);
drivers/gpu/drm/rcar-du/rcar_du_vsp.c +52 -24
115 lines not on this page · raw message
drivers/gpu/drm/rcar-du/rcar_du_vsp.h +2 -0
@@ -19,6 +19,7 @@struct rcar_du_format_info ;struct rcar_du_vsp ; +struct rcar_du_group ;struct rcar_du_vsp_plane {struct drm_plane plane;
@@ -31,6 +32,7 @@ struct rcar_du_vsp {struct device *vsp;struct rcar_du_device *dev;struct rcar_du_vsp_plane *planes; +struct rcar_du_group * group;unsigned int num_planes; };
PATCH 2/2 drm: rcar-du: enable VSPD on R8A7794
In reply to Sergei ShtylyovWe're going to use R8A7794 VSPD to control DU, so set the corresponding flag and the newly added field, 'num_vspds'...
--- drivers/gpu/drm/rcar-du/rcar_du_drv.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/rcar-du/rcar_du_drv.c +3 -1
@@ -136,7 +136,8 @@ static const struct rcar_du_device_infostatic const struct rcar_du_device_info rcar_du_r8a7794_info = { .gen =2 , .features =RCAR_DU_FEATURE_CRTC_IRQ_CLOCK - |RCAR_DU_FEATURE_EXT_CTRL_REGS , + |RCAR_DU_FEATURE_EXT_CTRL_REGS + |RCAR_DU_FEATURE_VSP1_SOURCE , .num_crtcs =2 , .routes = {/* R8A7794 has two RGB outputs and one (currently unsupported)
@@ -154,6 +155,7 @@ static const struct rcar_du_device_info }, }, .num_lvds = 0, + .num_vspds = 1, };static const struct rcar_du_device_info rcar_du_r8a7795_info = {
Hi Sergei,
Quoted 8 lines · On Thursday 29 Dec 2016 00:18:40 Sergei Shtylyov wrote:
Hello.
Here's the set of 2 patches against the 'drm-next' branch of David
Airlie's 'linux.git' repo. We're switching to the DU compositor for the DU driver on the Renesas R8A7794 SoC.[1/2] drm: rcar-du: support less VSPs than CRTCs
[2/2] drm: rcar-du: enable VSPD on R8A7794
Nack for the same reasons as your previous related patches. If you want to get this feature merged we'll need to configure whether the VSPD is used standalone or for DU operation at runtime. The DRM live sources were an attempt at implementing that, feel free to revive the idea and brush up the patches.
Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel