public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Alexander Graf <agraf@csgraf.de>
To: u-boot@lists.denx.de
Cc: Matthias Brugger <mbrugger@suse.com>,
	Heinrich Schuchardt <xypron.glpk@gmx.de>,
	Anatolij Gustschin <agust@denx.de>,
	Simon Glass <sjg@chromium.org>, Da Xue <da@libre.computer>,
	Ilias Apalodimas <ilias.apalodimas@linaro.org>,
	Jagan Teki <jagan@amarulasolutions.com>,
	Andre Przywara <andre.przywara@arm.com>,
	Neil Armstrong <neil.armstrong@linaro.org>,
	Philipp Tomsich <philipp.tomsich@vrull.eu>,
	Kever Yang <kever.yang@rock-chips.com>,
	Patrick Delaunay <patrick.delaunay@foss.st.com>,
	Patrice Chotard <patrice.chotard@foss.st.com>,
	uboot-stm32@st-md-mailman.stormreply.com,
	u-boot-amlogic@groups.io
Subject: [PATCH v4 8/9] video: Always compile cache flushing code
Date: Tue,  3 Jan 2023 22:50:03 +0100	[thread overview]
Message-ID: <20230103215004.22646-9-agraf@csgraf.de> (raw)
In-Reply-To: <20230103215004.22646-1-agraf@csgraf.de>

The dcache flushing code path was conditional on ARM && !DCACHE config
options. However, dcaches exist on other platforms as well and may need
clearing if their driver requires it.

Simplify the compile logic and always enable the dcache flush logic in
the video core. That way, drivers can always rely on it to call the arch
specific callbacks.

This will increase code size for non-ARM platforms with CONFIG_VIDEO=y
slightly.

Reported-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@csgraf.de>
---
 drivers/video/video-uclass.c | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c
index 956863f98a..bad5eedc96 100644
--- a/drivers/video/video-uclass.c
+++ b/drivers/video/video-uclass.c
@@ -285,11 +285,13 @@ int video_damage(struct udevice *vid, int x, int y, int width, int height)
 	return 0;
 }
 
-#if defined(CONFIG_ARM) && !CONFIG_IS_ENABLED(SYS_DCACHE_OFF)
 static void video_flush_dcache(struct udevice *vid)
 {
 	struct video_priv *priv = dev_get_uclass_priv(vid);
 
+	if (CONFIG_IS_ENABLED(SYS_DCACHE_OFF))
+		return;
+
 	if (!priv->flush_dcache)
 		return;
 
@@ -318,7 +320,6 @@ static void video_flush_dcache(struct udevice *vid)
 		}
 	}
 }
-#endif
 
 static void video_flush_copy(struct udevice *vid)
 {
@@ -357,14 +358,9 @@ int video_sync(struct udevice *vid, bool force)
 			return ret;
 	}
 
-	/*
-	 * flush_dcache_range() is declared in common.h but it seems that some
-	 * architectures do not actually implement it. Is there a way to find
-	 * out whether it exists? For now, ARM is safe.
-	 */
-#if defined(CONFIG_ARM) && !CONFIG_IS_ENABLED(SYS_DCACHE_OFF)
 	video_flush_dcache(vid);
-#elif defined(CONFIG_VIDEO_SANDBOX_SDL)
+
+#if defined(CONFIG_VIDEO_SANDBOX_SDL)
 	static ulong last_sync;
 
 	if (force || get_timer(last_sync) > 100) {
-- 
2.37.1 (Apple Git-137.1)


  parent reply	other threads:[~2023-01-03 21:51 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-03 21:49 [PATCH v4 0/9] Add video damage tracking Alexander Graf
2023-01-03 21:49 ` [PATCH v4 1/9] dm: video: Add damage tracking API Alexander Graf
2023-01-07  0:13   ` Simon Glass
2023-01-03 21:49 ` [PATCH v4 2/9] dm: video: Add damage notification on display clear Alexander Graf
2023-01-07  0:13   ` Simon Glass
2023-01-03 21:49 ` [PATCH v4 3/9] vidconsole: Add damage notifications to all vidconsole drivers Alexander Graf
2023-01-07  0:13   ` Simon Glass
2023-01-03 21:49 ` [PATCH v4 4/9] video: Add damage notification on bmp display Alexander Graf
2023-01-07  0:13   ` Simon Glass
2023-01-03 21:50 ` [PATCH v4 5/9] efi_loader: GOP: Add damage notification on BLT Alexander Graf
2023-01-04 12:50   ` Heinrich Schuchardt
2023-01-03 21:50 ` [PATCH v4 6/9] video: Only dcache flush damaged lines Alexander Graf
2023-01-03 21:50 ` [PATCH v4 7/9] video: Use VIDEO_DAMAGE for VIDEO_COPY Alexander Graf
2023-01-07  0:13   ` Simon Glass
2023-01-07 22:40     ` Heinrich Schuchardt
2023-01-08 15:48       ` Simon Glass
2023-01-03 21:50 ` Alexander Graf [this message]
2023-01-07  0:13   ` [PATCH v4 8/9] video: Always compile cache flushing code Simon Glass
2023-01-03 21:50 ` [PATCH v4 9/9] video: Enable VIDEO_DAMAGE for drivers that need it Alexander Graf
2023-01-04 12:32   ` Neil Armstrong
2023-01-07  0:13   ` Simon Glass
2023-01-07  0:13 ` [PATCH v4 0/9] Add video damage tracking Simon Glass
2023-04-14  7:35 ` Antonio Murdaca
2023-04-19  1:45   ` Simon Glass

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230103215004.22646-9-agraf@csgraf.de \
    --to=agraf@csgraf.de \
    --cc=agust@denx.de \
    --cc=andre.przywara@arm.com \
    --cc=da@libre.computer \
    --cc=ilias.apalodimas@linaro.org \
    --cc=jagan@amarulasolutions.com \
    --cc=kever.yang@rock-chips.com \
    --cc=mbrugger@suse.com \
    --cc=neil.armstrong@linaro.org \
    --cc=patrice.chotard@foss.st.com \
    --cc=patrick.delaunay@foss.st.com \
    --cc=philipp.tomsich@vrull.eu \
    --cc=sjg@chromium.org \
    --cc=u-boot-amlogic@groups.io \
    --cc=u-boot@lists.denx.de \
    --cc=uboot-stm32@st-md-mailman.stormreply.com \
    --cc=xypron.glpk@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox