• Home
  • Raw
  • Download

Lines Matching refs:mdp4_kms

20 	struct mdp4_kms *mdp4_kms = to_mdp4_kms(to_mdp_kms(kms));  in mdp4_hw_init()  local
21 struct drm_device *dev = mdp4_kms->dev; in mdp4_hw_init()
28 if (mdp4_kms->rev > 1) { in mdp4_hw_init()
29 mdp4_write(mdp4_kms, REG_MDP4_CS_CONTROLLER0, 0x0707ffff); in mdp4_hw_init()
30 mdp4_write(mdp4_kms, REG_MDP4_CS_CONTROLLER1, 0x03073f3f); in mdp4_hw_init()
33 mdp4_write(mdp4_kms, REG_MDP4_PORTMAP_MODE, 0x3); in mdp4_hw_init()
36 mdp4_write(mdp4_kms, REG_MDP4_READ_CNFG, 0x02222); in mdp4_hw_init()
38 clk = clk_get_rate(mdp4_kms->clk); in mdp4_hw_init()
40 if ((mdp4_kms->rev >= 1) || (clk >= 90000000)) { in mdp4_hw_init()
50 mdp4_write(mdp4_kms, REG_MDP4_DMA_FETCH_CONFIG(DMA_P), dmap_cfg); in mdp4_hw_init()
51 mdp4_write(mdp4_kms, REG_MDP4_DMA_FETCH_CONFIG(DMA_E), dmap_cfg); in mdp4_hw_init()
53 mdp4_write(mdp4_kms, REG_MDP4_PIPE_FETCH_CONFIG(VG1), vg_cfg); in mdp4_hw_init()
54 mdp4_write(mdp4_kms, REG_MDP4_PIPE_FETCH_CONFIG(VG2), vg_cfg); in mdp4_hw_init()
55 mdp4_write(mdp4_kms, REG_MDP4_PIPE_FETCH_CONFIG(RGB1), vg_cfg); in mdp4_hw_init()
56 mdp4_write(mdp4_kms, REG_MDP4_PIPE_FETCH_CONFIG(RGB2), vg_cfg); in mdp4_hw_init()
58 if (mdp4_kms->rev >= 2) in mdp4_hw_init()
59 mdp4_write(mdp4_kms, REG_MDP4_LAYERMIXER_IN_CFG_UPDATE_METHOD, 1); in mdp4_hw_init()
60 mdp4_write(mdp4_kms, REG_MDP4_LAYERMIXER_IN_CFG, 0); in mdp4_hw_init()
63 mdp4_write(mdp4_kms, REG_MDP4_PIPE_OP_MODE(VG1), 0); in mdp4_hw_init()
64 mdp4_write(mdp4_kms, REG_MDP4_PIPE_OP_MODE(VG2), 0); in mdp4_hw_init()
65 mdp4_write(mdp4_kms, REG_MDP4_DMA_P_OP_MODE, 0); in mdp4_hw_init()
66 mdp4_write(mdp4_kms, REG_MDP4_DMA_S_OP_MODE, 0); in mdp4_hw_init()
67 mdp4_write(mdp4_kms, REG_MDP4_OVLP_CSC_CONFIG(1), 0); in mdp4_hw_init()
68 mdp4_write(mdp4_kms, REG_MDP4_OVLP_CSC_CONFIG(2), 0); in mdp4_hw_init()
70 if (mdp4_kms->rev > 1) in mdp4_hw_init()
71 mdp4_write(mdp4_kms, REG_MDP4_RESET_STATUS, 1); in mdp4_hw_init()
80 struct mdp4_kms *mdp4_kms = to_mdp4_kms(to_mdp_kms(kms)); in mdp4_enable_commit() local
81 mdp4_enable(mdp4_kms); in mdp4_enable_commit()
86 struct mdp4_kms *mdp4_kms = to_mdp4_kms(to_mdp_kms(kms)); in mdp4_disable_commit() local
87 mdp4_disable(mdp4_kms); in mdp4_disable_commit()
101 struct mdp4_kms *mdp4_kms = to_mdp4_kms(to_mdp_kms(kms)); in mdp4_wait_flush() local
104 for_each_crtc_mask(mdp4_kms->dev, crtc, crtc_mask) in mdp4_wait_flush()
128 struct mdp4_kms *mdp4_kms = to_mdp4_kms(to_mdp_kms(kms)); in mdp4_destroy() local
129 struct device *dev = mdp4_kms->dev->dev; in mdp4_destroy()
132 if (mdp4_kms->blank_cursor_iova) in mdp4_destroy()
133 msm_gem_unpin_iova(mdp4_kms->blank_cursor_bo, kms->aspace); in mdp4_destroy()
134 drm_gem_object_put(mdp4_kms->blank_cursor_bo); in mdp4_destroy()
141 if (mdp4_kms->rpm_enabled) in mdp4_destroy()
144 mdp_kms_destroy(&mdp4_kms->base); in mdp4_destroy()
146 kfree(mdp4_kms); in mdp4_destroy()
171 int mdp4_disable(struct mdp4_kms *mdp4_kms) in mdp4_disable() argument
175 clk_disable_unprepare(mdp4_kms->clk); in mdp4_disable()
176 if (mdp4_kms->pclk) in mdp4_disable()
177 clk_disable_unprepare(mdp4_kms->pclk); in mdp4_disable()
178 if (mdp4_kms->lut_clk) in mdp4_disable()
179 clk_disable_unprepare(mdp4_kms->lut_clk); in mdp4_disable()
180 if (mdp4_kms->axi_clk) in mdp4_disable()
181 clk_disable_unprepare(mdp4_kms->axi_clk); in mdp4_disable()
186 int mdp4_enable(struct mdp4_kms *mdp4_kms) in mdp4_enable() argument
190 clk_prepare_enable(mdp4_kms->clk); in mdp4_enable()
191 if (mdp4_kms->pclk) in mdp4_enable()
192 clk_prepare_enable(mdp4_kms->pclk); in mdp4_enable()
193 if (mdp4_kms->lut_clk) in mdp4_enable()
194 clk_prepare_enable(mdp4_kms->lut_clk); in mdp4_enable()
195 if (mdp4_kms->axi_clk) in mdp4_enable()
196 clk_prepare_enable(mdp4_kms->axi_clk); in mdp4_enable()
202 static int mdp4_modeset_init_intf(struct mdp4_kms *mdp4_kms, in mdp4_modeset_init_intf() argument
205 struct drm_device *dev = mdp4_kms->dev; in mdp4_modeset_init_intf()
301 static int modeset_init(struct mdp4_kms *mdp4_kms) in modeset_init() argument
303 struct drm_device *dev = mdp4_kms->dev; in modeset_init()
370 ret = mdp4_modeset_init_intf(mdp4_kms, mdp4_intfs[i]); in modeset_init()
384 static void read_mdp_hw_revision(struct mdp4_kms *mdp4_kms, in read_mdp_hw_revision() argument
387 struct drm_device *dev = mdp4_kms->dev; in read_mdp_hw_revision()
390 mdp4_enable(mdp4_kms); in read_mdp_hw_revision()
391 version = mdp4_read(mdp4_kms, REG_MDP4_VERSION); in read_mdp_hw_revision()
392 mdp4_disable(mdp4_kms); in read_mdp_hw_revision()
405 struct mdp4_kms *mdp4_kms; in mdp4_kms_init() local
411 mdp4_kms = kzalloc(sizeof(*mdp4_kms), GFP_KERNEL); in mdp4_kms_init()
412 if (!mdp4_kms) { in mdp4_kms_init()
418 ret = mdp_kms_init(&mdp4_kms->base, &kms_funcs); in mdp4_kms_init()
424 priv->kms = &mdp4_kms->base.base; in mdp4_kms_init()
427 mdp4_kms->dev = dev; in mdp4_kms_init()
429 mdp4_kms->mmio = msm_ioremap(pdev, NULL, "MDP4"); in mdp4_kms_init()
430 if (IS_ERR(mdp4_kms->mmio)) { in mdp4_kms_init()
431 ret = PTR_ERR(mdp4_kms->mmio); in mdp4_kms_init()
448 mdp4_kms->vdd = devm_regulator_get_exclusive(&pdev->dev, "vdd"); in mdp4_kms_init()
449 if (IS_ERR(mdp4_kms->vdd)) in mdp4_kms_init()
450 mdp4_kms->vdd = NULL; in mdp4_kms_init()
452 if (mdp4_kms->vdd) { in mdp4_kms_init()
453 ret = regulator_enable(mdp4_kms->vdd); in mdp4_kms_init()
460 mdp4_kms->clk = devm_clk_get(&pdev->dev, "core_clk"); in mdp4_kms_init()
461 if (IS_ERR(mdp4_kms->clk)) { in mdp4_kms_init()
463 ret = PTR_ERR(mdp4_kms->clk); in mdp4_kms_init()
467 mdp4_kms->pclk = devm_clk_get(&pdev->dev, "iface_clk"); in mdp4_kms_init()
468 if (IS_ERR(mdp4_kms->pclk)) in mdp4_kms_init()
469 mdp4_kms->pclk = NULL; in mdp4_kms_init()
471 mdp4_kms->axi_clk = devm_clk_get(&pdev->dev, "bus_clk"); in mdp4_kms_init()
472 if (IS_ERR(mdp4_kms->axi_clk)) { in mdp4_kms_init()
474 ret = PTR_ERR(mdp4_kms->axi_clk); in mdp4_kms_init()
478 clk_set_rate(mdp4_kms->clk, config->max_clk); in mdp4_kms_init()
480 read_mdp_hw_revision(mdp4_kms, &major, &minor); in mdp4_kms_init()
489 mdp4_kms->rev = minor; in mdp4_kms_init()
491 if (mdp4_kms->rev >= 2) { in mdp4_kms_init()
492 mdp4_kms->lut_clk = devm_clk_get(&pdev->dev, "lut_clk"); in mdp4_kms_init()
493 if (IS_ERR(mdp4_kms->lut_clk)) { in mdp4_kms_init()
495 ret = PTR_ERR(mdp4_kms->lut_clk); in mdp4_kms_init()
498 clk_set_rate(mdp4_kms->lut_clk, config->max_clk); in mdp4_kms_init()
502 mdp4_kms->rpm_enabled = true; in mdp4_kms_init()
508 mdp4_enable(mdp4_kms); in mdp4_kms_init()
509 mdp4_write(mdp4_kms, REG_MDP4_DTV_ENABLE, 0); in mdp4_kms_init()
510 mdp4_write(mdp4_kms, REG_MDP4_LCDC_ENABLE, 0); in mdp4_kms_init()
511 mdp4_write(mdp4_kms, REG_MDP4_DSI_ENABLE, 0); in mdp4_kms_init()
512 mdp4_disable(mdp4_kms); in mdp4_kms_init()
536 ret = modeset_init(mdp4_kms); in mdp4_kms_init()
542 mdp4_kms->blank_cursor_bo = msm_gem_new(dev, SZ_16K, MSM_BO_WC | MSM_BO_SCANOUT); in mdp4_kms_init()
543 if (IS_ERR(mdp4_kms->blank_cursor_bo)) { in mdp4_kms_init()
544 ret = PTR_ERR(mdp4_kms->blank_cursor_bo); in mdp4_kms_init()
546 mdp4_kms->blank_cursor_bo = NULL; in mdp4_kms_init()
550 ret = msm_gem_get_and_pin_iova(mdp4_kms->blank_cursor_bo, kms->aspace, in mdp4_kms_init()
551 &mdp4_kms->blank_cursor_iova); in mdp4_kms_init()