From: Meng Yi <meng.yi@nxp.com>
To: airlied@linux.ie
Cc: Meng Yi <meng.yi@nxp.com>, dri-devel@lists.freedesktop.org
Subject: [RESEND,V2] drm: fsl-dcu: Fix no fb check bug
Date: Wed, 6 Jan 2016 12:12:05 +0800 [thread overview]
Message-ID: <1452053525-15053-1-git-send-email-meng.yi@nxp.com> (raw)
For state->fb or state->crtc may be NULL in fsl_dcu_drm_plane_atomic_check
function, if so, return 0.
Signed-off-by: Meng Yi <meng.yi@nxp.com>
Signed-off-by: Jianwei Wang <jianwei.wang.chn@gmail.com>
---
change in v2:
-Add state->crtc check
-return 0 when state->fb or state->crtc is NULL, instead of -EINVAL
Adviced by Daniel Stone
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c
index 4b13cf9..8965580 100644
--- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c
+++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c
@@ -41,6 +41,9 @@ static int fsl_dcu_drm_plane_atomic_check(struct drm_plane *plane,
{
struct drm_framebuffer *fb = state->fb;
+ if (!state->fb || !state->crtc)
+ return 0;
+
switch (fb->pixel_format) {
case DRM_FORMAT_RGB565:
case DRM_FORMAT_RGB888:
@@ -85,9 +88,6 @@ static void fsl_dcu_drm_plane_atomic_update(struct drm_plane *plane,
unsigned int alpha, bpp;
int index, ret;
- if (!fb)
- return;
-
index = fsl_dcu_drm_plane_index(plane);
if (index < 0)
return;
--
2.1.0.27.g96db324
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
next reply other threads:[~2016-01-06 4:20 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-06 4:12 Meng Yi [this message]
2016-01-08 9:20 ` [RESEND,V2] drm: fsl-dcu: Fix no fb check bug Emil Velikov
2016-01-14 5:54 ` Stefan Agner
2016-01-14 8:23 ` Meng Yi
2016-01-26 21:18 ` Emil Velikov
2016-01-28 2:23 ` Stefan Agner
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=1452053525-15053-1-git-send-email-meng.yi@nxp.com \
--to=meng.yi@nxp.com \
--cc=airlied@linux.ie \
--cc=dri-devel@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;
as well as URLs for NNTP newsgroup(s).