We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 3982

Summary: Raspberry Pi window contents crooked (slightly rotated)
Product: SDL Reporter: Eric wing <ewmailing>
Component: renderAssignee: Sam Lantinga <slouken>
Status: NEW --- QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: bandock666
Version: 2.0.7   
Hardware: ARM   
OS: Linux   
Attachments: screenshot of crooked window
test program

Description Eric wing 2017-11-27 22:10:15 UTC
Created attachment 3104 [details]
screenshot of crooked window

I think this is a Raspberry Pi and not really SDL's fault, but I'm not completely sure so I'm filing it just in case.

On a new installation of Raspbian Stretch on a Pi 2, I enabled the GL Full KMS driver.
I built SDL 2.0.7 and ran a few simple programs that use the SDL 2D renderer.

I discovered that the contents in the window are slightly crooked...rotated counterclockwise by maybe a degree or two. I am attaching a screenshot.


The background clear color is cyan. I draw a purple rectangle the size of the window first. You should not see the background, but you can see a little sliver of cyan on the bottom-right corner and the left-bottom corner.

I then draw a red rectangle on top and if you look closely at the edges, you can see the lines are not straight.

Then I draw some text, and if you look closely, you can also see that it is not straight.


I also built SDL with the OpenGL ES driver that works without X11 and takes up the full screen. It does not have this problem. So I believe the problem is with the experimental OpenGL Full KMS driver.

I am also attaching a simple SDL program in case you want to try it.


I filed this same bug at
https://github.com/raspberrypi/linux/issues/2291
hoping Pi people might be able to fix it.
Comment 1 Eric wing 2017-11-27 22:10:59 UTC
Created attachment 3105 [details]
test program
Comment 2 Joshua Moss 2018-02-24 04:45:33 UTC
I think I might've figured it out at least to a degree.  I have a staunch feeling there might be floating point errors going on.  I just learned about this because I started to use SDL_RenderSetIntegerScale on my personal project (which benefited greatly).  When I just ran a new test build on my Raspberry Pi 3 after compiling; I noticed that it wasn't as crooked (in fact, stopped being more crooked as more data got added).  Without integer scale enabled, it's a complete mess (which might be floating point errors).

I haven't looked at the code yet (though I recently got a hold of the latest source build for 2.0.8), but figured I might give a clue from my own experience.