Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp775349rwb; Wed, 16 Nov 2022 07:31:35 -0800 (PST) X-Google-Smtp-Source: AA0mqf576HrsY5YQ4F2+N5VC0e9VIqTiesuQRwDJa6PmYnIip6AvXbf3rcgeIdpq3bJh48iJ/f27 X-Received: by 2002:a65:6d93:0:b0:44e:466f:4759 with SMTP id bc19-20020a656d93000000b0044e466f4759mr21034210pgb.194.1668612695475; Wed, 16 Nov 2022 07:31:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668612695; cv=none; d=google.com; s=arc-20160816; b=WBcFR2vjT/uXqL3J6AXtzAYfbxEvcXmLZMcGVovDJzGdayjC0AAcicUeGCuE/FTgDf NZksEz+F3a7QSkMd1nho59gvASlM0Q2cJ3Nwnok7Ry7kx6V6wVVDTQq45dU1FD3B+WsB RoAN1znQrRAf6/XaoeyUpCYNda0hEoBCPigagW9pO8dBq1tQ8dlE+GQXsGylrw9s4Lvd ymQTNAnR2kd+AD5x8FjNCDZ7hmYPSOaOu29JDvimUQMZuUR3FUzQHrL1IqyEnzlx41kE 6WP7rTws5XcyGr7R80lpahv1t+/vVdknVFdUzdwPSz+z2g9OyWSpY3k+b7agZU+iN5XB 1veg== 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=he8mFZOBs1BvDVjn5opl2MtZ0ur6XPJl6SpGq2658M8=; b=grBDLEMbCXl7UkxUA68qdSqYhaHSKOvDWKlchZ5DMuW8QrFSqS3b+ExSQE2N29wO7L cJopQHVfJqnPwlbDAIiMF65sAYR/SBpmSwzX4cki75z0Wn7KBmtHQFfumh1Wwj6cyxCK VCQu5A0cNp5fiwyMRzDlqr8ZXyuKNKfNpgLFfKX9aPvT7i2IABPhEtARU3TEPPINsagC ou1WMkJBUD7DTLxIapphh/aYjlZcAkfGRl82uiMUM+6SkR+qtjJ5T6HA3dpo+yua4s0q AZ3OYS6+D9tTNPN4coz/1t8a+44u9r2FlidlI9LKF6s/GNfyKF9Mm1wNJc1DNM1qjVuX RKrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vwMTJ5pI; 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 c8-20020a170903234800b0016f9420a15asi17095904plh.168.2022.11.16.07.31.22; Wed, 16 Nov 2022 07:31:35 -0800 (PST) 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=vwMTJ5pI; 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 S231501AbiKPPT3 (ORCPT + 91 others); Wed, 16 Nov 2022 10:19:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233087AbiKPPTA (ORCPT ); Wed, 16 Nov 2022 10:19:00 -0500 Received: from mail-lj1-x235.google.com (mail-lj1-x235.google.com [IPv6:2a00:1450:4864:20::235]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97D144C247 for ; Wed, 16 Nov 2022 07:18:40 -0800 (PST) Received: by mail-lj1-x235.google.com with SMTP id d3so22238027ljl.1 for ; Wed, 16 Nov 2022 07:18:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=he8mFZOBs1BvDVjn5opl2MtZ0ur6XPJl6SpGq2658M8=; b=vwMTJ5pIkGEoaz0oXODpU2Ez3BIxpc2QEfeB7VT+/2pa2GZsfVgBeg4hm0F5E8wjqR PFCsrOrIlX/Ni6yTgehE031bVkTkdQdJ8vdHZpLDaOFxxvOUtT/qOWMsvDe3MhEnqq9F HmehlVfaKvICqRnu0pe2ftMIdJ6bXdmkTQy4BGMhhHZS50rRbid8B+kvpSAGoDAFt4ad OjaktdrUe6SP1lYfz/siC2YQAqabqgOyt+OxrdsucT4/IG/JEBZsOvMVwVW+6xjgQR+e iTBeu//obUbrkYyxRFxrvNNAsK9y24c7cD2wyXrUAOQvejlemS1JUmoOjPIeF5nimHnO b8NQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=he8mFZOBs1BvDVjn5opl2MtZ0ur6XPJl6SpGq2658M8=; b=KzeRBEriOXEJ+RIn0G+HNrjQlMArMU46YtGPlTcVnQL2R+4XEg2qECi28SWN/9GF6N aSSo3aM6KPmEXjR+b8hiA4iKZZc8YecG1XeGKlAgs77k3zW950PpU4NZRjztF9Qa9Onu /vNHGaY08/3YU7Fy9Foxe7FfmVmo1ilFWXiOVMBdx05heHwqQfHaWsSRvOCw0Q9EP0Fa NGiWeB/QA4cGTr527geL80KIpoO6ejPe6BQTsnqYEN/FQlpsgVd5kIpIkAOBDviCY5f1 sRX9RhpTb5aIRQzgqk8G27hXUO1yl0myz3fyDKoBWCUQXcxuHFVET3dqB/lMVq5R0MDY DMiQ== X-Gm-Message-State: ANoB5pljzYodwx1sTsRmoZ/ThYigDtIkzVY25e8fkMFfIrvVu+UFQLN5 ZaicengMPziEwuMLurROv4Y1MQ== X-Received: by 2002:a05:651c:2314:b0:26e:2772:ffab with SMTP id bi20-20020a05651c231400b0026e2772ffabmr7494107ljb.97.1668611918933; Wed, 16 Nov 2022 07:18:38 -0800 (PST) Received: from [10.10.15.130] ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id f12-20020a2eb5ac000000b0026e15713edesm3038815ljn.9.2022.11.16.07.18.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 16 Nov 2022 07:18:38 -0800 (PST) Message-ID: Date: Wed, 16 Nov 2022 18:18:37 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.1 Subject: Re: [PATCH v2 2/3] drm/msm/disp/dpu1: add helper to know if display is pluggable Content-Language: en-GB To: Abhinav Kumar , Kalyan Thota , dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, devicetree@vger.kernel.org Cc: linux-kernel@vger.kernel.org, robdclark@chromium.org, dianders@chromium.org, swboyd@chromium.org, quic_vpolimer@quicinc.com References: <1668609040-2549-1-git-send-email-quic_kalyant@quicinc.com> <1668609040-2549-3-git-send-email-quic_kalyant@quicinc.com> <6b1907db-3fdb-8fe0-e5e3-21ea17021925@quicinc.com> From: Dmitry Baryshkov In-Reply-To: <6b1907db-3fdb-8fe0-e5e3-21ea17021925@quicinc.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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 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 16/11/2022 18:11, Abhinav Kumar wrote: > > > On 11/16/2022 7:08 AM, Dmitry Baryshkov wrote: >> On 16/11/2022 17:30, Kalyan Thota wrote: >>> Since DRM encoder type for few encoders can be similar >>> (like eDP and DP) find out if the interface supports HPD >>> from encoder bridge to differentiate between builtin >>> and pluggable displays. >>> >>> Changes in v1: >>> - add connector type in the disp_info (Dmitry) >>> - add helper functions to know encoder type >>> - update commit text reflecting the change >>> >>> Changes in v2: >>> - avoid hardcode of connector type for DSI as it may not be true >>> (Dmitry) >>> - get the HPD information from encoder bridge >>> >>> Signed-off-by: Kalyan Thota >>> --- >>>   drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 16 ++++++++++++++++ >>>   drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h |  6 ++++++ >>>   2 files changed, 22 insertions(+) >>> >>> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c >>> b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c >>> index 9c6817b..be93269 100644 >>> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c >>> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c >>> @@ -15,6 +15,7 @@ >>>   #include >>>   #include >>>   #include >>> +#include >>>   #include "msm_drv.h" >>>   #include "dpu_kms.h" >>> @@ -217,6 +218,21 @@ static u32 dither_matrix[DITHER_MATRIX_SZ] = { >>>       15, 7, 13, 5, 3, 11, 1, 9, 12, 4, 14, 6, 0, 8, 2, 10 >>>   }; >>> +bool dpu_encoder_is_pluggable(struct drm_encoder *encoder) >>> +{ >>> +    struct drm_bridge *bridge; >>> +    int ops = 0; >>> + >>> +    if (!encoder) >>> +        return false; >>> + >>> +    /* Get last bridge in the chain to determine pluggable state */ >>> +    drm_for_each_bridge_in_chain(encoder, bridge) >>> +        if (!drm_bridge_get_next_bridge(bridge)) >>> +            ops = bridge->ops; >>> + >>> +    return ops & DRM_BRIDGE_OP_HPD; >> >> No. This is not what you should be checking (hint: polled connectors >> also can be pluggable). >> >> Please check the type of the actual connector connected to this encoder. >> > > Even if we check the connector type as DSI or eDP that does not > necessarily mean its built-in. > > We can even use DSI or eDP as a pluggable display. Well, I don't think so. eDP and DSI connectors are not pluggable per design. One can use them so, but they are not thought to be used this way. Unlike e.g. HDMI, DP, VGA, etc. I would say LVDS, eDP, DSI, DPI and SPI can be assumed to be constantly plugged. Compare this with Composite, SVIDEO, 9PinDIN, TV. They can be assumed to be external even if they do not have the HPD (or even polling). And these connectors usually don't have it. > > Thats why we thought of this check. > -- With best wishes Dmitry