Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp3373678ioa; Tue, 26 Apr 2022 02:14:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwr/M9SLz9ctqY4LX7mVUquDAqSry2sD3Z7Bwv+lPUNR2c9ZkgP4cCXGyrs4BwV/Q54NLDv X-Received: by 2002:a05:6a00:244a:b0:4fa:ebf9:75de with SMTP id d10-20020a056a00244a00b004faebf975demr23428649pfj.73.1650964446050; Tue, 26 Apr 2022 02:14:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650964446; cv=none; d=google.com; s=arc-20160816; b=w0HjQt5B1Hvt4A2jkXKzhp7ZSxDG0H5nY9TeWxGcvS/K+RA19ClZPtuoSdQZNo/oAK +2dmDDPizXXHPM+Hnwv4pov7fJ0phQWmMp8R+shDfvAH3uYje5u6q45KO5nsfmqr6okI +T3LubltkzPE5+U6P8k3VP/is+eGNehSHNv89V7YxPHc+0caZZgqxLaffS4TZZZ6Av/s 4q1Z08oZgQxGWZum9EE799x92D4/IsRWPqAMaAAoorDOZO5OM9cchODrhSMhggZozXPM r0GUZ2hYPBhE/hZFgmzj4jozBEBZHBkbM7A1S7LZ6Pk77wNwtK3W9WSiXFc5pD2u45eS iVSQ== 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:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=QYonx3ubYaWiggUf41EdorM7lx+Lfx71h1aRc3WYJGk=; b=q1w+rmXY6hb9OYOYj0IAoUwrywU2QNHcRI/eRQqJZRApaZuifAd9myVnDLx6iUUTbp nxGPkh0PVUhue8jc1Aya0blg0nHiE8LWPBAAvFyTc5p9MD8/DXKLWFQR1k4kW8Hd31Jl hzavBMc0Z+nzdC72cbzITP7B2rK9SzCgxH3Tz7d2lde8Ggz8hsrt8PWNibWgNYSU9jkH WQ6cg4t8U/ZW2ksuy7hZ8M3Jt9dPTLTXxaG3E4S6HdmJUTXdOSuINO0GgmpkEwPb7mwY blAcKRLQAVfe5kBiMZhgvQSsJNS0gohYV+YLlT5OK3xFQUfqmCU7EP/ftWOKDxxyym6c GKsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=Fwto2PAS; 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=quicinc.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q11-20020a65494b000000b0039d976426d9si20080329pgs.575.2022.04.26.02.13.51; Tue, 26 Apr 2022 02:14:06 -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=@quicinc.com header.s=qcdkim header.b=Fwto2PAS; 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=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243216AbiDZDiq (ORCPT + 99 others); Mon, 25 Apr 2022 23:38:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243191AbiDZDil (ORCPT ); Mon, 25 Apr 2022 23:38:41 -0400 Received: from alexa-out-sd-01.qualcomm.com (alexa-out-sd-01.qualcomm.com [199.106.114.38]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ADBE2393FA; Mon, 25 Apr 2022 20:35:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1650944133; x=1682480133; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=QYonx3ubYaWiggUf41EdorM7lx+Lfx71h1aRc3WYJGk=; b=Fwto2PASakxMYj7hDZKZWQadRTQkX09VFUNWJdbGHnCadmYGN1Ck/QgB atwUvPZQLIyw15B/gfWRq4ZRN6oqsZT4KmTSMxmtCSbzbknCjD2cd+3i+ ZJHPJrv4J6irHHpaqmQC6ie0kPl8F6z23AIF7TxKZDj2pEbDMHWh0pcFf U=; Received: from unknown (HELO ironmsg01-sd.qualcomm.com) ([10.53.140.141]) by alexa-out-sd-01.qualcomm.com with ESMTP; 25 Apr 2022 20:35:32 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg01-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Apr 2022 20:35:32 -0700 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Mon, 25 Apr 2022 20:35:31 -0700 Received: from [10.111.165.107] (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Mon, 25 Apr 2022 20:35:28 -0700 Message-ID: Date: Mon, 25 Apr 2022 20:35:26 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.6.2 Subject: Re: [Freedreno] [PATCH] drm/msm/dp: move add fail safe mode to dp_connector_get_mode() Content-Language: en-US To: Doug Anderson CC: Sean Paul , Sankeerth Billakanti , David Airlie , linux-arm-msm , Kuogee Hsieh , LKML , dri-devel , Stephen Boyd , Vinod Koul , Andy Gross , Dmitry Baryshkov , "Aravind Venkateswaran (QUIC)" , Bjorn Andersson , freedreno References: <1650671124-14030-1-git-send-email-quic_khsieh@quicinc.com> <3b9588d2-d9f6-c96f-b316-953b56b59bfe@linaro.org> <73e2a37e-23db-d614-5f5c-8120f1869158@quicinc.com> <9b331b16-8d1b-4e74-8fee-d74c4041f8d7@quicinc.com> <9b4ccdef-c98a-b907-c7ee-a92456dc5bba@quicinc.com> From: Abhinav Kumar In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-Spam-Status: No, score=-6.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS 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 4/25/2022 7:18 PM, Doug Anderson wrote: > Hi, > > On Mon, Apr 25, 2022 at 6:42 PM Abhinav Kumar wrote: >> >>>> 2) When there was a valid EDID but no 640x480 mode >>>> >>>> This is the equipment specific case and the one even I was a bit >>>> surprised. There is a DP compliance equipment we have in-house and while >>>> validation, it was found that in its list of modes , it did not have any >>>> modes which chromebook supported ( due to 2 lanes ). But my >>>> understanding was that, all sinks should have atleast 640x480 but >>>> apparently this one did not have that. So to handle this DP compliance >>>> equipment behavior, we had to do this. >>> >>> That doesn't seem right. If there's a valid EDID and the valid EDID >>> doesn't contain 640x480, are you _sure_ you're supposed to be adding >>> 640x480? That doesn't sound right to me. I've got a tiny display in >>> front of me for testing that only has one mode: >>> >>> #0 800x480 65.68 800 840 888 928 480 493 496 525 32000 >>> >> >> As I had wrote, DRM core kicks in only when the count of modes is 0. >> Here what is happening is the count was not 0 but 640x480 was not >> present in the EDID. So we had to add it explicitly. >> >> Your tiny display is a display port display? >> >> I am referring to only display port monitors. If your tiny display is >> DP, it should have had 640x480 in its list of modes. > > My tiny display is actually a HDMI display hooked up to a HDMI to DP > (active) adapter. > > ...but this is a legal and common thing to have. I suppose possibly my > HDMI display is "illegal"? > > OK, so reading through the spec more carefully, I do see that the DP > spec makes numerous mentions of the fact that DP sinks _must_ support > 640x480. Even going back to DP 1.4, I see section "5.2.1.2 Video > Timing Format" says that we must support 640x480. It seems like that's > _intended_ to be used only if the EDID read fails, though or if we > somehow have to output video without knowledge of the EDID. It seems > hard to believe that there's a great reason to assume a display will > support 640x480 if we have more accurate knowledge. > > In any case, I guess I would still say that adding this mode belongs > in the DRM core. The core should notice that it's a DP connection > (bridge->type == DRM_MODE_CONNECTOR_DisplayPort) and that 640x480 was > left out and it should add it. We should also make sure it's not > "preferred" and is last in the list so we never accidentally pick it. > If DP truly says that we should always give the user 640x480 then > that's true for everyone, not just Qualcomm. We should add it in the > core. If, later, someone wants to hide this from the UI it would be > much easier if they only needed to modify one place. > So I debugged with kuogee just now using the DP compliance equipment. It turns out, the issue is not that 640x480 mode is not present. The issue is that it is not marked as preferred. Hence we missed this part during debugging this equipment failure. We still have to figure out the best way to either mark 640x480 as preferred or eliminate other modes during the test-case so that 640x480 is actually picked by usermode. Now that being said, the fix still doesn't belong in the framework. It has to be in the msm/dp code. Different vendors handle this failure case differently looks like. Lets take below snippet from i915 as example. 3361 if (intel_connector->detect_edid == NULL || 3362 connector->edid_corrupt || 3363 intel_dp->aux.i2c_defer_count > 6) { 3364 /* Check EDID read for NACKs, DEFERs and corruption 3365 * (DP CTS 1.2 Core r1.1) 3366 * 4.2.2.4 : Failed EDID read, I2C_NAK 3367 * 4.2.2.5 : Failed EDID read, I2C_DEFER 3368 * 4.2.2.6 : EDID corruption detected 3369 * Use failsafe mode for all cases 3370 */ 3371 if (intel_dp->aux.i2c_nack_count > 0 || 3372 intel_dp->aux.i2c_defer_count > 0) 3373 drm_dbg_kms(&i915->drm, 3374 "EDID read had %d NACKs, %d DEFERs\n", 3375 intel_dp->aux.i2c_nack_count, 3376 intel_dp->aux.i2c_defer_count); 3377 intel_dp->compliance.test_data.edid = INTEL_DP_RESOLUTION_FAILSAFE; This marks the fail safe mode and IGT test case reads this to set this mode and hence the test passes. We rely on the chromeOS usermode to output pixel data for this test-case and not IGT. We use IGT only for video pattern CTS today but this is a different test-case which is failing. ChromeOS usermode will not pick 640x480 unless we mark it as preferred or other modes are eliminated. So we have to come up with the right way for the usermode to pick 640x480. We will discuss this a bit more and come up with a different change. > >>> So IMO we _shouldn't_ land ${SUBJECT} patch. >>> >>> Just for testing, I also tried a hack to make EDID reading fail >>> (return -EIO in the MSM dp_aux_transfer() function if msg->request < >>> 8). Before ${SUBJECT} patch I'd see these modes: >>> >>> #0 1024x768 60.00 1024 1048 1184 1344 768 771 777 806 65000 >>> #1 800x600 60.32 800 840 968 1056 600 601 605 628 40000 >>> #2 800x600 56.25 800 824 896 1024 600 601 603 625 36000 >>> #3 848x480 60.00 848 864 976 1088 480 486 494 517 33750 >>> #4 640x480 59.94 640 656 752 800 480 490 492 525 25175 >>> >>> ...and after ${SUBJECT} patch I'd see: >>> >>> #0 640x480 59.94 640 656 752 800 480 490 492 525 25175 >>> #1 1024x768 60.00 1024 1048 1184 1344 768 771 777 806 65000 >>> #2 800x600 60.32 800 840 968 1056 600 601 605 628 40000 >>> #3 800x600 56.25 800 824 896 1024 600 601 603 625 36000 >>> #4 848x480 60.00 848 864 976 1088 480 486 494 517 33750 >>> >>> ...so your patch causes 640x480 to be prioritized. That also doesn't >>> seem ideal. If it was ideal, the DRM core should have listed 640x480 >>> first. >> >> So this is a different display or these modes are coming due to the >> drm_add_modes_noedid() call because of the EDID read fail right? > > Right, it's from the !edid case. > > -Doug