All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel.vetter@ffwll.ch>
To: DRI Development <dri-devel@lists.freedesktop.org>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>,
	Thomas Hellstrom <thellstrom@vmware.com>,
	VMware Graphics <linux-graphics-maintainer@vmware.com>
Subject: [PATCH 16/21] drm/vmwgfx: Fix vmw_du_cursor_plane_atomic_check
Date: Thu,  4 Oct 2018 22:24:41 +0200	[thread overview]
Message-ID: <20181004202446.22905-17-daniel.vetter@ffwll.ch> (raw)
In-Reply-To: <20181004202446.22905-1-daniel.vetter@ffwll.ch>

From: Thomas Hellstrom <thellstrom@vmware.com>

Use the correct helper and also return early on helper
success rather than on helper failure.

Also explicitly return 0 in the case of no fb.

v2: Check for !fb after updating state->visible (Ville).

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> (v1)
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Reported-by: Daniel Vetter <daniel@ffwll.ch>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: VMware Graphics <linux-graphics-maintainer@vmware.com>
Cc: Sinclair Yeh <syeh@vmware.com>
Cc: Thomas Hellstrom <thellstrom@vmware.com>
---
 drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
index a50fb0360317..e88689b44efc 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
@@ -493,24 +493,24 @@ int vmw_du_cursor_plane_atomic_check(struct drm_plane *plane,
 				     struct drm_plane_state *new_state)
 {
 	int ret = 0;
+	struct drm_crtc_state *crtc_state = NULL;
 	struct vmw_surface *surface = NULL;
 	struct drm_framebuffer *fb = new_state->fb;
 
-	struct drm_rect src = drm_plane_state_src(new_state);
-	struct drm_rect dest = drm_plane_state_dest(new_state);
+	if (new_state->crtc)
+		crtc_state = drm_atomic_get_new_crtc_state(new_state->state,
+							   new_state->crtc);
 
-	/* Turning off */
-	if (!fb)
+	ret = drm_atomic_helper_check_plane_state(new_state, crtc_state,
+						  DRM_PLANE_HELPER_NO_SCALING,
+						  DRM_PLANE_HELPER_NO_SCALING,
+						  true, true);
+	if (ret)
 		return ret;
 
-	ret = drm_plane_helper_check_update(plane, new_state->crtc, fb,
-					    &src, &dest,
-					    DRM_MODE_ROTATE_0,
-					    DRM_PLANE_HELPER_NO_SCALING,
-					    DRM_PLANE_HELPER_NO_SCALING,
-					    true, true, &new_state->visible);
-	if (!ret)
-		return ret;
+	/* Turning off */
+	if (!fb)
+		return 0;
 
 	/* A lot of the code assumes this */
 	if (new_state->crtc_w != 64 || new_state->crtc_h != 64) {
-- 
2.19.0.rc2

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2018-10-04 20:25 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-04 20:24 [PATCH 00/21] atomic helper cleanup, take 2 Daniel Vetter
2018-10-04 20:24 ` [PATCH 01/21] drm/amdgpu: Remove default best_encoder hook from DC Daniel Vetter
2018-10-05 15:41   ` Harry Wentland
2018-10-05 20:13     ` Leo Li
2018-10-04 20:24 ` [PATCH 02/21] drm/atomic-helper: Unexport drm_atomic_helper_best_encoder Daniel Vetter
2018-10-04 20:24 ` [PATCH 03/21] drm: Extract drm_atomic_state_helper.[hc] Daniel Vetter
2018-10-04 20:24 ` [PATCH 04/21] drm/vmwgfx: Don't look at state->allow_modeset Daniel Vetter
2018-10-04 20:24 ` [PATCH 05/21] drm/vmwgfx: Remove confused comment from vmw_du_connector_atomic_set_property Daniel Vetter
2018-10-04 22:40   ` Thomas Hellstrom
2018-10-05  6:43     ` Daniel Vetter
2018-10-05  7:48       ` Daniel Vetter
2018-10-05 18:19         ` Thomas Hellstrom
2018-10-05 18:30           ` Daniel Vetter
2018-10-04 20:24 ` [PATCH 06/21] drm/atomic: Improve docs for drm_atomic_state->allow_modeset Daniel Vetter
2018-10-04 20:24 ` [PATCH 07/21] drm/vmwgfx: Add FIXME comments for customer page_flip handlers Daniel Vetter
2018-10-04 20:24 ` [PATCH 08/21] drm/arcpgu: Drop transitional hooks Daniel Vetter
2018-10-04 20:24 ` [PATCH 09/21] drm/atmel: " Daniel Vetter
2018-10-04 20:24   ` Daniel Vetter
2018-10-04 20:24 ` [PATCH 10/21] drm/arcpgu: Use drm_atomic_helper_shutdown Daniel Vetter
     [not found] ` <20181004202446.22905-1-daniel.vetter-/w4YWyX8dFk@public.gmane.org>
2018-10-04 20:24   ` [PATCH 11/21] drm/msm: " Daniel Vetter
2018-10-04 20:24 ` [PATCH 12/21] drm/sti: " Daniel Vetter
2018-10-04 20:24 ` [PATCH 13/21] drm/vc4: " Daniel Vetter
2018-10-04 20:24 ` [PATCH 14/21] drm/zte: " Daniel Vetter
2018-10-05 13:07   ` Shawn Guo
2018-10-04 20:24 ` [PATCH 15/21] drm: Remove transitional helpers Daniel Vetter
2018-10-04 21:04   ` Sam Ravnborg
2018-10-05  6:10     ` Daniel Vetter
2018-10-04 20:24 ` Daniel Vetter [this message]
2018-10-05 16:06   ` [PATCH 16/21] drm/vmwgfx: Fix vmw_du_cursor_plane_atomic_check Daniel Vetter
2018-10-05 16:21     ` Thomas Hellstrom
2018-10-05 20:46       ` Daniel Vetter
2018-10-05 20:53         ` Thomas Hellstrom
2018-10-04 20:24 ` [PATCH 17/21] drm: Unexport drm_plane_helper_check_update Daniel Vetter
2018-10-04 21:03   ` Sam Ravnborg
2018-10-05  6:13     ` Daniel Vetter
2018-10-04 20:24 ` [PATCH 18/21] drm: Unexport primary plane helpers Daniel Vetter
2018-10-04 21:14   ` Sam Ravnborg
2018-10-05  6:18     ` Daniel Vetter
2018-10-05  9:47   ` [PATCH] " Daniel Vetter
2018-10-04 20:24 ` [PATCH 19/21] drm/doc: fix drm_driver_legacy_fb_format Daniel Vetter
2018-10-05  5:07   ` Gerd Hoffmann
2018-10-04 20:24 ` [PATCH 20/21] drm/todo: Add some cleanup tasks Daniel Vetter
2018-10-04 20:35   ` Ville Syrjälä
2018-10-05 16:07   ` Harry Wentland
2018-10-05 16:20     ` Eric Engestrom
2018-10-04 20:24 ` [PATCH 21/21] drm/doc: kerneldoc for quirk_addfb_prefer_xbgr_30bpp Daniel Vetter
2018-10-24 10:01   ` Alexandru-Cosmin Gheorghe
2018-10-24 12:19     ` Daniel Vetter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181004202446.22905-17-daniel.vetter@ffwll.ch \
    --to=daniel.vetter@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-graphics-maintainer@vmware.com \
    --cc=thellstrom@vmware.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.