AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
  • * [PATCH AUTOSEL 4.20 218/304] drm/amd/display: Add retry to read ddc_clock pin
           [not found] <20190128154341.47195-1-sashal@kernel.org>
           [not found] ` <20190128154341.47195-1-sashal-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
    @ 2019-01-28 15:42 ` Sasha Levin
      2019-01-28 15:42 ` [PATCH AUTOSEL 4.20 219/304] drm/amd/display: Wait edp HPD to high in detect_sink Sasha Levin
                       ` (2 subsequent siblings)
      4 siblings, 0 replies; 8+ messages in thread
    From: Sasha Levin @ 2019-01-28 15:42 UTC (permalink / raw)
      To: linux-kernel, stable
      Cc: Paul Hsieh, Alex Deucher, Sasha Levin, amd-gfx, dri-devel
    
    From: Paul Hsieh <paul.hsieh@amd.com>
    
    [ Upstream commit bd4905a9583c760da31ded7256dca6f71483c3dc ]
    
    [WHY]
    On customer board, there is one pluse (1v , < 1ms) on
    DDC_CLK pin when plug / unplug DP cable. Driver will read
    it and config DP to HDMI/DVI dongle.
    
    [HOW]
    If there is a real dongle, DDC_CLK should be always pull high.
    Try to read again to recovery this special case. Retry times = 3.
    Need additional 3ms to detect DP passive dongle(3 failures)
    
    Signed-off-by: Paul Hsieh <paul.hsieh@amd.com>
    Reviewed-by: Eric Yang <eric.yang2@amd.com>
    Acked-by: Leo Li <sunpeng.li@amd.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
     drivers/gpu/drm/amd/display/dc/core/dc_link.c | 23 ++++++++++++++-----
     1 file changed, 17 insertions(+), 6 deletions(-)
    
    diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link.c b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
    index 5141c1401889..ef1b350a45e0 100644
    --- a/drivers/gpu/drm/amd/display/dc/core/dc_link.c
    +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
    @@ -332,7 +332,7 @@ bool dc_link_is_dp_sink_present(struct dc_link *link)
     {
     	enum gpio_result gpio_result;
     	uint32_t clock_pin = 0;
    -
    +	uint8_t retry = 0;
     	struct ddc *ddc;
     
     	enum connector_id connector_id =
    @@ -361,11 +361,22 @@ bool dc_link_is_dp_sink_present(struct dc_link *link)
     		return present;
     	}
     
    -	/* Read GPIO: DP sink is present if both clock and data pins are zero */
    -	/* [anaumov] in DAL2, there was no check for GPIO failure */
    -
    -	gpio_result = dal_gpio_get_value(ddc->pin_clock, &clock_pin);
    -	ASSERT(gpio_result == GPIO_RESULT_OK);
    +	/*
    +	 * Read GPIO: DP sink is present if both clock and data pins are zero
    +	 *
    +	 * [W/A] plug-unplug DP cable, sometimes customer board has
    +	 * one short pulse on clk_pin(1V, < 1ms). DP will be config to HDMI/DVI
    +	 * then monitor can't br light up. Add retry 3 times
    +	 * But in real passive dongle, it need additional 3ms to detect
    +	 */
    +	do {
    +		gpio_result = dal_gpio_get_value(ddc->pin_clock, &clock_pin);
    +		ASSERT(gpio_result == GPIO_RESULT_OK);
    +		if (clock_pin)
    +			udelay(1000);
    +		else
    +			break;
    +	} while (retry++ < 3);
     
     	present = (gpio_result == GPIO_RESULT_OK) && !clock_pin;
     
    -- 
    2.19.1
    
    ^ permalink raw reply related	[flat|nested] 8+ messages in thread
  • * [PATCH AUTOSEL 4.20 219/304] drm/amd/display: Wait edp HPD to high in detect_sink
           [not found] <20190128154341.47195-1-sashal@kernel.org>
           [not found] ` <20190128154341.47195-1-sashal-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
      2019-01-28 15:42 ` [PATCH AUTOSEL 4.20 218/304] drm/amd/display: Add retry to read ddc_clock pin Sasha Levin
    @ 2019-01-28 15:42 ` Sasha Levin
      2019-01-28 15:42 ` [PATCH AUTOSEL 4.20 221/304] drm/amd/display: fix YCbCr420 blank color Sasha Levin
      2019-01-28 15:42 ` [PATCH AUTOSEL 4.20 243/304] drm/amd/display: validate extended dongle caps Sasha Levin
      4 siblings, 0 replies; 8+ messages in thread
    From: Sasha Levin @ 2019-01-28 15:42 UTC (permalink / raw)
      To: linux-kernel, stable
      Cc: Alex Deucher, Sasha Levin, Dale Zhao, dri-devel, amd-gfx
    
    From: Dale Zhao <dale.zhao@amd.com>
    
    [ Upstream commit 0a6414e75d231ee1bb7ffb2f5eb246b682a884cd ]
    
    [Why]
    In 99% user case, edp will be post by vbios.
    In 1% / current case: Lenovo don't light up edp panel in vbios
    post stage, vbios won't be lit up. Thus in dal when we init DCN
    10 hw, we power up edp, then we start detect_sink, but internal
    time is too short, when we detect it, HPD is still low, so we don't
    detect the edp, and edp shows black.
    
    [How]
    When we init hw, we wait edp HPD to high after power up edp.
    
    Signed-off-by: Dale Zhao <dale.zhao@amd.com>
    Reviewed-by: Eric Yang <eric.yang2@amd.com>
    Acked-by: Leo Li <sunpeng.li@amd.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
     drivers/gpu/drm/amd/display/dc/core/dc_link.c | 3 +++
     1 file changed, 3 insertions(+)
    
    diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link.c b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
    index ef1b350a45e0..8b69913b6943 100644
    --- a/drivers/gpu/drm/amd/display/dc/core/dc_link.c
    +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
    @@ -208,6 +208,9 @@ bool dc_link_detect_sink(struct dc_link *link, enum dc_connection_type *type)
     		return true;
     	}
     
    +	if (link->connector_signal == SIGNAL_TYPE_EDP)
    +		link->dc->hwss.edp_wait_for_hpd_ready(link, true);
    +
     	/* todo: may need to lock gpio access */
     	hpd_pin = get_hpd_gpio(link->ctx->dc_bios, link->link_id, link->ctx->gpio_service);
     	if (hpd_pin == NULL)
    -- 
    2.19.1
    
    _______________________________________________
    dri-devel mailing list
    dri-devel@lists.freedesktop.org
    https://lists.freedesktop.org/mailman/listinfo/dri-devel
    
    ^ permalink raw reply related	[flat|nested] 8+ messages in thread
  • * [PATCH AUTOSEL 4.20 221/304] drm/amd/display: fix YCbCr420 blank color
           [not found] <20190128154341.47195-1-sashal@kernel.org>
                       ` (2 preceding siblings ...)
      2019-01-28 15:42 ` [PATCH AUTOSEL 4.20 219/304] drm/amd/display: Wait edp HPD to high in detect_sink Sasha Levin
    @ 2019-01-28 15:42 ` Sasha Levin
      2019-01-28 15:42 ` [PATCH AUTOSEL 4.20 243/304] drm/amd/display: validate extended dongle caps Sasha Levin
      4 siblings, 0 replies; 8+ messages in thread
    From: Sasha Levin @ 2019-01-28 15:42 UTC (permalink / raw)
      To: linux-kernel, stable
      Cc: Eric Yang, Alex Deucher, Sasha Levin, amd-gfx, dri-devel
    
    From: Eric Yang <Eric.Yang2@amd.com>
    
    [ Upstream commit 12750d1647f118496f1da727146f255f5e44d500 ]
    
    [Why]
    YCbCr420 packing format uses two chanels for luma, and 1
    channel for both chroma component. Our previous implementation
    did not account for this and results in every other pixel having
    very high luma value, showing greyish color instead of black.
    
    YCbCr444 = <Y1, Cb1, Cr1>; <Y2, Cb2, Cr2> .....
    YCbCr420 = <Y1, Y2,  Cb1>; <Y3, Y4,  Cr1> .....
    
    [How]
    Program the second channel with the black color value for luma
    as well.
    
    Signed-off-by: Eric Yang <Eric.Yang2@amd.com>
    Reviewed-by: Hugo Hu <Hugo.Hu@amd.com>
    Acked-by: Leo Li <sunpeng.li@amd.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
     .../drm/amd/display/dc/dce110/dce110_hw_sequencer.c   | 11 ++++++++++-
     .../gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c |  9 +++++++++
     2 files changed, 19 insertions(+), 1 deletion(-)
    
    diff --git a/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c b/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c
    index a6bcb90e8419..4443a916a0fb 100644
    --- a/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c
    +++ b/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c
    @@ -1268,10 +1268,19 @@ static void program_scaler(const struct dc *dc,
     		pipe_ctx->plane_res.scl_data.lb_params.depth,
     		&pipe_ctx->stream->bit_depth_params);
     
    -	if (pipe_ctx->stream_res.tg->funcs->set_overscan_blank_color)
    +	if (pipe_ctx->stream_res.tg->funcs->set_overscan_blank_color) {
    +		/*
    +		 * The way 420 is packed, 2 channels carry Y component, 1 channel
    +		 * alternate between Cb and Cr, so both channels need the pixel
    +		 * value for Y
    +		 */
    +		if (pipe_ctx->stream->timing.pixel_encoding == PIXEL_ENCODING_YCBCR420)
    +			color.color_r_cr = color.color_g_y;
    +
     		pipe_ctx->stream_res.tg->funcs->set_overscan_blank_color(
     				pipe_ctx->stream_res.tg,
     				&color);
    +	}
     
     	pipe_ctx->plane_res.xfm->funcs->transform_set_scaler(pipe_ctx->plane_res.xfm,
     		&pipe_ctx->plane_res.scl_data);
    diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c
    index 32e4c653b1b4..220ba828748d 100644
    --- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c
    +++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c
    @@ -2165,6 +2165,15 @@ static void dcn10_blank_pixel_data(
     	color_space = stream->output_color_space;
     	color_space_to_black_color(dc, color_space, &black_color);
     
    +	/*
    +	 * The way 420 is packed, 2 channels carry Y component, 1 channel
    +	 * alternate between Cb and Cr, so both channels need the pixel
    +	 * value for Y
    +	 */
    +	if (stream->timing.pixel_encoding == PIXEL_ENCODING_YCBCR420)
    +		black_color.color_r_cr = black_color.color_g_y;
    +
    +
     	if (stream_res->tg->funcs->set_blank_color)
     		stream_res->tg->funcs->set_blank_color(
     				stream_res->tg,
    -- 
    2.19.1
    
    ^ permalink raw reply related	[flat|nested] 8+ messages in thread
  • * [PATCH AUTOSEL 4.20 243/304] drm/amd/display: validate extended dongle caps
           [not found] <20190128154341.47195-1-sashal@kernel.org>
                       ` (3 preceding siblings ...)
      2019-01-28 15:42 ` [PATCH AUTOSEL 4.20 221/304] drm/amd/display: fix YCbCr420 blank color Sasha Levin
    @ 2019-01-28 15:42 ` Sasha Levin
      4 siblings, 0 replies; 8+ messages in thread
    From: Sasha Levin @ 2019-01-28 15:42 UTC (permalink / raw)
      To: linux-kernel, stable
      Cc: Wenjing Liu, Alex Deucher, Sasha Levin, amd-gfx, dri-devel
    
    From: Wenjing Liu <Wenjing.Liu@amd.com>
    
    [ Upstream commit 99b922f9ed6a6313c0d2247cde8aa1e4a0bd67e4 ]
    
    [why]
    Some dongle doesn't have a valid extended dongle caps,
    but we still set the extended dongle caps to be valid.
    This causes validation fails for all timing.
    
    [how]
    If no dp_hdmi_max_pixel_clk is provided,
    don't use extended dongle caps.
    
    Signed-off-by: Wenjing Liu <Wenjing.Liu@amd.com>
    Reviewed-by: Aric Cyr <Aric.Cyr@amd.com>
    Reviewed-by: Jun Lei <Jun.Lei@amd.com>
    Acked-by: Abdoulaye Berthe <Abdoulaye.Berthe@amd.com>
    Acked-by: Leo Li <sunpeng.li@amd.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
     drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 3 ++-
     1 file changed, 2 insertions(+), 1 deletion(-)
    
    diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
    index d91df5ef0cb3..d33a5ebe990b 100644
    --- a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
    +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
    @@ -2240,7 +2240,8 @@ static void get_active_converter_info(
     					translate_dpcd_max_bpc(
     						hdmi_color_caps.bits.MAX_BITS_PER_COLOR_COMPONENT);
     
    -				link->dpcd_caps.dongle_caps.extendedCapValid = true;
    +				if (link->dpcd_caps.dongle_caps.dp_hdmi_max_pixel_clk != 0)
    +					link->dpcd_caps.dongle_caps.extendedCapValid = true;
     			}
     
     			break;
    -- 
    2.19.1
    
    ^ permalink raw reply related	[flat|nested] 8+ messages in thread

  • end of thread, other threads:[~2019-01-28 15:42 UTC | newest]
    
    Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
    -- links below jump to the message on this page --
         [not found] <20190128154341.47195-1-sashal@kernel.org>
         [not found] ` <20190128154341.47195-1-sashal-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
    2019-01-28 15:38   ` [PATCH AUTOSEL 4.20 013/304] drm/amd/display: Fix potential nullptr error Sasha Levin
    2019-01-28 15:39   ` [PATCH AUTOSEL 4.20 055/304] drm/amd/display: fix gamma not being applied correctly Sasha Levin
    2019-01-28 15:39   ` [PATCH AUTOSEL 4.20 056/304] drm/amd/display: calculate stream->phy_pix_clk before clock mapping Sasha Levin
    2019-01-28 15:40   ` [PATCH AUTOSEL 4.20 129/304] drm/amdgpu/powerplay: fix clock stretcher limits on polaris (v2) Sasha Levin
    2019-01-28 15:42 ` [PATCH AUTOSEL 4.20 218/304] drm/amd/display: Add retry to read ddc_clock pin Sasha Levin
    2019-01-28 15:42 ` [PATCH AUTOSEL 4.20 219/304] drm/amd/display: Wait edp HPD to high in detect_sink Sasha Levin
    2019-01-28 15:42 ` [PATCH AUTOSEL 4.20 221/304] drm/amd/display: fix YCbCr420 blank color Sasha Levin
    2019-01-28 15:42 ` [PATCH AUTOSEL 4.20 243/304] drm/amd/display: validate extended dongle caps Sasha Levin
    

    This is a public inbox, see mirroring instructions
    for how to clone and mirror all data and code used for this inbox