Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vc4 does not use full display #150

Open
jonas-hagen opened this issue Apr 24, 2019 · 9 comments
Open

vc4 does not use full display #150

jonas-hagen opened this issue Apr 24, 2019 · 9 comments

Comments

@jonas-hagen
Copy link

I try to use a 1440x2560 display with the Raspberry Pi model 3B+. The display works in portrait mode (hdmi_timings=1440 1 70 35 45 2560 1 12 2 2 0 0 0 50 0 204792000 3).

With the legacy driver, the display works as expected at full resolution. When I switch to the vc4-fkms driver, only the middle third of the display is used at an aspect of 4:3. Is it possible that the vc4 driver somehow can not handle portrait mode framebuffers (framebuffer_width=1440 framebuffer_height=2560)?

@lategoodbye
Copy link

Could you please at least provide the kernel version / tree you are using?

@jonas-hagen
Copy link
Author

jonas-hagen commented Apr 24, 2019

Sorry, completely forgot to mention. I am using the latest Raspberry Pi build

uname -a
Linux raspberrypi 4.19.36-v7+ #1212 SMP Tue Apr 23 12:28:46 BST 2019 armv7l GNU/Linux

I could try to build a kernel and try again. With which kernel version (which branch of this repo) should I try?

@anholt
Copy link
Owner

anholt commented Apr 24, 2019

In drivers/gpu/drm/vc4/vc4_kms.c you'll find max_width/max_height settings. You can try bumping those up to 4095 -- I see enough bits in SCALER_DISPCTRLX_WIDTH/HEIGHT and SCALER_POS1_SCL_WIDTH for that. >1920 widths may take adjusting the COB allocations between the HVS channels.

jonas-hagen added a commit to jonas-hagen/linux that referenced this issue Apr 25, 2019
@jonas-hagen
Copy link
Author

jonas-hagen commented Apr 25, 2019

I tried increasing the max_ settings just now (see patch ) and it seems to work! At least I can use the full screen and glxgears runs smoothly. I will now make further tests with full screen opengl.
Thanks!

Maybe you would like to issue a warning when hitting the limit?

@jonas-hagen
Copy link
Author

In the virtual terminal (boot screen) the full screen is used from top to bottom, also with startx I get a fullscreen display and can move the mouse from top to bottom. But as soon as I try to start glxgears (or other openGL applications) in fullscreen mode or appropriate dimensions, the screen stays black or seems to be limited to approx. 1900 pixels in height.
Could you elaborate a bit on what you mean by ">1920 widths may take adjusting the COB allocations between the HVS channels."?

@anholt
Copy link
Owner

anholt commented Apr 25, 2019

vc4 has a 3D rendering texture size limit of 2048. You'll start getting OpenGL errors if you try to exceed that (as X11 might do if we're missing checks)

@jonas-hagen
Copy link
Author

Ok thank you for pointing this out. To my understanding (from reading the code) the view port is limited to 4096 pixels in width and height because of fixed point arithmetic, which is large enough. Texture size limits should not matter when creating a window. Or do I miss something?

Anyways, thanks for your help! I would be motivated to test any ideas you have to overcome this limit, but if its more involved or not a priority, you can close the issue.

@anholt
Copy link
Owner

anholt commented Apr 30, 2019

If you're using X11, rendering your windows will involve texturing for various operations, so it is a limit on screen size.

@anholt
Copy link
Owner

anholt commented May 2, 2019

I'd love to review someone's (tested) patches for >2k display on vc4, regardless of whether you can do GL with it. I probably won't have time to work on that, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants