From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753092AbbJGJfj (ORCPT ); Wed, 7 Oct 2015 05:35:39 -0400 Received: from lucky1.263xmail.com ([211.157.147.133]:48436 "EHLO lucky1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752165AbbJGJfi (ORCPT ); Wed, 7 Oct 2015 05:35:38 -0400 X-263anti-spam: KSV:0; X-MAIL-GRAY: 1 X-MAIL-DELIVERY: 0 X-KSVirus-check: 0 X-ABS-CHECKED: 4 X-ADDR-CHECKED: 0 X-RL-SENDER: ykk@rock-chips.com X-FST-TO: jon.nettleton@gmail.com X-SENDER-IP: 58.22.7.114 X-LOGIN-NAME: ykk@rock-chips.com X-UNIQUE-TAG: X-ATTACHMENT-NUM: 0 X-DNS-TYPE: 0 Message-ID: <5614E761.8020706@rock-chips.com> Date: Wed, 07 Oct 2015 17:35:29 +0800 From: Yakir Yang User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.8.0 MIME-Version: 1.0 To: Russell King - ARM Linux CC: linux-rockchip@lists.infradead.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Fabio Estevam , David Airlie , Sascha Hauer , Philipp Zabel , Andy Yan , Jon Nettleton Subject: Re: [PATCH 08/12] drm: bridge/dw_hdmi: avoid enabling interface in mode_set References: <20150808160251.GM7557@n2100.arm.linux.org.uk> <5614969D.7030201@rock-chips.com> <20151007091830.GE21513@n2100.arm.linux.org.uk> In-Reply-To: <20151007091830.GE21513@n2100.arm.linux.org.uk> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/07/2015 05:18 PM, Russell King - ARM Linux wrote: > On Wed, Oct 07, 2015 at 11:50:53AM +0800, Yakir Yang wrote: >> >> On 08/09/2015 12:04 AM, Russell King wrote: >>> On a mode set, DRM makes the following sequence of calls: >>> * for_each_encoder >>> * bridge mode_fixup >>> * encoder mode_fixup >>> * crtc mode_fixup >>> * for_each_encoder >>> * bridge disable >>> * encoder prepare >>> * bridge post_disable >>> * disable unused encoders >>> * crtc prepare >>> * crtc mode_set >>> * for_each_encoder >>> * encoder mode_set >>> * bridge mode_set >>> * crtc commit >>> * for_each_encoder >>> * bridge pre_enable >>> * encoder commit >>> * bridge enable >>> >>> dw_hdmi enables the HDMI output in both the bridge mode_set() and also >>> the bridge enable() step. This is duplicated work - we can avoid the >>> setup in mode_set() and just do it in the enable() stage. This >>> simplifies the code a little. >>> >>> Signed-off-by: Russell King >> I have noticed that dw_hdmi driver have poweron/poweroff when >> driver detect HPD event in irq thread, that's also duplicated works, >> would you like to collect that changes into this one: >> >> static irqreturn_t dw_hdmi_irq(int irq, void *dev_id) >> { >> ...... >> >> if (intr_stat & HDMI_IH_PHY_STAT0_HPD) { >> if (phy_int_pol & HDMI_PHY_HPD) { >> dev_dbg(hdmi->dev, "EVENT=plugin\n"); >> >> hdmi_modb(hdmi, 0, HDMI_PHY_HPD, HDMI_PHY_POL0); >> >> dw_hdmi_poweron(hdmi); // no need here >> } else { >> dev_dbg(hdmi->dev, "EVENT=plugout\n"); >> >> hdmi_modb(hdmi, HDMI_PHY_HPD, HDMI_PHY_HPD, >> HDMI_PHY_POL0); >> >> dw_hdmi_poweroff(hdmi); // no need here >> } >> drm_helper_hpd_irq_event(hdmi->connector.dev); >> } >> ...... >> } > I'm very much of the opinion of making small logical changes. This > patch is one small logical change to the DRM-side logic to get rid > of the identified duplication there without touching anything else. > If removing the above calls to dw_hdmi_poweron()/dw_hdmi_poweroff() > were found to cause a regression, then the whole change would end > up being reverted, which would be annoying. Hmm... Yeah, it do make some driver logical changes, but I thought that's good, just make a clean on HPD thread, and I do give lots of test on chrome tree about this changes, guess a separate patch would be better. If you don't feel good enough about this, okay, I would give more test on that changes, and send upstream to request comment later. - Yakir