Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp1300347rdb; Fri, 16 Feb 2024 11:05:10 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUaiLiJDZUEwCukEnGL9hCEAF3mzb7GQyYoozV57/iHyFTCaKGgk3AZ/uDh5PphDn11q0FeluDgsNhkoUYbSaRBj+tJIcdT2aNxjmfqFQ== X-Google-Smtp-Source: AGHT+IFIV+81zWsNAHtb4qElNlAdJblUSS3h3Mr6X7Q7xGJ9nkSj6khjB+GTXjmyCWN0LLmfuQiR X-Received: by 2002:a17:906:371a:b0:a3d:f717:1459 with SMTP id d26-20020a170906371a00b00a3df7171459mr1194229ejc.20.1708110310111; Fri, 16 Feb 2024 11:05:10 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708110310; cv=pass; d=google.com; s=arc-20160816; b=lpbA0R0EvMwlvudsZXLLKr4/ySdUdjOVEDiMHqrRU+A2CJ+eYBJMSggwlIHYyw5un1 V9TkAfiC4dL81JYqbG3dREiRUoxecgqx/aA2N0Sak9Ae9dDBwNz8tdaZNWJsIVJ8tTCf PbSFKsdVRWOQbb9wCDB3m9OQ2AJbAH7mLuNAKrQC/GVZCRDjqIUHw8NjCPEekrn+oKmN ++An6+Ih9U5V4r47xDN4VUkAMKnMAQsj/HiWUM5df4zU/H/EhZGTcIzTUtU1rQqlvmGJ NmWeBFhKu2QcqiMNrGBDMXmqg75cqjSlzQaRX6eghc8PKiCjjD3CD/qSa1I7x9ISRAI4 AA8w== 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-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-69223-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=xff.cz Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id n17-20020a1709061d1100b00a3d38952605si175102ejh.746.2024.02.16.11.05.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 11:05:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-69223-linux.lists.archive=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-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-69223-linux.lists.archive=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 D968A1F246EF for ; Fri, 16 Feb 2024 19:05:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 58A91137C4A; Fri, 16 Feb 2024 19:04:40 +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=20Jirman?= 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 Content-Transfer-Encoding: 8bit From: Ondrej Jirman These will be needed later on when we move layer configuration to crtc update. Signed-off-by: Ondrej Jirman --- 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); } /** -- 2.43.0