Lines Matching refs:rcdu
330 struct rcar_du_device *rcdu = dev->dev_private; in rcar_du_dumb_create() local
338 if (rcar_du_needs(rcdu, RCAR_DU_QUIRK_ALIGN_128B)) in rcar_du_dumb_create()
352 struct rcar_du_device *rcdu = dev->dev_private; in rcar_du_fb_create() local
366 if (rcdu->info->gen < 3) { in rcar_du_fb_create()
376 if (rcar_du_needs(rcdu, RCAR_DU_QUIRK_ALIGN_128B)) in rcar_du_fb_create()
424 struct rcar_du_device *rcdu = dev->dev_private; in rcar_du_atomic_check() local
431 if (rcar_du_has(rcdu, RCAR_DU_FEATURE_VSP1_SOURCE)) in rcar_du_atomic_check()
440 struct rcar_du_device *rcdu = dev->dev_private; in rcar_du_atomic_commit_tail() local
449 rcdu->dpad1_source = -1; in rcar_du_atomic_commit_tail()
457 rcdu->dpad0_source = rcrtc->index; in rcar_du_atomic_commit_tail()
460 rcdu->dpad1_source = rcrtc->index; in rcar_du_atomic_commit_tail()
489 static int rcar_du_encoders_init_one(struct rcar_du_device *rcdu, in rcar_du_encoders_init_one() argument
499 dev_dbg(rcdu->dev, "unconnected endpoint %pOF, skipping\n", in rcar_du_encoders_init_one()
505 dev_dbg(rcdu->dev, in rcar_du_encoders_init_one()
512 ret = rcar_du_encoder_init(rcdu, output, entity); in rcar_du_encoders_init_one()
514 dev_warn(rcdu->dev, in rcar_du_encoders_init_one()
523 static int rcar_du_encoders_init(struct rcar_du_device *rcdu) in rcar_du_encoders_init() argument
525 struct device_node *np = rcdu->dev->of_node; in rcar_du_encoders_init()
547 if (rcdu->info->routes[i].possible_crtcs && in rcar_du_encoders_init()
548 rcdu->info->routes[i].port == ep.port) { in rcar_du_encoders_init()
555 dev_warn(rcdu->dev, in rcar_du_encoders_init()
562 ret = rcar_du_encoders_init_one(rcdu, output, &ep); in rcar_du_encoders_init()
578 static int rcar_du_properties_init(struct rcar_du_device *rcdu) in rcar_du_properties_init() argument
585 rcdu->props.colorkey = in rcar_du_properties_init()
586 drm_property_create_range(rcdu->ddev, 0, "colorkey", in rcar_du_properties_init()
588 if (rcdu->props.colorkey == NULL) in rcar_du_properties_init()
594 static int rcar_du_vsps_init(struct rcar_du_device *rcdu) in rcar_du_vsps_init() argument
596 const struct device_node *np = rcdu->dev->of_node; in rcar_du_vsps_init()
619 cells = ret / rcdu->num_crtcs - 1; in rcar_du_vsps_init()
623 for (i = 0; i < rcdu->num_crtcs; ++i) { in rcar_du_vsps_init()
652 rcdu->crtcs[i].vsp = &rcdu->vsps[j]; in rcar_du_vsps_init()
653 rcdu->crtcs[i].vsp_pipe = cells >= 1 ? args.args[0] : 0; in rcar_du_vsps_init()
661 struct rcar_du_vsp *vsp = &rcdu->vsps[i]; in rcar_du_vsps_init()
664 vsp->dev = rcdu; in rcar_du_vsps_init()
680 static int rcar_du_cmm_init(struct rcar_du_device *rcdu) in rcar_du_cmm_init() argument
682 const struct device_node *np = rcdu->dev->of_node; in rcar_du_cmm_init()
690 if (cells > rcdu->num_crtcs) { in rcar_du_cmm_init()
691 dev_err(rcdu->dev, in rcar_du_cmm_init()
704 dev_err(rcdu->dev, in rcar_du_cmm_init()
717 dev_err(rcdu->dev, "No device found for CMM%u\n", i); in rcar_du_cmm_init()
736 link = device_link_add(rcdu->dev, &pdev->dev, DL_FLAG_STATELESS); in rcar_du_cmm_init()
738 dev_err(rcdu->dev, in rcar_du_cmm_init()
743 rcdu->cmms[i] = pdev; in rcar_du_cmm_init()
749 int rcar_du_modeset_init(struct rcar_du_device *rcdu) in rcar_du_modeset_init() argument
755 struct drm_device *dev = rcdu->ddev; in rcar_du_modeset_init()
775 if (rcdu->info->gen < 3) { in rcar_du_modeset_init()
787 rcdu->num_crtcs = hweight8(rcdu->info->channels_mask); in rcar_du_modeset_init()
789 ret = rcar_du_properties_init(rcdu); in rcar_du_modeset_init()
797 ret = drm_vblank_init(dev, rcdu->num_crtcs); in rcar_du_modeset_init()
802 num_groups = DIV_ROUND_UP(rcdu->num_crtcs, 2); in rcar_du_modeset_init()
805 struct rcar_du_group *rgrp = &rcdu->groups[i]; in rcar_du_modeset_init()
809 rgrp->dev = rcdu; in rcar_du_modeset_init()
813 rgrp->channels_mask = (rcdu->info->channels_mask >> (2 * i)) in rcar_du_modeset_init()
824 ? (rcdu->info->gen >= 3 ? 0x04 : 0xf0) in rcar_du_modeset_init()
827 if (!rcar_du_has(rcdu, RCAR_DU_FEATURE_VSP1_SOURCE)) { in rcar_du_modeset_init()
835 if (rcar_du_has(rcdu, RCAR_DU_FEATURE_VSP1_SOURCE)) { in rcar_du_modeset_init()
836 ret = rcar_du_vsps_init(rcdu); in rcar_du_modeset_init()
842 ret = rcar_du_cmm_init(rcdu); in rcar_du_modeset_init()
847 for (swindex = 0, hwindex = 0; swindex < rcdu->num_crtcs; ++hwindex) { in rcar_du_modeset_init()
851 if (!(rcdu->info->channels_mask & BIT(hwindex))) in rcar_du_modeset_init()
854 rgrp = &rcdu->groups[hwindex / 2]; in rcar_du_modeset_init()
862 ret = rcar_du_encoders_init(rcdu); in rcar_du_modeset_init()
867 dev_err(rcdu->dev, "error: no encoder could be initialized\n"); in rcar_du_modeset_init()
881 &rcdu->info->routes[renc->output]; in rcar_du_modeset_init()
888 if (rcdu->info->gen >= 3) { in rcar_du_modeset_init()
889 for (i = 0; i < rcdu->num_crtcs; ++i) { in rcar_du_modeset_init()
890 struct rcar_du_crtc *rcrtc = &rcdu->crtcs[i]; in rcar_du_modeset_init()
892 ret = rcar_du_writeback_init(rcdu, rcrtc); in rcar_du_modeset_init()
906 dpad0_sources = rcdu->info->routes[RCAR_DU_OUTPUT_DPAD0].possible_crtcs; in rcar_du_modeset_init()
907 rcdu->dpad0_source = ffs(dpad0_sources) - 1; in rcar_du_modeset_init()