From: Matt Roper <matthew.d.roper@intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH 1/7] drm/plane-helper: Test for plane disable earlier
Date: Tue, 9 Dec 2014 11:53:37 -0800 [thread overview]
Message-ID: <1418154823-10819-2-git-send-email-matthew.d.roper@intel.com> (raw)
In-Reply-To: <1418154823-10819-1-git-send-email-matthew.d.roper@intel.com>
drm_plane_helper_check_update() currently uses crtc before testing whether
we're disabling the plane (fb == NULL). Move the fb test before the first crtc
usage so that crtc == NULL doesn't have to be handled by the caller.
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
---
drivers/gpu/drm/drm_plane_helper.c | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/drm_plane_helper.c b/drivers/gpu/drm/drm_plane_helper.c
index ae61fb2..f24c4cf 100644
--- a/drivers/gpu/drm/drm_plane_helper.c
+++ b/drivers/gpu/drm/drm_plane_helper.c
@@ -142,6 +142,17 @@ int drm_plane_helper_check_update(struct drm_plane *plane,
{
int hscale, vscale;
+ if (!fb) {
+ *visible = false;
+ return 0;
+ }
+
+ /* crtc should only be NULL when disabling (i.e., !fb) */
+ if (WARN_ON(!crtc)) {
+ *visible = false;
+ return 0;
+ }
+
if (!crtc->enabled && !can_update_disabled) {
DRM_DEBUG_KMS("Cannot update plane of a disabled CRTC.\n");
return -EINVAL;
@@ -155,11 +166,6 @@ int drm_plane_helper_check_update(struct drm_plane *plane,
return -ERANGE;
}
- if (!fb) {
- *visible = false;
- return 0;
- }
-
*visible = drm_rect_clip_scaled(src, dest, clip, hscale, vscale);
if (!*visible)
/*
--
1.8.5.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2014-12-09 20:15 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-09 19:53 [PATCH 0/7] i915 atomic plane helper conversion (v3) Matt Roper
2014-12-09 19:53 ` Matt Roper [this message]
2014-12-10 10:05 ` [PATCH 1/7] drm/plane-helper: Test for plane disable earlier Daniel Vetter
2014-12-11 15:20 ` Matt Roper
2014-12-11 15:57 ` [Intel-gfx] " Daniel Vetter
2014-12-09 19:53 ` [PATCH 2/7] drm/i915: Refactor work that can sleep out of commit (v3) Matt Roper
2014-12-11 23:53 ` [PATCH] drm/i915: Refactor work that can sleep out of commit (v4) Matt Roper
2014-12-12 9:06 ` Ander Conselvan de Oliveira
2014-12-13 12:23 ` shuang.he
2014-12-09 19:53 ` [PATCH 3/7] drm/i915: Move vblank evasion to commit (v3) Matt Roper
2014-12-09 19:53 ` [PATCH 4/7] drm/i915: Clarify sprite plane function names (v2) Matt Roper
2014-12-09 19:53 ` [PATCH 5/7] drm/i915: Prepare for atomic plane helpers (v6) Matt Roper
2014-12-11 23:54 ` [PATCH] drm/i915: Prepare for atomic plane helpers (v7) Matt Roper
2014-12-12 12:52 ` Ander Conselvan de Oliveira
2014-12-09 19:53 ` [PATCH 6/7] drm/i915: Switch plane handling to atomic helpers (v5) Matt Roper
2014-12-12 12:53 ` Ander Conselvan de Oliveira
2014-12-09 19:53 ` [PATCH 7/7] drm/i915: Drop unused position fields Matt Roper
2014-12-10 7:12 ` shuang.he
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=1418154823-10819-2-git-send-email-matthew.d.roper@intel.com \
--to=matthew.d.roper@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox