diff options
author | 2018-04-27 23:21:53 +0100 | |
---|---|---|
committer | 2018-05-05 17:11:19 +0300 | |
commit | 7ae90455bc865ab1c30fb4db53ac56ec32741ab9 (patch) | |
tree | 6046cbb08032c475f0aeabbdf1fcb99373f806cf /drivers/gpu/drm/rcar-du/rcar_du_kms.c | |
parent | drm: rcar-du: Split CRTC handling to support hardware indexing (diff) | |
download | linux-dev-7ae90455bc865ab1c30fb4db53ac56ec32741ab9.tar.xz linux-dev-7ae90455bc865ab1c30fb4db53ac56ec32741ab9.zip |
drm: rcar-du: Allow DU groups to work with hardware indexing
The group objects assume linear indexing, and more so always assume that
channel 0 of any active group is used.
Now that the CRTC objects support non-linear indexing, adapt the groups
to remove assumptions that channel 0 is utilised in each group by using
the channel mask provided in the device structures.
Finally ensure that the RGB routing is determined from the index of the
CRTC object (which represents the hardware DU channel index).
Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Diffstat (limited to 'drivers/gpu/drm/rcar-du/rcar_du_kms.c')
-rw-r--r-- | drivers/gpu/drm/rcar-du/rcar_du_kms.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_kms.c b/drivers/gpu/drm/rcar-du/rcar_du_kms.c index b5e331cb0d1c..34f1c27e9cf9 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_kms.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_kms.c @@ -559,7 +559,10 @@ int rcar_du_modeset_init(struct rcar_du_device *rcdu) rgrp->dev = rcdu; rgrp->mmio_offset = mmio_offsets[i]; rgrp->index = i; - rgrp->num_crtcs = min(rcdu->num_crtcs - 2 * i, 2U); + /* Extract the channel mask for this group only. */ + rgrp->channels_mask = (rcdu->info->channels_mask >> (2 * i)) + & GENMASK(1, 0); + rgrp->num_crtcs = hweight8(rgrp->channels_mask); /* * If we have more than one CRTCs in this group pre-associate |