* [PATCH v2] drm/msm/dpu: add display port support in DPU
@ 2018-11-27 22:28 Jeykumar Sankaran
[not found] ` <1543357710-3918-1-git-send-email-jsanka-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
0 siblings, 1 reply; 6+ messages in thread
From: Jeykumar Sankaran @ 2018-11-27 22:28 UTC (permalink / raw)
To: dri-devel, freedreno, linux-arm-msm; +Cc: hoegsberg, seanpaul
Add display port support in DPU by creating hooks
for DP encoder enumeration and encoder mode
initialization.
This change is based on the SDM845 Display port
driver changes[1].
changes in v2:
- rebase on [2] (Sean Paul)
- remove unwanted error checks and
switch cases (Jordan Crouse)
[1] https://lwn.net/Articles/768265/
[2] https://lkml.org/lkml/2018/11/17/87
Signed-off-by: Jeykumar Sankaran <jsanka@codeaurora.org>
---
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 8 ++---
drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 47 +++++++++++++++++++++++++----
2 files changed, 45 insertions(+), 10 deletions(-)
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
index d3f4501..1f6b4b1 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
@@ -2015,7 +2015,7 @@ static int dpu_encoder_setup_display(struct dpu_encoder_virt *dpu_enc,
{
int ret = 0;
int i = 0;
- enum dpu_intf_type intf_type;
+ enum dpu_intf_type intf_type = INTF_NONE;
struct dpu_enc_phys_init_params phys_params;
if (!dpu_enc || !dpu_kms) {
@@ -2038,9 +2038,9 @@ static int dpu_encoder_setup_display(struct dpu_encoder_virt *dpu_enc,
case DRM_MODE_ENCODER_DSI:
intf_type = INTF_DSI;
break;
- default:
- DPU_ERROR_ENC(dpu_enc, "unsupported display interface type\n");
- return -EINVAL;
+ case DRM_MODE_ENCODER_TMDS:
+ intf_type = INTF_DP;
+ break;
}
WARN_ON(disp_info->num_of_h_tiles < 1);
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
index 985c855..7d931ae 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
@@ -473,6 +473,32 @@ static void _dpu_kms_initialize_dsi(struct drm_device *dev,
}
}
+static void _dpu_kms_initialize_displayport(struct drm_device *dev,
+ struct msm_drm_private *priv,
+ struct dpu_kms *dpu_kms)
+{
+ struct drm_encoder *encoder = NULL;
+ int rc;
+
+ if (!priv->dp)
+ return;
+
+ encoder = dpu_encoder_init(dev, DRM_MODE_ENCODER_TMDS);
+ if (IS_ERR(encoder)) {
+ DPU_ERROR("encoder init failed for dsi display\n");
+ return;
+ }
+
+ rc = msm_dp_modeset_init(priv->dp, dev, encoder);
+ if (rc) {
+ DPU_ERROR("modeset_init failed for DP, rc = %d\n", rc);
+ drm_encoder_cleanup(encoder);
+ return;
+ }
+
+ priv->encoders[priv->num_encoders++] = encoder;
+}
+
/**
* _dpu_kms_setup_displays - create encoders, bridges and connectors
* for underlying displays
@@ -487,6 +513,8 @@ static void _dpu_kms_setup_displays(struct drm_device *dev,
{
_dpu_kms_initialize_dsi(dev, priv, dpu_kms);
+ _dpu_kms_initialize_displayport(dev, priv, dpu_kms);
+
/**
* Extend this function to initialize other
* types of displays
@@ -723,13 +751,20 @@ static void _dpu_kms_set_encoder_mode(struct msm_kms *kms,
info.capabilities = cmd_mode ? MSM_DISPLAY_CAP_CMD_MODE :
MSM_DISPLAY_CAP_VID_MODE;
- /* TODO: No support for DSI swap */
- for (i = 0; i < ARRAY_SIZE(priv->dsi); i++) {
- if (priv->dsi[i]) {
- info.h_tile_instance[info.num_of_h_tiles] = i;
- info.num_of_h_tiles++;
+ switch (info.intf_type) {
+ case DRM_MODE_ENCODER_DSI:
+ /* TODO: No support for DSI swap */
+ for (i = 0; i < ARRAY_SIZE(priv->dsi); i++) {
+ if (priv->dsi[i]) {
+ info.h_tile_instance[info.num_of_h_tiles] = i;
+ info.num_of_h_tiles++;
+ }
}
- }
+ break;
+ case DRM_MODE_ENCODER_TMDS:
+ info.num_of_h_tiles = 1;
+ break;
+ };
rc = dpu_encoder_setup(encoder->dev, encoder, &info);
if (rc)
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v2] drm/msm/dpu: add display port support in DPU
[not found] ` <1543357710-3918-1-git-send-email-jsanka-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
@ 2018-12-01 7:35 ` kbuild test robot
2018-12-03 14:47 ` Sean Paul
1 sibling, 0 replies; 6+ messages in thread
From: kbuild test robot @ 2018-12-01 7:35 UTC (permalink / raw)
To: Jeykumar Sankaran
Cc: linux-arm-msm-u79uwXL29TY76Z2rM5mHXA,
dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
seanpaul-F7+t8E8rja9g9hUCZPvPmw, kbuild-all-JC7UmRfGjtg,
hoegsberg-hpIqsD4AKlfQT0dZR+AlfA,
freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
[-- Attachment #1: Type: text/plain, Size: 2733 bytes --]
Hi Jeykumar,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on robclark/msm-next]
[also build test ERROR on v4.20-rc4 next-20181130]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Jeykumar-Sankaran/drm-msm-dpu-add-display-port-support-in-DPU/20181130-230021
base: git://people.freedesktop.org/~robclark/linux msm-next
config: arm-allmodconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (Debian 7.2.0-11) 7.2.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
GCC_VERSION=7.2.0 make.cross ARCH=arm
All errors (new ones prefixed by >>):
drivers/gpu//drm/msm/disp/dpu1/dpu_kms.c: In function '_dpu_kms_initialize_displayport':
>> drivers/gpu//drm/msm/disp/dpu1/dpu_kms.c:483:13: error: 'struct msm_drm_private' has no member named 'dp'; did you mean 'edp'?
if (!priv->dp)
^~
edp
>> drivers/gpu//drm/msm/disp/dpu1/dpu_kms.c:492:7: error: implicit declaration of function 'msm_dp_modeset_init'; did you mean 'msm_edp_modeset_init'? [-Werror=implicit-function-declaration]
rc = msm_dp_modeset_init(priv->dp, dev, encoder);
^~~~~~~~~~~~~~~~~~~
msm_edp_modeset_init
drivers/gpu//drm/msm/disp/dpu1/dpu_kms.c:492:33: error: 'struct msm_drm_private' has no member named 'dp'; did you mean 'edp'?
rc = msm_dp_modeset_init(priv->dp, dev, encoder);
^~
edp
cc1: some warnings being treated as errors
vim +483 drivers/gpu//drm/msm/disp/dpu1/dpu_kms.c
475
476 static void _dpu_kms_initialize_displayport(struct drm_device *dev,
477 struct msm_drm_private *priv,
478 struct dpu_kms *dpu_kms)
479 {
480 struct drm_encoder *encoder = NULL;
481 int rc;
482
> 483 if (!priv->dp)
484 return;
485
486 encoder = dpu_encoder_init(dev, DRM_MODE_ENCODER_TMDS);
487 if (IS_ERR(encoder)) {
488 DPU_ERROR("encoder init failed for dsi display\n");
489 return;
490 }
491
> 492 rc = msm_dp_modeset_init(priv->dp, dev, encoder);
493 if (rc) {
494 DPU_ERROR("modeset_init failed for DP, rc = %d\n", rc);
495 drm_encoder_cleanup(encoder);
496 return;
497 }
498
499 priv->encoders[priv->num_encoders++] = encoder;
500 }
501
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 67195 bytes --]
[-- Attachment #3: Type: text/plain, Size: 160 bytes --]
_______________________________________________
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] drm/msm/dpu: add display port support in DPU
[not found] ` <1543357710-3918-1-git-send-email-jsanka-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-12-01 7:35 ` kbuild test robot
@ 2018-12-03 14:47 ` Sean Paul
2018-12-04 3:02 ` Jeykumar Sankaran
2018-12-04 23:45 ` Jeykumar Sankaran
1 sibling, 2 replies; 6+ messages in thread
From: Sean Paul @ 2018-12-03 14:47 UTC (permalink / raw)
To: Jeykumar Sankaran
Cc: linux-arm-msm-u79uwXL29TY76Z2rM5mHXA,
robdclark-Re5JQEeQqe8AvxtiuMwx3w,
dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
jcrouse-sgV2jX0FEOL9JmXXK+q4OQ, seanpaul-F7+t8E8rja9g9hUCZPvPmw,
hoegsberg-hpIqsD4AKlfQT0dZR+AlfA,
freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
On Tue, Nov 27, 2018 at 02:28:30PM -0800, Jeykumar Sankaran wrote:
> Add display port support in DPU by creating hooks
> for DP encoder enumeration and encoder mode
> initialization.
>
> This change is based on the SDM845 Display port
> driver changes[1].
>
> changes in v2:
> - rebase on [2] (Sean Paul)
> - remove unwanted error checks and
> switch cases (Jordan Crouse)
>
> [1] https://lwn.net/Articles/768265/
> [2] https://lkml.org/lkml/2018/11/17/87
>
> Signed-off-by: Jeykumar Sankaran <jsanka@codeaurora.org>
> ---
> drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 8 ++---
> drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 47 +++++++++++++++++++++++++----
> 2 files changed, 45 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> index d3f4501..1f6b4b1 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> @@ -2015,7 +2015,7 @@ static int dpu_encoder_setup_display(struct dpu_encoder_virt *dpu_enc,
> {
> int ret = 0;
> int i = 0;
> - enum dpu_intf_type intf_type;
> + enum dpu_intf_type intf_type = INTF_NONE;
dpu_intf_type seems unnecessary, you could just use the DRM_MODE_ENCODER_* value
directly?
> struct dpu_enc_phys_init_params phys_params;
>
> if (!dpu_enc || !dpu_kms) {
> @@ -2038,9 +2038,9 @@ static int dpu_encoder_setup_display(struct dpu_encoder_virt *dpu_enc,
> case DRM_MODE_ENCODER_DSI:
> intf_type = INTF_DSI;
> break;
> - default:
> - DPU_ERROR_ENC(dpu_enc, "unsupported display interface type\n");
> - return -EINVAL;
> + case DRM_MODE_ENCODER_TMDS:
> + intf_type = INTF_DP;
> + break;
> }
>
> WARN_ON(disp_info->num_of_h_tiles < 1);
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
> index 985c855..7d931ae 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
> @@ -473,6 +473,32 @@ static void _dpu_kms_initialize_dsi(struct drm_device *dev,
> }
> }
>
> +static void _dpu_kms_initialize_displayport(struct drm_device *dev,
> + struct msm_drm_private *priv,
> + struct dpu_kms *dpu_kms)
> +{
> + struct drm_encoder *encoder = NULL;
> + int rc;
> +
> + if (!priv->dp)
> + return;
> +
> + encoder = dpu_encoder_init(dev, DRM_MODE_ENCODER_TMDS);
> + if (IS_ERR(encoder)) {
> + DPU_ERROR("encoder init failed for dsi display\n");
> + return;
> + }
> +
> + rc = msm_dp_modeset_init(priv->dp, dev, encoder);
> + if (rc) {
> + DPU_ERROR("modeset_init failed for DP, rc = %d\n", rc);
> + drm_encoder_cleanup(encoder);
> + return;
> + }
> +
> + priv->encoders[priv->num_encoders++] = encoder;
No need to keep track of drm resources at the driver level, the core will do
this for you. So can you please add a patch preceding this one to remove the
priv->encoders/crtc/planes/connectors arrays?
> +}
> +
> /**
> * _dpu_kms_setup_displays - create encoders, bridges and connectors
> * for underlying displays
> @@ -487,6 +513,8 @@ static void _dpu_kms_setup_displays(struct drm_device *dev,
Why are these functions voids? Seems like there are plenty of places for them to
fail :)
Let's add a patch to the beginning of this series to properly handle failures in
setup_displays and initialize_dsi
> {
> _dpu_kms_initialize_dsi(dev, priv, dpu_kms);
>
> + _dpu_kms_initialize_displayport(dev, priv, dpu_kms);
> +
> /**
> * Extend this function to initialize other
> * types of displays
> @@ -723,13 +751,20 @@ static void _dpu_kms_set_encoder_mode(struct msm_kms *kms,
> info.capabilities = cmd_mode ? MSM_DISPLAY_CAP_CMD_MODE :
> MSM_DISPLAY_CAP_VID_MODE;
>
> - /* TODO: No support for DSI swap */
> - for (i = 0; i < ARRAY_SIZE(priv->dsi); i++) {
> - if (priv->dsi[i]) {
> - info.h_tile_instance[info.num_of_h_tiles] = i;
> - info.num_of_h_tiles++;
> + switch (info.intf_type) {
> + case DRM_MODE_ENCODER_DSI:
> + /* TODO: No support for DSI swap */
> + for (i = 0; i < ARRAY_SIZE(priv->dsi); i++) {
> + if (priv->dsi[i]) {
> + info.h_tile_instance[info.num_of_h_tiles] = i;
> + info.num_of_h_tiles++;
> + }
> }
> - }
> + break;
> + case DRM_MODE_ENCODER_TMDS:
> + info.num_of_h_tiles = 1;
> + break;
> + };
>
> rc = dpu_encoder_setup(encoder->dev, encoder, &info);
> if (rc)
> --
> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
> a Linux Foundation Collaborative Project
>
> _______________________________________________
> Freedreno mailing list
> Freedreno@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/freedreno
--
Sean Paul, Software Engineer, Google / Chromium OS
_______________________________________________
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] drm/msm/dpu: add display port support in DPU
2018-12-03 14:47 ` Sean Paul
@ 2018-12-04 3:02 ` Jeykumar Sankaran
[not found] ` <3ee2493cf6b31c903add62e837364056-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-12-04 23:45 ` Jeykumar Sankaran
1 sibling, 1 reply; 6+ messages in thread
From: Jeykumar Sankaran @ 2018-12-04 3:02 UTC (permalink / raw)
To: Sean Paul
Cc: linux-arm-msm-u79uwXL29TY76Z2rM5mHXA,
robdclark-Re5JQEeQqe8AvxtiuMwx3w,
dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
jcrouse-sgV2jX0FEOL9JmXXK+q4OQ, seanpaul-F7+t8E8rja9g9hUCZPvPmw,
hoegsberg-hpIqsD4AKlfQT0dZR+AlfA,
freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
On 2018-12-03 06:47, Sean Paul wrote:
> On Tue, Nov 27, 2018 at 02:28:30PM -0800, Jeykumar Sankaran wrote:
>> Add display port support in DPU by creating hooks
>> for DP encoder enumeration and encoder mode
>> initialization.
>>
>> This change is based on the SDM845 Display port
>> driver changes[1].
>>
>> changes in v2:
>> - rebase on [2] (Sean Paul)
>> - remove unwanted error checks and
>> switch cases (Jordan Crouse)
>>
>> [1] https://lwn.net/Articles/768265/
>> [2] https://lkml.org/lkml/2018/11/17/87
>>
>> Signed-off-by: Jeykumar Sankaran <jsanka@codeaurora.org>
>> ---
>> drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 8 ++---
>> drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 47
> +++++++++++++++++++++++++----
>> 2 files changed, 45 insertions(+), 10 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
>> index d3f4501..1f6b4b1 100644
>> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
>> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
>> @@ -2015,7 +2015,7 @@ static int dpu_encoder_setup_display(struct
> dpu_encoder_virt *dpu_enc,
>> {
>> int ret = 0;
>> int i = 0;
>> - enum dpu_intf_type intf_type;
>> + enum dpu_intf_type intf_type = INTF_NONE;
>
> dpu_intf_type seems unnecessary, you could just use the
> DRM_MODE_ENCODER_*
> value
> directly?
>
>> struct dpu_enc_phys_init_params phys_params;
>>
>> if (!dpu_enc || !dpu_kms) {
>> @@ -2038,9 +2038,9 @@ static int dpu_encoder_setup_display(struct
> dpu_encoder_virt *dpu_enc,
>> case DRM_MODE_ENCODER_DSI:
>> intf_type = INTF_DSI;
>> break;
>> - default:
>> - DPU_ERROR_ENC(dpu_enc, "unsupported display interface
> type\n");
>> - return -EINVAL;
>> + case DRM_MODE_ENCODER_TMDS:
>> + intf_type = INTF_DP;
>> + break;
>> }
>>
>> WARN_ON(disp_info->num_of_h_tiles < 1);
>> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
> b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
>> index 985c855..7d931ae 100644
>> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
>> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
>> @@ -473,6 +473,32 @@ static void _dpu_kms_initialize_dsi(struct
> drm_device *dev,
>> }
>> }
>>
>> +static void _dpu_kms_initialize_displayport(struct drm_device *dev,
>> + struct msm_drm_private *priv,
>> + struct dpu_kms *dpu_kms)
>> +{
>> + struct drm_encoder *encoder = NULL;
>> + int rc;
>> +
>> + if (!priv->dp)
>> + return;
>> +
>> + encoder = dpu_encoder_init(dev, DRM_MODE_ENCODER_TMDS);
>> + if (IS_ERR(encoder)) {
>> + DPU_ERROR("encoder init failed for dsi display\n");
>> + return;
>> + }
>> +
>> + rc = msm_dp_modeset_init(priv->dp, dev, encoder);
>> + if (rc) {
>> + DPU_ERROR("modeset_init failed for DP, rc = %d\n", rc);
>> + drm_encoder_cleanup(encoder);
>> + return;
>> + }
>> +
>> + priv->encoders[priv->num_encoders++] = encoder;
>
> No need to keep track of drm resources at the driver level, the core
> will
> do
> this for you. So can you please add a patch preceding this one to
> remove
> the
> priv->encoders/crtc/planes/connectors arrays?
>
priv arrays for tracking drm components and priv->num_** counters are
introduced
by mdp4/5. DPU just adapted the implementation.
De-coupling DPU from these arrays is much easier than fixing them in
mdp4/5. I see
mdp5 is using it to track the max resources and also in ./msm_fbdev.c.
Thanks and Regards,
Jeykumar S.
>> +}
>> +
>> /**
>> * _dpu_kms_setup_displays - create encoders, bridges and connectors
>> * for underlying displays
>> @@ -487,6 +513,8 @@ static void _dpu_kms_setup_displays(struct
> drm_device *dev,
>
> Why are these functions voids? Seems like there are plenty of places
> for
> them to
> fail :)
>
> Let's add a patch to the beginning of this series to properly handle
> failures in
> setup_displays and initialize_dsi
>
>> {
>> _dpu_kms_initialize_dsi(dev, priv, dpu_kms);
>>
>> + _dpu_kms_initialize_displayport(dev, priv, dpu_kms);
>> +
>> /**
>> * Extend this function to initialize other
>> * types of displays
>> @@ -723,13 +751,20 @@ static void _dpu_kms_set_encoder_mode(struct
> msm_kms *kms,
>> info.capabilities = cmd_mode ? MSM_DISPLAY_CAP_CMD_MODE :
>> MSM_DISPLAY_CAP_VID_MODE;
>>
>> - /* TODO: No support for DSI swap */
>> - for (i = 0; i < ARRAY_SIZE(priv->dsi); i++) {
>> - if (priv->dsi[i]) {
>> - info.h_tile_instance[info.num_of_h_tiles] = i;
>> - info.num_of_h_tiles++;
>> + switch (info.intf_type) {
>> + case DRM_MODE_ENCODER_DSI:
>> + /* TODO: No support for DSI swap */
>> + for (i = 0; i < ARRAY_SIZE(priv->dsi); i++) {
>> + if (priv->dsi[i]) {
>> + info.h_tile_instance[info.num_of_h_tiles]
> = i;
>> + info.num_of_h_tiles++;
>> + }
>> }
>> - }
>> + break;
>> + case DRM_MODE_ENCODER_TMDS:
>> + info.num_of_h_tiles = 1;
>> + break;
>> + };
>>
>> rc = dpu_encoder_setup(encoder->dev, encoder, &info);
>> if (rc)
>> --
>> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora
> Forum,
>> a Linux Foundation Collaborative Project
>>
>> _______________________________________________
>> Freedreno mailing list
>> Freedreno@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/freedreno
--
Jeykumar S
_______________________________________________
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] drm/msm/dpu: add display port support in DPU
[not found] ` <3ee2493cf6b31c903add62e837364056-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
@ 2018-12-04 13:52 ` Sean Paul
0 siblings, 0 replies; 6+ messages in thread
From: Sean Paul @ 2018-12-04 13:52 UTC (permalink / raw)
To: Jeykumar Sankaran
Cc: Sean Paul, robdclark-Re5JQEeQqe8AvxtiuMwx3w,
dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
jcrouse-sgV2jX0FEOL9JmXXK+q4OQ, hoegsberg-hpIqsD4AKlfQT0dZR+AlfA,
linux-arm-msm-u79uwXL29TY76Z2rM5mHXA,
seanpaul-F7+t8E8rja9g9hUCZPvPmw,
freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
On Mon, Dec 03, 2018 at 07:02:07PM -0800, Jeykumar Sankaran wrote:
> On 2018-12-03 06:47, Sean Paul wrote:
> > On Tue, Nov 27, 2018 at 02:28:30PM -0800, Jeykumar Sankaran wrote:
> > > Add display port support in DPU by creating hooks
> > > for DP encoder enumeration and encoder mode
> > > initialization.
> > >
> > > This change is based on the SDM845 Display port
> > > driver changes[1].
> > >
> > > changes in v2:
> > > - rebase on [2] (Sean Paul)
> > > - remove unwanted error checks and
> > > switch cases (Jordan Crouse)
> > >
> > > [1] https://lwn.net/Articles/768265/
> > > [2] https://lkml.org/lkml/2018/11/17/87
> > >
> > > Signed-off-by: Jeykumar Sankaran <jsanka@codeaurora.org>
> > > ---
> > > drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 8 ++---
> > > drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 47
> > +++++++++++++++++++++++++----
> > > 2 files changed, 45 insertions(+), 10 deletions(-)
> > >
> > > diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> > b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> > > index d3f4501..1f6b4b1 100644
> > > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> > > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> > > @@ -2015,7 +2015,7 @@ static int dpu_encoder_setup_display(struct
> > dpu_encoder_virt *dpu_enc,
> > > {
> > > int ret = 0;
> > > int i = 0;
> > > - enum dpu_intf_type intf_type;
> > > + enum dpu_intf_type intf_type = INTF_NONE;
> >
> > dpu_intf_type seems unnecessary, you could just use the
> > DRM_MODE_ENCODER_*
> > value
> > directly?
> >
> > > struct dpu_enc_phys_init_params phys_params;
> > >
> > > if (!dpu_enc || !dpu_kms) {
> > > @@ -2038,9 +2038,9 @@ static int dpu_encoder_setup_display(struct
> > dpu_encoder_virt *dpu_enc,
> > > case DRM_MODE_ENCODER_DSI:
> > > intf_type = INTF_DSI;
> > > break;
> > > - default:
> > > - DPU_ERROR_ENC(dpu_enc, "unsupported display interface
> > type\n");
> > > - return -EINVAL;
> > > + case DRM_MODE_ENCODER_TMDS:
> > > + intf_type = INTF_DP;
> > > + break;
> > > }
> > >
> > > WARN_ON(disp_info->num_of_h_tiles < 1);
> > > diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
> > b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
> > > index 985c855..7d931ae 100644
> > > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
> > > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
> > > @@ -473,6 +473,32 @@ static void _dpu_kms_initialize_dsi(struct
> > drm_device *dev,
> > > }
> > > }
> > >
> > > +static void _dpu_kms_initialize_displayport(struct drm_device *dev,
> > > + struct msm_drm_private *priv,
> > > + struct dpu_kms *dpu_kms)
> > > +{
> > > + struct drm_encoder *encoder = NULL;
> > > + int rc;
> > > +
> > > + if (!priv->dp)
> > > + return;
> > > +
> > > + encoder = dpu_encoder_init(dev, DRM_MODE_ENCODER_TMDS);
> > > + if (IS_ERR(encoder)) {
> > > + DPU_ERROR("encoder init failed for dsi display\n");
> > > + return;
> > > + }
> > > +
> > > + rc = msm_dp_modeset_init(priv->dp, dev, encoder);
> > > + if (rc) {
> > > + DPU_ERROR("modeset_init failed for DP, rc = %d\n", rc);
> > > + drm_encoder_cleanup(encoder);
> > > + return;
> > > + }
> > > +
> > > + priv->encoders[priv->num_encoders++] = encoder;
> >
> > No need to keep track of drm resources at the driver level, the core
> > will
> > do
> > this for you. So can you please add a patch preceding this one to remove
> > the
> > priv->encoders/crtc/planes/connectors arrays?
> >
> priv arrays for tracking drm components and priv->num_** counters are
> introduced
> by mdp4/5. DPU just adapted the implementation.
>
> De-coupling DPU from these arrays is much easier than fixing them in mdp4/5.
> I see
> mdp5 is using it to track the max resources and also in ./msm_fbdev.c.
Ok, I'll take a look at it
Sean
>
> Thanks and Regards,
> Jeykumar S.
> > > +}
> > > +
> > > /**
> > > * _dpu_kms_setup_displays - create encoders, bridges and connectors
> > > * for underlying displays
> > > @@ -487,6 +513,8 @@ static void _dpu_kms_setup_displays(struct
> > drm_device *dev,
> >
> > Why are these functions voids? Seems like there are plenty of places for
> > them to
> > fail :)
> >
> > Let's add a patch to the beginning of this series to properly handle
> > failures in
> > setup_displays and initialize_dsi
> >
> > > {
> > > _dpu_kms_initialize_dsi(dev, priv, dpu_kms);
> > >
> > > + _dpu_kms_initialize_displayport(dev, priv, dpu_kms);
> > > +
> > > /**
> > > * Extend this function to initialize other
> > > * types of displays
> > > @@ -723,13 +751,20 @@ static void _dpu_kms_set_encoder_mode(struct
> > msm_kms *kms,
> > > info.capabilities = cmd_mode ? MSM_DISPLAY_CAP_CMD_MODE :
> > > MSM_DISPLAY_CAP_VID_MODE;
> > >
> > > - /* TODO: No support for DSI swap */
> > > - for (i = 0; i < ARRAY_SIZE(priv->dsi); i++) {
> > > - if (priv->dsi[i]) {
> > > - info.h_tile_instance[info.num_of_h_tiles] = i;
> > > - info.num_of_h_tiles++;
> > > + switch (info.intf_type) {
> > > + case DRM_MODE_ENCODER_DSI:
> > > + /* TODO: No support for DSI swap */
> > > + for (i = 0; i < ARRAY_SIZE(priv->dsi); i++) {
> > > + if (priv->dsi[i]) {
> > > + info.h_tile_instance[info.num_of_h_tiles]
> > = i;
> > > + info.num_of_h_tiles++;
> > > + }
> > > }
> > > - }
> > > + break;
> > > + case DRM_MODE_ENCODER_TMDS:
> > > + info.num_of_h_tiles = 1;
> > > + break;
> > > + };
> > >
> > > rc = dpu_encoder_setup(encoder->dev, encoder, &info);
> > > if (rc)
> > > --
> > > The Qualcomm Innovation Center, Inc. is a member of the Code Aurora
> > Forum,
> > > a Linux Foundation Collaborative Project
> > >
> > > _______________________________________________
> > > Freedreno mailing list
> > > Freedreno@lists.freedesktop.org
> > > https://lists.freedesktop.org/mailman/listinfo/freedreno
>
> --
> Jeykumar S
--
Sean Paul, Software Engineer, Google / Chromium OS
_______________________________________________
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] drm/msm/dpu: add display port support in DPU
2018-12-03 14:47 ` Sean Paul
2018-12-04 3:02 ` Jeykumar Sankaran
@ 2018-12-04 23:45 ` Jeykumar Sankaran
1 sibling, 0 replies; 6+ messages in thread
From: Jeykumar Sankaran @ 2018-12-04 23:45 UTC (permalink / raw)
To: Sean Paul
Cc: linux-arm-msm-u79uwXL29TY76Z2rM5mHXA,
robdclark-Re5JQEeQqe8AvxtiuMwx3w,
dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
jcrouse-sgV2jX0FEOL9JmXXK+q4OQ, seanpaul-F7+t8E8rja9g9hUCZPvPmw,
hoegsberg-hpIqsD4AKlfQT0dZR+AlfA,
freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
On 2018-12-03 06:47, Sean Paul wrote:
> On Tue, Nov 27, 2018 at 02:28:30PM -0800, Jeykumar Sankaran wrote:
>> Add display port support in DPU by creating hooks
>> for DP encoder enumeration and encoder mode
>> initialization.
>>
>> This change is based on the SDM845 Display port
>> driver changes[1].
>>
>> changes in v2:
>> - rebase on [2] (Sean Paul)
>> - remove unwanted error checks and
>> switch cases (Jordan Crouse)
>>
>> [1] https://lwn.net/Articles/768265/
>> [2] https://lkml.org/lkml/2018/11/17/87
>>
>> Signed-off-by: Jeykumar Sankaran <jsanka@codeaurora.org>
>> ---
>> drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 8 ++---
>> drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 47
> +++++++++++++++++++++++++----
>> 2 files changed, 45 insertions(+), 10 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
>> index d3f4501..1f6b4b1 100644
>> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
>> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
>> @@ -2015,7 +2015,7 @@ static int dpu_encoder_setup_display(struct
> dpu_encoder_virt *dpu_enc,
>> {
>> int ret = 0;
>> int i = 0;
>> - enum dpu_intf_type intf_type;
>> + enum dpu_intf_type intf_type = INTF_NONE;
>
> dpu_intf_type seems unnecessary, you could just use the
> DRM_MODE_ENCODER_*
> value
> directly?
>
enum dpu_intf_type enumerates HW interface types the SOC has. Below
switch
case maps the DRM_MODE_ENCODER_* to HW dpu_intf_type it should reserve.
Note that DRM_MODE_ENCODER_* and dpu_intf_type are not mapped 1-to-1.
e.g. DRM_MODE_ENCODER_TMDS can be mapped to HDMI or DisplayPort.
Thanks,
Jeykumar S.
>> struct dpu_enc_phys_init_params phys_params;
>>
>> if (!dpu_enc || !dpu_kms) {
>> @@ -2038,9 +2038,9 @@ static int dpu_encoder_setup_display(struct
> dpu_encoder_virt *dpu_enc,
>> case DRM_MODE_ENCODER_DSI:
>> intf_type = INTF_DSI;
>> break;
>> - default:
>> - DPU_ERROR_ENC(dpu_enc, "unsupported display interface
> type\n");
>> - return -EINVAL;
>> + case DRM_MODE_ENCODER_TMDS:
>> + intf_type = INTF_DP;
>> + break;
>> }
>>
>> WARN_ON(disp_info->num_of_h_tiles < 1);
>> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
> b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
>> index 985c855..7d931ae 100644
>> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
>> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
>> @@ -473,6 +473,32 @@ static void _dpu_kms_initialize_dsi(struct
> drm_device *dev,
>> }
>> }
>>
>> +static void _dpu_kms_initialize_displayport(struct drm_device *dev,
>> + struct msm_drm_private *priv,
>> + struct dpu_kms *dpu_kms)
>> +{
>> + struct drm_encoder *encoder = NULL;
>> + int rc;
>> +
>> + if (!priv->dp)
>> + return;
>> +
>> + encoder = dpu_encoder_init(dev, DRM_MODE_ENCODER_TMDS);
>> + if (IS_ERR(encoder)) {
>> + DPU_ERROR("encoder init failed for dsi display\n");
>> + return;
>> + }
>> +
>> + rc = msm_dp_modeset_init(priv->dp, dev, encoder);
>> + if (rc) {
>> + DPU_ERROR("modeset_init failed for DP, rc = %d\n", rc);
>> + drm_encoder_cleanup(encoder);
>> + return;
>> + }
>> +
>> + priv->encoders[priv->num_encoders++] = encoder;
>
> No need to keep track of drm resources at the driver level, the core
> will
> do
> this for you. So can you please add a patch preceding this one to
> remove
> the
> priv->encoders/crtc/planes/connectors arrays?
>
>> +}
>> +
>> /**
>> * _dpu_kms_setup_displays - create encoders, bridges and connectors
>> * for underlying displays
>> @@ -487,6 +513,8 @@ static void _dpu_kms_setup_displays(struct
> drm_device *dev,
>
> Why are these functions voids? Seems like there are plenty of places
> for
> them to
> fail :)
>
> Let's add a patch to the beginning of this series to properly handle
> failures in
> setup_displays and initialize_dsi
>
>> {
>> _dpu_kms_initialize_dsi(dev, priv, dpu_kms);
>>
>> + _dpu_kms_initialize_displayport(dev, priv, dpu_kms);
>> +
>> /**
>> * Extend this function to initialize other
>> * types of displays
>> @@ -723,13 +751,20 @@ static void _dpu_kms_set_encoder_mode(struct
> msm_kms *kms,
>> info.capabilities = cmd_mode ? MSM_DISPLAY_CAP_CMD_MODE :
>> MSM_DISPLAY_CAP_VID_MODE;
>>
>> - /* TODO: No support for DSI swap */
>> - for (i = 0; i < ARRAY_SIZE(priv->dsi); i++) {
>> - if (priv->dsi[i]) {
>> - info.h_tile_instance[info.num_of_h_tiles] = i;
>> - info.num_of_h_tiles++;
>> + switch (info.intf_type) {
>> + case DRM_MODE_ENCODER_DSI:
>> + /* TODO: No support for DSI swap */
>> + for (i = 0; i < ARRAY_SIZE(priv->dsi); i++) {
>> + if (priv->dsi[i]) {
>> + info.h_tile_instance[info.num_of_h_tiles]
> = i;
>> + info.num_of_h_tiles++;
>> + }
>> }
>> - }
>> + break;
>> + case DRM_MODE_ENCODER_TMDS:
>> + info.num_of_h_tiles = 1;
>> + break;
>> + };
>>
>> rc = dpu_encoder_setup(encoder->dev, encoder, &info);
>> if (rc)
>> --
>> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora
> Forum,
>> a Linux Foundation Collaborative Project
>>
>> _______________________________________________
>> Freedreno mailing list
>> Freedreno@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/freedreno
--
Jeykumar S
_______________________________________________
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2018-12-04 23:45 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-27 22:28 [PATCH v2] drm/msm/dpu: add display port support in DPU Jeykumar Sankaran
[not found] ` <1543357710-3918-1-git-send-email-jsanka-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-12-01 7:35 ` kbuild test robot
2018-12-03 14:47 ` Sean Paul
2018-12-04 3:02 ` Jeykumar Sankaran
[not found] ` <3ee2493cf6b31c903add62e837364056-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-12-04 13:52 ` Sean Paul
2018-12-04 23:45 ` Jeykumar Sankaran
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.