From patchwork Tue Jan 20 22:09:14 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 5672621 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 6A2839F4DC for ; Tue, 20 Jan 2015 22:09:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 928A6204FC for ; Tue, 20 Jan 2015 22:09:31 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id C1122204FB for ; Tue, 20 Jan 2015 22:09:30 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 512316E693; Tue, 20 Jan 2015 14:09:28 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wg0-f44.google.com (mail-wg0-f44.google.com [74.125.82.44]) by gabe.freedesktop.org (Postfix) with ESMTP id 1C1E46E69E for ; Tue, 20 Jan 2015 14:09:27 -0800 (PST) Received: by mail-wg0-f44.google.com with SMTP id z12so3752204wgg.3 for ; Tue, 20 Jan 2015 14:09:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=W5w3vXdBre95foBgUB8Y66zjbPGY8oz7hYZ+NTTCfY8=; b=AUkUvOPiE5Dn1Pm9g36E7e47iB1RC84JDea9VdptCEWvpb0KUO/fYOeOBsnMmhGnOf 6P5Qn0skSZ5hMXG7PZJGthg36q5v1IBaJCA4G/Ls42Dx7FJBRNmjzKQtHHySQg9Y4B5c SnJ8HJJPJrLkJnmiJ4C1avRPrj3t/HT+K46uI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=W5w3vXdBre95foBgUB8Y66zjbPGY8oz7hYZ+NTTCfY8=; b=NU+BM7Vz4PvrLn4xOvoWpw0SpgtexpwIBCRvNUHvEoFrEV2hqddXhluYEhcKNsi/xs kwKYYi/ZpjKF9c7ceXHLQ1YkciYs9Wsg8jJfyaTJUPhZ7RlIzsh4XpjdMjdmcVMo5jrI tm+DcMwF3X0IYssF/c4nmSOF6h8h+nKATzwslUaDsljt4lxpcO9JcLQc+rAoEEm0ITz0 LMcoFBX4pcQVfzyQLifEdCEyJ0yfSHHHV/F2Mk3HAq7MCdDu0jUYzWaQBif7H5+ptvek nih1cKHRswvtcZIEDl+zCsQ9iLF2e+aNxVzqc6VwQctT8CzvwnPkkeu/x49jLDTdtIw/ ZHpA== X-Gm-Message-State: ALoCoQl2p+obuJmLHb+/44Ps9FD/U3A1bMpSdIEnICsXn5EqiLmJVRtwYtpFhGIn3WhrIba1zV33 X-Received: by 10.194.219.68 with SMTP id pm4mr16200315wjc.71.1421791766418; Tue, 20 Jan 2015 14:09:26 -0800 (PST) Received: from phenom.ffwll.local (84-73-67-144.dclient.hispeed.ch. [84.73.67.144]) by mx.google.com with ESMTPSA id l9sm4676357wic.21.2015.01.20.14.09.24 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jan 2015 14:09:25 -0800 (PST) From: Daniel Vetter To: DRI Development Subject: [PATCH 4/4] drm/atomic-helpers: Recover full cursor plane behaviour Date: Tue, 20 Jan 2015 23:09:14 +0100 Message-Id: <1421791754-6244-4-git-send-email-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1421791754-6244-1-git-send-email-daniel.vetter@ffwll.ch> References: <1421791754-6244-1-git-send-email-daniel.vetter@ffwll.ch> Cc: Daniel Vetter , Intel Graphics Development , Daniel Vetter X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Cursor plane updates have historically been fully async and mutliple updates batched together for the next vsync. And userspace relies upon that. Since implementing a full queue of async atomic updates is a bit of work lets just recover the cursor specific behaviour with a hint flag and some hacks to drop the vblank wait. Cc: Rob Clark Cc: "Jasper St. Pierre" Signed-off-by: Daniel Vetter Reviewed-by: Thierry Reding --- drivers/gpu/drm/drm_atomic_helper.c | 11 +++++++++++ include/drm/drm_crtc.h | 2 ++ 2 files changed, 13 insertions(+) diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c index b462b2123553..5d3fbbd241a9 100644 --- a/drivers/gpu/drm/drm_atomic_helper.c +++ b/drivers/gpu/drm/drm_atomic_helper.c @@ -906,6 +906,11 @@ drm_atomic_helper_wait_for_vblanks(struct drm_device *dev, if (!crtc->state->enable) continue; + /* Legacy cursor ioctls are completely unsynced, and userspace + * relies on that (by doing tons of cursor updates). */ + if (old_state->legacy_cursor_update) + continue; + if (!framebuffer_changed(dev, old_state, crtc)) continue; @@ -1332,6 +1337,9 @@ retry: if (ret != 0) goto fail; + if (plane == crtc->cursor) + state->legacy_cursor_update = true; + /* Driver takes ownership of state on successful commit. */ return 0; fail: @@ -1407,6 +1415,9 @@ retry: plane_state->src_h = 0; plane_state->src_w = 0; + if (plane == plane->crtc->cursor) + state->legacy_cursor_update = true; + ret = drm_atomic_commit(state); if (ret != 0) goto fail; diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h index 4d3f3b874dd6..8b626ff3d3bd 100644 --- a/include/drm/drm_crtc.h +++ b/include/drm/drm_crtc.h @@ -929,6 +929,7 @@ struct drm_bridge { * struct struct drm_atomic_state - the global state object for atomic updates * @dev: parent DRM device * @allow_modeset: allow full modeset + * @allow_modeset: hint to enforce legacy cursor ioctl semantics * @planes: pointer to array of plane pointers * @plane_states: pointer to array of plane states pointers * @crtcs: pointer to array of CRTC pointers @@ -941,6 +942,7 @@ struct drm_bridge { struct drm_atomic_state { struct drm_device *dev; bool allow_modeset : 1; + bool legacy_cursor_update : 1; struct drm_plane **planes; struct drm_plane_state **plane_states; struct drm_crtc **crtcs;