Lines Matching refs:rcdu
331 struct rcar_du_device *rcdu = to_rcar_du_device(dev); in rcar_du_dumb_create() local
339 if (rcar_du_needs(rcdu, RCAR_DU_QUIRK_ALIGN_128B)) in rcar_du_dumb_create()
353 struct rcar_du_device *rcdu = to_rcar_du_device(dev); in rcar_du_fb_create() local
367 if (rcdu->info->gen < 3) { in rcar_du_fb_create()
377 if (rcar_du_needs(rcdu, RCAR_DU_QUIRK_ALIGN_128B)) in rcar_du_fb_create()
425 struct rcar_du_device *rcdu = to_rcar_du_device(dev); in rcar_du_atomic_check() local
432 if (rcar_du_has(rcdu, RCAR_DU_FEATURE_VSP1_SOURCE)) in rcar_du_atomic_check()
441 struct rcar_du_device *rcdu = to_rcar_du_device(dev); in rcar_du_atomic_commit_tail() local
450 rcdu->dpad1_source = -1; in rcar_du_atomic_commit_tail()
458 rcdu->dpad0_source = rcrtc->index; in rcar_du_atomic_commit_tail()
461 rcdu->dpad1_source = rcrtc->index; in rcar_du_atomic_commit_tail()
490 static int rcar_du_encoders_init_one(struct rcar_du_device *rcdu, in rcar_du_encoders_init_one() argument
500 dev_dbg(rcdu->dev, "unconnected endpoint %pOF, skipping\n", in rcar_du_encoders_init_one()
506 dev_dbg(rcdu->dev, in rcar_du_encoders_init_one()
513 ret = rcar_du_encoder_init(rcdu, output, entity); in rcar_du_encoders_init_one()
515 dev_warn(rcdu->dev, in rcar_du_encoders_init_one()
524 static int rcar_du_encoders_init(struct rcar_du_device *rcdu) in rcar_du_encoders_init() argument
526 struct device_node *np = rcdu->dev->of_node; in rcar_du_encoders_init()
548 if (rcdu->info->routes[i].possible_crtcs && in rcar_du_encoders_init()
549 rcdu->info->routes[i].port == ep.port) { in rcar_du_encoders_init()
556 dev_warn(rcdu->dev, in rcar_du_encoders_init()
563 ret = rcar_du_encoders_init_one(rcdu, output, &ep); in rcar_du_encoders_init()
579 static int rcar_du_properties_init(struct rcar_du_device *rcdu) in rcar_du_properties_init() argument
586 rcdu->props.colorkey = in rcar_du_properties_init()
587 drm_property_create_range(&rcdu->ddev, 0, "colorkey", in rcar_du_properties_init()
589 if (rcdu->props.colorkey == NULL) in rcar_du_properties_init()
595 static int rcar_du_vsps_init(struct rcar_du_device *rcdu) in rcar_du_vsps_init() argument
597 const struct device_node *np = rcdu->dev->of_node; in rcar_du_vsps_init()
620 cells = ret / rcdu->num_crtcs - 1; in rcar_du_vsps_init()
624 for (i = 0; i < rcdu->num_crtcs; ++i) { in rcar_du_vsps_init()
653 rcdu->crtcs[i].vsp = &rcdu->vsps[j]; in rcar_du_vsps_init()
654 rcdu->crtcs[i].vsp_pipe = cells >= 1 ? args.args[0] : 0; in rcar_du_vsps_init()
662 struct rcar_du_vsp *vsp = &rcdu->vsps[i]; in rcar_du_vsps_init()
665 vsp->dev = rcdu; in rcar_du_vsps_init()
681 static int rcar_du_cmm_init(struct rcar_du_device *rcdu) in rcar_du_cmm_init() argument
683 const struct device_node *np = rcdu->dev->of_node; in rcar_du_cmm_init()
691 if (cells > rcdu->num_crtcs) { in rcar_du_cmm_init()
692 dev_err(rcdu->dev, in rcar_du_cmm_init()
705 dev_err(rcdu->dev, in rcar_du_cmm_init()
718 dev_err(rcdu->dev, "No device found for CMM%u\n", i); in rcar_du_cmm_init()
735 rcdu->cmms[i] = pdev; in rcar_du_cmm_init()
741 link = device_link_add(rcdu->dev, &pdev->dev, DL_FLAG_STATELESS); in rcar_du_cmm_init()
743 dev_err(rcdu->dev, in rcar_du_cmm_init()
754 struct rcar_du_device *rcdu = to_rcar_du_device(dev); in rcar_du_modeset_cleanup() local
757 for (i = 0; i < ARRAY_SIZE(rcdu->cmms); ++i) in rcar_du_modeset_cleanup()
758 platform_device_put(rcdu->cmms[i]); in rcar_du_modeset_cleanup()
761 int rcar_du_modeset_init(struct rcar_du_device *rcdu) in rcar_du_modeset_init() argument
767 struct drm_device *dev = &rcdu->ddev; in rcar_du_modeset_init()
781 ret = drmm_add_action(&rcdu->ddev, rcar_du_modeset_cleanup, NULL); in rcar_du_modeset_init()
791 if (rcdu->info->gen < 3) { in rcar_du_modeset_init()
803 rcdu->num_crtcs = hweight8(rcdu->info->channels_mask); in rcar_du_modeset_init()
805 ret = rcar_du_properties_init(rcdu); in rcar_du_modeset_init()
813 ret = drm_vblank_init(dev, rcdu->num_crtcs); in rcar_du_modeset_init()
818 num_groups = DIV_ROUND_UP(rcdu->num_crtcs, 2); in rcar_du_modeset_init()
821 struct rcar_du_group *rgrp = &rcdu->groups[i]; in rcar_du_modeset_init()
825 rgrp->dev = rcdu; in rcar_du_modeset_init()
829 rgrp->channels_mask = (rcdu->info->channels_mask >> (2 * i)) in rcar_du_modeset_init()
840 ? (rcdu->info->gen >= 3 ? 0x04 : 0xf0) in rcar_du_modeset_init()
843 if (!rcar_du_has(rcdu, RCAR_DU_FEATURE_VSP1_SOURCE)) { in rcar_du_modeset_init()
851 if (rcar_du_has(rcdu, RCAR_DU_FEATURE_VSP1_SOURCE)) { in rcar_du_modeset_init()
852 ret = rcar_du_vsps_init(rcdu); in rcar_du_modeset_init()
858 ret = rcar_du_cmm_init(rcdu); in rcar_du_modeset_init()
863 for (swindex = 0, hwindex = 0; swindex < rcdu->num_crtcs; ++hwindex) { in rcar_du_modeset_init()
867 if (!(rcdu->info->channels_mask & BIT(hwindex))) in rcar_du_modeset_init()
870 rgrp = &rcdu->groups[hwindex / 2]; in rcar_du_modeset_init()
878 ret = rcar_du_encoders_init(rcdu); in rcar_du_modeset_init()
883 dev_err(rcdu->dev, "error: no encoder could be initialized\n"); in rcar_du_modeset_init()
897 &rcdu->info->routes[renc->output]; in rcar_du_modeset_init()
904 if (rcdu->info->gen >= 3) { in rcar_du_modeset_init()
905 for (i = 0; i < rcdu->num_crtcs; ++i) { in rcar_du_modeset_init()
906 struct rcar_du_crtc *rcrtc = &rcdu->crtcs[i]; in rcar_du_modeset_init()
908 ret = rcar_du_writeback_init(rcdu, rcrtc); in rcar_du_modeset_init()
922 dpad0_sources = rcdu->info->routes[RCAR_DU_OUTPUT_DPAD0].possible_crtcs; in rcar_du_modeset_init()
923 rcdu->dpad0_source = ffs(dpad0_sources) - 1; in rcar_du_modeset_init()