blob: fc74d30556ad31718570dd48aba2a7b3d276d0a0 [file] [log] [blame]
Andrew Geisslerd5838332022-05-27 11:33:10 -05001From 14ad91658fd296e34bb9e833281e72c871bfb189 Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex@linutronix.de>
3Date: Tue, 3 May 2022 12:31:50 +0200
4Subject: [PATCH] video: restore ability to disable fb accel via hint
5
6Somewhere in code refactoring between .20 and .22 this check
7was lost, and so the hint had no effect anymore.
8
9Upstream-Status: Submitted [https://github.com/libsdl-org/SDL/pull/5611]
10Signed-off-by: Alexander Kanavin <alex@linutronix.de>
11---
12 src/video/SDL_video.c | 8 ++++++++
13 1 file changed, 8 insertions(+)
14
15diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c
16index 93c803e..cbe7616 100644
17--- a/src/video/SDL_video.c
18+++ b/src/video/SDL_video.c
19@@ -2503,6 +2503,14 @@ SDL_CreateWindowFramebuffer(SDL_Window * window)
20 if (!_this->checked_texture_framebuffer) {
21 SDL_bool attempt_texture_framebuffer = SDL_TRUE;
22
23+ /* See if the user or application wants to specifically disable the framebuffer */
24+ const char *hint = SDL_GetHint(SDL_HINT_FRAMEBUFFER_ACCELERATION);
25+ if (hint) {
26+ if (*hint == '0' || SDL_strcasecmp(hint, "false") == 0) {
27+ attempt_texture_framebuffer = SDL_FALSE;
28+ }
29+ }
30+
31 if (_this->is_dummy) { /* dummy driver never has GPU support, of course. */
32 attempt_texture_framebuffer = SDL_FALSE;
33 }
34--
352.30.2
36