From patchwork Fri Feb 16 19:04:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Ond=C5=99ej_Jirman?= X-Patchwork-Id: 202328 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:c619:b0:108:e6aa:91d0 with SMTP id hn25csp725737dyb; Fri, 16 Feb 2024 11:05:36 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVEy0yFcYl6MKU/EyWmJIJMyfdlYtPoCpm6R+CSibDwak9017e++j9zbPCi9iFgQBj1tE2OAc5gX+38lHOLHJkJucpvpw== X-Google-Smtp-Source: AGHT+IG26wGchsGxbMVYHy6CbdpqEfz7Hg51aARoRf/s+Vc/PjvEOHWph/SGSxoFUk2g44qKe+QZ X-Received: by 2002:a17:906:5594:b0:a3d:37a4:a7e6 with SMTP id y20-20020a170906559400b00a3d37a4a7e6mr3638639ejp.21.1708110336327; Fri, 16 Feb 2024 11:05:36 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708110336; cv=pass; d=google.com; s=arc-20160816; b=ea1iUWwVWrDoWP+BpUIk4CqKwD4Xxkj4H0+gQYz378C1LA/alC+TTqxYp0EA9m7RRa MS1tO8x79TCPqsePMf2hVzmLzDxO/Oq+geyXb0U91RspmrKPXQxTZQD1R59XpWdJSrwn DyxaQI1n7nN2Z3I2u/1ihyaA3Y30bznZp92u42Ho4z0HkneX7kNtUOtmY7fWLKFFnM64 +ThLdsSDH9xhYEvCprB1s3HuHoxHOVUtsqX5w/aUzZ9UPLvRvV8JqiGuUxHQsxa3S5gO uZtCQDh6l0TucjQkIbbx0bMTxtqNUVYy32pv25Ff0DJj69hPD/Wy82pB9h8v6Md/xE78 paBQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=8/Y44pKHuWqIFsuC7L1HiI3N1OpOa0ONQjDJ/95ifYU=; fh=yr4ZNRU98qvAJKzjmrr2qbVKE/C07NdRne4enYDAdEY=; b=DKBKCiET91k1kF7RmKEnPEJna5LiyvNIkMxNywyMwzm07o7NocIC9m5u9E6QMQY7NG WYUSauTb91xg73XAgC+4nRK25sSjclq7xTjv5CE3W6oS0vZHYM9Ve/G5vNBWXf/f56Cr WS/gDUupaT/aPWJ3Iu0H4neWjw+9v+tMgpI/AmFI9GAPFW6gROiHXG6h+nJvDW0vJEGF TqROPaZJS0cmkfFGta47+xyUe+Q0fpLS4gmX+xdFlwZ7OsF00AOS+pSPK6ptA4Mg6OAr hzBr5t3nan4a3rCHPVkFmu/ABqDznmzKjMk/dkzOieuQJZe3InGzZsusUEgmX0DPP5B0 4ypg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@xff.cz header.s=mail header.b=Xo8yth0b; arc=pass (i=1 spf=pass spfdomain=xff.cz dkim=pass dkdomain=xff.cz dmarc=pass fromdomain=xff.cz); spf=pass (google.com: domain of linux-kernel+bounces-69223-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-69223-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=xff.cz Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id t16-20020a1709066bd000b00a3d5f9c1c68si182367ejs.204.2024.02.16.11.05.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 11:05:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-69223-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@xff.cz header.s=mail header.b=Xo8yth0b; arc=pass (i=1 spf=pass spfdomain=xff.cz dkim=pass dkdomain=xff.cz dmarc=pass fromdomain=xff.cz); spf=pass (google.com: domain of linux-kernel+bounces-69223-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-69223-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=xff.cz Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id E3AE11F24752 for ; Fri, 16 Feb 2024 19:05:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2837D135400; Fri, 16 Feb 2024 19:04:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=xff.cz header.i=@xff.cz header.b="Xo8yth0b" Received: from vps.xff.cz (vps.xff.cz [195.181.215.36]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BF8CF136658 for ; Fri, 16 Feb 2024 19:04:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.181.215.36 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708110279; cv=none; b=TTVe8j91Lrl3Ai6UuBVax2Qt5rAxntPl5gU3x+lRxa79lL2pyXGr0zCYc8lWsEw8d08LPN+9gYuHQNaS3+cZAOqe1pmjk5l5iPKfeprlYj89R7A8bO0C7oz486DCoN8jrHXeMpzpzbjEWt/sIod7n1lh5jxm73T8B5PHFrvS3bA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708110279; c=relaxed/simple; bh=gzfy6/vvZoRzl37dLBsm+GqehoPej8h+i37amwWN5NI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=FiKvwKERRkM76aly9Snrm6TKrXJKAsuIAyre5ksXtysJYFYbazzXQkd3niAO9aZAJVYzBn1U4hUkEAaL6JPBUjACiEuNIYlC6vEsozajW9z3fUkmgwCEAahfi1eE2QeyNhP7lTIHaniZRYdDBGMwSIPMF0cEYMoHrfoqZeOOk5k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=xff.cz; spf=pass smtp.mailfrom=xff.cz; dkim=pass (1024-bit key) header.d=xff.cz header.i=@xff.cz header.b=Xo8yth0b; arc=none smtp.client-ip=195.181.215.36 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=xff.cz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=xff.cz DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xff.cz; s=mail; t=1708110272; bh=gzfy6/vvZoRzl37dLBsm+GqehoPej8h+i37amwWN5NI=; h=From:To:Cc:Subject:Date:References:From; b=Xo8yth0bF7rUSZmk11Hj53wBnA1Xn/wKDTaBoqI1mMdTeZA5q1BJAB+Rb/Clos5/w +3MQZb/LOFPPTW4G6XLlf8pZ/pB5IdN7bMQjDTlKIwBMMufN4Yt+iRS7nVLoDisEqd X0aV5Ck/scC1Zv+0PXoVsRCtPDw1OiR3Ej/ZyXc0= From: =?utf-8?q?Ond=C5=99ej_Jirman?= To: Maxime Ripard , Chen-Yu Tsai , Maarten Lankhorst , Thomas Zimmermann , David Airlie , Daniel Vetter , Jernej Skrabec , Samuel Holland Cc: Ondrej Jirman , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH 2/3] drm/sun4i: Add more parameters to sunxi_engine commit callback Date: Fri, 16 Feb 2024 20:04:25 +0100 Message-ID: <20240216190430.1374132-3-megi@xff.cz> In-Reply-To: <20240216190430.1374132-1-megi@xff.cz> References: <20240216190430.1374132-1-megi@xff.cz> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791083504079639776 X-GMAIL-MSGID: 1791083504079639776 From: Ondrej Jirman These will be needed later on when we move layer configuration to crtc update. Signed-off-by: Ondrej Jirman Reviewed-by: Maxime Ripard Reviewed-by: Jernej Skrabec --- drivers/gpu/drm/sun4i/sun4i_backend.c | 4 +++- drivers/gpu/drm/sun4i/sun4i_crtc.c | 2 +- drivers/gpu/drm/sun4i/sun8i_mixer.c | 5 ++++- drivers/gpu/drm/sun4i/sunxi_engine.h | 13 ++++++++++--- 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun4i_backend.c b/drivers/gpu/drm/sun4i/sun4i_backend.c index 335fd0edb904..e89eb96d3131 100644 --- a/drivers/gpu/drm/sun4i/sun4i_backend.c +++ b/drivers/gpu/drm/sun4i/sun4i_backend.c @@ -69,7 +69,9 @@ static void sun4i_backend_disable_color_correction(struct sunxi_engine *engine) SUN4I_BACKEND_OCCTL_ENABLE, 0); } -static void sun4i_backend_commit(struct sunxi_engine *engine) +static void sun4i_backend_commit(struct sunxi_engine *engine, + struct drm_crtc *crtc, + struct drm_atomic_state *state) { DRM_DEBUG_DRIVER("Committing changes\n"); diff --git a/drivers/gpu/drm/sun4i/sun4i_crtc.c b/drivers/gpu/drm/sun4i/sun4i_crtc.c index c06d7cd45388..18e74047b0f5 100644 --- a/drivers/gpu/drm/sun4i/sun4i_crtc.c +++ b/drivers/gpu/drm/sun4i/sun4i_crtc.c @@ -91,7 +91,7 @@ static void sun4i_crtc_atomic_flush(struct drm_crtc *crtc, DRM_DEBUG_DRIVER("Committing plane changes\n"); - sunxi_engine_commit(scrtc->engine); + sunxi_engine_commit(scrtc->engine, crtc, state); if (event) { crtc->state->event = NULL; diff --git a/drivers/gpu/drm/sun4i/sun8i_mixer.c b/drivers/gpu/drm/sun4i/sun8i_mixer.c index 1e681314e379..bdeb9b80e038 100644 --- a/drivers/gpu/drm/sun4i/sun8i_mixer.c +++ b/drivers/gpu/drm/sun4i/sun8i_mixer.c @@ -16,6 +16,7 @@ #include #include +#include #include #include #include @@ -249,7 +250,9 @@ int sun8i_mixer_drm_format_to_hw(u32 format, u32 *hw_format) return -EINVAL; } -static void sun8i_mixer_commit(struct sunxi_engine *engine) +static void sun8i_mixer_commit(struct sunxi_engine *engine, + struct drm_crtc *crtc, + struct drm_atomic_state *state) { DRM_DEBUG_DRIVER("Committing changes\n"); diff --git a/drivers/gpu/drm/sun4i/sunxi_engine.h b/drivers/gpu/drm/sun4i/sunxi_engine.h index ec8cf9b2bda4..ec0c4932f15c 100644 --- a/drivers/gpu/drm/sun4i/sunxi_engine.h +++ b/drivers/gpu/drm/sun4i/sunxi_engine.h @@ -7,6 +7,7 @@ #define _SUNXI_ENGINE_H_ struct drm_plane; +struct drm_crtc; struct drm_device; struct drm_crtc_state; struct drm_display_mode; @@ -59,7 +60,9 @@ struct sunxi_engine_ops { * * This function is optional. */ - void (*commit)(struct sunxi_engine *engine); + void (*commit)(struct sunxi_engine *engine, + struct drm_crtc *crtc, + struct drm_atomic_state *state); /** * @layers_init: @@ -144,12 +147,16 @@ struct sunxi_engine { /** * sunxi_engine_commit() - commit all changes of the engine * @engine: pointer to the engine + * @crtc: pointer to crtc the engine is associated with + * @state: atomic state */ static inline void -sunxi_engine_commit(struct sunxi_engine *engine) +sunxi_engine_commit(struct sunxi_engine *engine, + struct drm_crtc *crtc, + struct drm_atomic_state *state) { if (engine->ops && engine->ops->commit) - engine->ops->commit(engine); + engine->ops->commit(engine, crtc, state); } /**