From patchwork Sun Apr 23 14:10:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Melissa Wen X-Patchwork-Id: 86730 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2221019vqo; Sun, 23 Apr 2023 07:23:07 -0700 (PDT) X-Google-Smtp-Source: AKy350YnaKOnw35cQBj1I0jJhYuduuxMKcTSOBpzN8rjFYB9QloEnv+M9IPIt1ws5QpzV+IsU+iM X-Received: by 2002:a05:6a20:a120:b0:ef:b596:2fb6 with SMTP id q32-20020a056a20a12000b000efb5962fb6mr15478941pzk.36.1682259786762; Sun, 23 Apr 2023 07:23:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682259786; cv=none; d=google.com; s=arc-20160816; b=UnWs6TNsuRkMj65CDJHCVjDvaJWOXUAY/jPymTknlip46W26eyKaMqSy3Qu0ouV8HE h56QAZIL3HOeZytI+KWuQ6csFHhlWqh2uHPkOHNq37k/l4EM4ijNOq/6/a3xgOgnyBKx IxlMj8YdYQJkukpHiRW4WQ6SlMwxTWGSGILJaBG3J4ZjsDfSgaEx7oLMWFo3gmwBSj69 8w/lWxQQR08rbgARcaLembrDGndqlQmKds+bHedSEm0TzXzUCaF5qlBlnSQfUdMuFR0Q ZMrCfjn8Z/2WNjubKyn7fLh72WzvzCEnlzZOjvPda1tBmrxqYY3R9ByOO1GsLxQAkxt6 JJxw== 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=ZF72DZB7Rgk8EtXWwwujfnKdljuruiYf02uBPV9pt/Q=; b=CPfgvs3xPDFctXdAZaOJpZ8wwBDN1QfROsMeC6pSqIu9agw3SiygWElJaMOJHU8ICk 6r4pdBI7dA5nuan3xlyZWVDjO+xGyBRfjW1ih14iD/RjE/WkHVv+b1IOs1sSHF01A6gR HD8mKtdqE382Wil3tY4Oonye54dcmJf8R9o38OT6fh4ckx2RTc9Rs8M/LLAA4+TTgecf YCdF9/1ToVYeOgp592OPV5C2C/t4cclu7fbo4EIZY5iWlipy4A088jNwfc4t4qBYlW4m CAjOr4DCJ1suKqyIyS0tbsJdOmvW5lf/NyC48qhtQ82bBnmsH8AyBp9hrmCBso67zsb+ N8Kw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@igalia.com header.s=20170329 header.b=NE7h2Ttl; 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 f16-20020a63f110000000b00524ba819b3csi8663867pgi.443.2023.04.23.07.22.51; Sun, 23 Apr 2023 07:23:06 -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=NE7h2Ttl; 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 S229604AbjDWONX (ORCPT + 99 others); Sun, 23 Apr 2023 10:13:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60812 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230235AbjDWONQ (ORCPT ); Sun, 23 Apr 2023 10:13:16 -0400 Received: from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BC4593596 for ; Sun, 23 Apr 2023 07:12:45 -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=ZF72DZB7Rgk8EtXWwwujfnKdljuruiYf02uBPV9pt/Q=; b=NE7h2Ttlh5qeOufFgjOAuj/G/N Mp6FYLx78siblzVP66SdNvhoMEkWQ379KPdDVm0g22cVo3yC2oVgwcWaAOKs0kES8gdUaEdDAQkgg V6yplEEC6zaGkUnK/2AgU29axB7rlQcYjd01O06TNsIV4vq4TZT47+NuBevfCZJol5rhmHj1TWXDW GHguQtOBF2nekb6b5BIEwirgX4fRh0Zb32PiIy9cfpdenPEwYT+PTtOdHUgWzGk09qAv2wlaCq2Qh pokXGbQZnEL1lyjypEfC/ZJ/W283j3F7NOzsO/t32qIyViHQKcHjeTF1QBiZTCW/8LHsR+3Q1Vr3p sMXro7iA==; Received: from nat-wifi.fi.muni.cz ([147.251.43.9] helo=killbill.fi.muni.cz) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim) id 1pqaRv-00ANVs-Ak; Sun, 23 Apr 2023 16:12:19 +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 , Melissa Wen , linux-kernel@vger.kernel.org Subject: [RFC PATCH 08/40] drm/drm_plane: track color mgmt changes per plane Date: Sun, 23 Apr 2023 13:10:20 -0100 Message-Id: <20230423141051.702990-9-mwen@igalia.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230423141051.702990-1-mwen@igalia.com> References: <20230423141051.702990-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,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763977237993226404?= X-GMAIL-MSGID: =?utf-8?q?1763977237993226404?= We will add color mgmt properties to DRM planes in the text 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. 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 c0dc5858a723..da2429470c4f 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 dfb57217253b..3df4c96a902e 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 447e664e49d5..6c97380b8c76 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