From patchwork Wed Jan 6 04:12:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Meng Yi X-Patchwork-Id: 7972941 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 CBCA99F38D for ; Thu, 7 Jan 2016 01:28:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E08432017D for ; Thu, 7 Jan 2016 01:28:50 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id B858A201B9 for ; Thu, 7 Jan 2016 01:28:48 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F2B858A1C5; Wed, 6 Jan 2016 17:28:44 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org X-Greylist: delayed 90053 seconds by postgrey-1.34 at gabe; Tue, 05 Jan 2016 20:20:49 PST Received: from na01-by2-obe.outbound.protection.outlook.com (mail-by2on0060.outbound.protection.outlook.com [207.46.100.60]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0658A6E2CE for ; Tue, 5 Jan 2016 20:20:48 -0800 (PST) Received: from BN3PR0301CA0010.namprd03.prod.outlook.com (10.160.180.148) by SN1PR0301MB2125.namprd03.prod.outlook.com (10.163.228.144) with Microsoft SMTP Server (TLS) id 15.1.361.13; Wed, 6 Jan 2016 04:20:45 +0000 Received: from BL2FFO11OLC008.protection.gbl (2a01:111:f400:7c09::112) by BN3PR0301CA0010.outlook.office365.com (2a01:111:e400:4000::20) with Microsoft SMTP Server (TLS) id 15.1.361.13 via Frontend Transport; Wed, 6 Jan 2016 04:20:46 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=none action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BL2FFO11OLC008.mail.protection.outlook.com (10.173.160.143) with Microsoft SMTP Server (TLS) id 15.1.355.15 via Frontend Transport; Wed, 6 Jan 2016 04:20:42 +0000 Received: from titan.ap.freescale.net ([10.192.208.233]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id u064KZNh006117; Tue, 5 Jan 2016 21:20:37 -0700 From: Meng Yi To: Subject: [RESEND,V2] drm: fsl-dcu: Fix no fb check bug Date: Wed, 6 Jan 2016 12:12:05 +0800 Message-ID: <1452053525-15053-1-git-send-email-meng.yi@nxp.com> X-Mailer: git-send-email 2.1.0.27.g96db324 X-EOPAttributedMessage: 0 X-Matching-Connectors: 130965276455849289; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11OLC008; 1:awyb+oUNoMLUKSA6sZYzxEs+j7m7AaV40Fxj/v+iQ2h+DpJT3QAq0nF6HplzhuYwTG1eaLZdpvB5IFTlkjSFcUYzFP0tkonN5Wxh81CJL+khBbmUEgzrhAKz3JxL314pBSNntwE2SS6IwzredJvdJzimBKNTGPJ1WpoCHzg2OgOz+Uaf8NCsACXWSmr1HMnwHG+qdUB/6+U8RLWPDvBebHNeUbpEsEgsVQ1e7hvrFrw/VV0k3u8x8PAvZEbttQF4nOd2us5hIxqMfcV8N9Wvo/f63oLvRsfhC83UGL8T33bjTH8Do3lCUpARBl8kG6zH1MFAPqN5jQUVe1XuewSpAgADlOg0vzCvMkLdJA058Ql/Q9j9AUR2ZbR1OZFWKb/SFS5mXbortdRCnx2HrhbpCiztRUGxkfAOG8pcU9A4VW0BVIMozInjkz02vcmKVm8yCmxHSi4KNDFeQw+BIjAd0w== X-Forefront-Antispam-Report: CIP:192.88.168.50; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(2980300002)(1109001)(1110001)(339900001)(199003)(189002)(33646002)(5008740100001)(586003)(19580405001)(1096002)(86362001)(104016004)(81156007)(1220700001)(87936001)(50226001)(48376002)(19580395003)(85426001)(50986999)(47776003)(77096005)(110136002)(36756003)(5001960100002)(5003940100001)(229853001)(97736004)(4326007)(106466001)(6806005)(2351001)(105606002)(189998001)(50466002)(92566002)(7059030)(142933001); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR0301MB2125; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Exchange-Diagnostics: 1; SN1PR0301MB2125; 2:cZAAHPjYIandiI4HtbGeTgApPV2vjinoAHWafNqnvKSNFG6MhmRhL/ZBn53rHPmI5uR+fGiOCnlKqj2jOCFG51U7Z4OrOJzNFpHGPC0yI5fI6FzGvqa9Zsql2MD9+xbn9gWGTuwDTCUqx0Ll+SyzmQ==; 3:XmykP50dCAuMRKGz/w1rdHlYB0LqPOL4AdRekenoQXbb+Frpgif6Nqx6cHSxmhb8E/ufGtPCssrmSNRwXByXYWz5c21bmTMPJjyQbdYJruuZ+v25xFuU3zn0/j/GHGuFOBg0qE/nOp+QIQeHsStIDoXV61oAuKSXbVvlMBQ24sF5t9/24JK3jwc42KDAV2MfBEWyqpQxtYmKHdevZYAT78e18J7Dyo/qVaugSC6HXAM=; 25:M4efwCxK/qdhXoHlA7nRDzKi6J2Lu7psayr81tEjq+iiuiNFz+HOP5Re8h/EOu3pwo4Sq/Jm/3d1MWL11dc8jVniPrEI9ITpNgMj72/w/kTnZC5kB/1r5DxcTruR17gbrcWTRmfZFCgZ6WOFqpIndhaExsA+ZMAD7Gu81YjTBIf/jU9LMry/5l+Gfr0nfXvsQdQWwdlNdlMT2H7QJgTRUrdCA7AeBOCjWQ9Nn5+ZiYnOZvdzH6AvPYekRO6M3k7V2e06qwvJmolfHVGgZ8+t1w== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:SN1PR0301MB2125; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(8121501046)(5005006)(520078)(3002001)(10201501046); SRVR:SN1PR0301MB2125; BCL:0; PCL:0; RULEID:(400006); SRVR:SN1PR0301MB2125; X-Microsoft-Exchange-Diagnostics: 1; SN1PR0301MB2125; 4:o/zkUXlN+q7gBKjFmDAMCXdZbD70Ol+P1vS3VU23Sye/e3jIYz8sroN2d/jh94yZtTNvUOvqb5pDKI+lm+cdCXrY7xkpvZibzuGQZfx80yBU0y0v90SdyCUbviJFo6DSWbRqbUp4pM0vftYbhu8S8ofLJX5qz1YqoEgqaflTO9ccw3/nad6FUhiT2LZOkCSbPoOqVfU5RF2DgCvWzarhrIGXL+uOLQ4/8tnBvSwFYoxxiXLhKyE1214RahxbzE/5TwOtNBSzP+PRPtYW0iuj7c869L3wOnx007K13hj9l0Wgc056rsvzpdPjcg+rE75L5/SxBYSFBZ+hv1AEs8z0+m9vc2NGHyIXi7BZt8e7TOsGXLsbotTF80tPRUbAk/2Bi+EQKomX8k7dl03EuA8fkjIMJEYktLeB95Lv/DcBBfEvHkEXImvwK6m7+dtgWmFh X-Forefront-PRVS: 0813C68E65 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN1PR0301MB2125; 23:o/Vjq3FEP3TDQ0L2irJRAYdXVwd2X9bQwif9ESl?= =?us-ascii?Q?n9ZLW0J3BW68PwDrU/rC9+wVwD+Q6PI1KXQ+/ySu1qWngkSM0vsB3iHkx9wN?= =?us-ascii?Q?6Sl33fvjkTM1gABQy5fXIllrmfAfo78q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rQKnfRXa02N1mMFKw1NUCRHSiDlLI9pFw9H7qJ/b1Lgru6?= =?us-ascii?Q?ggQyFBYE=3D?= X-Microsoft-Exchange-Diagnostics: 1; SN1PR0301MB2125; 5:G/50TQr8KqL1m0Yk1k33CoVvyNAyj3p7u7nlTbierDjDOrLlCj3QRz6aISFxlRCEf3UtvWDZkuoobKsbWhhShQ/bVe9I2kTm+MBVqs9/RsqZwJzm8DeGvyzdnLwkC0ceBgKNC3Ols9kSOR0VNytvpdCxWq9XpcQgPPDBGUEA9x0=; 24:W9CAlgJE8O8/pUk9kgd/EKNPO/SAv2felgRPfMOb6ZWyvczT77Nzto+YKnI3ENFYahMYyKOyIVhkmYgJcZz+8WtPxC0A/xTkJq4XOrHW3pk= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jan 2016 04:20:42.9329 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR0301MB2125 X-Mailman-Approved-At: Wed, 06 Jan 2016 17:28:41 -0800 Cc: Meng Yi , dri-devel@lists.freedesktop.org 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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAD_ENC_HEADER,BAYES_00, RCVD_IN_DNSWL_MED, 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 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 Signed-off-by: Jianwei Wang --- 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;