Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp413038imw; Mon, 4 Jul 2022 11:41:33 -0700 (PDT) X-Google-Smtp-Source: AGRyM1v3i3jMTj5HOeMwCo1Nrcthy265jnLwVv1akWJxqIQcVXz6+3haFfZcqqffW2cInG06U/2U X-Received: by 2002:a17:906:5a4d:b0:722:e8ce:8c7f with SMTP id my13-20020a1709065a4d00b00722e8ce8c7fmr17952774ejc.405.1656960093709; Mon, 04 Jul 2022 11:41:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656960093; cv=none; d=google.com; s=arc-20160816; b=hMQnk9DqAv9dwsDp+vS9EHrSIegvZshEVsjTW26TiW4Z0LDDkV4bAj4WGInvMWFlbx HUZ8gL/t16kehe+0IYOigRZn7rh3SKNmS8QOW4qe1Uucf5cnMj9Sn9M3hJ4c3TENZT18 w/4Sq/ZL+SGay9Zxzu3b1F0RNJgPwKWkWtF+tBzRKi6ocUGgg5L3+OKiOCKJeq/9lV4Z QQ646iimvN3QLl6WX4cGzWHpipOX6/q/UnayzlDGoLrEddTeS27+EbS/AJ02P4E+Kumc pCHbi+w+o3MV6ZW6wNo+JDEPR5JIu0ORP1kQn9nFORiQQwBTEsp/JQe0K96spBfJdgq0 WU+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:references :cc:to:from:content-language:subject:user-agent:mime-version:date :message-id:dkim-signature; bh=yK261D6HT2CVyvMevzRHg6YQDQr/r3Jm74jKb1CkJiA=; b=hht7CSdzcI0BcZQ+M1Qem1PYOvibYFK4HMcPdYxFQfsoL+UyUqPY4NFHH6Z0gi8AWi L7krP2w6pAh7nEEnBamgb2ZnFw/aFdc79ndsvWh6cjdH2CVTgxP8TKKqza/QUb9zBE4s m00QRIAyTtgk1QKIe/V8EiH+qHGgnrYfoK4Afir08bpTLYQn4tYT9w27akhbNfpQ3FS0 BQ52qoOys3Jre1u7Zzt/tGQ8HcYU+FSZeajd3PR5YJbK31LRwFprR96GijZ6IrtheSnJ qANqWMHUUY/1UUugBvv6ERfPDd60t1L2TELHJJ2/bDIm88V6/RJWxIdcIM5LlOzcC7AJ qgEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=u5E0t5qI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dn18-20020a17090794d200b006f3976ed175si39430702ejc.938.2022.07.04.11.41.07; Mon, 04 Jul 2022 11:41:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=u5E0t5qI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233369AbiGDSOq (ORCPT + 99 others); Mon, 4 Jul 2022 14:14:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32798 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233326AbiGDSOl (ORCPT ); Mon, 4 Jul 2022 14:14:41 -0400 Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2F222C7 for ; Mon, 4 Jul 2022 11:14:40 -0700 (PDT) Received: by mail-lf1-x130.google.com with SMTP id z21so16901445lfb.12 for ; Mon, 04 Jul 2022 11:14:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=message-id:date:mime-version:user-agent:subject:content-language :from:to:cc:references:in-reply-to:content-transfer-encoding; bh=yK261D6HT2CVyvMevzRHg6YQDQr/r3Jm74jKb1CkJiA=; b=u5E0t5qI//wrIJMe7jyJw1s5HaBn6u2jtbBpeqrjqVCy5pEtO5+2UR59UJlmSGcDCT l1jw+MYdnW15Xi0g8am4oVWwxVfXE7XMMAc7/xL2pyw11VIaCuL9sx15zvOSeEvkr7rR z5XWhD5XGrKcJ9vhDc68aCmfDg2EqI5LCkKDqdm5aHm79fqjgLrGtNepYA8GZGEAzM9/ qdFVoxoxGsNiQC2SJx1z2crW6CgeGUxN7hqxrMrK0My217aEFMKo6t3VnFSRUMs4k/np EiCpPjZl6akLiyKdhF/LPkDgjD97ehSE13uQxmxp7ZUmXlgHgujueO9Qb45scuRvyrr4 UM5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:from:to:cc:references:in-reply-to :content-transfer-encoding; bh=yK261D6HT2CVyvMevzRHg6YQDQr/r3Jm74jKb1CkJiA=; b=FD0pxLFzrOKG5w5/8VkniKA7di2syTVvdsr2Zdtp7IaPuu1MXc6CRcxL6ZnYi8khxx T/lyeZQGiYDPKmRnmhvUlFnJG8lZ59XyFQwfJlHHuN9xwBmox923ta/lVSIyxsXeb/lq ak+H0DVI32Bfn3hEM+2olFQUQeMwV/wkUlAaQwwyvpFTjkJ/aZZLV5s4b21g5EsXT1zd 8M34iVyG3ekVw0bz4qtZBDWLpmE6Yqc3FN0eKX9pM+F5pBMffUjzcOutcRNkEciUzfqd rpZMvfPE+d+iSo5nGVZcl7lhW9FmLu5/dsG475+WZF1ZKHhN+XW3zNguG9jRRUpv/MAm xZVQ== X-Gm-Message-State: AJIora/2S8dBRA63fw9Oi4+uDDcTRGVdN7t/14FI69fOPbyXSyyPeFVK rfcBc6iemSC3Za+n2WkTjYqTCg== X-Received: by 2002:a05:6512:15a1:b0:47f:933e:a865 with SMTP id bp33-20020a05651215a100b0047f933ea865mr18387360lfb.200.1656958478998; Mon, 04 Jul 2022 11:14:38 -0700 (PDT) Received: from [192.168.1.212] ([37.153.55.125]) by smtp.gmail.com with ESMTPSA id d6-20020a2e96c6000000b0025bdd6af056sm3461335ljj.45.2022.07.04.11.14.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 04 Jul 2022 11:14:38 -0700 (PDT) Message-ID: <1df69cf9-7610-45af-240c-1b8e02953bc1@linaro.org> Date: Mon, 4 Jul 2022 21:14:37 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Subject: Re: [PATCH] drm/msm/dp: make eDP panel as the first connected connector Content-Language: en-GB From: Dmitry Baryshkov To: Rob Clark , Doug Anderson , Kuogee Hsieh Cc: Sean Paul , Stephen Boyd , Vinod Koul , Daniel Vetter , David Airlie , Andy Gross , Bjorn Andersson , "Abhinav Kumar (QUIC)" , "Aravind Venkateswaran (QUIC)" , "Kuogee Hsieh (QUIC)" , Sankeerth Billakanti , freedreno , dri-devel , linux-arm-msm , LKML References: <1656429606-2765-1-git-send-email-quic_khsieh@quicinc.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 30/06/2022 09:14, Dmitry Baryshkov wrote: > > > On 30 June 2022 04:57:35 GMT+03:00, Rob Clark wrote: >> On Wed, Jun 29, 2022 at 5:36 PM Doug Anderson wrote: >>> >>> Hi, >>> >>> On Tue, Jun 28, 2022 at 1:14 PM Dmitry Baryshkov >>> wrote: >>>> >>>> On 28 June 2022 18:20:06 GMT+03:00, Kuogee Hsieh wrote: >>>>> Some userspace presumes that the first connected connector is the main >>>>> display, where it's supposed to display e.g. the login screen. For >>>>> laptops, this should be the main panel. >>>>> >>>>> This patch call drm_helper_move_panel_connectors_to_head() after >>>>> drm_bridge_connector_init() to make sure eDP stay at head of >>>>> connected connector list. This fixes unexpected corruption happen >>>>> at eDP panel if eDP is not placed at head of connected connector >>>>> list. >>>> >>>> The change itself is a good fix anyway. (And I'd ack it.) However I would like to understand why does it fix the corruption issue. What is we have eDP and DSI, with DSI ending up before the eDP? Would we see the issue? >>>> Also could you please describe the mind of corruption you are observing? >>> >>> I've spent a whole bunch of time poking at this and in the end my >>> conclusion is this: >>> >>> 1. The glitchyness seems to be a result of the Chrome OS userspace >>> somehow telling the kernel to do something wrong. >>> >>> 2. I believe (though I have no proof other than Kuogee's patch fixing >>> things) that the Chrome OS userspace is simply confused by the eDP >>> connector being second. This would imply that Kuogee's patch is >>> actually the right one. >>> >>> 3. It would be ideal if the Chrome OS userspace were fixed to handle >>> this, but it's an area of code that I've never looked at. It also >>> seems terribly low priority to fix since apparently other OSes have >>> similar problems (seems like this code was originally added by >>> RedHat?) >>> >>> >>> Specifically, I tested with a similar but "persistent" glitch that I >>> reproduced. The glitch Kuogee was digging into was a transitory glitch >>> on the eDP (internal) display when you plugged in a DP (external) >>> display. It would show up for a frame or two and then be fixed. I can >>> get a similar-looking glitch (vertical black and white bars) that >>> persists by doing these steps on a Chrome OS device (and Chrome OS >>> kernel): >>> >>> a) Observe screen looks good. >>> b) Observe DP not connected. >>> c) Plug in DP >>> d) See transitory glitch on screen, then it all looks fine. >>> e) set_power_policy --ac_screen_dim_delay=5 --ac_screen_off_delay=10 >>> f) Wait for screen to turn off >>> g) Unplug DP >>> h) Hit key on keyboard to wake device. >>> i) See glitchy. >>> j) Within 5 seconds: set_power_policy --ac_screen_dim_delay=5000 >>> --ac_screen_off_delay=10000 >>> >>> Once I'm in the persistent glitch: >>> >>> * The "screenshot" command in Chrome OS shows corruption. Not exactly >>> black and white bars, but the image produced has distinct bands of >>> garbage. >>> >>> * I can actually toggle between VT2 and the main screen (VT1). Note >>> that VT1/VT2 are not quite the normal Linux managed solution--I >>> believe they're handled by frecon. In any case, when I switch to VT2 >>> it looks normal (I can see the login prompt). Then back to VT1 and the >>> vertical bars glitch. Back to VT2 and it's normal. Back to VT1 and the >>> glitch again. This implies (especially with the extra evidence of >>> screenshot) that the display controller hardware is all fine and that >>> it's the underlying data that's somehow messed up. >> >> fwiw, from looking at this a bit w/ Doug, I think the "glitch" is >> simply just an un-renderered buffer being interpreted by the display >> controller as UBWC (because userspace tells it to) > > Thanks for the description. I think the userspace code should be fixed too, but this patch can go in on its own. > > Reviewed-by: Dmitry Baryshkov After some time (please excuse me), musing with the code and even picking up the commit for the merge branch, I understood the fact that I did not like about this change. It moves all panel connectors (generic code) from the DP-specific driver. I'd like to retract my R-b. Please move this call to the msm_drm_init(). Calling this function somewhere after the ->kms_init() would make sure that all panel connectors are close to the top of the list, whichever MDP/DPU driver is used and whichever actual interface is bound to this panel. > > >> >> BR, >> -R >> >>> When I pick Kuogee's patch then this "persistent" glitch goes away >>> just like the transitory one does. >>> >>> I'm going to go ahead and do: >>> >>> Reviewed-by: Douglas Anderson >>> Tested-by: Douglas Anderson > -- With best wishes Dmitry