Andrew Geissler | d583833 | 2022-05-27 11:33:10 -0500 | [diff] [blame] | 1 | From 14ad91658fd296e34bb9e833281e72c871bfb189 Mon Sep 17 00:00:00 2001 |
| 2 | From: Alexander Kanavin <alex@linutronix.de> |
| 3 | Date: Tue, 3 May 2022 12:31:50 +0200 |
| 4 | Subject: [PATCH] video: restore ability to disable fb accel via hint |
| 5 | |
| 6 | Somewhere in code refactoring between .20 and .22 this check |
| 7 | was lost, and so the hint had no effect anymore. |
| 8 | |
| 9 | Upstream-Status: Submitted [https://github.com/libsdl-org/SDL/pull/5611] |
| 10 | Signed-off-by: Alexander Kanavin <alex@linutronix.de> |
| 11 | --- |
| 12 | src/video/SDL_video.c | 8 ++++++++ |
| 13 | 1 file changed, 8 insertions(+) |
| 14 | |
| 15 | diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c |
| 16 | index 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 | -- |
| 35 | 2.30.2 |
| 36 | |