Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1033207AbbKFLCR (ORCPT ); Fri, 6 Nov 2015 06:02:17 -0500 Received: from mail-by2on0129.outbound.protection.outlook.com ([207.46.100.129]:52219 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1031997AbbKFLCP (ORCPT ); Fri, 6 Nov 2015 06:02:15 -0500 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=freescale.com; linux.ie; dkim=none (message not signed) header.d=none;linux.ie; dmarc=none action=none header.from=freescale.com; Date: Fri, 6 Nov 2015 18:38:36 +0800 From: Liu Ying To: Philipp Zabel CC: , , Subject: Re: [PATCH 2/2] drm/imx: Remove the primary plane created by create_primary_plane() Message-ID: <20151106103835.GB2036@shlinux2> References: <1446632158-19998-1-git-send-email-Ying.Liu@freescale.com> <1446632158-19998-2-git-send-email-Ying.Liu@freescale.com> <1446804348.4569.1.camel@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <1446804348.4569.1.camel@pengutronix.de> User-Agent: Mutt/1.5.21 (2010-09-15) X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1;BY2FFO11FD026;1:v03WyU2W4xrCIdekEayxdRzWpZD0H3KKfY5ukE3kjSFabzpkt9j83aLH1Z/eUrZyvNE8adqXjHDxVBopTKWDyxIcRdKnq0EurRMPh1xJVdMD9G73fakyjOVOA5bv9DBImI0A1ugWendrG4YPDnH1WANyvm8RERQjkxCaGeym1jtKstQWYOQSz0+BbbRsW6ZqtcdzAL2MDpRd7WwwiqjNDGuEIZynN/RK1ZGSxAOU+8vVVCOaWIFQXoRoGwCm9Z9NtYZueZaL+BEomioMA6lL+AbJVljOoggRtZbqs8KyD0cWNcDzCaYkXNM8P2R4m4n6dpV/n2hSfMrH8E/e/AuoPCefK7X9QZ/UXUob/YuOsLn5P2hH7vhX9fc1t3XV115D X-Forefront-Antispam-Report: CIP:192.88.168.50;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10019020)(6009001)(2980300002)(1110001)(1109001)(339900001)(189002)(24454002)(199003)(83506001)(97736004)(5001960100002)(2950100001)(81156007)(5890100001)(110136002)(33656002)(77096005)(4001350100001)(50466002)(5008740100001)(85426001)(92566002)(189998001)(87936001)(19580395003)(19580405001)(33716001)(105606002)(106466001)(104016004)(11100500001)(5007970100001)(6806005)(86362001)(50986999)(46406003)(54356999)(97756001)(47776003)(23726002)(76176999);DIR:OUT;SFP:1102;SCL:1;SRVR:BLUPR0301MB2001;H:tx30smr01.am.freescale.net;FPR:;SPF:Fail;PTR:InfoDomainNonexistent;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;BLUPR0301MB2001;2:+snCXds9cU9O2cQDw2I+j/O7mAAZ46Y+uAjJPZTrBaalvwn2yn2XTbdIo85YU/u7uLsRkrn+Z6zy8rDn0B2d7jS97uB/9PS01jJFe+GOz84NiOrQX2/yAUDpwjudzKAEYWje2fBQg/MfvtWP4iqg4ZrFDcVVuLAEag0ChRBaNxI=;3:X9n36MWmvAhLWw+y4U4Xd70u8klYkoEIjSbbInPh+Opl7kVvsDbu/9jRxDneCMwdJJN4dAHQ9XVLjuzN6hid++oAos33YOj3hkswB9wKw0CDZGvWK7S1wYGQwF91nWSJO4UO0WZaUm21Cs7uaYjx4tkqtUq05hzxeVWRVAnccheYIUZXPLFiOVzEQd49JNfBUsgR+mrT2DpfXJiuADIvsLb/rhXb6nUzHxLM7UjEJfw=;25:MOq5z/tyeAi3I1BkXyH1d2b/rirMkYbq2hFPZhwGwPJj1vUxv9fBNr4sJJ3SMsrUTFfpAGnLo4eG9VnuhfjRM4z++jyEyFjV/doQwg5TBP+0xPsh7m4hFP1FRP6UVuY/pONBa+hAnJv1DWiEyyVY/JvQpAF4wx97Lo0L7pTNiRiS6BQY+1T+aRaZotq8XDzxoWto7Wrw7DUPbAauyqi6vEbhcChKlUbeSMv1tqdpsCld5946rhxqF2glfw82hUNRE7Sne1Q1/V5h0HkMcymFRQ== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR0301MB2001; X-Microsoft-Exchange-Diagnostics: 1;BLUPR0301MB2001;20:Jb/hyYrKL1IBCqybTdT8R5dLhMNtFWGeP0Vhh9VPcJskb9rtBaTCe5HTFf/OdFhxNhgRAlXkMFf/W1gBJ11mNxTO772Bd9QxKiEcpMqugNN24y9qGL+XC+QOhqRf//d3ePTxS6frmQa1fYJFxubmsAPkTBI70UGJEG4BdBGEX4QbyeZaGqreKgxqmZclLx/DzzthKoRG5l4a/VqSucBsOULswIUzdp5wuH8sF8/Vn6yptgAEnur3NGrurAJo8ny8ucKJIKSElhF2EG7sz31Ah0wxj8uG+Zxg370BDpaET0mcVXgRq8pL2Qumx2CVHTFrjxvEiRWm6zj2wjAvMxxgO0Jqu3qETTiDkMvWJvf/JZY=;4:K0QrKSMhKSO/smAkgBg2FQYECPW3AW9MjkRYrP/e6GlhKhi0LnTS5qWqWxsEp0fe7xZNj1GMRMWqOJkljpxoOal8Rplb6Kqr+WebeapSwUxl8Z6WnlthjdepfVWg8qnuJRdeYE5jzGVp+xs9+EV2SmOZWV6dioIbi9x/sOvExK+BU5aahThL3HTrimsNZS1PdTwc2WrMxA7A0dayy5da2WqTn1A1YJOKthtoFYCoTBA6y+KeOGI0Zl4W2RZE0MhDK1IPEuZ/hY5HQa8vSthwDCgtVPivoYN2p9nij5FJfTA4Cql3XB9D80Y5Huze0AoHRLIyUHFFJQ3/GflTWXVebOOPHbusj97I47Lh+h0H4LU2FQf6PdX8jpIcztd3Irti X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(101931422205132); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(520078)(8121501046)(5005006)(10201501046)(3002001);SRVR:BLUPR0301MB2001;BCL:0;PCL:0;RULEID:;SRVR:BLUPR0301MB2001; X-Forefront-PRVS: 07521929C1 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BLUPR0301MB2001;23:gv6etShxDCPQUg9lAuZRSBGXqeMT2WVFqNM+cIv?= =?us-ascii?Q?SgRjx4SWH2DrIb/0SH2YKq1WTsdzWv5gTU0zVdy4AP9KOudExPJ5XHEMEyHh?= =?us-ascii?Q?ZJpp0Taj+crTX1BwICncAtvrE35AoxDuI+T7okqFJOsNswHCxqUlAyqu2WGr?= =?us-ascii?Q?d562J9E2+nS8sDbvgfw6q+OQnGxbEIHeU7MmvboNV5BFsAPyD967xJfsvSDO?= =?us-ascii?Q?1HSWXJ6altUoFrjTEl3O1pPcKvgOdKmqK74cubw75PoBtjNBLfFds+cAkQk0?= =?us-ascii?Q?R7ESrKdlr6AToAVo85cDo24NTH6eiOR7cQQ7T6843RW2ozBj6GRkFzWXPrxG?= =?us-ascii?Q?rUVoQQes7dLLmvR1KekG/ptSVq3ojnkuw4xWur5jbbAWvfolDyhMGkdYcqEd?= =?us-ascii?Q?6UDswxU/9blXhAIbqKMpUyXyRJ3qjLc5+2T8f7j15vQc3xIduO9BqAluE+k4?= =?us-ascii?Q?+g6RcTo83QoUh6kl0yPp1FkhlEt+mmyWaGXoeBf+/WSyNvpaw+z6MNf+QtcQ?= =?us-ascii?Q?xvjH+Moa/mo5+xVBMcEUanfojmT6GSHkB08rrZLFB+iQsyiTs2zJ/uikbblb?= =?us-ascii?Q?7NSR5kZwvvz6KWzLIekRQLX1o4UvUBnBhdtxW2MKIm7nj/HHZr/NvAFifhf0?= =?us-ascii?Q?OuL3L/Shpu4hjyj1+wRuN/CIvYTrrfqtrmkc2aRzKsCwpdC+sAGpQIIh0gLS?= =?us-ascii?Q?ztkJ45MARz+Ilb9sEbGUGaVtUIe2/AEuNAwS6qJlG42vP7gj95bBIKzXyDLK?= =?us-ascii?Q?vSkPiBlXlQyx5Qg3FTpyvT77+yaoM/BS5CxmndOAvk/dfbF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ginalArrivalTime: 06 Nov 2015 10:40:41.0581 (UTC) X-MS-Exchange-CrossTenant-Id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=710a03f5-10f6-4d38-9ff4-a80b81da590d;Ip=[192.88.168.50];Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0301MB2001 X-Microsoft-Exchange-Diagnostics: 1;BLUPR0301MB2004;2:tOVb+cqK4jTEnOMa5PH+eoS4+lc9RsE6aloLL4xqlf8YFVFFDH2f2VJxTFzZhQnFEAXSiwMLxGvEDqWSmflsWzafthBWUlZOIL+0pAAWsY56hfgwgQ+cnEEC5itZz7NAfi70fjf4YvMuQ5yrIY6SgEmRu4MvaszrKpmhceTk0/M=;23:hrsZ3Wrn9ZxrGB4p4WZCAqcIGC6HMuj0UWPXn5KEXt91xxcEnzg2E4lvmjeQUVhK1WnswChclC0szqeuF6JJuaCTkniR6jhnehcAuJ3fo9QofuNLcxVULFbkwI/EmTgWEpnjtOFkZvXKMciaBctmkX+iZnOmI5kEN0AvRMmbUNURny/fVo0hTIU539KygGje X-OriginatorOrg: freescale.com Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2981 Lines: 64 On Fri, Nov 06, 2015 at 11:05:48AM +0100, Philipp Zabel wrote: > Am Mittwoch, den 04.11.2015, 18:15 +0800 schrieb Liu Ying: > > Since we are using ipu_plane_init() to add one primary plane for each > > IPU CRTC, it's unnecessary to create the safe one by using the helper > > create_primary_plane(). > > > > Furthermore, the safe one is attached to crtc->primary, which actually > > carries a framebuffer(crtc->primary->fb) created by the fbdev helper to > > build up the fbcon. Instead, the one created by ipu_plane_init() is > > dangling, but it is the one actually does ipu_plane_mode_set() for the > > fbcon. This may causes the mismatch bewteen ipu_plane->enabled(true) and > > ipu_plane->base.fb(NULL). Thus, it brings a NULL pointer dereference > > issue in ipu_plane_mode_set() when we try to additionally touch the > > IDMAC channel of the ipu_plane. This issue could be reproduced by > > running the drm modetest with command line 'modetest -P 19:1024x768@XR24' > > on the i.MX6Q SabreSD platform(single LVDS display). This patch binds > > the plane created by ipu_plane_init() with crtc->primary and removes the > > safe one to address this issue. > > > > Signed-off-by: Liu Ying > > --- > > drivers/gpu/drm/imx/imx-drm-core.c | 3 ++- > > drivers/gpu/drm/imx/ipuv3-crtc.c | 6 ++++++ > > 2 files changed, 8 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/gpu/drm/imx/imx-drm-core.c b/drivers/gpu/drm/imx/imx-drm-core.c > > index 6faa735..08eceeb 100644 > > --- a/drivers/gpu/drm/imx/imx-drm-core.c > > +++ b/drivers/gpu/drm/imx/imx-drm-core.c > > @@ -373,7 +373,8 @@ int imx_drm_add_crtc(struct drm_device *drm, struct drm_crtc *crtc, > > drm_crtc_helper_add(crtc, > > imx_drm_crtc->imx_drm_helper_funcs.crtc_helper_funcs); > > > > - drm_crtc_init(drm, crtc, > > + /* The related primary plane will be created in ipu_plane_init(). */ > > + drm_crtc_init_with_planes(drm, crtc, NULL, NULL, > > imx_drm_crtc->imx_drm_helper_funcs.crtc_funcs); > > We rather should generate the plane first and add the primary_plane > parameter to imx_drm_add_crtc than calling drm_crtc_init_with_planes > without planes. Yes, that is the regular way. I thought about that, though I took the easy approach here. The question is that we currently generate the crtc pipe number in imx_drm_add_crtc() first, and then pass it to ipu_plane_init(). Do you think it would be good to add OF alias id for IPU, pass the id to ipu_crtc_init() via struct ipu_soc and determine the pipe number in ipu_crtc_init() by using the IPU id and pdata->di? This way, ipu_plane_init() may know the pipe number in the first place. Or, any other suggestions? Regards, Liu Ying > > regards > Philipp > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/