Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH] metal: Add hint to select low power device instead of the default one
@ 2023-09-04 21:58 Jérémy Demeule
  0 siblings, 0 replies; only message in thread
From: Jérémy Demeule @ 2023-09-04 21:58 UTC (permalink / raw)
  To: ffmpeg-devel

SDL >= 2.28.3 introduce a renderer hint to allow selection of low-power
device on default macOS backend (i.e. metal).

<TLDR>
On some system like MacBook Pro Intel with AMD card, asking for the
default device will always return the AMD GPU.

This is not an issue for 99% of the case when the renderer context is
here to provide the maximum performance level like for game.

However, for video application using GPU for 1 quad and 1 texture,
using the discrete GPU for that lead to an important power consumption
(4 to 8W), heat increase, and fan noise.

With this patch, ffplay will use the integrated GPU (i.e. the Intel
one), instead of the discrete GPU (i.e. the AMD one).

Signed-off-by: Jérémy Demeule <jeremy.demeule@gmail.com>
---
fftools/ffplay.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/fftools/ffplay.c b/fftools/ffplay.c
index 5212ad053e..e766d502a8 100644
--- a/fftools/ffplay.c
+++ b/fftools/ffplay.c
@@ -3712,6 +3712,9 @@ int main(int argc, char **argv)
#endif
        window = SDL_CreateWindow(program_name, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, default_width, default_height, flags);
        SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "linear");
+#if SDL_VERSION_ATLEAST(2,28,3)
+        SDL_SetHint(SDL_HINT_RENDER_METAL_PREFER_LOW_POWER_DEVICE, "true");
+#endif
        if (window) {
            renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC);
            if (!renderer) {
-- 
2.39.0

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-09-04 21:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-04 21:58 [FFmpeg-devel] [PATCH] metal: Add hint to select low power device instead of the default one Jérémy Demeule

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git