static void exynos_drm_crtc_apply(struct drm_crtc *crtc)
{
    struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc);
    struct exynos_drm_overlay *overlay = &exynos_crtc->overlay;

    exynos_drm_fn_encoder(crtc, overlay,
                          exynos_drm_encoder_crtc_mode_set);
    exynos_drm_fn_encoder(crtc, &exynos_crtc->pipe,
                          exynos_drm_encoder_crtc_commit);
}
static int
exynos_drm_crtc_mode_set(struct drm_crtc *crtc, struct drm_display_mode *mode,
                         struct drm_display_mode *adjusted_mode, int x, int y,
                         struct drm_framebuffer *old_fb)
{
    struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc);
    struct drm_plane *plane = exynos_crtc->plane;
    unsigned int crtc_w;
    unsigned int crtc_h;
    int pipe = exynos_crtc->pipe;
    int ret;

    /*
     * copy the mode data adjusted by mode_fixup() into crtc->mode
     * so that hardware can be seet to proper mode.
     */
    memcpy(&crtc->mode, adjusted_mode, sizeof(*adjusted_mode));

    crtc_w = crtc->primary->fb->width - x;
    crtc_h = crtc->primary->fb->height - y;

    ret = exynos_plane_mode_set(plane, crtc, crtc->primary->fb, 0, 0, crtc_w, crtc_h,
                                x, y, crtc_w, crtc_h);
    if (ret)
        return ret;

    plane->crtc = crtc;
    plane->fb = crtc->primary->fb;

    exynos_drm_fn_encoder(crtc, &pipe, exynos_drm_encoder_crtc_pipe);

    return 0;
}
Beispiel #3
0
static void exynos_drm_crtc_dpms(struct drm_crtc *crtc, int mode)
{
	struct drm_device *dev = crtc->dev;
	struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc);

	DRM_DEBUG_KMS("crtc[%d] mode[%d]\n", crtc->base.id, mode);

	if (exynos_crtc->dpms == mode) {
		DRM_DEBUG_KMS("desired dpms mode is same as previous one.\n");
		return;
	}

	mutex_lock(&dev->struct_mutex);

	exynos_drm_fn_encoder(crtc, &mode, exynos_drm_encoder_crtc_dpms);
	exynos_crtc->dpms = mode;

	mutex_unlock(&dev->struct_mutex);
}
static void exynos_drm_crtc_dpms(struct drm_crtc *crtc, int mode)
{
    struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc);

    DRM_DEBUG_KMS("crtc[%d] mode[%d]\n", crtc->base.id, mode);

    if (exynos_crtc->dpms == mode) {
        DRM_DEBUG_KMS("desired dpms mode is same as previous one.\n");
        return;
    }

    if (mode > DRM_MODE_DPMS_ON) {
        /* wait for the completion of page flip. */
        wait_event(exynos_crtc->pending_flip_queue,
                   atomic_read(&exynos_crtc->pending_flip) == 0);
        drm_vblank_off(crtc->dev, exynos_crtc->pipe);
    }

    exynos_drm_fn_encoder(crtc, &mode, exynos_drm_encoder_crtc_dpms);
    exynos_crtc->dpms = mode;
}