From patchwork Mon Oct 10 06:50:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ying Liu X-Patchwork-Id: 9369079 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9DF686048F for ; Mon, 10 Oct 2016 07:22:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8CD2928ED3 for ; Mon, 10 Oct 2016 07:22:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 80E7D28EDB; Mon, 10 Oct 2016 07:22:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7DE4928ED3 for ; Mon, 10 Oct 2016 07:22:58 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 98C846E20D; Mon, 10 Oct 2016 07:22:57 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org X-Greylist: delayed 1059 seconds by postgrey-1.35 at gabe; Mon, 10 Oct 2016 07:22:56 UTC Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0077.outbound.protection.outlook.com [104.47.42.77]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5C4B26E20D for ; Mon, 10 Oct 2016 07:22:56 +0000 (UTC) Received: from BLUPR0301CA0024.namprd03.prod.outlook.com (10.162.113.162) by MWHPR03MB2447.namprd03.prod.outlook.com (10.169.200.141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.659.11; Mon, 10 Oct 2016 06:50:53 +0000 Received: from BN1BFFO11FD036.protection.gbl (2a01:111:f400:7c10::1:185) by BLUPR0301CA0024.outlook.office365.com (2a01:111:e400:5259::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.659.11 via Frontend Transport; Mon, 10 Oct 2016 06:50:53 +0000 Authentication-Results: spf=softfail (sender IP is 192.88.168.50) smtp.mailfrom=gmail.com; vger.kernel.org; dkim=none (message not signed) header.d=none; vger.kernel.org; dmarc=fail action=none header.from=gmail.com; Received-SPF: SoftFail (protection.outlook.com: domain of transitioning gmail.com discourages use of 192.88.168.50 as permitted sender) Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1BFFO11FD036.mail.protection.outlook.com (10.58.144.99) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.629.5 via Frontend Transport; Mon, 10 Oct 2016 06:50:52 +0000 Received: from victor.ap.freescale.net (victor.ap.freescale.net [10.192.241.62]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id u9A6ojcx023730; Sun, 9 Oct 2016 23:50:50 -0700 From: Liu Ying To: Subject: [PATCH 3/3] drm/imx: ipuv3-plane: Access old u/vbo properly in ->atomic_check for YU12/YV12 Date: Mon, 10 Oct 2016 14:50:08 +0800 Message-ID: <1476082208-14480-3-git-send-email-gnuiyl@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1476082208-14480-1-git-send-email-gnuiyl@gmail.com> References: <1476082208-14480-1-git-send-email-gnuiyl@gmail.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131205558530916764; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(2980300002)(199003)(189002)(81156014)(81166006)(83322999)(48376002)(55446002)(2906002)(6666003)(2351001)(5660300001)(8936002)(626004)(19580395003)(110136003)(8676002)(19580405001)(50466002)(61266001)(50226002)(229853001)(36756003)(82202001)(87936001)(4326007)(47776003)(2950100002)(5003940100001)(6916009)(68736007)(586003)(77096005)(105596002)(97736004)(305945005)(73972006)(106466001)(7846002)(73392002)(15975445007)(104016004)(87572001)(76176999)(50986999)(33646002)(76482005)(6260500002)(86362001)(92566002)(356003)(81442002)(11100500001)(189998001); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR03MB2447; H:tx30smr01.am.freescale.net; FPR:; SPF:SoftFail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD036; 1:nHC8d02biyQu71MzM7hcE1DXoQnpP3eI5t8k4AtqfuwfQ8n34/cfy+OrKZ2QZMTtLHJRdQ1rRt23td+7RJGVmdDmF8fps5JJI2oaca7QdRLgR8wBiLCLgPAMdu0qo038ws7Mqw5cefyBlsqsW8/AlQ7bjqCwxnoYICGQX7LsKvuoWokAn/WQupgYkXaxaEU4pmN5/2sztVOEAHr5+mPmbswa6JitFQH/AIuuuG3CafTJ/2/Q22MS86kv/uGp81597fBeHePdVhvh8DbYNi4FeA4fR0ClRbDMd1JeGpFfcucFGtcxqy/pgj8ct3YxNTODixBPN7hBJvk8eVWkZZfjKVv3Hp3Cp+IhPB6lFXJVskrJhKmr7zwHxbeXmytkGODRFUlzGgufJHRKv3DCyL6dqkGQVGvUXtbyZuGNnVxvfFB5MxsJOIdAV1bmhqe8+6lo53CHy+XB+KAeCT3uuTjXNOMrQx9y6zg8dKINLIGthE/v5XvC20aqdvfZcRziU0USRztCp+cPguHgkJRfesUrUDepsBKvByuEA+RIq+FrbQjacUAuPn6kI8OnI2s14KubfR0H3/Is05xAArbjUYqv8g== MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 62c128d5-b1e2-4efc-c19c-08d3f0d9c741 X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2447; 2:MmVHp4oa+AcHl+Ik+Qm2nN3CX+qEB1wGGYVIuxnzC8w/zoMN8t0atZ8gXMOLjCKX5b6imIp3gWSR5UjYkFD2eJVQGcXGXDvubDAxAgIsR8BLUYwzTLBtBBOaPqXnmRR+pSjBO3hjpylKrnYCS+ANfCzPEnqOStu61myEReBYFsiVtMwuzamh1Ba8K8oKpyDodeUlUDJgxp0Gaefh1kOmxQ==; 3:uks9u1HGG0mr+Whm0k9wbaqudixMRsjssg2ffPL6LUJZSuj7m7MgT7OXRjRYnt2DBPQlJSrM89gTKrP5Jerr0khjLPC4zMmWWz+cTNyQCwuhIVY5ZEcJIcchQuoIsR5L/2oDE4t7bhvUw9Q9yv9mJc9ekw7/PWm9P1r2SzJGwdhIBqGZ6crndyEAZNGl4JSNFSW4Z25gIcHD3+F1QJacYtqgk1TaxM0lr0g6roxT92pVNXEI/7gaqknExogPCJ/Q; 25:XiYZQtsXlANR+qp3c6S3z2o921c4t8z/Gi+/i207X+ESmmHqqu1Bzzb5pPPgryleIRorKETogvuFZ61yXctrZ6aw/NeINtVIXGR00k4KdkiFseoKaQq1Bto7NBnOoAOj6dVqCKAsgdGqKiNo0R8Wkv1Xqsc821InjO1jU9RaoBXYMcSYwasi7mMJk6PLnz5BPPOHbpFtMaCgpUXuHMdYRucp1eeNumsgfL5UkX5V+CYW14ohDiSG8BvUJ0kCS2+daSD+lXz6H6m/mXVuZA+P8/kq2mp54vZvGHYzlGl2ERpqCm+raAPu3aPuO3iXTI4DPdGMmIHn7cPmLs96fzIZIG0n7sleP7gyh5NbPxSXwuJoq61dCrlmJfSYRf1sutNRWoIznQ37eOL4m4HpS6BqJ9x3VlKI8YsMYT/pfoLn7NTgwOhtvUHhLUpAYSem26KI X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:MWHPR03MB2447; X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2447; 31:5ObEFT8s1jcpUbK3ACS6DQEP4eQ1AFue8L1Fhm4FV+yaJkWAwOh4pT8iVrTGrNIT2bUHFk1G/RwfdsVOIj0i0rSnlAE/q6u6ivwrsD3H1xQ5DTaJ368Y8yer0SdzSDjVrFXt/noyj1EkT/ZwazQQ2T1oOwFhhzR2gaVyT9PDE3p1HE6Y8H2gQQBKzSHjY6bTpmyFxQVXVmRxvufOxucsOIhsHu+CfA1A222Qnf40fjH+wUFS3RRsjUqbNar6TbsNzH+5PSunh9sa3HcKjwisFw==; 4:CrjLVeySio5uInGdz3XOJiVZGN7umRUQW5Y3f9kz0uvYrUHNEwbO707NRuf7wiQBEqKbVXbyJzswgaHumkX/pkN7uyFrf5jUJBbWX/xvRmT7NRtxzCSoplZs+nJ1cIQ8Eh79vcLu7++EUEAOLMBaPgmHsSnX3PIhL+WjRq6GgHushi0RjPik1LHCjOKt9V8kTZDfNcOXW6JM4ENNLYDts6fRoyC9ufdcvkUg9lMSl6Nfkck32YjOiniglvDDqtUsYeiEOtwzSZ+xCO9e2iY8PbGlNsJgtmcgKsCTbGONaKu6PVz+/yd/TxB1H6qFx7WP2XeV7q/8wwksFS0EaBjelbDqWAFATSZydPhUDh2y2OqIvhWRFn/CwxbeIogUelKNwDyrQLxWRm4q7B1yl8aiD71JLphbAt6lWbtyFbSV3r0xkyTmuaee7ZoD2gvFSN1VxWr4309II8H7oMy2mbPJ1kd2q0pSztB0muq2GF6WVTHbnrRLmlckyW/RkZIMQIsmJ8+QkyqWcH/ZR08TTDuuXS+TcaNCXrW1HI861ecOt2l0T0ecCdFHTGa5NKhNFLf1 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(9452136761055); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(13024025)(13023025)(13015025)(13018025)(13017025)(8121501046)(5005006)(10201501046)(3002001)(6055026); SRVR:MWHPR03MB2447; BCL:0; PCL:0; RULEID:(400006); SRVR:MWHPR03MB2447; X-Forefront-PRVS: 0091C8F1EB X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR03MB2447; 23:WX9ZTYmmB8JAIoSvVPZa7WbLG7ARy+rSFEmVM6Crd?= =?us-ascii?Q?XyUN7bFLKvpwKRuAo1rJ357LMnTTcLNz7gq5ayAmNUerBZhugb0kT/Vnrs6C?= =?us-ascii?Q?r1+FwcHhcPT7hS1h1iDuUDJIs84JmlRgktYqCSJtXkXQv2TIV5PXlW4TxmD2?= =?us-ascii?Q?uCpEMNeHVUBfOzzbRlN6FuYXgDqbNdk2HyOmq2AHKAIeid0sJGXZ+KpTqE/8?= =?us-ascii?Q?npx2UFaXk7au0Ql0EXnZR3ANZ1yx7AZ2h0wZAjDkbKtog7GIGUB9Mj0nTYKf?= =?us-ascii?Q?iCm66Majx5HLEhcgNl/t+Bzmp7YWHc2cT1AEv80iZ219q4yQ+MFOgJFwzov5?= =?us-ascii?Q?d0vSRfTLR7vYdewZ7dPCE6rp2SvVazIB7vCXfu7G235IBtstt4ogQCFj/s6U?= =?us-ascii?Q?kh5K0EkcepsteYSvIJ+cl4LZIPToq8f0x4HZL6MtM0U+/EEGKIQVyGTCmiFK?= =?us-ascii?Q?JGDQj8SQ7U/Cnf4W19GNpu2KFNL7fQHnr/4xADG5/t47U5TuBcMZ/lgjShBO?= =?us-ascii?Q?XahTv4slTQeggJaxb9DrPJRR7Oa4jSWcdgYmnbnnIZkpBL88F49qrIhhP4mu?= =?us-ascii?Q?mkewtnFHbWowqZDBh4zB6z1ObCGmlXXiIRdpFkewWcwl9SSltG+uQ96c0MCw?= =?us-ascii?Q?h0aoHGAsFsvxca+TbZUB/Ie6mhPAHiUhuBkl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nn/HZ3zUyN8Hfig0izKkOE1j6yUOkyLWqh6xjhgRwhaqRnI+Z1e1mq3HSRoh9x8z5ccFdLu6765X4m6jNm32cwHKSyZkW2aAH; 5:ZsMUldrKD72Jjq8DaAq1PVEVs3umCBOyjZOKfW8z+S3rtsmRdkFyprITfnn9Rb1EARbKpTH4ydoc6PkkKJRiRk2e71JkpytcLfcj/NJL1GqVHusFMYmtQZzpPdwrCi1+wZm48lUBVoMSUTq/hxvQEHKn8sqeTjaiNBJjq8vpi5LolazQKWM5/EpeF4jih4b7; 24:0D6mamGXXDqZBWIshyiVIzcMNuYgIaQ6rMNQo3E1evVkr+0PO/iYeU9np3scrxc721yDGdItlm8DtWT8AULCZvI8zUxkcW0enT2ESQtnaUY= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2447; 7:dm7W1+2EY90KH6FhJJWyqW4t1m0A5QCTynYcbMpheRCZjg6r4HhCd9pPCAClsIhu9He7LveNINLFtVb5prw+pcce9RH+rcQXhjW0lvzF4NJdvJa/bW/lHyQI6tWtAXif/f6fY8Wt8Q9XWb1x6qqmYyQim1/dqpgq8R4TDEMrd+J0Qankxa1rsEs0yPFUClydWgXSflIdF2k5nGZPRNYnjYXi9BldY7s709e1D4o/zXhYU2JDFxeud/EWUMor5R9EP4ahwywGz8g5kSN3WYFGqdkHN1wE0HRI8ooXcHWQ6DUQjDRGhy26K/uoo53Zv7iaMn4w/Dbcv6mFMg/H6k9IIa8hlI6w7JgK/A0vN6mx5hQ= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Oct 2016 06:50:52.9044 (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: MWHPR03MB2447 Cc: stable@vger.kernel.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-Virus-Scanned: ClamAV using ClamSMTP Before accessing the u/v offset(aka, u/vbo for IPUv3) of the old plane state's relevant fb, we should make sure the fb is in YU12 or YV12 pixel format(which are the two YUV pixel formats we support only), otherwise, we are likely to trigger BUG_ON() in drm_plane_state_to_u/vbo() since the fb's pixel format is probably not YU12 or YV12. Link: https://bugs.freedesktop.org/show_bug.cgi?id=98150 Fixes: c6c1f9bc798b ("drm/imx: Add active plane reconfiguration support") Cc: stable@vger.kernel.org # 4.8 Signed-off-by: Liu Ying --- drivers/gpu/drm/imx/ipuv3-plane.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/imx/ipuv3-plane.c b/drivers/gpu/drm/imx/ipuv3-plane.c index e33110e..a691892 100644 --- a/drivers/gpu/drm/imx/ipuv3-plane.c +++ b/drivers/gpu/drm/imx/ipuv3-plane.c @@ -359,7 +359,7 @@ static int ipu_plane_atomic_check(struct drm_plane *plane, if ((ubo > 0xfffff8) || (vbo > 0xfffff8)) return -EINVAL; - if (old_fb) { + if (old_fb && old_fb->pixel_format == fb->pixel_format) { old_ubo = drm_plane_state_to_ubo(old_state); old_vbo = drm_plane_state_to_vbo(old_state); if (ubo != old_ubo || vbo != old_vbo)