static int exynos_drm_crtc_mode_set_commit(struct drm_crtc *crtc, 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 ret;

    /* when framebuffer changing is requested, crtc's dpms should be on */
    if (exynos_crtc->dpms > DRM_MODE_DPMS_ON) {
        DRM_ERROR("failed framebuffer changing request.\n");
        return -EPERM;
    }

    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;

    exynos_drm_crtc_commit(crtc);

    return 0;
}
示例#2
0
static int exynos_drm_crtc_mode_set_base(struct drm_crtc *crtc, 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 ret;

	DRM_DEBUG_KMS("%s\n", __FILE__);

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

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

	exynos_drm_crtc_commit(crtc);

	return 0;
}