AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
  • * [PATCH AUTOSEL 5.2 23/76] drm/amd/display: Fix dc_create failure handling and 666 color depths
           [not found] <20190802131951.11600-1-sashal@kernel.org>
           [not found] ` <20190802131951.11600-1-sashal-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
    @ 2019-08-02 13:18 ` Sasha Levin
      2019-08-02 13:18 ` [PATCH AUTOSEL 5.2 24/76] drm/amd/display: Only enable audio if speaker allocation exists Sasha Levin
      2 siblings, 0 replies; 8+ messages in thread
    From: Sasha Levin @ 2019-08-02 13:18 UTC (permalink / raw)
      To: linux-kernel, stable
      Cc: Julian Parkin, Charlene Liu, Leo Li, Alex Deucher, Sasha Levin,
    	amd-gfx, dri-devel
    
    From: Julian Parkin <julian.parkin@amd.com>
    
    [ Upstream commit 0905f32977268149f06e3ce6ea4bd6d374dd891f ]
    
    [Why]
    It is possible (but very unlikely) that constructing dc fails
    before current_state is created.
    
    We support 666 color depth in some scenarios, but this
    isn't handled in get_norm_pix_clk. It uses exactly the
    same pixel clock as the 888 case.
    
    [How]
    Check for non null current_state before destructing.
    
    Add case for 666 color depth to get_norm_pix_clk to
    avoid assertion.
    
    Signed-off-by: Julian Parkin <julian.parkin@amd.com>
    Reviewed-by: Charlene Liu <Charlene.Liu@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.c          | 6 ++++--
     drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 1 +
     2 files changed, 5 insertions(+), 2 deletions(-)
    
    diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
    index ee6b646180b66..0a7adc2925e35 100644
    --- a/drivers/gpu/drm/amd/display/dc/core/dc.c
    +++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
    @@ -608,8 +608,10 @@ const struct dc_link_settings *dc_link_get_link_cap(
     
     static void destruct(struct dc *dc)
     {
    -	dc_release_state(dc->current_state);
    -	dc->current_state = NULL;
    +	if (dc->current_state) {
    +		dc_release_state(dc->current_state);
    +		dc->current_state = NULL;
    +	}
     
     	destroy_links(dc);
     
    diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
    index ad82906b99db9..b87e8d80bb6a8 100644
    --- a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
    +++ b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
    @@ -1872,6 +1872,7 @@ static int get_norm_pix_clk(const struct dc_crtc_timing *timing)
     		pix_clk /= 2;
     	if (timing->pixel_encoding != PIXEL_ENCODING_YCBCR422) {
     		switch (timing->display_color_depth) {
    +		case COLOR_DEPTH_666:
     		case COLOR_DEPTH_888:
     			normalized_pix_clk = pix_clk;
     			break;
    -- 
    2.20.1
    
    ^ permalink raw reply related	[flat|nested] 8+ messages in thread
  • * [PATCH AUTOSEL 5.2 24/76] drm/amd/display: Only enable audio if speaker allocation exists
           [not found] <20190802131951.11600-1-sashal@kernel.org>
           [not found] ` <20190802131951.11600-1-sashal-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
      2019-08-02 13:18 ` [PATCH AUTOSEL 5.2 23/76] drm/amd/display: Fix dc_create failure handling and 666 color depths Sasha Levin
    @ 2019-08-02 13:18 ` Sasha Levin
      2 siblings, 0 replies; 8+ messages in thread
    From: Sasha Levin @ 2019-08-02 13:18 UTC (permalink / raw)
      To: linux-kernel, stable
      Cc: Sasha Levin, Leo Li, dri-devel, amd-gfx, Alvin Lee, Alex Deucher,
    	Jun Lei
    
    From: Alvin Lee <alvin.lee2@amd.com>
    
    [ Upstream commit 6ac25e6d5b2fbf251e9fa2f4131d42c815b43867 ]
    
    [Why]
    
    In dm_helpers_parse_edid_caps, there is a corner case where no speakers
    can be allocated even though the audio mode count is greater than 0.
    Enabling audio when no speaker allocations exists can cause issues in
    the video stream.
    
    [How]
    
    Add a check to not enable audio unless one or more speaker allocations
    exist (since doing this can cause issues in the video stream).
    
    Signed-off-by: Alvin Lee <alvin.lee2@amd.com>
    Reviewed-by: Jun Lei <Jun.Lei@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_resource.c | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
    index b87e8d80bb6a8..0fd759d3a0e7d 100644
    --- a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
    +++ b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
    @@ -2019,7 +2019,7 @@ enum dc_status resource_map_pool_resources(
     	/* TODO: Add check if ASIC support and EDID audio */
     	if (!stream->converter_disable_audio &&
     	    dc_is_audio_capable_signal(pipe_ctx->stream->signal) &&
    -	    stream->audio_info.mode_count) {
    +	    stream->audio_info.mode_count && stream->audio_info.flags.all) {
     		pipe_ctx->stream_res.audio = find_first_free_audio(
     		&context->res_ctx, pool, pipe_ctx->stream_res.stream_enc->id);
     
    -- 
    2.20.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

  • end of thread, other threads:[~2019-08-02 13:18 UTC | newest]
    
    Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
    -- links below jump to the message on this page --
         [not found] <20190802131951.11600-1-sashal@kernel.org>
         [not found] ` <20190802131951.11600-1-sashal-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
    2019-08-02 13:18   ` [PATCH AUTOSEL 5.2 18/76] drm/amd/display: Wait for backlight programming completion in set backlight level Sasha Levin
    2019-08-02 13:18   ` [PATCH AUTOSEL 5.2 19/76] drm/amd/display: fix DMCU hang when going into Modern Standby Sasha Levin
    2019-08-02 13:18   ` [PATCH AUTOSEL 5.2 20/76] drm/amd/display: use encoder's engine id to find matched free audio device Sasha Levin
    2019-08-02 13:18   ` [PATCH AUTOSEL 5.2 21/76] drm/amd/display: put back front end initialization sequence Sasha Levin
    2019-08-02 13:18   ` [PATCH AUTOSEL 5.2 22/76] drm/amd/display: allocate 4 ddc engines for RV2 Sasha Levin
    2019-08-02 13:18   ` [PATCH AUTOSEL 5.2 25/76] drm/amd/display: Increase size of audios array Sasha Levin
    2019-08-02 13:18 ` [PATCH AUTOSEL 5.2 23/76] drm/amd/display: Fix dc_create failure handling and 666 color depths Sasha Levin
    2019-08-02 13:18 ` [PATCH AUTOSEL 5.2 24/76] drm/amd/display: Only enable audio if speaker allocation exists Sasha Levin
    

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