From patchwork Thu Aug 10 16:03:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Melissa Wen X-Patchwork-Id: 134104 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b824:0:b0:3f2:4152:657d with SMTP id z4csp544253vqi; Thu, 10 Aug 2023 09:39:59 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEo98CHAe+V2mgHyJlt9I2FQmFY2ygg6j70xebadH4JMdTIzdtY1pUXwNwpXZS2ifvFU4lA X-Received: by 2002:a17:902:6941:b0:1ac:8be5:8787 with SMTP id k1-20020a170902694100b001ac8be58787mr2379312plt.21.1691685599551; Thu, 10 Aug 2023 09:39:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691685599; cv=none; d=google.com; s=arc-20160816; b=uDRSWDTGTC9/YA8n0wmVzHWBrlvHYslmhGGCJltyN0PeYjkwM77sGhFNZA96oywPtd OA9HTAY8C1Mv9gn6z/wrRKqzxKbGhuVFBP8q6OekHLpuqgoJEPJ5mICkArPL0rZ3lKuC SJXYMa5rsCaTgA5AvrFh5cc7LVbqlVIABfui7xmpGg8bHrZfj60DPhH+RCPZRyr+wjms SmFS8mUBv/5l+2nxcXq/I29l2d02pmC3EdYS1X/JgQ5GzPQN1t7hMlm540kY8VMeEWgh aDkZhNwlb7gJUXOOjX6/3ExwtDxaPeqbdlsEahtTIbhKuXjm32b8jOSYhjb6FlIzTaU5 PoKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=iSvY5eK5ZdZKmH4pP/lmxSlVsRs8T9hbslg1Fi3LMRU=; fh=K4g2hpcHeis9i+u86e9V+yTBU0PZFkfdrKenkMdV+qw=; b=zO6tKdqbTTj+vbptUYkPhyz0f36hTY+2zqjvD0i+gTiNqKmfd35qJPXwaPujFhxMQQ z0hdtik88m2HjyyIQspdJBNbzukD4NSa8K/3xGlqwKNQ2Wqc/amIFiDJlOGmZyBZJqGu DUHkKOinkqI56QMoAeZsmOFXUV1M++e2iEusvaLxBgB2ut/isXyp1XAfSf9QHILlGevn t8rtWXY9D+uoXCwbFocpCHUwSj3JR3p9niuGS6ojJuWqvdfmzqHokWHEQISi/aN+msdX MuX3xy5CS9iYrR7iu1MZvsSYtV0QLhDjdgB3y9hBOk9x2oBr/OJpjqwW7RCXkFfsdP8d Xuvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@igalia.com header.s=20170329 header.b=rJwMoA6+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c17-20020a170903235100b001b69de1eae1si1764808plh.620.2023.08.10.09.39.45; Thu, 10 Aug 2023 09:39:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@igalia.com header.s=20170329 header.b=rJwMoA6+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236401AbjHJQFZ (ORCPT + 99 others); Thu, 10 Aug 2023 12:05:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236398AbjHJQEz (ORCPT ); Thu, 10 Aug 2023 12:04:55 -0400 Received: from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E65FD358E for ; Thu, 10 Aug 2023 09:04:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=iSvY5eK5ZdZKmH4pP/lmxSlVsRs8T9hbslg1Fi3LMRU=; b=rJwMoA6+tB4RLXyBpSSetkamz1 WyDZoxRgxsgLQgbnuDWCM8QpqbY4YNCm0ZfpuqVMctMAPiNd7lWvGFmOOimzyR8wuje7W8ZNRgVUL sCgwHgZ/8apJGsvd/xW0mkiqfYunRAeXh1EWfDyEG3m+iS+eNBsk3/X08Gttwlnvr3INCXFf4QXNB 10EeKZbhQqucanGI30BIw2BjNuD+jREW+/gtEJJAkzPcWNG5XnpckHD4x5o9bjgTMmg4uF1HRfuXt TGtxKxtpWUk3uIFEwmVZvTyQtS+24REXdQ459Bz6MAxvnQq2u+VSl49RroIDbLQhcVAqWmmM58hFu iT4ffeEw==; Received: from [38.44.68.151] (helo=killbill.home) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim) id 1qU88t-00GjYD-UP; Thu, 10 Aug 2023 18:04:08 +0200 From: Melissa Wen To: amd-gfx@lists.freedesktop.org, Harry Wentland , Rodrigo Siqueira , sunpeng.li@amd.com, Alex Deucher , dri-devel@lists.freedesktop.org, christian.koenig@amd.com, Xinhui.Pan@amd.com, airlied@gmail.com, daniel@ffwll.ch Cc: Joshua Ashton , Sebastian Wick , Xaver Hugl , Shashank Sharma , Nicholas Kazlauskas , sungjoon.kim@amd.com, Alex Hung , Pekka Paalanen , Simon Ser , kernel-dev@igalia.com, linux-kernel@vger.kernel.org Subject: [PATCH v2 23/34] drm/amd/display: add HDR multiplier support Date: Thu, 10 Aug 2023 15:03:03 -0100 Message-Id: <20230810160314.48225-24-mwen@igalia.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230810160314.48225-1-mwen@igalia.com> References: <20230810160314.48225-1-mwen@igalia.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773860919091448173 X-GMAIL-MSGID: 1773860919091448173 From: Joshua Ashton With `dc_fixpt_from_s3132()` translation, we can just use it to set hdr_mult. Reviewed-by: Harry Wentland Signed-off-by: Joshua Ashton Signed-off-by: Melissa Wen --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 1 + drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c | 3 +++ 2 files changed, 4 insertions(+) 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 3e5aa1e46662..9fcc169fb87b 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -8060,6 +8060,7 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state, bundle->surface_updates[planes_count].gamma = dc_plane->gamma_correction; bundle->surface_updates[planes_count].in_transfer_func = dc_plane->in_transfer_func; bundle->surface_updates[planes_count].gamut_remap_matrix = &dc_plane->gamut_remap_matrix; + bundle->surface_updates[planes_count].hdr_mult = dc_plane->hdr_mult; } amdgpu_dm_plane_fill_dc_scaling_info(dm->adev, new_plane_state, diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c index db771c895720..15f7304d8f33 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c @@ -902,6 +902,7 @@ int amdgpu_dm_update_plane_color_mgmt(struct dm_crtc_state *crtc, struct drm_plane_state *plane_state, struct dc_plane_state *dc_plane_state) { + struct dm_plane_state *dm_plane_state = to_dm_plane_state(plane_state); bool has_crtc_cm_degamma; int ret; @@ -912,6 +913,8 @@ int amdgpu_dm_update_plane_color_mgmt(struct dm_crtc_state *crtc, /* After, we start to update values according to color props */ has_crtc_cm_degamma = (crtc->cm_has_degamma || crtc->cm_is_degamma_srgb); + dc_plane_state->hdr_mult = dc_fixpt_from_s3132(dm_plane_state->hdr_mult); + ret = __set_dm_plane_degamma(plane_state, dc_plane_state); if (ret == -ENOMEM) return ret;