Searched refs:rcdu (Results 1 - 19 of 19) sorted by relevance

/linux-4.4.14/drivers/gpu/drm/rcar-du/
H A Drcar_du_drv.c149 struct rcar_du_device *rcdu = dev->dev_private; rcar_du_unload() local
151 if (rcdu->fbdev) rcar_du_unload()
152 drm_fbdev_cma_fini(rcdu->fbdev); rcar_du_unload()
168 struct rcar_du_device *rcdu; rcar_du_load() local
177 rcdu = devm_kzalloc(&pdev->dev, sizeof(*rcdu), GFP_KERNEL); rcar_du_load()
178 if (rcdu == NULL) { rcar_du_load()
183 init_waitqueue_head(&rcdu->commit.wait); rcar_du_load()
185 rcdu->dev = &pdev->dev; rcar_du_load()
186 rcdu->info = of_match_device(rcar_du_of_table, rcdu->dev)->data; rcar_du_load()
187 rcdu->ddev = dev; rcar_du_load()
188 dev->dev_private = rcdu; rcar_du_load()
192 rcdu->mmio = devm_ioremap_resource(&pdev->dev, mem); rcar_du_load()
193 if (IS_ERR(rcdu->mmio)) rcar_du_load()
194 return PTR_ERR(rcdu->mmio); rcar_du_load()
199 ret = drm_vblank_init(dev, (1 << rcdu->info->num_crtcs) - 1); rcar_du_load()
206 ret = rcar_du_modeset_init(rcdu); rcar_du_load()
214 platform_set_drvdata(pdev, rcdu); rcar_du_load()
225 struct rcar_du_device *rcdu = dev->dev_private; rcar_du_preclose() local
228 for (i = 0; i < rcdu->num_crtcs; ++i) rcar_du_preclose()
229 rcar_du_crtc_cancel_page_flip(&rcdu->crtcs[i], file); rcar_du_preclose()
234 struct rcar_du_device *rcdu = dev->dev_private; rcar_du_lastclose() local
236 drm_fbdev_cma_restore_mode(rcdu->fbdev); rcar_du_lastclose()
241 struct rcar_du_device *rcdu = dev->dev_private; rcar_du_enable_vblank() local
243 rcar_du_crtc_enable_vblank(&rcdu->crtcs[pipe], true); rcar_du_enable_vblank()
250 struct rcar_du_device *rcdu = dev->dev_private; rcar_du_disable_vblank() local
252 rcar_du_crtc_enable_vblank(&rcdu->crtcs[pipe], false); rcar_du_disable_vblank()
309 struct rcar_du_device *rcdu = dev_get_drvdata(dev); rcar_du_pm_suspend() local
311 drm_kms_helper_poll_disable(rcdu->ddev); rcar_du_pm_suspend()
319 struct rcar_du_device *rcdu = dev_get_drvdata(dev); rcar_du_pm_resume() local
323 drm_kms_helper_poll_enable(rcdu->ddev); rcar_du_pm_resume()
343 struct rcar_du_device *rcdu = platform_get_drvdata(pdev); rcar_du_remove() local
345 drm_put_dev(rcdu->ddev); rcar_du_remove()
H A Drcar_du_kms.c120 struct rcar_du_device *rcdu = dev->dev_private; rcar_du_dumb_create() local
127 if (rcar_du_needs(rcdu, RCAR_DU_QUIRK_ALIGN_128B)) rcar_du_dumb_create()
141 struct rcar_du_device *rcdu = dev->dev_private; rcar_du_fb_create() local
161 if (rcar_du_needs(rcdu, RCAR_DU_QUIRK_ALIGN_128B)) rcar_du_fb_create()
186 struct rcar_du_device *rcdu = dev->dev_private; rcar_du_output_poll_changed() local
188 drm_fbdev_cma_hotplug_event(rcdu->fbdev); rcar_du_output_poll_changed()
265 struct rcar_du_device *rcdu = dev->dev_private; rcar_du_atomic_check() local
289 dev_dbg(rcdu->dev, "%s: checking plane (%u,%u)\n", __func__, rcar_du_atomic_check()
297 dev_dbg(rcdu->dev, "%s: plane is being disabled\n", rcar_du_atomic_check()
309 dev_dbg(rcdu->dev, "%s: plane needs reallocation\n", rcar_du_atomic_check()
333 struct rcar_du_group *group = &rcdu->groups[index]; rcar_du_atomic_check()
336 dev_dbg(rcdu->dev, "%s: finding free planes for group %u\n", rcar_du_atomic_check()
356 dev_dbg(rcdu->dev, rcar_du_atomic_check()
366 dev_dbg(rcdu->dev, rcar_du_atomic_check()
378 dev_dbg(rcdu->dev, "%s: group %u free planes mask 0x%02x\n", rcar_du_atomic_check()
396 dev_dbg(rcdu->dev, "%s: allocating plane (%u,%u)\n", __func__, rcar_du_atomic_check()
422 dev_dbg(rcdu->dev, "%s: no available hardware plane\n", rcar_du_atomic_check()
427 dev_dbg(rcdu->dev, "%s: allocated %u hwplanes (index %u)\n", rcar_du_atomic_check()
435 dev_dbg(rcdu->dev, "%s: group %u free planes mask 0x%02x\n", rcar_du_atomic_check()
453 struct rcar_du_device *rcdu = dev->dev_private; rcar_du_atomic_complete() local
468 spin_lock(&rcdu->commit.wait.lock); rcar_du_atomic_complete()
469 rcdu->commit.pending &= ~commit->crtcs; rcar_du_atomic_complete()
470 wake_up_all_locked(&rcdu->commit.wait); rcar_du_atomic_complete()
471 spin_unlock(&rcdu->commit.wait.lock); rcar_du_atomic_complete()
487 struct rcar_du_device *rcdu = dev->dev_private; rcar_du_atomic_commit() local
515 spin_lock(&rcdu->commit.wait.lock); rcar_du_atomic_commit()
516 ret = wait_event_interruptible_locked(rcdu->commit.wait, rcar_du_atomic_commit()
517 !(rcdu->commit.pending & commit->crtcs)); rcar_du_atomic_commit()
519 rcdu->commit.pending |= commit->crtcs; rcar_du_atomic_commit()
520 spin_unlock(&rcdu->commit.wait.lock); rcar_du_atomic_commit()
553 static int rcar_du_encoders_init_one(struct rcar_du_device *rcdu, rcar_du_encoders_init_one() argument
580 dev_dbg(rcdu->dev, "unconnected endpoint %s, skipping\n", rcar_du_encoders_init_one()
600 dev_warn(rcdu->dev, for_each_endpoint_of_node()
629 dev_warn(rcdu->dev,
644 ret = rcar_du_encoder_init(rcdu, enc_type, output, encoder, connector);
649 dev_warn(rcdu->dev,
656 static int rcar_du_encoders_init(struct rcar_du_device *rcdu) rcar_du_encoders_init() argument
658 struct device_node *np = rcdu->dev->of_node; rcar_du_encoders_init()
680 if (rcdu->info->routes[i].possible_crtcs && for_each_endpoint_of_node()
681 rcdu->info->routes[i].port == ep.port) { for_each_endpoint_of_node()
688 dev_warn(rcdu->dev, for_each_endpoint_of_node()
695 ret = rcar_du_encoders_init_one(rcdu, output, &ep); for_each_endpoint_of_node()
711 static int rcar_du_properties_init(struct rcar_du_device *rcdu) rcar_du_properties_init() argument
713 rcdu->props.alpha = rcar_du_properties_init()
714 drm_property_create_range(rcdu->ddev, 0, "alpha", 0, 255); rcar_du_properties_init()
715 if (rcdu->props.alpha == NULL) rcar_du_properties_init()
722 rcdu->props.colorkey = rcar_du_properties_init()
723 drm_property_create_range(rcdu->ddev, 0, "colorkey", rcar_du_properties_init()
725 if (rcdu->props.colorkey == NULL) rcar_du_properties_init()
728 rcdu->props.zpos = rcar_du_properties_init()
729 drm_property_create_range(rcdu->ddev, 0, "zpos", 1, 7); rcar_du_properties_init()
730 if (rcdu->props.zpos == NULL) rcar_du_properties_init()
736 int rcar_du_modeset_init(struct rcar_du_device *rcdu) rcar_du_modeset_init() argument
742 struct drm_device *dev = rcdu->ddev; rcar_du_modeset_init()
758 rcdu->num_crtcs = rcdu->info->num_crtcs; rcar_du_modeset_init()
760 ret = rcar_du_properties_init(rcdu); rcar_du_modeset_init()
765 num_groups = DIV_ROUND_UP(rcdu->num_crtcs, 2); rcar_du_modeset_init()
768 struct rcar_du_group *rgrp = &rcdu->groups[i]; rcar_du_modeset_init()
772 rgrp->dev = rcdu; rcar_du_modeset_init()
775 rgrp->num_crtcs = min(rcdu->num_crtcs - 2 * i, 2U); rcar_du_modeset_init()
789 for (i = 0; i < rcdu->num_crtcs; ++i) { rcar_du_modeset_init()
790 struct rcar_du_group *rgrp = &rcdu->groups[i / 2]; rcar_du_modeset_init()
798 ret = rcar_du_lvdsenc_init(rcdu); rcar_du_modeset_init()
802 ret = rcar_du_encoders_init(rcdu); rcar_du_modeset_init()
807 dev_err(rcdu->dev, "error: no encoder could be initialized\n"); rcar_du_modeset_init()
820 &rcdu->info->routes[renc->output]; rcar_du_modeset_init()
836 rcdu->fbdev = fbdev; rcar_du_modeset_init()
838 dev_info(rcdu->dev, rcar_du_modeset_init()
H A Drcar_du_drv.h101 static inline bool rcar_du_has(struct rcar_du_device *rcdu, rcar_du_has() argument
104 return rcdu->info->features & feature; rcar_du_has()
107 static inline bool rcar_du_needs(struct rcar_du_device *rcdu, rcar_du_needs() argument
110 return rcdu->info->quirks & quirk; rcar_du_needs()
113 static inline u32 rcar_du_read(struct rcar_du_device *rcdu, u32 reg) rcar_du_read() argument
115 return ioread32(rcdu->mmio + reg); rcar_du_read()
118 static inline void rcar_du_write(struct rcar_du_device *rcdu, u32 reg, u32 data) rcar_du_write() argument
120 iowrite32(data, rcdu->mmio + reg); rcar_du_write()
H A Drcar_du_hdmicon.h21 int rcar_du_hdmi_connector_init(struct rcar_du_device *rcdu,
24 static inline int rcar_du_hdmi_connector_init(struct rcar_du_device *rcdu, rcar_du_hdmi_connector_init() argument
H A Drcar_du_hdmienc.h24 int rcar_du_hdmienc_init(struct rcar_du_device *rcdu,
27 static inline int rcar_du_hdmienc_init(struct rcar_du_device *rcdu, rcar_du_hdmienc_init() argument
H A Drcar_du_crtc.c34 struct rcar_du_device *rcdu = rcrtc->group->dev; rcar_du_crtc_read() local
36 return rcar_du_read(rcdu, rcrtc->mmio_offset + reg); rcar_du_crtc_read()
41 struct rcar_du_device *rcdu = rcrtc->group->dev; rcar_du_crtc_write() local
43 rcar_du_write(rcdu, rcrtc->mmio_offset + reg, data); rcar_du_crtc_write()
48 struct rcar_du_device *rcdu = rcrtc->group->dev; rcar_du_crtc_clr() local
50 rcar_du_write(rcdu, rcrtc->mmio_offset + reg, rcar_du_crtc_clr()
51 rcar_du_read(rcdu, rcrtc->mmio_offset + reg) & ~clr); rcar_du_crtc_clr()
56 struct rcar_du_device *rcdu = rcrtc->group->dev; rcar_du_crtc_set() local
58 rcar_du_write(rcdu, rcrtc->mmio_offset + reg, rcar_du_crtc_set()
59 rcar_du_read(rcdu, rcrtc->mmio_offset + reg) | set); rcar_du_crtc_set()
65 struct rcar_du_device *rcdu = rcrtc->group->dev; rcar_du_crtc_clr_set() local
66 u32 value = rcar_du_read(rcdu, rcrtc->mmio_offset + reg); rcar_du_crtc_clr_set()
68 rcar_du_write(rcdu, rcrtc->mmio_offset + reg, (value & ~clr) | set); rcar_du_crtc_clr_set()
182 struct rcar_du_device *rcdu = rcrtc->group->dev; rcar_du_crtc_route_output() local
193 rcdu->dpad0_source = rcrtc->index; rcar_du_crtc_route_output()
342 struct rcar_du_device *rcdu = rcrtc->group->dev; rcar_du_crtc_wait_page_flip() local
349 dev_warn(rcdu->dev, "page flip timeout\n"); rcar_du_crtc_wait_page_flip()
573 struct rcar_du_device *rcdu = rgrp->dev; rcar_du_crtc_create() local
574 struct platform_device *pdev = to_platform_device(rcdu->dev); rcar_du_crtc_create()
575 struct rcar_du_crtc *rcrtc = &rcdu->crtcs[index]; rcar_du_crtc_create()
585 if (rcar_du_has(rcdu, RCAR_DU_FEATURE_CRTC_IRQ_CLOCK)) { rcar_du_crtc_create()
592 rcrtc->clock = devm_clk_get(rcdu->dev, name); rcar_du_crtc_create()
594 dev_err(rcdu->dev, "no clock for CRTC %u\n", index); rcar_du_crtc_create()
599 clk = devm_clk_get(rcdu->dev, clk_name); rcar_du_crtc_create()
603 dev_info(rcdu->dev, "can't get external clock %u\n", index); rcar_du_crtc_create()
614 ret = drm_crtc_init_with_planes(rcdu->ddev, crtc, rcar_du_crtc_create()
626 if (rcar_du_has(rcdu, RCAR_DU_FEATURE_CRTC_IRQ_CLOCK)) { rcar_du_crtc_create()
635 dev_err(rcdu->dev, "no IRQ for CRTC %u\n", index); rcar_du_crtc_create()
639 ret = devm_request_irq(rcdu->dev, irq, rcar_du_crtc_irq, irqflags, rcar_du_crtc_create()
640 dev_name(rcdu->dev), rcrtc); rcar_du_crtc_create()
642 dev_err(rcdu->dev, rcar_du_crtc_create()
H A Drcar_du_encoder.c122 int rcar_du_encoder_init(struct rcar_du_device *rcdu, rcar_du_encoder_init() argument
133 renc = devm_kzalloc(rcdu->dev, sizeof(*renc), GFP_KERNEL); rcar_du_encoder_init()
142 renc->lvds = rcdu->lvds[0]; rcar_du_encoder_init()
146 renc->lvds = rcdu->lvds[1]; rcar_du_encoder_init()
166 encoder_type = rcdu->info->routes[output].encoder_type; rcar_du_encoder_init()
171 ret = rcar_du_hdmienc_init(rcdu, renc, enc_node); rcar_du_encoder_init()
175 ret = drm_encoder_init(rcdu->ddev, encoder, &encoder_funcs, rcar_du_encoder_init()
185 ret = rcar_du_lvds_connector_init(rcdu, renc, con_node); rcar_du_encoder_init()
189 ret = rcar_du_vga_connector_init(rcdu, renc); rcar_du_encoder_init()
193 ret = rcar_du_hdmi_connector_init(rcdu, renc); rcar_du_encoder_init()
205 devm_kfree(rcdu->dev, renc); rcar_du_encoder_init()
H A Drcar_du_vgacon.c56 int rcar_du_vga_connector_init(struct rcar_du_device *rcdu, rcar_du_vga_connector_init() argument
64 rcon = devm_kzalloc(rcdu->dev, sizeof(*rcon), GFP_KERNEL); rcar_du_vga_connector_init()
73 ret = drm_connector_init(rcdu->ddev, connector, &connector_funcs, rcar_du_vga_connector_init()
85 rcdu->ddev->mode_config.dpms_property, DRM_MODE_DPMS_OFF); rcar_du_vga_connector_init()
H A Drcar_du_plane.c239 struct rcar_du_device *rcdu = rplane->group->dev; rcar_du_plane_atomic_check() local
248 dev_dbg(rcdu->dev, "%s: scaling not supported\n", __func__); rcar_du_plane_atomic_check()
254 dev_dbg(rcdu->dev, "%s: unsupported format %08x\n", __func__, rcar_du_plane_atomic_check()
330 struct rcar_du_device *rcdu = to_rcar_plane(plane)->group->dev; rcar_du_plane_atomic_set_property() local
332 if (property == rcdu->props.alpha) rcar_du_plane_atomic_set_property()
334 else if (property == rcdu->props.colorkey) rcar_du_plane_atomic_set_property()
336 else if (property == rcdu->props.zpos) rcar_du_plane_atomic_set_property()
350 struct rcar_du_device *rcdu = to_rcar_plane(plane)->group->dev; rcar_du_plane_atomic_get_property() local
352 if (property == rcdu->props.alpha) rcar_du_plane_atomic_get_property()
354 else if (property == rcdu->props.colorkey) rcar_du_plane_atomic_get_property()
356 else if (property == rcdu->props.zpos) rcar_du_plane_atomic_get_property()
391 struct rcar_du_device *rcdu = rgrp->dev; rcar_du_planes_init() local
401 crtcs = ((1 << rcdu->num_crtcs) - 1) & (3 << (2 * rgrp->index)); rcar_du_planes_init()
411 ret = drm_universal_plane_init(rcdu->ddev, &plane->plane, crtcs, rcar_du_planes_init()
424 rcdu->props.alpha, 255); rcar_du_planes_init()
426 rcdu->props.colorkey, rcar_du_planes_init()
429 rcdu->props.zpos, 1); rcar_du_planes_init()
H A Drcar_du_lvdsenc.h30 int rcar_du_lvdsenc_init(struct rcar_du_device *rcdu);
34 static inline int rcar_du_lvdsenc_init(struct rcar_du_device *rcdu) rcar_du_lvdsenc_init() argument
H A Drcar_du_hdmicon.c87 int rcar_du_hdmi_connector_init(struct rcar_du_device *rcdu, rcar_du_hdmi_connector_init() argument
95 rcon = devm_kzalloc(rcdu->dev, sizeof(*rcon), GFP_KERNEL); rcar_du_hdmi_connector_init()
105 ret = drm_connector_init(rcdu->ddev, connector, &connector_funcs, rcar_du_hdmi_connector_init()
117 rcdu->ddev->mode_config.dpms_property, DRM_MODE_DPMS_OFF); rcar_du_hdmi_connector_init()
H A Drcar_du_lvdscon.c87 int rcar_du_lvds_connector_init(struct rcar_du_device *rcdu, rcar_du_lvds_connector_init() argument
97 lvdscon = devm_kzalloc(rcdu->dev, sizeof(*lvdscon), GFP_KERNEL); rcar_du_lvds_connector_init()
114 ret = drm_connector_init(rcdu->ddev, connector, &connector_funcs, rcar_du_lvds_connector_init()
126 rcdu->ddev->mode_config.dpms_property, DRM_MODE_DPMS_OFF); rcar_du_lvds_connector_init()
H A Drcar_du_lvdscon.h20 int rcar_du_lvds_connector_init(struct rcar_du_device *rcdu,
H A Drcar_du_vgacon.h20 int rcar_du_vga_connector_init(struct rcar_du_device *rcdu,
H A Drcar_du_hdmienc.c122 int rcar_du_hdmienc_init(struct rcar_du_device *rcdu, rcar_du_hdmienc_init() argument
131 hdmienc = devm_kzalloc(rcdu->dev, sizeof(*hdmienc), GFP_KERNEL); rcar_du_hdmienc_init()
149 ret = driver->encoder_init(i2c_slave, rcdu->ddev, &renc->slave); rcar_du_hdmienc_init()
153 ret = drm_encoder_init(rcdu->ddev, encoder, &encoder_funcs, rcar_du_hdmienc_init()
H A Drcar_du_kms.h34 int rcar_du_modeset_init(struct rcar_du_device *rcdu);
H A Drcar_du_lvdsenc.c165 int rcar_du_lvdsenc_init(struct rcar_du_device *rcdu) rcar_du_lvdsenc_init() argument
167 struct platform_device *pdev = to_platform_device(rcdu->dev); rcar_du_lvdsenc_init()
172 for (i = 0; i < rcdu->info->num_lvds; ++i) { rcar_du_lvdsenc_init()
179 lvds->dev = rcdu; rcar_du_lvdsenc_init()
188 rcdu->lvds[i] = lvds; rcar_du_lvdsenc_init()
H A Drcar_du_encoder.h55 int rcar_du_encoder_init(struct rcar_du_device *rcdu,
H A Drcar_du_group.c165 static int rcar_du_set_dpad0_routing(struct rcar_du_device *rcdu) rcar_du_set_dpad0_routing() argument
169 if (!rcar_du_has(rcdu, RCAR_DU_FEATURE_EXT_CTRL_REGS)) rcar_du_set_dpad0_routing()
177 ret = clk_prepare_enable(rcdu->crtcs[0].clock); rcar_du_set_dpad0_routing()
181 rcar_du_group_setup_defr8(&rcdu->groups[0]); rcar_du_set_dpad0_routing()
183 clk_disable_unprepare(rcdu->crtcs[0].clock); rcar_du_set_dpad0_routing()

Completed in 145 milliseconds