| Summary: | The recent changes in drivers/gpu/drm/drm_fb_helper.c (Linux kernel) broke FB_SetVideoMode() for DRM Framebuffers | ||
|---|---|---|---|
| Product: | SDL | Reporter: | |
| Component: | video | Assignee: | Ozkan Sezer <sezeroz> |
| Status: | ASSIGNED --- | QA Contact: | Sam Lantinga <slouken> |
| Severity: | critical | ||
| Priority: | P2 | CC: | sezeroz |
| Version: | 1.2.15 | ||
| Hardware: | All | ||
| OS: | Linux | ||
|
Description
mail
2018-12-20 11:36:25 UTC
AFAICS, that kernel change forbids bits_per_pixel change.
So, how about ignoring the caller's bpp request, something
like the below one-liner? (completely untested !)
diff --git a/src/video/fbcon/SDL_fbvideo.c b/src/video/fbcon/SDL_fbvideo.c
--- a/src/video/fbcon/SDL_fbvideo.c
+++ b/src/video/fbcon/SDL_fbvideo.c
@@ -1031,11 +1031,11 @@ static SDL_Surface *FB_SetVideoMode(_THI
if ( (vinfo.xres != width) || (vinfo.yres != height) ||
(vinfo.bits_per_pixel != bpp) || (flags & SDL_DOUBLEBUF) ) {
vinfo.activate = FB_ACTIVATE_NOW;
vinfo.accel_flags = 0;
- vinfo.bits_per_pixel = bpp;
+ /*vinfo.bits_per_pixel = bpp;*/
vinfo.xres = width;
vinfo.xres_virtual = width;
vinfo.yres = height;
if ( flags & SDL_DOUBLEBUF ) {
vinfo.yres_virtual = height*2;
It doesn't works in my case. By the way, requested pixel depth the same as actual framebuffer pixel depth. This bug somehow connected to double buffering. With disabled double buffering the segmentation fault disappears, but the picture turns to mess. The second patch that works for me:
diff -ru SDL-1.2.15_orig/src/video/fbcon/SDL_fbvideo.c SDL-1.2.15/src/video/fbcon/SDL_fbvideo.c
--- SDL-1.2.15_orig/src/video/fbcon/SDL_fbvideo.c 2012-01-19 10:30:06.000000000 +0400
+++ SDL-1.2.15/src/video/fbcon/SDL_fbvideo.c 2018-12-27 21:59:42.853402012 +0300
@@ -1044,9 +1044,6 @@
}
vinfo.xoffset = 0;
vinfo.yoffset = 0;
- vinfo.red.length = vinfo.red.offset = 0;
- vinfo.green.length = vinfo.green.offset = 0;
- vinfo.blue.length = vinfo.blue.offset = 0;
vinfo.transp.length = vinfo.transp.offset = 0;
if ( ! choose_fbmodes_mode(&vinfo) ) {
choose_vesa_mode(&vinfo);
Actual values are:
vinfo.red.length = 8
vinfo.green.length = 8
vinfo.blue.length = 8
vinfo.red.offset = 16
vinfo.green.offset = 8
vinfo.blue.offset = 0
(In reply to mail from comment #3) > The second patch that works for me: > diff -ru SDL-1.2.15_orig/src/video/fbcon/SDL_fbvideo.c > SDL-1.2.15/src/video/fbcon/SDL_fbvideo.c > --- SDL-1.2.15_orig/src/video/fbcon/SDL_fbvideo.c 2012-01-19 > 10:30:06.000000000 +0400 > +++ SDL-1.2.15/src/video/fbcon/SDL_fbvideo.c 2018-12-27 > 21:59:42.853402012 +0300 > @@ -1044,9 +1044,6 @@ > } > vinfo.xoffset = 0; > vinfo.yoffset = 0; > - vinfo.red.length = vinfo.red.offset = 0; > - vinfo.green.length = vinfo.green.offset = 0; > - vinfo.blue.length = vinfo.blue.offset = 0; > vinfo.transp.length = vinfo.transp.offset = 0; > if ( ! choose_fbmodes_mode(&vinfo) ) { > choose_vesa_mode(&vinfo); > > Actual values are: > vinfo.red.length = 8 > vinfo.green.length = 8 > vinfo.blue.length = 8 > vinfo.red.offset = 16 > vinfo.green.offset = 8 > vinfo.blue.offset = 0 Sam, Ryan: Is this correct? Why did we need to zero those members? PING: Is the patch from comment #3 correct? Note: Paul Cercueil <paul@crapouillou.net> reports that: ".. can't reproduce , fbdev has been working fine on top of DRM in our case." |