lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <BN0PR02MB81424044EB8F918A99ECE3ED96099@BN0PR02MB8142.namprd02.prod.outlook.com>
Date:   Fri, 18 Nov 2022 14:37:26 +0000
From:   Kalyan Thota <kalyant@....qualcomm.com>
To:     "dmitry.baryshkov@...aro.org" <dmitry.baryshkov@...aro.org>,
        "Kalyan Thota (QUIC)" <quic_kalyant@...cinc.com>,
        "dri-devel@...ts.freedesktop.org" <dri-devel@...ts.freedesktop.org>,
        "linux-arm-msm@...r.kernel.org" <linux-arm-msm@...r.kernel.org>,
        "freedreno@...ts.freedesktop.org" <freedreno@...ts.freedesktop.org>,
        "devicetree@...r.kernel.org" <devicetree@...r.kernel.org>
CC:     "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "robdclark@...omium.org" <robdclark@...omium.org>,
        "dianders@...omium.org" <dianders@...omium.org>,
        "swboyd@...omium.org" <swboyd@...omium.org>,
        "Vinod Polimera (QUIC)" <quic_vpolimer@...cinc.com>,
        "Abhinav Kumar (QUIC)" <quic_abhinavk@...cinc.com>
Subject: RE: [PATCH v3 2/3] drm/msm/disp/dpu1: add helper to know if display
 is builtin



>-----Original Message-----
>From: Dmitry Baryshkov <dmitry.baryshkov@...aro.org>
>Sent: Friday, November 18, 2022 6:09 PM
>To: Kalyan Thota (QUIC) <quic_kalyant@...cinc.com>; dri-
>devel@...ts.freedesktop.org; linux-arm-msm@...r.kernel.org;
>freedreno@...ts.freedesktop.org; devicetree@...r.kernel.org
>Cc: linux-kernel@...r.kernel.org; robdclark@...omium.org;
>dianders@...omium.org; swboyd@...omium.org; Vinod Polimera (QUIC)
><quic_vpolimer@...cinc.com>; Abhinav Kumar (QUIC)
><quic_abhinavk@...cinc.com>
>Subject: Re: [PATCH v3 2/3] drm/msm/disp/dpu1: add helper to know if display is
>builtin
>
>WARNING: This email originated from outside of Qualcomm. Please be wary of
>any links or attachments, and do not enable macros.
>
>On 18/11/2022 15:16, 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
>>
>> Changes in v3:
>> - use bridge type instead of bridge ops in determining connector
>> (Dmitry)
>>
>> Signed-off-by: Kalyan Thota <quic_kalyant@...cinc.com>
>> ---
>>   drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 27
>+++++++++++++++++++++++++++
>>   drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h |  6 ++++++
>>   2 files changed, 33 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..574f2b0 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 <drm/drm_crtc.h>
>>   #include <drm/drm_file.h>
>>   #include <drm/drm_probe_helper.h>
>> +#include <drm/drm_bridge.h>
>>
>>   #include "msm_drv.h"
>>   #include "dpu_kms.h"
>> @@ -217,6 +218,32 @@ 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_builtin(struct drm_encoder *encoder) {
>> +     struct drm_bridge *bridge;
>> +     int ops = 0;
>> +
>> +     if (!encoder)
>> +             return false;
>> +
>> +     /* Get last bridge in the chain to determine connector type */
>> +     drm_for_each_bridge_in_chain(encoder, bridge)
>> +             if (!drm_bridge_get_next_bridge(bridge))
>> +                     ops = bridge->type;
>
>Why don't we check the connector type directly? You should not assume that
>connector's type is equal to the latest bridge's type.

if we need to get the type from connector, need to do something as below.
Are you thinking on the same lines ?

"to_drm_bridge_connector" macro needs to be moved to drm_bridge_connector.h

struct drm_bridge_connector *bridge_connector;

drm_connector_list_iter_begin(dev, &conn_iter);
	drm_for_each_connector_iter(connector, &conn_iter) {

		bridge_connector = to_drm_bridge_connector(connector);
		if (bridge_connector->encoder == encoder) {
			type = connector->connector_type;
			break;
		}
	}
drm_connector_list_iter_end(&conn_iter);


>> +
>> +     switch (ops) {
>> +     case DRM_MODE_CONNECTOR_Unknown:
>> +     case DRM_MODE_CONNECTOR_LVDS:
>> +     case DRM_MODE_CONNECTOR_eDP:
>> +     case DRM_MODE_CONNECTOR_DSI:
>> +     case DRM_MODE_CONNECTOR_DPI:
>> +     case DRM_MODE_CONNECTOR_WRITEBACK:
>> +     case DRM_MODE_CONNECTOR_VIRTUAL:
>
>Unknown, WRITEBACK and VIRTUAL are not builtin (for the point of CTM at
>least).
>
>> +             return true;
>> +     default:
>> +             return false;
>> +     }
>> +}
>>
>>   bool dpu_encoder_is_widebus_enabled(const struct drm_encoder *drm_enc)
>>   {
>> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h
>> b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h
>> index 9e7236e..7f3d823 100644
>> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h
>> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h
>> @@ -224,4 +224,10 @@ void dpu_encoder_cleanup_wb_job(struct
>drm_encoder *drm_enc,
>>    */
>>   bool dpu_encoder_is_valid_for_commit(struct drm_encoder *drm_enc);
>>
>> +/**
>> + * dpu_encoder_is_builtin - find if the encoder is of type builtin
>> + * @drm_enc:    Pointer to previously created drm encoder structure
>> + */
>> +bool dpu_encoder_is_builtin(struct drm_encoder *drm_enc);
>> +
>>   #endif /* __DPU_ENCODER_H__ */
>
>--
>With best wishes
>Dmitry

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ