From patchwork Sat Aug 13 15:00:04 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 9280223 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 84DA460231 for ; Mon, 15 Aug 2016 00:31:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 745B928B06 for ; Mon, 15 Aug 2016 00:31:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 684B728B17; Mon, 15 Aug 2016 00:31:57 +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.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID 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 C2F3228B06 for ; Mon, 15 Aug 2016 00:31:56 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3A51F6E35A; Mon, 15 Aug 2016 00:31:40 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:3201:214:fdff:fe10:1be6]) by gabe.freedesktop.org (Postfix) with ESMTPS id 08CC66E22F for ; Sat, 13 Aug 2016 15:00:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2014; h=Sender:In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=QK9oIVO8OBa4m9IQpDR9GonsnTVhbc3zdBwlDUj89eE=; b=FVyrUFGiJ7Ju29KJZpZR3gA5dvYpGJ6bYYQHr4B2xdstURX3ecc8xJm696sW74aiebf36DraQgbrgtvjWCL6Do5dU09WPXNzN1SEABURakZV9wbpiwIesAW6ifyvwQfGZrj1NeOIqVAiENSq++3CsVF3xG3xcASbxJ9FsIYeS0g=; Received: from n2100.armlinux.org.uk ([fd8f:7570:feb6:1:214:fdff:fe10:4f86]:38289) by pandora.armlinux.org.uk with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1bYaQ2-0007uy-VN; Sat, 13 Aug 2016 16:00:15 +0100 Received: from linux by n2100.armlinux.org.uk with local (Exim 4.76) (envelope-from ) id 1bYaPu-0003PW-UK; Sat, 13 Aug 2016 16:00:07 +0100 Date: Sat, 13 Aug 2016 16:00:04 +0100 From: Russell King - ARM Linux To: Liu Ying Subject: Re: [PATCH v3 03/10] drm/imx: atomic phase 1: Use transitional atomic CRTC and plane helpers Message-ID: <20160813150004.GA12419@n2100.armlinux.org.uk> References: <1467618039-7457-1-git-send-email-gnuiyl@gmail.com> <1467618039-7457-4-git-send-email-gnuiyl@gmail.com> <20160813101154.GA3864@n2100.armlinux.org.uk> <20160813104531.GA4844@n2100.armlinux.org.uk> <20160813112947.GA6718@n2100.armlinux.org.uk> <20160813140910.GA11506@n2100.armlinux.org.uk> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20160813140910.GA11506@n2100.armlinux.org.uk> User-Agent: Mutt/1.5.23 (2014-03-12) X-Mailman-Approved-At: Mon, 15 Aug 2016 00:31:38 +0000 Cc: Daniel Vetter , 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-Virus-Scanned: ClamAV using ClamSMTP On Sat, Aug 13, 2016 at 03:09:10PM +0100, Russell King - ARM Linux wrote: > Okay, this is what I've ended up with - I'm not sure whether it's > correct or not, but this dirty patch allows the full series to be > applied and still have working userspace. > > I still need to undo all the reverts I have touching imx-drm between > patch 10 of this set and 4.8-rc1... I tried a slightly different approach, so we at least get the simple plane updates without having to go through the disable path: but unfortunately this leads to a kernel oops. From what I can tell, lock->class_cache[subclass] was 0xffffffff. subclass was 0, lock was 0xec58631c. [drm:drm_atomic_helper_commit_cleanup_done] *ERROR* [CRTC:24:crtc-0] flip_done timed out Alignment trap: not handling instruction e1921f9f at [][ 651.472496] Unhandled fault: alignment exception (0x001) at 0x00000103 pgd = ecea4000 [00000103] *pgd=00000000 Internal error: : 1 [#1] SMP ARM Modules linked in: bnep rfcomm bluetooth nfsd rc_cec snd_soc_fsl_spdif caam_jr coda imx_pcm_dma imx_sdma v4l2_mem2mem videobuf2_dma_contig imx2_wdt videobuf2_vmalloc dw_hdmi_cec imx_thermal dw_hdmi_ahb_audio videobuf2_memops caam etnaviv snd_soc_imx_spdif CPU: 0 PID: 1091 Comm: dbus-daemon Not tainted 4.8.0-rc1+ #2043 Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree) task: ee3755c0 task.stack: ece74000 PC is at __lock_acquire+0xd4/0x18fc LR is at lock_acquire+0xd8/0x250 pc : [] lr : [] psr: a0070193 sp : ece75730 ip : ece74000 fp : ece757b4 r10: 00000000 r9 : c0acbef0 r8 : ec58631c r7 : 00000001 r6 : ee3755c0 r5 : c0a925f8 r4 : c125ad8c r3 : 00000000 r2 : 00000103 r1 : 00000000 r0 : ffffffff Flags: NzCv IRQs off FIQs on Mode SVC_32 ISA ARM Segment none Control: 10c5387d Table: 3cea404a DAC: 00000051 Process dbus-daemon (pid: 1091, stack limit = 0xece74210) Stack: (0xece75730 to 0xece76000) (omitted) Backtrace: [] (__lock_acquire) from [] (lock_acquire+0xd8/0x250) r10:00000000 r9:c0acbef0 r8:00000000 r7:00000000 r6:ec58631c r5:60070193 r4:00000000 [] (lock_acquire) from [] (_raw_spin_lock_irqsave+0x4c/0x60) r10:ee1ca000 r9:0000040a r8:00000000 r7:00000000 r6:c007a48c r5:a0070193 r4:ec58630c [] (_raw_spin_lock_irqsave) from [] (complete_all+0x1c/0x4c) r6:c0acdd18 r5:ec586308 r4:ec58630c [] (complete_all) from [] (drm_send_event_locked+0x30/0x104) r6:c0acdd18 r5:c0acb61d r4:ebc57200 r3:04240423 [] (drm_send_event_locked) from [] (send_vblank_event+0x94/0x1bc) r5:c0acb61d r4:ebc57200 [] (send_vblank_event) from [] (drm_handle_vblank+0x158/0x364) r10:ee1ca23c r9:ee1ca234 r8:0000040a r7:ee1ca000 r6:00000000 r5:ee1ca228 r4:ebc57200 [] (drm_handle_vblank) from [] (drm_crtc_handle_vblank+0x1c/0x20) r10:ece75964 r9:c0a3d554 r8:00000000 r7:0000012f r6:ee114a10 r5:ee114a00 r4:ee055940 [] (drm_crtc_handle_vblank) from [] (imx_drm_handle_vblank+0x14/0x18) [] (imx_drm_handle_vblank) from [] (ipu_irq_handler+0x14/0x1c) [] (ipu_irq_handler) from [] (__handle_irq_event_percpu+0xa4/0x428) [] (__handle_irq_event_percpu) from [] (handle_irq_event_percpu+0x24/0x60) r10:ece75ab0 r9:f4001100 r8:00000009 r7:00000000 r6:ee114a10 r5:ee114a00 r4:ee114a00 [] (handle_irq_event_percpu) from [] (handle_irq_event+0x40/0x64) r5:ee114a60 r4:ee114a00 [] (handle_irq_event) from [] (handle_level_irq+0xb0/0x138) r6:ee114a10 r5:ee114a60 r4:ee114a00 r3:c0a323d8 [] (handle_level_irq) from [] (generic_handle_irq+0x20/0x30) r6:ee146810 r5:ece75a08 r4:00000017 r3:c009a114 [] (generic_handle_irq) from [] (ipu_irq_handle+0xa8/0xd8) [] (ipu_irq_handle) from [] (ipu_irq_handler+0x5c/0xb4) r8:ee820000 r7:00000026 r6:ee146810 r5:c0a44288 r4:eea46f10 [] (ipu_irq_handler) from [] (generic_handle_irq+0x20/0x30) r6:00000000 r5:ece75c68 r4:c0a37240 [] (generic_handle_irq) from [] (__handle_domain_irq+0x5c/0xb8) [] (__handle_domain_irq) from [] (gic_handle_irq+0x4c/0x9c) r8:c0a92950 r7:000003eb r6:c0a3dba4 r5:f400010c r4:f4000100 r3:ece75ab0 [] (gic_handle_irq) from [] (__irq_svc+0x70/0x98) Exception stack(0xece75ab0 to 0xece75af8) 5aa0: 00000001 ee375a70 00000000 60070193 5ac0: 20070113 c0a4b910 00000001 00000002 00000002 c0a4b680 c0acbc34 ece75b14 5ae0: ece75ad0 ece75b00 c00821a0 c074e028 60070113 ffffffff r10:c0acbc34 r9:ece74000 r8:00000002 r7:ece75ae4 r6:ffffffff r5:60070113 r4:c074e028 r3:ee3755c0 [] (_raw_spin_unlock_irqrestore) from [] (swake_up+0x3c/0x40) r5:20070113 r4:c0a4b910 [] (swake_up) from [] (rcu_gp_kthread_wake+0x48/0x4c) r5:60070113 r4:eef85340 [] (rcu_gp_kthread_wake) from [] (rcu_process_callbacks+0x3a8/0x93c) [] (rcu_process_callbacks) from [] (__do_softirq+0xe8/0x5e4) r10:c0acbc34 r9:00000024 r8:00000002 r7:00000002 r6:c0a3d554 r5:00000009 r4:c0a3d0a4 [] (__do_softirq) from [] (irq_exit+0xe4/0x150) r10:ece75c68 r9:f4001100 r8:ee820000 r7:0000001d r6:00000000 r5:00000000 r4:c0a37240 [] (irq_exit) from [] (__handle_domain_irq+0x60/0xb8) [] (__handle_domain_irq) from [] (gic_handle_irq+0x4c/0x9c) r8:c0a92950 r7:000003eb r6:c0a3dba4 r5:f400010c r4:f4000100 r3:ece75c68 [] (gic_handle_irq) from [] (__irq_svc+0x70/0x98) Exception stack(0xece75c68 to 0xece75cb0) 5c60: 00000001 ece75eb0 ece75ca8 ee765748 ee765748 ee4357e8 5c80: ed7e9011 eeefa000 c0acb1f6 00002081 ece75eb0 ece75cf4 ece75cb8 ece75cb8 5ca0: c0181764 c0181838 60070013 ffffffff r10:ece75eb0 r9:ece74000 r8:c0acb1f6 r7:ece75c9c r6:ffffffff r5:60070013 r4:c0181838 r3:ee3755c0 [] (__d_lookup_rcu) from [] (lookup_fast+0x48/0x384) r10:ece75d5c r9:ee955910 r8:ece75d58 r7:ee4357e8 r6:00000000 r5:ece75d60 r4:ece75ea8 [] (lookup_fast) from [] (walk_component+0x34/0x284) r10:90954373 r9:ff010301 r8:ece75ea8 r7:00000001 r6:00000000 r5:2f727375 r4:ece75ea8 [] (walk_component) from [] (link_path_walk+0x19c/0x4b8) r7:ed7e9015 r6:ee4357e8 r5:2f727375 r4:7fffffff [] (link_path_walk) from [] (path_openat+0x70/0xee0) r10:ece75ea8 r9:ece74000 r8:ece75f5c r7:00000003 r6:ece75ea8 r5:ece75f5c r4:00000046 [] (path_openat) from [] (do_filp_open+0x68/0xbc) r10:00000000 r9:ece74000 r8:c000ff44 r7:00000003 r6:ece75ea8 r5:ece75f5c r4:00000046 [] (do_filp_open) from [] (do_sys_open+0x120/0x1d4) r7:00000142 r6:ffffff9c r5:ed7e9000 r4:00000046 [] (do_sys_open) from [] (SyS_openat+0x14/0x18) r10:00000000 r8:c000ff44 r7:00000142 r6:801462c8 r5:bed94468 r4:80146450 [] (SyS_openat) from [] (ret_fast_syscall+0x0/0x1c) Code: 0affffe9 e2802f41 f592f000 e1921f9f (e2811001) ---[ end trace 8ffd323ac322f062 ]--- diff --git a/drivers/gpu/drm/imx/ipuv3-plane.c b/drivers/gpu/drm/imx/ipuv3-plane.c index 4ad67d015ec7..1cd3422e6e62 100644 --- a/drivers/gpu/drm/imx/ipuv3-plane.c +++ b/drivers/gpu/drm/imx/ipuv3-plane.c @@ -278,7 +278,7 @@ static int ipu_plane_atomic_check(struct drm_plane *plane, if (WARN_ON(!crtc_state)) return -EINVAL; - /* CRTC should be enabled */ + /* CRTC should be enabled -- why? */ if (!crtc_state->enable) return -EINVAL; @@ -322,10 +322,14 @@ static int ipu_plane_atomic_check(struct drm_plane *plane, * since we cannot touch active IDMAC channels, we do not support * resizing the enabled plane or changing its format */ +#if 0 if (old_fb && (state->src_w != old_state->src_w || state->src_h != old_state->src_h || - fb->pixel_format != old_fb->pixel_format)) + fb->pixel_format != old_fb->pixel_format)) { + printk("%s:%d: fail\n", __func__, __LINE__); return -EINVAL; + } +#endif eba = drm_plane_state_to_eba(state); @@ -335,9 +339,6 @@ static int ipu_plane_atomic_check(struct drm_plane *plane, if (fb->pitches[0] < 1 || fb->pitches[0] > 16384) return -EINVAL; - if (old_fb && fb->pitches[0] != old_fb->pitches[0]) - return -EINVAL; - switch (fb->pixel_format) { case DRM_FORMAT_YUV420: case DRM_FORMAT_YVU420: @@ -391,11 +392,17 @@ static void ipu_plane_atomic_update(struct drm_plane *plane, struct drm_plane_state *state = plane->state; enum ipu_color_space ics; - if (old_state->fb) { + if (old_state->fb && + old_state->src_w == state->src_w && + old_state->src_h == state->src_h && + old_state->fb->pixel_format == state->fb->pixel_format && + old_state->fb->pitches[0] == state->fb->pitches[0]) { ipu_plane_atomic_set_base(ipu_plane, old_state); return; } + ipu_plane_disable(ipu_plane); + switch (ipu_plane->dp_flow) { case IPU_DP_FLOW_SYNC_BG: ipu_dp_setup_channel(ipu_plane->dp,