From patchwork Thu Dec 24 05:28:52 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Meng Yi X-Patchwork-Id: 7917741 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 6B9B19F350 for ; Thu, 24 Dec 2015 13:33:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8ACC32060A for ; Thu, 24 Dec 2015 13:33:42 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 1FC5120608 for ; Thu, 24 Dec 2015 13:33:41 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 609206E3E5; Thu, 24 Dec 2015 05:33:40 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org X-Greylist: delayed 5648 seconds by postgrey-1.34 at gabe; Wed, 23 Dec 2015 23:03:05 PST Received: from emea01-am1-obe.outbound.protection.outlook.com (mail-am1on0066.outbound.protection.outlook.com [157.56.112.66]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7F8D86E02D for ; Wed, 23 Dec 2015 23:03:05 -0800 (PST) Received: from HE1PR04MB1051.eurprd04.prod.outlook.com (10.162.26.148) by HE1PR04MB1050.eurprd04.prod.outlook.com (10.162.26.147) with Microsoft SMTP Server (TLS) id 15.1.361.13; Thu, 24 Dec 2015 05:28:54 +0000 Received: from HE1PR04MB1051.eurprd04.prod.outlook.com ([10.162.26.148]) by HE1PR04MB1051.eurprd04.prod.outlook.com ([10.162.26.148]) with mapi id 15.01.0361.006; Thu, 24 Dec 2015 05:28:53 +0000 From: Meng Yi To: Dongsheng Wang , "airlied@linux.ie" Subject: =?gb2312?B?tPC4tDogW1JFU0VORCAxLzNdIGRybTogZnNsLWRjdTogRml4IG5vIGZiIGNo?= =?gb2312?Q?eck_bug?= Thread-Topic: [RESEND 1/3] drm: fsl-dcu: Fix no fb check bug Thread-Index: AQHROZN/T/YaVJ7eXUWcpZAmvrBIh57ZpMOQ Date: Thu, 24 Dec 2015 05:28:52 +0000 Message-ID: References: <1448957749-12337-1-git-send-email-dongsheng.wang@freescale.com> In-Reply-To: <1448957749-12337-1-git-send-email-dongsheng.wang@freescale.com> Accept-Language: en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=meng.yi@nxp.com; x-originating-ip: [123.151.195.53] x-microsoft-exchange-diagnostics: 1; HE1PR04MB1050; 5:0qf9X7+8PO7BSTrxHMZTINqiv9ugzcmn0lx7P01Z14QY4PFqbvJgy5tqOrd1cs52g46BFPwKL382Z2sAjAAMuX3Tpn66/b7CovXJe+TU8U0YGlzVUbBfXJVhpPWrBzGJlEXEdO/fWJQH0geU3c7ZIQ==; 24:DsAkhW2cxJVKiv8p2+/45HRJv4gkA1c8pLvsjyKe4KF85SbBIhcuVcSc8Mk5w4V76bce/1+Tr3OkK/dKmmWMgrPRxiD4j87MlExnFRZtW3Y= x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:HE1PR04MB1050; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(185117386973197)(101931422205132); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(520078)(8121501046)(10201501046)(3002001); SRVR:HE1PR04MB1050; BCL:0; PCL:0; RULEID:; SRVR:HE1PR04MB1050; x-forefront-prvs: 0800C0C167 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(199003)(189002)(377454003)(33656002)(2950100001)(5003600100002)(92566002)(5001770100001)(122556002)(77096005)(5001960100002)(66066001)(2501003)(2900100001)(50986999)(40100003)(54356999)(97736004)(106116001)(106356001)(189998001)(76176999)(5008740100001)(10400500002)(101416001)(74316001)(81156007)(5002640100001)(5004730100002)(87936001)(86362001)(586003)(102836003)(1096002)(6116002)(1220700001)(229853001)(3846002)(105586002)(224303003)(19580395003)(19580405001)(76576001)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR04MB1050; H:HE1PR04MB1051.eurprd04.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:23 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Dec 2015 05:28:52.5432 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR04MB1050 X-Mailman-Approved-At: Thu, 24 Dec 2015 05:33:39 -0800 Cc: "dri-devel@lists.freedesktop.org" , Yi Meng-B56799 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=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 Tested-by: Meng Yi -----????----- ???: Dongsheng Wang [mailto:Dongsheng.Wang@freescale.com] ????: Tuesday, December 01, 2015 4:16 PM ???: airlied@linux.ie ??: stefan@agner.ch; dri-devel@lists.freedesktop.org; Jianwei Wang ; Yi Meng-B56799 ; Wang Dongsheng-B40534 ??: [RESEND 1/3] drm: fsl-dcu: Fix no fb check bug From: Jianwei Wang For state->fb may be NULL in fsl_dcu_drm_plane_atomic_check function, if so, return -EINVAL. No need check in fsl_dcu_drm_plane_atomic_update anymore. Signed-off-by: Jianwei Wang Signed-off-by: Yi Meng Signed-off-by: Wang Dongsheng Tested-by: Stefan Agner unsigned int alpha, bpp; int index, ret; - if (!fb) - return; - index = fsl_dcu_drm_plane_index(plane); if (index < 0) return; Acked-by: Stefan Agner --- 2.1.0.27.g96db324 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 51daaea..a8932a8 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 (!fb) + return -EINVAL; + 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,