From: "Jérémy Demeule" <jeremy.demeule@gmail.com>
To: ffmpeg-devel@ffmpeg.org
Subject: [FFmpeg-devel] [PATCH] metal: Add hint to select low power device instead of the default one
Date: Mon, 4 Sep 2023 23:58:13 +0200
Message-ID: <5B54A9AC-BC65-4159-8CE4-B3A1214A8454@gmail.com> (raw)
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".
reply other threads:[~2023-09-04 21:58 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=5B54A9AC-BC65-4159-8CE4-B3A1214A8454@gmail.com \
--to=jeremy.demeule@gmail.com \
--cc=ffmpeg-devel@ffmpeg.org \
/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
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