From patchwork Fri Dec 29 11:11:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Drake X-Patchwork-Id: 10136999 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2BAC5600C5 for ; Fri, 29 Dec 2017 11:11:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1DDA52DED6 for ; Fri, 29 Dec 2017 11:11:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 10D432DEE0; Fri, 29 Dec 2017 11:11:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 755F62DED6 for ; Fri, 29 Dec 2017 11:11:42 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C0CC9897C3; Fri, 29 Dec 2017 11:11:40 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr0-x242.google.com (mail-wr0-x242.google.com [IPv6:2a00:1450:400c:c0c::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id AF19589138 for ; Fri, 29 Dec 2017 11:11:39 +0000 (UTC) Received: by mail-wr0-x242.google.com with SMTP id g17so32171254wrd.13 for ; Fri, 29 Dec 2017 03:11:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=endlessm-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=m7EQNPn8iQAG31CW8XGGEamf50y+McVjQk/A6GAMspw=; b=jZhcW9kO+WwG1+gfmmSfdkrBVIg4O+ubfw+ZkEldOgHycZy09nVP2b6AjLToghAsup oa1OInoaEFAXcYbvGrEbsqP+4TTavMKhPQdCxVX+lImnlHqlPzDF/wNR0TqOnohbIiNb MywxwCsLeFW2hlepdBILYZz35k4NiP1r0Msiu9cez+tBHEq/jwg6Yk6MS4uj2urZJo8z rM8W6JKdnmopggBDH0X8DBzp+b4Ygt0MczVmoV8xM9PisP2vpwf+xIDSy5CorDMWu78G 2Gas0hZFlSNjA4/C9Nr2C1NZ5jCceRLnaOS6rpvZv4veS4PbEyk0PSJy/fIj5WflO7kb eG0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=m7EQNPn8iQAG31CW8XGGEamf50y+McVjQk/A6GAMspw=; b=sAtW8g6wP2llctsVCQcqZ4kjR426TSb5AHOe6DiDRdafN/l6cjXtN66OSZhTSER3x1 D8hDPA8uOHFESQtgIQosIAwX2s0bJ3T8PJ3Wu6Qz3/TVDgKdPLPOmZE4SgwTyPpmNEww Kc3rG3y27pI+5JQKbVqcBDlJxzIzTCuCbLzApcFva6NEme61FWOBfkC08RICglYaEWH7 iswMIuM6iGOyranlY84YVsrNkjSvgbcMyKl8T5wDwcDyxmq1iH0HXr7KoUYKN26QJ6h0 99b2LBSgsdEm0dyoSM6LiGXNedTNuOx8dwzL7d8sXnKhAKrbFwZDtKz/ZXUViwtngDt2 pw8g== X-Gm-Message-State: AKGB3mIw6FWPfneKUT+tnoR8cYbNzRonRLARK5QhWvjXkVMgEUPbnZ37 LyvtXfAMWjNmZ20CENnbTREmvg== X-Google-Smtp-Source: ACJfBotaANu1au1qfpBDivPh5cWGOjmAnXbhnBlBSe1NO/QrTqVEXAgAb88h7XDeJBcFueiRq2vh8Q== X-Received: by 10.223.177.217 with SMTP id r25mr33589282wra.191.1514545898029; Fri, 29 Dec 2017 03:11:38 -0800 (PST) Received: from limbo.local (79-75-17-121.dynamic.dsl.as9105.com. [79.75.17.121]) by smtp.gmail.com with ESMTPSA id 198sm38171523wmo.21.2017.12.29.03.11.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 29 Dec 2017 03:11:36 -0800 (PST) From: Daniel Drake To: alexander.deucher@amd.com, christian.koenig@amd.com Subject: [PATCH 4.15] drm/amd/display: call set csc_default if enable adjustment is false Date: Fri, 29 Dec 2017 11:11:18 +0000 Message-Id: <20171229111118.10645-1-drake@endlessm.com> X-Mailer: git-send-email 2.14.1 Cc: Yuehin.Lau@amd.com, chiu@endlessm.com, linux@endlessm.com, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Yue Hin Lau Signed-off-by: Yue Hin Lau Reviewed-by: Eric Bernstein Acked-by: Harry Wentland Signed-off-by: Alex Deucher [drake@endlessm.com: backport to 4.15] Signed-off-by: Daniel Drake --- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.h | 2 +- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp_cm.c | 6 ++---- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 2 ++ drivers/gpu/drm/amd/display/dc/inc/hw/dpp.h | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) Testing Acer Aspire TC-380 engineering sample (Raven Ridge), the display comes up with an excessively green tint. This patch (from amd-staging-drm-next) solves the issue. Can it be included in Linux 4.15? diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.h b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.h index a9782b1aba47..34daf895f848 100644 --- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.h +++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.h @@ -1360,7 +1360,7 @@ void dpp1_cm_set_output_csc_adjustment( void dpp1_cm_set_output_csc_default( struct dpp *dpp_base, - const struct default_adjustment *default_adjust); + enum dc_color_space colorspace); void dpp1_cm_set_gamut_remap( struct dpp *dpp, diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp_cm.c b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp_cm.c index 40627c244bf5..ed1216b53465 100644 --- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp_cm.c +++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp_cm.c @@ -225,14 +225,13 @@ void dpp1_cm_set_gamut_remap( void dpp1_cm_set_output_csc_default( struct dpp *dpp_base, - const struct default_adjustment *default_adjust) + enum dc_color_space colorspace) { struct dcn10_dpp *dpp = TO_DCN10_DPP(dpp_base); uint32_t ocsc_mode = 0; - if (default_adjust != NULL) { - switch (default_adjust->out_color_space) { + switch (colorspace) { case COLOR_SPACE_SRGB: case COLOR_SPACE_2020_RGB_FULLRANGE: ocsc_mode = 0; @@ -253,7 +252,6 @@ void dpp1_cm_set_output_csc_default( case COLOR_SPACE_UNKNOWN: default: break; - } } REG_SET(CM_OCSC_CONTROL, 0, CM_OCSC_MODE, ocsc_mode); 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 961ad5c3b454..05dc01e54531 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 @@ -2097,6 +2097,8 @@ static void program_csc_matrix(struct pipe_ctx *pipe_ctx, tbl_entry.color_space = color_space; //tbl_entry.regval = matrix; pipe_ctx->plane_res.dpp->funcs->opp_set_csc_adjustment(pipe_ctx->plane_res.dpp, &tbl_entry); + } else { + pipe_ctx->plane_res.dpp->funcs->opp_set_csc_default(pipe_ctx->plane_res.dpp, colorspace); } } static bool is_lower_pipe_tree_visible(struct pipe_ctx *pipe_ctx) diff --git a/drivers/gpu/drm/amd/display/dc/inc/hw/dpp.h b/drivers/gpu/drm/amd/display/dc/inc/hw/dpp.h index 83a68460edcd..9420dfb94d39 100644 --- a/drivers/gpu/drm/amd/display/dc/inc/hw/dpp.h +++ b/drivers/gpu/drm/amd/display/dc/inc/hw/dpp.h @@ -64,7 +64,7 @@ struct dpp_funcs { void (*opp_set_csc_default)( struct dpp *dpp, - const struct default_adjustment *default_adjust); + enum dc_color_space colorspace); void (*opp_set_csc_adjustment)( struct dpp *dpp,