Re: [Intel-gfx] [PATCH] drm/i915: Do not create a new max_bpc prop for MST connectors

2019-08-21 Thread Li, Sun peng (Leo)


On 2019-08-20 12:16 p.m., Ville Syrjala wrote:
> From: Ville Syrjälä 
> 
> We're not allowed to create new properties after device registration
> so for MST connectors we need to either create the max_bpc property
> earlier, or we reuse one we already have. Let's do the latter apporach
> since the corresponding SST connector already has the prop and its
> min/max are correct also for the MST connector.
> 
> The problem was highlighted by commit 4f5368b5541a ("drm/kms:
> Catch mode_object lifetime errors") which results in the following
> spew:
> [ 1330.878941] WARNING: CPU: 2 PID: 1554 at 
> drivers/gpu/drm/drm_mode_object.c:45 __drm_mode_object_add+0xa0/0xb0 [drm]
> ...
> [ 1330.879008] Call Trace:
> [ 1330.879023]  drm_property_create+0xba/0x180 [drm]
> [ 1330.879036]  drm_property_create_range+0x15/0x30 [drm]
> [ 1330.879048]  drm_connector_attach_max_bpc_property+0x62/0x80 [drm]
> [ 1330.879086]  intel_dp_add_mst_connector+0x11f/0x140 [i915]
> [ 1330.879094]  drm_dp_add_port.isra.20+0x20b/0x440 [drm_kms_helper]
> ...
> 
> Cc: sta...@vger.kernel.org
> Cc: Lyude Paul 
> Cc: sunpeng...@amd.com
> Cc: Daniel Vetter 
> Cc: Sean Paul 
> Fixes: 5ca0ef8a56b8 ("drm/i915: Add max_bpc property for DP MST")
> Signed-off-by: Ville Syrjälä 

Thanks for following up, I had forgotten about this issue.
Reviewed-by: Leo Li 

> ---
>  drivers/gpu/drm/i915/display/intel_dp_mst.c | 10 +-
>  1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_dp_mst.c 
> b/drivers/gpu/drm/i915/display/intel_dp_mst.c
> index 83faa246e361..9748581c1d62 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp_mst.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp_mst.c
> @@ -536,7 +536,15 @@ static struct drm_connector 
> *intel_dp_add_mst_connector(struct drm_dp_mst_topolo
>  
>   intel_attach_force_audio_property(connector);
>   intel_attach_broadcast_rgb_property(connector);
> - drm_connector_attach_max_bpc_property(connector, 6, 12);
> +
> + /*
> +  * Reuse the prop from the SST connector because we're
> +  * not allowed to create new props after device registration.
> +  */
> + connector->max_bpc_property =
> + intel_dp->attached_connector->base.max_bpc_property;
> + if (connector->max_bpc_property)
> + drm_connector_attach_max_bpc_property(connector, 6, 12);
>  
>   return connector;
>  
> 
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Re: [Intel-gfx] [RFC][PATCH 0/2] drm: PATH prop for all connectors?

2019-08-01 Thread Li, Sun peng (Leo)


On 2019-08-01 5:51 a.m., Pekka Paalanen wrote:
> On Tue, 16 Jul 2019 14:59:58 +
> "Li, Sun peng (Leo)"  wrote:
> 
>> On 2019-07-11 3:29 a.m., Pekka Paalanen wrote:
>>> Wait, one can write udev rules for connectors and stuff?
>>> How? What can they do?  
>>
>> I was using it to generate user-friendly device names for the mst aux
>> implementation:
>> https://patchwork.freedesktop.org/patch/315900/?series=63237=2
> 
> Hi,
> 
> what is that device node used for?
> 
> Are the "by-path" symlinks to help a display server associate the
> right device node with the right DRM KMS connector resource?

I intended it to be something more descriptive than the
'/dev/drm_dp_aux0, drm_dp_aux1, drm_dp_aux2, ...'  names, to help users
identify the connector they're addressing in the mst topology. I guess
it could also be used for the purpose you mention as well.

Of course, we'd need more reliable and persistent PATH props first. The
patch was dropped until this happens.

Leo

> 
> The patch commit message did not explain what the names are
> actually used for.
> 
> 
> Thanks,
> pq
> 
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Re: [Intel-gfx] [RFC][PATCH 0/2] drm: PATH prop for all connectors?

2019-07-16 Thread Li, Sun peng (Leo)


On 2019-07-11 3:29 a.m., Pekka Paalanen wrote:
> Wait, one can write udev rules for connectors and stuff?
> How? What can they do?

I was using it to generate user-friendly device names for the mst aux
implementation:
https://patchwork.freedesktop.org/patch/315900/?series=63237=2

Leo
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Re: [Intel-gfx] [PATCH 2/2] drm/atomic: Create and use __drm_atomic_helper_crtc_reset() everywhere

2018-11-12 Thread Li, Sun peng (Leo)


On 2018-11-12 10:01 AM, Maarten Lankhorst wrote:
> We already have __drm_atomic_helper_connector_reset() and
> __drm_atomic_helper_plane_reset(), extend this to crtc as well.
> 
> Most drivers already have a gpu reset hook, correct it.
> Nouveau already implemented its own __drm_atomic_helper_crtc_reset(),
> convert it to the common one.
> 
> Signed-off-by: Maarten Lankhorst 
> Cc: Harry Wentland 
> Cc: Leo Li 
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: "David (ChunMing) Zhou" 
> Cc: David Airlie 
> Cc: Liviu Dudau 
> Cc: Brian Starkey 
> Cc: Mali DP Maintainers 
> Cc: Boris Brezillon 
> Cc: Nicolas Ferre 
> Cc: Alexandre Belloni 
> Cc: Ludovic Desroches 
> Cc: Maarten Lankhorst 
> Cc: Maxime Ripard 
> Cc: Sean Paul 
> Cc: Jani Nikula 
> Cc: Joonas Lahtinen 
> Cc: Rodrigo Vivi 
> Cc: Philipp Zabel 
> Cc: CK Hu 
> Cc: Matthias Brugger 
> Cc: Rob Clark 
> Cc: Ben Skeggs 
> Cc: Tomi Valkeinen 
> Cc: Laurent Pinchart 
> Cc: Kieran Bingham 
> Cc: Sandy Huang 
> Cc: "Heiko Stübner" 
> Cc: Thierry Reding 
> Cc: Jonathan Hunter 
> Cc: Eric Anholt 
> Cc: VMware Graphics 
> Cc: Sinclair Yeh 
> Cc: Thomas Hellstrom 
> Cc: Tony Cheng 
> Cc: Shirish S 
> Cc: Mikita Lipski 
> Cc: Bhawanpreet Lakha 
> Cc: David Francis 
> Cc: Anthony Koo 
> Cc: Jeykumar Sankaran 
> Cc: Jordan Crouse 
> Cc: Bruce Wang 
> Cc: Sravanthi Kollukuduru 
> Cc: Archit Taneja 
> Cc: Steve Kowalik 
> Cc: Carsten Behling 
> Cc: Haneen Mohammed 
> Cc: Daniel Vetter 
> Cc: Rodrigo Siqueira 
> Cc: Mahesh Kumar 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-de...@lists.freedesktop.org
> Cc: linux-ker...@vger.kernel.org
> Cc: linux-arm-ker...@lists.infradead.org
> Cc: intel-gfx@lists.freedesktop.org
> Cc: linux-media...@lists.infradead.org
> Cc: linux-arm-...@vger.kernel.org
> Cc: freedr...@lists.freedesktop.org
> Cc: nouv...@lists.freedesktop.org
> Cc: linux-renesas-...@vger.kernel.org
> Cc: linux-rockc...@lists.infradead.org
> Cc: linux-te...@vger.kernel.org
> ---
>   .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c |  4 +--
>   drivers/gpu/drm/arm/malidp_crtc.c |  5 +--
>   .../gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c|  5 +--
>   drivers/gpu/drm/drm_atomic_state_helper.c | 31 ---
>   drivers/gpu/drm/i915/intel_display.c  |  2 +-
>   drivers/gpu/drm/imx/ipuv3-crtc.c  |  5 +--
>   drivers/gpu/drm/mediatek/mtk_drm_crtc.c   |  5 +--
>   drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c  | 12 ++-
>   drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c |  6 +---
>   drivers/gpu/drm/nouveau/dispnv50/head.c   | 13 ++--
>   drivers/gpu/drm/omapdrm/omap_crtc.c   |  7 ++---
>   drivers/gpu/drm/rcar-du/rcar_du_crtc.c|  4 +--
>   drivers/gpu/drm/rockchip/rockchip_drm_vop.c   |  7 +++--
>   drivers/gpu/drm/tegra/dc.c|  5 +--
>   drivers/gpu/drm/vc4/vc4_crtc.c|  8 ++---
>   drivers/gpu/drm/vkms/vkms_crtc.c  |  7 +
>   drivers/gpu/drm/vmwgfx/vmwgfx_kms.c   |  9 +-
>   include/drm/drm_atomic_state_helper.h |  2 ++
>   18 files changed, 56 insertions(+), 81 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c 
> b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> index 5064768642f3..770a71726cd1 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -2802,9 +2802,7 @@ static void dm_crtc_reset_state(struct drm_crtc *crtc)
>   if (WARN_ON(!state))
>   return;
>   
> - crtc->state = >base;
> - crtc->state->crtc = crtc;
> -
> + __drm_atomic_helper_crtc_reset(crtc, >base);
>   }
>   
>   static struct drm_crtc_state *
> diff --git a/drivers/gpu/drm/arm/malidp_crtc.c 
> b/drivers/gpu/drm/arm/malidp_crtc.c
> index e1b72782848c..9a924ff27148 100644
> --- a/drivers/gpu/drm/arm/malidp_crtc.c
> +++ b/drivers/gpu/drm/arm/malidp_crtc.c
> @@ -474,10 +474,7 @@ static void malidp_crtc_reset(struct drm_crtc *crtc)
>   
>   kfree(state);
>   state = kzalloc(sizeof(*state), GFP_KERNEL);
> - if (state) {
> - crtc->state = >base;
> - crtc->state->crtc = crtc;
> - }
> + __drm_atomic_helper_crtc_reset(crtc, >base);
>   }
>   
>   static void malidp_crtc_destroy_state(struct drm_crtc *crtc,
> diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c 
> b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c
> index 96f4082671fe..8084d549c7d1 100644
> --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c
> +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c
> @@ -412,10 +412,7 @@ static void atmel_hlcdc_crtc_reset(struct drm_crtc *crtc)
>   }
>   
>   state = kzalloc(sizeof(*state), GFP_KERNEL);
> - if (state) {
> - crtc->state = >base;
> - crtc->state->crtc = crtc;
> - }
> + __drm_atomic_helper_crtc_reset(crtc, >base);
>   }
>   
>   static struct drm_crtc_state *
> diff --git a/drivers/gpu/drm/drm_atomic_state_helper.c 
> 

Re: [Intel-gfx] ✗ Fi.CI.IGT: failure for drm: Get ref on CRTC commit object when waiting for flip_done

2018-10-17 Thread Li, Sun peng (Leo)


On 2018-10-16 06:48 PM, Patchwork wrote:
> == Series Details ==
> 
> Series: drm: Get ref on CRTC commit object when waiting for flip_done
> URL   : https://patchwork.freedesktop.org/series/51079/
> State : failure
> 
> == Summary ==
> 
> = CI Bug Log - changes from CI_DRM_4990_full -> Patchwork_10479_full =
> 
> == Summary - FAILURE ==
> 
>Serious unknown changes coming with Patchwork_10479_full absolutely need 
> to be
>verified manually.
>
>If you think the reported changes have nothing to do with the changes
>introduced in Patchwork_10479_full, please notify your bug team to allow 
> them
>to document this new failure mode, which will reduce false positives in CI.
> 
>
> 
> == Possible new issues ==
> 
>Here are the unknown changes that may have been introduced in 
> Patchwork_10479_full:
> 
>=== IGT changes ===
> 
>   Possible regressions 
> 
>  igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions-varying-size:
>shard-skl:  PASS -> FAIL
> 

I can't seem to reproduce this, here's what I've done:

* Running on a skylake i5-6600
* Single 4k display via DP
* System is imaged to the commits specified in '== Build changes =='
* Ran '# ./kms_cursor_legacy --run-subtest 
flip-vs-cursor-atomictransitions-varying-size'

Maybe I'm missing something?

Leo

>  
> == Known issues ==
> 
>Here are the changes found in Patchwork_10479_full that come from known 
> issues:
> 
>=== IGT changes ===
> 
>   Issues hit 
> 
>  igt@gem_exec_schedule@pi-ringfull-blt:
>shard-skl:  NOTRUN -> FAIL (fdo#103158)
> 
>  igt@gem_exec_schedule@pi-ringfull-render:
>shard-glk:  NOTRUN -> FAIL (fdo#103158)
> 
>  igt@gem_ppgtt@blt-vs-render-ctx0:
>shard-skl:  NOTRUN -> TIMEOUT (fdo#108039)
> 
>  igt@gem_ppgtt@blt-vs-render-ctxn:
>shard-kbl:  PASS -> INCOMPLETE (fdo#103665, fdo#106023)
> 
>  igt@kms_atomic_transition@1x-modeset-transitions-nonblocking:
>shard-skl:  NOTRUN -> FAIL (fdo#108228)
> 
>  igt@kms_busy@extended-modeset-hang-newfb-render-b:
>shard-hsw:  NOTRUN -> DMESG-WARN (fdo#107956) +1
> 
>  igt@kms_busy@extended-pageflip-modeset-hang-oldfb-render-a:
>shard-glk:  NOTRUN -> DMESG-WARN (fdo#107956) +1
> 
>  igt@kms_cursor_crc@cursor-256x256-random:
>shard-apl:  PASS -> FAIL (fdo#103232) +2
> 
>  igt@kms_cursor_crc@cursor-256x256-suspend:
>shard-skl:  NOTRUN -> FAIL (fdo#103191, fdo#103232)
> 
>  igt@kms_cursor_crc@cursor-64x64-suspend:
>shard-glk:  PASS -> FAIL (fdo#103232)
> 
>  igt@kms_cursor_legacy@pipe-c-forked-move:
>shard-apl:  PASS -> INCOMPLETE (fdo#103927)
> 
>  igt@kms_frontbuffer_tracking@fbc-1p-primscrn-pri-indfb-draw-mmap-gtt:
>shard-skl:  NOTRUN -> FAIL (fdo#105682) +1
> 
>  igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-mmap-wc:
>shard-apl:  PASS -> FAIL (fdo#103167)
> 
>  igt@kms_frontbuffer_tracking@psr-1p-primscrn-cur-indfb-move:
>shard-skl:  NOTRUN -> FAIL (fdo#103167) +4
> 
>  igt@kms_plane@pixel-format-pipe-a-planes:
>shard-skl:  NOTRUN -> DMESG-FAIL (fdo#103166, fdo#106885)
> 
>  igt@kms_plane@plane-position-covered-pipe-b-planes:
>shard-glk:  NOTRUN -> FAIL (fdo#103166) +1
> 
>  igt@kms_plane_alpha_blend@pipe-b-constant-alpha-max:
>shard-glk:  NOTRUN -> FAIL (fdo#108145) +2
> 
>  igt@kms_plane_alpha_blend@pipe-c-alpha-basic:
>shard-skl:  NOTRUN -> FAIL (fdo#107815, fdo#108145)
> 
>  igt@kms_plane_alpha_blend@pipe-c-constant-alpha-min:
>shard-skl:  NOTRUN -> FAIL (fdo#108145) +3
> 
>  igt@kms_rotation_crc@exhaust-fences:
>shard-skl:  NOTRUN -> DMESG-WARN (fdo#105748)
> 
>  
>   Possible fixes 
> 
>  igt@kms_flip@flip-vs-expired-vblank-interruptible:
>shard-glk:  FAIL (fdo#105363) -> PASS
> 
>  igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-mmap-wc:
>shard-glk:  FAIL (fdo#103167) -> PASS
> 
>  igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-render:
>shard-apl:  FAIL (fdo#103167) -> PASS
> 
>  igt@kms_vblank@pipe-a-ts-continuation-suspend:
>shard-skl:  INCOMPLETE (fdo#104108, fdo#107773) -> PASS
> 
>  igt@perf@short-reads:
>shard-skl:  FAIL (fdo#103183) -> PASS
> 
>  igt@pm_rpm@dpms-mode-unset-non-lpsp:
>shard-skl:  INCOMPLETE (fdo#107807) -> SKIP
> 
>  
>   Warnings 
> 
>  igt@pm_backlight@fade_with_suspend:
>shard-skl:  FAIL (fdo#107847) -> INCOMPLETE (fdo#107773)
> 
>  
>fdo#103158 https://bugs.freedesktop.org/show_bug.cgi?id=103158
>fdo#103166 https://bugs.freedesktop.org/show_bug.cgi?id=103166
>