static void mdp4_crtc_err_irq(struct mdp_irq *irq, uint32_t irqstatus) { struct mdp4_crtc *mdp4_crtc = container_of(irq, struct mdp4_crtc, err); struct drm_crtc *crtc = &mdp4_crtc->base; DBG("%s: error: %08x", mdp4_crtc->name, irqstatus); crtc_flush(crtc); }
static void mdp4_crtc_commit(struct drm_crtc *crtc) { mdp4_crtc_dpms(crtc, DRM_MODE_DPMS_ON); crtc_flush(crtc); /* drop the ref to mdp clk's that we got in prepare: */ mdp4_disable(get_kms(crtc)); }
static void set_attach(struct drm_crtc *crtc, enum mdp4_pipe pipe_id, struct drm_plane *plane) { struct mdp4_crtc *mdp4_crtc = to_mdp4_crtc(crtc); BUG_ON(pipe_id >= ARRAY_SIZE(mdp4_crtc->planes)); if (mdp4_crtc->planes[pipe_id] == plane) return; mdp4_crtc->planes[pipe_id] = plane; blend_setup(crtc); if (mdp4_crtc->enabled && (plane != mdp4_crtc->plane)) crtc_flush(crtc); }
static int mdp4_crtc_cursor_move(struct drm_crtc *crtc, int x, int y) { struct mdp4_crtc *mdp4_crtc = to_mdp4_crtc(crtc); unsigned long flags; spin_lock_irqsave(&mdp4_crtc->cursor.lock, flags); mdp4_crtc->cursor.x = x; mdp4_crtc->cursor.y = y; spin_unlock_irqrestore(&mdp4_crtc->cursor.lock, flags); crtc_flush(crtc); request_pending(crtc, PENDING_CURSOR); return 0; }
static void pageflip_cb(struct msm_fence_cb *cb) { struct mdp4_crtc *mdp4_crtc = container_of(cb, struct mdp4_crtc, pageflip_cb); struct drm_crtc *crtc = &mdp4_crtc->base; struct drm_framebuffer *fb = crtc->fb; if (!fb) return; mdp4_plane_set_scanout(mdp4_crtc->plane, fb); crtc_flush(crtc); /* enable vblank to complete flip: */ request_pending(crtc, PENDING_FLIP); }
/* unlike update_fb(), take a ref to the new scanout fb *before* updating * plane, then call this. Needed to ensure we don't unref the buffer that * is actually still being scanned out. * * Note that this whole thing goes away with atomic.. since we can defer * calling into driver until rendering is done. */ static void update_scanout(struct drm_crtc *crtc, struct drm_framebuffer *fb) { struct mdp4_crtc *mdp4_crtc = to_mdp4_crtc(crtc); /* flush updates, to make sure hw is updated to new scanout fb, * so that we can safely queue unref to current fb (ie. next * vblank we know hw is done w/ previous scanout_fb). */ crtc_flush(crtc); if (mdp4_crtc->scanout_fb) drm_flip_work_queue(&mdp4_crtc->unref_fb_work, mdp4_crtc->scanout_fb); mdp4_crtc->scanout_fb = fb; /* enable vblank to complete flip: */ request_pending(crtc, PENDING_FLIP); }