static void omap_crtc_dpms(struct drm_crtc *crtc, int mode) { struct omap_drm_private *priv = crtc->dev->dev_private; struct omap_crtc *omap_crtc = to_omap_crtc(crtc); int i; WARN_ON(omap_plane_dpms(omap_crtc->plane, mode)); for (i = 0; i < priv->num_planes; i++) { struct drm_plane *plane = priv->planes[i]; if (plane->crtc == crtc) WARN_ON(omap_plane_dpms(plane, mode)); } }
static int omap_plane_update(struct drm_plane *plane, struct drm_crtc *crtc, struct drm_framebuffer *fb, int crtc_x, int crtc_y, unsigned int crtc_w, unsigned int crtc_h, uint32_t src_x, uint32_t src_y, uint32_t src_w, uint32_t src_h) { omap_plane_mode_set(plane, crtc, fb, crtc_x, crtc_y, crtc_w, crtc_h, src_x, src_y, src_w, src_h); return omap_plane_dpms(plane, DRM_MODE_DPMS_ON); }
/* when CRTC that we are attached to has potentially changed, this checks * if we are attached to proper manager, and if necessary updates. */ static void update_manager(struct drm_plane *plane) { struct omap_drm_private *priv = plane->dev->dev_private; struct omap_plane *omap_plane = to_omap_plane(plane); struct omap_overlay *ovl = omap_plane->ovl; struct omap_overlay_manager *mgr = NULL; int i; if (plane->crtc) { for (i = 0; i < priv->num_encoders; i++) { struct drm_encoder *encoder = priv->encoders[i]; if (encoder->crtc == plane->crtc) { mgr = omap_encoder_get_manager(encoder); break; } } } if (ovl->manager != mgr) { bool enabled = ovl->is_enabled(ovl); /* don't switch things around with enabled overlays: */ if (enabled) omap_plane_dpms(plane, DRM_MODE_DPMS_OFF); if (ovl->manager) { DBG("disconnecting %s from %s", ovl->name, ovl->manager->name); ovl->unset_manager(ovl); } if (mgr) { DBG("connecting %s to %s", ovl->name, mgr->name); ovl->set_manager(ovl, mgr); } if (enabled && mgr) omap_plane_dpms(plane, DRM_MODE_DPMS_ON); } }
/* update parameters that are dependent on the framebuffer dimensions and * position within the fb that this plane scans out from. This is called * when framebuffer or x,y base may have changed. */ static void update_scanout(struct drm_plane *plane) { struct omap_plane *omap_plane = to_omap_plane(plane); struct omap_overlay_info *info = &omap_plane->info; int ret; ret = update_pin(plane, plane->fb); if (ret) { dev_err(plane->dev->dev, "could not pin fb: %d\n", ret); omap_plane_dpms(plane, DRM_MODE_DPMS_OFF); return; } omap_framebuffer_update_scanout(plane->fb, omap_plane->src_x, omap_plane->src_y, info); DBG("%s: %d,%d: %08x %08x (%d)", omap_plane->ovl->name, omap_plane->src_x, omap_plane->src_y, (u32)info->paddr, (u32)info->p_uv_addr, info->screen_width); }
static int omap_plane_disable(struct drm_plane *plane) { struct omap_plane *omap_plane = to_omap_plane(plane); omap_plane->win.rotation = BIT(DRM_ROTATE_0); return omap_plane_dpms(plane, DRM_MODE_DPMS_OFF); }
static int omap_plane_disable(struct drm_plane *plane) { return omap_plane_dpms(plane, DRM_MODE_DPMS_OFF); }