Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp60124iog; Wed, 29 Jun 2022 18:06:02 -0700 (PDT) X-Google-Smtp-Source: AGRyM1shXWY0ox/30x0UQs/aht/Gnl/SF7fSN6zedraw5GKluNNOQqJGTGEvyJX+3jUamiJmO8Kk X-Received: by 2002:aa7:d9c3:0:b0:435:bb08:9ada with SMTP id v3-20020aa7d9c3000000b00435bb089adamr7918416eds.171.1656551162320; Wed, 29 Jun 2022 18:06:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656551162; cv=none; d=google.com; s=arc-20160816; b=ztFNoRf40yQugjlV4Mib8bUrlDWtOcmJwnDHWevBOBJ5F97jnspQodzI5V7mSYuluA Sixk9DBorTEENJ4SaGN8cWfWAk1TF7o1EFPu1eI5nMW2GB4x4tMj9RjIztKMw3a4NBfc 8DC6vHMHkC724YLZcByGDSXmSCSg7SUL0PfTLYTJu7PvF1wHtjzI8kKDYAohc/mXd/9G eZnlCwG1d+TAfz3fF5+4oUvoURzXzBYjXh+93hN+F7PdMzJopNM7/TOtJ7eASKYeZtCH hfhEbnHZH4poOmG/5QczCWZDuO9ANyZrjUc3zFVotcA3tgIQzNQdIWMAiTlObjzQPC0n qqGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=MD/TmTcrQEiZqX2Bjoyo72hV/tgqwsB/VS7liK0M4hY=; b=m0Mh/9XjTUva+ypN7q1wiI2GIHwVMlGUbGGysdVdVT+LGUeKnLbrXlkrLAJjP0oBQh orlwFMc0+IXKlg8PCftcD5qkMkhVSFLOe4gC6pjDi9unGotxxYJBffkRFicIMi+wVaXM Pk1mxzOTIVfnYdXQUBM9pvdJh3INDi3uRKnSGeD0h6goo/0xe61298aWBG+Lk9DtY7Wf RF//SgGxwlVrwq5G6wbfV5Brzvyg475a0uhxQFaSJcgu9f8blcbed94zik6SUKWwUXVP kKOymZ+7uKf6GkIU0KrabpK9FbGafax4C0NsgM+AseJVA7rRSZIuM5nhdypfqUT1GkUd irtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=HeIA5Da9; 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=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mp34-20020a1709071b2200b00726e8b63a97si3213758ejc.988.2022.06.29.18.05.33; Wed, 29 Jun 2022 18:06:02 -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=@chromium.org header.s=google header.b=HeIA5Da9; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230081AbiF3AhF (ORCPT + 99 others); Wed, 29 Jun 2022 20:37:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229925AbiF3AhE (ORCPT ); Wed, 29 Jun 2022 20:37:04 -0400 Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com [IPv6:2a00:1450:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F23028717 for ; Wed, 29 Jun 2022 17:37:03 -0700 (PDT) Received: by mail-ej1-x635.google.com with SMTP id u12so35766091eja.8 for ; Wed, 29 Jun 2022 17:37:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=MD/TmTcrQEiZqX2Bjoyo72hV/tgqwsB/VS7liK0M4hY=; b=HeIA5Da9l8UvD4H4iDgPRtvuycOMJXJpAAfo8lblN1BJG1Th+zubJ+VY5Im1UUxsQe 2pZfW8CNWgyPy0WDAjKew+yjU3CQSjl56GNR5fKp0NRCndcOmqKoTe0IbTZgraD/kuWb TWXX9BCr+B1GfCA33OQtCqwDt5TssQC2VynmI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=MD/TmTcrQEiZqX2Bjoyo72hV/tgqwsB/VS7liK0M4hY=; b=8PEM7zT1smVYuTXYMES5ww9+BI+k4Am8uJ7Y+Fx2O95BZJLFlAFwsm0IuUpXaxahGK TSeLbZTrYR98chZ/Sm9aM63eM0Hsdvx69cBjq2kNmVTdEYBf7pueVQIr7Tddbm+bDrSr O1yr846f2UgEQjkmGFoImvpP5iMzJH3SfZ2x8EMct1y/AzrqU1wrJ5fYZeiV4b+2X3YT XjlaZunYIZYg7kRJGC+I1kfI8S3TEnXVxpJhDspjoDE2NC/VK+9Sm2m18hpgqJ7I15eW GkZtccYnEyxu2ekK6v+AJ7MiBin7dnFcfr+Gr6IljUliWadWs6qN6+qcUjbQ0n1tZJIR U45Q== X-Gm-Message-State: AJIora+oRZSrUkjZfTnih+5g4598bn9LmxLqzXfC0EV8y9qVBzSJ1zns CcV4WzxPyc7DGsZCNU7etEAgxgLVjmKccxa4fpE= X-Received: by 2002:a17:907:7b84:b0:726:c8a0:c9e7 with SMTP id ne4-20020a1709077b8400b00726c8a0c9e7mr5900788ejc.375.1656549421326; Wed, 29 Jun 2022 17:37:01 -0700 (PDT) Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com. [209.85.221.47]) by smtp.gmail.com with ESMTPSA id g6-20020a1709064e4600b007121b22b376sm8286710ejw.105.2022.06.29.17.36.59 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 29 Jun 2022 17:37:00 -0700 (PDT) Received: by mail-wr1-f47.google.com with SMTP id i25so19303546wrc.13 for ; Wed, 29 Jun 2022 17:36:59 -0700 (PDT) X-Received: by 2002:adf:d1c1:0:b0:21b:a5e9:b7b2 with SMTP id b1-20020adfd1c1000000b0021ba5e9b7b2mr5938881wrd.405.1656549418843; Wed, 29 Jun 2022 17:36:58 -0700 (PDT) MIME-Version: 1.0 References: <1656429606-2765-1-git-send-email-quic_khsieh@quicinc.com> In-Reply-To: From: Doug Anderson Date: Wed, 29 Jun 2022 17:36:45 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] drm/msm/dp: make eDP panel as the first connected connector To: Dmitry Baryshkov Cc: Rob Clark , 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 Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 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. 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