From patchwork Thu Aug 10 16:02:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Melissa Wen X-Patchwork-Id: 134065 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b824:0:b0:3f2:4152:657d with SMTP id z4csp522734vqi; Thu, 10 Aug 2023 09:06:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEcKeWwa2iDMRdjYsQbFljFR8LhLF2i/2p8wJ5SGQiKyUO/iQJcmXrBhfEsvsj/UYN6XQx5 X-Received: by 2002:a17:907:2c6b:b0:993:d5bd:a757 with SMTP id ib11-20020a1709072c6b00b00993d5bda757mr2138577ejc.19.1691683597922; Thu, 10 Aug 2023 09:06:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691683597; cv=none; d=google.com; s=arc-20160816; b=0I+YQjjMIo2a5g4zwawVKmwb516W/YZzlCa+PCyKagOy7gR2sFM4Nli/WHZCH8l3+O YB0gnIFanF4ngMTOs2gTT9avjMvYc5IcYWOlNmj/8peoEGcaWh8jX/wDzoNJNEf14OiX a/IsrIX2YagSDP29XvKecqHxPVWyRcIxi0mhbOekZ431DNyGw7MUr21j4Bgz83BRSy1A FNKh6QiTWLFqGwJ4MdpBkPVFQ0dkoIB11ezwzA9uUEsF/Hw1P/7I/xR6uJvuPWZ4RmOc XEyucmbGh2xOFpRxOtq+8jixvM3LgY/v3Jc/ATRMtu/vL6JNSvIqKLDotfFqv+x9JPoB 57tg== 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=zT/VDpLE5nsssjtLEBlZ0NSODRfzy0bJee/fO7gbbBo=; fh=WUoJGlDRs3sy6P6Xi/GRsKK9XYo6wCLKvj+grjxEXaU=; b=J51mJsIu6ltyQ77meE5T6Frc4ZcesruYFHzxLVGcyp4jXnAgdvIBicY5OsS2Revmcx ybzyrZkSq0C6MgWOBK+s2LPB9XbExwb+Makzv7ZLj+LDGSO/ruhCQ1DYYS118SOC6lgp if9SRgzIYHND/HlIN6Jgli2xnJ7aLP50I8n2aXndiZ2HNW+9QqsaUmHdpTkt5iCW02L/ LQ7Igc6Xjssn4HuLZNPsh8ou2p6r50mXmTGjFwQOTJXOWNNLUDgo2uzr4/BO8Hjf0hgD 6eUWZ+3IOj5qObepgJSTs639hcUIUGeBA06cgFY2mA0k6sq4illi7UTg1tkZDWRuP60X WQMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@igalia.com header.s=20170329 header.b="V/iZXj6h"; 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 gv8-20020a170906f10800b0099b49483268si1620165ejb.301.2023.08.10.09.06.12; Thu, 10 Aug 2023 09:06:37 -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="V/iZXj6h"; 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 S236447AbjHJQEL (ORCPT + 99 others); Thu, 10 Aug 2023 12:04:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54790 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236297AbjHJQDx (ORCPT ); Thu, 10 Aug 2023 12:03:53 -0400 Received: from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D24F2735 for ; Thu, 10 Aug 2023 09:03:48 -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=zT/VDpLE5nsssjtLEBlZ0NSODRfzy0bJee/fO7gbbBo=; b=V/iZXj6hPE2tgNfq55jw00eNpw W1lEUftYeGZ4xtj9ptAwJVmCqx0c0J/XDogla/47idgkf58Cv3uAVz4eSEx81LIN4D5R1smFD9IMr iI5rHduZoGnBOUDuRpDsFPrrxiJ24Q4m6EzAwcp18UbpCz/fO12v+9ZQ3opGjoSKSMPnUUuEs1uJo FpabRhgBZT0FEUOIoVHvip2yLDGbDag+PjCvzpxWjudTW97wHKzO+ZoDxSBBsxr+S+COfoJLm4Sa5 4t8zoZx0PvCLQoAhRpv65Qq4XqyIeNCvdtqllFbbKiomm25REEl92B4sws8JycmGyawpHDbNPquCa 2Fcb8pDQ==; 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 1qU88E-00GjYD-PE; Thu, 10 Aug 2023 18:03:26 +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, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, 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 04/34] drm/drm_plane: track color mgmt changes per plane Date: Thu, 10 Aug 2023 15:02:44 -0100 Message-Id: <20230810160314.48225-5-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: 1773858820463920657 X-GMAIL-MSGID: 1773858820463920657 We will add color mgmt properties to DRM planes in the next patches and we want to track when one of this properties change to define atomic commit behaviors. Using a similar approach from CRTC color props, we set a color_mgmt_changed boolean whenever a plane color prop changes. Reviewed-by: Harry Wentland Signed-off-by: Melissa Wen --- drivers/gpu/drm/drm_atomic.c | 1 + drivers/gpu/drm/drm_atomic_state_helper.c | 1 + include/drm/drm_plane.h | 7 +++++++ 3 files changed, 9 insertions(+) diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c index 11f3a130f6f4..30aa3248bb0d 100644 --- a/drivers/gpu/drm/drm_atomic.c +++ b/drivers/gpu/drm/drm_atomic.c @@ -724,6 +724,7 @@ static void drm_atomic_plane_print_state(struct drm_printer *p, drm_get_color_encoding_name(state->color_encoding)); drm_printf(p, "\tcolor-range=%s\n", drm_get_color_range_name(state->color_range)); + drm_printf(p, "\tcolor_mgmt_changed=%d\n", state->color_mgmt_changed); if (plane->funcs->atomic_print_state) plane->funcs->atomic_print_state(p, state); diff --git a/drivers/gpu/drm/drm_atomic_state_helper.c b/drivers/gpu/drm/drm_atomic_state_helper.c index 784e63d70a42..25bb0859fda7 100644 --- a/drivers/gpu/drm/drm_atomic_state_helper.c +++ b/drivers/gpu/drm/drm_atomic_state_helper.c @@ -338,6 +338,7 @@ void __drm_atomic_helper_plane_duplicate_state(struct drm_plane *plane, state->fence = NULL; state->commit = NULL; state->fb_damage_clips = NULL; + state->color_mgmt_changed = false; } EXPORT_SYMBOL(__drm_atomic_helper_plane_duplicate_state); diff --git a/include/drm/drm_plane.h b/include/drm/drm_plane.h index 51291983ea44..52c3287da0da 100644 --- a/include/drm/drm_plane.h +++ b/include/drm/drm_plane.h @@ -237,6 +237,13 @@ struct drm_plane_state { /** @state: backpointer to global drm_atomic_state */ struct drm_atomic_state *state; + + /** + * @color_mgmt_changed: Color management properties have changed. Used + * by the atomic helpers and drivers to steer the atomic commit control + * flow. + */ + bool color_mgmt_changed : 1; }; static inline struct drm_rect