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

Texture alignment and layout problem #53

Open
yuq opened this issue May 2, 2018 · 10 comments
Open

Texture alignment and layout problem #53

yuq opened this issue May 2, 2018 · 10 comments

Comments

@yuq
Copy link
Owner

yuq commented May 2, 2018

Dump the mali 260x260 FBO draw with:
https://github.com/yuq/gfx/tree/master/x11/fbo

Output:
https://gist.github.com/yuq/a17350bd5bf91dbeba24e9deeda9a829
https://gist.github.com/yuq/a32a5ed635bfffe27c49b936a06c4887

Seems the texture memory will be reused and no copy:

  1. frame 0 output to 0x10100000
  2. frame 1 get texture from 0x10100000
  3. 0x10100000 memory not changed from the end of frame 0 to beginning of frame 1

The memory content at 0x10100000 is not linear and the layout field in pp frame wb0 and texture desc are set. Maybe some tiled format or mipmap?

Need more investigation.

@anarsoul
Copy link
Contributor

anarsoul commented May 3, 2018

Looks like a tiled format.

@yuq
Copy link
Owner Author

yuq commented May 13, 2018

Help from Alyssa:
"
Utgard and Midgard have identical formats for tiled textures. So, I
modified the limare code for texture tiling to improve the flexibility
and maybe performance. It might be useful for lima.
https://gitlab.freedesktop.org/panfrost/panloader/blob/develop/trans/limare-swizzle.c
"

@anarsoul
Copy link
Contributor

We also need untiling routine. Basically we need to plug tiling/untiling routines into lima_transfer_map() and lima_transfer_unmap(). Scanout buffer should be kept untiled, but it cannot be used as texture later (at least not without a copy).

@yuq
Copy link
Owner Author

yuq commented May 14, 2018

Yes, we need it anyway. If mali GPU has a format converter DMA, we can use it too. I see in mali kernel driver there's DMA IOREG but never used.

I still doubt that mali doesn't support aligned linear texture. Maybe only because we haven't found where's the setting. I'm thinking if there's a case that mali binary driver has to use an aligned linear texture so that we can write a test for dump.

@anarsoul
Copy link
Contributor

anarsoul commented May 14, 2018

Tiled textures should be faster, so we'll have to support them anyway. As for aligned linear textures - limare comment says that proprietary driver uses linear format for large textures. So could you try running your demo with 1300x1300 texture?

@yuq
Copy link
Owner Author

yuq commented May 14, 2018

Tried 1300x1300, same tiled texture. I think I have to setup a mali driver supporting gbm interfaces for this.

@anarsoul
Copy link
Contributor

anarsoul commented May 14, 2018

@yuq could you try setting layout to 1 or 2 in lima_update_tex_desc() in lima? I don't have access to my setup atm to test.

@yuq
Copy link
Owner Author

yuq commented May 14, 2018

What's the purpose of this? I'm investigating the aligned linear texture desc setup, not the tiled texture desc setup.

@anarsoul
Copy link
Contributor

@yuq layout = 3 enables tiling, and looks like pitch is aligned to 16 in this case. layout = 0 is linear, and pitch equals width. I wonder if layout = 1 or layout = 2 is linear texture with aligned pitch.

@shadeslayer
Copy link

I tried running weston and Plasma with layout = 1 and 2 ( as well as setting flag0 to both 0 or 1 ).

With Weston, on all 4 configurations, I got nothing on the screen.
With Plasma, on all 4 configurations, I got a garbled cursor on the screen.

So perhaps linear textures don't work?

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